fix: generate the webmin, code-server and copyparty logins; leave existing installs alone

webmin set root/root, coder-code-server ran without authentication as root on 0.0.0.0:8680, and copyparty took community-scripts.org when the password prompt was left empty. New installs now get a random password in ~/<app>.creds. The filebrowser and quantum updates no longer touch existing installs, and the FileBrowser database is no longer world-readable.
This commit is contained in:
MickLesk
2026-11-09 15:36:10 +01:00
parent db2721208a
commit fdace325ad
5 changed files with 19 additions and 39 deletions
+7 -3
View File
@@ -85,12 +85,16 @@ function install() {
mkdir -p "${HOME}/.config/code-server/"
if [ "$preexisting_config" = false ]; then
CS_PASS=$(random_password 20)
cat <<EOF >"$config_path"
bind-addr: 0.0.0.0:8680
auth: none
password:
auth: password
password: ${CS_PASS}
cert: false
EOF
chmod 600 "$config_path"
echo -e "Coder Code Server\nPassword: ${CS_PASS}" >~/coder-code-server.creds
chmod 600 ~/coder-code-server.creds
fi
systemctl enable -q --now code-server@"$USER"
systemctl restart code-server@"$USER"
@@ -111,7 +115,7 @@ EOF
msg_ok "Created update script (/usr/local/bin/update_coder-code-server)"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8680${CL} \n"
${BL}http://${IP}:8680${CL} (password in ~/coder-code-server.creds)\n"
}
# ==============================================================================