]> Raphaël G. Git Repositories - blogbundle/blob - Resources/config/packages/rapsys_blog.yaml
b57fc12536cc31a40db91da9c08dd6ab9d6d1a18
[blogbundle] / Resources / config / packages / rapsys_blog.yaml
1 # Dev log configuration
2 #TODO: set mail, calendar and facebook app id as env variables ???
3 rapsys_blog:
4 contact:
5 address: 'blog@rapsys.eu'
6 name: 'Raphaël Gertz'
7 copy:
8 by: 'Rapsys'
9 link: 'https://rapsys.eu'
10 long: 'All rights reserved'
11 short: 'Copyright 2019-2023'
12 title: 'By Raphaël'
13 donate: 'https://paypal.me/milongaraphael'
14 facebook:
15 #TODO: set this as env variables ???
16 apps: [ 3728770287223690 ]
17 height: 630
18 width: 1200
19 icon:
20 ico: '@RapsysBlog/ico/icon.ico'
21 png:
22 # Default
23 256: '@RapsysBlog/png/icon.256.png'
24
25 # For google
26 # Chrome for Android home screen icon
27 196: '@RapsysBlog/png/icon.196.png'
28 # Google Developer Web App Manifest Recommendation
29 192: '@RapsysBlog/png/icon.192.png'
30 # Chrome Web Store icon
31 128: '@RapsysBlog/png/icon.128.png'
32
33 # Fallback
34 32: '@RapsysBlog/png/icon.32.png'
35
36 # For apple
37 # XXX: old obsolete format: [57, 72, 76, 114, 120, 144]
38 # XXX: see https://webhint.io/docs/user-guide/hints/hint-apple-touch-icons/
39 # XXX: see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
40 # iPhone Retina
41 180: '@RapsysBlog/png/icon.180.png'
42 # iPad Retina touch icon
43 167: '@RapsysBlog/png/icon.167.png'
44 # iPad touch icon
45 152: '@RapsysBlog/png/icon.152.png'
46 # iOS7
47 120: '@RapsysBlog/png/icon.120.png'
48
49 # For windows
50 # XXX: see https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn255024(v=vs.85)
51 310: '@RapsysBlog/png/icon.310.png'
52 150: '@RapsysBlog/png/icon.150.png'
53 70: '@RapsysBlog/png/icon.70.png'
54 svg: '@RapsysBlog/svg/icon.svg'
55 languages:
56 en_gb: 'English'
57 fr_fr: 'French'
58 locale: 'fr_fr'
59 locales: [ 'fr_fr', 'en_gb' ]
60 logo:
61 alt: 'Rapsys'' dev log logo'
62 png: '@RapsysBlog/png/logo.png'
63 svg: '@RapsysBlog/svg/logo.svg'
64 root: 'rapsys_blog'
65 title: 'Rapsys'' dev log'
66
67 #RapsysUser configuration
68 rapsys_user:
69 #Class replacement
70 class:
71 group: 'Rapsys\BlogBundle\Entity\Group'
72 civility: 'Rapsys\BlogBundle\Entity\Civility'
73 user: 'Rapsys\BlogBundle\Entity\User'
74 #Default replacement
75 default:
76 admin: 'ROLE_ADMIN'
77 civility: 'Mister'
78 group: [ 'User' ]
79 #Route replacement
80 route:
81 index:
82 name: 'rapsys_blog'
83 register:
84 name: 'rapsys_user_register'
85 #Translate replacement
86 translate: [ 'title', 'password', 'copy.by', 'copy.long', 'copy.short', 'copy.title', 'head.logo.alt', 'head.site' ]
87 #Languages replacement
88 languages: '%rapsys_blog.languages%'
89 #Contact replacement
90 contact: '%rapsys_blog.contact%'
91 #Context replacement
92 context:
93 copy: '%rapsys_blog.copy%'
94 head:
95 icon: '%rapsys_blog.icon%'
96 logo: '%rapsys_blog.logo%'
97 root: '%rapsys_blog.root%'
98 site: '%rapsys_blog.title%'
99 #Edit replacement
100 edit:
101 #field:
102 #mail: false
103 #password: false
104 #pseudonym: false
105 #slug: false
106 route:
107 index: 'root'
108 view:
109 edit: 'Rapsys\BlogBundle\Form\EditType'
110 name: '@RapsysBlog/form/edit.html.twig'
111 context:
112 title: 'Modify account'
113 password: 'Modify password'
114 #Index replacement
115 index:
116 route:
117 index: 'root'
118 view:
119 name: '@RapsysBlog/user/index.html.twig'
120 context:
121 title: 'User list'
122 #Login replacement
123 login:
124 route:
125 index: 'root'
126 view:
127 name: '@RapsysBlog/form/login.html.twig'
128 context:
129 title: 'Login'
130 #Recover replacement
131 recover:
132 route:
133 index: 'root'
134 recover: 'recover_url'
135 view:
136 name: '@RapsysBlog/form/recover.html.twig'
137 context:
138 title: 'Recover'
139 mail:
140 subject: 'Welcome back %%recipient_name%% to %%head.site%%'
141 html: '@RapsysBlog/mail/recover.html.twig'
142 text: '@RapsysBlog/mail/recover.text.twig'
143 context:
144 #Register replacement
145 register:
146 field:
147 pseudonym: false
148 slug: false
149 route:
150 index: 'root'
151 confirm: 'confirm_url'
152 view:
153 form: 'Rapsys\BlogBundle\Form\RegisterType'
154 name: '@RapsysBlog/form/register.html.twig'
155 context:
156 title: 'Register'
157 mail:
158 subject: 'Welcome %%recipient_name%% to %%head.site%%'
159 html: '@RapsysBlog/mail/register.html.twig'
160 text: '@RapsysBlog/mail/register.text.twig'
161 context:
162
163 # Doctrine configuration
164 doctrine:
165 # Orm configuration
166 orm:
167 # Replace repository factory
168 repository_factory: 'Rapsys\BlogBundle\Factory\RepositoryFactory'
169
170 #Force resolution of UserBundle entities to BlogBundle one
171 #XXX: without these lines, relations are lookup in parent namespace ignoring BlogBundle extension
172 resolve_target_entities:
173 Rapsys\UserBundle\Entity\Group: 'Rapsys\BlogBundle\Entity\Group'
174 Rapsys\UserBundle\Entity\Civility: 'Rapsys\BlogBundle\Entity\Civility'
175 Rapsys\UserBundle\Entity\User: 'Rapsys\BlogBundle\Entity\User'
176
177 # Framework configuration
178 framework:
179 default_locale: '%rapsys_blog.locale%'
180 disallow_search_engine_index: false
181 #error_controller: 'Rapsys\BlogBundle\Controller\ErrorController::show'
182 mailer:
183 headers:
184 X-Originating-IP: '%env(REMOTE_ADDR)%'
185 secret: '%env(APP_SECRET)%'
186 #csrf_protection: true
187 session:
188 enabled: true
189 handler_id: ~
190 storage_factory_id: 'session.storage.factory.native'
191 cookie_secure: 'auto'
192 cookie_samesite: 'lax'
193 translator:
194 fallbacks: '%rapsys_blog.locales%'
195
196 # Security configuration
197 security:
198 # Set password hashers
199 password_hashers:
200 #XXX: comment this key in config/security.yaml to prevent users_in_memory induced failures
201 #TODO: see https://symfony.com/doc/current/security/passwords.html (sodium ? + upgrade)
202 Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
203 algorithm: 'bcrypt'
204 migrate_from:
205 - 'plaintext'
206
207 # Set providers
208 providers:
209 database:
210 entity:
211 class: Rapsys\BlogBundle\Entity\User
212 property: mail
213
214 # Set firewall
215 firewalls:
216 # Disables authentication for assets and the profiler, adapt it according to your needs
217 dev:
218 pattern: ^/(_(profiler|wdt)|css|images|js)/
219 security: false
220
221 main:
222 # Allow anonymous access
223 #anonymous: ~
224 #lazy: true
225
226 # Activate database provider
227 #XXX: comment this key in config/security.yaml to prevent users_in_memory induced failures
228 provider: database
229
230 # Activate user checker
231 user_checker: 'security.user_checker'
232
233 #XXX: https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
234 #http_basic: ~
235
236 # Set form login
237 #XXX: https://symfony.com/doc/current/security/form_login_setup.html
238 #TODO: https://symfony.com/doc/current/security/guard_authentication.html
239 form_login:
240 # Redirect to referer if different from login route
241 use_referer: true
242 # Login path
243 login_path: rapsys_user_login
244 # Check path
245 check_path: rapsys_user_login
246 # Username parameter
247 username_parameter: 'login[mail]'
248 # Password parameter
249 password_parameter: 'login[password]'
250 # Enable login csrf protection
251 #TODO: enable in framework now that it works here ?
252 enable_csrf: false
253 # Csrf parameter
254 csrf_parameter: 'login[_token]'
255 # Csrf id
256 csrf_token_id: 'login'
257
258 # Set logout route
259 logout:
260 # Logout route
261 path: rapsys_user_logout
262 # Logout default target
263 target: rapsys_blog
264
265 # Set custom access denied handler
266 #access_denied_handler: Rapsys\BlogBundle\Handler\AccessDeniedHandler
267
268 # Remember me
269 #XXX: see https://symfony.com/doc/current/security/remember_me.html
270 remember_me:
271 # Use APP_SECRET
272 secret: '%kernel.secret%'
273 # Always remember me
274 always_remember_me: true
275
276 # Set role hierarchy
277 role_hierarchy:
278 ROLE_USER: [ 'ROLE_GUEST' ]
279 ROLE_ADMIN: [ 'ROLE_GUEST', 'ROLE_USER' ]
280
281 #Service configuration
282 services:
283 #Register abstract controller
284 Rapsys\BlogBundle\Controller\AbstractController:
285 arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
286 tags: [ 'controller.service_arguments' ]
287 #Register article controller
288 Rapsys\BlogBundle\Controller\ArticleController:
289 arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
290 tags: [ 'controller.service_arguments' ]
291 #Register default controller
292 Rapsys\BlogBundle\Controller\DefaultController:
293 arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
294 tags: [ 'controller.service_arguments' ]
295 #Register keyword controller
296 Rapsys\BlogBundle\Controller\KeywordController:
297 arguments: [ '@security.authorization_checker', '@service_container', '@rapsys_user.access_decision_manager', '@doctrine', '@rapsys_pack.facebook_util', '@form.factory', '@rapsys_pack.image_util', '@mailer.mailer', '@doctrine.orm.default_entity_manager', '@rapsys_pack.path_package', '@router', '@rapsys_pack.slugger_util', '@security.helper', '@request_stack', '@translator', '@twig' ]
298 tags: [ 'controller.service_arguments' ]
299 Rapsys\BlogBundle\Factory\RepositoryFactory:
300 arguments: [ '@request_stack', '@router', '@rapsys_pack.slugger_util', '@translator', '%rapsys_blog.languages%', '%rapsys_blog.locale%' ]
301 #Register blog fixture
302 Rapsys\BlogBundle\Fixture\BlogFixture:
303 arguments: [ '@rapsys_pack.slugger_util' ]
304 tags: [ 'doctrine.fixture.orm' ]
305 #Register form factory as public
306 form.factory:
307 class: 'Symfony\Component\Form\FormFactory'
308 arguments: [ '@form.registry' ]
309 public: true
310 #Register facebook event subscriber
311 Rapsys\PackBundle\Subscriber\FacebookSubscriber:
312 arguments: [ '@router', '%rapsys_blog.locales%' ]
313 tags: [ 'kernel.event_subscriber' ]
314 #Register facebook util service
315 rapsys_blog.facebook_util:
316 class: 'Rapsys\PackBundle\Util\FacebookUtil'
317 #TODO: create the facebook.png file and add the fonts
318 #TODO: add a default font
319 arguments: [ '@router', '%kernel.project_dir%/var/cache', '%rapsys_pack.path%', 'facebook', '%rapsys_blog.path%/png/facebook.png', { irishgrover: '%rapsys_blog.path%/ttf/irishgrover.v10.ttf', labelleaurore: '%rapsys_blog.path%/ttf/labelleaurore.v10.ttf', dejavusans: '%rapsys_blog.path%/ttf/dejavusans.2.37.ttf', droidsans: '%rapsys_blog.path%/ttf/droidsans.regular.ttf' } ]
320 public: true
321 #Register contact form type
322 Rapsys\BlogBundle\Form\ContactType:
323 arguments: [ '@rapsys_pack.image_util', '@rapsys_pack.slugger_util', '@translator' ]
324 tags: [ 'form.type' ]
325
326 # Twig configuration
327 twig:
328 #Enforce debug
329 debug: true
330 #auto_reload: ~
331 #Disable cache
332 #XXX: enable forced regeneration of css and js at each page load
333 cache: false
334 #Fix form layout for css
335 #XXX: @RapsysBlog is a shortcut to vendor/rapsys/blogbundle/Resources/views directory here
336 form_theme: [ '@RapsysBlog/form/form_div_layout.html.twig' ]
337 #Set twig paths
338 paths:
339 #Required by email.image(site_logo) directive
340 #XXX: Allow twig to resolve @RapsysBlog/png/logo.png in vendor/rapsys/blogbundle/Resources/public/png/logo.png
341 '%kernel.project_dir%/vendor/rapsys/blogbundle/Resources/public': 'RapsysBlog'