Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fff1c758c9 | |||
| 247bc69b4f | |||
| 54908c7d97 | |||
| 678fe04d9a | |||
| 2363a04af3 | |||
| bc7bda8a12 | |||
| 4ab805bc21 | |||
| b18b002d55 | |||
| 9439984cd2 | |||
| 7e2a908da7 | |||
| b7500c278d | |||
| fb075463ee | |||
| 321b853d42 |
@@ -8,4 +8,5 @@ TGPORT=4443
|
|||||||
IMAGE=alpine:3.18.2
|
IMAGE=alpine:3.18.2
|
||||||
IP=
|
IP=
|
||||||
VER=
|
VER=
|
||||||
|
TELEGRAM_API=api.telegram.org
|
||||||
ENV=/root/.ashrc
|
ENV=/root/.ashrc
|
||||||
+631
-149
File diff suppressed because it is too large
Load Diff
+1
-3
@@ -1,8 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// ini_set('display_errors', 'On');
|
error_reporting(E_ALL | E_NOTICE);
|
||||||
// ini_set("log_errors", 1);
|
|
||||||
// ini_set("error_log", '/logs/php_error');
|
|
||||||
|
|
||||||
$debug = [
|
$debug = [
|
||||||
'raw' => file_get_contents('php://input'),
|
'raw' => file_get_contents('php://input'),
|
||||||
|
|||||||
@@ -261,6 +261,10 @@ $i = [
|
|||||||
'en' => 'setSecret',
|
'en' => 'setSecret',
|
||||||
'ru' => 'установить свой ключ',
|
'ru' => 'установить свой ключ',
|
||||||
],
|
],
|
||||||
|
'setAdTag' => [
|
||||||
|
'en' => 'set adtag',
|
||||||
|
'ru' => 'установить adtag',
|
||||||
|
],
|
||||||
'defaultDNS' => [
|
'defaultDNS' => [
|
||||||
'en' => 'defaultDNS',
|
'en' => 'defaultDNS',
|
||||||
'ru' => 'дефолтный днс',
|
'ru' => 'дефолтный днс',
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
ini_set('session.use_cookies', 0);
|
||||||
|
|
||||||
require __DIR__ . '/timezone.php';
|
require __DIR__ . '/timezone.php';
|
||||||
|
|
||||||
require __DIR__ . '/bot.php';
|
require __DIR__ . '/bot.php';
|
||||||
@@ -11,6 +13,6 @@ if ($c['debug']) {
|
|||||||
|
|
||||||
$bot = new Bot($c['key'], $i);
|
$bot = new Bot($c['key'], $i);
|
||||||
$bot->cleanQueue();
|
$bot->cleanQueue();
|
||||||
$bot->setwebhook();
|
|
||||||
$bot->syncPortClients();
|
$bot->syncPortClients();
|
||||||
$bot->setcommands();
|
$bot->setcommands();
|
||||||
|
$bot->polling();
|
||||||
|
|||||||
@@ -30,3 +30,4 @@ $c = $bot->getPacConf();
|
|||||||
$bot->setUpstreamDomain($c['transport'] != 'Reality' ? 't' : $c['reality']['domain']);
|
$bot->setUpstreamDomain($c['transport'] != 'Reality' ? 't' : $c['reality']['domain']);
|
||||||
$bot->setUpstreamDomainNaive($c['domain']);
|
$bot->setUpstreamDomainNaive($c['domain']);
|
||||||
$bot->setUpstreamDomainOcserv($c['domain']);
|
$bot->setUpstreamDomainOcserv($c['domain']);
|
||||||
|
$bot->restartXray($bot->getXray());
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"mixed-port": 2080,
|
|
||||||
"allow-lan": true,
|
|
||||||
"tcp-concurrent": true,
|
"tcp-concurrent": true,
|
||||||
"enable-process": true,
|
"enable-process": true,
|
||||||
"find-process-mode": "strict",
|
"find-process-mode": "strict",
|
||||||
@@ -50,7 +48,6 @@
|
|||||||
},
|
},
|
||||||
"dns": {
|
"dns": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"listen": ":1053",
|
|
||||||
"prefer-h3": false,
|
"prefer-h3": false,
|
||||||
"ipv6": false,
|
"ipv6": false,
|
||||||
"enhanced-mode": "fake-ip",
|
"enhanced-mode": "fake-ip",
|
||||||
|
|||||||
+4
-4
@@ -214,7 +214,7 @@ services:
|
|||||||
- dnstt
|
- dnstt
|
||||||
- hy
|
- hy
|
||||||
wg:
|
wg:
|
||||||
image: mercurykd/vpnbot-wg:1.2
|
image: mercurykd/vpnbot-wg:1.3
|
||||||
build:
|
build:
|
||||||
dockerfile: dockerfile/wireguard.dockerfile
|
dockerfile: dockerfile/wireguard.dockerfile
|
||||||
args:
|
args:
|
||||||
@@ -252,7 +252,7 @@ services:
|
|||||||
ipv4_address: 10.10.0.4
|
ipv4_address: 10.10.0.4
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
wg1:
|
wg1:
|
||||||
image: mercurykd/vpnbot-wg:1.2
|
image: mercurykd/vpnbot-wg:1.3
|
||||||
build:
|
build:
|
||||||
dockerfile: dockerfile/wireguard.dockerfile
|
dockerfile: dockerfile/wireguard.dockerfile
|
||||||
args:
|
args:
|
||||||
@@ -354,7 +354,7 @@ services:
|
|||||||
ipv4_address: 10.10.0.8
|
ipv4_address: 10.10.0.8
|
||||||
logging: *default-logging
|
logging: *default-logging
|
||||||
xr:
|
xr:
|
||||||
image: mercurykd/vpnbot-xr:1.5
|
image: mercurykd/vpnbot-xr:1.6
|
||||||
build:
|
build:
|
||||||
dockerfile: dockerfile/xray.dockerfile
|
dockerfile: dockerfile/xray.dockerfile
|
||||||
args:
|
args:
|
||||||
@@ -418,7 +418,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.2
|
image: mercurykd/vpnbot-np:1.3
|
||||||
build:
|
build:
|
||||||
dockerfile: dockerfile/naive.dockerfile
|
dockerfile: dockerfile/naive.dockerfile
|
||||||
args:
|
args:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
ARG image
|
ARG image
|
||||||
FROM golang:alpine as go
|
FROM golang:alpine as go
|
||||||
RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest \
|
RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest \
|
||||||
&& /go/bin/xcaddy build --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive
|
&& /go/bin/xcaddy build --with github.com/caddyserver/forwardproxy=github.com/klzgrad/forwardproxy@naive
|
||||||
FROM $image
|
FROM $image
|
||||||
COPY --from=go /go/caddy /usr/local/bin/
|
COPY --from=go /go/caddy /usr/local/bin/
|
||||||
RUN apk add openssh \
|
RUN apk add openssh \
|
||||||
|
|||||||
@@ -13,4 +13,9 @@ RUN apk add --no-cache --virtual .build-deps alpine-sdk git \
|
|||||||
&& apk del .build-deps \
|
&& apk del .build-deps \
|
||||||
&& rm -rf /amneziawg-go \
|
&& rm -rf /amneziawg-go \
|
||||||
&& rm -rf /amneziawg-tools \
|
&& rm -rf /amneziawg-tools \
|
||||||
&& mkdir /root/.ssh
|
&& mkdir /root/.ssh \
|
||||||
|
&& cd /tmp \
|
||||||
|
&& wget -O tun2socks.zip https://github.com/xjasonlyu/tun2socks/releases/download/v2.6.0/tun2socks-linux-amd64.zip \
|
||||||
|
&& unzip tun2socks.zip \
|
||||||
|
&& mv tun2socks-linux-amd64 /usr/bin/tun2socks \
|
||||||
|
&& chmod +x /usr/bin/tun2socks
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
-include .env
|
||||||
|
export
|
||||||
|
|
||||||
|
IP := $(or $(IP),$(shell hostname -I | awk '{print $$1}'))
|
||||||
|
|
||||||
b:
|
b:
|
||||||
docker compose build
|
docker compose build
|
||||||
u: # запуск контейнеров
|
u: # запуск контейнеров
|
||||||
$(eval IP := $(shell hostname -I | awk '{print $$1}'))
|
|
||||||
bash ./update/update.sh &
|
bash ./update/update.sh &
|
||||||
touch ./override.env ./docker-compose.override.yml ./config/location.conf ./config/override.conf
|
touch ./override.env ./docker-compose.override.yml ./config/location.conf ./config/override.conf
|
||||||
IP=$(IP) VER=$(shell git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
|
IP=$(IP) VER=$(shell git describe --tags) docker compose --env-file ./.env --env-file ./override.env up -d --force-recreate
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
rm /ssh/key*
|
rm /ssh/key*
|
||||||
ssh-keygen -m PEM -t rsa -f /ssh/key -N ''
|
ssh-keygen -m PEM -t rsa -f /ssh/key -N ''
|
||||||
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 365 -keyout /certs/self_private -out /certs/self_public -subj "/C=NN/ST=N/L=N/O=N/CN=$IP"
|
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 365 -keyout /certs/self_private -out /certs/self_public -subj "/C=NN/ST=N/L=N/O=N/CN=$IP"
|
||||||
php init.php
|
if [[ -f "/ssh/key.pub" && -s "/ssh/key.pub" ]]; then
|
||||||
if [[ -f "/start" && -f "/ssh/key.pub" && -s "/ssh/key.pub" ]]; then
|
unitd --control 0.0.0.0:8080 --log /logs/unit_error
|
||||||
unitd --log /logs/unit_error
|
curl -X PUT --data-binary @/config/unit.json http://127.0.0.1:8080/config
|
||||||
curl -X PUT --data-binary @/config/unit.json --unix-socket /var/run/control.unit.sock http://localhost/config
|
php init.php
|
||||||
pkill unitd
|
|
||||||
unitd --no-daemon --control 0.0.0.0:8080 --log /logs/unit_error
|
|
||||||
else
|
else
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
INTERFACE_VPN="tun0"
|
||||||
|
TABLE_ID=100
|
||||||
|
|
||||||
cat /ssh/key.pub > /root/.ssh/authorized_keys
|
cat /ssh/key.pub > /root/.ssh/authorized_keys
|
||||||
ssh-keygen -A
|
ssh-keygen -A
|
||||||
exec /usr/sbin/sshd -D -e "$@" &
|
exec /usr/sbin/sshd -D -e "$@" &
|
||||||
@@ -66,4 +70,15 @@ else
|
|||||||
sh /block_exchange.sh
|
sh /block_exchange.sh
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ip tuntap add mode tun dev $INTERFACE_VPN || true
|
||||||
|
ip addr add 10.255.0.1/24 dev $INTERFACE_VPN || true
|
||||||
|
ip link set up dev $INTERFACE_VPN
|
||||||
|
ip rule add from $ADDRESS table $TABLE_ID || true
|
||||||
|
ip route add default dev $INTERFACE_VPN table $TABLE_ID || true
|
||||||
|
iptables -A FORWARD -i $INTERFACE_VPN -j ACCEPT
|
||||||
|
iptables -A FORWARD -o $INTERFACE_VPN -j ACCEPT
|
||||||
|
iptables -t nat -I POSTROUTING 1 -s $ADDRESS -j RETURN
|
||||||
|
tun2socks -device $INTERFACE_VPN -proxy socks5://xr:10808 &
|
||||||
|
|
||||||
tail -f /dev/null
|
tail -f /dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user