Skip to content

Commit

Permalink
Merge branch 'main' into issue/353
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy132 committed Oct 29, 2024
2 parents 11bb03b + 3f9c1db commit a708218
Show file tree
Hide file tree
Showing 76 changed files with 1,252 additions and 689 deletions.
3 changes: 2 additions & 1 deletion .github/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fi

mkdir /pelican-data/database
ln -s /pelican-data/.env /var/www/html/
chown -h www-data:www-data /var/www/html/.env
ln -s /pelican-data/database/database.sqlite /var/www/html/database/

if ! grep -q "APP_KEY=" .env || grep -q "APP_KEY=$" .env; then
Expand Down Expand Up @@ -58,7 +59,7 @@ else
echo "Starting PHP-FPM only"
fi

chown -R www-data:www-data . /pelican-data/.env /pelican-data/database
chown -R www-data:www-data /pelican-data/.env /pelican-data/database

echo "Starting Supervisord"
exec "$@"
4 changes: 4 additions & 0 deletions .github/docker/supervisord.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
username=dummy
password=dummy

[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
Expand All @@ -18,6 +20,8 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
username=dummy
password=dummy

[program:php-fpm]
command=/usr/local/sbin/php-fpm -F
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
types:
- published

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
name: Build and Push
Expand All @@ -26,7 +30,7 @@ jobs:
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/pelican-dev/panel
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ RUN touch .env
RUN composer install --no-dev --optimize-autoloader

# Set file permissions
RUN chmod -R 755 storage bootstrap/cache
RUN chmod -R 755 storage bootstrap/cache \
&& chown -R www-data:www-data ./

# Add scheduler to cron
RUN echo "* * * * * php /var/www/html/artisan schedule:run >> /dev/null 2>&1" | crontab -u www-data -
Expand Down
3 changes: 1 addition & 2 deletions app/Console/Commands/Schedule/ProcessRunnableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Models\Schedule;
use Illuminate\Database\Eloquent\Builder;
use App\Services\Schedules\ProcessScheduleService;
use Carbon\Carbon;

class ProcessRunnableCommand extends Command
{
Expand All @@ -24,7 +23,7 @@ public function handle(): int
->whereRelation('server', fn (Builder $builder) => $builder->whereNull('status'))
->where('is_active', true)
->where('is_processing', false)
->where('next_run_at', '<=', Carbon::now()->toDateTimeString())
->where('next_run_at', '<=', now('UTC')->toDateTimeString())
->get();

if ($schedules->count() < 1) {
Expand Down
5 changes: 5 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use App\Console\Commands\Schedule\ProcessRunnableCommand;
use App\Jobs\NodeStatistics;
use App\Models\ActivityLog;
use App\Models\Webhook;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Database\Console\PruneCommand;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
Expand Down Expand Up @@ -48,5 +49,9 @@ protected function schedule(Schedule $schedule): void
if (config('activity.prune_days')) {
$schedule->command(PruneCommand::class, ['--model' => [ActivityLog::class]])->daily();
}

if (config('panel.webhook.prune_days')) {
$schedule->command(PruneCommand::class, ['--model' => [Webhook::class]])->daily();
}
}
}
19 changes: 0 additions & 19 deletions app/Events/Server/Created.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Server/Creating.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Server/Deleted.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Server/Deleting.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Server/Saved.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Server/Saving.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Server/Updated.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Server/Updating.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Subuser/Created.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Subuser/Creating.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Subuser/Deleted.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/Subuser/Deleting.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/User/Created.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/User/Creating.php

This file was deleted.

19 changes: 0 additions & 19 deletions app/Events/User/Deleted.php

This file was deleted.

Loading

0 comments on commit a708218

Please sign in to comment.