Added skeleton for basic admin auth system

This commit is contained in:
2026-05-16 17:01:34 +02:00
parent d5c4cfa9d0
commit 4d53a6b471
9 changed files with 179 additions and 12 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ type Config struct {
func Load(path string) Config {
configData := Config{
SiteName: "Unnamed Download Listing",
Port: "8080",
Port: ":8080",
DataDir: "data",
}
@@ -46,7 +46,7 @@ func Save(path string, configData Config) error {
if configData.AdminUser != "" {
file.WriteString("admin_user = \"" + configData.AdminUser + "\"\n")
file.WriteString("admin_password_hash = \"" + configData.AdminPasswordHash + "\"\n")
file.WriteString("# This admin_password_hash above is a hashed password, not your actual\"")
file.WriteString("# This admin_password_hash above is a hashed password, not your actual\n")
file.WriteString("# written password. You can't change your admin password here.\n")
file.WriteString("# If you've lost your password, delete admin_user and admin_hash\n")
file.WriteString("# from this file and restart the app to create a new account.\n")