feat: waitress port from services option

This commit is contained in:
2023-01-15 18:20:10 +01:00
parent 25441ea4b2
commit a684479e05
3 changed files with 22 additions and 9 deletions

View File

@@ -39,20 +39,24 @@ keycloak_clients:
- "https://images.potaris.de/*" - "https://images.potaris.de/*"
description: "Images Factory" description: "Images Factory"
keycloak_id: "00000000-0000-0000-0000-000000000001" keycloak_id: "00000000-0000-0000-0000-000000000001"
groups: "images"
simple-log-server: simple-log-server:
party_secret : "8fZpHISTORY_PURGED_SECRET" party_secret : "8fZpHISTORY_PURGED_SECRET"
client_id: z_sls client_id: z_sls
client_secret: "" client_secret: "HISTORY_PURGED_SECRET"
redirect_uris: redirect_uris:
- "https://sls.atlantishq.de/*" - "https://sls.atlantishq.de/*"
description: "Simple Log Server" description: "Simple Log Server"
keycloak_id: "00000000-0000-0000-0000-000000000002" keycloak_id: "00000000-0000-0000-0000-000000000002"
groups: "monitoring"
soundlib-interface: soundlib-interface:
party_secret : "zdHRHISTORY_PURGED_SECRET" party_secret : "zdHRHISTORY_PURGED_SECRET"
client_id: z_soundlib client_id: z_soundlib
client_secret: "" client_secret: "HISTORY_PURGED_SECRET"
redirect_uris: redirect_uris:
- "https://sounds.atlantishq.de/*" - "https://sounds.atlantishq.de/*"
description: "Soundlib interface" description: "Soundlib interface"
keycloak_id: "00000000-0000-0000-0000-000000000003" keycloak_id: "00000000-0000-0000-0000-000000000003"
groups: "soundlib"

View File

@@ -77,7 +77,6 @@
src: oauth-standalone-docker-compose.yaml src: oauth-standalone-docker-compose.yaml
dest: "/opt/oauth2proxy/{{ item }}/docker-compose.yaml" dest: "/opt/oauth2proxy/{{ item }}/docker-compose.yaml"
with_items: with_items:
- python-flask-picture-factory
- simple-log-server - simple-log-server
- soundlib-interface - soundlib-interface
@@ -86,10 +85,10 @@
src: "waitress-systemd-unit.j2" src: "waitress-systemd-unit.j2"
dest: "/etc/systemd/system/{{ item.name }}.service" dest: "/etc/systemd/system/{{ item.name }}.service"
with_items: with_items:
- { name : "image-factory", path : "/var/www/python-flask-picture-factory", port : 5000 } - { name : "image-factory", path : "/var/www/python-flask-picture-factory" }
- { name : "serien-ampel", path : "/var/www/serien-ampel", port : 5001 } - { name : "serien-ampel", path : "/var/www/serien-ampel" }
- { name : "simple-log-server", path : "/var/www/simple-log-server", port : 5002 } - { name : "simple-log-server", path : "/var/www/simple-log-server" }
- { name : "soundlib", path : "/var/www/soundlib-interface", port : 5003 } - { name : "soundlib", path : "/var/www/soundlib-interface" }
notify: notify:
- daemon reload - daemon reload

View File

@@ -1,5 +1,15 @@
{% if item.get("port") %}
{% set port = item.port %}
{% else %}
{% set port = services[item.name].port %}
{% endif %}
{% if item.get("oidc") %}
{% set port = port + 1000 %}
{% endif %}
[Unit] [Unit]
Description={{ item.name }} on {{ item.port }} at {{ item.path }} Description={{ item.name }} on {{ port }} at {{ item.path }}
After=network.target After=network.target
[Service] [Service]
@@ -8,7 +18,7 @@ WorkingDirectory={{ item.path }}
Type=simple Type=simple
User=www-data User=www-data
ExecStart=/usr/bin/waitress-serve --host 0.0.0.0 --port {{ item.port }} --call 'app:createApp' ExecStart=/usr/bin/waitress-serve --host 0.0.0.0 --port {{ port }} --call 'app:createApp'
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target