Update repo as documentation

This commit is contained in:
tiff 2024-03-28 15:17:09 -04:00
parent 13a1231b91
commit 5836f78eb2
24 changed files with 386 additions and 55 deletions

View file

@ -8,6 +8,7 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents ## 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) - [Introduction: What is a "home lab"?](#introduction-what-is-a-home-lab)
- [Who is a home lab for?](#who-is-a-home-lab-for) - [Who is a home lab for?](#who-is-a-home-lab-for)
- [What hardware should I invest in?](#what-hardware-should-i-invest-in) - [What hardware should I invest in?](#what-hardware-should-i-invest-in)
@ -16,6 +17,13 @@
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
# 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"? # 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. 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 [deco-x55]: assets/deco-x55.png
[navepoint-12u-closet-rack]: assets/navepoint-12u.png [navepoint-12u-closet-rack]: assets/navepoint-12u.png
[raspberry-pi-4]: assets/rpi-4.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 [beelink-nuc]: assets/beelink.png
[cyber-power-ups]: assets/ups.png [cyber-power-ups]: assets/ups.png

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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.

View file

@ -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:

View file

@ -2,10 +2,11 @@
> [!NOTE]\ > [!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. > 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 - [tteck Proxmox scripts - GitHub](https://github.com/tteck/Proxmox/)
- [Proxmox VE Helper Scripts](https://tteck.github.io/Proxmox/)
> For proxying
[How to use Cloudflare Tunnel in your Homelab (even with Traefik)](https://www.youtube.com/watch?v=yMmxw-DZ5Ec)

View file

View file

@ -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"

14
proxmox/grafana/README.md Normal file
View file

@ -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)

View file

@ -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"

View file

View file

@ -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"

View file

View file

@ -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 <<EOF >/.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 <<EOF >/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"

0
proxmox/ubuntu/README.md Normal file
View file

View file

@ -0,0 +1,8 @@
# Docker Examples
> [!NOTE]\
> I installed Docker on an Ubuntu Live Server with Portainer installed for easy Docker Compose configuration
>
>

View file

@ -0,0 +1,2 @@
FROM haproxy:2.3
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg

View file

@ -0,0 +1,2 @@
# HAProxy for Proxy Server and Load Balancer

View file

@ -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

28
proxmox/ubuntu/ubuntu.sh Normal file
View file

@ -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"

8
proxmox/wikijs/README.md Normal file
View file

@ -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/)

83
proxmox/wikijs/wiki-js.sh Normal file
View file

@ -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 <<EOF >/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"