summaryrefslogtreecommitdiff
path: root/stacks/edge
diff options
context:
space:
mode:
Diffstat (limited to 'stacks/edge')
-rw-r--r--stacks/edge/.edge.env.template18
-rw-r--r--stacks/edge/.env.template14
-rw-r--r--stacks/edge/.gitignore2
-rw-r--r--stacks/edge/Caddyfile.template52
-rw-r--r--stacks/edge/compose.yml19
-rw-r--r--stacks/edge/env.template16
-rw-r--r--stacks/edge/run.env.template34
7 files changed, 98 insertions, 57 deletions
diff --git a/stacks/edge/.edge.env.template b/stacks/edge/.edge.env.template
deleted file mode 100644
index 737f239..0000000
--- a/stacks/edge/.edge.env.template
+++ /dev/null
@@ -1,18 +0,0 @@
-DOMAIN=
-DOCUMENT_ROOT=
-
-SERVICE0=
-SERVICE0_SUB=
-SERVICE0_PORT=
-
-SERVICE1=
-SERVICE1_SUB=
-SERVICE1_PORT=
-
-SERVICE2=
-SERVICE2_SUB=
-SERVICE2_PORT=
-
-SERVICE3=
-SERVICE3_SUB=
-SERVICE3_PORT=
diff --git a/stacks/edge/.env.template b/stacks/edge/.env.template
deleted file mode 100644
index 0dc0292..0000000
--- a/stacks/edge/.env.template
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-#
-# Stack Compose Variables
-
-# Namespace
-_STACK=
-_CONTAINER=
-
-# Network
-_NET=
-
-# Volumes
-_CADDYFILE=
-_WEBROOT=
diff --git a/stacks/edge/.gitignore b/stacks/edge/.gitignore
index 4d2bac6..14be0dc 100644
--- a/stacks/edge/.gitignore
+++ b/stacks/edge/.gitignore
@@ -1,5 +1,5 @@
# Ignore .env files
*.env
-.srv/
+srv/
Caddyfile
compose.test.yml
diff --git a/stacks/edge/Caddyfile.template b/stacks/edge/Caddyfile.template
index 85ca962..03dadf8 100644
--- a/stacks/edge/Caddyfile.template
+++ b/stacks/edge/Caddyfile.template
@@ -1,29 +1,53 @@
-# {
-# debug
-# auto_https off
-# }
-
-# NOTE: EDIT THIS FILE EXPLICITLY. DO NOT AUTOMATE.
+#
+#
+# Reverse Proxy Configuration
{$DOMAIN}:80 {
+ redir https://{$DOMAIN}{uri} 302
+}
+
+{$DOMAIN} {
+
root * {$DOCUMENT_ROOT}
encode
try_files {path} index.html
file_server
}
-{$SERVICE0_SUB}.{$DOMAIN} {
- reverse_proxy {$SERVICE0}:{$SERVICE0_PORT}
+{$PKM_SUB}.{$DOMAIN} {
+ reverse_proxy {$PKM_HOST}:{$PKM_PORT}
+}
+
+{$SCM_SUB}.{$DOMAIN} {
+ reverse_proxy {$SCM_HOST}:{$SCM_PORT}
+}
+
+{$PIM_SUB}.{$DOMAIN} {
+
+ reverse_proxy {$PIM_HOST}:{$PIM_PORT}
+}
+
+{$TSS_SUB}.{$DOMAIN} {
+
+ reverse_proxy {$TSS_HOST}:{$TSS_PORT}
}
-{$SERVICE1_SUB}.{$DOMAIN} {
- reverse_proxy {$SERVICE1}:{$SERVICE1_PORT}
+{$IAM_SUB}.{$DOMAIN} {
+
+ reverse_proxy {$IAM_HOST}:{$IAM_PORT}
}
-{$SERVICE2_SUB}.{$DOMAIN} {
- reverse_proxy {$SERVICE2}:{$SERVICE2_PORT}
+{$IRM_SUB}.{$DOMAIN} {
+
+ reverse_proxy {$IRM_HOST}:{$IRM_PORT}
}
-{$SERVICE3_SUB}.{$DOMAIN} {
- reverse_proxy {$SERVICE3}:{$SERVICE3_PORT}
+{$NEWS_SUB}.{$DOMAIN} {
+
+ reverse_proxy {$NEWS_HOST}:{$NEWS_PORT}
+}
+
+{$DBA_SUB}.{$DOMAIN} {
+
+ reverse_proxy {$DBA_HOST}:{$DBA_PORT}
}
diff --git a/stacks/edge/compose.yml b/stacks/edge/compose.yml
index 7e88c95..d8c86fa 100644
--- a/stacks/edge/compose.yml
+++ b/stacks/edge/compose.yml
@@ -1,27 +1,26 @@
-name: ${_STACK_0}
+name: ${STACK}
networks:
- edge-net:
- name: ${_NET_0}
+ net:
+ name: ${EDGE_NET}
external: true
services:
- edge:
- container_name: ${_CONTAINER_0}
+ edge-test:
+ container_name: ${EDGE_CONTAINER}
image: caddy:latest
restart: unless-stopped
env_file:
- .run.env
- .env
networks:
- - edge-net
+ - net
cap_add:
- - NET_ADMIN # Allow Caddy to redefine memory limits based on host spec.
+ - NET_ADMIN
ports:
- 80:80
- 443:443
- 443:443/udp
volumes:
- - ${_CADDYFILE:-./Caddyfile}:/etc/caddy/Caddyfile
- - ${_WEBROOT:-.srv/}:/srv
- - /var/log/http/:/var/log/http # Fail2Ban needs this.
+ - ${CADDYFILE}:/etc/caddy/Caddyfile
+ - ${WEBROOT}/:/srv
diff --git a/stacks/edge/env.template b/stacks/edge/env.template
new file mode 100644
index 0000000..b43dec1
--- /dev/null
+++ b/stacks/edge/env.template
@@ -0,0 +1,16 @@
+#
+#
+# Stack Compose Variables
+
+# Namespace
+STACK=
+
+# Containers
+EDGE_CONTAINER=
+
+# Networks
+EDGE_NET=
+
+# Volumes
+CADDYFILE=
+WEBROOT=
diff --git a/stacks/edge/run.env.template b/stacks/edge/run.env.template
new file mode 100644
index 0000000..aa456bf
--- /dev/null
+++ b/stacks/edge/run.env.template
@@ -0,0 +1,34 @@
+DOMAIN=
+DOCUMENT_ROOT=
+
+PKM_HOST=
+PKM_SUB=
+PKM_PORT=
+
+SCM_HOST=
+SCM_SUB=
+SCM_PORT=
+
+PIM_HOST=
+PIM_SUB=
+PIM_PORT=
+
+TSS_HOST=
+TSS_SUB=
+TSS_PORT=
+
+IAM_HOST=
+IAM_SUB=
+IAM_PORT=
+
+IRM_HOST=
+IRM_SUB=
+IRM_PORT=
+
+NEWS_HOST=
+NEWS_SUB=
+NEWS_PORT=
+
+DBA_HOST=
+DBA_SUB=
+DBA_PORT=