add a setup screen to create the first admin user

If you prefer to auto-create the first admin you can enable the
"create_default_admin" configuration key and SFTPGo will work as before.

You can also create the first admin by loading initial data: now you can
set both username and password, before you could only change the password
This commit is contained in:
Nicola Murino
2021-05-14 19:21:15 +02:00
parent 0540b8780e
commit f2b93c0402
20 changed files with 430 additions and 36 deletions

View File

@@ -60,6 +60,7 @@ func TestMain(m *testing.M) {
logFilePath := filepath.Join(configDir, "common_test.log")
logger.InitLogger(logFilePath, 5, 1, 28, false, zerolog.DebugLevel)
os.Setenv("SFTPGO_DATA_PROVIDER__CREATE_DEFAULT_ADMIN", "1")
err := config.LoadConfig(configDir, "")
if err != nil {
logger.ErrorToConsole("error loading configuration: %v", err)