[signal,proxy,relay] Add service configuration examples

Operators need concrete schemas for the new config-file flags.

Add validated YAML examples for Relay/STUN, Signal, and Proxy.
This commit is contained in:
jnfrati
2026-08-25 11:03:33 +02:00
parent 0646d8fc78
commit 2545a3c30b
6 changed files with 106 additions and 0 deletions
+14
View File
@@ -9,6 +9,20 @@ import (
"github.com/stretchr/testify/require"
)
func TestExampleConfig(t *testing.T) {
require.NoError(t, rootCmd.ParseFlags(nil))
oldConfigPath := configPath
configPath = filepath.Join("..", "config.example.yaml")
t.Cleanup(func() {
configPath = oldConfigPath
})
cfg, err := loadConfig(rootCmd)
require.NoError(t, err)
assert.Equal(t, "rels://relay.example.com:443", cfg.ExposedAddress, "Example config should load")
assert.True(t, cfg.EnableSTUN, "Example config should enable STUN")
}
func TestLoadConfigPrecedence(t *testing.T) {
path := filepath.Join(t.TempDir(), "relay.yaml")
require.NoError(t, os.WriteFile(path, []byte(`