Skip to content

Commit

Permalink
Merge pull request #318 from EscolaLMS/develop
Browse files Browse the repository at this point in the history
l9 update
  • Loading branch information
qunabu authored Feb 28, 2024
2 parents e6564af + 176ffa6 commit a3f74bd
Show file tree
Hide file tree
Showing 37 changed files with 21,645 additions and 187 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
15 changes: 13 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ APP_ENV=local
APP_KEY=base64:pveos6JL8iCwO3MbzoyQpNx6TETMYuUpfZ18CDKl6Cw=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost:1000
APP_URL=http://api.localhost:1001

DB_CONNECTION=pgsql
DB_HOST=postgres
Expand Down Expand Up @@ -50,4 +50,15 @@ MJML_BINARY_PATH=/usr/bin/mjml

TRACKER_ENABLED=false

REPORTBRO_URL="https://www.reportbro.com/report/run"
REPORTBRO_URL="https://www.reportbro.com/report/run"


FILESYSTEM_DRIVER=s3

AWS_ACCESS_KEY_ID=masoud
AWS_SECRET_ACCESS_KEY=tg9t712TG1Odn17fisxXM9y01YrD
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=wellms
AWS_ENDPOINT="http://minio:9000"
AWS_URL="http://storage.localhost:1001/wellms"
AWS_USE_PATH_STYLE_ENDPOINT=true
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.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM escolalms/php:8.1-prod
FROM escolalms/php:8.2-prod
WORKDIR /var/www/html
EXPOSE 80
COPY / /var/www/html
Expand Down
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/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use EscolaLms\Webinar\Enum\WebinarTermReminderStatusEnum;
use EscolaLms\Webinar\Jobs\ReminderAboutWebinarJob;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Gecche\Multidomain\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use App\Http\Middleware\ForceJsonResponse;
use App\Http\Middleware\ManualRoutesAuthorization;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Gecche\Multidomain\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
Expand All @@ -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');
}
}
2 changes: 1 addition & 1 deletion app/Providers/HorizonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Support\Facades\Gate;
use Laravel\Horizon\Horizon;
use Laravel\Horizon\HorizonApplicationServiceProvider;
use Gecche\Multidomain\Horizon\HorizonApplicationServiceProvider;

class HorizonServiceProvider extends HorizonApplicationServiceProvider
{
Expand Down
10 changes: 8 additions & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
|
*/

$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
$domainParams = [
'domain_detection_function_web' => function() {
return \Illuminate\Support\Arr::get($_SERVER,'HTTP_X_FORWARDED_HOST') ?? \Illuminate\Support\Arr::get($_SERVER,'HTTP_HOST');
}
];

$app = new Gecche\Multidomain\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__), null, $domainParams
);

/*
Expand Down
60 changes: 34 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,37 @@
"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/bulk-notifications": "^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 +75,36 @@
"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",
"gecche/laravel-multidomain": "^5.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",
"league/flysystem-aws-s3-v3": "^3.0",
"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 a3f74bd

Please sign in to comment.