]> Raphaël G. Git Repositories - blogbundle/blob - Resources/config/packages/rapsys_blog.yaml
Enable mail, pseudonym and slug for admin
[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 admin:
102 mail: true
103 pseudonym: true
104 slug: true
105 route:
106 index: 'root'
107 view:
108 edit: 'Rapsys\BlogBundle\Form\EditType'
109 name: '@RapsysBlog/form/edit.html.twig'
110 context:
111 title: 'Modify account'
112 password: 'Modify password'
113 #Index replacement
114 index:
115 route:
116 index: 'root'
117 view:
118 name: '@RapsysBlog/user/index.html.twig'
119 context:
120 title: 'User list'
121 #Login replacement
122 login:
123 route:
124 index: 'root'
125 view:
126 name: '@RapsysBlog/form/login.html.twig'
127 context:
128 title: 'Login'
129 #Recover replacement
130 recover:
131 route:
132 index: 'root'
133 recover: 'recover_url'
134 view:
135 name: '@RapsysBlog/form/recover.html.twig'
136 context:
137 title: 'Recover'
138 mail:
139 subject: 'Welcome back %%recipient_name%% to %%head.site%%'
140 html: '@RapsysBlog/mail/recover.html.twig'
141 text: '@RapsysBlog/mail/recover.text.twig'
142 context:
143 #Register replacement
144 register:
145 field:
146 pseudonym: false
147 slug: false
148 route:
149 index: 'root'
150 confirm: 'confirm_url'
151 view:
152 form: 'Rapsys\BlogBundle\Form\RegisterType'
153 name: '@RapsysBlog/form/register.html.twig'
154 context:
155 title: 'Register'
156 mail:
157 subject: 'Welcome %%recipient_name%% to %%head.site%%'
158 html: '@RapsysBlog/mail/register.html.twig'
159 text: '@RapsysBlog/mail/register.text.twig'
160 context:
161
162 # Doctrine configuration
163 doctrine:
164 # Orm configuration
165 orm:
166 # Replace repository factory
167 repository_factory: 'Rapsys\BlogBundle\Factory\RepositoryFactory'
168
169 #Force resolution of UserBundle entities to BlogBundle one
170 #XXX: without these lines, relations are lookup in parent namespace ignoring BlogBundle extension
171 resolve_target_entities:
172 Rapsys\UserBundle\Entity\Group: 'Rapsys\BlogBundle\Entity\Group'
173 Rapsys\UserBundle\Entity\Civility: 'Rapsys\BlogBundle\Entity\Civility'
174 Rapsys\UserBundle\Entity\User: 'Rapsys\BlogBundle\Entity\User'
175
176 # Framework configuration
177 framework:
178 default_locale: '%rapsys_blog.locale%'
179 disallow_search_engine_index: false
180 #error_controller: 'Rapsys\BlogBundle\Controller\ErrorController::show'
181 mailer:
182 headers:
183 X-Originating-IP: '%env(REMOTE_ADDR)%'
184 secret: '%env(APP_SECRET)%'
185 csrf_protection: true
186 session:
187 enabled: true
188 handler_id: ~
189 storage_factory_id: 'session.storage.factory.native'
190 cookie_secure: 'auto'
191 cookie_samesite: 'lax'
192 translator:
193 fallbacks: '%rapsys_blog.locales%'
194
195 # Security configuration
196 security:
197 # Set password hashers
198 password_hashers:
199 #XXX: comment this key in config/security.yaml to prevent users_in_memory induced failures
200 #TODO: see https://symfony.com/doc/current/security/passwords.html (sodium ? + upgrade)
201 Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
202 #Rapsys\BlogBundle\Entity\User:
203 algorithm: 'sodium'
204 migrate_from:
205 - 'bcrypt'
206 - 'plaintext'
207
208 # Set providers
209 providers:
210 database:
211 entity:
212 class: Rapsys\BlogBundle\Entity\User
213 property: mail
214
215 # Set firewall
216 firewalls:
217 # Disables authentication for assets and the profiler, adapt it according to your needs
218 dev:
219 pattern: ^/(_(profiler|wdt)|css|images|js)/
220 security: false
221
222 main:
223 # Allow anonymous access
224 #anonymous: ~
225 #lazy: true
226
227 # Activate database provider
228 #XXX: comment this key in config/security.yaml to prevent users_in_memory induced failures
229 provider: database
230
231 # Activate user checker
232 user_checker: 'security.user_checker'
233
234 #XXX: https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
235 #http_basic: ~
236
237 # Set form login
238 #XXX: https://symfony.com/doc/current/security/form_login_setup.html
239 #TODO: https://symfony.com/doc/current/security/guard_authentication.html
240 form_login:
241 # Redirect to referer if different from login route
242 use_referer: true
243 # Login path
244 login_path: rapsys_user_login
245 # Check path
246 check_path: rapsys_user_login
247 # Username parameter
248 username_parameter: 'login[mail]'
249 # Password parameter
250 password_parameter: 'login[password]'
251 # Enable login csrf protection
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'