mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-07 18:57:12 +02:00
Renamed general and mode constants and implemented a check to verify that constants are just defined ones over the whole repository
This commit is contained in:
@@ -20,7 +20,7 @@ server:
|
||||
connect-src:
|
||||
- https://ka-f.fontawesome.com
|
||||
frame-src:
|
||||
- "{{ WEB_PROTOCOL }}://*.{{primary_domain}}"
|
||||
- "{{ WEB_PROTOCOL }}://*.{{PRIMARY_DOMAIN}}"
|
||||
flags:
|
||||
style-src:
|
||||
unsafe-inline: true
|
||||
@@ -30,5 +30,5 @@ server:
|
||||
unsafe-inline: true
|
||||
domains:
|
||||
canonical:
|
||||
- "{{ primary_domain }}"
|
||||
- "{{ PRIMARY_DOMAIN }}"
|
||||
|
||||
|
@@ -37,7 +37,7 @@
|
||||
portfolio_menu_categories: "{{ portfolio_menu_categories}}"
|
||||
portfolio_menu_data: "{{ portfolio_menu_data }}"
|
||||
service_provider: "{{ service_provider }}"
|
||||
when: enable_debug | bool
|
||||
when: MODE_DEBUG | bool
|
||||
|
||||
- name: Copy host-specific config.yaml if it exists
|
||||
template:
|
||||
|
@@ -1,8 +1,8 @@
|
||||
window.addEventListener("message", function(event) {
|
||||
const allowedSuffix = ".{{ primary_domain }}";
|
||||
const allowedSuffix = ".{{ PRIMARY_DOMAIN }}";
|
||||
const origin = event.origin;
|
||||
|
||||
// 1. Only allow messages from *.{{ primary_domain }}
|
||||
// 1. Only allow messages from *.{{ PRIMARY_DOMAIN }}
|
||||
if (!origin.endsWith(allowedSuffix)) return;
|
||||
|
||||
const data = event.data;
|
||||
@@ -12,7 +12,7 @@ window.addEventListener("message", function(event) {
|
||||
try {
|
||||
const hrefUrl = new URL(data.href);
|
||||
|
||||
// 3. Only allow redirects to *.{{ primary_domain }}
|
||||
// 3. Only allow redirects to *.{{ PRIMARY_DOMAIN }}
|
||||
if (!hrefUrl.hostname.endsWith(allowedSuffix)) return;
|
||||
|
||||
// 4. Update the ?iframe= parameter in the browser URL
|
||||
@@ -25,6 +25,6 @@ window.addEventListener("message", function(event) {
|
||||
}
|
||||
});
|
||||
|
||||
{% if enable_debug | bool %}
|
||||
{% if MODE_DEBUG | bool %}
|
||||
console.log("[iframe-sync] Listener for iframe messages is active.");
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user