Minor fixes

This commit is contained in:
Kirigaya Kazuto 2021-07-30 18:51:31 +00:00
parent 91e50a99ee
commit b60fdfea64
5 changed files with 38 additions and 29 deletions

View File

@ -2,13 +2,13 @@
A group of Interactive bash scripts for [Wireguard](https://github.com/WireGuard/wireguard-go) over [udp2raw-tunnel](https://github.com/wangyu-/udp2raw-tunnel), with optional [UDPSpeeder](https://github.com/wangyu-/UDPspeeder) support.
## Usage
## Basic Usage
1. Run `install.sh`. (May require Super user permission)
1. Run `install.sh`. (May prompt sudo)
2. Run `create.sh` and fill in content interactively.
3. Run the generated `start.sh`. (May require Super user permission)
3. Run the generated `start.sh`. (May prompt sudo)
Start as service: `systemctl start wg-quick@wg0`
@ -16,6 +16,10 @@ Start service on system start-up: `systemctl enable wg-quick@wg0`
See [wg-quick(8)](https://man7.org/linux/man-pages/man8/wg-quick.8.html) for more information.
### Quick Import
On client-only nodes, run `quick_create_client.sh` and paste the **Quick Import String** (starts with `#QCS#`) to setup quickly.
## Notice
Make sure to setup firewall. UFW is recommended.

View File

@ -22,20 +22,22 @@ rm udpspeeder.tgz
cd ..
VERIFIED_HASH="a7ce38b2c30980be4e71c3af8a9c1db8183db349c699fa6f843e67add7e6cca2"
TEMP_HASH=$(sha256sum bin/udp2raw_amd64 | awk '{print $1}')
if [ "$TEMP_HASH" == "$VERIFIED_HASH" ]
VERIFIED_TUNNEL_HASH="a7ce38b2c30980be4e71c3af8a9c1db8183db349c699fa6f843e67add7e6cca2"
LOCAL_TUNNEL_HASH=$(sha256sum bin/udp2raw_amd64 | awk '{print $1}')
VERIFIED_SPEEDER_HASH="3cf8f6c1e9baa530170368efb8a4bfcd6e75f88c2726ecbf2a75261dd1dd9fd5"
LOCAL_SPEEDER_HASH=$(sha256sum bin/speederv2_amd64 | awk '{print $1}')
if [ "$LOCAL_TUNNEL_HASH" == "$VERIFIED_TUNNEL_HASH" ]
then
echo "[OK] udp2raw hash match: $TEMP_HASH"
echo "[OK] udp2raw hash match: $LOCAL_TUNNEL_HASH"
else
echo "[WARN] udp2raw hash mismatch: $TEMP_HASH. Expected: $VERIFIED_HASH"
echo "[WARN] udp2raw hash mismatch: $LOCAL_TUNNEL_HASH. Expected: $VERIFIED_TUNNEL_HASH"
fi
VERIFIED_HASH="3cf8f6c1e9baa530170368efb8a4bfcd6e75f88c2726ecbf2a75261dd1dd9fd5"
TEMP_HASH=$(sha256sum bin/speederv2_amd64 | awk '{print $1}')
if [ "$TEMP_HASH" == "$VERIFIED_HASH" ]
if [ "$LOCAL_SPEEDER_HASH" == "$VERIFIED_SPEEDER_HASH" ]
then
echo "[OK] speederv2 hash match: $TEMP_HASH"
echo "[OK] speederv2 hash match: $LOCAL_SPEEDER_HASH"
else
echo "[WARN] speederv2 hash mismatch: $TEMP_HASH. Expected: $VERIFIED_HASH"
echo "[WARN] speederv2 hash mismatch: $LOCAL_SPEEDER_HASH. Expected: $VERIFIED_SPEEDER_HASH"
fi

View File

@ -10,33 +10,36 @@ mkdir -p local/tunnel
mkdir -p bin
cd bin
rm -rf wg-op-binary
git clone https://gitee.com/kiritow/wg-op-binary
cd wg-op-binary
openssl enc -aes-256-cbc -pbkdf2 -a -d -in bin.01 -out ../udp2raw_amd64
openssl enc -aes-256-cbc -pbkdf2 -a -d -in bin.02 -out ../speederv2_amd64
chmod +x udp2raw_amd64
chmod +x speederv2_amd64
chmod +x ../udp2raw_amd64
chmod +x ../speederv2_amd64
cd ..
rm -rf wg-op-binary
cd ..
VERIFIED_HASH="a7ce38b2c30980be4e71c3af8a9c1db8183db349c699fa6f843e67add7e6cca2"
TEMP_HASH=$(sha256sum bin/udp2raw_amd64 | awk '{print $1}')
if [ "$TEMP_HASH" == "$VERIFIED_HASH" ]
VERIFIED_TUNNEL_HASH="a7ce38b2c30980be4e71c3af8a9c1db8183db349c699fa6f843e67add7e6cca2"
LOCAL_TUNNEL_HASH=$(sha256sum bin/udp2raw_amd64 | awk '{print $1}')
VERIFIED_SPEEDER_HASH="3cf8f6c1e9baa530170368efb8a4bfcd6e75f88c2726ecbf2a75261dd1dd9fd5"
LOCAL_SPEEDER_HASH=$(sha256sum bin/speederv2_amd64 | awk '{print $1}')
if [ "$LOCAL_TUNNEL_HASH" == "$VERIFIED_TUNNEL_HASH" ]
then
echo "[OK] udp2raw hash match: $TEMP_HASH"
echo "[OK] udp2raw hash match: $LOCAL_TUNNEL_HASH"
else
echo "[WARN] udp2raw hash mismatch: $TEMP_HASH. Expected: $VERIFIED_HASH"
echo "[WARN] udp2raw hash mismatch: $LOCAL_TUNNEL_HASH. Expected: $VERIFIED_TUNNEL_HASH"
fi
VERIFIED_HASH="3cf8f6c1e9baa530170368efb8a4bfcd6e75f88c2726ecbf2a75261dd1dd9fd5"
TEMP_HASH=$(sha256sum bin/speederv2_amd64 | awk '{print $1}')
if [ "$TEMP_HASH" == "$VERIFIED_HASH" ]
if [ "$LOCAL_SPEEDER_HASH" == "$VERIFIED_SPEEDER_HASH" ]
then
echo "[OK] speederv2 hash match: $TEMP_HASH"
echo "[OK] speederv2 hash match: $LOCAL_SPEEDER_HASH"
else
echo "[WARN] speederv2 hash mismatch: $TEMP_HASH. Expected: $VERIFIED_HASH"
echo "[WARN] speederv2 hash mismatch: $LOCAL_SPEEDER_HASH. Expected: $VERIFIED_SPEEDER_HASH"
fi

0
tool_create.py Executable file → Normal file
View File

View File

@ -110,9 +110,9 @@ with open("start.sh", "w", encoding='utf-8') as f:
f.write('''#!/bin/bash
set -e
cp local/{}.conf /etc/wireguard/
wg-quick up {}
tmux attach-session -t tunnel
sudo cp local/{}.conf /etc/wireguard/
sudo wg-quick up {}
sudo tmux attach-session -t tunnel
'''.format(config["interface"], config["interface"]))
@ -120,7 +120,7 @@ logger.info("Generating stop script...")
with open("stop.sh", "w", encoding='utf-8') as f:
f.write('''#!/bin/bash
set -x
wg-quick down {}
sudo wg-quick down {}
'''.format(config["interface"]))