mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
feat(backend,frontend): add Web UI for configuring OpenCode server Basic Auth password
Allow administrators to set and clear the managed OpenCode server password from the Settings UI without requiring container or environment variable changes. Passwords are encrypted before database persistence and never returned to the frontend. The server manager resolves the password dynamically at restart time, falling back to the env var if no stored password exists. - Add system_settings table migration (v12) - Add SettingsService methods for encrypted password storage - Add GET/PATCH /api/settings/opencode-server-auth routes - Make OpenCodeServerManager resolve password dynamically from DB - Add frontend API methods, React Query hook, and auth settings component
This commit is contained in:
1 parent
efae3b86c1
commit
954bc60ddb
13 files changed
+731
-20
No files matched your search
@@ -328,3 +328,17 @@ export const OpenCodeConfigResponseSchema = z.object({
|
||||
configs: z.array(OpenCodeConfigMetadataSchema),
|
||||
defaultConfig: OpenCodeConfigMetadataSchema.nullable(),
|
||||
});
|
||||
|
||||
export const OpenCodeServerAuthSettingsSchema = z.object({
|
||||
username: z.string().min(1),
|
||||
hasPassword: z.boolean(),
|
||||
source: z.enum(['configured', 'env', 'none']),
|
||||
});
|
||||
|
||||
export const UpdateOpenCodeServerAuthSettingsSchema = z.object({
|
||||
password: z.string().min(1).optional(),
|
||||
clearPassword: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export type OpenCodeServerAuthSettings = z.infer<typeof OpenCodeServerAuthSettingsSchema>;
|
||||
export type UpdateOpenCodeServerAuthSettings = z.infer<typeof UpdateOpenCodeServerAuthSettingsSchema>;
|
||||
Reference in new issue
Block a user