Skip to content

Commit 1823f0e

Browse files
authored
Merge pull request #6 from AlchemyLink/feature/singbox-role-refactor
docs: prepare repo for public release
2 parents 2d46812 + d8a6568 commit 1823f0e

14 files changed

Lines changed: 908 additions & 663 deletions

File tree

README.md

Lines changed: 364 additions & 122 deletions
Large diffs are not rendered by default.

README.ru.md

Lines changed: 507 additions & 0 deletions
Large diffs are not rendered by default.

roles/hosts.yml.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
all:
3+
children:
4+
cloud:
5+
hosts:
6+
vm_my_srv:
7+
ansible_host: "EU_VPS_IP" # Replace with your EU VPS IP
8+
ansible_port: 22
9+
vars:
10+
ansible_user: deploy
11+
ansible_python_interpreter: /usr/bin/python3
12+
ansible_ssh_private_key_file: ~/.ssh/id_ed25519
13+
ansible_ssh_host_key_checking: false

roles/nginx_frontend/defaults/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
# nginx_frontend role — TLS frontend for EU server (media.zirgate.com)
2+
# nginx_frontend role — TLS frontend for EU VPS
33
#
44
# Responsibilities:
55
# - Install nginx + certbot
66
# - Obtain Let's Encrypt certificate for nginx_frontend_domain
77
# - Proxy Xray XHTTP (nginx_frontend_xhttp_path) → 127.0.0.1:nginx_frontend_xhttp_port
88

99
# ── Domain ────────────────────────────────────────────────────────────────────
10-
nginx_frontend_domain: "media.zirgate.com"
10+
nginx_frontend_domain: "media.example.com" # Set to your EU VPS domain
1111

1212
# ── Certbot ───────────────────────────────────────────────────────────────────
1313
nginx_frontend_certbot_email: "" # Set in secrets.yml
@@ -27,6 +27,6 @@ nginx_frontend_xhttp_path: "/api/v3/data-sync" # Must match xray_xhttp.xhttpSe
2727

2828
# ── TCP stream relay for Xray VLESS Reality ───────────────────────────────────
2929
# Stream proxy: nginx_frontend_reality_port → 127.0.0.1:443 (Xray)
30-
# Allows clients to reach Reality via media.zirgate.com instead of direct EU IP.
30+
# Allows clients to reach Reality via media.example.com instead of direct EU IP.
3131
nginx_frontend_reality_stream_enabled: true
3232
nginx_frontend_reality_port: 8445 # External TCP port for Reality stream

roles/raven_subscribe/defaults/secrets.yml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
raven_subscribe_admin_token: ""
88

99
# Public URL used in subscription links — must be the relay domain
10-
raven_subscribe_base_url: "https://my.zirgate.com"
10+
raven_subscribe_base_url: "https://my.example.com"
1111

1212
# EU VPS public IP or domain (used in generated client outbound addresses)
1313
raven_subscribe_server_host: ""

roles/relay/defaults/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
# Relay role — nginx reverse proxy on RU VPS
3-
# Domain: zirgate.com
4-
# zirgate.com A → RU VPS IP (static stub site)
5-
# my.zirgate.com A → RU VPS IP (relay → Raven subscriptions + API)
3+
# Domain layout example:
4+
# example.com A → RU VPS IP (static stub site)
5+
# my.example.com A → RU VPS IP (relay → Raven subscriptions + API)
66
#
77
# EU server (managed by nginx_frontend role, not this role):
8-
# media.zirgate.com A → EU VPS IP (nginx_frontend → Xray XHTTP)
8+
# media.example.com A → EU VPS IP (nginx_frontend → Xray XHTTP)
99

1010
# ── Domain ───────────────────────────────────────────────────────────────────
11-
relay_domain: "zirgate.com"
11+
relay_domain: "example.com" # Set to your RU VPS domain
1212
relay_sub_my: "my.{{ relay_domain }}" # Raven-subscribe relay (RU VPS)
1313

