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
+23
View File
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Log in - {{ .SiteName }}</title>
</head>
<body>
<h1>Log in</h1>
{{ if .Error }}
<p><strong>{{ .Error }}</strong></p>
{{ end }}
<form method="POST" action="/login">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
<button type="submit">Log in</button>
</form>
</body>
</html>
+28
View File
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Set up your filehost</title>
</head>
<body>
<h1>Welcome! It's time to get you set up.</h1>
<p>Create your admin account to start managing your site. Consider picking a username different than 'admin' or your standard internet alias to make it harder for people to guess your admin credentials.</p>
<p>If you ever lose your credentials or your admin account is compromised, you can reset it by editing the 'config.toml' file and removing the credentials there. You can then recreate your admin account without losing your listings.</p>
{{ if .Error }}
<p><strong>{{ .Error }}</strong></p>
{{ end }}
<form method="POST" action="/setup">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
<label for="confirm">Confirm password</label>
<input type="password" id="confirm" name="confirm" required>
<button type="submit">Create account</button>
</form>
</body>
</html>