Skip to content

Commit

Permalink
drop symlink support as unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
marat2509 authored Mar 13, 2024
1 parent 29b5ef3 commit cb74dd0
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ matrix.image }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix={{branch}}-
type=sha,prefix={{branch}}-,enable=${{ startsWith(github.ref, 'refs/heads/') }}
type=ref,event=branch
- name: Build and push Docker image
id: build-and-push
Expand Down
5 changes: 2 additions & 3 deletions nod32ms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ unrar_binary = "C:\unrar.exe"
debug_update = 0

; Method for linking files
; hardlink_php - link() php function for create hard link
; symlink_php - symlink() php function for create symbolic link
; hardlink - link() php function for create hard link, needs UAC on Windows
; copy - copy() php function for create copy of file, default method
link_method = "hardlink_php"
link_method = "hardlink"

; Generate index.html file and put it into the root of www directory.
; It will have: correct database version, size and date of successful update.
Expand Down
6 changes: 1 addition & 5 deletions worker/core/inc/classes/Mirror.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,14 +650,10 @@ static public function create_links($dir, $new_files)
if (!file_exists($res)) mkdir($res, 0755, true);

switch (Config::get('SCRIPT')['link_method']) {
case 'hardlink_php':
case 'hardlink':
link($result, $path);
Log::write_log(Language::t("Created hard link for %s", basename($array['file'])), 3, static::$version);
break;
case 'symlink_php':
symlink($result, $path);
Log::write_log(Language::t("Created symbolic link for %s", basename($array['file'])), 3, static::$version);
break;
case 'copy':
default:
copy($result, $path);
Expand Down
1 change: 0 additions & 1 deletion worker/core/inc/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
@define('KEY_FILE_INVALID', 'nod_keys.invalid');
@define('LOG_FILE', 'nod32ms.log');
@define('SUCCESSFUL_TIMESTAMP', 'nod_lastupdate');
@define('LINKTEST', 'nod_linktest');
@define('DATABASES_SIZE', 'nod_databases_size');


Expand Down
1 change: 0 additions & 1 deletion worker/core/langpacks/en.lng
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Downloading file %s from %s...
Downloading %d files
Mirror for %s initiliazed with update_file %s
Created hard link for %s
Created symbolic link for %s
Copied file %s
Run script %s
Total working time: %s
Expand Down
1 change: 0 additions & 1 deletion worker/core/langpacks/ru.lng
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
Загрузка %d файлов
Зеркало для %s инициализировано с помощью update_file %s
Создана жесткая ссылка для %s
Создана символическая ссылка для %s
Скопирован файл %s
Запуск скрипта %s
Общее время работы: %s
Expand Down
1 change: 0 additions & 1 deletion worker/core/langpacks/ukr.lng
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
Завантаження %d файлів
Дзеркало для %s ініціалізовано за допомогою update_file %s
Створено жорстке посилання для %s
Створено символічне посилання для %s
Скопійовано файл %s
Запуск скрипта %s
Загальний час роботи: %s
Expand Down
10 changes: 9 additions & 1 deletion worker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,12 @@ if [ -z "${UPDATE_INTERVAL}" ]; then
UPDATE_INTERVAL=3600
fi

watch -tn $UPDATE_INTERVAL "php /app/update.php"
while true; do
php /app/update.php
if [ ! $? -eq 0 ]; then
echo "E: Run script failed, exitting..."
exit 1
else
sleep $UPDATE_INTERVAL
fi
done

0 comments on commit cb74dd0

Please sign in to comment.