Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(rexctl): show every setting, including SSO private addresses (#3674)

Hampusb806b9e61ab8
diff --git a/fluxer_docs/src/content/docs/operator/rexctl.mdx b/fluxer_docs/src/content/docs/operator/rexctl.mdx
index 6ec3319e2..5423429e1 100644
--- a/fluxer_docs/src/content/docs/operator/rexctl.mdx
+++ b/fluxer_docs/src/content/docs/operator/rexctl.mdx
@@ -198,10 +198,6 @@ List every setting with its value and help.
rexctl config list [flags]
```
-- `--all`
-
- Also list every raw setting and the secrets rexctl generated.
-
- `--json`
Print JSON.
diff --git a/fluxer_rexctl/cmd/config.go b/fluxer_rexctl/cmd/config.go
index 3ff2cedc0..a6040b352 100644
--- a/fluxer_rexctl/cmd/config.go
+++ b/fluxer_rexctl/cmd/config.go
@@ -245,7 +245,7 @@ func (v *configView) row(k settings.Key, reveal bool) configRow {
return r
}
-func (v *configView) deploymentKeys(all bool) []settings.Key {
+func (v *configView) deploymentKeys() []settings.Key {
var out []settings.Key
for _, k := range settings.Named() {
if _, err := settings.Lookup(v.set, v.vars, k.Name, nil); err == nil {
@@ -257,11 +257,9 @@ func (v *configView) deploymentKeys(all bool) []settings.Key {
for name := range st.Settings {
raw = append(raw, name)
}
- if all {
- raw = append(raw, v.vars...)
- for name := range st.Secrets {
- raw = append(raw, name)
- }
+ raw = append(raw, v.vars...)
+ for name := range st.Secrets {
+ raw = append(raw, name)
}
slices.Sort(raw)
for _, name := range slices.Compact(raw) {
@@ -280,10 +278,8 @@ func newConfigCmd(app *App) *cobra.Command {
}
func newConfigListCmd(app *App) *cobra.Command {
- var all bool
list := &cobra.Command{Use: "list", Short: "List every setting with its value and help", Args: noArgs}
app.jsonFlag(list)
- list.Flags().BoolVar(&all, "all", false, "also list every raw setting and the secrets rexctl generated")
list.RunE = func(c *cobra.Command, _ []string) error {
ctx := c.Context()
v, err := loadConfigView(app)
@@ -292,7 +288,7 @@ func newConfigListCmd(app *App) *cobra.Command {
}
var rows []configRow
var table [][]string
- for _, k := range v.deploymentKeys(all) {
+ for _, k := range v.deploymentKeys() {
r := v.row(k, false)
if _, generated := v.inst.State.Secrets[k.Name]; generated && k.Kind == settings.Raw {
if _, chosen := v.inst.State.Settings[k.Name]; !chosen {
diff --git a/fluxer_rexctl/internal/instance/bundleenv.go b/fluxer_rexctl/internal/instance/bundleenv.go
index 9b442c028..ee77299ad 100644
--- a/fluxer_rexctl/internal/instance/bundleenv.go
+++ b/fluxer_rexctl/internal/instance/bundleenv.go
@@ -31,6 +31,7 @@ var envSections = []envSection{
"Leave these unset to use the bundled object store. To use your own S3-compatible store, set them and add " +
stack.OverlayFiles[stack.OverlayExternalObjectStore] + " to COMPOSE_FILE."},
{"network.", "OUTGOING PROXY", ""},
+ {"sso.", "SINGLE SIGN-ON", ""},
{settings.ImagesPrefix, "IMAGES",
"Set one to use your own mirror or another version. Fluxer's own images are pinned to the release in " +
stack.ComposeFile + "."},
diff --git a/fluxer_rexctl/internal/instance/shipped.json b/fluxer_rexctl/internal/instance/shipped.json
index 30344c146..03528fa1a 100644
--- a/fluxer_rexctl/internal/instance/shipped.json
+++ b/fluxer_rexctl/internal/instance/shipped.json
@@ -9,6 +9,7 @@
"1599f1c87d97dbca696a72fd7b7929d467a070bbe037ccc3944abf3ff725f7fd",
"1c2224572db81239f4500d051dea92aa195338d90085423c0be53f8ac70d8162",
"1f1f7d647217b224ab8ca7e28ab656eeaf18a3fa2dc125ab6e5a6c9f8242fa5b",
+ "291e8c41701e6757444b64d77df16a1c6f1916cf034f04052d6ee25172736d27",
"29f53f3e7053c764e3611885708fcff47ae1a8940f47d950924f989b6724591a",
"2b23ac88751a5e043aa48b14d1bc54336c0fca352f98825079eedb270a388b31",
"2bea98e5ef69a0689e0a30146b2ce3666bd9f79f3141a67b564365e2d61af2a9",
diff --git a/fluxer_rexctl/internal/settings/keys.go b/fluxer_rexctl/internal/settings/keys.go
index f26fafb36..28557abd0 100644
--- a/fluxer_rexctl/internal/settings/keys.go
+++ b/fluxer_rexctl/internal/settings/keys.go
@@ -56,6 +56,7 @@ const (
HTTPSProxy = "network.https_proxy"
NoProxy = "network.no_proxy"
IPv6 = "network.ipv6"
+ SSOPrivate = "sso.allow_private_addresses"
ImagesRegistry = "images.registry"
MemoryProfile = "memory.profile"
EngineHost = "engine.host"
@@ -125,6 +126,8 @@ func buildNamed() []Key {
Help: "Hosts Fluxer connects to without the proxy"},
{Name: IPv6, Type: "bool", Validate: validBool, Confirm: "Every Fluxer service restarts.",
Help: "Whether Fluxer's network uses IPv6"},
+ {Name: SSOPrivate, Type: "bool", Vars: []string{"FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES"}, Validate: validBool,
+ Help: "Whether single sign-on can use a provider on a private or local network address"},
{Name: ImagesRegistry, Type: "registry", Validate: validRegistry,
Help: "A registry mirror for the database, cache, search, storage, voice and edge images"},
{Name: MemoryProfile, Type: "choice", Options: []string{"small", "medium", "large"}, Validate: oneOf("small", "medium", "large"),
diff --git a/fluxer_rexctl/internal/settings/keys_test.go b/fluxer_rexctl/internal/settings/keys_test.go
new file mode 100644
index 000000000..22f48d941
--- /dev/null
+++ b/fluxer_rexctl/internal/settings/keys_test.go
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+package settings
+
+import (
+ "errors"
+ "testing"
+
+ "github.com/fluxerapp/fluxer/fluxer_rexctl/internal/stack"
+)
+
+func TestSSOPrivateAddressesIsANamedSetting(t *testing.T) {
+ set := stack.Embedded()
+ if _, err := Lookup(set, nil, SSOPrivate, nil); err != nil {
+ t.Fatalf("Lookup(%s) = %v", SSOPrivate, err)
+ }
+ if _, err := Lookup(set, nil, "FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES", nil); !errors.Is(err, ErrOtherName) {
+ t.Errorf("raw name lookup = %v, want it to point at %s", err, SSOPrivate)
+ }
+ env, err := Effective(set, map[string]string{SSOPrivate: "true"}, nil, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if got := env["FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES"]; got != "true" {
+ t.Errorf("FLUXER_SSO_ALLOW_PRIVATE_ADDRESSES = %q, want true", got)
+ }
+}