Просмотр исходного кода

contrib/sni-router: split MTG_SECRET assignment from envsubst in examples

`MTG_SECRET=<placeholder> envsubst < ...` was shell-broken on literal
copy-paste — bash parses `<placeholder>` as redirection from a
non-existent file. Two-line `export MTG_SECRET=...` + plain envsubst
form removes the ambiguity. Applies to README, docker-compose.yml,
and the .example header.
pull/525/head
Alexey Dolotov 3 дней назад
Родитель
Сommit
3d0899dcca

+ 2
- 1
contrib/sni-router/README.md Просмотреть файл

@@ -31,7 +31,8 @@ docker run --rm nineseconds/mtg:2 generate-secret --hex YOUR_DOMAIN
31 31
 #    - .env (or export)  →  DOMAIN=your.domain   # used by HAProxy + Caddy
32 32
 #    - render mtg-config.toml from the tracked template
33 33
 #      (the rendered file is gitignored — secret stays out of git):
34
-MTG_SECRET=<secret-from-step-2> envsubst < mtg-config.toml.example > mtg-config.toml
34
+export MTG_SECRET=...    # paste the hex secret from step 2
35
+envsubst < mtg-config.toml.example > mtg-config.toml
35 36
 #      (Or `cp mtg-config.toml.example mtg-config.toml` and edit ${MTG_SECRET}
36 37
 #      by hand if you don't have envsubst.)
37 38
 

+ 2
- 1
contrib/sni-router/docker-compose.yml Просмотреть файл

@@ -11,7 +11,8 @@
11 11
 # Quick start:
12 12
 #   1. Set DOMAIN in a .env file next to this one (or export it)
13 13
 #   2. mtg generate-secret YOUR_DOMAIN   -> render mtg-config.toml:
14
-#        MTG_SECRET=<secret> envsubst < mtg-config.toml.example > mtg-config.toml
14
+#        export MTG_SECRET=...     # paste the hex secret
15
+#        envsubst < mtg-config.toml.example > mtg-config.toml
15 16
 #      (the rendered file is gitignored). See README.md for the cp+edit variant.
16 17
 #   3. docker compose up -d
17 18
 #

+ 2
- 1
contrib/sni-router/mtg-config.toml.example Просмотреть файл

@@ -6,7 +6,8 @@
6 6
 #   1. Set DOMAIN=<your.domain> in .env (HAProxy + Caddy pick it up).
7 7
 #   2. Generate the secret:  mtg generate-secret --hex <your.domain>
8 8
 #   3. Produce mtg-config.toml — pick one:
9
-#        MTG_SECRET=<secret> envsubst < mtg-config.toml.example > mtg-config.toml
9
+#        export MTG_SECRET=...     # paste the hex secret
10
+#        envsubst < mtg-config.toml.example > mtg-config.toml
10 11
 #      or just copy and hand-edit `${MTG_SECRET}`:
11 12
 #        cp mtg-config.toml.example mtg-config.toml && $EDITOR mtg-config.toml
12 13
 

Загрузка…
Отмена
Сохранить