finalisation bricolage pour prod

This commit is contained in:
Melaine Gérard 2025-01-04 09:41:48 +01:00
parent 714a330f27
commit a0d83fe1e8
87 changed files with 172 additions and 13 deletions

0
.env Normal file → Executable file
View File

0
.env.test Normal file → Executable file
View File

2
.gitignore vendored Normal file → Executable file
View File

@ -32,3 +32,5 @@
/uploads/*
!uploads/.gitkeep
/public/kumora/

11
.htaccess Executable file
View File

@ -0,0 +1,11 @@
<IfModule mod_rewrite.c>
RewriteEngine On
# Rediriger les assets
RewriteCond %{REQUEST_URI} ^/kumora/assets/
RewriteRule ^kumora/assets/(.*)$ assets/$1 [L]
# Rediriger toutes les autres requêtes vers le dossier public
RewriteCond %{REQUEST_URI} !^/kumora/public/
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

0
.symfony.local.yaml Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
assets/app.js Normal file → Executable file
View File

0
assets/bootstrap.js vendored Normal file → Executable file
View File

0
assets/controllers.json Normal file → Executable file
View File

0
assets/controllers/.gitkeep Normal file → Executable file
View File

0
assets/controllers/csrf_protection_controller.js Normal file → Executable file
View File

0
assets/icons/symfony.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

0
assets/images/favicon.ico Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

0
assets/images/logo.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 814 KiB

After

Width:  |  Height:  |  Size: 814 KiB

0
assets/styles/app.css Normal file → Executable file
View File

1
composer.json Normal file → Executable file
View File

@ -15,6 +15,7 @@
"oneup/flysystem-bundle": "^4.12.3",
"phpdocumentor/reflection-docblock": "^5.6.1",
"phpstan/phpdoc-parser": "^2.0",
"symfony/apache-pack": "^1.0",
"symfony/asset": "7.2.*",
"symfony/asset-mapper": "7.2.*",
"symfony/console": "7.2.*",

28
composer.lock generated Normal file → Executable file
View File

@ -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": "e09298f3e588af757a6dc171b49156ce",
"content-hash": "3032276cf7af61e3028a0f94b2488b8d",
"packages": [
{
"name": "composer/semver",
@ -2403,6 +2403,32 @@
},
"time": "2021-10-29T13:26:27+00:00"
},
{
"name": "symfony/apache-pack",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/apache-pack.git",
"reference": "3aa5818d73ad2551281fc58a75afd9ca82622e6c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/apache-pack/zipball/3aa5818d73ad2551281fc58a75afd9ca82622e6c",
"reference": "3aa5818d73ad2551281fc58a75afd9ca82622e6c",
"shasum": ""
},
"type": "symfony-pack",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A pack for Apache support in Symfony",
"support": {
"issues": "https://github.com/symfony/apache-pack/issues",
"source": "https://github.com/symfony/apache-pack/tree/master"
},
"time": "2017-12-12T01:46:35+00:00"
},
{
"name": "symfony/asset",
"version": "v7.2.0",

0
config/bundles.php Normal file → Executable file
View File

1
config/packages/asset_mapper.yaml Normal file → Executable file
View File

@ -4,6 +4,7 @@ framework:
paths:
- assets/
missing_import_mode: strict
public_prefix: /kumora/assets
when@prod:
framework:

0
config/packages/cache.yaml Normal file → Executable file
View File

0
config/packages/csrf.yaml Normal file → Executable file
View File

0
config/packages/debug.yaml Normal file → Executable file
View File

0
config/packages/doctrine.yaml Normal file → Executable file
View File

0
config/packages/doctrine_migrations.yaml Normal file → Executable file
View File

0
config/packages/framework.yaml Normal file → Executable file
View File

0
config/packages/mailer.yaml Normal file → Executable file
View File

0
config/packages/messenger.yaml Normal file → Executable file
View File

0
config/packages/monolog.yaml Normal file → Executable file
View File

0
config/packages/notifier.yaml Normal file → Executable file
View File

0
config/packages/oneup_flysystem.yaml Normal file → Executable file
View File

0
config/packages/routing.yaml Normal file → Executable file
View File

14
config/packages/security.yaml Normal file → Executable file
View File

@ -1,7 +1,7 @@
security:
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: "auto"
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
providers:
# used to reload user from session & other features (e.g. switch_user)
@ -20,10 +20,12 @@ security:
login_path: app_login
check_path: app_login
enable_csrf: true
default_target_path: app_home
always_use_default_target_path: true
logout:
path: app_logout
# where to redirect after logout
# target: app_any_route
target: app_home
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
@ -45,7 +47,7 @@ when@test:
# are not important, waste resources and increase test times. The following
# reduces the work factor to the lowest possible values.
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
algorithm: auto
cost: 4 # Lowest possible value for bcrypt
time_cost: 3 # Lowest possible value for argon
memory_cost: 10 # Lowest possible value for argon
algorithm: auto
cost: 4 # Lowest possible value for bcrypt
time_cost: 3 # Lowest possible value for argon
memory_cost: 10 # Lowest possible value for argon

0
config/packages/translation.yaml Normal file → Executable file
View File

0
config/packages/twig.yaml Normal file → Executable file
View File

0
config/packages/twig_component.yaml Normal file → Executable file
View File

0
config/packages/validator.yaml Normal file → Executable file
View File

1
config/packages/web_profiler.yaml Normal file → Executable file
View File

@ -2,6 +2,7 @@ when@dev:
web_profiler:
toolbar: true
intercept_redirects: false
excluded_ajax_paths: '^/((index|app(_[\w]+)?)\.php/)?(?!/kumora)(_(profiler|wdt)|css|images|js)/'
framework:
profiler:

0
config/preload.php Normal file → Executable file
View File

1
config/routes.yaml Normal file → Executable file
View File

@ -3,3 +3,4 @@ controllers:
path: ../src/Controller/
namespace: App\Controller
type: attribute
prefix: /kumora

0
config/routes/framework.yaml Normal file → Executable file
View File

0
config/routes/security.yaml Normal file → Executable file
View File

8
config/routes/web_profiler.yaml Normal file → Executable file
View File

@ -1,8 +1,8 @@
when@dev:
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /kumora/_wdt
web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
prefix: /kumora/_profiler

0
config/services.yaml Normal file → Executable file
View File

0
importmap.php Normal file → Executable file
View File

0
migrations/.gitignore vendored Normal file → Executable file
View File

0
migrations/Version20241229133017.php Normal file → Executable file
View File

0
phpunit.xml.dist Normal file → Executable file
View File

73
public/.htaccess Executable file
View File

@ -0,0 +1,73 @@
# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php
# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
# when compiling LESS/Sass/CoffeScript assets.
# Options +SymLinksIfOwnerMatch
# Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve
# to the front controller "/index.php" but be rewritten to "/index.php/index".
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_rewrite.c>
# This Option needs to be enabled for RewriteRule, otherwise it will show an error like
# 'Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden'
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteRule ^assets/(.*)$ assets/$1 [L]
# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper
# resolution of the index.php file and to redirect to the correct URI. It will
# work in environments without path prefix as well, providing a safe, one-size
# fits all solution. But as you do not need it in this case, you can comment
# the following 2 lines to eliminate the overhead.
RewriteCond %{ENV:BASE} ^/kumora(.+)$
RewriteRule .* - [E=BASE:%1]
RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
RewriteRule .* - [E=BASE:%1]
# Sets the HTTP_AUTHORIZATION header removed by Apache
RewriteCond %{HTTP:Authorization} .+
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
# Redirect to URI without front controller to prevent duplicate content
# (with and without `/index.php`). Only do this redirect on the initial
# rewrite by Apache and not on subsequent cycles. Otherwise we would get an
# endless redirect loop (request -> rewrite to front controller ->
# redirect -> request -> ...).
# So in case you get a "too many redirects" error or you always get redirected
# to the start page because your Apache does not expose the REDIRECT_STATUS
# environment variable, you have 2 choices:
# - disable this feature by commenting the following 2 lines or
# - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
# following RewriteCond (best solution)
RewriteCond %{ENV:REDIRECT_STATUS} =""
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
# Rewrite all other queries to the front controller.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
# When mod_rewrite is not available, we instruct a temporary redirect of
# the start page to the front controller explicitly so that the website
# and the generated links can still be used.
RedirectMatch 307 ^/$ /index.php/
# RedirectTemp cannot be used instead
</IfModule>
</IfModule>

0
public/index.php Normal file → Executable file
View File

0
renovate.json Normal file → Executable file
View File

0
src/Command/CreateUserCommand.php Normal file → Executable file
View File

0
src/Controller/.gitignore vendored Normal file → Executable file
View File

0
src/Controller/AdminController.php Normal file → Executable file
View File

0
src/Controller/FilesController.php Normal file → Executable file
View File

0
src/Controller/HomeController.php Normal file → Executable file
View File

6
src/Controller/SecurityController.php Normal file → Executable file
View File

@ -6,15 +6,21 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class SecurityController extends AbstractController
{
public function __construct(private readonly UrlGeneratorInterface $urlGenerator)
{
}
#[Route(path: '/login', name: 'app_login')]
public function login(AuthenticationUtils $authenticationUtils): Response
{
if ($this->isGranted('IS_AUTHENTICATED_FULLY')) {
return $this->redirectToRoute('app_home');
}
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();

0
src/Entity/.gitignore vendored Normal file → Executable file
View File

0
src/Entity/User.php Normal file → Executable file
View File

0
src/Form/.gitkeep Normal file → Executable file
View File

0
src/Form/UserAdminType.php Normal file → Executable file
View File

0
src/Kernel.php Normal file → Executable file
View File

0
src/Repository/.gitignore vendored Normal file → Executable file
View File

0
src/Repository/UserRepository.php Normal file → Executable file
View File

View File

@ -0,0 +1,23 @@
<?php
namespace App\Security\Authentication;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
class AuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface
{
public function __construct(private readonly UrlGeneratorInterface $urlGenerator)
{
}
public function onAuthenticationSuccess(Request $request, TokenInterface $tokenInterface): Response
{
$url = $this->urlGenerator->generate('app_home');
return new RedirectResponse($url);
}
}

0
src/Twig/Extension/BasenameExtension.php Normal file → Executable file
View File

0
src/Twig/Extension/SizeExtension.php Normal file → Executable file
View File

0
src/Twig/Extension/TimeExtension.php Normal file → Executable file
View File

0
src/Twig/Runtime/BasenameExtensionRuntime.php Normal file → Executable file
View File

0
src/Twig/Runtime/SizeExtensionRuntime.php Normal file → Executable file
View File

0
src/Twig/Runtime/TimeExtensionRuntime.php Normal file → Executable file
View File

12
symfony.lock Normal file → Executable file
View File

@ -52,6 +52,18 @@
"tests/bootstrap.php"
]
},
"symfony/apache-pack": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "1.0",
"ref": "0f18b4decdf5695d692c1d0dfd65516a07a6adf1"
},
"files": [
"public/.htaccess"
]
},
"symfony/asset-mapper": {
"version": "7.2",
"recipe": {

0
tailwind.config.js Normal file → Executable file
View File

0
templates/admin/index.html.twig Normal file → Executable file
View File

0
templates/admin/user_edit.html.twig Normal file → Executable file
View File

0
templates/admin/user_index.html.twig Normal file → Executable file
View File

0
templates/base-admin.html.twig Normal file → Executable file
View File

0
templates/base.html.twig Normal file → Executable file
View File

0
templates/files/index.html.twig Normal file → Executable file
View File

0
templates/home/index.html.twig Normal file → Executable file
View File

0
templates/partials/alerts.html.twig Normal file → Executable file
View File

0
templates/partials/breadbrumb.html.twig Normal file → Executable file
View File

0
templates/partials/navbar-admin.html.twig Normal file → Executable file
View File

0
templates/partials/navbar.html.twig Normal file → Executable file
View File

0
templates/security/login.html.twig Normal file → Executable file
View File

0
tests/bootstrap.php Normal file → Executable file
View File

0
translations/.gitignore vendored Normal file → Executable file
View File

0
uploads/.gitkeep Normal file → Executable file
View File