detached 726a7cb

fix(cli) handle unsupported sops backend and log unknown backends

commit
726a7cb1de007a282afa0141e5bb1559142a1567
author
bnema · · 2026-02-06 20:43 UTC
parent
198c878
signature
unsigned
2 files · +9 -2
M internal/adapters/in/cli/local.go +8 -2
@@ -101,10 +101,14 @@ func GetLocalServices(configPath string) (*LocalServices, error) {
101101
102102 func createLocalDomainSecretStore(v *viper.Viper, envDir string, log zerowrap.Logger) (out.DomainSecretStore, error) {
103103 backend := resolveLocalSecretsBackend(v)
104- if backend == domain.SecretsBackendPass {
104+ switch backend {
105+ case domain.SecretsBackendPass:
105106 return domainsecrets.NewPassStore(log)
107+ case domain.SecretsBackendSops:
108+ return nil, fmt.Errorf("sops backend not yet supported for domain secrets")
109+ default:
110+ return domainsecrets.NewFileStore(envDir, log)
106111 }
107- return domainsecrets.NewFileStore(envDir, log)
108112 }
109113
110114 func resolveLocalSecretsBackend(v *viper.Viper) domain.SecretsBackend {
@@ -122,6 +126,8 @@ func resolveLocalSecretsBackend(v *viper.Viper) domain.SecretsBackend {
122126 case "unsafe", "":
123127 return domain.SecretsBackendUnsafe
124128 default:
129+ log := zerowrap.Default()
130+ log.Warn().Str("backend", backend).Msg("unrecognized secrets backend, falling back to unsafe")
125131 return domain.SecretsBackendUnsafe
126132 }
127133 }
@@ -101,10 +101,14 @@ func GetLocalServices(configPath string) (*LocalServices, error) {
101 101
102 func createLocalDomainSecretStore(v *viper.Viper, envDir string, log zerowrap.Logger) (out.DomainSecretStore, error) {102 func createLocalDomainSecretStore(v *viper.Viper, envDir string, log zerowrap.Logger) (out.DomainSecretStore, error) {
103 backend := resolveLocalSecretsBackend(v)103 backend := resolveLocalSecretsBackend(v)
104- if backend == domain.SecretsBackendPass {104+ switch backend {
105+ case domain.SecretsBackendPass:
105 return domainsecrets.NewPassStore(log)106 return domainsecrets.NewPassStore(log)
107+ case domain.SecretsBackendSops:
108+ return nil, fmt.Errorf("sops backend not yet supported for domain secrets")
109+ default:
110+ return domainsecrets.NewFileStore(envDir, log)
106 }111 }
107- return domainsecrets.NewFileStore(envDir, log)
108 }112 }
109 113
110 func resolveLocalSecretsBackend(v *viper.Viper) domain.SecretsBackend {114 func resolveLocalSecretsBackend(v *viper.Viper) domain.SecretsBackend {
@@ -122,6 +126,8 @@ func resolveLocalSecretsBackend(v *viper.Viper) domain.SecretsBackend {
122 case "unsafe", "":126 case "unsafe", "":
123 return domain.SecretsBackendUnsafe127 return domain.SecretsBackendUnsafe
124 default:128 default:
129+ log := zerowrap.Default()
130+ log.Warn().Str("backend", backend).Msg("unrecognized secrets backend, falling back to unsafe")
125 return domain.SecretsBackendUnsafe131 return domain.SecretsBackendUnsafe
126 }132 }
127 }133 }
M internal/adapters/in/cli/remote/config.go +1 -0
@@ -231,6 +231,7 @@ func resolveInsecureTLS(flagInsecure bool, config *ClientConfig, remotes *Client
231231 if value, err := strconv.ParseBool(env); err == nil {
232232 return value
233233 }
234+ fmt.Fprintf(os.Stderr, "WARNING: invalid GORDON_INSECURE value %q, ignoring\n", env)
234235 }
235236
236237 if config != nil && config.Client.InsecureTLS {
@@ -231,6 +231,7 @@ func resolveInsecureTLS(flagInsecure bool, config *ClientConfig, remotes *Client
231 if value, err := strconv.ParseBool(env); err == nil {231 if value, err := strconv.ParseBool(env); err == nil {
232 return value232 return value
233 }233 }
234+ fmt.Fprintf(os.Stderr, "WARNING: invalid GORDON_INSECURE value %q, ignoring\n", env)
234 }235 }
235 236
236 if config != nil && config.Client.InsecureTLS {237 if config != nil && config.Client.InsecureTLS {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close