summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-02-08 02:31:06 -0500
committerseth <[email protected]>2023-02-08 02:31:06 -0500
commit5e4b6ebb8c9e6adaf1ab12802beb82c59c88dcab (patch)
tree4a1ddb00d04dc94612cf01c4ffc2eb6443fa6db4
parent7a6d77e94da09fb1a4e32ebd90e794049f0c737d (diff)
switch to caddy + centralize services
-rw-r--r--.gitignore2
-rw-r--r--.gitmodules10
-rw-r--r--caddy/Caddyfile42
-rw-r--r--config/guzzle.conf55
-rw-r--r--docker-compose.yml36
m---------guzzle_api0
m---------src/modpack0
m---------src/server-modpack0
8 files changed, 89 insertions, 56 deletions
diff --git a/.gitignore b/.gitignore
index a9b9cd5..d074f97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-push
+caddy/data
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..6dc1cfc
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,10 @@
+[submodule "guzzle_api"]
+ path = guzzle_api
+ url = https://github.com/getchoo/guzzle_api.git
+[submodule "src/modpack"]
+ path = src/modpack
+ url = https://github.com/getchoo/modpack.git
+[submodule "src/server-modpack"]
+ path = src/server-modpack
+ url = https://github.com/getchoo/modpack.git
+ branch = server
diff --git a/caddy/Caddyfile b/caddy/Caddyfile
new file mode 100644
index 0000000..1bb889f
--- /dev/null
+++ b/caddy/Caddyfile
@@ -0,0 +1,42 @@
+{
+ log {
+ output stdout
+ format console
+ }
+}
+
+(strip-www) {
+ redir https://{args.0}{uri}
+}
+
+(common_domain) {
+ encode gzip
+ handle {
+ try_files {path} {path}/ =404
+ }
+}
+
+(no_embeds) {
+ header /{args.0} X-Frame-Options DENY
+}
+
+(container_proxy) {
+ handle_path /{args.0}/* {
+ reverse_proxy {args.1}
+ }
+}
+
+www.{$DOMAIN:localhost} {
+ import strip-www {$DOMAIN:localhost}
+}
+
+{$DOMAIN:localhost} {
+ root * {$CADDY_ROOT:/var/www}
+ import common_domain
+
+ file_server browse
+
+ import no_embeds lul.html
+ import container_proxy api {$API_HOST:api}:80
+}
diff --git a/config/guzzle.conf b/config/guzzle.conf
deleted file mode 100644
index 4aa3314..0000000
--- a/config/guzzle.conf
+++ /dev/null
@@ -1,55 +0,0 @@
-server {
- server_name guzzle.gay www.guzzle.gay;
-
-
- root /var/www/guzzle;
- index index.html;
-
- rewrite /chris2 /files/chris.webp permanent;
-
- location / {
- try_files $uri $uri/ =404;
- }
-
- location /lul.html {
- add_header X-Frame-Options DENY;
- }
-
- location /files {
- autoindex on;
- }
-
- location /api {
- rewrite ^/api/(.*) /$1 break;
- proxy_pass http://127.0.0.1:7070$uri$is_args$args;
- }
-
- listen [::]:443 ssl ipv6only=on; # managed by Certbot
- listen 443 ssl; # managed by Certbot
- ssl_certificate /etc/letsencrypt/live/guzzle.gay/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/guzzle.gay/privkey.pem; # managed by Certbot
- include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
-
-
-}
-server {
- if ($host = www.guzzle.gay) {
- return 301 https://$host$request_uri;
- } # managed by Certbot
-
-
- if ($host = guzzle.gay) {
- return 301 https://$host$request_uri;
- } # managed by Certbot
-
-
- listen 80;
- listen [::]:80;
- server_name guzzle.gay www.guzzle.gay;
- return 404; # managed by Certbot
-
-
-
-
-}
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..9298293
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,36 @@
+# docker
+networks:
+ web:
+ external: true
+ internal:
+ external: false
+ driver: bridge
+
+services:
+ website:
+ image: caddy:alpine
+ container_name: guzzle
+ environment:
+ API_HOST: "guzzle_api"
+ CADDY_ROOT: "/var/www"
+ DOMAIN: "guzzle.gay"
+ networks:
+ - web
+ - internal
+ ports:
+ - 80:80
+ - 443:443
+ - 443:443/udp
+ restart: unless-stopped
+ volumes:
+ - ./caddy/Caddyfile:/etc/caddy/Caddyfile:z
+ - ./caddy/data:/data
+ - ./src/:/var/www:z
+ depends_on: api
+ api:
+ build:
+ context: ./guzzle_api
+ dockerfile: Dockerfile
+ container_name: guzzle_api
+ networks:
+ - internal
diff --git a/guzzle_api b/guzzle_api
new file mode 160000
+Subproject 042aebe2ef9a83a9c40d9f817d712678a2aafd6
diff --git a/src/modpack b/src/modpack
new file mode 160000
+Subproject 4713b892c811c6ef5f12f605ea1054c600ee019
diff --git a/src/server-modpack b/src/server-modpack
new file mode 160000
+Subproject 3b9df410bdfb06b49cafea41868fb57897cff0d