wip: 🌮

This commit is contained in:
Andras Bacsai 2023-12-05 13:56:11 +01:00
parent cd22863a8c
commit 5cc22a8271
10 changed files with 84 additions and 55 deletions

View File

@ -4,3 +4,7 @@ APP_KEY=
DB_PASSWORD= DB_PASSWORD=
REDIS_PASSWORD= REDIS_PASSWORD=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

View File

@ -10,12 +10,12 @@ class Dashboard extends Component
{ {
public $projects = []; public $projects = [];
public $servers = []; public $servers = [];
// protected $listeners = ['echo:public,TestEvent' => 'notifyNewOrder']; protected $listeners = ['echo:public,TestEvent' => 'notifyNewOrder'];
// public function notifyNewOrder() public function notifyNewOrder()
// { {
// $this->emit('success', 'New order received!'); $this->emit('success', 'New order received!');
// } }
public function mount() public function mount()
{ {
$this->servers = Server::ownedByCurrentTeam()->get(); $this->servers = Server::ownedByCurrentTeam()->get();

View File

@ -194,7 +194,7 @@
App\Providers\AppServiceProvider::class, App\Providers\AppServiceProvider::class,
App\Providers\FortifyServiceProvider::class, App\Providers\FortifyServiceProvider::class,
App\Providers\AuthServiceProvider::class, App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class, App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class, App\Providers\EventServiceProvider::class,
App\Providers\HorizonServiceProvider::class, App\Providers\HorizonServiceProvider::class,
App\Providers\RouteServiceProvider::class, App\Providers\RouteServiceProvider::class,

View File

@ -15,7 +15,7 @@
| |
*/ */
'default' => env('BROADCAST_DRIVER', 'null'), 'default' => env('BROADCAST_DRIVER', 'pusher'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -36,7 +36,7 @@
'secret' => env('PUSHER_APP_SECRET', 'coolify'), 'secret' => env('PUSHER_APP_SECRET', 'coolify'),
'app_id' => env('PUSHER_APP_ID', 'coolify'), 'app_id' => env('PUSHER_APP_ID', 'coolify'),
'options' => [ 'options' => [
'host' => 'coolify-soketi', 'host' => env('PUSHER_HOST', 'coolify-soketi'),
'port' => env('PUSHER_PORT', 6001), 'port' => env('PUSHER_PORT', 6001),
'scheme' => env('PUSHER_SCHEME', 'http'), 'scheme' => env('PUSHER_SCHEME', 'http'),
'encrypted' => true, 'encrypted' => true,

View File

@ -21,10 +21,11 @@ services:
SSL_MODE: "off" SSL_MODE: "off"
AUTORUN_LARAVEL_STORAGE_LINK: "false" AUTORUN_LARAVEL_STORAGE_LINK: "false"
AUTORUN_LARAVEL_MIGRATION: "false" AUTORUN_LARAVEL_MIGRATION: "false"
# PUSHER_HOST: "coolify-soketi" PUSHER_HOST: "${PUSHER_HOST}"
# PUSHER_APP_ID: "${PUSHER_APP_ID:-coolify}" PUSHER_PORT: "${PUSHER_PORT:-6001}"
# PUSHER_APP_KEY: "${PUSHER_APP_KEY:-coolify}" PUSHER_APP_ID: "${PUSHER_APP_ID:-coolify}"
# PUSHER_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}" PUSHER_APP_KEY: "${PUSHER_APP_KEY:-coolify}"
PUSHER_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}"
volumes: volumes:
- .:/var/www/html/:cached - .:/var/www/html/:cached
postgres: postgres:
@ -48,16 +49,16 @@ services:
volumes: volumes:
- /data/coolify/_volumes/redis/:/data - /data/coolify/_volumes/redis/:/data
# - coolify-redis-data-dev:/data # - coolify-redis-data-dev:/data
# soketi: soketi:
# env_file: env_file:
# - .env - .env
# ports: ports:
# - "${FORWARD_SOKETI_PORT:-6001}:6001" - "${FORWARD_SOKETI_PORT:-6001}:6001"
# environment: environment:
# SOKETI_DEBUG: "false" SOKETI_DEBUG: "false"
# SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID:-coolify}" SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID:-coolify}"
# SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY:-coolify}" SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY:-coolify}"
# SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}" SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}"
vite: vite:
image: node:20 image: node:20
working_dir: /var/www/html working_dir: /var/www/html

View File

@ -35,9 +35,12 @@ services:
- PHP_PM_START_SERVERS=1 - PHP_PM_START_SERVERS=1
- PHP_PM_MIN_SPARE_SERVERS=1 - PHP_PM_MIN_SPARE_SERVERS=1
- PHP_PM_MAX_SPARE_SERVERS=10 - PHP_PM_MAX_SPARE_SERVERS=10
# - PUSHER_APP_ID - PUSHER_HOST
# - PUSHER_APP_KEY - PUSHER_PORT
# - PUSHER_APP_SECRET - PUSHER_SCHEME
- PUSHER_APP_ID
- PUSHER_APP_KEY
- PUSHER_APP_SECRET
- SELF_HOSTED - SELF_HOSTED
- WAITLIST - WAITLIST
- SUBSCRIPTION_PROVIDER - SUBSCRIPTION_PROVIDER
@ -114,12 +117,12 @@ services:
interval: 2s interval: 2s
retries: 5 retries: 5
timeout: 2s timeout: 2s
# soketi: soketi:
# environment: environment:
# SOKETI_DEBUG: "${SOKETI_DEBUG:-false}" SOKETI_DEBUG: "${SOKETI_DEBUG:-false}"
# SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID}" SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID}"
# SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY}" SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY}"
# SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET}" SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET}"
volumes: volumes:
coolify-db: coolify-db:
name: coolify-db name: coolify-db

View File

@ -24,12 +24,12 @@ services:
restart: always restart: always
networks: networks:
- coolify - coolify
# soketi: soketi:
# image: 'quay.io/soketi/soketi:latest-16-alpine' image: 'quay.io/soketi/soketi:latest-16-alpine'
# container_name: coolify-soketi container_name: coolify-soketi
# restart: always restart: always
# networks: networks:
# - coolify - coolify
networks: networks:
coolify: coolify:
name: coolify name: coolify

View File

@ -24,6 +24,12 @@
@if (config('app.name') == 'Coolify Cloud') @if (config('app.name') == 'Coolify Cloud')
<script defer data-domain="app.coolify.io" src="https://analytics.coollabs.io/js/plausible.js"></script> <script defer data-domain="app.coolify.io" src="https://analytics.coollabs.io/js/plausible.js"></script>
@endif @endif
<script src="https://cdnjs.cloudflare.com/ajax/libs/laravel-echo/1.15.3/echo.iife.min.js"
integrity="sha512-aPAh2oRUr3ALz2MwVWkd6lmdgBQC0wSr0R++zclNjXZreT/JrwDPZQwA/p6R3wOCTcXKIHgA9pQGEQBWQmdLaA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pusher/8.3.0/pusher.min.js"
integrity="sha512-tXL5mrkSoP49uQf2jO0LbvzMyFgki//znmq0wYXGq94gVF6TU0QlrSbwGuPpKTeN1mIjReeqKZ4/NJPjHN1d2Q=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head> </head>
@section('body') @section('body')
@ -37,7 +43,22 @@
</dialog> </dialog>
<x-toaster-hub /> <x-toaster-hub />
<x-version class="fixed left-2 bottom-1" /> <x-version class="fixed left-2 bottom-1" />
<script> <script>
window.Pusher = Pusher;
window.Echo = new Echo({
broadcaster: 'pusher',
cluster: "{{ env('PUSHER_HOST') }}" || window.location.hostname,
key: 'coolify',
wsHost: "{{ env('PUSHER_HOST') }}" || window.location.hostname,
wsPort: "{{ env('PUSHER_PORT') }}" || 6001,
wssPort: "{{ env('PUSHER_PORT') }}" || 6001,
forceTLS: false,
encrypted: true,
disableStats: false,
enableLogging: true,
enabledTransports: ['ws', 'wss'],
});
let checkHealthInterval = null; let checkHealthInterval = null;
let checkIfIamDeadInterval = null; let checkIfIamDeadInterval = null;

View File

@ -38,12 +38,12 @@
use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse; use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse;
use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse; use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;
use Laravel\Fortify\Fortify; use Laravel\Fortify\Fortify;
if (isDev()) {
Route::get('/fire', function () { Route::get('/fire', function () {
event(new \App\Events\TestEvent()); event(new \App\Events\TestEvent());
return 'fired'; return 'fired';
}); });
if (isDev()) {
Route::get('/dev/compose', Compose::class)->name('dev.compose'); Route::get('/dev/compose', Compose::class)->name('dev.compose');
} }
Route::post('/forgot-password', function (Request $request) { Route::post('/forgot-password', function (Request $request) {

View File

@ -4,25 +4,25 @@
VERSION="1.0.4" VERSION="1.0.4"
CDN="https://cdn.coollabs.io/coolify" CDN="https://cdn.coollabs.io/coolify"
curl -fsSL $CDN/docker-compose.yml -o /data/coolify/source/docker-compose.yml #curl -fsSL $CDN/docker-compose.yml -o /data/coolify/source/docker-compose.yml
curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml #curl -fsSL $CDN/docker-compose.prod.yml -o /data/coolify/source/docker-compose.prod.yml
curl -fsSL $CDN/.env.production -o /data/coolify/source/.env.production #curl -fsSL $CDN/.env.production -o /data/coolify/source/.env.production
# Merge .env and .env.production. New values will be added to .env # Merge .env and .env.production. New values will be added to .env
sort -u -t '=' -k 1,1 /data/coolify/source/.env /data/coolify/source/.env.production | sed '/^$/d' >/data/coolify/source/.env.temp && mv /data/coolify/source/.env.temp /data/coolify/source/.env sort -u -t '=' -k 1,1 /data/coolify/source/.env /data/coolify/source/.env.production | sed '/^$/d' >/data/coolify/source/.env.temp && mv /data/coolify/source/.env.temp /data/coolify/source/.env
# Check if PUSHER_APP_ID or PUSHER_APP_KEY or PUSHER_APP_SECRET is empty in /data/coolify/source/.env # Check if PUSHER_APP_ID or PUSHER_APP_KEY or PUSHER_APP_SECRET is empty in /data/coolify/source/.env
# if grep -q "PUSHER_APP_ID=$" /data/coolify/source/.env; then if grep -q "PUSHER_APP_ID=$" /data/coolify/source/.env; then
# sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(openssl rand -hex 32)|g" /data/coolify/source/.env sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(openssl rand -hex 32)|g" /data/coolify/source/.env
# fi fi
# if grep -q "PUSHER_APP_KEY=$" /data/coolify/source/.env; then if grep -q "PUSHER_APP_KEY=$" /data/coolify/source/.env; then
# sed -i "s|PUSHER_APP_KEY=.*|PUSHER_APP_KEY=$(openssl rand -hex 32)|g" /data/coolify/source/.env sed -i "s|PUSHER_APP_KEY=.*|PUSHER_APP_KEY=$(openssl rand -hex 32)|g" /data/coolify/source/.env
# fi fi
# if grep -q "PUSHER_APP_SECRET=$" /data/coolify/source/.env; then if grep -q "PUSHER_APP_SECRET=$" /data/coolify/source/.env; then
# sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env
# fi fi
# Make sure coolify network exists # Make sure coolify network exists
docker network create --attachable coolify 2>/dev/null docker network create --attachable coolify 2>/dev/null