From 32f1742c207519cc7162f855b711c2045b53ba60 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Fri, 16 Jul 2021 11:56:50 +0800 Subject: [PATCH] Update Readme --- Readme.md | 8 ++++++++ tool_create.py | 5 ++++- tool_generate.py | 9 ++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index dc50204..88128ab 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,11 @@ # Wireguard Ops Interactive setup scripts for [Wireguard](https://github.com/WireGuard/wireguard-go) over [udp2raw-tunnel](https://github.com/wangyu-/udp2raw-tunnel). + +## Usage + +1. Run `install.sh`. (May require Super user permission) + +2. Run `create.sh` and fill in content interactively. + +3. Run the generated `start.sh`. (May require Super user permission) diff --git a/tool_create.py b/tool_create.py index b1c3c8d..9ddd73d 100755 --- a/tool_create.py +++ b/tool_create.py @@ -135,7 +135,10 @@ while True: print("[{}] UDP2Raw Tunnel to Remote {}".format(index + 1, client_info["remote"])) peer_endpoint = input("Enter Wireguard Peer Endpoint (ID from tunnel list, keep empty on server side): ").strip() - peer_keepalive = input("Enter Wireguard Peer Keep Alive seconds (Keep empty on server side): ").strip() + if peer_endpoint: + peer_keepalive = input("Enter Wireguard Peer Keep Alive seconds: ").strip() + else: + peer_keepalive = "" peers.append({ "pubkey": peer_pubk, diff --git a/tool_generate.py b/tool_generate.py index d0ae2e5..32028d2 100644 --- a/tool_generate.py +++ b/tool_generate.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import os import json import traceback @@ -33,6 +34,7 @@ AllowedIPs = {} if info["keepalive"]: f.write("PersistentKeepalive = {}".format(info["keepalive"])) +os.system("chmod 600 {}.conf".format(config["interface"])) print("Generating start script...") with open("start.sh", "w", encoding='utf-8') as f: @@ -55,4 +57,9 @@ tmux new-session -s tunnel -d tmux attach-session -t tunnel '''.format(config["interface"])) -print("[OK] Config generated. Be sure to configure and enable UFW (or any other firewall) before start.") +print('''[OK] Config generated. Before you run start.sh, besure to: +1. Disable SSH Server password login. +2. Enable UFW (or any other firewall) + +Safety First. +''')