updated everything to not require gs-secret manually
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
all:
|
all:
|
||||||
@echo "Usage: make server | make stop-server | make server-secret | make simple"
|
@echo "Usage: make server|stop-server|ovpn|start|stop|clean"
|
||||||
|
|
||||||
server:
|
server:
|
||||||
@cd server && docker compose up --build -d
|
@cd server && docker compose up --build -d
|
||||||
@@ -10,9 +10,6 @@ stop-server:
|
|||||||
clean:
|
clean:
|
||||||
@cd server && docker compose down -v
|
@cd server && docker compose down -v
|
||||||
|
|
||||||
server-secret:
|
|
||||||
@cd server && printf 'Enter server secret: ' && read -r GS_SECRET && echo "GS_SECRET=$$GS_SECRET" > .env
|
|
||||||
|
|
||||||
ovpn:
|
ovpn:
|
||||||
@docker cp gsocket-vpn:/vpn/client.ovpn . && echo 'client.ovpn saved!'
|
@docker cp gsocket-vpn:/vpn/client.ovpn . && echo 'client.ovpn saved!'
|
||||||
|
|
||||||
|
|||||||
@@ -31,32 +31,35 @@ Client-side dependencies:
|
|||||||
|
|
||||||
Assumes having Docker and Make. From the repo root:
|
Assumes having Docker and Make. From the repo root:
|
||||||
|
|
||||||
1. Enter and save the GSocket secret: `make server-secret`
|
1. Build (if necessary) and start the server: `make server`
|
||||||
2. Build (if necessary) and start the server: `make server`
|
2. Export the `client.ovpn` file to the current directory: `make ovpn`
|
||||||
3. Export the `client.ovpn` file to the current directory: `make ovpn`
|
3. Stop the server (without removing the data): `make stop-server`
|
||||||
4. Stop the server (without removing the data): `make stop-server`
|
4. Stop the server and remove all data: `make clean`
|
||||||
5. Stop the server and remove all data: `make clean`
|
|
||||||
|
Note: the `client.ovpn` file is the sole access key to the entire tunnel. Treat is as confidential data.
|
||||||
|
|
||||||
### On the client ("simple" approach, Make-based)
|
### On the client ("simple" approach, Make-based)
|
||||||
|
|
||||||
1. Get the `client.ovpn` file from the server and put it into the `client` directory.
|
1. Get the `client.ovpn` file from the server and put it into the `client` directory.
|
||||||
2. Run `make start`, enter your GSocket server secret and then your sudo password (if necessary).
|
2. Run `make start` and then enter your sudo password (if necessary).
|
||||||
3. To stop the client, run `make stop.`
|
3. To stop the client, run `make stop.`
|
||||||
|
|
||||||
### On the client (manual approach, POSIX)
|
### On the client (manual approach, POSIX)
|
||||||
|
|
||||||
1. Get the `client.ovpn` file from the server.
|
1. Get the `client.ovpn` file from the server.
|
||||||
2. Run these commands directly: `gs-netcat -D -s your_gsocket_secret -p 1194 && sudo openvpn --daemon gs-warp --config client.ovpn`
|
2. Get the GS secret as the MD5 hash of the `client.ovpn` file: `export GS_SECRET=$(md5sum client.ovpn | cut -d ' ' -f 1)`
|
||||||
3. To stop, first stop the OpenVPN process and then gs-netcat.
|
3. Run these commands directly: `gs-netcat -D -s $GS_SECRET -p 1194 && sudo openvpn --daemon gs-warp --config client.ovpn`
|
||||||
|
4. To stop, first stop the OpenVPN process and then gs-netcat.
|
||||||
|
|
||||||
### On the client (manual approach, non-POSIX)
|
### On the client (manual approach, non-POSIX)
|
||||||
|
|
||||||
This is suitable for non-POSIX environments. You'll need any OpenVPN client and `gs-netcat` binary for your platform.
|
This is suitable for non-POSIX environments. You'll need any OpenVPN client and `gs-netcat` binary for your platform.
|
||||||
|
|
||||||
1. Get the `client.ovpn` file from the server and put it into your OpenVPN client's profile. Do not start the client yet.
|
1. Get the `client.ovpn` file from the server and put it into your OpenVPN client's profile. Do not start the client yet.
|
||||||
2. In a separate terminal window, run `gs-netcat -D -s your_gsocket_secret -p 1194`.
|
2. Get the GS secret as the MD5 hash of the `client.ovpn` file using whatever means available.
|
||||||
3. Start the OpenVPN connection in the client.
|
3. In a separate terminal window, run `gs-netcat -D -s $GS_SECRET -p 1194`.
|
||||||
4. To stop, first stop the OpenVPN connection and then terminate the gs-netcat process.
|
4. Start the OpenVPN connection in the client.
|
||||||
|
5. To stop, first stop the OpenVPN connection and then terminate the gs-netcat process.
|
||||||
|
|
||||||
More client options coming soon!
|
More client options coming soon!
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ -z "$GS_SECRET" ] && GS_SECRET="$1"
|
# Client-side GS-Warp launcher
|
||||||
[ -z "$GS_SECRET" ] && printf 'Enter GSocket secret: ' && read -r GS_SECRET
|
# Created by Luxferre in 2026, released into the public domain
|
||||||
|
|
||||||
[ -z "$OVPNCFG" ] && OVPNCFG="$2"
|
[ -z "$OVPNCFG" ] && OVPNCFG="$2"
|
||||||
[ -z "$OVPNCFG" ] && OVPNCFG="client.ovpn"
|
[ -z "$OVPNCFG" ] && OVPNCFG="client.ovpn"
|
||||||
|
GS_SECRET="$(md5sum "$OVPNCFG" | cut -d ' ' -f 1)"
|
||||||
|
|
||||||
GSPIDFILE='/tmp/gswarp-gs.pid'
|
GSPIDFILE='/tmp/gswarp-gs.pid'
|
||||||
OVPIDFILE='/tmp/gswarp-ov.pid'
|
OVPIDFILE='/tmp/gswarp-ov.pid'
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
container_name: gsocket-vpn
|
container_name: gsocket-vpn
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
|
||||||
- GS_SECRET=${GS_SECRET}
|
|
||||||
dns:
|
dns:
|
||||||
- 1.1.1.1
|
- 1.1.1.1
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
# Server-side core (entrypoint) for GS-Warp
|
||||||
|
# Created by Luxferre in 2026, released into the public domain
|
||||||
|
|
||||||
if [ -z "$GS_SECRET" ]; then
|
set -e
|
||||||
echo "[!] ERROR: GS_SECRET environment variable is missing."
|
|
||||||
echo " Please start the container with -e GS_SECRET=\"your_secret_key\""
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure TUN device node exists in container namespace
|
# Ensure TUN device node exists in container namespace
|
||||||
if [ ! -c /dev/net/tun ]; then
|
if [ ! -c /dev/net/tun ]; then
|
||||||
@@ -151,5 +148,6 @@ openvpn --config /vpn/server.conf \
|
|||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
# 4. Forward GSocket stream directly to 127.0.0.1:1194
|
# 4. Forward GSocket stream directly to 127.0.0.1:1194
|
||||||
|
GS_SECRET="$(md5sum /vpn/client.ovpn | cut -d ' ' -f 1)"
|
||||||
echo "[+] Starting gs-netcat port forwarder..."
|
echo "[+] Starting gs-netcat port forwarder..."
|
||||||
exec gs-netcat -s "$GS_SECRET" -l -d 127.0.0.1 -p 1194
|
exec gs-netcat -s "$GS_SECRET" -l -d 127.0.0.1 -p 1194
|
||||||
|
|||||||
Reference in New Issue
Block a user