This commit is contained in:
2026-05-10 13:53:56 +02:00
parent ea78fdcbab
commit d02573112e
4 changed files with 58 additions and 9 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Tord-Vincent Heggland
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,3 +1,4 @@
{
email {$ACME_EMAIL}
}
### FUNKSJONER ###
@@ -28,9 +29,11 @@ import snippets/*.caddy
import remote-ip
handle @external {
redir / /tvh-linux
import rate-limit
reverse_proxy gitea:3000
}
respond "Forbidden" 403
}
lms.home.{$DOMENESHOP_DNS} {
import dns-tls
import remote-ip
@@ -46,7 +49,10 @@ pihole.home.{$DOMENESHOP_DNS} {
handle @internal {
redir / /admin
reverse_proxy 10.10.10.1:18080
reverse_proxy pihole:80
}
handle {
respond "Forbidden" 403
}
}
nextcloud.{$DOMENESHOP_DNS} {
import remote-ip
@@ -56,6 +62,7 @@ nextcloud.{$DOMENESHOP_DNS} {
reverse_proxy nextcloud-app:80
}
respond "Forbidden" 403
}
portainer.{$DOMENESHOP_DNS} {
import remote-ip
handle @external {

26
caddy/sites/whoami.caddy Normal file
View File

@@ -0,0 +1,26 @@
whoami.srv.{$DOMENESHOP_DNS} {
respond <<EOF
remote_host: {remote_host}
remote_ip: {remote_ip}
client_ip: {client_ip}
host: {host}
x_forwarded_for: {header.X-Forwarded-For}
x_real_ip: {header.X-Real-IP}
proto: {scheme}
EOF 200
}
whoami.home.{$DOMENESHOP_DNS} {
import dns-tls
respond <<EOF
remote_host: {remote_host}
remote_ip: {remote_ip}
client_ip: {client_ip}
host: {host}
EOF 200
}

View File

@@ -13,19 +13,14 @@ services:
- caddy_data:/data
- caddy_config:/config
networks:
- proxy_net
- edge_net
- proxy_swarm
- dns_internal
proxy_net:
ipv4_address: 172.19.0.254
proxy_swarm:
networks:
proxy_net:
external: true
edge_net:
external: true
proxy_swarm:
external: true
dns_internal:
external: true
volumes:
caddy_data:
caddy_config: