summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorsergei <sergei@em-sysadmin.xyz>2026-04-14 06:23:55 +0400
committersergei <sergei@em-sysadmin.xyz>2026-04-14 06:23:55 +0400
commit3d51aa455006903345f554a2dd90034993796114 (patch)
tree62a7be2faf047f5eb7886feebc3b815556f03d7f /scripts
downloadvpnem-main.tar.gz
vpnem-main.tar.bz2
vpnem-main.zip
vpnem: VPN infrastructure with load-balanced multi-protocol nodesHEADmain
- Multi-protocol VPS nodes (VLESS-REALITY + Hysteria2 + SOCKS5) - Smart load balancing via recommendation API - Windows/Linux client (Go + Wails + sing-box) - Server API with RealIP detection and connection tracking - Auto-deployment via vpnui control plane - Silent Windows installer with UAC elevation - Load-based server recommendation (no sticky sessions) - Best Server one-click connection workflow
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install-ruleset-timer.sh13
-rwxr-xr-xscripts/update-rulesets.sh37
2 files changed, 50 insertions, 0 deletions
diff --git a/scripts/install-ruleset-timer.sh b/scripts/install-ruleset-timer.sh
new file mode 100755
index 0000000..dc34008
--- /dev/null
+++ b/scripts/install-ruleset-timer.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -euo pipefail
+
+SERVICE_SRC="${1:-/opt/vpnem/deploy/systemd/vpnem-rulesets-update.service}"
+TIMER_SRC="${2:-/opt/vpnem/deploy/systemd/vpnem-rulesets-update.timer}"
+SYSTEMD_DIR="${3:-/etc/systemd/system}"
+
+install -m 0644 "$SERVICE_SRC" "$SYSTEMD_DIR/vpnem-rulesets-update.service"
+install -m 0644 "$TIMER_SRC" "$SYSTEMD_DIR/vpnem-rulesets-update.timer"
+systemctl daemon-reload
+systemctl enable --now vpnem-rulesets-update.timer
+systemctl start vpnem-rulesets-update.service
+systemctl --no-pager --full status vpnem-rulesets-update.timer
diff --git a/scripts/update-rulesets.sh b/scripts/update-rulesets.sh
new file mode 100755
index 0000000..24dcfcb
--- /dev/null
+++ b/scripts/update-rulesets.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Downloads public .srs rule-sets from GitHub
+# Run via cron: 0 4 * * 1 /opt/vpnem/scripts/update-rulesets.sh
+
+set -euo pipefail
+
+RULES_DIR="${1:-/opt/vpnem/data/rules}"
+mkdir -p "$RULES_DIR"
+
+download() {
+ local url="$1"
+ local dest="$2"
+ local tmp="${dest}.tmp"
+
+ if wget -q -O "$tmp" "$url"; then
+ mv "$tmp" "$dest"
+ echo "OK: $(basename "$dest")"
+ else
+ rm -f "$tmp"
+ echo "FAIL: $(basename "$dest")"
+ return 1
+ fi
+}
+
+download \
+ "https://github.com/1andrevich/Re-filter-lists/releases/latest/download/ruleset-domain-refilter_domains.srs" \
+ "$RULES_DIR/refilter-domains.srs"
+
+download \
+ "https://github.com/1andrevich/Re-filter-lists/releases/latest/download/ruleset-ip-refilter_ipsum.srs" \
+ "$RULES_DIR/refilter-ip.srs"
+
+download \
+ "https://github.com/legiz-ru/sb-rule-sets/raw/main/discord-voice-ip-list.srs" \
+ "$RULES_DIR/discord-voice-ip-list.srs"
+
+echo "Rule-set update complete"