├── .bolt └── config.json ├── .github └── workflows │ └── docker-publish.yml ├── .gitignore ├── Dockerfile ├── README.md ├── docker-compose.yml ├── index.html ├── nginx.conf ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.svg └── vite.svg ├── src ├── App.vue ├── assets │ └── vue.svg ├── components │ ├── CaddyConfig.vue │ ├── HelloWorld.vue │ ├── HostForm.vue │ ├── ImportModal.vue │ ├── PresetModal.vue │ └── PresetSelect.vue ├── main.ts ├── presets.ts ├── style.css ├── types │ └── caddy.ts └── vite-env.d.ts ├── tailwind.config.js ├── tsconfig.app.json ├── tsconfig.app.tsbuildinfo ├── tsconfig.json ├── tsconfig.node.json ├── tsconfig.node.tsbuildinfo └── vite.config.ts /.bolt/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "template": "vite-vue-ts" 3 | } 4 | -------------------------------------------------------------------------------- /.github/workflows/docker-publish.yml: -------------------------------------------------------------------------------- 1 | name: Docker Build and Publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | build-and-push: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | # Checkout the repository 14 | - name: Checkout repository 15 | uses: actions/checkout@v3 16 | 17 | # Set up Docker Buildx 18 | - name: Set up Docker Buildx 19 | uses: docker/setup-buildx-action@v2 20 | 21 | # Log in to Docker Hub 22 | - name: Log in to Docker Hub 23 | uses: docker/login-action@v2 24 | with: 25 | username: ${{ secrets.DOCKER_USERNAME }} 26 | password: ${{ secrets.DOCKER_PASSWORD }} 27 | 28 | # Build and push the multi-platform image 29 | - name: Build and push multi-platform Docker image 30 | uses: docker/build-push-action@v4 31 | with: 32 | context: . 33 | push: true 34 | platforms: linux/amd64,linux/arm64 35 | tags: wardy784/caddygen:latest -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-alpine as build 2 | 3 | WORKDIR /app 4 | COPY package*.json ./ 5 | RUN npm install 6 | COPY . . 7 | RUN npx vite build 8 | 9 | FROM nginx:alpine 10 | COPY --from=build /app/dist /usr/share/nginx/html 11 | COPY nginx.conf /etc/nginx/conf.d/default.conf 12 | EXPOSE 80 13 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **CaddyGen - Caddy Config Generator** 2 | 3 | CaddyGen is a user-friendly web interface for generating [Caddy server](https://caddyserver.com) configurations. Easily create and manage reverse proxy and file server configurations with support for SSL, compression, security headers, and more. 4 | 5 | ## **Features** 6 | 7 | - 🚀 **Visual configuration builder** for the Caddy server 8 | - 🔒 **SSL/TLS configuration** with Let's Encrypt support 9 | - 🔄 **Reverse proxy** and **file server** setup 10 | - 📦 Pre-configured **presets** for popular applications 11 | - 💾 **Local storage** for saving configurations 12 | - 📤 **Import/Export** for Caddyfiles 13 | - 🛡️ Advanced **security options** (CSP, rate limiting, IP filtering) 14 | - ⚡ **Performance optimizations** (compression, caching) 15 | - 🌐 **CORS configuration** 16 | - 📁 File server options (directory listing, PHP and FrankenPHP support) 17 | 18 | --- 19 | 20 | ## **Live Demo** 21 | 22 | Try CaddyGen now: [demo.caddygen.site](https://demo.caddygen.site) 23 | 24 | ### **How to Use** 25 | 1. Click the **"Add New Host"** button. 26 | 2. Configure your settings: 27 | - Choose between **reverse proxy** or **file server**. 28 | - Select from pre-configured **application presets**. 29 | - Configure SSL, compression, and security options. 30 | 3. View, copy, or download your generated **Caddyfile**. 31 | 32 | --- 33 | 34 | ## **Docker Deployment** 35 | 36 | Deploy CaddyGen using Docker with ease: 37 | 38 | ### **Run the Pre-Built Image** 39 | Pull the latest image from Docker Hub and run it: 40 | ```bash 41 | docker pull wardy784/caddygen:latest 42 | docker run -d --restart unless-stopped -p 8189:80 wardy784/caddygen:latest 43 | ``` 44 | 45 | ### **Run with Docker Compose** 46 | Use the following `docker-compose.yml`: 47 | ```yaml 48 | version: '3.8' 49 | 50 | services: 51 | app: 52 | image: wardy784/caddygen:latest 53 | ports: 54 | - "8189:80" 55 | restart: unless-stopped 56 | container_name: caddygen 57 | ``` 58 | 59 | To deploy: 60 | ```bash 61 | docker compose up -d 62 | ``` 63 | 64 | Access the app at `http://localhost:8189`. 65 | 66 | ### **Build Locally** 67 | If you prefer to build the image yourself: 68 | ```bash 69 | docker build -t caddygen . 70 | docker run -p 8189:80 caddygen 71 | ``` 72 | 73 | --- 74 | 75 | ## **Development Setup** 76 | 77 | This project is built using the following technologies: 78 | 79 | - **Vue 3** with TypeScript 80 | - **Vite** for fast builds 81 | - **Tailwind CSS** for styling 82 | - **Prism.js** for syntax highlighting 83 | - **Lucide Icons** for UI elements 84 | 85 | ### **Getting Started** 86 | 1. Clone the repository: 87 | ```bash 88 | git clone https://github.com/wardy784/caddygen.git 89 | cd caddygen 90 | ``` 91 | 92 | 2. Install dependencies: 93 | ```bash 94 | npm install 95 | ``` 96 | 97 | 3. Start the development server: 98 | ```bash 99 | npm run dev 100 | ``` 101 | 102 | 4. Open the app in your browser at `http://localhost:5173`. 103 | 104 | --- 105 | 106 | ## **Contributing** 107 | 108 | Contributions are welcome! Whether it's fixing a bug, suggesting a new feature, or improving the documentation, we’d love your help. Feel free to open an issue or submit a pull request. 109 | 110 | --- 111 | 112 | ## **License** 113 | 114 | CaddyGen is open-source and available under the **MIT License**. Feel free to use, modify, and distribute it as you wish! 115 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | app: 5 | image: wardy784/caddygen:latest 6 | ports: 7 | - "8189:80" 8 | restart: unless-stopped 9 | container_name: caddygen -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |No hosts configured yet. Add your first host to get started!
122 |{{ caddyConfig }}
258 |
15 | Edit
16 | components/HelloWorld.vue
to test HMR
17 |
21 | Check out 22 | create-vue, the official Vue + Vite starter 25 |
26 |27 | Learn more about IDE Support for Vue in the 28 | Vue Docs Scaling up Guide. 33 |
34 |Click on the Vite and Vue logos to learn more
35 | 36 | 37 | 42 | -------------------------------------------------------------------------------- /src/components/HostForm.vue: -------------------------------------------------------------------------------- 1 | 106 | 107 | 108 | 395 | 396 | 397 | -------------------------------------------------------------------------------- /src/components/ImportModal.vue: -------------------------------------------------------------------------------- 1 | 122 | 123 | 124 |