v0.84.0: catalog-driven initial_credentials — read an app's auto-generated first-login from a file and show it on the app page

This commit is contained in:
2026-06-26 11:00:06 +02:00
parent 49f6dbf847
commit 1705d71dd5
7 changed files with 341 additions and 0 deletions
+22
View File
@@ -25,6 +25,28 @@ type Metadata struct {
OptionalConfig []OptionalConfigGroup `yaml:"optional_config" json:"optional_config"`
HealthCheck *HealthCheckConfig `yaml:"healthcheck,omitempty" json:"healthcheck,omitempty"`
Integrations []IntegrationDef `yaml:"integrations,omitempty" json:"integrations,omitempty"`
// InitialCreds: for apps that auto-generate a first-login credential into a file inside the
// container (e.g. Crafty's default-creds.txt). The controller reads + parses that file live and
// surfaces it on the app page, so the customer never has to dig through logs. Optional.
InitialCreds *InitialCredentials `yaml:"initial_credentials,omitempty" json:"initial_credentials,omitempty"`
}
// InitialCredentials tells the controller how to extract an app's auto-generated first-login
// credential from a file inside the running container. The file path is catalog-defined (trusted).
// Verification stays catalog-driven so any future self-seeding app can reuse the mechanism.
type InitialCredentials struct {
File string `yaml:"file" json:"file"` // path INSIDE the container
Format string `yaml:"format" json:"format"` // "json" | "regex" | "plain"
// Container overrides which container to read from; empty → the stack's main container.
Container string `yaml:"container,omitempty" json:"container,omitempty"`
// json format: which keys hold the username/password (password_key required; username optional).
UsernameKey string `yaml:"username_key,omitempty" json:"username_key,omitempty"`
PasswordKey string `yaml:"password_key,omitempty" json:"password_key,omitempty"`
// regex format: patterns whose first capture group is the value (password_pattern required).
UsernamePattern string `yaml:"username_pattern,omitempty" json:"username_pattern,omitempty"`
PasswordPattern string `yaml:"password_pattern,omitempty" json:"password_pattern,omitempty"`
// Note is shown alongside the credential (e.g. "initial password, change it after first login").
Note string `yaml:"note,omitempty" json:"note,omitempty"`
}
// AppInfo holds detailed app information for the info page.