From b1642aa905350e456f6f600a6b5a31b9f32d4bd2 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Wed, 7 Feb 2024 16:23:48 +0100 Subject: [PATCH 1/9] Add multi domains --- app/Console/Kernel.php | 2 +- app/Http/Kernel.php | 2 +- app/Providers/HorizonServiceProvider.php | 2 +- bootstrap/app.php | 10 ++- composer.json | 1 + config/app.php | 2 +- config/domain.php | 25 ++++++++ config/filesystems.php | 4 +- .../supervisor/services/horizon.conf.example | 10 +++ .../services/scheduler.conf.example | 10 +++ docker/envs/envs.php | 19 ++++++ init.sh | 64 +++++++++++++++++++ routes/api.php | 20 +----- 13 files changed, 145 insertions(+), 26 deletions(-) create mode 100644 config/domain.php create mode 100644 docker/conf/supervisor/services/horizon.conf.example create mode 100644 docker/conf/supervisor/services/scheduler.conf.example diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 2d27c582..97aa353a 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -7,7 +7,7 @@ use EscolaLms\Webinar\Enum\WebinarTermReminderStatusEnum; use EscolaLms\Webinar\Jobs\ReminderAboutWebinarJob; use Illuminate\Console\Scheduling\Schedule; -use Illuminate\Foundation\Console\Kernel as ConsoleKernel; +use Gecche\Multidomain\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index e61844b8..85521f59 100755 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -4,7 +4,7 @@ use App\Http\Middleware\ForceJsonResponse; use App\Http\Middleware\ManualRoutesAuthorization; -use Illuminate\Foundation\Http\Kernel as HttpKernel; +use Gecche\Multidomain\Foundation\Http\Kernel as HttpKernel; class Kernel extends HttpKernel { diff --git a/app/Providers/HorizonServiceProvider.php b/app/Providers/HorizonServiceProvider.php index f127bd80..f51bfd60 100644 --- a/app/Providers/HorizonServiceProvider.php +++ b/app/Providers/HorizonServiceProvider.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Gate; use Laravel\Horizon\Horizon; -use Laravel\Horizon\HorizonApplicationServiceProvider; +use Gecche\Multidomain\Horizon\HorizonApplicationServiceProvider; class HorizonServiceProvider extends HorizonApplicationServiceProvider { diff --git a/bootstrap/app.php b/bootstrap/app.php index 037e17df..e8b9c134 100755 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -11,8 +11,14 @@ | */ -$app = new Illuminate\Foundation\Application( - $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__) +$domainParams = [ + 'domain_detection_function_web' => function() { + return \Illuminate\Support\Arr::get($_SERVER,'HTTP_X_FORWARDED_FOR') ?? \Illuminate\Support\Arr::get($_SERVER,'HTTP_HOST'); + } +]; + +$app = new Gecche\Multidomain\Foundation\Application( + $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__), null, $domainParams ); /* diff --git a/composer.json b/composer.json index 2c6ab4de..6f310112 100644 --- a/composer.json +++ b/composer.json @@ -73,6 +73,7 @@ "escolalms/webinar": "^0", "fideloper/proxy": "^4.0", "fruitcake/laravel-cors": "^2.0", + "gecche/laravel-multidomain": "^4.2", "guzzlehttp/guzzle": "^7.3", "laravel/framework": "^8.0", "laravel/helpers": "^1.4", diff --git a/config/app.php b/config/app.php index bf39ccff..624f934b 100755 --- a/config/app.php +++ b/config/app.php @@ -157,7 +157,7 @@ Illuminate\Notifications\NotificationServiceProvider::class, Illuminate\Pagination\PaginationServiceProvider::class, Illuminate\Pipeline\PipelineServiceProvider::class, - Illuminate\Queue\QueueServiceProvider::class, + Gecche\Multidomain\Queue\QueueServiceProvider::class, Illuminate\Redis\RedisServiceProvider::class, Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, Illuminate\Session\SessionServiceProvider::class, diff --git a/config/domain.php b/config/domain.php new file mode 100644 index 00000000..9b9e3c71 --- /dev/null +++ b/config/domain.php @@ -0,0 +1,25 @@ + '.env', + 'storage_dirs' => [ + 'app' => [ + 'public' => [ + ], + ], + 'framework' => [ + 'cache' => [ + ], + 'testing' => [ + ], + 'sessions' => [ + ], + 'views' => [ + ], + ], + 'logs' => [ + ], + ], + 'domains' => [ + ], + ]; diff --git a/config/filesystems.php b/config/filesystems.php index 6344ccd6..b03c09f0 100755 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -46,7 +46,7 @@ 'local' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => env('APP_URL').'/storage' . env('APP_PUBLIC_STORAGE'), 'visibility' => 'public', ], @@ -60,7 +60,7 @@ 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'url' => env('APP_URL').'/storage' . env('APP_PUBLIC_STORAGE'), 'visibility' => 'public', ], diff --git a/docker/conf/supervisor/services/horizon.conf.example b/docker/conf/supervisor/services/horizon.conf.example new file mode 100644 index 00000000..0201f292 --- /dev/null +++ b/docker/conf/supervisor/services/horizon.conf.example @@ -0,0 +1,10 @@ +[program:laravel-horizon-$HORIZON_DOMAIN] +process_name=%(program_name)s_%(process_num)02d +command=php /var/www/html/artisan horizon --domain=$HORIZON_DOMAIN +user=devilbox +autostart=true +autorestart=true +numprocs=1 +redirect_stderr=true +stopwaitsecs=3600 +logfile=/etc/supervisor/conf.d/horizon.log diff --git a/docker/conf/supervisor/services/scheduler.conf.example b/docker/conf/supervisor/services/scheduler.conf.example new file mode 100644 index 00000000..352315e6 --- /dev/null +++ b/docker/conf/supervisor/services/scheduler.conf.example @@ -0,0 +1,10 @@ +[program:laravel-schedule-$SCHEDULER_DOMAIN] +process_name=%(program_name)s_%(process_num)02d +command=/bin/sh -c "while [ true ]; do (php /var/www/html/artisan schedule:run --domain=$SCHEDULER_DOMAIN --verbose --no-interaction &); sleep 60; done" +user=devilbox +autostart=true +autorestart=true +numprocs=1 +redirect_stderr=true +stopwaitsecs=3600 +logfile=/etc/supervisor/conf.d/schedule.log diff --git a/docker/envs/envs.php b/docker/envs/envs.php index e7ea981b..5af9fc24 100644 --- a/docker/envs/envs.php +++ b/docker/envs/envs.php @@ -49,3 +49,22 @@ function add_env(string $key, string $new_value, string $env_path) } } } + +if (getenv('MULTI_DOMAINS')) { + $domains = explode(',', getenv('MULTI_DOMAINS')); + + foreach ($domains as $domain) { + exec('php artisan domain:add ' . $domain); + $domainKey = str_replace(['.', '-'], '_', strtoupper($domain)); + $domainVariables = []; + foreach (getenv() as $key => $value) { + if (str_starts_with($key, $domainKey)) { + $variableKey = str_replace($domainKey . '_', '', $key); + $domainVariables[$variableKey] = $value; + } + } + + exec("php artisan domain:update_env $domain --domain_values='" . json_encode($domainVariables) ."'"); + echo "Updated $domain env file\n"; + } +} diff --git a/init.sh b/init.sh index 80111818..93d9e58f 100755 --- a/init.sh +++ b/init.sh @@ -83,3 +83,67 @@ fi php artisan storage:link --force --no-interaction php artisan h5p:storage-link + +# MULTI_DOMAINS +if [ -n "$MULTI_DOMAINS" ]; then + IFS=',' read -ra domains <<< "$MULTI_DOMAINS" + + for domain in "${domains[@]}"; do + echo "$domain" + + # horizon + if [ -n "$DISBALE_HORIZON" ] && [ "$DISBALE_HORIZON" != "true" ]; + then + cp "docker/conf/supervisor/services/horizon.conf.example" "/etc/supervisor/custom.d/horizon.$domain.conf" + sed "s/\$HORIZON_DOMAIN/$domain/g" "docker/conf/supervisor/services/horizon.conf.example" > "/etc/supervisor/custom.d/horizon.$domain.conf" + fi + + # scheduler + if [ -n "$DISBALE_SCHEDULER" ] && [ "$DISBALE_SCHEDULER" != "true" ]; + then + cp "docker/conf/supervisor/services/scheduler.conf.example" "/etc/supervisor/custom.d/scheduler.$domain.conf" + sed "s/\$SCHEDULER_DOMAIN/$domain/g" "docker/conf/supervisor/services/scheduler.conf.example" > "/etc/supervisor/custom.d/scheduler.$domain.conf" + fi + + DOMAIN_KEY=$(echo "$domain" | tr '[:lower:]' '[:upper:]') + DOMAIN_KEY=$(echo "$DOMAIN_KEY" | tr '.-' '__') + + DB_NAME_KEY="${DOMAIN_KEY}_DB_DATABASE" + DB_NAME_VALUE=${!DB_NAME_KEY} + + # create db if not exists + if PGPASSWORD="$POSTGRES_PASSWORD" psql -h "$LARAVEL_DB_HOST" -U "$POSTGRES_USER" -d "$DB_NAME_VALUE" -c ";" >/dev/null 2>&1; then + echo "DB $DB_NAME_VALUE already exists" + else + PGPASSWORD="$POSTGRES_PASSWORD" psql -h "$LARAVEL_DB_HOST" -U "$POSTGRES_USER" -c "CREATE DATABASE $DB_NAME_VALUE;" + echo "DB $DB_NAME_VALUE has been created" + fi + + # db migrate + if [ "$DISBALE_DB_MIGRATE" == 'true' ] + then + echo "Disable db migrate" + else + php artisan migrate --force --domain=$domain + fi + + # db seed + if [ "$DISBALE_DB_SEED" == 'true' ] + then + echo "Disable db:seed" + else + php artisan db:seed --domain=$domain --class=PermissionsSeeder --force --no-interaction + fi + + # storage + STORAGE_DIRECTORY=$(echo "$domain" | tr '[:upper:]' '[:lower:]' | tr '.' '_') + STORAGE_PUBLIC_KEY="${DOMAIN_KEY}_APP_PUBLIC_STORAGE" + STORAGE_PUBLIC_NAME=${!STORAGE_PUBLIC_KEY} + if [ -n "$STORAGE_PUBLIC_NAME" ]; then + ln -s /var/www/html/storage/${STORAGE_DIRECTORY}/app/public public/storage${STORAGE_PUBLIC_NAME} + fi + + done +else + echo "Environment variable MULTI_DOMAINS is empty." +fi diff --git a/routes/api.php b/routes/api.php index b3fd32f5..5bb1e7b4 100755 --- a/routes/api.php +++ b/routes/api.php @@ -16,24 +16,8 @@ | */ - -Route::get('/debug-sentry', function () { - throw new \Exception('Test Sentry error!'); -}); - -//TODO Removed after testing jitsi components -Route::group(['middleware' => ['auth:api']], function () { - Route::get('/seeds/consultations/{author?}/{user?}', function ($author = null, $user = null) { - $seed = new \EscolaLms\Consultations\Database\Seeders\ConsultationTermsSeeder($author, $user); - $consultationTerms = $seed->run(); - return response()->json(['msg' => 'success']); - }); -}); - -Route::get('/seeds/consultations/{author?}/{user?}', function ($author = null, $user = null) { - $seed = new \EscolaLms\Consultations\Database\Seeders\ConsultationTermsSeeder($author, $user); - $consultationTerms = $seed->run(); - return response()->json(['msg' => 'success']); +Route::get('domain', function () { + return env('APP_NAME'); }); Route::get('events', [EventAPIController::class, 'index']); From 01c525293c8aa5b634f147e3762e02bf5bcf62c1 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Thu, 8 Feb 2024 08:50:12 +0100 Subject: [PATCH 2/9] Change header key --- bootstrap/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index e8b9c134..6c6852ae 100755 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -13,7 +13,7 @@ $domainParams = [ 'domain_detection_function_web' => function() { - return \Illuminate\Support\Arr::get($_SERVER,'HTTP_X_FORWARDED_FOR') ?? \Illuminate\Support\Arr::get($_SERVER,'HTTP_HOST'); + return \Illuminate\Support\Arr::get($_SERVER,'HTTP_X_FORWARDED_HOST') ?? \Illuminate\Support\Arr::get($_SERVER,'HTTP_HOST'); } ]; From bbc9fcea8776dd73588ebc5aa4a7e775cfc4d492 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Fri, 9 Feb 2024 16:12:25 +0100 Subject: [PATCH 3/9] WIP --- .../{services => example}/horizon.conf.example | 0 .../scheduler.conf.example | 0 docker/conf/supervisor/services/horizon.conf | 2 +- init.sh | 17 ++++++++++------- 4 files changed, 11 insertions(+), 8 deletions(-) rename docker/conf/supervisor/{services => example}/horizon.conf.example (100%) rename docker/conf/supervisor/{services => example}/scheduler.conf.example (100%) diff --git a/docker/conf/supervisor/services/horizon.conf.example b/docker/conf/supervisor/example/horizon.conf.example similarity index 100% rename from docker/conf/supervisor/services/horizon.conf.example rename to docker/conf/supervisor/example/horizon.conf.example diff --git a/docker/conf/supervisor/services/scheduler.conf.example b/docker/conf/supervisor/example/scheduler.conf.example similarity index 100% rename from docker/conf/supervisor/services/scheduler.conf.example rename to docker/conf/supervisor/example/scheduler.conf.example diff --git a/docker/conf/supervisor/services/horizon.conf b/docker/conf/supervisor/services/horizon.conf index 0e4e6100..f3f4d5f8 100644 --- a/docker/conf/supervisor/services/horizon.conf +++ b/docker/conf/supervisor/services/horizon.conf @@ -1,6 +1,6 @@ [program:laravel-horizon] process_name=%(program_name)s_%(process_num)02d -command=php /var/www/html/artisan horizon +command=php /var/www/html/artisan horizon --domain=default user=devilbox autostart=true autorestart=true diff --git a/init.sh b/init.sh index 93d9e58f..1f9f3ef3 100755 --- a/init.sh +++ b/init.sh @@ -92,17 +92,20 @@ if [ -n "$MULTI_DOMAINS" ]; then echo "$domain" # horizon - if [ -n "$DISBALE_HORIZON" ] && [ "$DISBALE_HORIZON" != "true" ]; + if [ -z "$DISBALE_HORIZON" ] || [ "$DISBALE_HORIZON" != "true" ]; then - cp "docker/conf/supervisor/services/horizon.conf.example" "/etc/supervisor/custom.d/horizon.$domain.conf" - sed "s/\$HORIZON_DOMAIN/$domain/g" "docker/conf/supervisor/services/horizon.conf.example" > "/etc/supervisor/custom.d/horizon.$domain.conf" + cp "docker/conf/supervisor/example/horizon.conf.example" "/etc/supervisor/custom.d/horizon.$domain.conf" + sed "s/\$HORIZON_DOMAIN/$domain/g" "docker/conf/supervisor/example/horizon.conf.example" > "/etc/supervisor/custom.d/horizon.$domain.conf" + else + echo "Horizon disabled" fi - # scheduler - if [ -n "$DISBALE_SCHEDULER" ] && [ "$DISBALE_SCHEDULER" != "true" ]; + if [ -z "$DISBALE_SCHEDULER" ] || [ "$DISBALE_SCHEDULER" != "true" ]; then - cp "docker/conf/supervisor/services/scheduler.conf.example" "/etc/supervisor/custom.d/scheduler.$domain.conf" - sed "s/\$SCHEDULER_DOMAIN/$domain/g" "docker/conf/supervisor/services/scheduler.conf.example" > "/etc/supervisor/custom.d/scheduler.$domain.conf" + cp "docker/conf/supervisor/example/scheduler.conf.example" "/etc/supervisor/custom.d/scheduler.$domain.conf" + sed "s/\$SCHEDULER_DOMAIN/$domain/g" "docker/conf/supervisor/example/scheduler.conf.example" > "/etc/supervisor/custom.d/scheduler.$domain.conf" + else + echo "Schedule disabled" fi DOMAIN_KEY=$(echo "$domain" | tr '[:lower:]' '[:upper:]') From 89d9a33d43de4ff4524d8c0ac8c718fc345d83e8 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Mon, 12 Feb 2024 13:55:21 +0100 Subject: [PATCH 4/9] WIP --- init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.sh b/init.sh index 1f9f3ef3..238dd5ea 100755 --- a/init.sh +++ b/init.sh @@ -146,6 +146,8 @@ if [ -n "$MULTI_DOMAINS" ]; then ln -s /var/www/html/storage/${STORAGE_DIRECTORY}/app/public public/storage${STORAGE_PUBLIC_NAME} fi + php artisan optimize:clear --domain=$domain + done else echo "Environment variable MULTI_DOMAINS is empty." From 4425b128c1aea6c405eb79d74924c368d6049cae Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Mon, 12 Feb 2024 14:06:12 +0100 Subject: [PATCH 5/9] WIP --- config/horizon.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/horizon.php b/config/horizon.php index 04bd910c..599a0c5f 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -204,5 +204,20 @@ 'balanceCooldown' => 3, ], ], + + 'stage' => [ + 'supervisor-1' => [ + 'maxProcesses' => 10, + 'balanceMaxShift' => 1, + 'balanceCooldown' => 3, + ], + 'supervisor-long-job' => [ + 'connection' => 'redis-long-job', + 'queue' => ['queue-long-job'], + 'maxProcesses' => 10, + 'balanceMaxShift' => 1, + 'balanceCooldown' => 3, + ], + ], ], ]; From 6339dfdb0df1a8f87890fa73a9d263acc4adc283 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Mon, 12 Feb 2024 14:54:29 +0100 Subject: [PATCH 6/9] WIP --- config/horizon.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/config/horizon.php b/config/horizon.php index 599a0c5f..21150fd4 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -207,16 +207,12 @@ 'stage' => [ 'supervisor-1' => [ - 'maxProcesses' => 10, - 'balanceMaxShift' => 1, - 'balanceCooldown' => 3, + 'maxProcesses' => 3, ], 'supervisor-long-job' => [ 'connection' => 'redis-long-job', 'queue' => ['queue-long-job'], - 'maxProcesses' => 10, - 'balanceMaxShift' => 1, - 'balanceCooldown' => 3, + 'maxProcesses' => 1, ], ], ], From 7804122b3ee0e83955721f5c08dfba8c08b38241 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Fri, 16 Feb 2024 13:36:07 +0100 Subject: [PATCH 7/9] WIP --- composer.json | 1 + composer.lock | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a28906b5..3d841ea3 100644 --- a/composer.json +++ b/composer.json @@ -82,6 +82,7 @@ "escolalms/video": "^0", "escolalms/vouchers": "^0", "escolalms/webinar": "^0", + "gecche/laravel-multidomain": "^5.0", "guzzlehttp/guzzle": "^7.4.5", "laravel/framework": "^9", "laravel/helpers": "^1.7", diff --git a/composer.lock b/composer.lock index dd57de8c..75c94ceb 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": "4d93a85e3f81d2e76ac92d8dbb536a02", + "content-hash": "34e4fa472e8c472a105b89938be4308b", "packages": [ { "name": "aloha/twilio", @@ -5861,6 +5861,71 @@ ], "time": "2023-10-12T05:21:21+00:00" }, + { + "name": "gecche/laravel-multidomain", + "version": "v5.0", + "source": { + "type": "git", + "url": "https://github.com/gecche/laravel-multidomain.git", + "reference": "0a1654b85a00ce88120797d8043934ee252ea6c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/gecche/laravel-multidomain/zipball/0a1654b85a00ce88120797d8043934ee252ea6c0", + "reference": "0a1654b85a00ce88120797d8043934ee252ea6c0", + "shasum": "" + }, + "require": { + "laravel/framework": "^9.0" + }, + "require-dev": { + "limedeck/phpunit-detailed-printer": "^6.0", + "mockery/mockery": "^1.4.4", + "orchestra/testbench": "7.x-dev", + "orchestra/testbench-browser-kit": "^7.0", + "phpunit/phpunit": "^9.5.8" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Gecche\\Multidomain\\Foundation\\Providers\\DomainConsoleServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/Foundation/helpers.php" + ], + "psr-4": { + "Gecche\\Multidomain\\": "src/" + }, + "classmap": [] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Giacomo Terreni", + "email": "giacomo.terreni@gmail.com" + } + ], + "description": "Laravel App on a subdomains, multi-tenancy setting", + "keywords": [ + "laravel", + "multi-tenants", + "multidomain", + "multitenancy", + "subdomains" + ], + "support": { + "issues": "https://github.com/gecche/laravel-multidomain/issues", + "source": "https://github.com/gecche/laravel-multidomain/tree/v5.0" + }, + "time": "2022-02-08T18:09:48+00:00" + }, { "name": "gnello/laravel-mattermost-driver", "version": "1.3.2", From 74bba6d2cf0eefdea5e39c90dc337642430ce809 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Fri, 16 Feb 2024 13:56:05 +0100 Subject: [PATCH 8/9] WIP --- composer.lock | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index c9614ab3..8d6bfd4e 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": "7f360ec551953d82991c897559cbc3fd", + "content-hash": "e9bcee4cf2d4c433be0fd4ed4ce09ff3", "packages": [ { "name": "aloha/twilio", @@ -5861,6 +5861,71 @@ ], "time": "2023-10-12T05:21:21+00:00" }, + { + "name": "gecche/laravel-multidomain", + "version": "v5.0", + "source": { + "type": "git", + "url": "https://github.com/gecche/laravel-multidomain.git", + "reference": "0a1654b85a00ce88120797d8043934ee252ea6c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/gecche/laravel-multidomain/zipball/0a1654b85a00ce88120797d8043934ee252ea6c0", + "reference": "0a1654b85a00ce88120797d8043934ee252ea6c0", + "shasum": "" + }, + "require": { + "laravel/framework": "^9.0" + }, + "require-dev": { + "limedeck/phpunit-detailed-printer": "^6.0", + "mockery/mockery": "^1.4.4", + "orchestra/testbench": "7.x-dev", + "orchestra/testbench-browser-kit": "^7.0", + "phpunit/phpunit": "^9.5.8" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Gecche\\Multidomain\\Foundation\\Providers\\DomainConsoleServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/Foundation/helpers.php" + ], + "psr-4": { + "Gecche\\Multidomain\\": "src/" + }, + "classmap": [] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Giacomo Terreni", + "email": "giacomo.terreni@gmail.com" + } + ], + "description": "Laravel App on a subdomains, multi-tenancy setting", + "keywords": [ + "laravel", + "multi-tenants", + "multidomain", + "multitenancy", + "subdomains" + ], + "support": { + "issues": "https://github.com/gecche/laravel-multidomain/issues", + "source": "https://github.com/gecche/laravel-multidomain/tree/v5.0" + }, + "time": "2022-02-08T18:09:48+00:00" + }, { "name": "gnello/laravel-mattermost-driver", "version": "1.3.2", From e6a9ea36fa6d3f487c83901e23a59e8dca8064f6 Mon Sep 17 00:00:00 2001 From: Maciej Rymarz Date: Thu, 22 Feb 2024 14:05:19 +0100 Subject: [PATCH 9/9] WIP --- init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/init.sh b/init.sh index 238dd5ea..11ceecb5 100755 --- a/init.sh +++ b/init.sh @@ -144,6 +144,7 @@ if [ -n "$MULTI_DOMAINS" ]; then STORAGE_PUBLIC_NAME=${!STORAGE_PUBLIC_KEY} if [ -n "$STORAGE_PUBLIC_NAME" ]; then ln -s /var/www/html/storage/${STORAGE_DIRECTORY}/app/public public/storage${STORAGE_PUBLIC_NAME} + ln -s /var/www/html/storage/${STORAGE_DIRECTORY}/app/h5p public/h5p${STORAGE_PUBLIC_NAME} fi php artisan optimize:clear --domain=$domain