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
|
||||
IP=
|
||||
VER=
|
||||
TELEGRAM_API=api.telegram.org
|
||||
ENV=/root/.ashrc
|
||||
+631
-149
File diff suppressed because it is too large
Load Diff
+1
-3
@@ -1,8 +1,6 @@
|
||||
<?php
|
||||
|
||||
// ini_set('display_errors', 'On');
|
||||
// ini_set("log_errors", 1);
|
||||
// ini_set("error_log", '/logs/php_error');
|
||||
error_reporting(E_ALL | E_NOTICE);
|
||||
|
||||
$debug = [
|
||||
'raw' => file_get_contents('php://input'),
|
||||
|
||||
@@ -261,6 +261,10 @@ $i = [
|
||||
'en' => 'setSecret',
|
||||
'ru' => 'установить свой ключ',
|
||||
],
|
||||
'setAdTag' => [
|
||||
'en' => 'set adtag',
|
||||
'ru' => 'установить adtag',
|
||||
],
|
||||
'defaultDNS' => [
|
||||
'en' => 'defaultDNS',
|
||||
'ru' => 'дефолтный днс',
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
ini_set('session.use_cookies', 0);
|
||||
|
||||
require __DIR__ . '/timezone.php';
|
||||
|
||||
require __DIR__ . '/bot.php';
|
||||
@@ -11,6 +13,6 @@ if ($c['debug']) {
|
||||
|
||||
$bot = new Bot($c['key'], $i);
|
||||
$bot->cleanQueue();
|
||||
$bot->setwebhook();
|
||||
$bot->syncPortClients();
|
||||
$bot->setcommands();
|
||||
$bot->polling();
|
||||
|
||||
@@ -30,3 +30,4 @@ $c = $bot->getPacConf();
|
||||
$bot->setUpstreamDomain($c['transport'] != 'Reality' ? 't' : $c['reality']['domain']);
|
||||
$bot->setUpstreamDomainNaive($c['domain']);
|
||||
$bot->setUpstreamDomainOcserv($c['domain']);
|
||||
$bot->restartXray($bot->getXray());
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"mixed-port": 2080,
|
||||
"allow-lan": true,
|
||||
"tcp-concurrent": true,
|
||||
"enable-process": true,
|
||||
"find-process-mode": "strict",
|
||||
@@ -50,7 +48,6 @@
|
||||
},
|
||||
"dns": {
|
||||
"enable": true,
|
||||
"listen": ":1053",
|
||||
"prefer-h3": false,
|
||||
"ipv6": false,
|
||||
"enhanced-mode": "fake-ip",
|
||||
|
||||
+4
-4
@@ -214,7 +214,7 @@ services:
|
||||
- dnstt
|
||||
- hy
|
||||
wg:
|
||||
image: mercurykd/vpnbot-wg:1.2
|
||||
image: mercurykd/vpnbot-wg:1.3
|
||||
build:
|
||||
dockerfile: dockerfile/wireguard.dockerfile
|
||||
args:
|
||||
@@ -252,7 +252,7 @@ services:
|
||||
ipv4_address: 10.10.0.4
|
||||
logging: *default-logging
|
||||
wg1:
|
||||
image: mercurykd/vpnbot-wg:1.2
|
||||
image: mercurykd/vpnbot-wg:1.3
|
||||
build:
|
||||
dockerfile: dockerfile/wireguard.dockerfile
|
||||
args:
|
||||
@@ -354,7 +354,7 @@ services:
|
||||
ipv4_address: 10.10.0.8
|
||||
logging: *default-logging
|
||||
xr:
|
||||
image: mercurykd/vpnbot-xr:1.5
|
||||
image: mercurykd/vpnbot-xr:1.6
|
||||
build:
|
||||
dockerfile: dockerfile/xray.dockerfile
|
||||
args:
|
||||
@@ -418,7 +418,7 @@ services:
|
||||
ipv4_address: 10.10.0.11
|
||||
logging: *default-logging
|
||||
np:
|
||||
image: mercurykd/vpnbot-np:1.2
|
||||
image: mercurykd/vpnbot-np:1.3
|
||||
build:
|
||||
dockerfile: dockerfile/naive.dockerfile
|
||||
args:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ARG image
|
||||
FROM golang:alpine as go
|
||||
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
|
||||
COPY --from=go /go/caddy /usr/local/bin/
|
||||
RUN apk add openssh \
|
||||
|
||||
@@ -13,4 +13,9 @@ RUN apk add --no-cache --virtual .build-deps alpine-sdk git \
|
||||
&& apk del .build-deps \
|
||||
&& rm -rf /amneziawg-go \
|
||||
&& 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:
|
||||
docker compose build
|
||||
u: # запуск контейнеров
|
||||
$(eval IP := $(shell hostname -I | awk '{print $$1}'))
|
||||
bash ./update/update.sh &
|
||||
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
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
rm /ssh/key*
|
||||
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"
|
||||
php init.php
|
||||
if [[ -f "/start" && -f "/ssh/key.pub" && -s "/ssh/key.pub" ]]; then
|
||||
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 --control 0.0.0.0:8080 --log /logs/unit_error
|
||||
if [[ -f "/ssh/key.pub" && -s "/ssh/key.pub" ]]; then
|
||||
unitd --control 0.0.0.0:8080 --log /logs/unit_error
|
||||
curl -X PUT --data-binary @/config/unit.json http://127.0.0.1:8080/config
|
||||
php init.php
|
||||
else
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#!/bin/bash
|
||||
INTERFACE_VPN="tun0"
|
||||
TABLE_ID=100
|
||||
|
||||
cat /ssh/key.pub > /root/.ssh/authorized_keys
|
||||
ssh-keygen -A
|
||||
exec /usr/sbin/sshd -D -e "$@" &
|
||||
@@ -66,4 +70,15 @@ else
|
||||
sh /block_exchange.sh
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user