This commit is contained in:
Kirigaya Kazuto 2021-07-30 19:06:58 +00:00
parent 0ae3396cd6
commit a8160c0a78
6 changed files with 22 additions and 22 deletions

View File

@ -1,6 +1,6 @@
# Wireguard Ops
# WireGuard Ops
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.
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.
## Basic Usage

View File

@ -2,7 +2,7 @@
set -xe
sudo apt update
sudo apt install -y curl wireguard python3
sudo apt install -y curl wireguard python3 tmux
mkdir -p local
mkdir -p local/tunnel

View File

@ -2,7 +2,7 @@
set -xe
sudo apt update
sudo apt install -y curl wireguard python3
sudo apt install -y curl wireguard python3 tmux
mkdir -p local
mkdir -p local/tunnel

View File

@ -131,7 +131,7 @@ wg_public_ip = os.getenv("WG_PUBLICIP")
print('''
====== Your Wireguard Public Key ======
====== Your WireGuard Public Key ======
{}
@ -143,12 +143,12 @@ print('''
'''.format(wg_pubk, wg_public_ip))
ifname = input("Input new wireguard interface name (wg0):").strip() or "wg0"
listen_port = input("Input new wireguard listen port (51820): ").strip() or "51820"
ifname = input("Input new WireGuard interface name (wg0):").strip() or "wg0"
listen_port = input("Input new WireGuard listen port (51820): ").strip() or "51820"
while True:
ifip = input("Input wireguard interface ip (Example: 10.0.0.1)\n> ").strip()
ifip = input("Input WireGuard interface ip (Example: 10.0.0.1)\n> ").strip()
if not ifip:
print("You MUST set a valid wireguard interface IP. Try Again.")
print("You MUST set a valid WireGuard interface IP. Try Again.")
continue
break
@ -197,13 +197,13 @@ if op_mode in ("s", "m"):
while True:
print("====== Adding Peer {} ======".format(len(config["peers"]) + 1))
while True:
peer_pubk = input("Enter Wireguard Peer Public Key: ").strip()
peer_pubk = input("Enter WireGuard Peer Public Key: ").strip()
if not peer_pubk:
print("A public key is required. Try Again.")
continue
break
while True:
peer_allowed = input("Enter Wireguard Peer AllowedIPs (CIDR, Example: 10.0.0.0/24)\n> ").strip()
peer_allowed = input("Enter WireGuard Peer AllowedIPs (CIDR, Example: 10.0.0.0/24)\n> ").strip()
if not peer_allowed:
print("Peer allowed ips required. Try Again.")
continue
@ -214,8 +214,8 @@ while True:
for index, client_info in enumerate(config["udp2raw"]["client"]):
print("[{}] UDP2Raw Tunnel to Remote {}".format(index + 1, client_info["remote"]))
peer_endpoint = input("Enter Wireguard Peer Endpoint (ID from list, default to 1): ").strip() or "1"
peer_keepalive = input("Enter Wireguard Peer Keep Alive seconds (default to 30): ").strip() or "30"
peer_endpoint = input("Enter WireGuard Peer Endpoint (ID from list, default to 1): ").strip() or "1"
peer_keepalive = input("Enter WireGuard Peer Keep Alive seconds (default to 30): ").strip() or "30"
else:
peer_endpoint = ""
peer_keepalive = ""

View File

@ -36,7 +36,7 @@ udp_clients = config["udp2raw"]["client"]
udp_servers = config["udp2raw"]["server"]
logger.info("Generating wireguard config...")
logger.info("Generating WireGuard config...")
with open("local/{}.conf".format(config["interface"]), "w", encoding='utf-8') as f:
f.write('''[Interface]
Address = {}

View File

@ -13,12 +13,12 @@ if config:
print("No valid config found, creating a default one...")
ifname = input("Input new wireguard interface name (wg0): ").strip() or "wg0"
listen_port = input("Input new wireguard listen port (51820): ").strip() or "51820"
ifname = input("Input new WireGuard interface name (wg0): ").strip() or "wg0"
listen_port = input("Input new WireGuard listen port (51820): ").strip() or "51820"
while True:
ifip = input("Input wireguard interface ip (Example: 10.0.0.1)\n> ").strip()
ifip = input("Input WireGuard interface ip (Example: 10.0.0.1)\n> ").strip()
if not ifip:
print("You MUST set a valid wireguard interface IP. Try Again.")
print("You MUST set a valid WireGuard interface IP. Try Again.")
continue
break
@ -49,19 +49,19 @@ paste_config["udp2raw_client"]["password"] = udp_server_password
if paste_config["suggest_allowed"]:
peer_allowed = input("Enter Wireguard Peer AllowedIPs (CIDR, Example: 10.0.0.0/24, default to {})\n> ".format(paste_config["suggest_allowed"])).strip()
peer_allowed = input("Enter WireGuard Peer AllowedIPs (CIDR, Example: 10.0.0.0/24, default to {})\n> ".format(paste_config["suggest_allowed"])).strip()
if not peer_allowed:
peer_allowed = paste_config["suggest_allowed"]
else:
while True:
peer_allowed = input("Enter Wireguard Peer AllowedIPs (CIDR, Example: 10.0.0.0/24)\n> ").strip()
peer_allowed = input("Enter WireGuard Peer AllowedIPs (CIDR, Example: 10.0.0.0/24)\n> ").strip()
if not peer_allowed:
print("Peer allowed ips required. Try Again.")
continue
break
peer_keepalive = input("Enter Wireguard Peer Keep Alive seconds (default to 30): ").strip() or "30"
peer_keepalive = input("Enter WireGuard Peer Keep Alive seconds (default to 30): ").strip() or "30"
# Generate Config
@ -91,7 +91,7 @@ save_config(config)
print('''
====== Your Wireguard Public Key ======
====== Your WireGuard Public Key ======
{}