From f8c19e1fb3efa94001c8c2ab5036ad90ac7f6678 Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Fri, 26 Jan 2024 08:39:54 +0100
Subject: [PATCH] Update contact links in error and subscription views
---
bootstrap/helpers/remoteProcess.php | 2 +-
config/coolify.php | 4 +-
database/seeders/ProductionSeeder.php | 56 ++++++++-
docker-compose.windows.yml | 116 ++++++++++++++++++
.../views/components/pricing-plans.blade.php | 2 +-
resources/views/errors/401.blade.php | 2 +-
resources/views/errors/403.blade.php | 2 +-
resources/views/errors/404.blade.php | 2 +-
resources/views/errors/419.blade.php | 2 +-
resources/views/errors/429.blade.php | 2 +-
resources/views/errors/500.blade.php | 2 +-
resources/views/errors/503.blade.php | 2 +-
.../livewire/subscription/actions.blade.php | 4 +-
.../subscription/pricing-plans.blade.php | 4 +-
14 files changed, 186 insertions(+), 16 deletions(-)
create mode 100644 docker-compose.windows.yml
diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.php
index f49c7cafc..a6838f7f3 100644
--- a/bootstrap/helpers/remoteProcess.php
+++ b/bootstrap/helpers/remoteProcess.php
@@ -120,7 +120,7 @@ function generateSshCommand(Server $server, string $command, bool $isMux = true)
$delimiter = 'EOF-COOLIFY-SSH';
$ssh_command = "timeout $timeout ssh ";
- if ($isMux && config('coolify.mux_enabled')) {
+ if ($isMux && config('coolify.mux_enabled') === true && config('coolify.is_windows_docker_desktop') === false) {
$ssh_command .= '-o ControlMaster=auto -o ControlPersist=1m -o ControlPath=/var/www/html/storage/app/ssh/mux/%h_%p_%r ';
}
if (data_get($server, 'settings.is_cloudflare_tunnel')) {
diff --git a/config/coolify.php b/config/coolify.php
index 05917d17a..2e15c8618 100644
--- a/config/coolify.php
+++ b/config/coolify.php
@@ -1,12 +1,14 @@
'https://coolify.io/docs/contact',
+ 'docs' => 'https://coolify.io/docs/',
+ 'contact' => 'https://coolify.io/docs/contact',
'self_hosted' => env('SELF_HOSTED', true),
'waitlist' => env('WAITLIST', false),
'license_url' => 'https://licenses.coollabs.io',
'mux_enabled' => env('MUX_ENABLED', true),
'dev_webhook' => env('SERVEO_URL'),
+ 'is_windows_docker_desktop' => env('IS_WINDOWS_DOCKER_DESKTOP', false),
'base_config_path' => env('BASE_CONFIG_PATH', '/data/coolify'),
'helper_image' => env('HELPER_IMAGE', 'ghcr.io/coollabsio/coolify-helper:latest'),
];
diff --git a/database/seeders/ProductionSeeder.php b/database/seeders/ProductionSeeder.php
index eb5880c32..e82c240bf 100644
--- a/database/seeders/ProductionSeeder.php
+++ b/database/seeders/ProductionSeeder.php
@@ -14,7 +14,6 @@
use App\Models\Team;
use App\Models\User;
use Illuminate\Database\Seeder;
-use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Process;
use Illuminate\Support\Facades\Storage;
@@ -67,7 +66,7 @@ public function run(): void
]);
}
- if (!isCloud()) {
+ if (!isCloud() && config('coolify.is_windows_docker_desktop') === false) {
// Save SSH Keys for the Coolify Host
$coolify_key_name = "id.root@host.docker.internal";
$coolify_key = Storage::disk('ssh-keys')->get("{$coolify_key_name}");
@@ -123,6 +122,59 @@ public function run(): void
]);
}
}
+ if (config('coolify.is_windows_docker_desktop')) {
+ PrivateKey::updateOrCreate(
+ [
+ 'id' => 0,
+ 'team_id' => 0,
+ ],
+ [
+ "name" => "Testing-host",
+ "description" => "This is a a docker container with SSH access",
+ "private_key" => "-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
+QyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevAAAAJi/QySHv0Mk
+hwAAAAtzc2gtZWQyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevA
+AAAECBQw4jg1WRT2IGHMncCiZhURCts2s24HoDS0thHnnRKVuGmoeGq/pojrsyP1pszcNV
+uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
+-----END OPENSSH PRIVATE KEY-----
+"
+ ]
+ );
+ if (Server::find(0) == null) {
+ $server_details = [
+ 'id' => 0,
+ 'uuid' => 'coolify-testing-host',
+ 'name' => "localhost",
+ 'description' => "This is the server where Coolify is running on. Don't delete this!",
+ 'user' => 'root',
+ 'ip' => "coolify-testing-host",
+ 'team_id' => 0,
+ 'private_key_id' => 0
+ ];
+ $server_details['proxy'] = ServerMetadata::from([
+ 'type' => ProxyTypes::TRAEFIK_V2->value,
+ 'status' => ProxyStatus::EXITED->value
+ ]);
+ $server = Server::create($server_details);
+ $server->settings->is_reachable = true;
+ $server->settings->is_usable = true;
+ $server->settings->save();
+ } else {
+ $server = Server::find(0);
+ $server->settings->is_reachable = true;
+ $server->settings->is_usable = true;
+ $server->settings->save();
+ }
+ if (StandaloneDocker::find(0) == null) {
+ StandaloneDocker::create([
+ 'id' => 0,
+ 'name' => 'localhost-coolify',
+ 'network' => 'coolify',
+ 'server_id' => 0,
+ ]);
+ }
+ }
try {
$settings = InstanceSettings::get();
diff --git a/docker-compose.windows.yml b/docker-compose.windows.yml
new file mode 100644
index 000000000..7dc5927f4
--- /dev/null
+++ b/docker-compose.windows.yml
@@ -0,0 +1,116 @@
+version: '3.8'
+services:
+ coolify-testing-host:
+ init: true
+ build:
+ dockerfile: Dockerfile
+ container_name: coolify-testing-host
+ volumes:
+ - //var/run/docker.sock://var/run/docker.sock
+ - ./:/data/coolify
+ coolify:
+ image: "ghcr.io/coollabsio/coolify:${LATEST_IMAGE:-4.0.0-beta.199}"
+ container_name: coolify
+ restart: always
+ working_dir: /var/www/html
+ extra_hosts:
+ - 'host.docker.internal:host-gateway'
+ volumes:
+ - type: bind
+ source: ./.env
+ target: /var/www/html/.env
+ read_only: true
+ - ./ssh:/var/www/html/storage/app/ssh
+ - ./applications:/var/www/html/storage/app/applications
+ - ./databases:/var/www/html/storage/app/databases
+ - ./services:/var/www/html/storage/app/services
+ - ./backups:/var/www/html/storage/app/backups
+ environment:
+ - IS_WINDOWS_DOCKER_DESKTOP=true
+ - APP_ID
+ - APP_ENV=production
+ - APP_NAME
+ - APP_KEY
+ - DB_PASSWORD
+ - REDIS_PASSWORD
+ - SSL_MODE=off
+ - PHP_PM_CONTROL=dynamic
+ - PHP_PM_START_SERVERS=1
+ - PHP_PM_MIN_SPARE_SERVERS=1
+ - PHP_PM_MAX_SPARE_SERVERS=10
+ - PUSHER_APP_ID
+ - PUSHER_APP_KEY
+ - PUSHER_APP_SECRET
+ - AUTOUPDATE=true
+ - SELF_HOSTED=true
+ - MUX_ENABLED=false
+ ports:
+ - "${APP_PORT:-8000}:80"
+ expose:
+ - "${APP_PORT:-8000}"
+ healthcheck:
+ test: curl --fail http://localhost:80/api/health || exit 1
+ interval: 5s
+ retries: 10
+ timeout: 2s
+ depends_on:
+ postgres:
+ condition: service_healthy
+ redis:
+ condition: service_healthy
+ postgres:
+ image: postgres:15-alpine
+ container_name: coolify-db
+ restart: always
+ volumes:
+ - coolify-db:/var/lib/postgresql/data
+ environment:
+ POSTGRES_USER: "${DB_USERNAME:-coolify}"
+ POSTGRES_PASSWORD: "${DB_PASSWORD}"
+ POSTGRES_DB: "${DB_DATABASE:-coolify}"
+ healthcheck:
+ test:
+ [
+ "CMD-SHELL",
+ "pg_isready -U ${DB_USERNAME:-coolify}",
+ "-d",
+ "${DB_DATABASE:-coolify}"
+ ]
+ interval: 5s
+ retries: 10
+ timeout: 2s
+ redis:
+ image: redis:alpine
+ container_name: coolify-redis
+ restart: always
+ command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
+ environment:
+ REDIS_PASSWORD: "${REDIS_PASSWORD}"
+ volumes:
+ - coolify-redis:/data
+ healthcheck:
+ test: redis-cli ping
+ interval: 5s
+ retries: 10
+ timeout: 2s
+ soketi:
+ image: 'quay.io/soketi/soketi:1.6-16-alpine'
+ container_name: coolify-realtime
+ restart: always
+ ports:
+ - "${SOKETI_PORT:-6001}:6001"
+ environment:
+ SOKETI_DEBUG: "${SOKETI_DEBUG:-false}"
+ SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID}"
+ SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY}"
+ SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET}"
+ healthcheck:
+ test: wget -qO- http://localhost:6001/ready || exit 1
+ interval: 5s
+ retries: 10
+ timeout: 2s
+volumes:
+ coolify-db:
+ name: coolify-db
+ coolify-redis:
+ name: coolify-redis
diff --git a/resources/views/components/pricing-plans.blade.php b/resources/views/components/pricing-plans.blade.php
index 3b37f6ef1..2c5844e6c 100644
--- a/resources/views/components/pricing-plans.blade.php
+++ b/resources/views/components/pricing-plans.blade.php
@@ -258,7 +258,7 @@ class="grid max-w-sm grid-cols-1 -mt-16 divide-y divide-coolgray-500 isolate gap
Need official support for
your self-hosted instance?
- Contact
+ Contact
Us
diff --git a/resources/views/errors/401.blade.php b/resources/views/errors/401.blade.php
index 92a2f3978..9db36a494 100644
--- a/resources/views/errors/401.blade.php
+++ b/resources/views/errors/401.blade.php
@@ -10,7 +10,7 @@
Go back home
- Contact
+ Contact
support
diff --git a/resources/views/errors/403.blade.php b/resources/views/errors/403.blade.php
index f5fee3d61..434d30ada 100644
--- a/resources/views/errors/403.blade.php
+++ b/resources/views/errors/403.blade.php
@@ -10,7 +10,7 @@
Go back home
- Contact
+ Contact
support
diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.php
index 0f2827801..473b2194e 100644
--- a/resources/views/errors/404.blade.php
+++ b/resources/views/errors/404.blade.php
@@ -11,7 +11,7 @@
Go back home
- Contact
+ Contact
support
diff --git a/resources/views/errors/419.blade.php b/resources/views/errors/419.blade.php
index 44b14a789..31fda0824 100644
--- a/resources/views/errors/419.blade.php
+++ b/resources/views/errors/419.blade.php
@@ -11,7 +11,7 @@
Go back home
- Contact
+ Contact
support
→
diff --git a/resources/views/errors/429.blade.php b/resources/views/errors/429.blade.php
index baf9b901b..f8ffeb85a 100644
--- a/resources/views/errors/429.blade.php
+++ b/resources/views/errors/429.blade.php
@@ -11,7 +11,7 @@
Go back home
- Contact
+ Contact
support
→
diff --git a/resources/views/errors/500.blade.php b/resources/views/errors/500.blade.php
index 348b3d06c..828e910f6 100644
--- a/resources/views/errors/500.blade.php
+++ b/resources/views/errors/500.blade.php
@@ -14,7 +14,7 @@
Go back home
- Contact
+ Contact
support
→
diff --git a/resources/views/errors/503.blade.php b/resources/views/errors/503.blade.php
index d7a9441e1..906d610b4 100644
--- a/resources/views/errors/503.blade.php
+++ b/resources/views/errors/503.blade.php
@@ -8,7 +8,7 @@
patience.
diff --git a/resources/views/livewire/subscription/actions.blade.php b/resources/views/livewire/subscription/actions.blade.php
index 1b430574d..10c6d7acf 100644
--- a/resources/views/livewire/subscription/actions.blade.php
+++ b/resources/views/livewire/subscription/actions.blade.php
@@ -16,7 +16,7 @@
again
@endif
To update your subscription (upgrade / downgrade), please
contact us.
+ href="{{ config('coolify.contact') }}" target="_blank">contact us.
@endif
@if (subscriptionProvider() === 'lemon')
@@ -25,7 +25,7 @@
@if (currentTeam()->subscription->lemon_status === 'cancelled')
Subscriptions ends at: {{ getRenewDate() }}
@else
diff --git a/resources/views/livewire/subscription/pricing-plans.blade.php b/resources/views/livewire/subscription/pricing-plans.blade.php
index 92644347b..37a8abe2b 100644
--- a/resources/views/livewire/subscription/pricing-plans.blade.php
+++ b/resources/views/livewire/subscription/pricing-plans.blade.php
@@ -23,13 +23,13 @@
Contact Us
Contact Us