Skip to content
This repository has been archived by the owner on Aug 20, 2023. It is now read-only.

Commit

Permalink
Clean-up websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 committed Feb 8, 2022
1 parent 2242e36 commit 763a4f8
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 61 deletions.
10 changes: 4 additions & 6 deletions .env.sail.example
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=testapp
PUSHER_APP_KEY=websocketkey
PUSHER_APP_SECRET=somethingsecret
PUSHER_APP_KEY=app-key
PUSHER_APP_ID=app-id
PUSHER_APP_SECRET=app-secret
PUSHER_APP_CLUSTER=mt1
PUSHER_SCHEME=https

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=/etc/nginx/ssl/cert.pem
LARAVEL_WEBSOCKETS_SSL_LOCAL_PK=/etc/nginx/ssl/key.pem

OCTANE_SERVER=swoole
OCTANE_HTTPS=true

Expand Down
24 changes: 12 additions & 12 deletions app/Providers/TelescopeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@

class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
{
/**
* Configure the Telescope authorization services.
*
* @return void
*/
protected function authorization()
{
Telescope::auth(function ($request) {
return $request->user()->hasRole('super-admin');
});
}

/**
* Register any application services.
*
Expand Down Expand Up @@ -64,4 +52,16 @@ protected function hideSensitiveRequestDetails(): void
'x-xsrf-token',
]);
}

/**
* Configure the Telescope authorization services.
*
* @return void
*/
protected function authorization()
{
Telescope::auth(function ($request) {
return $request->user()->hasRole('super-admin');
});
}
}
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ version: "3"
services:
laravel.test:
build:
context: ./docker/8.0
context: ./docker/8.1
dockerfile: Dockerfile
args:
WWWGROUP: "${WWWGROUP}"
image: sail-8.0/app
image: sail-8.1/app
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "${APP_PORT:-80}:80"
- "${LARAVEL_WEBSOCKETS_PORT:-6001}:6001"
environment:
WWWUSER: "${WWWUSER}"
LARAVEL_SAIL: 1
Expand Down
14 changes: 1 addition & 13 deletions docker/7.4/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,10 @@ stderr_logfile_maxbytes=0
[program:horizon]
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan horizon
user=sail
autostart=true
autorestart=true
stopwaitsecs=3600
environment=LARAVEL_SAIL="1"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:websockets]
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan websockets:serve --host=0.0.0.0 --port=6001
user=sail
numprocs=1
autostart=true
autorestart=true
environment=LARAVEL_SAIL="1"
stopwaitsecs=3600
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down
14 changes: 1 addition & 13 deletions docker/8.0/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,10 @@ stderr_logfile_maxbytes=0
[program:horizon]
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan horizon
user=sail
autostart=true
autorestart=true
stopwaitsecs=3600
environment=LARAVEL_SAIL="1"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:websockets]
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan websockets:serve --host=0.0.0.0 --port=6001
user=sail
numprocs=1
autostart=true
autorestart=true
environment=LARAVEL_SAIL="1"
stopwaitsecs=3600
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down
3 changes: 2 additions & 1 deletion docker/8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ RUN apt-get update \
&& apt-get install -y yarn \
&& apt-get install -y mysql-client \
&& apt-get install -y postgresql-client \
&& apt-get install -y php-imagick imagemagick ffmpeg jpegoptim optipng pngquant gifsicle \
&& apt-get install imagemagick ffmpeg jpegoptim optipng pngquant gifsicle \
&& apt-get install -y php8.1-imagick \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
14 changes: 1 addition & 13 deletions docker/8.1/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,10 @@ stderr_logfile_maxbytes=0
[program:horizon]
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan horizon
user=sail
autostart=true
autorestart=true
stopwaitsecs=3600
environment=LARAVEL_SAIL="1"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:websockets]
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan websockets:serve --host=0.0.0.0 --port=6001
user=sail
numprocs=1
autostart=true
autorestart=true
environment=LARAVEL_SAIL="1"
stopwaitsecs=3600
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down

0 comments on commit 763a4f8

Please sign in to comment.