From 5836f78eb2deda7d578199d033c60675156327b6 Mon Sep 17 00:00:00 2001 From: tiff Date: Thu, 28 Mar 2024 15:17:09 -0400 Subject: [PATCH] Update repo as documentation --- README.md | 10 +++ builds/README.md | 8 -- cloudflare/README.md | 6 -- docker/README.md | 6 -- docker/grafana/README.md | 4 - docker/grafana/docker-compose.yml | 26 ------ proxmox/README.md | 11 +-- proxmox/cloudflared/README.md | 0 proxmox/cloudflared/cloudflared.sh | 37 +++++++++ proxmox/grafana/README.md | 14 ++++ proxmox/grafana/grafana.sh | 43 ++++++++++ proxmox/homepage/README.md | 0 proxmox/homepage/homepage.sh | 76 +++++++++++++++++ proxmox/qbittorrent/README.md | 0 proxmox/qbittorrent/qbittorrent.sh | 54 ++++++++++++ proxmox/ubuntu/README.md | 0 proxmox/ubuntu/docker/README.md | 8 ++ proxmox/ubuntu/docker/haproxy/Dockerfile | 2 + proxmox/ubuntu/docker/haproxy/README.md | 2 + proxmox/ubuntu/docker/portainer/README.md | 0 .../docker/portainer/docker-compose.yml | 15 ++++ proxmox/ubuntu/ubuntu.sh | 28 +++++++ proxmox/wikijs/README.md | 8 ++ proxmox/wikijs/wiki-js.sh | 83 +++++++++++++++++++ 24 files changed, 386 insertions(+), 55 deletions(-) delete mode 100644 builds/README.md delete mode 100644 cloudflare/README.md delete mode 100644 docker/README.md delete mode 100644 docker/grafana/README.md delete mode 100644 docker/grafana/docker-compose.yml create mode 100644 proxmox/cloudflared/README.md create mode 100644 proxmox/cloudflared/cloudflared.sh create mode 100644 proxmox/grafana/README.md create mode 100644 proxmox/grafana/grafana.sh create mode 100644 proxmox/homepage/README.md create mode 100644 proxmox/homepage/homepage.sh create mode 100644 proxmox/qbittorrent/README.md create mode 100644 proxmox/qbittorrent/qbittorrent.sh create mode 100644 proxmox/ubuntu/README.md create mode 100644 proxmox/ubuntu/docker/README.md create mode 100644 proxmox/ubuntu/docker/haproxy/Dockerfile create mode 100644 proxmox/ubuntu/docker/haproxy/README.md create mode 100644 proxmox/ubuntu/docker/portainer/README.md create mode 100644 proxmox/ubuntu/docker/portainer/docker-compose.yml create mode 100644 proxmox/ubuntu/ubuntu.sh create mode 100644 proxmox/wikijs/README.md create mode 100644 proxmox/wikijs/wiki-js.sh diff --git a/README.md b/README.md index 7a8e5d4..1b71849 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ ## Table of Contents +- [The Purpose of this repo](#the-purpose-of-this-repo) - [Introduction: What is a "home lab"?](#introduction-what-is-a-home-lab) - [Who is a home lab for?](#who-is-a-home-lab-for) - [What hardware should I invest in?](#what-hardware-should-i-invest-in) @@ -16,6 +17,13 @@ + +# The Purpose of this repo + +The purpose of this repo, as of today, is to document my homelab and network. From here, the scripts, Dockerfiles, Docker Compose files, and markdown files will be imported into my wiki of choice, [Wiki.js](https://js.wiki/). From there, I will update my [draw.io](https://www.drawio.com/) diagrams to explain which devices are on what subnet and the switches each device is connected to. + +If you would like more information about documenting your homelab/network setup, there are some excellent resources listed at the end of this README. + # Introduction: What is a "home lab"? A home lab is basically an over-engineered home networking setup for uber nerds. You can self-host your blog and airgap your IoT traffic with a VLAN on your UniFi Dream Machine Pro or SE, but it really isn't necessary. @@ -75,5 +83,7 @@ Some of the software running on the servers in my home lab. [deco-x55]: assets/deco-x55.png [navepoint-12u-closet-rack]: assets/navepoint-12u.png [raspberry-pi-4]: assets/rpi-4.png + [raspberry-pi-3B+]: assets/rpi-3bp.png + [raspberry-pi-2]: assets/rpi-2.png [beelink-nuc]: assets/beelink.png [cyber-power-ups]: assets/ups.png \ No newline at end of file diff --git a/builds/README.md b/builds/README.md deleted file mode 100644 index 6da7c3d..0000000 --- a/builds/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Home Lab Builds, etc - -> [!NOTE]\ -> Links to videos and articles about how others have built their home labs, as well as a link to my home lab building series. - - - - diff --git a/cloudflare/README.md b/cloudflare/README.md deleted file mode 100644 index 0f86f47..0000000 --- a/cloudflare/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Cloudflare Examples - -> [!NOTE]\ -> This is a work in progress. I will be placing configs and yaml files and docker compose files, etc in here once I get a better feel for Cloudflare proxying and how it works. - - diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 8a5a012..0000000 --- a/docker/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Docker Examples - -> [!NOTE]\ -> This is a work in progress. I will be placing configs and yaml files and docker compose files, etc in here once I get a better feel for Docker compose and how it works. - - diff --git a/docker/grafana/README.md b/docker/grafana/README.md deleted file mode 100644 index c894bf8..0000000 --- a/docker/grafana/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Grafana Image - -> [!NOTE]\ -> This is a work in progress. Please don't copy the docker compose file in here because it is unfinished. If you do, please make sure you know what you're doing and add your own information to it. \ No newline at end of file diff --git a/docker/grafana/docker-compose.yml b/docker/grafana/docker-compose.yml deleted file mode 100644 index 863241b..0000000 --- a/docker/grafana/docker-compose.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: '2' - -services: - grafana: - image: bitnami/grafana:6 - ports: - - '3000:3000' - environment: - GF_SECURITY_ADMIN_PASSWORD: "bitnami" - GF_RENDERING_SERVER_URL: "http://grafana-image-renderer:8080/render" - GF_RENDERING_CALLBACK_URL: "http://grafana:3000/" - grafana-image-renderer: - image: bitnami/grafana-image-renderer:1 - ports: - - '8080:8080' - environment: - HTTP_HOST: "0.0.0.0" - HTTP_PORT: "8080" - ENABLE_METRICS: 'true' - - depends - influxdb: - image: bitnami/influxdb:latest - environment: - - INFLUXDB_HTTP_AUTH_ENABLED=false -networks: diff --git a/proxmox/README.md b/proxmox/README.md index b4bda8e..eb302d5 100644 --- a/proxmox/README.md +++ b/proxmox/README.md @@ -2,10 +2,11 @@ > [!NOTE]\ > This is a work in progress. I will be placing configs and yaml files and docker compose files, etc in here once I get a better feel for Proxmox and how it works. +> +> +> [!INFO]\ +> The scripts in this folder is from a wonderful dev and his website listed at the bottom of this README -## Video resources - -> For proxying - -[How to use Cloudflare Tunnel in your Homelab (even with Traefik)](https://www.youtube.com/watch?v=yMmxw-DZ5Ec) \ No newline at end of file +- [tteck Proxmox scripts - GitHub](https://github.com/tteck/Proxmox/) +- [Proxmox VE Helper Scripts](https://tteck.github.io/Proxmox/) diff --git a/proxmox/cloudflared/README.md b/proxmox/cloudflared/README.md new file mode 100644 index 0000000..e69de29 diff --git a/proxmox/cloudflared/cloudflared.sh b/proxmox/cloudflared/cloudflared.sh new file mode 100644 index 0000000..53fa3b8 --- /dev/null +++ b/proxmox/cloudflared/cloudflared.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +msg_ok "Installed Dependencies" + +msg_info "Installing Cloudflared" +mkdir -p --mode=0755 /usr/share/keyrings +VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)" +curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg >/usr/share/keyrings/cloudflare-main.gpg +echo "deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared $VERSION main" >/etc/apt/sources.list.d/cloudflared.list +$STD apt-get update +$STD apt-get install -y cloudflared +msg_ok "Installed Cloudflared" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned" \ No newline at end of file diff --git a/proxmox/grafana/README.md b/proxmox/grafana/README.md new file mode 100644 index 0000000..2d44ed5 --- /dev/null +++ b/proxmox/grafana/README.md @@ -0,0 +1,14 @@ +# Grafana Script + +> [!WARNING]\ +> Always make sure you vet the scripts you install from anywhere on the internet! + +You can install the script directly from this link: + +- [Proxmox VE Helper Scripts](https://tteck.github.io/Proxmox/) + +To see how Grafana works, here are a couple of good resources: + +- [Beautiful Dashboards with Grafana and Prometheus - Monitoring Kubernetes Tutorial | Techno Tim](https://technotim.live/posts/kube-grafana-prometheus/) +- [NEXT LEVEL STATISTICS - Home Assistant InfluxDB and Grafana](https://www.youtube.com/watch?v=eJ-XE2tsD4U) + diff --git a/proxmox/grafana/grafana.sh b/proxmox/grafana/grafana.sh new file mode 100644 index 0000000..a488159 --- /dev/null +++ b/proxmox/grafana/grafana.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +$STD apt-get install -y gnupg +$STD apt-get install -y apt-transport-https +$STD apt-get install -y software-properties-common +msg_ok "Installed Dependencies" + +msg_info "Setting up Grafana Repository" +wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key +sh -c 'echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" > /etc/apt/sources.list.d/grafana.list' +msg_ok "Set up Grafana Repository" + +msg_info "Installing Grafana" +$STD apt-get update +$STD apt-get install -y grafana +systemctl start grafana-server +systemctl enable --now -q grafana-server.service +msg_ok "Installed Grafana" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned" \ No newline at end of file diff --git a/proxmox/homepage/README.md b/proxmox/homepage/README.md new file mode 100644 index 0000000..e69de29 diff --git a/proxmox/homepage/homepage.sh b/proxmox/homepage/homepage.sh new file mode 100644 index 0000000..517d2bd --- /dev/null +++ b/proxmox/homepage/homepage.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +$STD apt-get install -y make +$STD apt-get install -y g++ +$STD apt-get install -y gcc +$STD apt-get install -y ca-certificates +$STD apt-get install -y gnupg +msg_ok "Installed Dependencies" + +msg_info "Setting up Node.js Repository" +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +msg_ok "Set up Node.js Repository" + +msg_info "Installing Node.js" +$STD apt-get update +$STD apt-get install -y nodejs +$STD npm install -g pnpm +msg_ok "Installed Node.js" + +RELEASE=$(curl -s https://api.github.com/repos/gethomepage/homepage/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +msg_info "Installing Homepage v${RELEASE} (Patience)" +wget -q https://github.com/gethomepage/homepage/archive/refs/tags/v${RELEASE}.tar.gz +$STD tar -xzf v${RELEASE}.tar.gz +mkdir -p /opt/homepage/config +mv homepage-${RELEASE}/* /opt/homepage +rm -rf homepage-${RELEASE} +cd /opt/homepage +cp /opt/homepage/src/skeleton/* /opt/homepage/config +$STD pnpm install +$STD pnpm build +msg_ok "Installed Homepage v${RELEASE}" + +msg_info "Creating Service" +service_path="/etc/systemd/system/homepage.service" +echo "[Unit] +Description=Homepage +After=network.target +StartLimitIntervalSec=0 +[Service] +Type=simple +Restart=always +RestartSec=1 +User=root +WorkingDirectory=/opt/homepage/ +ExecStart=pnpm start +[Install] +WantedBy=multi-user.target" >$service_path +$STD systemctl enable --now homepage +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned" \ No newline at end of file diff --git a/proxmox/qbittorrent/README.md b/proxmox/qbittorrent/README.md new file mode 100644 index 0000000..e69de29 diff --git a/proxmox/qbittorrent/qbittorrent.sh b/proxmox/qbittorrent/qbittorrent.sh new file mode 100644 index 0000000..139d458 --- /dev/null +++ b/proxmox/qbittorrent/qbittorrent.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +msg_ok "Installed Dependencies" + +msg_info "Installing qbittorrent-nox" +$STD apt-get install -y qbittorrent-nox +mkdir -p /.config/qBittorrent/ +cat </.config/qBittorrent/qBittorrent.conf +[Preferences] +WebUI\Password_PBKDF2="@ByteArray(amjeuVrF3xRbgzqWQmes5A==:XK3/Ra9jUmqUc4RwzCtrhrkQIcYczBl90DJw2rT8DFVTss4nxpoRhvyxhCf87ahVE3SzD8K9lyPdpyUCfmVsUg==)" +WebUI\Port=8090 +WebUI\UseUPnP=false +WebUI\Username=admin +EOF +msg_ok "qbittorrent-nox" + +msg_info "Creating Service" +cat </etc/systemd/system/qbittorrent-nox.service +[Unit] +Description=qBittorrent client +After=network.target +[Service] +ExecStart=/usr/bin/qbittorrent-nox --webui-port=8090 +Restart=always +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now qbittorrent-nox +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned" \ No newline at end of file diff --git a/proxmox/ubuntu/README.md b/proxmox/ubuntu/README.md new file mode 100644 index 0000000..e69de29 diff --git a/proxmox/ubuntu/docker/README.md b/proxmox/ubuntu/docker/README.md new file mode 100644 index 0000000..a983890 --- /dev/null +++ b/proxmox/ubuntu/docker/README.md @@ -0,0 +1,8 @@ +# Docker Examples + +> [!NOTE]\ +> I installed Docker on an Ubuntu Live Server with Portainer installed for easy Docker Compose configuration +> +> + + diff --git a/proxmox/ubuntu/docker/haproxy/Dockerfile b/proxmox/ubuntu/docker/haproxy/Dockerfile new file mode 100644 index 0000000..9e9a3ad --- /dev/null +++ b/proxmox/ubuntu/docker/haproxy/Dockerfile @@ -0,0 +1,2 @@ +FROM haproxy:2.3 +COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg \ No newline at end of file diff --git a/proxmox/ubuntu/docker/haproxy/README.md b/proxmox/ubuntu/docker/haproxy/README.md new file mode 100644 index 0000000..5fef227 --- /dev/null +++ b/proxmox/ubuntu/docker/haproxy/README.md @@ -0,0 +1,2 @@ +# HAProxy for Proxy Server and Load Balancer + diff --git a/proxmox/ubuntu/docker/portainer/README.md b/proxmox/ubuntu/docker/portainer/README.md new file mode 100644 index 0000000..e69de29 diff --git a/proxmox/ubuntu/docker/portainer/docker-compose.yml b/proxmox/ubuntu/docker/portainer/docker-compose.yml new file mode 100644 index 0000000..1d71aa7 --- /dev/null +++ b/proxmox/ubuntu/docker/portainer/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + portainer: + image: portainer/portainer-ce + container_name: portainer + restart: unless-stopped + security_opt: + - no-new-privileges:true + networks: + - proxy + volumes: + - /etc/localtime:/etc/localtime:ro + - /var/run/docker.sock:/var/run/docker.sock:ro + - /home/username/portainer/data:/data \ No newline at end of file diff --git a/proxmox/ubuntu/ubuntu.sh b/proxmox/ubuntu/ubuntu.sh new file mode 100644 index 0000000..18fd594 --- /dev/null +++ b/proxmox/ubuntu/ubuntu.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +msg_ok "Installed Dependencies" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned" \ No newline at end of file diff --git a/proxmox/wikijs/README.md b/proxmox/wikijs/README.md new file mode 100644 index 0000000..532e8fa --- /dev/null +++ b/proxmox/wikijs/README.md @@ -0,0 +1,8 @@ +# Wiki.js Script + +> [!WARNING]\ +> Always make sure you vet the scripts you install from anywhere on the internet! + +You can install the script directly from this link: + +- [Proxmox VE Helper Scripts](https://tteck.github.io/Proxmox/) \ No newline at end of file diff --git a/proxmox/wikijs/wiki-js.sh b/proxmox/wikijs/wiki-js.sh new file mode 100644 index 0000000..48a10ee --- /dev/null +++ b/proxmox/wikijs/wiki-js.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2024 tteck +# Author: tteck (tteckster) +# License: MIT +# https://github.com/tteck/Proxmox/raw/main/LICENSE + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y curl +$STD apt-get install -y sudo +$STD apt-get install -y mc +$STD apt-get install -y git +$STD apt-get install -y ca-certificates +$STD apt-get install -y gnupg +msg_ok "Installed Dependencies" + +msg_info "Setting up Node.js Repository" +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +msg_ok "Set up Node.js Repository" + +msg_info "Installing Node.js" +$STD apt-get update +$STD apt-get install -y nodejs +msg_ok "Installed Node.js" + +msg_info "Installing Wiki.js" +mkdir -p /opt/wikijs +cd /opt/wikijs +$STD wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz +tar xzf wiki-js.tar.gz +rm wiki-js.tar.gz + +cat </opt/wikijs/config.yml +bindIP: 0.0.0.0 +port: 3000 +db: + type: sqlite + storage: /opt/wikijs/db.sqlite +logLevel: info +logFormat: default +dataPath: /opt/wikijs/data +bodyParserLimit: 5mb +EOF +$STD npm rebuild sqlite3 +msg_ok "Installed Wiki.js" + +msg_info "Creating Service" +service_path="/etc/systemd/system/wikijs.service" + +echo "[Unit] +Description=Wiki.js +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/node server +Restart=always +User=root +Environment=NODE_ENV=production +WorkingDirectory=/opt/wikijs + +[Install] +WantedBy=multi-user.target" >$service_path +$STD systemctl enable --now wikijs +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt-get autoremove +$STD apt-get autoclean +msg_ok "Cleaned" \ No newline at end of file