https://github.com/taigrr/cayswap
https://github.com/taigrr/cayswap
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/taigrr/cayswap
- Owner: taigrr
- Created: 2022-05-31T23:51:32.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-10T00:54:24.000Z (over 3 years ago)
- Last Synced: 2025-09-11T09:56:59.311Z (9 months ago)
- Language: Go
- Size: 84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
1. Check command line parameters to determine if in server or CLI mode
2. If Server:
- Parse in config as a server
- Parse in wg.conf (filename determined by config at /etc/cayswap)
- Use key passed in from CLI or from config file for auth
- Use interface passed in from CLI or from config for listening
- receive requests from clients
- on request received, check client IP and check to see if client exists
- if client exists, error out and write out error message
- if client is new, then:
- create new entry in wg config file with IP address + public key
- systemctl reload wg-quick@
- afer 15 minutes, exit
3. If Client:
- Read in key from CLI
- Read in endpoint from CLI
- Parse WG Config
- Post public key + IP to server
- receive public key + ip back from server
- update wg config and reload wg-quick, exit