Skip to content

grokuku/CaddyPanel

Repository files navigation

⚠️ IMPORTANT DISCLAIMER ⚠️

This project, CaddyPanel, was entirely generated by an Artificial Intelligence (Gemini 2.5 pro).

  • NO HUMAN SUPPORT: There is absolutely no human support provided for this project.
  • NO GUARANTEES: This software is provided "as-is" without any guarantees or warranty. It may not work as expected, could contain bugs, security vulnerabilities, or might not be suitable for any specific purpose.
  • USE AT YOUR OWN RISK: You are solely responsible for any consequences arising from the use or misuse of this software.

Proceed with caution and a thorough understanding of these limitations.


CaddyPanel

CaddyPanel is a web-based control panel designed to simplify the configuration and management of the Caddy 2 web server. It runs as a single Docker container, bundling Caddy 2 itself along with a Flask-based user interface.

Project Goal

The primary goal of CaddyPanel is to provide a user-friendly interface for managing Caddy 2, making it easier to:

  • Set up reverse proxy hosts.
  • Manage Caddyfile configurations.
  • Monitor basic Caddy activity through statistics.
  • Streamline the deployment process via Docker.

Features

  • Web UI for Caddy Configuration:
    • Visual editor for adding, editing, and deleting site configurations (proxy hosts).
    • Raw Caddyfile editor for direct modifications.
  • User Authentication: Secure access with an initial admin account setup.
  • Automatic Caddyfile Management: Changes made through the UI are automatically saved to the Caddyfile, and Caddy is reloaded to apply them.
  • Preference Management:
    • Customize the UI theme.
    • Set a global admin email for ACME (Let's Encrypt, ZeroSSL).
    • Define default values for new site configurations, including Authentik integration settings.
  • Global Statistics: View basic statistics derived from Caddy's JSON access logs, such as total requests, error rates, and top paths.
  • Logging Configuration Helper: A feature on the statistics page to assist in configuring Caddy for JSON logging if not already set up.
  • Containerized Deployment: Packaged as a Docker image for easy and consistent deployment.
  • Process Management: Uses Supervisor to manage both the Caddy server and the Flask application processes within the container.

Getting Started

Prerequisites

Building the Docker Image

  1. Clone this repository or download the project files.
  2. Navigate to the project's root directory (where the Dockerfile is located).
  3. Build the Docker image:
    docker build -t caddypanel:latest .
    For multi-architecture builds (e.g., linux/arm64 or linux/amd64), you might use docker buildx:
    # Example for amd64
    docker buildx build --platform linux/amd64 -t caddypanel:latest --load .

Running the Container

It's recommended to use Docker Compose for a more straightforward setup.

1. Using docker-compose.yml (Recommended)

a. Create Host Directories for Volumes: Before running, create directories on your host machine to persist data: bash mkdir -p ./caddy_config_on_host mkdir -p ./caddy_data_on_host mkdir -p ./app_data_on_host

b. Create an .env file: In the same directory as docker-compose.yml, create a file named .env with the following content. Replace the placeholder FLASK_SECRET_KEY with a strong, random key. env # .env FLASK_SECRET_KEY=your_super_strong_and_random_flask_secret_key_here TZ=Europe/Paris # Optional: Set your timezone You can generate a secret key using: openssl rand -hex 32

c. Start the container: bash docker-compose up -d

2. Using docker run

If you prefer not to use Docker Compose, you can run the container with the following command. Ensure you've created the host directories as mentioned above. Replace your_super_strong_and_random_flask_secret_key_here and adjust paths/ports if needed.

docker run -d \
    -p 80:80 \
    -p 443:443 \
    -p 5000:5000 \
    -v "$(pwd)/caddy_config_on_host:/etc/caddy" \
    -v "$(pwd)/caddy_data_on_host:/data/caddy" \
    -v "$(pwd)/app_data_on_host:/app_data" \
    -e FLASK_SECRET_KEY="your_super_strong_and_random_flask_secret_key_here" \
    -e TZ="Europe/Paris" \
    --name caddypanel-instance \
    caddypanel:latest

About

The Caddy 2 Reverse Proxy Control Panel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published