diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index d9f4d9c..6bae89c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -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 diff --git a/nod32ms.conf b/nod32ms.conf index a2bbf9a..49c2e35 100644 --- a/nod32ms.conf +++ b/nod32ms.conf @@ -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. diff --git a/worker/core/inc/classes/Mirror.class.php b/worker/core/inc/classes/Mirror.class.php index 7737fd0..47fa9c6 100644 --- a/worker/core/inc/classes/Mirror.class.php +++ b/worker/core/inc/classes/Mirror.class.php @@ -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); diff --git a/worker/core/inc/init.php b/worker/core/inc/init.php index 3833f6a..5eff357 100644 --- a/worker/core/inc/init.php +++ b/worker/core/inc/init.php @@ -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'); diff --git a/worker/core/langpacks/en.lng b/worker/core/langpacks/en.lng index a654895..ce1250e 100644 --- a/worker/core/langpacks/en.lng +++ b/worker/core/langpacks/en.lng @@ -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 diff --git a/worker/core/langpacks/ru.lng b/worker/core/langpacks/ru.lng index 6db9f9c..3257dbe 100644 --- a/worker/core/langpacks/ru.lng +++ b/worker/core/langpacks/ru.lng @@ -17,7 +17,6 @@ Загрузка %d файлов Зеркало для %s инициализировано с помощью update_file %s Создана жесткая ссылка для %s -Создана символическая ссылка для %s Скопирован файл %s Запуск скрипта %s Общее время работы: %s diff --git a/worker/core/langpacks/ukr.lng b/worker/core/langpacks/ukr.lng index 2e4a985..97b53ac 100644 --- a/worker/core/langpacks/ukr.lng +++ b/worker/core/langpacks/ukr.lng @@ -17,7 +17,6 @@ Завантаження %d файлів Дзеркало для %s ініціалізовано за допомогою update_file %s Створено жорстке посилання для %s -Створено символічне посилання для %s Скопійовано файл %s Запуск скрипта %s Загальний час роботи: %s diff --git a/worker/entrypoint.sh b/worker/entrypoint.sh index e595ad0..9fb1ebc 100755 --- a/worker/entrypoint.sh +++ b/worker/entrypoint.sh @@ -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