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=
REDIS_PASSWORD=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

View File

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

View File

@ -194,7 +194,7 @@
App\Providers\AppServiceProvider::class,
App\Providers\FortifyServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\HorizonServiceProvider::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'),
'app_id' => env('PUSHER_APP_ID', 'coolify'),
'options' => [
'host' => 'coolify-soketi',
'host' => env('PUSHER_HOST', 'coolify-soketi'),
'port' => env('PUSHER_PORT', 6001),
'scheme' => env('PUSHER_SCHEME', 'http'),
'encrypted' => true,

View File

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

View File

@ -35,9 +35,12 @@ services:
- 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
- PUSHER_HOST
- PUSHER_PORT
- PUSHER_SCHEME
- PUSHER_APP_ID
- PUSHER_APP_KEY
- PUSHER_APP_SECRET
- SELF_HOSTED
- WAITLIST
- SUBSCRIPTION_PROVIDER
@ -92,7 +95,7 @@ services:
POSTGRES_USER: "${DB_USERNAME:-coolify}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_DB: "${DB_DATABASE:-coolify}"
healthcheck:
healthcheck:
test:
[
"CMD-SHELL",
@ -114,12 +117,12 @@ services:
interval: 2s
retries: 5
timeout: 2s
# soketi:
# 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}"
soketi:
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}"
volumes:
coolify-db:
name: coolify-db

View File

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

View File

@ -24,6 +24,12 @@
@if (config('app.name') == 'Coolify Cloud')
<script defer data-domain="app.coolify.io" src="https://analytics.coollabs.io/js/plausible.js"></script>
@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>
@section('body')
@ -37,7 +43,22 @@
</dialog>
<x-toaster-hub />
<x-version class="fixed left-2 bottom-1" />
<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 checkIfIamDeadInterval = null;

View File

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

View File

@ -4,25 +4,25 @@
VERSION="1.0.4"
CDN="https://cdn.coollabs.io/coolify"
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/.env.production -o /data/coolify/source/.env.production
#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/.env.production -o /data/coolify/source/.env.production
# 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
# 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
# sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(openssl rand -hex 32)|g" /data/coolify/source/.env
# fi
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
fi
# 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
# fi
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
fi
# 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
# fi
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
fi
# Make sure coolify network exists
docker network create --attachable coolify 2>/dev/null