Skip to content

Commit

Permalink
更新 Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-cq committed Mar 2, 2024
1 parent 69cbcdc commit af9596f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/alist-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local_test*
tmp/
config.json
config.yaml
.DS_Store

.alist-sync-cache/
alist_sync/.alist-sync-cache/
Expand Down
8 changes: 5 additions & 3 deletions tools/create_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)

# 创建本地存储器
Expand Down

0 comments on commit af9596f

Please sign in to comment.