Add .env configuration for easy environment customization

- Create .env.example with all configurable settings:
  - Server IPs (RU_VDS_IP, DE_VDS_IP)
  - WireGuard ports (WG_CLIENT_PORT, WG_TUNNEL_PORT)
  - VPN networks (USER_VPN_NETWORK, TUNNEL_NETWORK)
  - DNS settings, SSH port, timeouts
- Add .gitignore to exclude .env from version control
- Update setup-ru-vds.sh to read from .env
- Update setup-de-vds.sh to read from .env
- Update add-client.sh to use configuration
- Setup scripts save config to /etc/wireguard/vpn.conf for runtime use
- Update documentation with .env usage instructions

This allows easy deployment to test environments by simply
changing values in .env before running setup scripts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
mguschin
2026-02-19 18:18:06 +03:00
parent f14d4f8f33
commit 054437d5a4
7 changed files with 268 additions and 51 deletions

View File

@@ -18,14 +18,26 @@ A VPN network where:
## Deployment Steps
### Step 0: Configure Environment (2 min)
```bash
# On your local machine, in the project directory
cp .env.example .env
nano .env # Edit values for your servers
```
Key settings to change:
- `RU_VDS_IP` - Your RU gateway server IP
- `DE_VDS_IP` - Your DE exit node server IP
### Step 1: Setup DE VDS (5 min)
```bash
# From your computer
scp scripts/setup-de-vds.sh root@194.31.173.178:/root/
# From your computer (copy .env and script)
scp .env scripts/setup-de-vds.sh root@<DE_VDS_IP>:/root/
# SSH into DE VDS
ssh root@194.31.173.178
ssh root@<DE_VDS_IP>
# Run setup
chmod +x /root/setup-de-vds.sh
@@ -37,11 +49,11 @@ chmod +x /root/setup-de-vds.sh
### Step 2: Setup RU VDS (5 min)
```bash
# From your computer
scp scripts/setup-ru-vds.sh root@176.124.216.197:/root/
# From your computer (copy .env and script)
scp .env scripts/setup-ru-vds.sh root@<RU_VDS_IP>:/root/
# SSH into RU VDS
ssh root@176.124.216.197
ssh root@<RU_VDS_IP>
# Run setup
chmod +x /root/setup-ru-vds.sh