diff --git a/conf/caddy.conf b/conf/trantor.conf similarity index 61% rename from conf/caddy.conf rename to conf/trantor.conf index 8fe9ab6..1d9e807 100644 --- a/conf/caddy.conf +++ b/conf/trantor.conf @@ -16,7 +16,17 @@ https://git.238.kebler.net { } # Home Assistant Server -https://ha.238.kebler.net { +https://ha.kebler.net, https://ha.238.kebler.net { import r53 reverse_proxy /* hassio.kebler.net:8123 } + +https://docker.kebler.net { + import r53 + reverse_proxy /* http://trantor.kebler.net:9000 + } + +https://geeks.kebler.net { + import r53 + reverse_proxy /* http://trantor.kebler.net:9292 + } diff --git a/systemd/caddy.service b/systemd/caddy@.service similarity index 87% rename from systemd/caddy.service rename to systemd/caddy@.service index 00de363..03195d8 100644 --- a/systemd/caddy.service +++ b/systemd/caddy@.service @@ -21,8 +21,8 @@ User=caddy Group=caddy EnvironmentFile=/opt/caddy/env/AWS WorkingDirectory=/opt/caddy -ExecStart=/opt/caddy/caddy run --environ --config /opt/caddy/conf/caddy.conf --adapter=caddyfile -ExecReload=/opt/caddy/caddy reload --config /opt/caddy/conf/caddy.conf --adapter=caddyfile +ExecStart=/opt/caddy/caddy run --environ --config /opt/caddy/conf/%i.conf --adapter=caddyfile +ExecReload=/opt/caddy/caddy reload --config /opt/caddy/conf/%.conf --adapter=caddyfile TimeoutStopSec=5s LimitNOFILE=1048576 LimitNPROC=512 diff --git a/systemd/install b/systemd/install index 6607240..339bce8 100755 --- a/systemd/install +++ b/systemd/install @@ -1,5 +1,5 @@ #!/bin/bash -# makes link to this service file +# copies template to systemd DIR="$(dirname "$(readlink -f "$0")")" -sudo rm /etc/systemd/system/caddy.service -sudo ln -s $DIR/caddy.service /etc/systemd/system/ +sudo rm /etc/systemd/system/caddy@.service +sudo cp $DIR/caddy@.service /etc/systemd/system/ diff --git a/systemd/log b/systemd/log index 49d5d65..5f3493e 100755 --- a/systemd/log +++ b/systemd/log @@ -1,3 +1,4 @@ #!/bin/bash -sudo journalctl --unit=caddy.service -n 50 --no-pager +CONF=${1:-caddy} +sudo journalctl --unit=caddy@$CONF.service -n 50 --no-pager exit 1 diff --git a/systemd/persist b/systemd/persist index 19a992f..26ef004 100755 --- a/systemd/persist +++ b/systemd/persist @@ -1,2 +1,3 @@ #!/bin/bash -sudo systemctl enable caddy +CONF=${1:-caddy} +sudo systemctl enable caddy@$CONF diff --git a/systemd/start b/systemd/start index 06f1119..27139e8 100755 --- a/systemd/start +++ b/systemd/start @@ -1,5 +1,6 @@ #!/bin/bash +CONF=${1:-caddy} sudo systemctl daemon-reload -sudo systemctl stop caddy -sudo systemctl start caddy -sudo systemctl status caddy +sudo systemctl stop caddy@$CONF +sudo systemctl start caddy@$CONF +sudo systemctl status caddy@$CONF diff --git a/systemd/stop b/systemd/stop index 4fc99f3..b349b60 100755 --- a/systemd/stop +++ b/systemd/stop @@ -1,4 +1,5 @@ #!/bin/bash -sudo systemctl stop caddy -sudo systemctl status caddy -sudo journalctl --unit=caddy.service -n 100 --no-pager +CONF=${1:-caddy} +sudo systemctl stop caddy@$CONF +sudo systemctl status caddy@$CONF +sudo journalctl --unit=caddy@$CONF.service -n 100 --no-pager