first commit

This commit is contained in:
2025-04-09 20:38:48 +02:00
commit f8addc15f4
116 changed files with 17614 additions and 0 deletions

18
config/bundles.php Normal file
View File

@ -0,0 +1,18 @@
<?php
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
Symfony\UX\Turbo\TurboBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Oneup\UploaderBundle\OneupUploaderBundle::class => ['all' => true],
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
];

220
config/nineconfig/dicos.yml Normal file
View File

@ -0,0 +1,220 @@
global:
id: global
label: Global
style: col-md-12
vars:
APP_ENV:
id: APP_ENV
label: Type d'environnement
source: env/.env
type: choice
choices: "PROD,DEV"
required: true
WEB_URL:
id: WEB_URL
label: Hostname
source: env/.env
type: text
required: true
PROTOCOLE:
id: PROTOCOLE
label: Protocole
source: env/.env
type: choice
choices: "http,https"
required: true
REDIRECT_PATH:
id: REDIRECT_PATH
label: Redirection par défaut
source: env/.env
type: text
required: false
authentification:
id: authentification
label: Authentification
style: col-md-12
vars:
MODE_AUTH:
id: MODE_AUTH
label: Mode d'Authentification
source: env/.env
type: choice
choices: "SQL,CAS"
required: true
master: modeauth
KEYCLOAK_ACTIVATE:
id: KEYCLOAK_ACTIVATE
label: Activer Keycloak
source: env/.env
type: bool
required: true
master: keycloakactive
slave: modeauth=CAS
CAS_HOST:
id: CAS_HOST
label: Host du serveur CAS
source: env/.env
type: string
required: true
slave: modeauth=CAS
CAS_PORT:
id: CAS_PORT
label: Port du serveur CAS
source: env/.env
type: string
required: true
slave: modeauth=CAS
CAS_PATH:
id: CAS_PATH
label: Path du serveur CAS
source: env/.env
type: string
required: true
slave: modeauth=CAS
admin:
id: admin
label: Compte Administrateur
style: col-md-12
vars:
ADMIN_USER:
id: ADMIN_USER
label: Login du compte administrateur
source: env/.env
type: text
required: true
KEYCLOAK_USER:
id: KEYCLOAK_USER
label: Login de Keycloak
source: env/.env
type: string
required: true
slave: keycloakactive=1
ADMIN_EMAIL:
id: ADMIN_EMAIL
label: Email du compte administrateur
source: env/.env
type: text
required: true
# password:
# CAS_PASSWORD=${ADMIN_PASSWORD}-keycloak
applications:
id: applications
label: Applications
style: col-md-12
vars:
KOMGA_ACTIVATE:
id: KOMGA_ACTIVATE
label: Activer Komga
source: env/.env
type: bool
required: true
master: komgaactivate
NINEBOARD_ACTIVATE:
id: NINEBOARD_ACTIVATE
label: Activer Nineboard
source: env/.env
type: bool
required: true
master: nineboardactivate
NINECOMPTA_ACTIVATE:
id: NINECOMPTA_ACTIVATE
label: Activer Ninecompta
source: env/.env
type: bool
required: true
master: ninecomptaactivate
NINEFOLIO_ACTIVATE:
id: NINEFOLIO_ACTIVATE
label: Activer Ninefolio
source: env/.env
type: bool
required: true
master: ninefolioactivate
komga:
id: komga
label: Komga
style: col-md-6
vars:
KOMGA_LOCAL:
id: KOMGA_LOCAL
label: Komba local
source: env/.env
type: bool
required: true
slave: komgaactivate=1
master: komgalocal
KOMGA_URL:
id: KOMGA_URL
label: Url du Komga distant
source: env/.env
type: text
required: true
slave: komgalocal=0
nineboard:
id: nineboard
label: Nineboard
style: col-md-6
vars:
NINEBOARD_LOCAL:
id: NINEBOARD_LOCAL
label: Nineboard local
source: env/.env
type: bool
required: true
slave: nineboardactivate=1
master: nineboardlocal
NINEBOARD_URL:
id: NINEBOARD_URL
label: Url du Nineboard distant
source: env/.env
type: text
required: true
slave: nineboardlocal=0
ninecompta:
id: ninecompta
label: Ninecompta
style: col-md-6
vars:
NINECOMPTA_LOCAL:
id: NINECOMPTA_LOCAL
label: Ninecompta local
source: env/.env
type: bool
required: true
slave: ninecomptaactivate=1
master: ninecomptalocal
NINECOMPTA_URL:
id: NINECOMPTA_URL
label: Url du Ninecompta distant
source: env/.env
type: text
required: true
slave: ninecomptalocal=0
ninefolio:
id: ninefolio
label: Ninefolio
style: col-md-6
vars:
NINEFOLIO_LOCAL:
id: NINEFOLIO_LOCAL
label: Ninefolio local
source: env/.env
type: bool
required: true
slave: ninefolioactivate=1
master: ninefoliolocal
NINEFOLIO_URL:
id: NINEFOLIO_URL
label: Url du Ninefolio distant
source: env/.env
type: text
required: true
slave: ninefoliolocal=0

View File

@ -0,0 +1,19 @@
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name
# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:
# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu
# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null

View File

@ -0,0 +1,5 @@
when@dev:
debug:
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
# See the "server:dump" command to start a new server.
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"

View File

@ -0,0 +1,54 @@
doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '16'
profiling_collect_backtrace: '%kernel.debug%'
use_savepoints: true
orm:
auto_generate_proxy_classes: true
enable_lazy_ghost_objects: true
report_fields_where_declared: true
validate_xml_mapping: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
identity_generation_preferences:
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
auto_mapping: true
mappings:
App:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
controller_resolver:
auto_mapping: false
when@test:
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
when@prod:
doctrine:
orm:
auto_generate_proxy_classes: false
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool
framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system

