Create default administrator account on server (closes #88) #91

Merged
luca0N merged 1 commit from dev_server_default_admin into dev 2026-08-12 21:46:53 +00:00
Owner

When running the server for the first time (i.e., if the server is started on a fresh database1), create a default administrator and print its credentials to standard output. This is needed so that the administrator can have one account to login to the server without having to manually modify the database.

  • Add unit testing
  • Generate random admin password

  1. The account is created if no other account with the username admin exists. ↩︎

When running the server for the first time (i.e., if the server is started on a fresh database[^1]), create a default administrator and print its credentials to standard output. This is needed so that the administrator can have one account to login to the server without having to manually modify the database. - [x] Add unit testing - [x] Generate random admin password [^1]: The account is created if no other account with the username `admin` exists.
luca0N self-assigned this 2026-08-10 22:46:19 +00:00
Create default administrator account on server
All checks were successful
/ Test and build server (push) Successful in 1m13s
491ef0a535
When running the server for the first time (i.e., if the server is
started on a fresh database[^1]), create a default administrator and
print its credentials to standard output.  This is needed so that the
administrator can have one account to login to the server without having
to manually modify the database.

[^1]: The account is created if no other account with the username
`admin` exists.
luca0N changed title from Create default administrator account on server to Create default administrator account on server (closes #88) 2026-08-10 22:46:34 +00:00
server/db.go Outdated
@ -149,0 +151,4 @@
func checkAdminAccount() {
defaultId := 0
defaultUsername := "admin"
defaultPassword := "admin"
Author
Owner

It'd be more secure to force the administrator to change the password upon first login, or generate a random password (even safer).

It'd be more secure to force the administrator to change the password upon first login, or generate a random password (even safer).
luca0N marked this conversation as resolved
Generate random default admin account password
All checks were successful
/ Test and build server (push) Successful in 1m8s
168945199b
During the default administrator account creation, generate a random
password by modifying some code that was used to make random session
tokens, and create some `crypto.go' unit tests for such functions.
Add unit testing for default admin creation
All checks were successful
/ Test and build server (push) Successful in 1m9s
12c006b45b
Add unit testing functions to test the default administrator account
creation functions in the server.
luca0N force-pushed dev_server_default_admin from 12c006b45b
All checks were successful
/ Test and build server (push) Successful in 1m9s
to 2d5d55d75a 2026-08-12 21:42:54 +00:00
Compare
Author
Owner

Previous force-push operation was made from 12c006b45b to 2d5d55d75a to squash all commits into one.

Previous force-push operation was made from 12c006b45b to 2d5d55d75a to squash all commits into one.
luca0N deleted branch dev_server_default_admin 2026-08-12 21:46:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
luca0N/lanbassador!91
No description provided.