diff --git a/VERSION b/VERSION index 75274d8..1f77169 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.12 +0.4.13 diff --git a/source_clean/VERSION b/source_clean/VERSION index 75274d8..1f77169 100644 --- a/source_clean/VERSION +++ b/source_clean/VERSION @@ -1 +1 @@ -0.4.12 +0.4.13 diff --git a/source_clean/deploy.sh b/source_clean/deploy.sh index 98c4b81..231ded2 100755 --- a/source_clean/deploy.sh +++ b/source_clean/deploy.sh @@ -97,11 +97,11 @@ done # -- 强制写入管理员密码 -- info "同步管理员密码..." sleep 3 -docker exec CloudSearch_App node -e ' +docker exec -e ADMIN_PASSWORD="$ADMIN_PASSWORD" CloudSearch_App node -e ' var bcrypt = require("bcryptjs"); var Database = require("better-sqlite3"); var db = new Database("/data/database.sqlite"); -var hash = bcrypt.hashSync("'"${ADMIN_PASSWORD}"'", 10); +var pw = process.env.ADMIN_PASSWORD || ""; var hash = bcrypt.hashSync(pw, 10); var existing = db.prepare("SELECT id FROM admins WHERE username = ?").get("admin"); if (existing) { db.prepare("UPDATE admins SET password_hash = ? WHERE username = ?").run(hash, "admin"); diff --git a/source_clean/src/database/database.ts b/source_clean/src/database/database.ts index a5ee697..84e3593 100755 --- a/source_clean/src/database/database.ts +++ b/source_clean/src/database/database.ts @@ -230,8 +230,8 @@ function migrateCloudConfigs(db: Database.Database): void { created_at TEXT NOT NULL DEFAULT (datetime('now', 'localtime')), updated_at TEXT NOT NULL DEFAULT (datetime('now', 'localtime')) ); - INSERT INTO cloud_configs_v2 (id, cloud_type, cookie, nickname, is_active, storage_used, storage_total, checkin_status, last_checkin_at, checkin_message, consecutive_failures, last_used_at, total_saves, created_at, updated_at) - SELECT id, cloud_type, cookie, nickname, is_active, storage_used, storage_total, COALESCE(checkin_status,'none'), last_checkin_at, checkin_message, COALESCE(consecutive_failures,0), last_used_at, COALESCE(total_saves,0), created_at, updated_at FROM cloud_configs; + INSERT INTO cloud_configs_v2 (id, cloud_type, cookie, cloud_type_uid, cookie_uid, nickname, is_active, storage_used, storage_total, checkin_status, last_checkin_at, checkin_message, consecutive_failures, last_used_at, total_saves, created_at, updated_at) + SELECT id, cloud_type, cookie, cloud_type_uid, cookie_uid, nickname, is_active, storage_used, storage_total, COALESCE(checkin_status,'none'), last_checkin_at, checkin_message, COALESCE(consecutive_failures,0), last_used_at, COALESCE(total_saves,0), created_at, updated_at FROM cloud_configs; DROP TABLE cloud_configs; ALTER TABLE cloud_configs_v2 RENAME TO cloud_configs; `); @@ -257,6 +257,7 @@ function migrateCloudConfigs(db: Database.Database): void { if (!hasPromotionAccount) { db.exec("ALTER TABLE cloud_configs ADD COLUMN promotion_account TEXT DEFAULT NULL"); console.log('[DB] cloud_configs migration: promotion_account column added'); +} // v0.3.5: notify_config for per-cloud push notification settings const hasNotifyConfig = db.prepare("SELECT sql FROM sqlite_master WHERE name='cloud_configs' AND sql LIKE '%notify_config%'").get();