Skip to content

Commit c16a6be

Browse files
committed
Refactor Docker configs and frontend styles
Removed unused environment variables and IPAM config from docker-compose files, added healthchecks, and made WireGuard port configurable. Updated frontend styles for user info and links, improved group and stats tables to show IPv6 ranges, and deleted unused dev agent config.
1 parent 9a85441 commit c16a6be

File tree

10 files changed

+64
-66
lines changed

10 files changed

+64
-66
lines changed

.github/agents/dev.agent.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A production-ready web-based management interface for WireGuard VPN, featuring m
66
![Docker](https://img.shields.io/badge/docker-ready-blue.svg)
77
![Security](https://img.shields.io/badge/security-hardened-green.svg)
88

9-
## 📸 Screenshots
9+
## Screenshots
1010

1111
> **Note**: Screenshots showing the application interface will be added here. The application features:
1212
> - Modern, responsive web interface
@@ -15,7 +15,7 @@ A production-ready web-based management interface for WireGuard VPN, featuring m
1515
> - Client management with configuration download
1616
> - Real-time traffic statistics and monitoring
1717
18-
## Features
18+
## Features
1919

2020
### 1. Account Management System
2121
- **Admin Role**: Full system access, user management, global settings
@@ -69,7 +69,7 @@ A production-ready web-based management interface for WireGuard VPN, featuring m
6969
- Rate limiting on authentication endpoints
7070
- Health check endpoints for monitoring
7171

72-
## 🚀 Quick Start with Docker
72+
## Quick Start with Docker
7373

7474
### Prerequisites
7575
- Docker and Docker Compose
@@ -99,8 +99,8 @@ docker-compose up -d
9999
5. Login with default credentials:
100100
- Username: `admin`
101101
- Password: `admin`
102-
103-
**⚠️ Change the admin password immediately after first login!**
102+
103+
**Change the admin password immediately after first login!**
104104

105105
## Configuration
106106

@@ -179,15 +179,15 @@ cd backend
179179
python -m pytest tests/ -v
180180
```
181181

182-
## 📚 Documentation
182+
## Documentation
183183

184184
- **[Production Deployment Guide](DEPLOYMENT.md)** - Complete guide for production deployment
185185
- **[Security Best Practices](SECURITY.md)** - Security hardening and best practices
186186
- **[Security Audit Report](SECURITY-AUDIT.md)** - Comprehensive security assessment
187187
- **[FAQ](FAQ.md)** - Frequently Asked Questions
188188
- **[API Documentation](#api-endpoints)** - API endpoint reference below
189189

190-
## 🔒 Security
190+
## Security
191191

192192
This application implements multiple security layers:
193193

@@ -198,7 +198,7 @@ This application implements multiple security layers:
198198
- **Rate Limiting**: Protection against brute force attacks
199199
- **Command Injection Prevention**: Validated interface names and commands
200200

201-
**⚠️ Important**: Before deploying to production, read [SECURITY.md](SECURITY.md) and follow all recommendations.
201+
**Important**: Before deploying to production, read [SECURITY.md](SECURITY.md) and follow all recommendations.
202202

203203
### Quick Security Checklist
204204

@@ -209,7 +209,7 @@ This application implements multiple security layers:
209209
- [ ] Set up regular backups
210210
- [ ] Review [SECURITY.md](SECURITY.md) completely
211211

212-
## 📊 Health Checks
212+
## Health Checks
213213

214214
The application provides health check endpoints for monitoring:
215215

@@ -279,7 +279,7 @@ Use these endpoints with Docker health checks, load balancers, or monitoring sys
279279
└─────────────────┘ └─────────────────┘
280280
```
281281

282-
## 🔧 Troubleshooting
282+
## Troubleshooting
283283

284284
### Container Issues
285285

@@ -320,12 +320,12 @@ cp data/app.db data/app.db.backup
320320

321321
For more troubleshooting, see [DEPLOYMENT.md](DEPLOYMENT.md).
322322

323-
## 📈 Performance
323+
## Performance
324324

325325
### Recommended Resources
326326

327327
- **Small Deployment** (< 50 users): 1 CPU, 1GB RAM
328-
- **Medium Deployment** (50-500 users): 2 CPU, 2GB RAM
328+
- **Medium Deployment** (50-500 users): 2 CPU, 2GB RAM
329329
- **Large Deployment** (500+ users): 4 CPU, 4GB RAM, PostgreSQL
330330

331331
### Optimization Tips
@@ -337,7 +337,7 @@ For more troubleshooting, see [DEPLOYMENT.md](DEPLOYMENT.md).
337337

338338
See [DEPLOYMENT.md](DEPLOYMENT.md) for scaling details.
339339

340-
## 🤝 Contributing
340+
## Contributing
341341

342342
1. Fork the repository
343343
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
@@ -347,25 +347,25 @@ See [DEPLOYMENT.md](DEPLOYMENT.md) for scaling details.
347347

348348
Please ensure your code follows the existing style and includes appropriate tests.
349349

350-
## 📝 License
350+
## License
351351

352352
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
353353

354-
## 🔐 Security
354+
## Security
355355

356356
If you discover a security vulnerability, please report it responsibly:
357357

358358
1. **Do not** open a public GitHub issue
359359
2. Create an issue with **[SECURITY]** in the title
360360
3. See [SECURITY.md](SECURITY.md) for full security policy
361361

362-
## 🙏 Acknowledgments
362+
## Acknowledgments
363363

364364
- [WireGuard](https://www.wireguard.com/) - Fast, modern, secure VPN tunnel
365365
- Built with Flask, React, and Docker
366366
- Inspired by the need for secure, multi-tenant VPN management
367367

368-
## 📞 Support
368+
## Support
369369

370370
- **Documentation**: [README.md](README.md), [SECURITY.md](SECURITY.md), [DEPLOYMENT.md](DEPLOYMENT.md), [FAQ.md](FAQ.md)
371371
- **Issues**: [GitHub Issues](https://github.com/Arthur2500/wireguard-multiclient-webui/issues)
@@ -374,4 +374,4 @@ If you discover a security vulnerability, please report it responsibly:
374374

375375
---
376376

377-
**Made with ❤️ for the WireGuard community**
377+
**Made for the WireGuard community**

docker-compose.local.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@ services:
77
restart: unless-stopped
88
env_file:
99
- .env
10-
environment:
11-
- FLASK_ENV=production
12-
- SECRET_KEY=${SECRET_KEY:-change-this-secret-key}
13-
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-change-this-jwt-secret}
14-
- DATABASE_URL=sqlite:////data/app.db
15-
- WG_CONFIG_PATH=/etc/wireguard
1610
ports:
17-
- "51820:51820/udp"
11+
- "${WG_DEFAULT_PORT:-51820}:${WG_DEFAULT_PORT:-51820}/udp"
1812
volumes:
1913
- ./data:/data
2014
- ./wireguard:/etc/wireguard
@@ -28,6 +22,12 @@ services:
2822
- net.ipv4.conf.all.src_valid_mark=1
2923
- net.ipv6.conf.all.forwarding=1
3024
- net.ipv6.conf.default.forwarding=1
25+
healthcheck:
26+
test: ["CMD", "curl", "-f", "http://localhost:5000/api/health"]
27+
interval: 30s
28+
timeout: 10s
29+
retries: 3
30+
start_period: 40s
3131

3232
frontend:
3333
build:
@@ -38,14 +38,18 @@ services:
3838
ports:
3939
- "8088:80"
4040
depends_on:
41-
- backend
41+
backend:
42+
condition: service_healthy
4243
networks:
4344
- wg-network
45+
healthcheck:
46+
test: ["CMD", "curl", "-f", "http://localhost:80"]
47+
interval: 30s
48+
timeout: 10s
49+
retries: 3
50+
start_period: 10s
4451

4552
networks:
4653
wg-network:
4754
driver: bridge
48-
enable_ipv6: true
49-
ipam:
50-
config:
51-
- subnet: fd00::/64
55+
enable_ipv6: true

docker-compose.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ services:
55
restart: unless-stopped
66
env_file:
77
- .env
8-
environment:
9-
- FLASK_ENV=production
10-
- SECRET_KEY=${SECRET_KEY:-change-this-secret-key}
11-
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-change-this-jwt-secret}
12-
- DATABASE_URL=sqlite:////data/app.db
13-
- WG_CONFIG_PATH=/etc/wireguard
148
ports:
15-
- "51820:51820/udp"
9+
- "${WG_DEFAULT_PORT:-51820}:${WG_DEFAULT_PORT:-51820}/udp"
1610
volumes:
1711
- ./data:/data
1812
- ./wireguard:/etc/wireguard
@@ -55,6 +49,3 @@ networks:
5549
wg-network:
5650
driver: bridge
5751
enable_ipv6: true
58-
ipam:
59-
config:
60-
- subnet: fd00::/64

frontend/src/components/clients/ClientList.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,17 @@
167167
.client-name {
168168
display: block;
169169
font-weight: 500;
170-
color: var(--text-primary);
170+
color: var(--primary);
171171
margin-bottom: 2px;
172172
}
173173

174-
.client-name-link {
174+
.group-link {
175175
text-decoration: none;
176176
color: inherit;
177177
}
178178

179-
.client-name-link:hover .client-name {
179+
.group-link:hover
180+
{
180181
color: var(--primary);
181182
text-decoration: underline;
182183
}
@@ -187,13 +188,12 @@
187188
color: var(--text-secondary);
188189
}
189190

190-
.group-link {
191-
color: var(--primary);
191+
.client-name-link {
192192
text-decoration: none;
193193
font-weight: 500;
194194
}
195195

196-
.group-link:hover {
196+
.client-name-link:hover .client-name{
197197
text-decoration: underline;
198198
}
199199

frontend/src/components/dashboard/Layout.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,18 @@
114114
border-top: 1px solid var(--border);
115115
}
116116

117-
.user-info {
117+
.user-info-wrapper {
118118
display: flex;
119119
align-items: center;
120120
margin-bottom: var(--spacing-md);
121121
gap: 12px;
122+
}
123+
124+
.user-info {
125+
display: flex;
126+
flex-grow: 1;
127+
align-items: center;
128+
gap: 12px;
122129
text-decoration: none;
123130
color: inherit;
124131
cursor: pointer;

frontend/src/components/dashboard/Layout.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,18 @@ const Layout: React.FC<LayoutProps> = ({ children, user, onLogout }) => {
9797
</ul>
9898

9999
<div className="sidebar-footer">
100-
<Link to={user ? `/users/${user.id}/edit-profile` : '#'} className="user-info">
101-
<div className="user-avatar">{user?.username.charAt(0).toUpperCase()}</div>
102-
<div className="user-details">
103-
<span className="user-name">{user?.username}</span>
104-
<span className="user-role">{user?.role}</span>
105-
</div>
100+
<div className="user-info-wrapper">
101+
<Link to={user ? `/users/${user.id}/edit-profile` : '#'} className="user-info">
102+
<div className="user-avatar">{user?.username.charAt(0).toUpperCase()}</div>
103+
<div className="user-details">
104+
<span className="user-name">{user?.username}</span>
105+
<span className="user-role">{user?.role}</span>
106+
</div>
107+
</Link>
106108
<button onClick={toggleDarkMode} className="theme-toggle" aria-label={darkMode ? 'Switch to light mode' : 'Switch to dark mode'}>
107109
{darkMode ? <Sun size={16} /> : <Moon size={16} />}
108110
</button>
109-
</Link>
111+
</div>
110112
<button onClick={handleLogout} className="logout-btn">
111113
<LogOut size={16} /> Logout
112114
</button>

frontend/src/components/groups/GroupList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ const GroupList: React.FC = () => {
5959
<tr>
6060
<th>Name</th>
6161
<th>Owner</th>
62-
<th>IP Range</th>
62+
<th>IP Range (IPv4)</th>
63+
<th>IPv6 Range</th>
6364
<th>Server IP</th>
6465
<th>Port</th>
6566
<th>Clients</th>
@@ -80,6 +81,7 @@ const GroupList: React.FC = () => {
8081
</td>
8182
<td>{group.owner_username || 'Unknown'}</td>
8283
<td className="mono">{group.ip_range}</td>
84+
<td className="mono">{group.ip_range_v6 || '-'}</td>
8385
<td className="mono">{group.server_ip}</td>
8486
<td>{group.listen_port}</td>
8587
<td>{group.client_count}</td>

frontend/src/components/stats/Stats.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
color: var(--text-primary);
274274
}
275275

276-
.stats-table .group-name, .stats-table .group-owner {
276+
.stats-table .group-name, .stats-table {
277277
font-weight: 500;
278278
color: var(--primary);
279279
}

frontend/src/components/stats/Stats.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ const Stats: React.FC = () => {
294294
{group.name}
295295
</Link>
296296
</td>
297-
<td className="group-owner">
297+
<td>
298298
<Link to={`/users/${group.owner_id}`} className="stats-link">
299299
{group.owner}
300300
</Link>
@@ -345,7 +345,7 @@ const Stats: React.FC = () => {
345345
{client.name}
346346
</Link>
347347
</td>
348-
<td className="group-owner">
348+
<td>
349349
<Link to={`/groups/${client.group_id}`} className="stats-link">
350350
{client.group_name}
351351
</Link>

0 commit comments

Comments
 (0)