1414
# ── Upstream EU server ────────────────────────────────────────────────────────
@@ -21,7 +21,7 @@ relay_upstream_raven_port: 8443
2121

2222
# ── TCP stream relay (VLESS Reality) ─────────────────────────────────────────
2323
# Proxies raw TCP on relay_stream_port → EU server:relay_upstream_xray_port
24-
# Clients connect to zirgate.com:relay_stream_port instead of EU IP directly.
24+
# Clients connect to example.com:relay_stream_port instead of EU IP directly.
2525
relay_stream_enabled: true
2626
relay_stream_port: 8444 # Listening port on RU server (must be free)
2727
relay_upstream_xray_port: 8445 # nginx_frontend Reality stream port on EU server
@@ -31,7 +31,7 @@ relay_nginx_user: "www-data"
3131
relay_webroot: "/var/www/{{ relay_domain }}"
3232

3333
# ── Certbot ───────────────────────────────────────────────────────────────────
34-
relay_certbot_email: "" # Set in secrets.yml: relay_certbot_email: "admin@zirgate.com"
34+
relay_certbot_email: "" # Set in secrets.yml: relay_certbot_email: "admin@example.com"
3535

3636
# ── Stub site ─────────────────────────────────────────────────────────────────
3737
relay_stub_title: "Welcome"

roles/relay/inventory.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[relay]
2-
zirgate ansible_host=RU_VPS_IP ansible_user=deploy
2+
relay ansible_host=RU_VPS_IP ansible_user=deploy

roles/relay/templates/nginx/https.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ server {
88
return 301 https://$host$request_uri;
99
}
1010

11-
# ── zirgate.com — stub site ──────────────────────────────────────────────────
11+
# ── {{ relay_domain }} — stub site ──────────────────────────────────────────────────
1212
server {
1313
listen 443 ssl;
1414
http2 on;
@@ -27,7 +27,7 @@ server {
2727
}
2828
}
2929

30-
# ── my.zirgate.com — Raven-subscribe relay ───────────────────────────────────
30+
# ── {{ relay_sub_my }} — Raven-subscribe relay ───────────────────────────────────
3131
server {
3232
listen 443 ssl;
3333
http2 on;

roles/role_nginx_frontend.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
# nginx frontend playbook — EU server (media.zirgate.com)
2+
# nginx frontend playbook — EU VPS
33
# Usage:
44
# ansible-playbook roles/role_nginx_frontend.yml -i roles/nginx_frontend/inventory.ini \
55
# --vault-password-file vault_password.txt
@@ -9,9 +9,10 @@
99
# nginx_frontend_nginx — deploy HTTP config
1010
# nginx_frontend_certbot — obtain TLS certificate
1111
# nginx_frontend_ssl — deploy HTTPS config with proxy_pass
12+
# nginx_frontend_stream — deploy TCP stream relay for VLESS Reality
1213

13-
- name: Configure nginx frontend (vpn.zirgate.com)
14-
hosts: vm_my_srv
14+
- name: Configure nginx frontend
15+
hosts: eu
1516
become: true
1617

1718
vars_files:

roles/role_relay.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
# Relay playbook — RU VPS (zirgate.com)
2+
# Relay playbook — RU VPS
33
# Usage:
44
# ansible-playbook roles/role_relay.yml -i roles/relay/inventory.ini \
55
# --vault-password-file vault_password.txt
@@ -10,9 +10,10 @@
1010
# relay_nginx — deploy HTTP nginx config
1111
# relay_certbot — obtain TLS certificates
1212
# relay_nginx_ssl — deploy HTTPS nginx config with proxy_pass
13+
# relay_stream — deploy TCP stream relay for VLESS Reality
1314

14-
- name: Configure relay server (zirgate.com)
15-
hosts: vm_my_ru
15+
- name: Configure relay server
16+
hosts: relay
1617
become: true
1718

1819
vars_files:

0 commit comments

Comments
 (0)