This commit is contained in:
Andras Bacsai 2023-05-16 15:10:29 +02:00
parent 846e74b8b5
commit 28cf89627d
4 changed files with 15 additions and 5 deletions

View File

@ -3,9 +3,11 @@
namespace App\Actions\Proxy;
use App\Enums\ActivityTypes;
use App\Models\InstanceSettings;
use App\Models\Server;
use Spatie\Activitylog\Models\Activity;
use Illuminate\Support\Str;
use Spatie\Url\Url;
class InstallProxy
{
@ -61,8 +63,10 @@ public function __invoke(Server $server): Activity
protected function getEnvContents()
{
$instance_fqdn = InstanceSettings::find(1)->fqdn ?? config('app.url');
$url = Url::fromString($instance_fqdn);
$data = [
'TRAEFIK_DASHBOARD_HOST' => '',
'TRAEFIK_DASHBOARD_HOST' => $url->getHost(),
'LETS_ENCRYPT_EMAIL' => '',
];

View File

@ -13,6 +13,7 @@
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Storage;
use Spatie\Activitylog\Models\Activity;
use Symfony\Component\Yaml\Yaml;
@ -379,8 +380,13 @@ private function set_labels_for_applications()
if ($this->application->fqdn) {
$url = Url::fromString($this->application->fqdn);
$host = $url->getHost();
$path = $url->getPath();
$labels[] = 'traefik.enable=true';
$labels[] = "traefik.http.routers.container.rule=Host(`{$host}`)";
if ($path === '/') {
$labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
} else {
$labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
}
}
return $labels;
}

View File

@ -1,7 +1,7 @@
<div x-data="{ deleteApplication: false }">
<x-naked-modal show="deleteApplication" />
@if ($application->status === 'running')
<x-inputs.button wire:click='start'>Restart</x-inputs.button>
<x-inputs.button wire:click='start'>Rebuild</x-inputs.button>
<x-inputs.button wire:click='forceRebuild'>Force Rebuild</x-inputs.button>
<x-inputs.button wire:click='stop'>Stop</x-inputs.button>
@else

View File

@ -23,7 +23,7 @@ function sync-bunny {
php artisan sync:bunny --env=secrets
}
function queue {
bash vendor/bin/spin exec -u webuser coolify php artisan horizon
bash vendor/bin/spin exec -u webuser coolify php artisan queue:listen
}
function schedule {
bash vendor/bin/spin exec -u webuser coolify php artisan schedule:work
@ -39,7 +39,7 @@ function mfs {
}
function reset-db-production {
bash vendor/bin/spin exec -u webuser coolify php artisan migrate:fresh --force --seed --seeder=ProductionSeeder ||
php artisan migrate:fresh --force --seed --seeder=ProductionSeeder
php artisan migrate:fresh --force --seed --seeder=ProductionSeeder
}
function coolify {
bash vendor/bin/spin exec -u webuser coolify bash