From 9bf81248c4d1a2a0ac318ebc7f761d81aa46c311 Mon Sep 17 00:00:00 2001 From: zarazaex69 Date: Thu, 21 May 2026 19:01:10 +0300 Subject: [PATCH] docs: replace 1.1.1.1 with 8.8.8.8 as default DNS server --- Dockerfile | 2 +- cmd/olcrtc/main_test.go | 10 +++++----- docker-compose.client.yml | 2 +- docker-compose.server.yml | 2 +- docs/about.md | 10 +++++----- docs/configuration.md | 6 +++--- docs/examples/failover.yaml | 2 +- docs/manual.md | 10 +++++----- docs/settings.md | 20 ++++++++++---------- internal/app/session/session_test.go | 14 +++++++------- internal/config/config_test.go | 11 ++++++----- mobile/mobile.go | 2 +- pkg/olcrtc/olcrtc.go | 2 +- pkg/olcrtc/tunnel/tunnel.go | 4 ++-- pkg/olcrtc/tunnel/tunnel_test.go | 2 +- script/docker/olcrtc-entrypoint.sh | 2 +- 16 files changed, 51 insertions(+), 50 deletions(-) diff --git a/Dockerfile b/Dockerfile index a412492..856c4a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,7 +45,7 @@ ENV OLCRTC_MODE=srv \ OLCRTC_CARRIER= \ OLCRTC_TRANSPORT=datachannel \ OLCRTC_DATA_DIR=/usr/share/olcrtc \ - OLCRTC_DNS=1.1.1.1:53 \ + OLCRTC_DNS=8.8.8.8:53 \ OLCRTC_KEY_FILE=/var/lib/olcrtc/key.hex \ OLCRTC_SOCKS_HOST=127.0.0.1 \ OLCRTC_SOCKS_PORT=8808 \ diff --git a/cmd/olcrtc/main_test.go b/cmd/olcrtc/main_test.go index c5e0df0..916bae3 100644 --- a/cmd/olcrtc/main_test.go +++ b/cmd/olcrtc/main_test.go @@ -16,7 +16,7 @@ var errBoom = errors.New("boom") const ( testAuthWBStream = "wbstream" - testDNSServer = "1.1.1.1:53" + testDNSServer = "8.8.8.8:53" ) func writeYAML(t *testing.T, body string) string { @@ -90,7 +90,7 @@ func TestRunWithConfigValidationAndDataDirErrors(t *testing.T) { Auth: "jitsi", RoomID: "https://meet.small-dm.ru/test", KeyHex: "key", - DNSServer: "1.1.1.1:53", + DNSServer: "8.8.8.8:53", } if err := runWithConfig(loadedConfig{scfg: scfg}); !errors.Is(err, ErrDataDirRequired) { t.Fatalf("runWithConfig(no data dir) = %v, want %v", err, ErrDataDirRequired) @@ -140,7 +140,7 @@ crypto: key: key net: transport: datachannel - dns: 1.1.1.1:53 + dns: 8.8.8.8:53 data: `+dir+` `) @@ -181,7 +181,7 @@ crypto: key: key net: transport: vp8channel - dns: 1.1.1.1:53 + dns: 8.8.8.8:53 data: `+dir+` `) @@ -216,7 +216,7 @@ link: direct crypto: key: key net: - dns: 1.1.1.1:53 + dns: 8.8.8.8:53 profiles: - name: wb-primary auth: diff --git a/docker-compose.client.yml b/docker-compose.client.yml index 7447e74..6221718 100644 --- a/docker-compose.client.yml +++ b/docker-compose.client.yml @@ -13,7 +13,7 @@ services: OLCRTC_ROOM_ID: "${OLCRTC_ROOM_ID:?set OLCRTC_ROOM_ID to the server room}" OLCRTC_KEY: "${OLCRTC_KEY:?set OLCRTC_KEY to the server encryption key}" OLCRTC_KEY_FILE: "${OLCRTC_KEY_FILE:-/var/lib/olcrtc/key.hex}" - OLCRTC_DNS: "${OLCRTC_DNS:-1.1.1.1:53}" + OLCRTC_DNS: "${OLCRTC_DNS:-8.8.8.8:53}" OLCRTC_SOCKS_HOST: "${OLCRTC_SOCKS_HOST:-127.0.0.1}" OLCRTC_SOCKS_PORT: "${OLCRTC_SOCKS_PORT:-8808}" OLCRTC_SOCKS_USER: "${OLCRTC_SOCKS_USER:-}" diff --git a/docker-compose.server.yml b/docker-compose.server.yml index a3f63b3..a83525e 100644 --- a/docker-compose.server.yml +++ b/docker-compose.server.yml @@ -12,7 +12,7 @@ services: OLCRTC_ROOM_ID: "${OLCRTC_ROOM_ID:-}" OLCRTC_KEY: "${OLCRTC_KEY:-}" OLCRTC_KEY_FILE: "${OLCRTC_KEY_FILE:-/var/lib/olcrtc/key.hex}" - OLCRTC_DNS: "${OLCRTC_DNS:-1.1.1.1:53}" + OLCRTC_DNS: "${OLCRTC_DNS:-8.8.8.8:53}" OLCRTC_SOCKS_PROXY: "${OLCRTC_SOCKS_PROXY:-}" OLCRTC_SOCKS_PROXY_PORT: "${OLCRTC_SOCKS_PROXY_PORT:-1080}" OLCRTC_VIDEO_W: "${OLCRTC_VIDEO_W:-0}" diff --git a/docs/about.md b/docs/about.md index f9cddcc..f67f973 100644 --- a/docs/about.md +++ b/docs/about.md @@ -117,12 +117,12 @@ mode: srv auth: provider: jitsi room: - id: "https://meet.small-dm.ru/myroom" + id: "https://meet.small-dm.ru/REPLACE_ME_WITH_ROOM_ID" crypto: key: "REPLACE_ME_WITH_64_HEX_CHARS" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" data: data ``` @@ -133,12 +133,12 @@ mode: cnc auth: provider: jitsi room: - id: "https://meet.small-dm.ru/myroom" + id: "https://meet.small-dm.ru/REPLACE_ME_WITH_ROOM_ID" crypto: key: "REPLACE_ME_WITH_64_HEX_CHARS" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 @@ -215,7 +215,7 @@ srv := tunnel.New(tunnel.Config{ Carrier: "jitsi", RoomURL: "https://meet.small-dm.ru/myroom", KeyHex: "<64-char hex>", - DNSServer: "1.1.1.1:53", + DNSServer: "8.8.8.8:53", }) err := srv.Run(ctx) ``` diff --git a/docs/configuration.md b/docs/configuration.md index 98d96eb..48d9cb8 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -85,7 +85,7 @@ crypto: key: "REPLACE_ME_WITH_64_HEX_CHARS" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" data: data ``` @@ -101,7 +101,7 @@ crypto: key: "REPLACE_ME_WITH_64_HEX_CHARS" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 @@ -154,7 +154,7 @@ mode: srv crypto: key_file: ./olcrtc.key net: - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" data: data profiles: diff --git a/docs/examples/failover.yaml b/docs/examples/failover.yaml index 3c11dd0..33b7873 100644 --- a/docs/examples/failover.yaml +++ b/docs/examples/failover.yaml @@ -7,7 +7,7 @@ crypto: key_file: "./olcrtc.key" net: - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" liveness: interval: 10s diff --git a/docs/manual.md b/docs/manual.md index 0f4818e..4c2dfce 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -162,7 +162,7 @@ crypto: key: "d823fa01cb3e0609b67322f7cf984c4ee2e4ce2e294936fc24ef38c9e59f4799" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" data: data ``` @@ -193,7 +193,7 @@ crypto: key: "d823fa01cb3e0609b67322f7cf984c4ee2e4ce2e294936fc24ef38c9e59f4799" net: transport: vp8channel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" data: data ``` @@ -236,7 +236,7 @@ crypto: key: "" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 @@ -262,7 +262,7 @@ crypto: key: "" net: transport: vp8channel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 @@ -292,7 +292,7 @@ crypto: key: "" net: transport: vp8channel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 diff --git a/docs/settings.md b/docs/settings.md index 3b820bb..86b5170 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -48,7 +48,7 @@ | `room.id` | Room ID | | `crypto.key` или `crypto.key_file` | Ключ шифрования hex 64 символа. Генерация: `openssl rand -hex 32` | | `data` | Всегда `data` | -| `net.dns` | DNS-сервер, например `1.1.1.1:53` | +| `net.dns` | DNS-сервер, например `8.8.8.8:53` | --- @@ -201,7 +201,7 @@ crypto: key: "" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" data: data ``` @@ -216,7 +216,7 @@ crypto: key: "" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 @@ -236,7 +236,7 @@ crypto: key: "" net: transport: datachannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 @@ -267,7 +267,7 @@ crypto: key: "" net: transport: vp8channel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" vp8: fps: 60 batch_size: 64 @@ -285,7 +285,7 @@ crypto: key: "" net: transport: vp8channel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 @@ -310,7 +310,7 @@ crypto: key: "" net: transport: seichannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" sei: fps: 60 batch_size: 64 @@ -330,7 +330,7 @@ crypto: key: "" net: transport: seichannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 @@ -355,7 +355,7 @@ crypto: key: "" net: transport: videochannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" video: codec: qrcode width: 1080 @@ -377,7 +377,7 @@ crypto: key: "" net: transport: videochannel - dns: "1.1.1.1:53" + dns: "8.8.8.8:53" socks: host: "127.0.0.1" port: 8808 diff --git a/internal/app/session/session_test.go b/internal/app/session/session_test.go index f03f9e8..1e878a3 100644 --- a/internal/app/session/session_test.go +++ b/internal/app/session/session_test.go @@ -130,7 +130,7 @@ func TestValidate(t *testing.T) { Auth: "telemost", RoomID: "room-1", KeyHex: "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff", - DNSServer: "1.1.1.1:53", //nolint:goconst // test literal, repetition is intentional + DNSServer: "8.8.8.8:53", //nolint:goconst // test literal, repetition is intentional } tests := []struct { @@ -577,17 +577,17 @@ func TestValidateGen(t *testing.T) { }{ { name: "wbstream room generation unsupported", - cfg: Config{Auth: testAuthWBStream, DNSServer: "1.1.1.1:53", Amount: 3}, + cfg: Config{Auth: testAuthWBStream, DNSServer: "8.8.8.8:53", Amount: 3}, want: ErrUnsupportedCarrier, }, { name: "missing auth", - cfg: Config{DNSServer: "1.1.1.1:53", Amount: 1}, + cfg: Config{DNSServer: "8.8.8.8:53", Amount: 1}, want: ErrAuthRequired, }, { name: "unsupported auth", - cfg: Config{Auth: "unknown", DNSServer: "1.1.1.1:53", Amount: 1}, + cfg: Config{Auth: "unknown", DNSServer: "8.8.8.8:53", Amount: 1}, want: ErrUnsupportedCarrier, }, { @@ -597,12 +597,12 @@ func TestValidateGen(t *testing.T) { }, { name: "amount zero", - cfg: Config{Auth: testAuthWBStream, DNSServer: "1.1.1.1:53", Amount: 0}, + cfg: Config{Auth: testAuthWBStream, DNSServer: "8.8.8.8:53", Amount: 0}, want: ErrAmountRequired, }, { name: "amount negative", - cfg: Config{Auth: testAuthWBStream, DNSServer: "1.1.1.1:53", Amount: -1}, + cfg: Config{Auth: testAuthWBStream, DNSServer: "8.8.8.8:53", Amount: -1}, want: ErrAmountRequired, }, } @@ -625,7 +625,7 @@ func TestValidateGen(t *testing.T) { func TestGenUnsupportedAuth(t *testing.T) { RegisterDefaults() - cfg := Config{Auth: "telemost", DNSServer: "1.1.1.1:53", Amount: 1} + cfg := Config{Auth: "telemost", DNSServer: "8.8.8.8:53", Amount: 1} err := Gen(context.Background(), cfg, func(string) {}) if !errors.Is(err, ErrUnsupportedCarrier) { t.Fatalf("Gen(telemost) error = %v, want ErrUnsupportedCarrier", err) diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 062788b..e650e6f 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -14,6 +14,7 @@ const ( testAuthProvider = "wbstream" testRoomID = "r1" testCryptoKey = "deadbeef" + testDNSServer = "8.8.8.8:53" ) func TestLoadAndApply(t *testing.T) { @@ -30,7 +31,7 @@ crypto: key: deadbeef net: transport: datachannel - dns: 1.1.1.1:53 + dns: 8.8.8.8:53 socks: host: 127.0.0.1 port: 1080 @@ -91,7 +92,7 @@ func requireAppliedConfig(t *testing.T, got session.Config) { RoomID: testRoomID, KeyHex: testCryptoKey, Transport: "datachannel", - DNSServer: "1.1.1.1:53", + DNSServer: testDNSServer, SOCKSHost: "127.0.0.1", SOCKSPort: 1080, SOCKSUser: "u", @@ -147,7 +148,7 @@ link: direct crypto: key: shared-key net: - dns: 1.1.1.1:53 + dns: 8.8.8.8:53 liveness: interval: 5s timeout: 2s @@ -207,7 +208,7 @@ failover: if first.Auth != "wbstream" || first.Transport != "vp8channel" || first.RoomID != "wb-room" { t.Fatalf("first profile = %+v", first) } - if first.KeyHex != "shared-key" || first.DNSServer != "1.1.1.1:53" || first.VP8.FPS != 30 || + if first.KeyHex != "shared-key" || first.DNSServer != testDNSServer || first.VP8.FPS != 30 || first.LivenessInterval != "1s" || first.LivenessTimeout != "2s" || first.LivenessFailures != 5 || first.MaxSessionDuration != "30m" || first.TrafficMaxPayloadSize != 4096 || first.TrafficMinDelay != "10ms" || first.TrafficMaxDelay != "20ms" { @@ -215,7 +216,7 @@ failover: } second := ApplyProfile(base, f.Profiles[1]) if second.Auth != "jitsi" || second.Transport != "datachannel" || - second.RoomID != "https://meet.example/room" || second.DNSServer != "8.8.8.8:53" { + second.RoomID != "https://meet.example/room" || second.DNSServer != testDNSServer { t.Fatalf("second profile = %+v", second) } if second.LivenessInterval != "5s" || second.LivenessTimeout != "2s" || second.LivenessFailures != 5 || diff --git a/mobile/mobile.go b/mobile/mobile.go index 10a8678..fd3444d 100644 --- a/mobile/mobile.go +++ b/mobile/mobile.go @@ -52,7 +52,7 @@ var ( const ( defaultTransport = "vp8channel" dataTransport = "datachannel" - defaultDNSServer = "1.1.1.1:53" + defaultDNSServer = "8.8.8.8:53" defaultHTTPPingURL = "https://www.google.com/generate_204" carrierWBStream = "wbstream" ) diff --git a/pkg/olcrtc/olcrtc.go b/pkg/olcrtc/olcrtc.go index 16307ae..18585f8 100644 --- a/pkg/olcrtc/olcrtc.go +++ b/pkg/olcrtc/olcrtc.go @@ -67,7 +67,7 @@ type Config struct { // --- common --- // Name is the display name used when joining the room. Name string - // DNSServer is an optional custom DNS resolver (e.g. "1.1.1.1:53"). + // DNSServer is an optional custom DNS resolver (e.g. "8.8.8.8:53"). DNSServer string // ProxyAddr / ProxyPort configure an outbound SOCKS5 proxy. ProxyAddr string diff --git a/pkg/olcrtc/tunnel/tunnel.go b/pkg/olcrtc/tunnel/tunnel.go index 9b060c2..f2337c6 100644 --- a/pkg/olcrtc/tunnel/tunnel.go +++ b/pkg/olcrtc/tunnel/tunnel.go @@ -9,7 +9,7 @@ // Carrier: "jitsi", // RoomURL: "https://meet.small-dm.ru/myroom", // KeyHex: "<64-char hex>", -// DNSServer: "1.1.1.1:53", +// DNSServer: "8.8.8.8:53", // AuthHook: func(deviceID string, claims map[string]any) (string, error) { // // reject unknown devices, enrich session with a DB-issued ID // return db.IssueSession(deviceID, claims) @@ -82,7 +82,7 @@ type Config struct { // --- crypto & networking --- KeyHex string // 64-char hex (32 bytes) shared with the client - DNSServer string // resolver used for target dials, e.g. "1.1.1.1:53" + DNSServer string // resolver used for target dials, e.g. "8.8.8.8:53" SOCKSProxyAddr string // optional outbound SOCKS5 proxy host SOCKSProxyPort int // optional outbound SOCKS5 proxy port diff --git a/pkg/olcrtc/tunnel/tunnel_test.go b/pkg/olcrtc/tunnel/tunnel_test.go index d0e785c..eadcf63 100644 --- a/pkg/olcrtc/tunnel/tunnel_test.go +++ b/pkg/olcrtc/tunnel/tunnel_test.go @@ -16,7 +16,7 @@ func TestRun_FailsWithoutKey(t *testing.T) { Transport: "datachannel", Carrier: "telemost", RoomURL: "room-1", - DNSServer: "1.1.1.1:53", + DNSServer: "8.8.8.8:53", }).Run(context.Background()) if err == nil { t.Fatal("Run(no key) error = nil") diff --git a/script/docker/olcrtc-entrypoint.sh b/script/docker/olcrtc-entrypoint.sh index 989df5a..9fed6d2 100644 --- a/script/docker/olcrtc-entrypoint.sh +++ b/script/docker/olcrtc-entrypoint.sh @@ -19,7 +19,7 @@ room_id="${OLCRTC_ROOM_ID:-}" carrier="${OLCRTC_CARRIER:-${OLCRTC_AUTH:-}}" transport="${OLCRTC_TRANSPORT:-}" data_dir="${OLCRTC_DATA_DIR:-/usr/share/olcrtc}" -dns_server="${OLCRTC_DNS:-1.1.1.1:53}" +dns_server="${OLCRTC_DNS:-8.8.8.8:53}" key="${OLCRTC_KEY:-}" key_file="${OLCRTC_KEY_FILE:-/var/lib/olcrtc/key.hex}" socks_proxy="${OLCRTC_SOCKS_PROXY:-}"