Compare commits

...

6 Commits

Author SHA1 Message Date
mercury 3c16620a7d update version 2024-03-07 11:58:25 +04:00
mercury b1efd9f400 fix syncports 2024-03-07 11:52:34 +04:00
mercury cbe0ef8a12 check webhook 2024-03-07 10:46:55 +04:00
mercury 24026d3678 optimize images 2024-03-07 10:23:13 +04:00
mercury dea46815c7 override environment 2024-03-07 10:20:43 +04:00
mercury 11e34d8c4e unversary path for vpnbot.service 2024-03-06 15:15:45 +04:00
11 changed files with 101 additions and 52 deletions
+1
View File
@@ -8,3 +8,4 @@ TGPORT=4443
IMAGE=alpine:3.18.2
IP=
VER=
ENV=/root/.ashrc
+2
View File
@@ -18,3 +18,5 @@
mirror/.env
update/*
!update/update.sh
override.env
+2 -2
View File
@@ -4060,8 +4060,8 @@ DNS-over-HTTPS with IP:
$this->wg = $i;
$clients = $this->readClients();
foreach ($clients as $k => $v) {
foreach ($v['peers'] as $i => $j) {
$clients[$k]['peers'][$i]['Endpoint'] = $endpoint[$i];
foreach ($v['peers'] as $n => $j) {
$clients[$k]['peers'][$n]['Endpoint'] = $endpoint[$i];
}
}
$this->saveClients($clients);
+11
View File
@@ -0,0 +1,11 @@
<?php
require './config.php';
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.telegram.org/bot{$c['key']}/getWebhookInfo",
CURLOPT_RETURNTRANSFER => true,
]);
$res = curl_exec($ch);
die(var_dump($res));
+68 -46
View File
@@ -41,8 +41,11 @@ services:
condition: service_started
ss:
condition: service_started
environment:
TZ: ${TZ}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_upstream.sh"]
networks:
@@ -73,9 +76,11 @@ services:
depends_on:
up:
condition: service_started
environment:
TZ: ${TZ}
SSPORT: ${SSPORT}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_ng.sh"]
networks:
@@ -88,6 +93,8 @@ services:
dockerfile: dockerfile/php.dockerfile
args:
image: ${IMAGE}
ports:
- 127.0.0.1:8081:8080
volumes:
- ./config/.profile:/root/.ashrc:ro
- ./config/php.ini:/etc/php81/php.ini
@@ -103,15 +110,13 @@ services:
- ./.env:/mirror/.env
- ./update:/update
environment:
TZ: ${TZ}
IP: ${IP}
ADDRESS: ${WGADDRESS}
WGPORT: ${WGPORT}
WG1ADDRESS: ${WG1ADDRESS}
WG1PORT: ${WG1PORT}
SSPORT: ${SSPORT}
TGPORT: ${TGPORT}
VER: ${VER}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
hostname: php
container_name: php-${VER}
restart: unless-stopped
@@ -130,7 +135,7 @@ services:
timeout: 5s
retries: 5
service:
image: mercurykd/vpnbot-php:1.1
image: mercurykd/vpnbot-php:1.2
build:
dockerfile: dockerfile/php.dockerfile
args:
@@ -146,15 +151,13 @@ services:
- ./update:/update
- ./scripts/start_service.sh:/start_service.sh
environment:
TZ: ${TZ}
IP: ${IP}
ADDRESS: ${WGADDRESS}
WGPORT: ${WGPORT}
WG1ADDRESS: ${WG1ADDRESS}
WG1PORT: ${WG1PORT}
SSPORT: ${SSPORT}
TGPORT: ${TGPORT}
VER: ${VER}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
hostname: service
container_name: service-${VER}
# restart: unless-stopped
@@ -200,7 +203,11 @@ services:
ipv4_address: 10.10.0.3
environment:
TZ: ${TZ}
SSPORT: ${SSPORT}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_proxy.sh"]
logging: *default-logging
@@ -227,11 +234,11 @@ services:
condition: service_healthy
ports:
- ${WGPORT}:${WGPORT}/udp
environment:
TZ: ${TZ}
WGPORT: ${WGPORT}
ADDRESS: ${WGADDRESS}
ENV: /root/.ashrc
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
cap_add:
- NET_ADMIN
devices:
@@ -265,11 +272,11 @@ services:
condition: service_healthy
ports:
- ${WG1PORT}:${WG1PORT}/udp
environment:
TZ: ${TZ}
WGPORT: ${WG1PORT}
ADDRESS: ${WG1ADDRESS}
ENV: /root/.ashrc
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
cap_add:
- NET_ADMIN
devices:
@@ -304,8 +311,11 @@ services:
depends_on:
php:
condition: service_healthy
environment:
TZ: ${TZ}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
networks:
default:
@@ -334,9 +344,11 @@ services:
ports:
- ${SSPORT}:${SSPORT}/tcp
- ${SSPORT}:${SSPORT}/udp
environment:
TZ: ${TZ}
SSPORT: ${SSPORT}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_ss.sh"]
networks:
@@ -361,9 +373,12 @@ services:
ports:
- ${TGPORT}:${TGPORT}
environment:
TZ: ${TZ}
IP: ${IP}
TGPORT: ${TGPORT}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_tg.sh"]
networks:
@@ -387,8 +402,11 @@ services:
depends_on:
php:
condition: service_healthy
environment:
TZ: ${TZ}
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_xray.sh"]
networks:
@@ -413,9 +431,11 @@ services:
depends_on:
php:
condition: service_healthy
environment:
TZ: ${TZ}
ENV: /root/.ashrc
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_oc.sh"]
cap_add:
@@ -444,9 +464,11 @@ services:
depends_on:
php:
condition: service_healthy
environment:
TZ: ${TZ}
ENV: /root/.ashrc
env_file:
- path: ./.env
required: true # default
- path: ./override.env
required: false
stop_grace_period: 1s
command: ["/bin/sh", "/start_np.sh"]
cap_add:
+3 -1
View File
@@ -55,4 +55,6 @@ s:
c:
git add config/
git checkout .
git reset
git reset
webhook:
docker compose exec php php checkwebhook.php
+2 -1
View File
@@ -1,3 +1,4 @@
cp scripts/vpnbot.service /etc/systemd/system/vpnbot.service
path=`pwd`
sed "s|path|$path|g" "$path/scripts/vpnbot.service" > /etc/systemd/system/vpnbot.service
systemctl daemon-reload
systemctl enable vpnbot
+1 -1
View File
@@ -6,4 +6,4 @@ php cron.php &
unitd --log /logs/unit_error
curl -X PUT --data-binary @/config/unit.json --unix-socket /var/run/control.unit.sock http://localhost/config
pkill unitd
unitd --no-daemon --log /logs/unit_error
unitd --no-daemon --control 0.0.0.0:8080 --log /logs/unit_error
+1 -1
View File
@@ -5,7 +5,7 @@ After=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/root/vpnbot
WorkingDirectory=path
ExecStart=/bin/sh -c "IP=$(curl https://ipinfo.io/ip) VER=$(git describe --tags) docker compose up -d --force-recreate"
ExecStartPost=/bin/sh -c "bash ./update/update.sh &"
ExecStop=/bin/sh -c "docker compose down --remove-orphans"
+6
View File
@@ -0,0 +1,6 @@
@url = http://127.0.0.1:8081
###
GET {{url}}/status
###
GET {{url}}/config
+4
View File
@@ -1,3 +1,7 @@
07.03.2024 v1.8.6
- фикс синхронизации клиентов амнезии, бот падал после рестарта, клиенты пропадали
- возможность переназначить порты в override.env, файл не отслеживаемый, обновление не будет его сбрасывать
- убрал дублирование образа php
06.03.2024
- короткие ссылки для амнезии
- фикс работы openconnect