(opts *serpent.OptionSet)
| 246 | } |
| 247 | |
| 248 | func (f *rotateFlags) attach(opts *serpent.OptionSet) { |
| 249 | *opts = append( |
| 250 | *opts, |
| 251 | serpent.Option{ |
| 252 | Flag: "postgres-url", |
| 253 | Env: "CODER_PG_CONNECTION_URL", |
| 254 | Description: "The connection URL for the Postgres database.", |
| 255 | Value: serpent.StringOf(&f.PostgresURL), |
| 256 | }, |
| 257 | serpent.Option{ |
| 258 | Name: "Postgres Connection Auth", |
| 259 | Description: "Type of auth to use when connecting to postgres.", |
| 260 | Flag: "postgres-connection-auth", |
| 261 | Env: "CODER_PG_CONNECTION_AUTH", |
| 262 | Default: "password", |
| 263 | Value: serpent.EnumOf(&f.PostgresAuth, codersdk.PostgresAuthDrivers...), |
| 264 | }, |
| 265 | serpent.Option{ |
| 266 | Flag: "new-key", |
| 267 | Env: "CODER_EXTERNAL_TOKEN_ENCRYPTION_ENCRYPT_NEW_KEY", |
| 268 | Description: "The new external token encryption key. Must be base64-encoded.", |
| 269 | Value: serpent.StringOf(&f.New), |
| 270 | }, |
| 271 | serpent.Option{ |
| 272 | Flag: "old-keys", |
| 273 | Env: "CODER_EXTERNAL_TOKEN_ENCRYPTION_ENCRYPT_OLD_KEYS", |
| 274 | Description: "The old external token encryption keys. Must be a comma-separated list of base64-encoded keys.", |
| 275 | Value: serpent.StringArrayOf(&f.Old), |
| 276 | }, |
| 277 | cliui.SkipPromptOption(), |
| 278 | ) |
| 279 | } |
| 280 | |
| 281 | func (f *rotateFlags) valid() error { |
| 282 | if f.PostgresURL == "" { |
no test coverage detected