This commit is contained in:
Stavros
2026-01-31 10:33:55 +02:00
parent 252ba10f48
commit 0cd3ba8236
10 changed files with 461 additions and 95 deletions

View File

@@ -45,6 +45,7 @@ func (app *BootstrapApp) Setup() error {
if app.config.Auth.SessionMaxLifetime != 0 && app.config.Auth.SessionMaxLifetime < app.config.Auth.SessionExpiry {
return fmt.Errorf("session max lifetime cannot be less than session expiry")
}
// Parse users
users, err := utils.GetUsers(app.config.Auth.Users, app.config.Auth.UsersFile)
@@ -203,6 +204,19 @@ func (app *BootstrapApp) Setup() error {
return nil
}
// If we have tailscale configured, we will listen on it
if app.services.tailscaleService.IsConfigured() {
ln, err := app.services.tailscaleService.CreateListener()
if err != nil {
return fmt.Errorf("failed to create listener: %w", err)
}
if err := router.RunListener(ln); err != nil {
tlog.App.Fatal().Err(err).Msg("Failed to start tailscale listener")
}
}
// Start server
address := fmt.Sprintf("%s:%d", app.config.Server.Address, app.config.Server.Port)
tlog.App.Info().Msgf("Starting server on %s", address)