feat(oauth): add config for oauth

This commit is contained in:
Edward 2023-07-14 10:22:30 +00:00 committed by GitHub
parent bc2d05bd85
commit 0f415e2f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -74,6 +74,12 @@ subscriptions:
stripe_endpoint_secret:
standard_price_id:
oauth:
enabled: false # whether to enable oauth
provider: # one of ['github', 'microsoft', 'google']
client_id: # oauth client id
client_secret: # oauth client secret
mail:
enabled: true # whether to enable mails (used for password resets, reports, etc.)
provider: smtp # method for sending mails, currently one of ['smtp', 'mailwhale']

View File

@ -144,6 +144,13 @@ type sentryConfig struct {
SampleRateHeartbeats float32 `yaml:"sample_rate_heartbeats" default:"0.1" env:"WAKAPI_SENTRY_SAMPLE_RATE_HEARTBEATS"`
}
type oauthConfig struct {
Enabled bool `env:"WAKAPI_OAUTH_ENABLED" default:"false"`
Provider string `env:"WAKAPI_OAUTH_PROVIDER" default:"github"`
ClientId string `yaml:"client_id" env:"WAKAPI_OAUTH_CLIENT_ID"`
ClientSecret string `yaml:"client_secret" env:"WAKAPI_OAUTH_CLIENT_SECRET"`
}
type mailConfig struct {
Enabled bool `env:"WAKAPI_MAIL_ENABLED" default:"true"`
Provider string `env:"WAKAPI_MAIL_PROVIDER" default:"smtp"`
@ -178,6 +185,7 @@ type Config struct {
Server serverConfig
Subscriptions subscriptionsConfig
Sentry sentryConfig
OAuth oauthConfig
Mail mailConfig
}