155 lines
4.7 KiB
Markdown
155 lines
4.7 KiB
Markdown
# 🚀 CaddyDB - Modern Web Server Dashboard
|
|
|
|
<div align="center">
|
|
<img src="https://img.shields.io/badge/caddy-2.7+-4f46e5?style=for-the-badge" alt="Caddy 2.7+"/>
|
|
<img src="https://img.shields.io/badge/nginx-compatible-009639?style=for-the-badge" alt="Nginx Compatible"/>
|
|
<img src="https://img.shields.io/badge/python-3.9+-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python 3.9+"/>
|
|
<img src="https://img.shields.io/badge/docker-ready-2496ED?style=for-the-badge&logo=docker&logoColor=white" alt="Docker Ready"/>
|
|
</div>
|
|
|
|
<div align="center">
|
|
<p><strong>A sleek, minimalist dashboard for monitoring and managing your Caddy and Nginx web servers.</strong></p>
|
|
<p>Visualize all your domains in one place with a beautiful dark-themed interface.</p>
|
|
</div>
|
|
|
|
<br/>
|
|
|
|

|
|
|
|
## ✨ Features
|
|
|
|
- **🖥️ Multi-Server Support**: Monitor both Caddy and Nginx servers across your infrastructure
|
|
- **🔄 Real-Time Updates**: Automatically detects configuration changes
|
|
- **🔍 Instant Search**: Quickly filter domains with keyboard shortcuts
|
|
- **📊 Visual Statistics**: At-a-glance metrics for all your servers
|
|
- **🌙 Dark Mode**: Easy on the eyes with a modern minimalist UI
|
|
- **🔒 Secure**: Token-based authentication between servers and agents
|
|
- **🐳 Docker Ready**: Easy deployment with Docker Compose
|
|
|
|
## 🚀 Getting Started
|
|
|
|
### Quick Start with Docker
|
|
|
|
#### Server Mode (Dashboard)
|
|
|
|
1. **Clone the repository:**
|
|
|
|
```bash
|
|
git clone https://github.com/yourusername/caddydb.git
|
|
cd caddydb
|
|
```
|
|
|
|
2. **Build the Docker image:**
|
|
|
|
```bash
|
|
./src/build.sh
|
|
# Note: You can customize the image name/tag by editing build.sh
|
|
```
|
|
|
|
3. **Configure your environment:**
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
# Edit .env with your preferred settings
|
|
nano .env
|
|
```
|
|
|
|
4. **Start the server:**
|
|
|
|
```bash
|
|
docker-compose up -d caddydb-server
|
|
```
|
|
|
|
5. **Access your dashboard at http://localhost:5000**
|
|
|
|
#### Agent Mode (Remote Servers)
|
|
|
|
1. **Configure agent environment:**
|
|
|
|
```bash
|
|
cp .env.example .env.agent
|
|
# Edit .env.agent with remote server details
|
|
nano .env.agent
|
|
```
|
|
|
|
2. **Start the agent:**
|
|
|
|
```bash
|
|
# For Caddy servers
|
|
docker-compose --env-file .env.agent up -d caddydb-caddy-agent
|
|
|
|
# For Nginx servers
|
|
docker-compose --env-file .env.agent up -d caddydb-nginx-agent
|
|
```
|
|
|
|
## 📝 Configuration Options
|
|
|
|
### Server Mode
|
|
|
|
| Variable | Description | Default |
|
|
| ------------- | ----------------------------- | -------------- |
|
|
| `API_KEY` | Authentication key for agents | Required |
|
|
| `DEBUG_MODE` | Enable debug logging | `false` |
|
|
| `SERVER_NAME` | Name for the local server | `Local Server` |
|
|
|
|
### Agent Mode
|
|
|
|
| Variable | Description | Default |
|
|
| ---------------- | ------------------------------------ | --------------------------------------- |
|
|
| `API_KEY` | Same key as configured on server | Required |
|
|
| `DASHBOARD_URL` | URL to the dashboard API | `http://caddydb-server:5000/api/update` |
|
|
| `SERVER_NAME` | How this server appears in dashboard | Host name |
|
|
| `SERVER_TYPE` | Type of server (`caddy` or `nginx`) | `caddy` |
|
|
| `CHECK_INTERVAL` | Seconds between updates | `60` |
|
|
| `VERIFY_SSL` | Verify SSL certificates | `true` |
|
|
|
|
## 🔧 Advanced Usage
|
|
|
|
### Multiple Server Monitoring
|
|
|
|
You can monitor multiple Caddy and Nginx servers by running the agent on each server:
|
|
|
|
```yaml
|
|
# Remote server docker-compose.yml
|
|
services:
|
|
caddydb-agent:
|
|
image: caddydb:latest
|
|
volumes:
|
|
- /etc/caddy/Caddyfile:/app/Caddyfile:ro # Mount your actual Caddyfile
|
|
environment:
|
|
- API_KEY=your_shared_secret_key
|
|
- DASHBOARD_URL=https://your-dashboard-server.com/api/update
|
|
- SERVER_NAME=Production Caddy
|
|
- SERVER_TYPE=caddy
|
|
command: agent
|
|
restart: unless-stopped
|
|
```
|
|
|
|
### Local Configuration
|
|
|
|
If you're running CaddyDB on the same server as your Caddy/Nginx instance, simply mount your config files:
|
|
|
|
```yaml
|
|
volumes:
|
|
- /etc/caddy/Caddyfile:/app/Caddyfile:ro
|
|
- /etc/nginx/conf.d:/app/nginx:ro
|
|
```
|
|
|
|
## 🤝 Contributing
|
|
|
|
Contributions are welcome! Feel free to open issues or submit pull requests.
|
|
|
|
## 📜 License
|
|
|
|
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
|
|
## 🙏 Acknowledgements
|
|
|
|
- Built with Flask and Tailwind CSS
|
|
- Inspired by modern dashboard design principles
|
|
|
|
---
|
|
|
|
<div align="center">
|
|
<p>Made with ❤️ for web server administrators</p>
|
|
</div>
|