Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@ updates:
schedule:
interval: "monthly"
versioning-strategy: increase
# This option has no impact on security updates, which have a separate,
# internal limit of ten open pull requests.
open-pull-requests-limit: 0
open-pull-requests-limit: 20
rebase-strategy: "disabled"

# Maintain dependencies for npm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
versioning-strategy: increase
# This option has no impact on security updates, which have a separate,
# internal limit of ten open pull requests.
open-pull-requests-limit: 0
open-pull-requests-limit: 20
rebase-strategy: "disabled"
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
php-version:
- '8.2'
- "8.4"

env:
extensions: mbstring, sqlite, intl, gd
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
24
99 changes: 33 additions & 66 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,31 @@
FROM php:8.2-fpm-alpine AS vendor
FROM code4romania/php:8.4 AS vendor

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp
ENV COMPOSER_CACHE_DIR /dev/null
# Switch to root so we can do root things
USER root

WORKDIR /var/www

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
# Install additional PHP extensions
RUN set -ex; \
install-php-extensions \
imagick

RUN apk update && \
#
# production dependencies
RUN set -ex; \
apk add --no-cache \
ffmpeg \
nginx && \
#
# install extensions
install-php-extensions \
event \
excimer \
exif \
gd \
imagick \
intl \
mbstring \
opcache \
pdo_mysql \
pcntl \
zip

COPY --chown=www-data:www-data . /var/www
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

RUN composer install \
ffmpeg

# Drop back to our unprivileged user
USER www-data

COPY --chown=www-data:www-data . /var/www/html

RUN set -ex; \
composer install \
--optimize-autoloader \
--no-interaction \
--no-plugins \
--no-dev \
--prefer-dist

FROM node:20-alpine AS assets
FROM node:24-alpine AS assets

WORKDIR /build

Expand All @@ -50,55 +36,36 @@ COPY \
vite.config.js \
./

RUN npm ci --no-audit --ignore-scripts
RUN set -ex; \
npm ci --no-audit --ignore-scripts

COPY --from=vendor /var/www /build
COPY --from=vendor /var/www/html /build

RUN npm run build
RUN set -ex; \
npm run build

FROM vendor

ARG S6_OVERLAY_VERSION=3.1.6.2
ARG VERSION
ARG REVISION

ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
RUN echo "$VERSION (${REVISION:0:7})" > /var/www/.version

ENTRYPOINT ["/init"]
COPY --from=assets --chown=www-data:www-data /build/public/build /var/www/html/public/build

COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/php/php.ini /usr/local/etc/php/php.ini
COPY docker/php/www.conf /usr/local/etc/php-fpm.d/zz-docker.conf
COPY docker/s6-rc.d /etc/s6-overlay/s6-rc.d

COPY --from=assets --chown=www-data:www-data /build/public/build /var/www/public/build

ENV APP_ENV production
ENV APP_DEBUG false
ENV LOG_CHANNEL stderr
ENV QUEUE_ENABLED=true

# The number of jobs to process before stopping
ENV WORKER_MAX_JOBS 5
ENV QUEUE_MAX_JOBS 5

# Number of seconds to sleep when no job is available
ENV WORKER_SLEEP 10
ENV QUEUE_SLEEP 10

# Number of seconds to rest between jobs
ENV WORKER_REST 1
ENV QUEUE_REST 1

# The number of seconds a child process can run
ENV WORKER_TIMEOUT 600
ENV QUEUE_TIMEOUT 600

# Number of times to attempt a job before logging it failed
ENV WORKER_TRIES 1

# determines what the container should do if one of the service scripts fails
# 0: Continue silently even if a script has failed.
# 1: Continue but warn with an annoying error message.ext script
# 2: Stop the container.
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2

ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME 0

