Skip to content

Commit c9ddfb1

Browse files
authored
vmauth: rm ip filters from non-ent config example (VictoriaMetrics#4526)
It is impossible to run OS vmauth with the provided config. The example of using ip filters should be only a part of docs. All other examples should work seamlessly with OS version. Signed-off-by: hagen1778 <[email protected]>
1 parent a97887a commit c9ddfb1

File tree

4 files changed

+63
-11
lines changed

4 files changed

+63
-11
lines changed

app/vmauth/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ip_filters:
8585
deny_list: [10.0.0.42]
8686
```
8787
88-
The following config allows requests for the user 'foobar' only from the ip `127.0.0.1`:
88+
The following config allows requests for the user 'foobar' only from the IP `127.0.0.1`:
8989

9090
```yml
9191
users:
@@ -96,6 +96,8 @@ users:
9696
allow_list: [127.0.0.1]
9797
```
9898

99+
See config example of using IP filters [here](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmauth/example_config_ent.yml).
100+
99101
## Auth config
100102

101103
`-auth.config` is represented in the following simple `yml` format:

app/vmauth/example_config.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ users:
8989
url_prefix: "http://vminsert:8480/insert/42/prometheus"
9090
headers:
9191
- "X-Scope-OrgID: abc"
92-
ip_filters:
93-
deny_list: [127.0.0.1]
9492
default_url:
9593
- "http://default1:8888/unsupported_url_handler"
9694
- "http://default2:8888/unsupported_url_handler"
@@ -104,10 +102,3 @@ unauthorized_user:
104102
url_prefix:
105103
- http://vmselect1:8481/select/0/prometheus
106104
- http://vmselect2:8481/select/0/prometheus
107-
ip_filters:
108-
allow_list: [8.8.8.8]
109-
110-
ip_filters:
111-
allow_list: ["1.2.3.0/24", "127.0.0.1"]
112-
deny_list:
113-
- 10.1.0.1

app/vmauth/example_config_ent.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Arbitrary number of usernames may be put here.
2+
# It is possible to set multiple identical usernames with different passwords.
3+
# Such usernames can be differentiated by `name` option.
4+
5+
users:
6+
# A single user for querying and inserting data:
7+
#
8+
# - Requests to http://vmauth:8427/api/v1/query, http://vmauth:8427/api/v1/query_range
9+
# and http://vmauth:8427/api/v1/label/<label_name>/values are proxied to the following urls in a round-robin manner:
10+
# - http://vmselect1:8481/select/42/prometheus
11+
# - http://vmselect2:8481/select/42/prometheus
12+
# For example, http://vmauth:8427/api/v1/query is proxied to http://vmselect1:8480/select/42/prometheus/api/v1/query
13+
# or to http://vmselect2:8480/select/42/prometheus/api/v1/query .
14+
#
15+
# - Requests to http://vmauth:8427/api/v1/write are proxied to http://vminsert:8480/insert/42/prometheus/api/v1/write .
16+
# The "X-Scope-OrgID: abc" http header is added to these requests.
17+
#
18+
# Request which do not match `src_paths` from the `url_map` are proxied to the urls from `default_url`
19+
# in a round-robin manner. The original request path is passed in `request_path` query arg.
20+
# For example, request to http://vmauth:8427/non/existing/path are proxied:
21+
# - to http://default1:8888/unsupported_url_handler?request_path=/non/existing/path
22+
# - or http://default2:8888/unsupported_url_handler?request_path=/non/existing/path
23+
- username: "foobar"
24+
url_map:
25+
- src_paths:
26+
- "/api/v1/query"
27+
- "/api/v1/query_range"
28+
- "/api/v1/label/[^/]+/values"
29+
url_prefix:
30+
- "http://vmselect1:8481/select/42/prometheus"
31+
- "http://vmselect2:8481/select/42/prometheus"
32+
- src_paths: ["/api/v1/write"]
33+
url_prefix: "http://vminsert:8480/insert/42/prometheus"
34+
headers:
35+
- "X-Scope-OrgID: abc"
36+
ip_filters:
37+
deny_list: [127.0.0.1]
38+
default_url:
39+
- "http://default1:8888/unsupported_url_handler"
40+
- "http://default2:8888/unsupported_url_handler"
41+
42+
# Requests without Authorization header are routed according to `unauthorized_user` section.
43+
unauthorized_user:
44+
url_map:
45+
- src_paths:
46+
- /api/v1/query
47+
- /api/v1/query_range
48+
url_prefix:
49+
- http://vmselect1:8481/select/0/prometheus
50+
- http://vmselect2:8481/select/0/prometheus
51+
ip_filters:
52+
allow_list: [8.8.8.8]
53+
54+
ip_filters:
55+
allow_list: ["1.2.3.0/24", "127.0.0.1"]
56+
deny_list:
57+
- 10.1.0.1

docs/vmauth.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ ip_filters:
9696
deny_list: [10.0.0.42]
9797
```
9898
99-
The following config allows requests for the user 'foobar' only from the ip `127.0.0.1`:
99+
The following config allows requests for the user 'foobar' only from the IP `127.0.0.1`:
100100

101101
```yml
102102
users:
@@ -107,6 +107,8 @@ users:
107107
allow_list: [127.0.0.1]
108108
```
109109

110+
See config example of using IP filters [here](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/app/vmauth/example_config_ent.yml).
111+
110112
## Auth config
111113

112114
`-auth.config` is represented in the following simple `yml` format:

0 commit comments

Comments
 (0)