MCPcopy
hub / github.com/kopia/kopia / serverStartOptions

Method serverStartOptions

cli/command_server_start.go:146–180  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

144}
145
146func (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
182func (c *commandServerStart) initRepositoryPossiblyAsync(ctx context.Context, srv *server.Server) error {
183 initialize := func(ctx context.Context) (repo.Repository, error) {

Callers 1

runMethod · 0.95

Calls 7

getAuthenticatorMethod · 0.95
DefaultAuthorizerFunction · 0.92
toRepoConnectOptionsMethod · 0.80

Tested by

no test coverage detected