mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-17 22:14:25 +02:00
Added j2 sniffer and solved syntax bugs
This commit is contained in:
parent
ed67ca0501
commit
33d14741e2
@ -9,8 +9,8 @@
|
|||||||
domain: "{{ item.domain }}"
|
domain: "{{ item.domain }}"
|
||||||
http_port: "{{ item.http_port }}"
|
http_port: "{{ item.http_port }}"
|
||||||
loop:
|
loop:
|
||||||
- { domain: "{{domains.[application_id].api", http_port: "{{ports.localhost.http.bluesky_api}}" }
|
- { domain: "{{domains[application_id].api", http_port: "{{ports.localhost.http.bluesky_api}}" }
|
||||||
- { domain: "{{domains.[application_id].web}}", http_port: "{{ports.localhost.http.bluesky_web}}" }
|
- { domain: "{{domains[application_id].web}}", http_port: "{{ports.localhost.http.bluesky_web}}" }
|
||||||
|
|
||||||
# The following lines should be removed when the following issue is closed:
|
# The following lines should be removed when the following issue is closed:
|
||||||
# https://github.com/bluesky-social/pds/issues/52
|
# https://github.com/bluesky-social/pds/issues/52
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
# It doesn't compile yet with this parameters. @todo Fix it
|
# It doesn't compile yet with this parameters. @todo Fix it
|
||||||
args:
|
args:
|
||||||
REACT_APP_PDS_URL: "{{ web_protocol }}://{{domains.[application_id].api}}" # URL des PDS
|
REACT_APP_PDS_URL: "{{ web_protocol }}://{{domains[application_id].api}}" # URL des PDS
|
||||||
REACT_APP_API_URL: "{{ web_protocol }}://{{domains.[application_id].api}}" # API-URL des PDS
|
REACT_APP_API_URL: "{{ web_protocol }}://{{domains[application_id].api}}" # API-URL des PDS
|
||||||
REACT_APP_SITE_NAME: "{{primary_domain | upper}} - Bluesky"
|
REACT_APP_SITE_NAME: "{{primary_domain | upper}} - Bluesky"
|
||||||
REACT_APP_SITE_DESCRIPTION: "Decentral Social "
|
REACT_APP_SITE_DESCRIPTION: "Decentral Social "
|
||||||
ports:
|
ports:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
PDS_HOSTNAME="{{domains.[application_id].api}}"
|
PDS_HOSTNAME="{{domains[application_id].api}}"
|
||||||
PDS_ADMIN_EMAIL="{{applications.bluesky.users.administrator.email}}"
|
PDS_ADMIN_EMAIL="{{applications.bluesky.users.administrator.email}}"
|
||||||
PDS_SERVICE_DID="did:web:{{domains.[application_id].api}}"
|
PDS_SERVICE_DID="did:web:{{domains[application_id].api}}"
|
||||||
|
|
||||||
# See https://mattdyson.org/blog/2024/11/self-hosting-bluesky-pds/
|
# See https://mattdyson.org/blog/2024/11/self-hosting-bluesky-pds/
|
||||||
PDS_SERVICE_HANDLE_DOMAINS=".{{primary_domain}}"
|
PDS_SERVICE_HANDLE_DOMAINS=".{{primary_domain}}"
|
||||||
@ -15,7 +15,7 @@ PDS_BLOBSTORE_DISK_LOCATION=/opt/pds/blocks
|
|||||||
PDS_DATA_DIRECTORY: /opt/pds
|
PDS_DATA_DIRECTORY: /opt/pds
|
||||||
PDS_BLOB_UPLOAD_LIMIT: 52428800
|
PDS_BLOB_UPLOAD_LIMIT: 52428800
|
||||||
PDS_DID_PLC_URL=https://plc.directory
|
PDS_DID_PLC_URL=https://plc.directory
|
||||||
PDS_BSKY_APP_VIEW_URL=https://{{domains.[application_id].web}}
|
PDS_BSKY_APP_VIEW_URL=https://{{domains[application_id].web}}
|
||||||
PDS_BSKY_APP_VIEW_DID=did:web:{{domains.[application_id].web}}
|
PDS_BSKY_APP_VIEW_DID=did:web:{{domains[application_id].web}}
|
||||||
PDS_REPORT_SERVICE_URL=https://mod.bsky.app
|
PDS_REPORT_SERVICE_URL=https://mod.bsky.app
|
||||||
PDS_REPORT_SERVICE_DID=did:plc:ar7c4by46qjdydhdevvrndac
|
PDS_REPORT_SERVICE_DID=did:plc:ar7c4by46qjdydhdevvrndac
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
retries: 3
|
retries: 3
|
||||||
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if applications | get_app_conf(application_id, 'plugins', True).chatgpt | bool %}
|
{% if applications | get_app_conf(application_id, 'plugins.chatgpt', True) | bool %}
|
||||||
matrix-chatgpt-bot:
|
matrix-chatgpt-bot:
|
||||||
restart: {{docker_restart_policy}}
|
restart: {{docker_restart_policy}}
|
||||||
container_name: matrix-chatgpt
|
container_name: matrix-chatgpt
|
||||||
@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
|
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
|
||||||
synapse_data:
|
synapse_data:
|
||||||
{% if applications | get_app_conf(application_id, 'plugins', True).chatgpt | bool %}
|
{% if applications | get_app_conf(application_id, 'plugins.chatgpt', True) | bool %}
|
||||||
chatgpt_data:
|
chatgpt_data:
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
35
tests/integration/test_jinja2_syntax.py
Normal file
35
tests/integration/test_jinja2_syntax.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# tests/integration/test_jinja2_syntax.py
|
||||||
|
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
from jinja2 import Environment, exceptions
|
||||||
|
|
||||||
|
class TestJinja2Syntax(unittest.TestCase):
|
||||||
|
def test_all_j2_templates_have_valid_syntax(self):
|
||||||
|
"""
|
||||||
|
Findet rekursiv alle .j2-Dateien ab Projekt-Root und versucht, sie zu parsen.
|
||||||
|
Ein SyntaxError in einem Template schlägt den Test fehl.
|
||||||
|
"""
|
||||||
|
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||||
|
env = Environment()
|
||||||
|
|
||||||
|
failures = []
|
||||||
|
|
||||||
|
for root, _dirs, files in os.walk(project_root):
|
||||||
|
for fname in files:
|
||||||
|
if fname.endswith('.j2'):
|
||||||
|
path = os.path.join(root, fname)
|
||||||
|
with open(path, 'r', encoding='utf-8') as f:
|
||||||
|
src = f.read()
|
||||||
|
try:
|
||||||
|
env.parse(src)
|
||||||
|
except exceptions.TemplateSyntaxError as e:
|
||||||
|
failures.append(f"{path}:{e.lineno} – {e.message}")
|
||||||
|
|
||||||
|
if failures:
|
||||||
|
self.fail("Gefundene Syntax-Fehler in Jinja2-Templates:\n" +
|
||||||
|
"\n".join(failures))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user