From af9596fbc412321eda0f3a6947461f49bfa4c5d3 Mon Sep 17 00:00:00 2001 From: LeeCQ Date: Sat, 2 Mar 2024 22:28:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/alist-sync.yaml | 3 ++- .gitignore | 1 + tools/create_storage.py | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/alist-sync.yaml b/.github/workflows/alist-sync.yaml index 82b0c9e..c1af81b 100644 --- a/.github/workflows/alist-sync.yaml +++ b/.github/workflows/alist-sync.yaml @@ -75,4 +75,5 @@ jobs: cat > alist-backup-config.json << EOF ${{ secrets.ALIST_BACKUP_CONFIG }} EOF - python3 -m alist_sync sync -c $SYNC_CONFIG + ./bootstrap.sh main test-config + ./bootstrap.sh main sync -c alist-backup-config.json diff --git a/.gitignore b/.gitignore index 0a8f42b..77eb48e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ local_test* tmp/ config.json config.yaml +.DS_Store .alist-sync-cache/ alist_sync/.alist-sync-cache/ diff --git a/tools/create_storage.py b/tools/create_storage.py index 411234d..1dedfef 100644 --- a/tools/create_storage.py +++ b/tools/create_storage.py @@ -18,7 +18,7 @@ alist_config = json.loads(PROJECT_ROOT.joinpath("alist/data/config.json").read_text()) alist_port = alist_config["scheme"]["http_port"] -admin_password = os.getenv("_ALIST_ADMIN_PASSWORD", "123456") +admin_password = os.getenv("_ALIST_ADMIN_PASSWORD", ) or "123456" remote_url = os.getenv("_ALIST_BACKUP_URL") remote_username = os.getenv("_ALIST_BACKUP_USERNAME") @@ -30,9 +30,11 @@ password=admin_password, ) +print("local_client =", admin_password) # 如果--, 删除全部存储器 -if os.getenv("_RELOAD_STORAGE"): - for i in local_client.admin_storage_list().data.content: +print("_RELOAD_STORAGE =", os.getenv("_RELOAD_STORAGE")) +if os.getenv("_RELOAD_STORAGE") == "true": + for i in local_client.admin_storage_list().data.content or []: local_client.admin_storage_delete(i.id) # 创建本地存储器