Compare commits

...

21 Commits

Author SHA1 Message Date
mercury 364dbd6408 xhttp from legiz 2025-12-02 22:41:08 +04:00
mercury 57ee403070 added hysteria 2025-12-01 00:13:19 +04:00
mercury b5ab8fb4eb command to add to cron to restart the bot when restarting the vps 2025-11-30 21:06:16 +04:00
mercury 95c6a023d0 iodine -> dnstt 2025-11-30 20:46:31 +04:00
mercury 9f196ca58e issue #36 fix 2025-11-29 22:32:50 +04:00
mercury 665b4007eb improve cron handlers 2025-11-28 02:43:29 +04:00
mercury 9c9f42e9e4 update mtproto image 2025-11-28 02:06:19 +04:00
mercury 30c260bf02 fix override html 2025-11-27 21:41:59 +04:00
mercury a3c59991ce fix override html 2025-11-27 21:35:09 +04:00
mercury 288435e2a0 support quic destination override 2025-11-27 14:29:41 +04:00
mercury 1b1acee59f Ruleset polling timeout increased to 60 seconds 2025-11-27 02:16:59 +04:00
mercury a8d121b7e1 adaptation of the warp, block list to the presence of ipcidr for all kernel configs 2025-11-27 02:15:22 +04:00
mercury f6d2c89e8d xray statistics are collected once per minute 2025-11-27 02:12:22 +04:00
mercury e4863eb645 update warp image 2025-11-26 11:54:13 +04:00
mercury bc28be571b fix warp rules for xray 2025-11-26 10:22:35 +04:00
mercury 34f5f32a82 warp list create classical ruleset for mihomo 2025-11-26 10:03:29 +04:00
mercury fc4c28edfb naiveproxy image update 2025-11-26 01:10:06 +04:00
mercury c352270b39 Fix overwriting fingerprint for vray 2025-11-26 01:03:55 +04:00
mercury 2ee6c3392b ability to add IPs and subnets to warplist 2025-11-26 00:50:43 +04:00
mercury 9bd85c9e05 empty password stoped openconnect and naive, fix 2025-11-10 00:24:35 +04:00
mercury 82e51c0d9c empty password stoped openconnect and naive 2025-11-10 00:14:04 +04:00
19 changed files with 942 additions and 297 deletions
+787 -246
View File
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -24,4 +24,9 @@ $bot->adguardSync();
$bot->cloakNginx(); $bot->cloakNginx();
$bot->syncDeny(); $bot->syncDeny();
$bot->cleanDocker(); $bot->cleanDocker();
$bot->iodineRestart(); $bot->dnsttStart();
$c = $bot->getPacConf();
$bot->setUpstreamDomain($c['pac']['transport'] != 'Reality' ? 't' : ($c['pac']['reality']['domain'] ?: $c['xray']['inbounds'][0]['streamSettings']['realitySettings']['serverNames'][0]));
$bot->setUpstreamDomainNaive($c['domain']);
$bot->setUpstreamDomainOcserv($c['domain']);
$bot->setUpstreamDomainHysteria($c['domain']);
+8 -8
View File
@@ -8,7 +8,7 @@
"mode": "rule", "mode": "rule",
"log-level": "info", "log-level": "info",
"ipv6": false, "ipv6": false,
"keep-alive-interval": 30, "keep-alive-interval": 60,
"unified-delay": false, "unified-delay": false,
"profile": { "profile": {
"store-selected": true, "store-selected": true,
@@ -98,7 +98,7 @@
"type": "RULE-SET", "type": "RULE-SET",
"list": "~block~", "list": "~block~",
"action": "REJECT", "action": "REJECT",
"interval": 30, "interval": 60,
"behavior": "domain", "behavior": "domain",
"name": "block" "name": "block"
}, },
@@ -106,7 +106,7 @@
"type": "RULE-SET", "type": "RULE-SET",
"list": "~process~", "list": "~process~",
"action": "PROXY", "action": "PROXY",
"interval": 30, "interval": 60,
"behavior": "classical", "behavior": "classical",
"name": "process" "name": "process"
}, },
@@ -114,7 +114,7 @@
"type": "RULE-SET", "type": "RULE-SET",
"list": "~package~", "list": "~package~",
"action": "PROXY", "action": "PROXY",
"interval": 30, "interval": 60,
"behavior": "classical", "behavior": "classical",
"name": "package" "name": "package"
}, },
@@ -122,15 +122,15 @@
"type": "RULE-SET", "type": "RULE-SET",
"list": "~warp~", "list": "~warp~",
"action": "PROXY", "action": "PROXY",
"interval": 30, "interval": 60,
"behavior": "domain", "behavior": "classical",
"name": "warp" "name": "warp"
}, },
{ {
"type": "RULE-SET", "type": "RULE-SET",
"list": "~pac~", "list": "~pac~",
"action": "PROXY", "action": "PROXY",
"interval": 30, "interval": 60,
"behavior": "domain", "behavior": "domain",
"name": "pac" "name": "pac"
}, },
@@ -138,7 +138,7 @@
"type": "RULE-SET", "type": "RULE-SET",
"list": "~subnet~", "list": "~subnet~",
"action": "PROXY", "action": "PROXY",
"interval": 30, "interval": 60,
"behavior": "ipcidr", "behavior": "ipcidr",
"name": "subnet" "name": "subnet"
}, },
+9
View File
@@ -0,0 +1,9 @@
listen: :443
proxy_protocol: true
tls:
cert: /certs/cert_public
key: /certs/cert_private
auth:
type: password
password:
+10
View File
@@ -48,6 +48,11 @@ http {
try_files $uri /override.html @auth; try_files $uri /override.html @auth;
} }
location /override/ {
alias /app/override/;
try_files $uri =404;
}
location / { location / {
root /app; root /app;
auth_basic "Restricted Content"; auth_basic "Restricted Content";
@@ -142,6 +147,11 @@ http {
# try_files $uri /override.html @auth; # try_files $uri /override.html @auth;
# } # }
# location /override/ {
# alias /app/override/;
# try_files $uri =404;
# }
# location / { # location / {
# root /app; # root /app;
# auth_basic "Restricted Content"; # auth_basic "Restricted Content";
+10
View File
@@ -48,6 +48,11 @@ http {
try_files $uri /override.html @auth; try_files $uri /override.html @auth;
} }
location /override/ {
alias /app/override/;
try_files $uri =404;
}
location / { location / {
root /app; root /app;
auth_basic "Restricted Content"; auth_basic "Restricted Content";
@@ -142,6 +147,11 @@ http {
# try_files $uri /override.html @auth; # try_files $uri /override.html @auth;
# } # }
# location /override/ {
# alias /app/override/;
# try_files $uri =404;
# }
# location / { # location / {
# root /app; # root /app;
# auth_basic "Restricted Content"; # auth_basic "Restricted Content";
+6 -6
View File
@@ -119,7 +119,7 @@
"createruleset": [ "createruleset": [
{ {
"name": "pac", "name": "pac",
"interval": "30s", "interval": "60s",
"rules": [ "rules": [
{ {
"domain_suffix": "~pac~" "domain_suffix": "~pac~"
@@ -134,7 +134,7 @@
"createruleset": [ "createruleset": [
{ {
"name": "subnet", "name": "subnet",
"interval": "30s", "interval": "60s",
"rules": [ "rules": [
{ {
"ip_cidr": "~subnet~" "ip_cidr": "~subnet~"
@@ -149,7 +149,7 @@
"createruleset": [ "createruleset": [
{ {
"name": "package", "name": "package",
"interval": "30s", "interval": "60s",
"rules": [ "rules": [
{ {
"package_name": "~package~" "package_name": "~package~"
@@ -164,7 +164,7 @@
"createruleset": [ "createruleset": [
{ {
"name": "process", "name": "process",
"interval": "30s", "interval": "60s",
"rules": [ "rules": [
{ {
"process_name": "~process~" "process_name": "~process~"
@@ -179,7 +179,7 @@
"createruleset": [ "createruleset": [
{ {
"name": "block", "name": "block",
"interval": "30s", "interval": "60s",
"rules": [ "rules": [
{ {
"domain_suffix": "~block~" "domain_suffix": "~block~"
@@ -194,7 +194,7 @@
"createruleset": [ "createruleset": [
{ {
"name": "warp", "name": "warp",
"interval": "30s", "interval": "60s",
"rules": [ "rules": [
{ {
"domain_suffix": "~warp~" "domain_suffix": "~warp~"
+8 -4
View File
@@ -83,9 +83,9 @@ AuthorizedKeysFile .ssh/authorized_keys
#AllowAgentForwarding yes #AllowAgentForwarding yes
# Feel free to re-enable these if your use case requires them. # Feel free to re-enable these if your use case requires them.
AllowTcpForwarding no # AllowTcpForwarding no
GatewayPorts no # GatewayPorts no
X11Forwarding no # X11Forwarding no
#X11DisplayOffset 10 #X11DisplayOffset 10
#X11UseLocalhost yes #X11UseLocalhost yes
#PermitTTY yes #PermitTTY yes
@@ -117,4 +117,8 @@ Subsystem sftp internal-sftp
# ForceCommand cvs server # ForceCommand cvs server
HostKeyAlgorithms +ssh-rsa HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa PubkeyAcceptedKeyTypes +ssh-rsa
PasswordAuthentication no PasswordAuthentication yes
AllowTcpForwarding yes
PermitTunnel yes
GatewayPorts yes
X11Forwarding yes
+8
View File
@@ -32,6 +32,10 @@ stream {
server np:443; server np:443;
} }
upstream hysteria {
server hy:443;
}
map_hash_bucket_size 128; map_hash_bucket_size 128;
map $ssl_preread_server_name $sni_name { map $ssl_preread_server_name $sni_name {
#domain #domain
@@ -45,6 +49,10 @@ stream {
#naive #naive
#np.domain naive; #np.domain naive;
#naive #naive
#hysteria
#hy.domain hysteria;
#hysteria
default other; default other;
} }
+2 -1
View File
@@ -11,7 +11,8 @@
"sniffing": { "sniffing": {
"destOverride": [ "destOverride": [
"http", "http",
"tls" "tls",
"quic"
], ],
"enabled": true "enabled": true
}, },
+52 -15
View File
@@ -43,7 +43,7 @@ services:
php: php:
condition: service_healthy condition: service_healthy
ng: ng:
condition: service_started condition: service_healthy
ad: ad:
condition: service_started condition: service_started
ss: ss:
@@ -54,6 +54,8 @@ services:
condition: service_started condition: service_started
np: np:
condition: service_started condition: service_started
hy:
condition: service_started
env_file: env_file:
- path: ./.env - path: ./.env
required: true # default required: true # default
@@ -104,6 +106,11 @@ services:
depends_on: depends_on:
php: php:
condition: service_healthy condition: service_healthy
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 10s
timeout: 5s
retries: 3
php: php:
image: mercurykd/vpnbot-php:1.7 image: mercurykd/vpnbot-php:1.7
build: build:
@@ -206,6 +213,8 @@ services:
- np - np
- proxy - proxy
- ss - ss
- dnstt
- hy
wg: wg:
image: mercurykd/vpnbot-wg:1.1 image: mercurykd/vpnbot-wg:1.1
build: build:
@@ -318,7 +327,7 @@ services:
entrypoint: ["/bin/sh", "/start_ad.sh"] entrypoint: ["/bin/sh", "/start_ad.sh"]
logging: *default-logging logging: *default-logging
tg: tg:
image: mercurykd/vpnbot-tg:1.1 image: mercurykd/vpnbot-tg:1.2
build: build:
dockerfile: dockerfile/telegram.dockerfile dockerfile: dockerfile/telegram.dockerfile
volumes: volumes:
@@ -410,7 +419,7 @@ services:
ipv4_address: 10.10.0.11 ipv4_address: 10.10.0.11
logging: *default-logging logging: *default-logging
np: np:
image: mercurykd/vpnbot-np:1.1 image: mercurykd/vpnbot-np:1.2
build: build:
dockerfile: dockerfile/naive.dockerfile dockerfile: dockerfile/naive.dockerfile
args: args:
@@ -441,7 +450,7 @@ services:
ipv4_address: 10.10.0.12 ipv4_address: 10.10.0.12
logging: *default-logging logging: *default-logging
wp: wp:
image: mercurykd/vpnbot-wp:1.3 image: mercurykd/vpnbot-wp:1.4
build: build:
dockerfile: dockerfile/warp.dockerfile dockerfile: dockerfile/warp.dockerfile
args: args:
@@ -532,21 +541,20 @@ services:
default: default:
ipv4_address: 10.10.0.6 ipv4_address: 10.10.0.6
logging: *default-logging logging: *default-logging
io: dnstt:
image: mercurykd/vpnbot-io:1.0 image: mercurykd/vpnbot-dnstt:1.0
build: build:
dockerfile: dockerfile/iodine.dockerfile dockerfile: dockerfile/dnstt.dockerfile
args:
image: ${IMAGE}
volumes: volumes:
- ./config/.profile:/root/.ashrc:ro - ./config/.profile:/root/.ashrc:ro
- ./ssh:/ssh - ./ssh:/ssh
- ./config/sshd_config:/etc/ssh/sshd_config - ./config/sshd_config:/etc/ssh/sshd_config
- ./scripts/start_io.sh:/start_io.sh - ./config/dnstt:/dnstt
hostname: iodine - ./scripts/start_dnstt.sh:/start_dnstt.sh
cap_add: hostname: dnstt
- NET_ADMIN container_name: dnstt-${VER}
devices:
- /dev/net/tun:/dev/net/tun
container_name: iodine-${VER}
depends_on: depends_on:
php: php:
condition: service_healthy condition: service_healthy
@@ -556,8 +564,37 @@ services:
- path: ./override.env - path: ./override.env
required: false required: false
stop_grace_period: 1s stop_grace_period: 1s
command: ["/bin/sh", "/start_io.sh"] command: ["/bin/sh", "/start_dnstt.sh"]
networks: networks:
default: default:
ipv4_address: 10.10.0.16 ipv4_address: 10.10.0.16
logging: *default-logging logging: *default-logging
hy:
image: mercurykd/vpnbot-hysteria:1.0
build:
dockerfile: dockerfile/hysteria.dockerfile
args:
image: ${IMAGE}
volumes:
- ./config/.profile:/root/.ashrc:ro
- ./ssh:/ssh
- ./config/sshd_config:/etc/ssh/sshd_config
- ./certs:/certs
- ./config:/config
- ./scripts/start_hysteria.sh:/start_hysteria.sh
hostname: hysteria
container_name: hysteria-${VER}
depends_on:
php:
condition: service_healthy
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_hysteria.sh"]
networks:
default:
ipv4_address: 10.10.0.17
logging: *default-logging
+13
View File
@@ -0,0 +1,13 @@
ARG image
FROM golang:alpine AS go
RUN apk add --no-cache git \
&& git clone https://www.bamsoftware.com/git/dnstt.git \
&& cd /go/dnstt/dnstt-server \
&& go build -ldflags="-s -w" -trimpath \
&& rm -rf /go/dnstt/.git \
&& apk del git
FROM $image
COPY --from=go /go/dnstt/dnstt-server/dnstt-server /usr/local/bin/
RUN apk add --no-cache openssh \
&& mkdir -p /root/.ssh
ENV ENV="/root/.ashrc"
+5
View File
@@ -0,0 +1,5 @@
FROM tobyxdd/hysteria
RUN apk add --no-cache openssh \
&& mkdir -p /root/.ssh
ENV ENV="/root/.ashrc"
ENTRYPOINT []
-4
View File
@@ -1,4 +0,0 @@
FROM alpine:3.22
RUN apk add iodine openssh iptables\
&& mkdir /root/.ssh
ENV ENV="/root/.ashrc"
+9 -3
View File
@@ -37,8 +37,10 @@ proxy: # консоль сервиса
docker compose exec proxy /bin/sh docker compose exec proxy /bin/sh
tg: # консоль сервиса tg: # консоль сервиса
docker compose exec tg /bin/sh docker compose exec tg /bin/sh
io: # консоль сервиса dnstt: # консоль сервиса
docker compose exec io /bin/sh docker compose exec dnstt /bin/sh
hy: # консоль сервиса
docker compose exec hy /bin/sh
xr: # консоль сервиса xr: # консоль сервиса
docker compose exec xr /bin/sh docker compose exec xr /bin/sh
oc: # консоль сервиса oc: # консоль сервиса
@@ -71,4 +73,8 @@ reset:
docker volume rm vpnbot_adguard vpnbot_warp docker volume rm vpnbot_adguard vpnbot_warp
make u make u
backup: backup:
docker compose exec php php backup.php > backup.json docker compose exec php php backup.php > backup.json
cron: # установка задачи в cron для автозапуска при перезагрузке
@(crontab -l 2>/dev/null | grep -v "cd /root/vpnbot && make r"; echo "@reboot cd /root/vpnbot && make r") | crontab -
uncron: # удаление задачи из cron
@crontab -l 2>/dev/null | grep -v "cd /root/vpnbot && make r" | crontab -
+4
View File
@@ -0,0 +1,4 @@
cat /ssh/key.pub > /root/.ssh/authorized_keys
ssh-keygen -A
exec /usr/sbin/sshd -D -e "$@" &
tail -f /dev/null
+5
View File
@@ -0,0 +1,5 @@
cat /ssh/key.pub > /root/.ssh/authorized_keys
ssh-keygen -A
exec /usr/sbin/sshd -D -e "$@" &
hysteria server -c /config/hysteria.yaml &
tail -f /dev/null
-7
View File
@@ -1,7 +0,0 @@
cat /ssh/key.pub > /root/.ssh/authorized_keys
ssh-keygen -A
exec /usr/sbin/sshd -D -e "$@" &
iptables -A FORWARD -i dns0 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o dns0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
tail -f /dev/null
-2
View File
@@ -1,6 +1,4 @@
cat /ssh/key.pub > /root/.ssh/authorized_keys cat /ssh/key.pub > /root/.ssh/authorized_keys
echo 'HostKeyAlgorithms +ssh-rsa' >> /etc/ssh/sshd_config
echo 'PubkeyAcceptedKeyTypes +ssh-rsa' >> /etc/ssh/sshd_config
service ssh start service ssh start
off=$(cat /config/pac.json | jq -r .warpoff) off=$(cat /config/pac.json | jq -r .warpoff)
key=$(cat /config/pac.json | jq -r .warp) key=$(cat /config/pac.json | jq -r .warp)