Skip to content

A self-hosted media server and file management system

feat: basic octane setup with frankenphp

aminnausin1825149e0f62
diff --git a/.gitignore b/.gitignore
index df74306d..a1bdd72a 100755
--- a/.gitignore
+++ b/.gitignore
@@ -48,3 +48,7 @@ stats.html
/resources/js/routes/*
/config/horizon-dynamic.php
/storage/app/public/metadata/*
+
+**/caddy
+frankenphp
+frankenphp-worker.php
diff --git a/Caddyfile b/Caddyfile
new file mode 100644
index 00000000..93414a67
--- /dev/null
+++ b/Caddyfile
@@ -0,0 +1,125 @@
+{
+ {$CADDY_GLOBAL_OPTIONS}
+
+ admin {$CADDY_SERVER_ADMIN_HOST}:{$CADDY_SERVER_ADMIN_PORT}
+
+ frankenphp {
+ worker {
+ file "{$APP_PUBLIC_PATH}/frankenphp-worker.php"
+ {$CADDY_SERVER_WORKER_DIRECTIVE}
+ {$CADDY_SERVER_WATCH_DIRECTIVES}
+ }
+ }
+}
+
+{$CADDY_EXTRA_CONFIG}
+
+{$APP_URL} {
+ log {
+ level {$CADDY_SERVER_LOG_LEVEL}
+
+ format filter {
+ wrap {$CADDY_SERVER_LOGGER}
+ fields {
+ request>uri query {
+ replace authorization REDACTED
+ }
+ }
+ }
+ }
+
+ route {
+ root * "{$APP_PUBLIC_PATH}"
+ encode zstd br gzip
+
+ header {
+ X-Frame-Options "SAMEORIGIN"
+ X-Content-Type-Options "nosniff"
+ Referrer-Policy "strict-origin-when-cross-origin"
+ Permissions-Policy "camera=(), microphone=(), geolocation=()"
+ -Server
+ }
+
+ @app path /app /app/*
+ handle @app {
+ reverse_proxy 127.0.0.1:6001
+ }
+
+ @iptv path /iptv
+ handle @iptv {
+ rewrite * /storage/media/anime/test/test.html
+ file_server
+ }
+
+ @hidden path /.ht* /.git/*
+ respond @hidden 404
+
+ @private_media path /storage/media/*
+ @valid_referrer header_regexp Referer ^https?://{$APP_HOST}(:[0-9]+)?(/|$)
+ handle @private_media {
+ handle @valid_referrer {
+ header Cache-Control "private, max-age=3600"
+ file_server
+ }
+ respond 403
+ }
+
+ @hashed_storage path_regexp hashed ^/storage/.*_[0-9a-f]{8,}\.(jpg|jpeg|png|gif|webp)$
+ handle @hashed_storage {
+ header Cache-Control "public, max-age=31536000, immutable"
+ file_server
+ }
+
+ @previews path_regexp previews ^/storage/.*/preview\.(webp|png|jpg|jpeg)$
+ handle @previews {
+ header Cache-Control "public, max-age=300"
+ file_server
+ }
+
+ @storyboards path_regexp storyboards ^/storage/.*/storyboard/[0-9]+\.(jpg|jpeg|webp)$
+ handle @storyboards {
+ header Cache-Control "private, max-age=30, must-revalidate"
+ file_server
+ }
+
+ @storage_fonts path_regexp storage_fonts ^/storage/.*\.(woff|woff2|ttf)$
+ handle @storage_fonts {
+ header Cache-Control "public, max-age=3600"
+ file_server
+ }
+
+ @storage_images path_regexp storage_images ^/storage/.*\.(jpg|jpeg|png|gif|webp)$
+ handle @storage_images {
+ header Cache-Control "public, max-age=3600"
+ file_server
+ }
+
+ @manifest path /manifest.json
+ handle @manifest {
+ header {
+ Cache-Control "public, max-age=3600"
+ Content-Type "application/json"
+ X-Served-By "frankenphp"
+ }
+ file_server
+ }
+
+ @assets path_regexp assets \.(js|css|map|woff|woff2|ttf)$
+ handle @assets {
+ header Cache-Control "public, max-age=31536000, immutable"
+ file_server
+ }
+
+ @images path_regexp images \.(jpg|jpeg|png|gif|webp|svg|ico)$
+ handle @images {
+ header Cache-Control "public, max-age=259200"
+ file_server
+ }
+
+ php_server {
+ index frankenphp-worker.php
+ try_files {path} frankenphp-worker.php
+ resolve_root_symlink
+ }
+ }
+}
diff --git a/README.md b/README.md
index 47bc6177..8453d05f 100755
--- a/README.md
+++ b/README.md
@@ -250,7 +250,6 @@ Below are screenshots of the current webpage on Desktop and Android.
<img width="1597" height="917" alt="image" src="https://github.com/user-attachments/assets/163f0e74-78d8-4e9a-b000-a178280fba16" />
</p>
-
### Explore Page
<p align="center">
@@ -432,6 +431,11 @@ To set up MediaServer without Docker, you’ll need:
- HTTPS: A valid SSL certificate is required to enable certain metadata features
- Use the nginx config in the docker folder for optimal caching
+#### Windows
+
+- [phpredis](https://pecl.php.net/package/redis) dll extension must be loaded to use redis cache on windows
+ - Download the version that corresponds to your PHP version (such as [v6.3.0](https://pecl.php.net/package/redis/6.3.0/windows) for PHP 7.4 to 8.5)
+
> [!TIP]
> You can use [Laragon](https://laragon.org/) to try it out locally. This will only be available on the host machine.
diff --git a/bootstrap/cache/packages.php b/bootstrap/cache/packages.php
index 0a01f10b..b8d0f4e2 100755
--- a/bootstrap/cache/packages.php
+++ b/bootstrap/cache/packages.php
@@ -53,6 +53,17 @@
0 => 'Laravel\\Horizon\\HorizonServiceProvider',
),
),
+ 'laravel/octane' =>
+ array (
+ 'aliases' =>
+ array (
+ 'Octane' => 'Laravel\\Octane\\Facades\\Octane',
+ ),
+ 'providers' =>
+ array (
+ 0 => 'Laravel\\Octane\\OctaneServiceProvider',
+ ),
+ ),
'laravel/pail' =>
array (
'providers' =>
diff --git a/bootstrap/cache/services.php b/bootstrap/cache/services.php
index 2e103185..0cc2ec9e 100755
--- a/bootstrap/cache/services.php
+++ b/bootstrap/cache/services.php
@@ -30,26 +30,27 @@
26 => 'Denniseilander\\LogFiles\\LogFilesServiceProvider',
27 => 'HosmelQ\\Laravel\\Pulse\\Schedule\\ScheduleServiceProvider',
28 => 'Laravel\\Horizon\\HorizonServiceProvider',
- 29 => 'Laravel\\Pail\\PailServiceProvider',
- 30 => 'Laravel\\Pulse\\PulseServiceProvider',
- 31 => 'Laravel\\Reverb\\ApplicationManagerServiceProvider',
- 32 => 'Laravel\\Reverb\\ReverbServiceProvider',
- 33 => 'Laravel\\Sail\\SailServiceProvider',
- 34 => 'Laravel\\Sanctum\\SanctumServiceProvider',
- 35 => 'Laravel\\Tinker\\TinkerServiceProvider',
- 36 => 'Laravel\\Wayfinder\\WayfinderServiceProvider',
- 37 => 'Livewire\\LivewireServiceProvider',
- 38 => 'Carbon\\Laravel\\ServiceProvider',
- 39 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
- 40 => 'Termwind\\Laravel\\TermwindServiceProvider',
- 41 => 'Opcodes\\LogViewer\\LogViewerServiceProvider',
- 42 => 'PauloHortelan\\RequestsGraphPulse\\RequestsGraphServiceProvider',
- 43 => 'Robertogallea\\PulseApi\\PulseAPIServiceProvider',
- 44 => 'App\\Providers\\AppServiceProvider',
- 45 => 'App\\Providers\\Api\\RouteServiceProvider',
- 46 => 'App\\Providers\\AppServiceProvider',
- 47 => 'App\\Providers\\HorizonServiceProvider',
- 48 => 'App\\Providers\\PathResolverServiceProvider',
+ 29 => 'Laravel\\Octane\\OctaneServiceProvider',
+ 30 => 'Laravel\\Pail\\PailServiceProvider',
+ 31 => 'Laravel\\Pulse\\PulseServiceProvider',
+ 32 => 'Laravel\\Reverb\\ApplicationManagerServiceProvider',
+ 33 => 'Laravel\\Reverb\\ReverbServiceProvider',
+ 34 => 'Laravel\\Sail\\SailServiceProvider',
+ 35 => 'Laravel\\Sanctum\\SanctumServiceProvider',
+ 36 => 'Laravel\\Tinker\\TinkerServiceProvider',
+ 37 => 'Laravel\\Wayfinder\\WayfinderServiceProvider',
+ 38 => 'Livewire\\LivewireServiceProvider',
+ 39 => 'Carbon\\Laravel\\ServiceProvider',
+ 40 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
+ 41 => 'Termwind\\Laravel\\TermwindServiceProvider',
+ 42 => 'Opcodes\\LogViewer\\LogViewerServiceProvider',
+ 43 => 'PauloHortelan\\RequestsGraphPulse\\RequestsGraphServiceProvider',
+ 44 => 'Robertogallea\\PulseApi\\PulseAPIServiceProvider',
+ 45 => 'App\\Providers\\AppServiceProvider',
+ 46 => 'App\\Providers\\Api\\RouteServiceProvider',
+ 47 => 'App\\Providers\\AppServiceProvider',
+ 48 => 'App\\Providers\\HorizonServiceProvider',
+ 49 => 'App\\Providers\\PathResolverServiceProvider',
),
'eager' =>
array (
@@ -68,23 +69,24 @@
12 => 'Dedoc\\Scramble\\ScrambleServiceProvider',
13 => 'Denniseilander\\LogFiles\\LogFilesServiceProvider',
14 => 'Laravel\\Horizon\\HorizonServiceProvider',
- 15 => 'Laravel\\Pail\\PailServiceProvider',
- 16 => 'Laravel\\Pulse\\PulseServiceProvider',
- 17 => 'Laravel\\Reverb\\ReverbServiceProvider',
- 18 => 'Laravel\\Sanctum\\SanctumServiceProvider',
- 19 => 'Laravel\\Wayfinder\\WayfinderServiceProvider',
- 20 => 'Livewire\\LivewireServiceProvider',
- 21 => 'Carbon\\Laravel\\ServiceProvider',
- 22 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
- 23 => 'Termwind\\Laravel\\TermwindServiceProvider',
- 24 => 'Opcodes\\LogViewer\\LogViewerServiceProvider',
- 25 => 'PauloHortelan\\RequestsGraphPulse\\RequestsGraphServiceProvider',
- 26 => 'Robertogallea\\PulseApi\\PulseAPIServiceProvider',
- 27 => 'App\\Providers\\AppServiceProvider',
- 28 => 'App\\Providers\\Api\\RouteServiceProvider',
- 29 => 'App\\Providers\\AppServiceProvider',
- 30 => 'App\\Providers\\HorizonServiceProvider',
- 31 => 'App\\Providers\\PathResolverServiceProvider',
+ 15 => 'Laravel\\Octane\\OctaneServiceProvider',
+ 16 => 'Laravel\\Pail\\PailServiceProvider',
+ 17 => 'Laravel\\Pulse\\PulseServiceProvider',
+ 18 => 'Laravel\\Reverb\\ReverbServiceProvider',
+ 19 => 'Laravel\\Sanctum\\SanctumServiceProvider',
+ 20 => 'Laravel\\Wayfinder\\WayfinderServiceProvider',
+ 21 => 'Livewire\\LivewireServiceProvider',
+ 22 => 'Carbon\\Laravel\\ServiceProvider',
+ 23 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
+ 24 => 'Termwind\\Laravel\\TermwindServiceProvider',
+ 25 => 'Opcodes\\LogViewer\\LogViewerServiceProvider',
+ 26 => 'PauloHortelan\\RequestsGraphPulse\\RequestsGraphServiceProvider',
+ 27 => 'Robertogallea\\PulseApi\\PulseAPIServiceProvider',
+ 28 => 'App\\Providers\\AppServiceProvider',
+ 29 => 'App\\Providers\\Api\\RouteServiceProvider',
+ 30 => 'App\\Providers\\AppServiceProvider',
+ 31 => 'App\\Providers\\HorizonServiceProvider',
+ 32 => 'App\\Providers\\PathResolverServiceProvider',
),
'deferred' =>
array (
diff --git a/composer.json b/composer.json
index a2f59d44..4f034654 100755
--- a/composer.json
+++ b/composer.json
@@ -17,6 +17,7 @@
"hosmelq/laravel-pulse-schedule": "^1.0",
"laravel/framework": "^11.31",
"laravel/horizon": "^5.33",
+ "laravel/octane": "^2.21",
"laravel/pulse": "^1.5",
"laravel/reverb": "^1.0",
"laravel/sanctum": "^4.0",
diff --git a/composer.lock b/composer.lock
index de95fa72..5cf9f659 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "79e2b89fa0bf004b1789708384634793",
+ "content-hash": "28d8675be6c49a8e8a673a30f29c1789",
"packages": [
{
"name": "bepsvpt/blurhash",
@@ -1633,6 +1633,95 @@
},
"time": "2025-02-15T19:56:16+00:00"
},
+ {
+ "name": "laminas/laminas-diactoros",
+ "version": "3.9.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/laminas/laminas-diactoros.git",
+ "reference": "4ab9fe10869ac0cd46fa78e641b6d0f4389bc6b4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/4ab9fe10869ac0cd46fa78e641b6d0f4389bc6b4",
+ "reference": "4ab9fe10869ac0cd46fa78e641b6d0f4389bc6b4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
+ "psr/http-factory": "^1.1",
+ "psr/http-message": "^1.1 || ^2.0"
+ },
+ "conflict": {
+ "amphp/amp": "<2.6.4"
+ },
+ "provide": {
+ "psr/http-factory-implementation": "^1.0",
+ "psr/http-message-implementation": "^1.1 || ^2.0"
+ },
+ "require-dev": {
+ "boundwize/structarmed": "^0.17.7",
+ "ext-curl": "*",
+ "ext-dom": "*",
+ "ext-gd": "*",
+ "ext-libxml": "*",
+ "http-interop/http-factory-tests": "^2.2.0",
+ "laminas/laminas-coding-standard": "~3.1.0",
+ "php-http/psr7-integration-tests": "^1.4.0",
+ "phpunit/phpunit": "^10.5.36",
+ "psalm/plugin-phpunit": "^0.19.5",
+ "vimeo/psalm": "^6.13"
+ },
+ "type": "library",
+ "extra": {
+ "laminas": {
+ "module": "Laminas\\Diactoros",
+ "config-provider": "Laminas\\Diactoros\\ConfigProvider"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/functions/create_uploaded_file.php",
+ "src/functions/marshal_headers_from_sapi.php",
+ "src/functions/marshal_method_from_sapi.php",
+ "src/functions/marshal_protocol_version_from_sapi.php",
+ "src/functions/normalize_server.php",
+ "src/functions/normalize_uploaded_files.php",
+ "src/functions/parse_cookie_header.php"
+ ],
+ "psr-4": {
+ "Laminas\\Diactoros\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "description": "PSR HTTP Message implementations",
+ "homepage": "https://laminas.dev",
+ "keywords": [
+ "http",
+ "laminas",
+ "psr",
+ "psr-17",
+ "psr-7"
+ ],
+ "support": {
+ "chat": "https://laminas.dev/chat",
+ "docs": "https://docs.laminas.dev/laminas-diactoros/",
+ "forum": "https://discourse.laminas.dev",
+ "issues": "https://github.com/laminas/laminas-diactoros/issues",
+ "rss": "https://github.com/laminas/laminas-diactoros/releases.atom",
+ "source": "https://github.com/laminas/laminas-diactoros"
+ },
+ "funding": [
+ {
+ "url": "https://crowdfunding.linuxfoundation.org/initiatives/laminas-project",
+ "type": "custom"
+ }
+ ],
+ "time": "2026-10-08T08:19:47+00:00"
+ },
{
"name": "laravel/framework",
"version": "v11.47.0",
@@ -1927,6 +2016,95 @@
},
"time": "2026-01-06T14:49:58+00:00"
},
+ {
+ "name": "laravel/octane",
+ "version": "v2.21.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/laravel/octane.git",
+ "reference": "ce755128c9c2be39adcf8b50ec757c97b3b30eb7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/laravel/octane/zipball/ce755128c9c2be39adcf8b50ec757c97b3b30eb7",
+ "reference": "ce755128c9c2be39adcf8b50ec757c97b3b30eb7",
+ "shasum": ""
+ },
+ "require": {
+ "laminas/laminas-diactoros": "^3.0",
+ "laravel/framework": "^10.10.1|^11.0|^12.0|^13.0",
+ "laravel/prompts": "^0.1.24|^0.2.0|^0.3.0",
+ "laravel/serializable-closure": "^1.3|^2.0",
+ "nesbot/carbon": "^2.66.0|^3.0",
+ "php": "^8.1.0",
+ "symfony/console": "^6.0|^7.0|^8.0",
+ "symfony/psr-http-message-bridge": "^2.2.0|^6.4|^7.0|^8.0"
+ },
+ "conflict": {
+ "spiral/roadrunner": "<2023.1.0",
+ "spiral/roadrunner-cli": "<2.6.0",
+ "spiral/roadrunner-http": "<3.3.0"
+ },
+ "require-dev": {
+ "guzzlehttp/guzzle": "^7.6.1",
+ "inertiajs/inertia-laravel": "^1.3.2|^2.0",
+ "laravel/scout": "^10.2.1",
+ "laravel/socialite": "^5.6.1",
+ "livewire/livewire": "^2.12.3|^3.0",
+ "nunomaduro/collision": "^6.4.0|^7.5.2|^8.0",
+ "orchestra/testbench": "^8.21|^9.0|^10.0|^11.0",
+ "phpstan/phpstan": "^2.1.7",
+ "phpunit/phpunit": "^10.4|^11.5|^12.0|^13.0",
+ "spiral/roadrunner-cli": "^2.6.0",
+ "spiral/roadrunner-http": "^3.3.0"
+ },
+ "bin": [
+ "bin/roadrunner-worker",
+ "bin/swoole-server"
+ ],
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "aliases": {
+ "Octane": "Laravel\\Octane\\Facades\\Octane"
+ },
+ "providers": [
+ "Laravel\\Octane\\OctaneServiceProvider"
+ ]
+ },
+ "branch-alias": {
+ "dev-master": "2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Laravel\\Octane\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ "email": "[email protected]"
+ }
+ ],
+ "description": "Supercharge your Laravel application's performance.",
+ "keywords": [
+ "frankenphp",
+ "laravel",
+ "octane",
+ "roadrunner",
+ "swoole"
+ ],
+ "support": {
+ "issues": "https://github.com/laravel/octane/issues",
+ "source": "https://github.com/laravel/octane"
+ },
+ "time": "2026-10-05T14:39:46+00:00"
+ },
{
"name": "laravel/prompts",
"version": "v0.3.8",
@@ -7443,6 +7621,93 @@
],
"time": "2026-01-26T15:07:59+00:00"
},
+ {
+ "name": "symfony/psr-http-message-bridge",
+ "version": "v8.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/psr-http-message-bridge.git",
+ "reference": "67fd34de15ded1763aa1e330fe345f080a94022c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/67fd34de15ded1763aa1e330fe345f080a94022c",
+ "reference": "67fd34de15ded1763aa1e330fe345f080a94022c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.4.1",
+ "psr/http-message": "^1.0|^2.0",
+ "symfony/http-foundation": "^7.4|^8.0"
+ },
+ "conflict": {
+ "php-http/discovery": "<1.15"
+ },
+ "require-dev": {
+ "nyholm/psr7": "^1.1",
+ "php-http/discovery": "^1.15",
+ "psr/log": "^1.1.4|^2|^3",
+ "symfony/browser-kit": "^7.4|^8.0",
+ "symfony/config": "^7.4|^8.0",
+ "symfony/event-dispatcher": "^7.4|^8.0",
+ "symfony/framework-bundle": "^7.4|^8.0",
+ "symfony/http-kernel": "^7.4|^8.0",
+ "symfony/runtime": "^7.4|^8.0"
+ },
+ "type": "symfony-bridge",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Bridge\\PsrHttpMessage\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "[email protected]"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "PSR HTTP message bridge",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "http",
+ "http-message",
+ "psr-17",
+ "psr-7"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/psr-http-message-bridge/tree/v8.1.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://github.com/nicolas-grekas",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2026-05-29T05:06:50+00:00"
+ },
{
"name": "symfony/routing",
"version": "v7.4.13",
diff --git a/config/octane.php b/config/octane.php
new file mode 100644
index 00000000..b5b609ed
--- /dev/null
+++ b/config/octane.php
@@ -0,0 +1,254 @@
+<?php
+
+use Laravel\Octane\Contracts\OperationTerminated;
+use Laravel\Octane\Events\RequestHandled;
+use Laravel\Octane\Events\RequestReceived;
+use Laravel\Octane\Events\RequestTerminated;
+use Laravel\Octane\Events\TaskReceived;
+use Laravel\Octane\Events\TaskTerminated;
+use Laravel\Octane\Events\TickReceived;
+use Laravel\Octane\Events\TickTerminated;
+use Laravel\Octane\Events\WorkerErrorOccurred;
+use Laravel\Octane\Events\WorkerStarting;
+use Laravel\Octane\Events\WorkerStopping;
+use Laravel\Octane\Listeners\CloseMonologHandlers;
+use Laravel\Octane\Listeners\CollectGarbage;
+use Laravel\Octane\Listeners\DisconnectFromDatabases;
+use Laravel\Octane\Listeners\EnsureUploadedFilesAreValid;
+use Laravel\Octane\Listeners\EnsureUploadedFilesCanBeMoved;
+use Laravel\Octane\Listeners\FlushOnce;
+use Laravel\Octane\Listeners\FlushTemporaryContainerInstances;
+use Laravel\Octane\Listeners\FlushUploadedFiles;
+use Laravel\Octane\Listeners\ReportException;
+use Laravel\Octane\Listeners\StopWorkerIfNecessary;
+use Laravel\Octane\Octane;
+
+return [
+
+ /*
+ |--------------------------------------------------------------------------
+ | Octane Server
+ |--------------------------------------------------------------------------
+ |
+ | This value determines the default "server" that will be used by Octane
+ | when starting, restarting, or stopping your server via the CLI. You
+ | are free to change this to the supported server of your choosing.
+ |
+ | Supported: "roadrunner", "swoole", "frankenphp"
+ |
+ */
+
+ 'server' => env('OCTANE_SERVER', 'roadrunner'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Force HTTPS
+ |--------------------------------------------------------------------------
+ |
+ | When this configuration value is set to "true", Octane will inform the
+ | framework that all absolute links must be generated using the HTTPS
+ | protocol. Otherwise your links may be generated using plain HTTP.
+ |
+ */
+
+ 'https' => env('OCTANE_HTTPS', false),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Octane Listeners
+ |--------------------------------------------------------------------------
+ |
+ | All of the event listeners for Octane's events are defined below. These
+ | listeners are responsible for resetting your application's state for
+ | the next request. You may even add your own listeners to the list.
+ |
+ */
+
+ 'listeners' => [
+ WorkerStarting::class => [
+ EnsureUploadedFilesAreValid::class,
+ EnsureUploadedFilesCanBeMoved::class,
+ ],
+
+ RequestReceived::class => [
+ ...Octane::prepareApplicationForNextOperation(),
+ ...Octane::prepareApplicationForNextRequest(),
+ //
+ ],
+
+ RequestHandled::class => [
+ //
+ ],
+
+ RequestTerminated::class => [
+ // FlushUploadedFiles::class,
+ ],
+
+ TaskReceived::class => [
+ ...Octane::prepareApplicationForNextOperation(),
+ //
+ ],
+
+ TaskTerminated::class => [
+ //
+ ],
+
+ TickReceived::class => [
+ ...Octane::prepareApplicationForNextOperation(),
+ //
+ ],
+
+ TickTerminated::class => [
+ //
+ ],
+
+ OperationTerminated::class => [
+ FlushOnce::class,
+ FlushTemporaryContainerInstances::class,
+ // DisconnectFromDatabases::class,
+ // CollectGarbage::class,
+ ],
+
+ WorkerErrorOccurred::class => [
+ ReportException::class,
+ StopWorkerIfNecessary::class,
+ ],
+
+ WorkerStopping::class => [
+ CloseMonologHandlers::class,
+ ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Warm / Flush Bindings
+ |--------------------------------------------------------------------------
+ |
+ | The bindings listed below will either be pre-warmed when a worker boots
+ | or they will be flushed before every new request. Flushing a binding
+ | will force the container to resolve that binding again when asked.
+ |
+ */
+
+ 'warm' => [
+ ...Octane::defaultServicesToWarm(),
+ ],
+
+ 'flush' => [
+ //
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Octane Swoole Tables
+ |--------------------------------------------------------------------------
+ |
+ | While using Swoole, you may define additional tables as required by the
+ | application. These tables can be used to store data that needs to be
+ | quickly accessed by other workers on the particular Swoole server.
+ |
+ */
+
+ 'tables' => [
+ 'example:1000' => [
+ 'name' => 'string:1000',
+ 'votes' => 'int',
+ ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Octane Swoole Cache Table
+ |--------------------------------------------------------------------------
+ |
+ | While using Swoole, you may leverage the Octane cache, which is powered
+ | by a Swoole table. You may set the maximum number of rows as well as
+ | the number of bytes per row using the configuration options below.
+ |
+ */
+
+ 'cache' => [
+ 'rows' => 1000,
+ 'bytes' => 10000,
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | File Watching
+ |--------------------------------------------------------------------------
+ |
+ | The following list of files and directories will be watched when using
+ | the --watch option offered by Octane. If any of the directories and
+ | files are changed, Octane will automatically reload your workers.
+ |
+ */
+
+ 'watch' => [
+ 'app',
+ 'bootstrap',
+ 'config/**/*.php',
+ 'database/**/*.php',
+ 'public/**/*.php',
+ 'resources/**/*.php',
+ 'routes',
+ 'composer.lock',
+ '.env',
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Garbage Collection Threshold
+ |--------------------------------------------------------------------------
+ |
+ | When executing long-lived PHP scripts such as Octane, memory can build
+ | up before being cleared by PHP. You can force Octane to run garbage
+ | collection if your application consumes this amount of megabytes.
+ |
+ */
+
+ 'garbage' => 50,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Maximum Execution Time
+ |--------------------------------------------------------------------------
+ |
+ | The following setting configures the maximum execution time for requests
+ | being handled by Octane. You may set this value to 0 to indicate that
+ | there isn't a specific time limit on Octane request execution time.
+ |
+ */
+
+ 'max_execution_time' => 30,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Octane Server State File
+ |--------------------------------------------------------------------------
+ |
+ | This value determines where Octane stores the state file used to track
+ | the running server's master process ID and admin endpoint, which is
+ | read by various Octane commands. You may tweak this if necessary.
+ |
+ */
+
+ 'state_file' => env('OCTANE_STATE_FILE', storage_path('logs/octane-server-state.json')),
+
+ /*
+ |--------------------------------------------------------------------------
+ | RoadRunner Options
+ |--------------------------------------------------------------------------
+ |
+ | The following options are only used when the RoadRunner server is the
+ | server powering your application. You may customize the path to the
+ | worker binary here, which is useful for zero-downtime deployments
+ | where the application is served from a symlinked "current" path.
+ |
+ */
+
+ 'roadrunner' => [
+ 'command' => env('OCTANE_ROADRUNNER_COMMAND', 'vendor/bin/roadrunner-worker'),
+ 'http_middleware' => env('OCTANE_ROADRUNNER_HTTP_MIDDLEWARE', 'static'),
+ ],
+
+];
diff --git a/octane-windows.ps1 b/octane-windows.ps1
new file mode 100644
index 00000000..2908f63b
--- /dev/null
+++ b/octane-windows.ps1
@@ -0,0 +1,46 @@
+$envFile = Join-Path $PSScriptRoot ".env"
+
+$schemeValue = "http"
+$hostValue = "127.0.0.1"
+$portValue = "8080"
+
+if (Test-Path $envFile) {
+ Get-Content $envFile | ForEach-Object {
+ if ($_ -match '^\s*APP_SCHEME\s*=\s*(.*?)\s*$') {
+ $schemeValue = $Matches[1].Trim().Trim('"', "'")
+ }
+ if ($_ -match '^\s*APP_HOST\s*=\s*(.*?)\s*$') {
+ $hostValue = $Matches[1].Trim().Trim('"', "'")
+ }
+ if ($_ -match '^\s*APP_PORT\s*=\s*(.*?)\s*$') {
+ $portValue = $Matches[1].Trim().Trim('"', "'")
+ }
+ }
+}
+
+$urlValue = "${schemeValue}://${hostValue}:${portValue}"
+
+$env:APP_SCHEME = $schemeValue
+$env:APP_HOST = $hostValue
+$env:APP_PORT = $portValue
+$env:APP_URL = $urlValue
+
+
+$phpArgs = @(
+ 'artisan', 'octane:start'
+ '--server=frankenphp'
+ "--host=$hostValue"
+ "--port=$portValue"
+ "--caddyfile=$(Join-Path $PSScriptRoot 'Caddyfile')"
+ '--watch'
+)
+
+php @phpArgs
+exit $LASTEXITCODE
+
+# To make this work, this file must be edited manually to bypass linux specific startup requirements
+# vendor/laravel/octane/src/Commands/Concerns/InteractsWithServers.php
+# public function getSubscribedSignals(): array
+# {
+# return \function_exists('pcntl_signal') ? [SIGINT, SIGTERM, SIGHUP] : [];
+# }
diff --git a/package.json b/package.json
index aa7d36ae..31630a85 100755
--- a/package.json
+++ b/package.json
@@ -23,6 +23,8 @@
"vite:phph": "concurrently -k -p \"[{name}]\" -c \"yellow.bold,white.bold,magenta.bold\" \"npm:php:horizon\" \"npm:php:pulse\" \"npm:php:reverb\"",
"vite:phphd": "concurrently -k -p \"[{name}]\" -c \"yellow.bold,white.bold,magenta.bold\" \"npm:php:horizon\" \"npm:php:pulse\" \"npm:php:reverb-debug\"",
"vite:phpp": "concurrently -k -p \"[{name}]\" -c \"blue.bold,green.bold,red.bold,white.bold,magenta.bold,yellow.bold\" \"npm:php:queue\" \"npm:php:queue\" \"npm:php:queue\" \"npm:php:pulse\" \"npm:php:reverb\" \"npm:php:queue-high\"",
+ "dev:octane": "powershell -NoProfile -ExecutionPolicy Bypass -File ./octane-windows.ps1",
+ "dev:octane-linux": "php artisan octane:start --server=frankenphp --host=${APP_HOST:-127.0.0.1} --port=${APP_PORT:-8080} --caddyfile=./Caddyfile --watch",
"build": "npm run pint && npm run type-check && npm run build-only",
"build-only": "vite build",
"type-check": "vue-tsc --build",