Skip to content

Commit

Permalink
Merge pull request #314 from EscolaLMS/feature/l9
Browse files Browse the repository at this point in the history
update laravel to l9
  • Loading branch information
qunabu authored Feb 16, 2024
2 parents e4ea38f + 13bfa70 commit 4dcde9b
Show file tree
Hide file tree
Showing 14 changed files with 20,388 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bootstrap/cache/**/*


storage/api-docs/api-docs.json
composer.lock
#composer.lock
yarn.lock


Expand Down
59 changes: 4 additions & 55 deletions .github/workflows/phpunit-tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
on: push
name: Integration Tests
jobs:
phpunit-mysql:
phpunit-mysql-php81:
runs-on: ubuntu-latest
container:
image: escolalms/php:8-work
image: escolalms/php:8.1-work

services:
mysql:
Expand All @@ -31,57 +31,7 @@ jobs:
run: |
apt-get install unzip -y
composer self-update
composer install --no-scripts
- name: Prepare Laravel Application
run: |
php artisan key:generate
php artisan migrate:fresh
php artisan db:seed --class="Database\Seeders\PermissionsSeeder"
php artisan passport:keys --force
php artisan passport:client --personal --no-interaction
cp storage/oauth-private.key vendor/orchestra/testbench-core/laravel/storage/oauth-private.key
cp storage/oauth-public.key vendor/orchestra/testbench-core/laravel/storage/oauth-public.key
mkdir vendor/escolalms/lrs/src/../../storage/
cp storage/*.key vendor/escolalms/lrs/src/../../storage/
- name: Special Migrations for Tests
run: php artisan migrate --path=vendor/escolalms/courses/tests/Database/Migrations

- name: Run Testsuite
run: vendor/bin/phpunit

phpunit-postgres:
runs-on: ubuntu-latest
container:
image: escolalms/php:8-work

services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
TZ: Europe/Warsaw
ports:
- 5432:5432

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Copy environment configuration files
run: |
cp docker/envs/.env.ci.postgres .env
cp docker/envs/phpunit.xml.postgres phpunit.xml
- name: Install composer dependencies
run: |
apt-get -y install git
apt-get install unzip
composer self-update
rm composer.lock # lock is for php >=8.2
composer install --no-scripts
- name: Prepare Laravel Application
Expand Down Expand Up @@ -132,9 +82,9 @@ jobs:
run: |
apt-get install git unzip -y
composer self-update
rm composer.lock # lock is for php >=8.2
composer install --no-scripts
- name: Prepare Laravel Application
run: |
php artisan key:generate
Expand Down Expand Up @@ -185,7 +135,6 @@ jobs:
composer self-update
composer install --no-scripts
- name: Prepare Laravel Application
run: |
php artisan key:generate
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ result.md


storage/api-docs/api-docs.json
composer.lock
#composer.lock
yarn.lock


Expand Down
11 changes: 0 additions & 11 deletions Caddyfile

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile.develop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM escolalms/php:8.1-work
FROM escolalms/php:8.2-work
WORKDIR /var/www/html
EXPOSE 80
COPY / /var/www/html
Expand All @@ -11,7 +11,7 @@ RUN cp docker/envs/.env.postgres.prod /var/www/html/.env \
# general supervisord settings
&& cp docker/conf/supervisor/supervisord.conf /etc/supervisor/supervisord.conf \
# supervisord services
&& cp -r docker/conf/supervisor/services/* /etc/supervisor/custom.d/ \
&& cp -r docker/conf/supervisor/services/* /etc/supervisor/custom.d \
# caddy file for routing
&& cp docker/conf/caddy/Caddyfile /etc/caddy/Caddyfile \
# devilbox php.ini./ TODO this should be rather send to different custom file
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Kernel extends HttpKernel
* @var array
*/
protected $middleware = [
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
Expand Down
8 changes: 6 additions & 2 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Http\Middleware;

use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;

class TrustProxies extends Middleware
{
Expand All @@ -19,5 +19,9 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
protected $headers = Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}
2 changes: 2 additions & 0 deletions app/Models/Course.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use EscolaLms\Courses\Events\CourseAssigned;
use EscolaLms\Courses\Events\CourseFinished;
use EscolaLms\Courses\Events\CourseUnassigned;
use EscolaLms\ModelFields\Traits\ModelFields;


class Course extends \EscolaLms\Courses\Models\Course implements Productable
{
Expand Down
7 changes: 3 additions & 4 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class AuthServiceProvider extends ServiceProvider
*
* @var array
*/
protected $policies = [
];
protected $policies = [];

/**
* Register any authentication / authorization services.
Expand All @@ -23,7 +22,7 @@ class AuthServiceProvider extends ServiceProvider
public function boot()
{
$this->registerPolicies();
Passport::routes();
Passport::loadKeysFrom(__DIR__ . '/../../storage');
//Passport::routes();
//Passport::loadKeysFrom(__DIR__ . '/../../storage');
}
}
57 changes: 31 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,36 @@
"name": "Paweł Chołaj",
"email": "[email protected]",
"homepage": "https://cholaj.pl"
},
{
"name": "Hubert Krzysztofiak"
},
{
"name": "Maciej Rymarz"
},
{
"name": "Tomasz Smolarek"
},
{
"name": "Witold Wiśniewski"
}
],
"require": {
"php": ">=7.4",
"darkaonline/l5-swagger": "8.1.0",
"dmore/chrome-mink-driver": "^2.7",
"php": ">=8.1",
"darkaonline/l5-swagger": "^8",
"doctrine/dbal": "^2|^3",
"escolalms/assign-without-account": "^0",
"escolalms/auth": "^0",
"escolalms/bookmarks_notes": "^0",
"escolalms/cart": "^0",
"escolalms/categories": "^0",
"escolalms/cmi5": "^0",
"escolalms/consultations": "^0",
"escolalms/consultation-access": "^0",
"escolalms/consultations": "^0",
"escolalms/core": "^1",
"escolalms/courses": "^0",
"escolalms/course-access": "^0",
"escolalms/courses-import-export": "^0",
"escolalms/courses": "^0",
"escolalms/courses-import-export": "^0.1.21",
"escolalms/csv-users": "^0",
"escolalms/files": "^0",
"escolalms/headless-h5p": "^0",
Expand All @@ -63,40 +74,34 @@
"escolalms/templates-email": "^0",
"escolalms/templates-pdf": "^0",
"escolalms/templates-sms": "^0",
"escolalms/topic-types": "^0",
"escolalms/topic-type-gift": "^0",
"escolalms/topic-type-project": "^0",
"escolalms/topic-types": "^0",
"escolalms/tracker": "^0",
"escolalms/translations": "^0",
"escolalms/video": "^0",
"escolalms/vouchers": "^0",
"escolalms/webinar": "^0",
"fideloper/proxy": "^4.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.3",
"laravel/framework": "^8.0",
"laravel/helpers": "^1.4",
"laravel/horizon": "^5.7",
"laravel/passport": "^10.0",
"guzzlehttp/guzzle": "^7.4.5",
"laravel/framework": "^9",
"laravel/helpers": "^1.7",
"laravel/horizon": "^5",
"laravel/passport": "^11",
"laravel/socialite": "^5.1",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
"predis/predis": "^1.1",
"sentry/sentry-laravel": "^3.6",
"spatie/laravel-permission": "^3.18",
"laravel/tinker": "^2.9",
"predis/predis": "^2.2",
"psr/http-message": "^1",
"sentry/sentry-laravel": "^4.2",
"spatie/laravel-permission": "^6.3",
"staudenmeir/laravel-migration-views": "^1.0"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.9",
"beyondcode/laravel-dump-server": "^1.0",
"brainmaestro/composer-git-hooks": "^2.8",
"facade/ignition": "^2.0",
"spatie/laravel-ignition": "^1.0",
"fakerphp/faker": "^1.9.1",
"filp/whoops": "^2.0",
"friends-of-behat/mink-extension": "^2.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^5.0",
"orchestra/testbench": "^6.17",
"nunomaduro/collision": "^7",
"orchestra/testbench": "^7",
"php-mock/php-mock-phpunit": "^2.6",
"phpunit/phpunit": "^9.0"
},
Expand Down
Loading

0 comments on commit 4dcde9b

Please sign in to comment.