diff --git a/.env.prod b/.env.prod index 8875448..1035801 100644 --- a/.env.prod +++ b/.env.prod @@ -1 +1,38 @@ -DATABASE_URL="mysql://eglfbugcundo2:Kryska10@eglfbugcundo2.mysql.db:3306/eglfbugcundo2?serverVersion=8.0&charset=utf8mb4" +DATABASE_URL="mysql://egflbugcundo2:Kryska10@egflbugcundo2.mysql.db:3306/egflbugcundo2" + + + +###> symfony/framework-bundle ### +APP_ENV=prod +APP_DEBUG=1 +APP_SECRET=change_me +APP_SHARE_DIR=var/share +###< symfony/framework-bundle ### +APP_SECRET=789cb87ecb8b846d8d1601ca3ee393a7 +###> symfony/routing ### +# 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=https://backport.varascundo.com +###< symfony/routing ### + +###> doctrine/doctrine-bundle ### +# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url +# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml +# + +###> app/admin ### +ADMIN_EMAIL=cundo@gmail.com +ADMIN_PASSWORD=kryska10 +ADMIN_API_TOKEN=un_vrai_token_secret_ici_123abc +###< app/admin ### + +###> app/skills-snapshot ### +GITHUB_USERNAME=cundovar +GITHUB_TOKEN=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 +OPENAI_API_KEY=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 +OPENAI_MODEL=gpt-4o-mini +OPENAI_SUMMARY_MAX_WORDS=90 +OPENAI_BULLETIN_MAX_WORDS=60 +OPENAI_BULLETIN_STYLE="technique + progres" +###< app/skills-snapshot ### + diff --git a/config/packages/cache.yaml b/config/packages/cache.yaml deleted file mode 100644 index 6899b72..0000000 --- a/config/packages/cache.yaml +++ /dev/null @@ -1,19 +0,0 @@ -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 diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index 1b5b74e..9f6afd8 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -2,8 +2,10 @@ doctrine: dbal: url: '%env(resolve:DATABASE_URL)%' - profiling_collect_backtrace: '%kernel.debug%' - use_savepoints: true + # IMPORTANT: You MUST configure your server version, + # either here or in the DATABASE_URL env var. + # server_version: '16' + orm: auto_generate_proxy_classes: true enable_lazy_ghost_objects: true @@ -18,31 +20,3 @@ doctrine: 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 diff --git a/config/packages/doctrine_migrations.yaml b/config/packages/doctrine_migrations.yaml index 29231d9..c4a193b 100644 --- a/config/packages/doctrine_migrations.yaml +++ b/config/packages/doctrine_migrations.yaml @@ -1,6 +1,4 @@ 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 diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml deleted file mode 100644 index 7e1ee1f..0000000 --- a/config/packages/framework.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# see https://symfony.com/doc/current/reference/configuration/framework.html -framework: - secret: '%env(APP_SECRET)%' - - # 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 diff --git a/config/packages/property_info.yaml b/config/packages/property_info.yaml deleted file mode 100644 index dd31b9d..0000000 --- a/config/packages/property_info.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - property_info: - with_constructor_extractor: true diff --git a/config/packages/routing.yaml b/config/packages/routing.yaml deleted file mode 100644 index 0f34f87..0000000 --- a/config/packages/routing.yaml +++ /dev/null @@ -1,10 +0,0 @@ -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: '%env(DEFAULT_URI)%' - -when@prod: - framework: - router: - strict_requirements: null diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 8964044..1d469ad 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -1,39 +1,18 @@ security: - # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords password_hashers: Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto' - # https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider providers: - users_in_memory: { memory: null } + app_user_provider: + memory: null firewalls: dev: - # Ensure dev tools and static assets are always allowed - pattern: ^/(_profiler|_wdt|assets|build)/ + pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: lazy: true - provider: users_in_memory + provider: app_user_provider - # Activate different ways to authenticate: - # https://symfony.com/doc/current/security.html#the-firewall - - # https://symfony.com/doc/current/security/impersonating_user.html - # switch_user: true - - # Note: Only the *first* matching rule is applied access_control: - # - { path: ^/admin, roles: ROLE_ADMIN } - # - { path: ^/profile, roles: ROLE_USER } - -when@test: - security: - password_hashers: - # Password hashers are resource-intensive by design to ensure security. - # In tests, it's safe to reduce their cost to improve performance. - 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 + - { path: ^/, roles: PUBLIC_ACCESS } diff --git a/config/packages/validator.yaml b/config/packages/validator.yaml deleted file mode 100644 index dd47a6a..0000000 --- a/config/packages/validator.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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 diff --git a/config/reference.php b/config/reference.php index e42e7e6..ecb3e41 100644 --- a/config/reference.php +++ b/config/reference.php @@ -1254,11 +1254,6 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * }>, * role_hierarchy?: array>, * } - * @psalm-type MakerConfig = array{ - * root_namespace?: scalar|null|Param, // Default: "App" - * generate_final_classes?: bool|Param, // Default: true - * generate_final_entities?: bool|Param, // Default: false - * } * @psalm-type ConfigType = array{ * imports?: ImportsConfig, * parameters?: ParametersConfig, @@ -1275,7 +1270,6 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * doctrine?: DoctrineConfig, * doctrine_migrations?: DoctrineMigrationsConfig, * security?: SecurityConfig, - * maker?: MakerConfig, * }, * "when@prod"?: array{ * imports?: ImportsConfig, @@ -1286,15 +1280,6 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param; * doctrine_migrations?: DoctrineMigrationsConfig, * security?: SecurityConfig, * }, - * "when@test"?: array{ - * imports?: ImportsConfig, - * parameters?: ParametersConfig, - * services?: ServicesConfig, - * framework?: FrameworkConfig, - * doctrine?: DoctrineConfig, - * doctrine_migrations?: DoctrineMigrationsConfig, - * security?: SecurityConfig, - * }, * ..., * "when@prod"?: array, - * "when@test"?: array, * ... * } */ diff --git a/public/.htaccess b/public/.htaccess index 644ff9e..2c0993e 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -8,13 +8,17 @@ - RewriteEngine On + RewriteEngine On - # Handle preflight OPTIONS - return 200 immediately - RewriteCond %{REQUEST_METHOD} OPTIONS - RewriteRule ^(.*)$ $1 [R=200,L] + # Pass Authorization header to PHP + RewriteCond %{HTTP:Authorization} . + RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] - # Redirect to front controller - RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^(.*)$ index.php [QSA,L] + # Handle preflight OPTIONS - return 200 immediately + RewriteCond %{REQUEST_METHOD} OPTIONS + RewriteRule ^(.*)$ $1 [R=200,L] + + # Redirect to front controller + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^(.*)$ index.php [QSA,L]