Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SimpleVPN Makefile

.PHONY: all build server client clean help
.PHONY: all build server client clean lint test format help

BINDIR := bin

Expand All @@ -10,11 +10,20 @@ build: server client

server:
@mkdir -p $(BINDIR)
go build -o $(BINDIR)/simplevpn-server main.go
go build -o $(BINDIR)/simplevpn-server server/cmd/main.go

client:
@mkdir -p $(BINDIR)
go build -o $(BINDIR)/simplevpn-client client.go
go build -o $(BINDIR)/simplevpn-client client/cmd/main.go

lint:
go vet ./...

test:
go test ./...

format:
gofmt -s -w .

clean:
rm -rf $(BINDIR)
Expand All @@ -24,5 +33,8 @@ help:
@echo " build - Build both server and client binaries."
@echo " server - Build only the server binary."
@echo " client - Build only the client binary."
@echo " lint - Run go vet on all packages."
@echo " test - Run all Go tests."
@echo " format - Run gofmt on all Go files."
@echo " clean - Remove built binaries."
@echo " help - Show this help message."
10 changes: 10 additions & 0 deletions client.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Interface]
PrivateKey = 6KpvHC9Zww5cPqJ9MxWq+4deki+U1eCEWBbR9dqMjUI=
Address = 10.0.0.2/32
DNS = 8.8.8.8

[Peer]
PublicKey = jdGJoGEVNaxjqjld1ReSc34IVo50ff8dnWvODaDAxgI=
Endpoint = 127.0.0.1:51820
AllowedIPs = 0.0.0.0/0, ::/0
PersistentKeepalive = 25
42 changes: 0 additions & 42 deletions client.go

This file was deleted.

28 changes: 28 additions & 0 deletions client/cmd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package main

import (
"flag"
"fmt"
"os"

client "github.com/adaptive-scale/simplevpn/client/pkg/sdk"
)

func main() {
mode := flag.String("mode", "embedded", "Mode: 'config' to generate config, 'embedded' to run embedded client")
serverIP := flag.String("server-ip", "127.0.0.1", "Server IP address")
serverPort := flag.Int("server-port", 51820, "Server WireGuard port")
serverPubKey := flag.String("server-pubkey", "", "Server public key (base64)")
clientIP := flag.String("client-ip", "10.0.0.2", "Client tunnel IP address (without mask)")
flag.Parse()

switch *mode {
case "config":
client.RunConfigGenerator(*serverIP, *serverPort, *serverPubKey, *clientIP)
case "embedded":
client.RunEmbeddedClient(*serverIP, *serverPort, *serverPubKey, *clientIP)
default:
fmt.Fprintf(os.Stderr, "Unknown mode: %s\n", *mode)
os.Exit(1)
}
}
145 changes: 0 additions & 145 deletions client/config

This file was deleted.

Loading