wip
This commit is contained in:
parent
02989678be
commit
ce49f26c53
26
app/Events/TestEvent.php
Normal file
26
app/Events/TestEvent.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class TestEvent implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function broadcastOn(): array
|
||||
{
|
||||
return [
|
||||
new Channel('public'),
|
||||
];
|
||||
}
|
||||
}
|
@ -10,6 +10,12 @@ class Dashboard extends Component
|
||||
{
|
||||
public $projects = [];
|
||||
public $servers = [];
|
||||
protected $listeners = ['echo:public,TestEvent' => 'notifyNewOrder'];
|
||||
|
||||
public function notifyNewOrder()
|
||||
{
|
||||
$this->emit('success', 'New order received!');
|
||||
}
|
||||
public function mount()
|
||||
{
|
||||
$this->servers = Server::ownedByCurrentTeam()->get();
|
||||
|
@ -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,
|
||||
|
@ -32,14 +32,14 @@
|
||||
|
||||
'pusher' => [
|
||||
'driver' => 'pusher',
|
||||
'key' => env('PUSHER_APP_KEY', 'coolify'),
|
||||
'secret' => env('PUSHER_APP_SECRET', 'coolify'),
|
||||
'app_id' => env('PUSHER_APP_ID', 'coolify'),
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'options' => [
|
||||
'host' => 'coolify-soketi',
|
||||
'port' => env('PUSHER_PORT', 6001),
|
||||
'scheme' => env('PUSHER_SCHEME', 'http'),
|
||||
'encrypted' => false,
|
||||
'encrypted' => true,
|
||||
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
|
||||
],
|
||||
'client_options' => [
|
||||
|
@ -21,10 +21,10 @@ 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: "coolify-soketi"
|
||||
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 +48,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: "true"
|
||||
# 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
|
||||
|
@ -35,6 +35,9 @@ 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
|
||||
- SELF_HOSTED
|
||||
- WAITLIST
|
||||
- SUBSCRIPTION_PROVIDER
|
||||
@ -111,12 +114,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
|
||||
|
@ -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
|
||||
|
@ -1,25 +1,25 @@
|
||||
import Alpine from "alpinejs";
|
||||
// import Echo from 'laravel-echo';
|
||||
// import Pusher from 'pusher-js';
|
||||
import Echo from 'laravel-echo';
|
||||
import Pusher from 'pusher-js';
|
||||
import { createApp } from "vue";
|
||||
import MagicBar from "./components/MagicBar.vue";
|
||||
import Toaster from "../../vendor/masmerise/livewire-toaster/resources/js";
|
||||
|
||||
// window.Pusher = Pusher;
|
||||
window.Pusher = Pusher;
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// cluster: window.location.hostname,
|
||||
// key: import.meta.env.VITE_PUSHER_APP_KEY ?? 'coolify',
|
||||
// wsHost: window.location.hostname,
|
||||
// wsPort: 6001,
|
||||
// wssPort: 6001,
|
||||
// forceTLS: false,
|
||||
// encrypted: true,
|
||||
// disableStats: false,
|
||||
// enableLogging: true,
|
||||
// enabledTransports: ['ws', 'wss'],
|
||||
// });
|
||||
window.Echo = new Echo({
|
||||
broadcaster: 'pusher',
|
||||
cluster: window.location.hostname,
|
||||
key: import.meta.env.VITE_PUSHER_APP_KEY,
|
||||
wsHost: window.location.hostname,
|
||||
wsPort: 6001,
|
||||
wssPort: 6001,
|
||||
forceTLS: false,
|
||||
encrypted: true,
|
||||
disableStats: false,
|
||||
enableLogging: true,
|
||||
enabledTransports: ['ws', 'wss'],
|
||||
});
|
||||
|
||||
Alpine.plugin(Toaster);
|
||||
|
||||
|
@ -39,6 +39,10 @@
|
||||
use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;
|
||||
use Laravel\Fortify\Fortify;
|
||||
|
||||
Route::get('/fire', function () {
|
||||
event(new \App\Events\TestEvent());
|
||||
return 'fired';
|
||||
});
|
||||
if (isDev()) {
|
||||
Route::get('/dev/compose', Compose::class)->name('dev.compose');
|
||||
}
|
||||
|
@ -137,6 +137,9 @@ if [ ! -f /data/coolify/source/.env ]; then
|
||||
sed -i "s|APP_KEY=.*|APP_KEY=base64:$(openssl rand -base64 32)|g" /data/coolify/source/.env
|
||||
sed -i "s|DB_PASSWORD=.*|DB_PASSWORD=$(openssl rand -base64 32)|g" /data/coolify/source/.env
|
||||
sed -i "s|REDIS_PASSWORD=.*|REDIS_PASSWORD=$(openssl rand -base64 32)|g" /data/coolify/source/.env
|
||||
sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(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
|
||||
sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env
|
||||
fi
|
||||
|
||||
# Merge .env and .env.production. New values will be added to .env
|
||||
|
@ -12,26 +12,26 @@ curl -fsSL $CDN/.env.production -o /data/coolify/source/.env.production
|
||||
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
|
||||
# echo "PUSHER_APP_ID is not set in .env"
|
||||
# sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(openssl rand -hex 32)|g" /data/coolify/source/.env
|
||||
# else
|
||||
# echo "PUSHER_APP_ID is set in .env"
|
||||
# fi
|
||||
if grep -q "PUSHER_APP_ID=$" /data/coolify/source/.env; then
|
||||
echo "PUSHER_APP_ID is not set in .env"
|
||||
sed -i "s|PUSHER_APP_ID=.*|PUSHER_APP_ID=$(openssl rand -hex 32)|g" /data/coolify/source/.env
|
||||
else
|
||||
echo "PUSHER_APP_ID is set in .env"
|
||||
fi
|
||||
|
||||
# if grep -q "PUSHER_APP_KEY=$" /data/coolify/source/.env; then
|
||||
# echo "PUSHER_APP_KEY is not set in .env"
|
||||
# sed -i "s|PUSHER_APP_KEY=.*|PUSHER_APP_KEY=$(openssl rand -hex 32)|g" /data/coolify/source/.env
|
||||
# else
|
||||
# echo "PUSHER_APP_KEY is set in .env"
|
||||
# fi
|
||||
if grep -q "PUSHER_APP_KEY=$" /data/coolify/source/.env; then
|
||||
echo "PUSHER_APP_KEY is not set in .env"
|
||||
sed -i "s|PUSHER_APP_KEY=.*|PUSHER_APP_KEY=$(openssl rand -hex 32)|g" /data/coolify/source/.env
|
||||
else
|
||||
echo "PUSHER_APP_KEY is set in .env"
|
||||
fi
|
||||
|
||||
# if grep -q "PUSHER_APP_SECRET=$" /data/coolify/source/.env; then
|
||||
# echo "PUSHER_APP_SECRET is not set in .env"
|
||||
# sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env
|
||||
# else
|
||||
# echo "PUSHER_APP_SECRET is set in .env"
|
||||
# fi
|
||||
if grep -q "PUSHER_APP_SECRET=$" /data/coolify/source/.env; then
|
||||
echo "PUSHER_APP_SECRET is not set in .env"
|
||||
sed -i "s|PUSHER_APP_SECRET=.*|PUSHER_APP_SECRET=$(openssl rand -hex 32)|g" /data/coolify/source/.env
|
||||
else
|
||||
echo "PUSHER_APP_SECRET is set in .env"
|
||||
fi
|
||||
|
||||
# Make sure coolify network exists
|
||||
docker network create --attachable coolify 2>/dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user