fix(filebrowser-q): migrate legacy Quantum config

This commit is contained in:
Cuptain committed 2026-11-13 23:16:29 +08:00
1 parent 19ee99b240
commit 1ce9006a9a
1 file changed
+15
+15
View File
@@ -46,6 +46,21 @@ userDefaults:
locale: "zhCN"
EOF
else
# Migrate config files generated by older package versions.
if grep -q '^ database: "' "$CONF_PATH"; then
sed -i \
-e "s/^server:$/http:\\n port: $listen_port\\nserver:/" \
-e "/^ port:/d" \
-e 's,^ database: "\(.*\)", database:\n path: "\1",' \
-e '/^auth:$/a\
methods:\
password:\
enabled: true' \
-e 's/^ adminUsername:/ adminUsername:/' \
-e 's/^ adminPassword:/ adminPassword:/' \
"$CONF_PATH"
fi
grep -q " name:" "$CONF_PATH" || sed -i "s,.*- path:.*,&\n name: \"\"," "$CONF_PATH"
sed -e "s/^ port:.*/ port: $listen_port/" \
-e "s, - path:.*, - path: \"$root_path\"," \