initial commit
This commit is contained in:
commit
13eace9ce9
219 files changed
+6918
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
state=/var/lib/xray-lists
|
||||
|
||||
if [ -e "$state/.reload-nft" ]; then
|
||||
nft -c -f /etc/nftables.conf
|
||||
nft -f /etc/nftables.conf
|
||||
rm -f "$state/.reload-nft"
|
||||
fi
|
||||
|
||||
if [ -e "$state/.reload-dnsmasq" ]; then
|
||||
dnsmasq --test
|
||||
systemctl restart dnsmasq
|
||||
rm -f "$state/.reload-dnsmasq"
|
||||
fi
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
state=/var/lib/xray-lists
|
||||
out=$(/opt/xray-lists/venv/bin/xray-lists --config /etc/xray-lists/config.yaml)
|
||||
|
||||
echo "$out"
|
||||
|
||||
if echo "$out" | grep -A 10 "changed:" | grep -q "nftsets.conf"; then
|
||||
touch "$state/.reload-dnsmasq"
|
||||
fi
|
||||
if echo "$out" | grep -A 10 "changed:" | grep -q "\.elements\.nft"; then
|
||||
touch "$state/.reload-nft"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=Update Xray lists
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=xray-lists
|
||||
Group=xray-lists
|
||||
WorkingDirectory=/var/lib/xray-lists
|
||||
UMask=0022
|
||||
ExecStart=/opt/xray-lists/update.sh
|
||||
ExecStartPost=+/opt/xray-lists/apply.sh
|
||||
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
PrivateDevices=yes
|
||||
ProtectHome=yes
|
||||
ProtectSystem=strict
|
||||
ReadWritePaths=/var/lib/xray-lists
|
||||
ProtectKernelTunables=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectControlGroups=yes
|
||||
RestrictSUIDSGID=yes
|
||||
LockPersonality=yes
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Run xray-lists update
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=12h
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in new issue
Block a user