update
This commit is contained in:
10
projects/priceservice/config/bundles.php
Normal file
10
projects/priceservice/config/bundles.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
];
|
||||
25
projects/priceservice/config/mitho/settings.yaml
Normal file
25
projects/priceservice/config/mitho/settings.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
parameters:
|
||||
mitho:
|
||||
api:
|
||||
expiredMaxTime: 3600
|
||||
maxPriceAge: 300
|
||||
priceListLimit: 2500
|
||||
cacheExpTime: 300
|
||||
cacheIsActive: true
|
||||
cacheNamespaces:
|
||||
rawData: 'price.data.raw'
|
||||
rawDataDiffSteps: 'price.data.diffSteps'
|
||||
rawDataWithArticle: 'price.data.withArticle'
|
||||
|
||||
import:
|
||||
orm:
|
||||
url: '%env(MTO_ORM_IMPORT_ENDPOINT_URL)%'
|
||||
urlBckp1: '%env(MTO_ORM_IMPORT_ENDPOINT_URL_BACKUP1)%'
|
||||
urlBckp2: '%env(MTO_ORM_IMPORT_ENDPOINT_URL_BACKUP2)%'
|
||||
user: '%env(MTO_ORM_IMPORT_USER)%'
|
||||
pwd: '%env(MTO_ORM_IMPORT_PWD)%'
|
||||
shopIds: [ 1,3,4,8 ]
|
||||
chunksize: 500
|
||||
maxPriceAge: 240
|
||||
maxTimeStampAgeSpan: 360
|
||||
cashPriceStep: 13
|
||||
6
projects/priceservice/config/packages/cache.yaml
Normal file
6
projects/priceservice/config/packages/cache.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
framework:
|
||||
cache:
|
||||
pools:
|
||||
cache.rate_limiter:
|
||||
adapter: cache.adapter.redis
|
||||
provider: '%env(REDIS_CACHE_URL)%'
|
||||
61
projects/priceservice/config/packages/doctrine.yaml
Normal file
61
projects/priceservice/config/packages/doctrine.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
doctrine:
|
||||
dbal:
|
||||
url: '%env(resolve:DATABASE_URL)%'
|
||||
server_version: '8.0' # oder 'mariadb-10.5' – je nach verwendeter DB
|
||||
charset: utf8mb4
|
||||
default_table_options:
|
||||
charset: utf8mb4
|
||||
collate: utf8mb4_unicode_ci
|
||||
|
||||
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
|
||||
|
||||
controller_resolver:
|
||||
auto_mapping: false
|
||||
|
||||
mappings:
|
||||
App:
|
||||
type: attribute
|
||||
is_bundle: false
|
||||
dir: '%kernel.project_dir%/src/Entity'
|
||||
prefix: 'App\Entity'
|
||||
alias: App
|
||||
|
||||
when@test:
|
||||
doctrine:
|
||||
dbal:
|
||||
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
|
||||
|
||||
when@prod:
|
||||
doctrine:
|
||||
dbal:
|
||||
server_version: '8.0' # Prod explizit deklarieren
|
||||
charset: utf8mb4
|
||||
default_table_options:
|
||||
charset: utf8mb4
|
||||
collate: utf8mb4_unicode_ci
|
||||
|
||||
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
|
||||
@@ -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
|
||||
25
projects/priceservice/config/packages/framework.yaml
Normal file
25
projects/priceservice/config/packages/framework.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
||||
framework:
|
||||
secret: '%env(APP_SECRET)%'
|
||||
#csrf_protection: true
|
||||
annotations: false
|
||||
http_method_override: false
|
||||
handle_all_throwables: true
|
||||
|
||||
# Enables session support. Note that the session will ONLY be started if you read or write from it.
|
||||
# Remove or comment this section to explicitly disable session support.
|
||||
session:
|
||||
handler_id: null
|
||||
cookie_secure: auto
|
||||
cookie_samesite: lax
|
||||
|
||||
#esi: true
|
||||
#fragments: true
|
||||
php_errors:
|
||||
log: true
|
||||
|
||||
when@test:
|
||||
framework:
|
||||
test: true
|
||||
session:
|
||||
storage_factory_id: session.storage.factory.mock_file
|
||||
2
projects/priceservice/config/packages/lock.yaml
Normal file
2
projects/priceservice/config/packages/lock.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
framework:
|
||||
lock: '%env(LOCK_DSN)%'
|
||||
13
projects/priceservice/config/packages/messenger.yaml
Normal file
13
projects/priceservice/config/packages/messenger.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
framework:
|
||||
messenger:
|
||||
default_bus: messenger.bus.default
|
||||
transports:
|
||||
async:
|
||||
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
|
||||
options:
|
||||
stream: messages
|
||||
stream_max_entries: 100
|
||||
retry_strategy:
|
||||
max_retries: 3
|
||||
routing:
|
||||
'App\Message\TriggerPriceImport': async
|
||||
48
projects/priceservice/config/packages/monolog.yaml
Normal file
48
projects/priceservice/config/packages/monolog.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
monolog:
|
||||
channels:
|
||||
- deprecation
|
||||
handlers:
|
||||
file_log:
|
||||
type: rotating_file
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: error
|
||||
|
||||
when@dev:
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: stream
|
||||
path: '%kernel.logs_dir%/dev.log'
|
||||
level: debug
|
||||
channels: ['!event']
|
||||
|
||||
deprecation:
|
||||
type: stream
|
||||
path: '%kernel.logs_dir%/deprecations.log'
|
||||
level: info
|
||||
channels: [deprecation]
|
||||
|
||||
stdout:
|
||||
type: stream
|
||||
path: php://stdout
|
||||
level: debug
|
||||
channels: ['!event']
|
||||
|
||||
when@prod:
|
||||
monolog:
|
||||
handlers:
|
||||
file:
|
||||
type: rotating_file
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: info
|
||||
channels: ['!event']
|
||||
formatter: monolog.formatter.line
|
||||
|
||||
deprecation:
|
||||
type: rotating_file
|
||||
path: '%kernel.logs_dir%/deprecations.log'
|
||||
level: warning
|
||||
channels: [deprecation]
|
||||
|
||||
|
||||
|
||||
6
projects/priceservice/config/packages/rate_limiter.yaml
Normal file
6
projects/priceservice/config/packages/rate_limiter.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
framework:
|
||||
rate_limiter:
|
||||
price_import:
|
||||
policy: fixed_window
|
||||
limit: 1
|
||||
interval: '10 seconds'
|
||||
12
projects/priceservice/config/packages/routing.yaml
Normal file
12
projects/priceservice/config/packages/routing.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
framework:
|
||||
router:
|
||||
utf8: true
|
||||
|
||||
# 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
|
||||
15
projects/priceservice/config/packages/security.yaml
Normal file
15
projects/priceservice/config/packages/security.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
security:
|
||||
role_hierarchy:
|
||||
ROLE_ADMIN: [ ROLE_PRICES, ROLE_USER ]
|
||||
|
||||
password_hashers:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
firewalls:
|
||||
dev:
|
||||
main:
|
||||
access_control:
|
||||
# api
|
||||
- { path: ^/api/prices, roles: [ PUBLIC_ACCESS ], ips: '%env(MTO_ALLOWED_API_IPS)%' }
|
||||
- { path: ^/api/prices, roles: [ ROLE_NO_ACCESS ] }
|
||||
#- { path: ^/trigger-import, roles: [ PUBLIC_ACCESS ], ips: '%env(MTO_ALLOWED_IMPORT_TRIGGER_IPS)%'}
|
||||
#- { path: ^/trigger-import, roles: [ ROLE_NO_ACCESS ]}
|
||||
4
projects/priceservice/config/packages/uid.yaml
Normal file
4
projects/priceservice/config/packages/uid.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
framework:
|
||||
uid:
|
||||
default_uuid_version: 7
|
||||
time_based_uuid_version: 7
|
||||
5
projects/priceservice/config/preload.php
Normal file
5
projects/priceservice/config/preload.php
Normal 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
projects/priceservice/config/routes.yaml
Normal file
5
projects/priceservice/config/routes.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
controllers:
|
||||
resource:
|
||||
path: ../src/Controller/
|
||||
namespace: App\Controller
|
||||
type: attribute
|
||||
4
projects/priceservice/config/routes/framework.yaml
Normal file
4
projects/priceservice/config/routes/framework.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
when@dev:
|
||||
_errors:
|
||||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
||||
prefix: /_error
|
||||
3
projects/priceservice/config/routes/security.yaml
Normal file
3
projects/priceservice/config/routes/security.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
_security_logout:
|
||||
resource: security.route_loader.logout
|
||||
type: service
|
||||
32
projects/priceservice/config/services.yaml
Normal file
32
projects/priceservice/config/services.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
# This file is the entry point to configure your own services.
|
||||
# Files in the packages/ subdirectory configure your dependencies.
|
||||
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
||||
parameters:
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
_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\Service\Prices\RedisImportService:
|
||||
arguments:
|
||||
$calledShopIds: '%mitho.import.orm.shopIds%'
|
||||
$cashPriceStep: '%mitho.import.orm.cashPriceStep%'
|
||||
|
||||
App\MessageHandler\TriggerPriceImportHandler:
|
||||
public: true
|
||||
arguments:
|
||||
$importService: '@App\Service\Prices\RedisImportService'
|
||||
tags:
|
||||
- name: 'messenger.message_handler'
|
||||
handles: 'App\Message\TriggerPriceImport'
|
||||
Reference in New Issue
Block a user