EXPOSE 80
ENV QUEUE_TRIES 1
2 changes: 1 addition & 1 deletion app/Events/UpdateNewsFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UpdateNewsFeed implements ShouldBroadcast
/**
* Get the channels the event should broadcast on.
*
* @return array<int, \Illuminate\Broadcasting\Channel>
* @return array<int, Channel>
*/
public function broadcastOn(): array
{
Expand Down
2 changes: 1 addition & 1 deletion app/Events/UpdateStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UpdateStats implements ShouldBroadcast
/**
* Get the channels the event should broadcast on.
*
* @return array<int, \Illuminate\Broadcasting\Channel>
* @return array<int, Channel>
*/
public function broadcastOn(): array
{
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Pages/Auth/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace App\Filament\Pages\Auth;

use Filament\Pages\Auth\Login as BaseLogin;
use Filament\Auth\Pages\Login as BaseLogin;

class Login extends BaseLogin
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

declare(strict_types=1);

namespace App\Filament\Resources;
namespace App\Filament\Resources\Authors;

use App\Filament\Resources\AuthorResource\Pages;
use App\Filament\Resources\Authors\Pages\ManageAuthors;
use App\Models\Author;
use Filament\Actions\EditAction;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Schemas\Schema;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

class AuthorResource extends Resource
{
protected static ?string $model = Author::class;

protected static ?string $navigationIcon = 'heroicon-o-user-group';
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-user-group';

protected static ?int $navigationSort = 11;

Expand All @@ -26,10 +26,10 @@ public static function getNavigationGroup(): ?string
return __('admin.navigation.newsfeed');
}

public static function form(Form $form): Form
public static function form(Schema $schema): Schema
{
return $form
->schema([
return $schema
->components([
TextInput::make('name')
->required()
->maxLength(255),
Expand Down Expand Up @@ -61,8 +61,8 @@ public static function table(Table $table): Table
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
->recordActions([
EditAction::make(),
])
->defaultSort('id', 'desc');
}
Expand All @@ -77,7 +77,7 @@ public static function getRelations(): array
public static function getPages(): array
{
return [
'index' => Pages\ManageAuthors::route('/'),
'index' => ManageAuthors::route('/'),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace App\Filament\Resources\AuthorResource\Pages;
namespace App\Filament\Resources\Authors\Pages;

use App\Filament\Resources\AuthorResource;
use Filament\Actions;
use App\Filament\Resources\Authors\AuthorResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ManageRecords;

class ManageAuthors extends ManageRecords
Expand All @@ -15,7 +15,7 @@ class ManageAuthors extends ManageRecords
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
CreateAction::make(),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@

declare(strict_types=1);

namespace App\Filament\Resources;
namespace App\Filament\Resources\ElectionDays;

use App\Filament\Resources\ElectionDayResource\Pages;
use App\Filament\Resources\ElectionDays\Pages\ManageElectionDays;
use App\Models\ElectionDay;
use Carbon\Carbon;
use Filament\Actions\BulkActionGroup;
use Filament\Actions\DeleteBulkAction;
use Filament\Actions\EditAction;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Schemas\Schema;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;

class ElectionDayResource extends Resource
{
protected static ?string $model = ElectionDay::class;

protected static ?string $navigationIcon = 'heroicon-o-calendar-days';
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-calendar-days';

protected static ?int $navigationSort = 12;

Expand All @@ -27,10 +29,10 @@ public static function getNavigationGroup(): ?string
return __('admin.navigation.newsfeed');
}

public static function form(Form $form): Form
public static function form(Schema $schema): Schema
{
return $form
->schema([
return $schema
->components([
DatePicker::make('date')
->time(false)
->unique(ignoreRecord:true)
Expand All @@ -54,12 +56,12 @@ public static function table(Table $table): Table
->filters([
//
])
->actions([
Tables\Actions\EditAction::make(),
->recordActions([
EditAction::make(),
])
->bulkActions([
Tables\Actions\BulkActionGroup::make([
Tables\Actions\DeleteBulkAction::make(),
->toolbarActions([
BulkActionGroup::make([
DeleteBulkAction::make(),
]),
])
->defaultSort('date', 'desc');
Expand All @@ -75,7 +77,7 @@ public static function getRelations(): array
public static function getPages(): array
{
return [
'index' => Pages\ManageElectionDays::route('/'),
'index' => ManageElectionDays::route('/'),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace App\Filament\Resources\ElectionDayResource\Pages;
namespace App\Filament\Resources\ElectionDays\Pages;

use App\Filament\Resources\ElectionDayResource;
use Filament\Actions;
use App\Filament\Resources\ElectionDays\ElectionDayResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;

class ManageElectionDays extends ListRecords
Expand All @@ -15,7 +15,7 @@ class ManageElectionDays extends ListRecords
protected function getHeaderActions(): array
{
return [
Actions\CreateAction::make(),
CreateAction::make(),
];
}
}
Loading
Loading