diff --git a/README.md b/README.md index 2b84b91..ca6a8b7 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ CaddyGen is a user-friendly web interface for generating [Caddy server](https:// - 🛡️ Advanced **security options** (CSP, rate limiting, IP filtering) - ⚡ **Performance optimizations** (compression, caching) - 🌐 **CORS configuration** -- 📁 File server options (directory listing, PHP support) +- 📁 File server options (directory listing, PHP and FrankenPHP support) --- diff --git a/src/App.vue b/src/App.vue index 1b9c4e7..400bedd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -198,10 +198,11 @@ function importHosts(newHosts: CaddyHost[]) { {{ host.fileServer.root }} - + ({{ [ host.fileServer.browse ? 'Browse' : null, - host.fileServer.php ? 'PHP' : null + host.fileServer.php ? 'PHP' : null, + host.fileServer.frankenphp ? 'FrankenPHP' : null, ].filter(Boolean).join(', ') }}) diff --git a/src/components/CaddyConfig.vue b/src/components/CaddyConfig.vue index 967ac19..a3fb5f9 100644 --- a/src/components/CaddyConfig.vue +++ b/src/components/CaddyConfig.vue @@ -23,7 +23,7 @@ onMounted(() => { greedy: true }, 'directive': { - pattern: /^\s*(root|file_server|reverse_proxy|encode|tls|basicauth|header|php_fastcgi|rate_limit|respond|remote_ip|hide|not|forward_auth|uri|copy_headers)\b/m, + pattern: /^\s*(root|file_server|reverse_proxy|encode|tls|basicauth|header|php_fastcgi|php_server|rate_limit|respond|remote_ip|hide|not|forward_auth|uri|copy_headers)\b/m, alias: 'keyword' }, 'block': { @@ -65,7 +65,7 @@ onMounted(() => { alias: 'operator' }, 'option': { - pattern: /\b(browse|internal|gzip|brotli|php_fastcgi|uri|copy_headers)\b/, + pattern: /\b(browse|internal|gzip|brotli|php_fastcgi|php_server|uri|copy_headers)\b/, alias: 'property' }, 'number': { @@ -101,12 +101,20 @@ const caddyConfig = computed(() => { if (host.presetName) { lines.push(`# ${host.presetName}`); } - + + if (host.fileServer && host.fileServer.frankenphp) { + lines.push('{'); + lines.push(' frankenphp'); + lines.push('}'); + } + lines.push(`${host.domain} {`); if (host.fileServer) { lines.push(` root * ${host.fileServer.root}`); - if (host.fileServer.php) { + if (host.fileServer.frankenphp) { + lines.push(' php_server'); + } else if (host.fileServer.php) { lines.push(' php_fastcgi unix//run/php/php-fpm.sock'); } lines.push(` file_server${host.fileServer.browse ? ' browse' : ''}`); diff --git a/src/components/HostForm.vue b/src/components/HostForm.vue index e6694c3..f5fc277 100644 --- a/src/components/HostForm.vue +++ b/src/components/HostForm.vue @@ -20,6 +20,7 @@ const host = ref(props.initialHost || { root: '', browse: false, php: false, + frankenphp: false, hide: [] }, gzip: false, @@ -72,6 +73,7 @@ function handleServerTypeChange(event: Event) { root: '/var/www/html', browse: false, php: false, + frankenphp: false, hide: [] }; } @@ -137,6 +139,13 @@ function applyPreset(preset: PresetConfig) { + + +
+
@@ -307,7 +316,7 @@ function applyPreset(preset: PresetConfig) {

Performance

- +