(ctx context.Context)
| 144 | } |
| 145 | |
| 146 | func (c *commandServerStart) serverStartOptions(ctx context.Context) (*server.Options, error) { |
| 147 | authn, err := c.getAuthenticator(ctx) |
| 148 | if err != nil { |
| 149 | return nil, errors.Wrap(err, "unable to initialize authentication") |
| 150 | } |
| 151 | |
| 152 | uiPreferencesFile := c.uiPreferencesFile |
| 153 | if uiPreferencesFile == "" { |
| 154 | uiPreferencesFile = filepath.Join(filepath.Dir(c.svc.repositoryConfigFileName()), "ui-preferences.json") |
| 155 | } |
| 156 | |
| 157 | return &server.Options{ |
| 158 | ConfigFile: c.svc.repositoryConfigFileName(), |
| 159 | ConnectOptions: c.co.toRepoConnectOptions(), |
| 160 | RefreshInterval: c.serverStartRefreshInterval, |
| 161 | MaxConcurrency: c.serverStartMaxConcurrency, |
| 162 | Authenticator: authn, |
| 163 | Authorizer: auth.DefaultAuthorizer(), |
| 164 | AuthCookieSigningKey: c.serverAuthCookieSingingKey, |
| 165 | UIUser: c.sf.serverUsername, |
| 166 | ServerControlUser: c.serverControlUsername, |
| 167 | LogRequests: c.logServerRequests, |
| 168 | PasswordPersist: c.svc.passwordPersistenceStrategy(), |
| 169 | UIPreferencesFile: uiPreferencesFile, |
| 170 | UITitlePrefix: c.uiTitlePrefix, |
| 171 | PersistentLogs: c.persistentLogs, |
| 172 | |
| 173 | DebugScheduler: c.debugScheduler, |
| 174 | MinMaintenanceInterval: c.minMaintenanceInterval, |
| 175 | DisableCSRFTokenChecks: c.disableCSRFTokenChecks, |
| 176 | |
| 177 | EnableErrorNotifications: c.svc.enableErrorNotifications(), |
| 178 | NotifyTemplateOptions: c.svc.notificationTemplateOptions(), |
| 179 | }, nil |
| 180 | } |
| 181 | |
| 182 | func (c *commandServerStart) initRepositoryPossiblyAsync(ctx context.Context, srv *server.Server) error { |
| 183 | initialize := func(ctx context.Context) (repo.Repository, error) { |
no test coverage detected