Explorar el Código

fix: move [secrets] after global keys in config examples

In TOML, all keys after a [section] header belong to that table.
The examples had api-bind-to after [secrets], causing it to be
parsed as secrets.api-bind-to and triggering "incorrect secret
format" errors.

Fixes #6
pull/434/head
Alexey Dolotov hace 1 mes
padre
commit
a853edcfda
Se han modificado 2 ficheros con 16 adiciones y 11 borrados
  1. 6
    4
      README.md
  2. 10
    7
      example.config.toml

+ 6
- 4
README.md Ver fichero

@@ -71,12 +71,13 @@ Minimal config:
71 71
 
72 72
 ```toml
73 73
 bind-to = "0.0.0.0:443"
74
+api-bind-to = "127.0.0.1:9090"
74 75
 
76
+# [secrets] must be the last section in the global scope —
77
+# in TOML, all keys after a [section] become part of that table.
75 78
 [secrets]
76 79
 alice = "ee..."
77 80
 bob   = "ee..."
78
-
79
-api-bind-to = "127.0.0.1:9090"
80 81
 ```
81 82
 
82 83
 Run:
@@ -154,12 +155,13 @@ mtg-multi generate-secret --hex storage.googleapis.com
154 155
 
155 156
 ```toml
156 157
 bind-to = "0.0.0.0:443"
158
+api-bind-to = "127.0.0.1:9090"
157 159
 
160
+# [secrets] должен быть последней секцией в глобальном scope —
161
+# в TOML все ключи после [section] становятся частью этой таблицы.
158 162
 [secrets]
159 163
 alice = "ee..."
160 164
 bob   = "ee..."
161
-
162
-api-bind-to = "127.0.0.1:9090"
163 165
 ```
164 166
 
165 167
 Запуск:

+ 10
- 7
example.config.toml Ver fichero

@@ -20,13 +20,6 @@ debug = true
20 20
 # should either be base64-encoded or starts with ee.
21 21
 secret = "ee367a189aee18fa31c190054efd4a8e9573746f726167652e676f6f676c65617069732e636f6d"
22 22
 
23
-# For multi-user support, use the [secrets] section instead of "secret".
24
-# Each key is a user name, used for per-user stats tracking.
25
-# All secrets must use the same hostname.
26
-# [secrets]
27
-# alice = "ee367a189aee18fa31c190054efd4a8e9573746f726167652e676f6f676c65617069732e636f6d"
28
-# bob = "ee0123456789abcdef0123456789abcd9573746f726167652e676f6f676c65617069732e636f6d"
29
-
30 23
 # Host:port pair to bind the built-in stats HTTP API server.
31 24
 # GET /stats returns per-user connection counts and traffic.
32 25
 # If not set, the stats API is not started.
@@ -118,6 +111,16 @@ tolerate-time-skewness = "5s"
118 111
 # Otherwise, chose a new DC.
119 112
 allow-fallback-on-unknown-dc = false
120 113
 
114
+# For multi-user support, use the [secrets] section instead of "secret".
115
+# Each key is a user name, used for per-user stats tracking.
116
+# All secrets must use the same hostname.
117
+#
118
+# IMPORTANT: [secrets] must appear after all global keys (like bind-to,
119
+# api-bind-to) — in TOML, keys after a [section] belong to that table.
120
+# [secrets]
121
+# alice = "ee367a189aee18fa31c190054efd4a8e9573746f726167652e676f6f676c65617069732e636f6d"
122
+# bob = "ee0123456789abcdef0123456789abcd9573746f726167652e676f6f676c65617069732e636f6d"
123
+
121 124
 # This section is relevant to communication with fronting domain. Usually
122 125
 # you do not need to setup anything here but there are plenty of cases, especially
123 126
 # if you put mtg behind load balancer, when some specific configuration is

Loading…
Cancelar
Guardar