You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(repository): add SQL repository support with multiple backends (#88)
* feat(repository): add SQL repository support with multiple backends (sqlite, postgres, mysql)
* feat(docs): add repository options for SQL backends in configuration
* fix(repository): remove deprecated SQL backend support in Run function
* docs: update repository options section for clarity and remove deprecated value
|`--repository-backend`|`REPOSITORY_BACKEND`|`local`| Storage backend for OAuth state. Supported values: `local` (embedded BoltDB), `sqlite`, `postgres`, or `mysql`. |
101
+
|`--repository-dsn`|`REPOSITORY_DSN`| - | Connection string passed directly to the SQL driver. Required when `--repository-backend` is `sqlite/postgres/mysql`. |
102
+
103
+
`local` uses an embedded BoltDB file under `--data-path`. SQL backends run migrations automatically via GORM; the DSN must be valid for the chosen driver (examples below). The deprecated value `sql` is no longer accepted—select the concrete driver instead.
Copy file name to clipboardExpand all lines: main.go
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,8 @@ func main() {
72
72
vartlsDirectoryURLstring
73
73
vartlsAcceptTOSbool
74
74
vardataPathstring
75
+
varrepositoryBackendstring
76
+
varrepositoryDSNstring
75
77
varexternalURLstring
76
78
vargoogleClientIDstring
77
79
vargoogleClientSecretstring
@@ -179,6 +181,8 @@ func main() {
179
181
tlsDirectoryURL,
180
182
tlsAcceptTOS,
181
183
dataPath,
184
+
repositoryBackend,
185
+
repositoryDSN,
182
186
externalURL,
183
187
googleClientID,
184
188
googleClientSecret,
@@ -216,6 +220,8 @@ func main() {
216
220
rootCmd.Flags().StringVar(&tlsDirectoryURL, "tls-directory-url", getEnvWithDefault("TLS_DIRECTORY_URL", "https://acme-v02.api.letsencrypt.org/directory"), "ACME directory URL for TLS certificates")
217
221
rootCmd.Flags().BoolVar(&tlsAcceptTOS, "tls-accept-tos", getEnvBoolWithDefault("TLS_ACCEPT_TOS", false), "Accept TLS terms of service")
218
222
rootCmd.Flags().StringVarP(&dataPath, "data-path", "d", getEnvWithDefault("DATA_PATH", "./data"), "Path to the data directory")
223
+
rootCmd.Flags().StringVar(&repositoryBackend, "repository-backend", getEnvWithDefault("REPOSITORY_BACKEND", "local"), "Repository backend to use: local, sqlite, postgres, or mysql")
224
+
rootCmd.Flags().StringVar(&repositoryDSN, "repository-dsn", getEnvWithDefault("REPOSITORY_DSN", ""), "DSN passed directly to the SQL driver (required when repository-backend is sqlite/postgres/mysql)")
219
225
rootCmd.Flags().StringVarP(&externalURL, "external-url", "e", getEnvWithDefault("EXTERNAL_URL", "http://localhost"), "External URL for the proxy")
0 commit comments