From 6224fcfcea295d9be6292a3068c5d914b87dab25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Mon, 29 Jun 2026 11:40:24 +0000 Subject: [PATCH] nginx port configuration --- cookbooks/matrix/config/examples/element-web.env | 1 + cookbooks/matrix/matrix-web.container | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 cookbooks/matrix/config/examples/element-web.env diff --git a/cookbooks/matrix/config/examples/element-web.env b/cookbooks/matrix/config/examples/element-web.env new file mode 100644 index 0000000..ea22f25 --- /dev/null +++ b/cookbooks/matrix/config/examples/element-web.env @@ -0,0 +1 @@ +ELEMENT_WEB_PORT=8081 diff --git a/cookbooks/matrix/matrix-web.container b/cookbooks/matrix/matrix-web.container index f92519f..6193fa9 100644 --- a/cookbooks/matrix/matrix-web.container +++ b/cookbooks/matrix/matrix-web.container @@ -4,7 +4,9 @@ Documentation=https://element.io/ After=local-fs.target network.target Before=matrix.target +# Only start if Element Web client has been configured ConditionPathExists=/etc/quadlets/matrix/element-web/config.json +ConditionPathExists=/etc/quadlets/matrix/element-web.env PartOf=matrix.target @@ -16,8 +18,8 @@ AutoUpdate=registry # Network Network=host -# Port - must match ELEMENT_WEB_PORT below -Environment=ELEMENT_WEB_PORT=8080 +# Source configuration into environment variables for the container +EnvironmentFile=/etc/quadlets/matrix/element-web.env # Config file (must exist before starting) Volume=/etc/quadlets/matrix/element-web/config.json:/app/config.json:z,ro @@ -30,7 +32,7 @@ GIDMap=0:1000000:65535 GIDMap=+101:10000:1 # Health check -HealthCmd=wget -q -O /dev/null http://127.0.0.1:8080/ +HealthCmd=wget -q -O /dev/null http://127.0.0.1:${ELEMENT_WEB_PORT}/ HealthInterval=30s HealthTimeout=10s HealthStartPeriod=30s @@ -41,6 +43,7 @@ Restart=always RestartSec=10 TimeoutStartSec=120 TimeoutStopSec=30 +EnvironmentFile=/etc/quadlets/matrix/element-web.env [Install] WantedBy=matrix.target