Skip to content

Commit

Permalink
Fix pre-commit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-asriyan committed Jan 14, 2025
1 parent 97fba01 commit ddbe048
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ repos:
rev: v4.4.0
hooks:
- id: detect-private-key
exclude: |
config/metrics.example.yml
config/servers.example.yml
- id: check-added-large-files
- id: check-yaml
args: [--unsafe]
Expand Down
34 changes: 34 additions & 0 deletions config/servers.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ config_servers:
supported_snis:
- example.com
- www.example.com
prometheus_metrics:
# port where prometheus metrics endpoints should be exposed
port:
# self-signed cert and keys SSL
# generate with `openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 3650 -nodes -subj "/CN=<ip or domain value>" -addext "subjectAltName=<IP or DNS>:<ip or domain value>"`
tls:
certificate: |
-----BEGIN CERTIFICATE-----
....
-----END CERTIFICATE-----
key: |
-----BEGIN PRIVATE KEY-----
....
-----END PRIVATE KEY-----
# there are two APIs: for xray metrics and node_exporter metrics
xray:
# URL path (any string starting with /)
url_path: /some-random-string1
node_exporter:
url_path: /some-random-string2

# second server (for instance)
server2-uuid:
Expand Down Expand Up @@ -56,3 +76,17 @@ config_servers:
supported_snis:
-
-
prometheus_metrics:
# port where prometheus metrics endpoints should be exposed
port:
# self-signed cert and keys SSL
# generate with `openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 3650 -nodes -subj "/CN=<ip or domain value>" -addext "subjectAltName=<IP or DNS>:<ip or domain value>"`
tls:
certificate:
key:
# there are two APIs: for xray metrics and node_exporter metrics
xray:
# URL path (any string starting with /)
url_path:
node_exporter:
url_path:
2 changes: 1 addition & 1 deletion diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion roles/metrics-exporter/templates/nginx.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ http {
}
}
{% endif %}
}
}
2 changes: 1 addition & 1 deletion roles/users-configs/templates/client-xray-config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"network": "tcp",
"security": "reality",
"realitySettings": {
"fingerprint": "{{ fingerprint }}",
"fingerprint": "{{ fingerprint }}",
"serverName": "{{ sni }}",
"publicKey": "{{ users_configs_server.public_key }}",
"spiderX": "/&",
Expand Down
2 changes: 1 addition & 1 deletion roles/xray-exporter/templates/executable.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ generate_metrics() {

# Parse JSON and generate Prometheus metrics
metrics=$(echo "$json" | jq -r '
.stats.user | to_entries[] |
.stats.user | to_entries[] |
[
"# HELP downlink Bytes transferred by the proxy, per access key",
"# TYPE downlink counter",
Expand Down

0 comments on commit ddbe048

Please sign in to comment.