diff --git a/.env.example b/.env.example index e519da6..750bb5e 100644 --- a/.env.example +++ b/.env.example @@ -42,3 +42,7 @@ SENTRY_LARAVEL_DSN= # Matomo MATOMO_SITE_ID= + +## ADMIN SECURE +LDC_WEB_API_KEY= +LDC_WEB_CIDR_MANUAL_ALLOWED_LIST= \ No newline at end of file diff --git a/README.md b/README.md index a47c1cb..2b293db 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,17 @@ npm install && npm run prod ``` +## Production +Put every min in PROD : +```php +php artisan schedule:run +``` + +## Available Commands +``` +ldcweb:admin-secure-sync +``` + ## Back-Office Création de compte diff --git a/composer.json b/composer.json index 75eea44..a7fe8b9 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "laravel/framework": "^8.12", "laravel/tinker": "^2.5", "ldc/ldccrmv2client": "^3.0", + "ldc/web-admin-secure-laravel": "^1.0", "maatwebsite/excel": "^3.1", "mews/purifier": "^3.3", "sentry/sentry-laravel": "^3.7", diff --git a/composer.lock b/composer.lock index fbba34e..05f4f78 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a69f03618c9de0831b0a66e7d42359be", + "content-hash": "f125859babe93c1c3b34a7e9b30cd499", "packages": [ { "name": "asm89/stack-cors", @@ -2089,6 +2089,70 @@ "Laravel" ] }, + { + "name": "ldc/web-admin-secure-laravel", + "version": "1.0.1", + "source": { + "type": "git", + "url": "git@lab.s-web.fr:ldc-web/projets/ldc-web-admin-secure-laravel.git", + "reference": "c538f5d349b119ac64cb62b33e6368bef6be90bc" + }, + "dist": { + "type": "zip", + "url": "https://lab.s-web.fr/api/v4/projects/20/packages/composer/archives/ldc/web-admin-secure-laravel.zip?sha=c538f5d349b119ac64cb62b33e6368bef6be90bc", + "reference": "c538f5d349b119ac64cb62b33e6368bef6be90bc", + "shasum": "" + }, + "require": { + "illuminate/support": "~8|~9", + "laravel/framework": "~8|~9", + "php": "~7.3|7.4|~8" + }, + "require-dev": { + "orchestra/testbench": "^6.24", + "phpunit/php-code-coverage": "^9.2", + "phpunit/phpunit": "~9.0", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "LDC\\WebAdminSecureLaravel\\AdminSecureServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "LDC\\WebAdminSecureLaravel\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "LDC\\WebAdminSecureLaravel\\Tests\\": "tests" + } + }, + "scripts": { + "test": [ + "vendor/bin/phpunit" + ], + "post-autoload-dump": [ + "@php ./vendor/bin/testbench package:discover --ansi" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Vincent BRIDIER", + "email": "vincent.bridier@ldc.fr", + "homepage": "https://www.ldc.fr" + } + ], + "description": "Restrict access to LDC Network" + }, { "name": "league/commonmark", "version": "1.6.7", @@ -11143,12 +11207,12 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^7.3" }, - "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform-dev": {}, + "plugin-api-version": "2.6.0" } diff --git a/manifest.yaml b/manifest.yaml index 010b40b..8e80676 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -27,6 +27,8 @@ data: CRM_PASSWORD: "${APP_CRM_PASSWORD}" SENTRY_LARAVEL_DSN: "${APP_SENTRY_LARAVEL_DSN}" MATOMO_SITE_ID: "${APP_MATOMO_SITE_ID}" + LDC_WEB_API_KEY: "${APP_LDC_WEB_API_KEY}" + LDC_WEB_CIDR_MANUAL_ALLOWED_LIST: "${APP_LDC_WEB_CIDR_MANUAL_ALLOWED_LIST}" --- apiVersion: v1 kind: PersistentVolumeClaim diff --git a/routes/web-bo.php b/routes/web-bo.php index ea72101..b077f5e 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -32,7 +32,7 @@ Route::name('auth.') Route::prefix('bo') ->name('bo.') - ->middleware(['auth', 'is-admin']) + ->middleware(['auth', 'is-admin', 'admin-secure']) ->group(function () { Route::get('/', [DashboardController::class, 'index'])->name('dashboard'); Route::match(['get', 'put'], '/content/{key}', [ContentController::class, 'manage'])