Cleanup + upgrade to 22.1.11

This commit is contained in:
Daniel Berteaud 2023-12-21 22:22:12 +01:00
parent 3cdd090a58
commit d082bd3c3d
6 changed files with 16 additions and 16 deletions

View File

@ -1,3 +1,3 @@
Kind = "service-defaults"
Name = "[[ .diagrams.instance ]][[ .consul.suffix ]]"
Name = "[[ .instance ]][[ .consul.suffix ]]"
Protocol = "http"

View File

@ -1,8 +1,8 @@
Kind = "service-intentions"
Name = "[[ .diagrams.instance ]][[ .consul.suffix ]]"
Name = "[[ .instance ]][[ .consul.suffix ]]"
Sources = [
{
Name = "[[ .traefik.instance ]]"
Name = "[[ (merge .diagrams .).traefik.instance ]]"
Permissions = [
{
Action = "allow"

View File

@ -1,5 +1,5 @@
[[ $c := merge .diagrams . -]]
job [[ .diagrams.instance | toJSON ]] {
job [[ .instance | toJSON ]] {
[[ template "common/job_start.tpl" $c ]]
@ -9,7 +9,7 @@ job [[ .diagrams.instance | toJSON ]] {
}
service {
name = "[[ .diagrams.instance ]][[ .consul.suffix ]]"
name = "[[ .instance ]][[ .consul.suffix ]]"
port = 8282
[[ template "common/connect.tpl" $c ]]
@ -31,21 +31,21 @@ job [[ .diagrams.instance | toJSON ]] {
"[[ $c.traefik.instance ]].enable=[[ $c.traefik.enabled ]]",
# Define a middleware to set custom CSP headers
"[[ $c.traefik.instance ]].http.middlewares.[[ .diagrams.instance ]]-headers[[ .consul.suffix ]].headers.contentsecuritypolicy=[[ range $k, $v := $c.traefik.csp ]][[ $k ]] [[ $v ]];[[ end ]]",
"[[ $c.traefik.instance ]].http.middlewares.[[ .instance ]]-headers[[ .consul.suffix ]].headers.contentsecuritypolicy=[[ range $k, $v := $c.traefik.csp ]][[ $k ]] [[ $v ]];[[ end ]]",
[[- if not (regexp.Match "^/?$" (urlParse $c.public_url).Path) ]]
# Diagrams exposed by traefik on a subpath. Define a middleware to strip the prefix before passing the request to the backend
"[[ $c.traefik.instance ]].http.middlewares.[[ .diagrams.instance ]]-prefix[[ .consul.suffix ]].stripprefix.prefixes=[[ (urlParse .diagrams.public_url).Path ]]",
"[[ $c.traefik.instance ]].http.middlewares.[[ .instance ]]-prefix[[ .consul.suffix ]].stripprefix.prefixes=[[ (urlParse .diagrams.public_url).Path ]]",
[[- end ]]
# Main app router
"[[ $c.traefik.instance ]].http.routers.[[ .diagrams.instance ]][[ .consul.suffix ]].rule=Host(`[[ (urlParse $c.public_url).Hostname ]]`)
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].rule=Host(`[[ (urlParse $c.public_url).Hostname ]]`)
[[- if not (regexp.Match "^/?$" (urlParse $c.public_url).Path) ]] && PathPrefix(`[[ (urlParse $c.public_url).Path ]]`)[[ end ]]",
"[[ $c.traefik.instance ]].http.routers.[[ .diagrams.instance ]][[ .consul.suffix ]].entrypoints=[[ join $c.traefik.entrypoints "," ]]",
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].entrypoints=[[ join $c.traefik.entrypoints "," ]]",
[[- if not (regexp.Match "^/?$" (urlParse $c.public_url).Path) ]]
"[[ $c.traefik.instance ]].http.routers.[[ .diagrams.instance ]][[ .consul.suffix ]].middlewares=[[ .diagrams.instance ]]-prefix[[ $c.consul.suffix ]],[[ .diagrams.instance ]]-headers[[ .consul.suffix ]],[[ template "common/traefik_middlewares.tpl" $c.traefik ]]",
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].middlewares=[[ .instance ]]-prefix[[ $c.consul.suffix ]],[[ .instance ]]-headers[[ .consul.suffix ]],[[ template "common/traefik_middlewares.tpl" $c.traefik ]]",
[[- else ]]
"[[ $c.traefik.instance ]].http.routers.[[ .diagrams.instance ]][[ .consul.suffix ]].middlewares=[[ .diagrams.instance ]]-headers[[ .consul.suffix ]],[[ template "common/traefik_middlewares.tpl" $c.traefik ]]",
"[[ $c.traefik.instance ]].http.routers.[[ .instance ]][[ .consul.suffix ]].middlewares=[[ .instance ]]-headers[[ .consul.suffix ]],[[ template "common/traefik_middlewares.tpl" $c.traefik ]]",
[[- end ]]
]
}

View File

@ -1,8 +1,8 @@
FROM [[ .docker.repo ]][[ .docker.base_images.java17.image ]]
MAINTAINER [[ .docker.maintainer ]]
ARG TOMCAT_VERSION=9.0.83 \
DIAGRAMS_VERSION=22.1.7
ARG TOMCAT_VERSION=9.0.84 \
DIAGRAMS_VERSION=22.1.11
ENV CATALINA_HOME=/opt/tomcat \
TOMCAT_PORT=8282 \

View File

@ -1 +1 @@
[[ template "common/mv_conf.sh.tpl" dict "ctx" . "services" (dict "diagrams" .diagrams.instance) ]]
[[ template "common/mv_conf.sh.tpl" dict "ctx" . "services" (dict "diagrams" .instance) ]]

View File

@ -1,8 +1,8 @@
---
instance: diagrams
diagrams:
instance: diagrams
image: danielberteaud/diagrams:22.1.7-1
image: '[[ .docker.repo ]]diagrams:22.1.11-1'
env: {}
public_url: https://draw.example.org
traefik: