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

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 1 месяц назад
Родитель
Сommit
a853edcfda
2 измененных файлов: 16 добавлений и 11 удалений
  1. 6
    4
      README.md
  2. 10
    7
      example.config.toml

+ 6
- 4
README.md Просмотреть файл

71
 
71
 
72
 ```toml
72
 ```toml
73
 bind-to = "0.0.0.0:443"
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
 [secrets]
78
 [secrets]
76
 alice = "ee..."
79
 alice = "ee..."
77
 bob   = "ee..."
80
 bob   = "ee..."
78
-
79
-api-bind-to = "127.0.0.1:9090"
80
 ```
81
 ```
81
 
82
 
82
 Run:
83
 Run:
154
 
155
 
155
 ```toml
156
 ```toml
156
 bind-to = "0.0.0.0:443"
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
 [secrets]
162
 [secrets]
159
 alice = "ee..."
163
 alice = "ee..."
160
 bob   = "ee..."
164
 bob   = "ee..."
161
-
162
-api-bind-to = "127.0.0.1:9090"
163
 ```
165
 ```
164
 
166
 
165
 Запуск:
167
 Запуск:

+ 10
- 7
example.config.toml Просмотреть файл

20
 # should either be base64-encoded or starts with ee.
20
 # should either be base64-encoded or starts with ee.
21
 secret = "ee367a189aee18fa31c190054efd4a8e9573746f726167652e676f6f676c65617069732e636f6d"
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
 # Host:port pair to bind the built-in stats HTTP API server.
23
 # Host:port pair to bind the built-in stats HTTP API server.
31
 # GET /stats returns per-user connection counts and traffic.
24
 # GET /stats returns per-user connection counts and traffic.
32
 # If not set, the stats API is not started.
25
 # If not set, the stats API is not started.
118
 # Otherwise, chose a new DC.
111
 # Otherwise, chose a new DC.
119
 allow-fallback-on-unknown-dc = false
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
 # This section is relevant to communication with fronting domain. Usually
124
 # This section is relevant to communication with fronting domain. Usually
122
 # you do not need to setup anything here but there are plenty of cases, especially
125
 # you do not need to setup anything here but there are plenty of cases, especially
123
 # if you put mtg behind load balancer, when some specific configuration is
126
 # if you put mtg behind load balancer, when some specific configuration is

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