mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-10-31 10:19:09 +00:00 
			
		
		
		
	feat(frontend): rename inj roles to sys-front-*, add sys-svc-cdn, cache-busting lookup
Introduce sys-svc-cdn (cdn_paths/cdn_urls/cdn_dirs) and ensure CDN directories + latest symlink. Rename sys-srv-web-inj-* → sys-front-inj-*; update includes/templates; serve shared/per-app CSS & JS via CDN. Add lookup_plugins/local_mtime_qs.py for mtime-based cache busting; split CSS into default.css/bootstrap.css + optional per-app style.css. CSP: use style-src-elem; drop unsafe-inline for styles. Services: fix SYS_SERVICE_ALL_ENABLED bool and controlled flush. BREAKING CHANGE: role names changed; replace includes and references accordingly. Conversation: https://chatgpt.com/share/68b55494-9ec4-800f-b559-44707029141d
This commit is contained in:
		
							
								
								
									
										25
									
								
								roles/sys-front-inj-css/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								roles/sys-front-inj-css/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | ||||
| - block: | ||||
|     - include_tasks: 01_core.yml | ||||
|     - include_tasks: utils/run_once.yml | ||||
|   when: run_once_sys_front_inj_css is not defined | ||||
|  | ||||
| - name: "Resolve optional app style.css source for '{{ application_id }}'" | ||||
|   vars: | ||||
|     app_role_dir: "{{ playbook_dir }}/roles/{{ application_id }}" | ||||
|     _app_style_src: >- | ||||
|       {{ lookup('first_found', { | ||||
|            'files': ['templates/style.css.j2','files/style.css'], | ||||
|            'paths': [app_role_dir] | ||||
|          }, errors='ignore') | default('', true) }} | ||||
|   set_fact: | ||||
|     app_style_src: "{{ _app_style_src }}" | ||||
|     app_style_present: "{{ _app_style_src | length > 0 }}" | ||||
|  | ||||
| - name: "Deploy per-app '{{ app_style_src }}' to '{{ css_app_dst }}'" | ||||
|   when: app_style_present | ||||
|   copy: | ||||
|     content:  "{{ lookup('template', app_style_src) }}" | ||||
|     dest:     "{{ css_app_dst }}" | ||||
|     owner:    "{{ NGINX.USER }}" | ||||
|     group:    "{{ NGINX.USER }}" | ||||
|     mode:     '0644' | ||||
		Reference in New Issue
	
	Block a user