diff --git a/README.md b/README.md index e71d06e..05d617c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,107 @@ # nexus_infernum -Infernal Symphony of Agony. And infrastructure description that SpeedyWeedyOPS site are using +Infernal Symphony of Agony. And infrastructure description that SpeedyWeedyOps site are using + +# SpeedyWeedyOps Web Infrastructure + +This project sets up a web infrastructure using Docker Compose, including a Ghost blog, Gitea for Git repository hosting, and supporting services. + +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"> + <!-- Background --> + <rect width="800" height="600" fill="#f0f0f0"/> + + <!-- Internet cloud --> + <ellipse cx="400" cy="50" rx="100" ry="40" fill="#d1ecf1" stroke="#0c5460" stroke-width="2"/> + <text x="400" y="55" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#0c5460">Internet</text> + + <!-- Caddy --> + <rect x="350" y="120" width="100" height="60" rx="10" ry="10" fill="#d4edda" stroke="#155724" stroke-width="2"/> + <text x="400" y="155" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#155724">Caddy</text> + + <!-- Varnish --> + <rect x="350" y="220" width="100" height="60" rx="10" ry="10" fill="#fff3cd" stroke="#856404" stroke-width="2"/> + <text x="400" y="255" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#856404">Varnish</text> + + <!-- Ghost --> + <rect x="200" y="320" width="100" height="60" rx="10" ry="10" fill="#cce5ff" stroke="#004085" stroke-width="2"/> + <text x="250" y="355" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#004085">Ghost</text> + + <!-- Gitea --> + <rect x="500" y="320" width="100" height="60" rx="10" ry="10" fill="#e2e3e5" stroke="#383d41" stroke-width="2"/> + <text x="550" y="355" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#383d41">Gitea</text> + + <!-- MySQL --> + <rect x="350" y="420" width="100" height="60" rx="10" ry="10" fill="#f8d7da" stroke="#721c24" stroke-width="2"/> + <text x="400" y="455" text-anchor="middle" font-family="Arial, sans-serif" font-size="14" fill="#721c24">MySQL</text> + + <!-- Connections --> + <line x1="400" y1="90" x2="400" y2="120" stroke="#0c5460" stroke-width="2"/> + <line x1="400" y1="180" x2="400" y2="220" stroke="#155724" stroke-width="2"/> + <line x1="400" y1="280" x2="250" y2="320" stroke="#856404" stroke-width="2"/> + <line x1="400" y1="280" x2="550" y2="320" stroke="#856404" stroke-width="2"/> + <line x1="250" y1="380" x2="400" y2="420" stroke="#004085" stroke-width="2"/> + <line x1="550" y1="380" x2="400" y2="420" stroke="#383d41" stroke-width="2"/> +</svg> + +## Services + +- **Caddy**: Web server and reverse proxy +- **Ghost**: Blogging platform +- **Gitea**: Self-hosted Git service +- **MySQL**: Database for both Ghost and Gitea +- **Varnish**: HTTP caching reverse proxy + +## Architecture + +The infrastructure is set up with the following architecture: + +1. Caddy serves as the front-facing web server, handling HTTPS and acting as a reverse proxy. +2. Varnish sits between Caddy and Ghost, providing caching for improved performance. +3. Ghost and Gitea are the main applications, each exposed on different subdomains. +4. MySQL serves as the database backend for both Ghost and Gitea. + +## Security Features + +- HTTPS enforced by Caddy with automatic certificate management +- Security headers set in Caddy configuration +- Secrets management for sensitive data (e.g., database passwords) +- Network separation using Docker networks + +## Performance Optimizations + +- Varnish caching for Ghost content +- Static asset caching configured in Caddy +- Compression enabled for responses + +## Configuration Files + +- `compose.yml`: Defines the Docker services and their configurations +- `Caddyfile`: Caddy web server configuration +- `varnish/default.vcl`: Varnish caching rules + +## Setup Instructions + +1. Clone this repository +2. Create a `ghost_mysql_password` file with the desired MySQL password for Ghost +3. Adjust any configuration files as needed +4. Run `docker compose up -d` to start the services + +## Maintenance + +- Logs for all services are configured to output to stdout/stderr and can be viewed with `docker compose logs` +- Volume mounts are used for persistent data storage +- Regular backups of the MySQL data and application content are recommended + +## Notes + +- The www subdomain is configured to redirect to the non-www version +- The Ghost admin panel and API are excluded from Varnish caching +- Both Ghost and Gitea are configured to use MySQL as their database backend + +For more detailed information about each service, refer to their respective documentation: + +- [Caddy](https://caddyserver.com/docs/) +- [Ghost](https://ghost.org/docs/) +- [Gitea](https://docs.gitea.io/) +- [MySQL](https://dev.mysql.com/doc/) +- [Varnish](https://varnish-cache.org/docs/)