From 98779c572811e8219d1ddba365641f57d73007f6 Mon Sep 17 00:00:00 2001 From: turtlebasket Date: Fri, 26 May 2023 12:05:53 -0700 Subject: [PATCH] initial commit --- .gitignore | 80 ++++++++++++++++++++++++++++++ README.md | 18 +++++++ cuddlefish/backup | 8 +++ cuddlefish/docker-compose.old.yaml | 25 ++++++++++ cuddlefish/docker-compose.yaml | 24 +++++++++ cuddlefish/nginx.conf | 67 +++++++++++++++++++++++++ 6 files changed, 222 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 cuddlefish/backup create mode 100644 cuddlefish/docker-compose.old.yaml create mode 100644 cuddlefish/docker-compose.yaml create mode 100644 cuddlefish/nginx.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c265584 --- /dev/null +++ b/.gitignore @@ -0,0 +1,80 @@ +# Docker volume mounts +*/*-data/ + +# backups + +*.tar +*.zip + +# === WINDOWS === + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# === MACOS === + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# === LINUX === + +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + diff --git a/README.md b/README.md new file mode 100644 index 0000000..f113a5b --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# Homelab + +## Hosts + +### Cuddlefish + +Services: + +| Service | Internal Ports | External Ports | URL | +| :------ | :------------- | :------------- | :--- | +| Gitea | `3000` | `80` | `git.michaellisano.com` | + +### Rocktiplex + +| Service | Internal Ports | External Ports | URL | +| :--------------- | :------------- | :------------- | :--- | +| Fathom Analytics | `8080` | `80` | `analytics.michaellisano.com` | + diff --git a/cuddlefish/backup b/cuddlefish/backup new file mode 100755 index 0000000..c7aac00 --- /dev/null +++ b/cuddlefish/backup @@ -0,0 +1,8 @@ +#!/bin/bash + +# CONTAINER_ID=b581d6283772 +CONTAINER_ID=gitea + +docker commit -p $CONTAINER_ID gitea-checkpoint-latest +docker save -o gitea-checkpoint-$(date | tr '[:upper:]' '[:lower:]' | tr ' ' '_').tar checkpoint-latest + diff --git a/cuddlefish/docker-compose.old.yaml b/cuddlefish/docker-compose.old.yaml new file mode 100644 index 0000000..44ce89e --- /dev/null +++ b/cuddlefish/docker-compose.old.yaml @@ -0,0 +1,25 @@ +version: "2.4" + +services: + + cloud: + image: nextcloud + ports: + - 80:80 + environment: + NEXTCLOUD_ADMIN_USER: turtlebasket + NEXTCLOUD_ADMIN_PASSWORD: pass + POSTGRES_HOST: db + POSTGRES_DB: ncdata + POSTGRES_USER: turtlebasket + POSTGRES_PASSWORD: pass + + db: + image: postgres + expose: + - 5432 + environment: + POSTGRES_DB: ncdata + POSTGRES_USER: turtlebasket + POSTGRES_PASSWORD: pass + diff --git a/cuddlefish/docker-compose.yaml b/cuddlefish/docker-compose.yaml new file mode 100644 index 0000000..6f2a163 --- /dev/null +++ b/cuddlefish/docker-compose.yaml @@ -0,0 +1,24 @@ +version: "3" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + container_name: gitea + environment: + USER_UID: 1000 + USER_GID: 1000 + restart: always + networks: + - gitea + volumes: + - ./gitea-data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3000:3000" + - "222:22" + diff --git a/cuddlefish/nginx.conf b/cuddlefish/nginx.conf new file mode 100644 index 0000000..de5e746 --- /dev/null +++ b/cuddlefish/nginx.conf @@ -0,0 +1,67 @@ +#/etc/nginx/nginx.conf + +events {} + +http { + server { + listen 80; + server_name git.turtlebasket.ml; + client_max_body_size 50m; + + location / { + proxy_pass http://127.0.0.1:3000; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } + + server { + listen 80; + server_name analytics.turtlebasket.ml; + + location / { + proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } + + server { + listen 80; + server_name md.turtlebasket.ml; + + location / { + proxy_pass http://192.168.1.25:3000; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } + + server { + listen 80; + server_name money.turtlebasket.ml; + + location / { + proxy_pass http://192.168.1.25:8080; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + } + + server { + listen 80; + server_name iot.turtlebasket.ml; + + location / { + proxy_pass http://192.168.1.25:8123; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + # Critical for websockets, which Home Assistant uses + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + } +} +