View File

@ -0,0 +1,6 @@
doctrine_migrations:
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
'DoctrineMigrations': '%kernel.project_dir%/migrations'
enable_profiler: false

View File

@ -0,0 +1,15 @@
# Read the documentation: https://fosrestbundle.readthedocs.io/en/3.x/
fos_rest:
# param_fetcher_listener: true
# allowed_methods_listener: true
routing_loader: false
# view:
# view_response_listener: true
# exception:
# codes:
# App\Exception\MyException: 403
# messages:
# App\Exception\MyException: Forbidden area.
# format_listener:
# rules:
# - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, html ] }

View File

@ -0,0 +1,16 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
# Note that the session will be started ONLY if you read or write from it.
session: true
#esi: true
#fragments: true
when@test:
framework:
test: true
session:
storage_factory_id: session.storage.factory.mock_file

View File

@ -0,0 +1,3 @@
framework:
mailer:
dsn: '%env(MAILER_DSN)%'

View File

@ -0,0 +1,29 @@
framework:
messenger:
failure_transport: failed
transports:
# https://symfony.com/doc/current/messenger.html#transport-configuration
async:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
use_notify: true
check_delayed_interval: 60000
retry_strategy:
max_retries: 3
multiplier: 2
failed: 'doctrine://default?queue_name=failed'
# sync: 'sync://'
default_bus: messenger.bus.default
buses:
messenger.bus.default: []
routing:
Symfony\Component\Mailer\Messenger\SendEmailMessage: async
Symfony\Component\Notifier\Message\ChatMessage: async
Symfony\Component\Notifier\Message\SmsMessage: async
# Route your messages to the transports
# 'App\Message\YourMessage': async

View File

@ -0,0 +1,62 @@
monolog:
channels:
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists
when@dev:
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]
when@test:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
channels: ["!event"]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
when@prod:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: stream
path: php://stderr
level: debug
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
channels: [deprecation]
path: php://stderr
formatter: monolog.formatter.json

View File

@ -0,0 +1,12 @@
framework:
notifier:
chatter_transports:
texter_transports:
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
urgent: ['email']
high: ['email']
medium: ['email']
low: ['email']
admin_recipients:
- { email: admin@example.com }

View File

@ -0,0 +1,6 @@
oneup_uploader:
mappings:
avatar:
frontend: dropzone
logo:
frontend: dropzone

View File

@ -0,0 +1,10 @@
framework:
router:
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
when@prod:
framework:
router:
strict_requirements: null

View File

@ -0,0 +1,42 @@
security:
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: "auto"
providers:
sql_provider:
entity:
class: App\Entity\User
property: username
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
provider: sql_provider
custom_authenticators:
- App\Security\DynamicAuthenticator
form_login:
login_path: app_login
check_path: app_login
enable_csrf: true
default_target_path: /
logout:
path: app_logout
access_control:
- { path: ^/login, roles: PUBLIC_ACCESS }
- { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/, roles: ROLE_USER }
when@test:
security:
password_hashers:
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

View File

@ -0,0 +1,7 @@
framework:
default_locale: en
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:
- en
providers:

View File

@ -0,0 +1,9 @@
twig:
file_name_pattern: "*.twig"
form_themes: ['bootstrap_5_layout.html.twig']
globals:
appName: "%appName%"
when@test:
twig:
strict_variables: true

View File

@ -0,0 +1,11 @@
framework:
validation:
# Enables validator auto-mapping support.
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
#auto_mapping:
# App\Entity\: []
when@test:
framework:
validation:
not_compromised_password: false

View File

@ -0,0 +1,17 @@
when@dev:
web_profiler:
toolbar: true
intercept_redirects: false
framework:
profiler:
only_exceptions: false
collect_serializer_data: true
when@test:
web_profiler:
toolbar: false
intercept_redirects: false
framework:
profiler: { collect: false }

5
config/preload.php Normal file
View File

@ -0,0 +1,5 @@
<?php
if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}

5
config/routes.yaml Normal file
View File

@ -0,0 +1,5 @@
controllers:
resource:
path: ../src/Controller/
namespace: App\Controller
type: attribute

View File

@ -0,0 +1,4 @@
when@dev:
_errors:
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error

View File

@ -0,0 +1,3 @@
oneup_uploader:
resource: .
type: uploader

View File

@ -0,0 +1,3 @@
_security_logout:
resource: security.route_loader.logout
type: service

View File

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

30
config/services.yaml Normal file
View File

@ -0,0 +1,30 @@
parameters:
appEnv: "%env(resolve:APP_ENV)%"
appSecret: "%env(resolve:APP_SECRET)%"
appName: "%env(resolve:APP_NAME)%"
appNoreply: "%env(resolve:APP_NOREPLY)%"
modeAuth: "%env(resolve:MODE_AUTH)%"
casHost: "%env(resolve:CAS_HOST)%"
casPort: "%env(resolve:CAS_PORT)%"
casPath: "%env(resolve:CAS_PATH)%"
casUsername: "%env(resolve:CAS_USERNAME)%"
casMail: "%env(resolve:CAS_MAIL)%"
casLastname: "%env(resolve:CAS_LASTNAME)%"
casFirstname: "%env(resolve:CAS_FIRSTNAME)%"
services:
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
App\:
resource: "../src/"
exclude:
- "../src/DependencyInjection/"
- "../src/Entity/"
- "../src/Kernel.php"
App\Security\DynamicAuthenticator:
arguments:
$modeAuth: '%env(MODE_AUTH)%'