Skip to content

Commit

Permalink
Merge branch 'develop' into feature/localization
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaspalma committed Sep 26, 2024
2 parents 0bfe021 + 084c7f4 commit 160e37e
Show file tree
Hide file tree
Showing 267 changed files with 8,356 additions and 6,143 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bootstrap/cache/services.php
bootstrap/cache/*

storage/app/*
storage/framework/cache/*
Expand Down
27 changes: 0 additions & 27 deletions .env

This file was deleted.

79 changes: 28 additions & 51 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,58 +1,35 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_NAME=ENEI
APP_ENV=local # Use "maintenance" to enable the maitenance page
APP_KEY=base64:AVegBkyjHs2QQsx53M9Kt9GbnrDLc6yG4cRg+WMJrbA=
APP_DEBUG=true
APP_URL=http://localhost
APP_URL=http://localhost:8000
APP_PORT=8000

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
LOCALE=pt
FAKER_LOCALE=pt_PT

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
DB_HOST=pgsql
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE=sinf-website-2023
DB_CONNECTION=pgsql

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=database
SESSION_LIFETIME=120
MAIL_HOST=mailpit
MAIL_PORT=1025

MEMCACHED_HOST=127.0.0.1
REDIS_HOST=redis

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAINTENANCE_DRIVER=cache

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
CACHE_DRIVER=redis

QUEUE_CONNECTION=redis

SCOUT_QUEUE=true
SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://meilisearch:7700

MEILISEARCH_NO_ANALYTICS=false

LOG_CHANNEL="eneiWebsite"
1 change: 1 addition & 0 deletions .env.railway.encrypted
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJpdiI6IjM4ckdUdk1XazMxQjA4RnpTRUZhc3c9PSIsInZhbHVlIjoib1Q3UWtxdzdjSytwMGVRMW9MT2lERlVxclpTK05mUDk1dlhJd2NwbmtkRnFWZTExV2NZdEROMG8zb2N5ZEN1MW5tMk5JbHMxdDh4Z0NsSzYvdy9TdWNKQ3hBMVhncVMxZkFiSkJLR2VZa0JRMUZYbnF0YXJya0NsN2UwemVkMGpnaUw5Y1Z6enBtcnBPWkR3MW1mRENnU2cvcm9rSXNLMzllV3I0QitKL0xvR0J4MHhhWCtMZERYd3pNeHJiMnBINW42a1dCWkVBNmRhTU14T3FvVzgrMjh3ODd3LzMxcnUzcmRWTjZ2OW1qMis2dkVvRWtINlBmN3YzSXR4Mm12VnJFeGZyckdtL3dwQnhvRWIrTEl0WFJNU2ZEbE5pOTJEaW9LOHlLZ0ZEMjlYdTBBakJma3NvRDdidUZ0bVRkWnZUVmtCVG1oTFBZZEVOa0xyNVdnTExzdGxNL3JLcjJOQ2VqTEh4VGV0LzBJMm5WNm5VWlVRMU50bng3UzhkVnVzVkNGWWtYYTBjS1VEbXNLMk02RHhoQnFUbWVZZGREOEhPQURpejhBY3IwVHlGNGs5THZraUZ2NTZxdTB5L095bFk1d25Za3JiNU1mSUU1YUlMV0VHZzRNVVJOa0dQRXFjM3MvY0ZJSEh2eDZITFMrbDFzV1JaaUFHRWcrV1Fjb0lEVWNKaEFIVFAya1I2RUZZZi9odS82OVZmSTNhek40L2dub2IrYlkvM29rd01uRytiZEVJQ3cwaTZoaHRUeXNDTVEzd0hiTVNsc2NzMWRhOUJpSUJFQjg3dlRkdHE4WTkvdmVudFZ2YjZtY1Ryd1dNWjZ5SGxWZkhMeEhFR2MycSIsIm1hYyI6ImFiZTIyM2NkOTYxYmNkNDA4ZWViZWVlOGIyY2IzNGEwMGFlOGQ4NGM1MGYwNDY2ZWE4ODY5YjllN2ZiOWUxZTgiLCJ0YWciOiIifQ==
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -32,7 +32,7 @@ jobs:
run: composer install -n --prefer-dist

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand All @@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -83,10 +83,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand All @@ -102,10 +102,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand All @@ -121,10 +121,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand All @@ -140,7 +140,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -153,7 +153,7 @@ jobs:
run: composer install -n --prefer-dist

- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
/public/storage
/storage/*.key
/vendor
.env.backup
.env.prod
.env*
!.env*.example
!.env*.encrypted
.phpunit.result.cache
Homestead.json
Homestead.yaml
Expand Down
20 changes: 16 additions & 4 deletions Dockerfile → Dockerfile.old
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,27 @@ WORKDIR /var/www/html

USER root

RUN apk add --no-cache php82-pdo_pgsql php82-pgsql php82-pecl-redis
RUN apk add --no-cache php82-pdo_pgsql php82-pgsql php82-pecl-redis php82-iconv php82-zip

USER nobody
# Install supercronic (cron alternative)
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.26/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=7a79496cf8ad899b99a719355d4db27422396735

RUN curl -fsSLO "$SUPERCRONIC_URL" \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic

COPY ./etc/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY ./etc/php/php.ini ${PHP_INI_DIR}/conf.d/php.ini
COPY --chown=nobody ./etc/crontab ./crontab
COPY --chown=nobody ./etc/supervisord.conf ./supervisord.conf

COPY --chown=nobody ./.env.prod ./.env
RUN cat ./supervisord.conf >> /etc/supervisor/conf.d/supervisord.conf

USER nobody

COPY --chown=nobody --from=dependencies /app/vendor ./vendor
COPY --chown=nobody --from=assets /app/public ./public
Expand All @@ -52,7 +65,6 @@ COPY --chown=nobody ./resources ./resources
COPY --chown=nobody ./routes ./routes
COPY --chown=nobody ./storage ./storage

RUN php artisan key:generate --force
RUN php artisan storage:link
RUN php artisan config:cache
RUN php artisan event:cache
Expand Down
9 changes: 7 additions & 2 deletions app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Models\Participant;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\CreatesNewUsers;
use Laravel\Jetstream\Jetstream;
Expand All @@ -27,17 +28,21 @@ public function create(array $input): User
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])->validate();

$user = User::create([
$data = [
'name' => $input['name'],
'email' => $input['email'],
'password' => Hash::make($input['password']),
'usertype_id' => '0',
'usertype_type' => Participant::class,
]);
];

$user = User::create($data);
$participant = Participant::create(['user_id' => $user->id]);
$user->usertype()->associate($participant);
$user->save();

Log::info('Created user with input: {input}', ['input' => $user->toArray()]);

return $user;
}
}
3 changes: 3 additions & 0 deletions app/Actions/Fortify/ResetUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\ResetsUserPasswords;

Expand All @@ -22,6 +23,8 @@ public function reset(User $user, array $input): void
'password' => $this->passwordRules(),
])->validate();

Log::info('Resetting password for {user}', ['user' => $user->name]);

$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
Expand Down
3 changes: 3 additions & 0 deletions app/Actions/Fortify/UpdateUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\UpdatesUserPasswords;

Expand All @@ -25,6 +26,8 @@ public function update(User $user, array $input): void
'current_password.current_password' => __('The provided password does not match your current password.'),
])->validateWithBag('updatePassword');

Log::info('Updating password for {user}', ['user' => $user->name]);

$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
Expand Down
Loading

0 comments on commit 160e37e

Please sign in to comment.