mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-01 12:31:42 +02:00
[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:
@@ -10,6 +10,13 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestExampleConfig(t *testing.T) {
|
||||
require.NoError(t, rootCmd.ParseFlags(nil))
|
||||
cfg, err := loadConfig(rootCmd, filepath.Join("..", "..", "..", "config.example.yaml"))
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "proxy.example.com", cfg.ProxyURL, "Example config should load")
|
||||
}
|
||||
|
||||
func TestLoadConfigPrecedence(t *testing.T) {
|
||||
configPath := filepath.Join(t.TempDir(), "proxy.yaml")
|
||||
require.NoError(t, os.WriteFile(configPath, []byte(`
|
||||
|
||||
41
proxy/config.example.yaml
Normal file
41
proxy/config.example.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
# Command-line flags override environment variables, which override this file.
|
||||
listenAddress: ":443"
|
||||
id: "proxy-1"
|
||||
domain: "proxy.example.com"
|
||||
managementAddress: "https://api.netbird.io:443"
|
||||
proxyToken: "replace-with-a-proxy-token"
|
||||
|
||||
certificateDirectory: "/var/lib/netbird/certs"
|
||||
certificateFile: "tls.crt"
|
||||
certificateKeyFile: "tls.key"
|
||||
generateACMECertificates: true
|
||||
acmeChallengeAddress: ":80"
|
||||
acmeDirectory: "https://acme-v02.api.letsencrypt.org/directory"
|
||||
acmeEABKID: ""
|
||||
acmeEABHMACKey: ""
|
||||
acmeChallengeType: "tls-alpn-01"
|
||||
certLockMethod: "auto"
|
||||
wildcardCertDir: ""
|
||||
|
||||
debugEndpointEnabled: false
|
||||
debugEndpointAddress: "localhost:8444"
|
||||
healthAddress: "localhost:8080"
|
||||
forwardedProto: "auto"
|
||||
trustedProxies: ""
|
||||
wireguardPort: 0
|
||||
proxyProtocol: false
|
||||
preSharedKey: ""
|
||||
supportsCustomPorts: true
|
||||
requireSubdomain: false
|
||||
private: false
|
||||
maxDialTimeout: "0s"
|
||||
maxSessionIdleTimeout: "0s"
|
||||
mappingBatchWatchdog: "0s"
|
||||
geoDataDir: "/var/lib/netbird/geolocation"
|
||||
crowdSecAPIURL: ""
|
||||
crowdSecAPIKey: ""
|
||||
logLevel: "info"
|
||||
|
||||
# Optional tunnel memory and throughput tuning.
|
||||
# preallocatedBuffers: 4096
|
||||
# maxBatchSize: 128
|
||||
Reference in New Issue
Block a user