Update docs for server -> jafner-net

This commit is contained in:
Joey Hafner 2023-03-27 09:27:30 -07:00
parent 2f32cd0bc2
commit eb58524cc9
7 changed files with 17 additions and 17 deletions

View File

@ -62,16 +62,16 @@ set service dhcp-server shared-network-name LAN1 subnet 192.168.1.0/24 dns-serve
commit; save; exit commit; save; exit
``` ```
3. Shut down Minecraft servers: `cd ~/homelab/server/config/minecraft && for service in ./*.yml; do echo "===== SHUTTING DOWN $service =====" && docker-compose -f $service down; done` 3. Shut down Minecraft servers: `cd ~/homelab/jafner-net/config/minecraft && for service in ./*.yml; do echo "===== SHUTTING DOWN $service =====" && docker-compose -f $service down; done`
4. Shut down remaining services: `for app in ~/homelab/server/config/*; do echo "===== SHUTTING DOWN $app =====" && cd $app && docker-compose down; done` 4. Shut down remaining services: `for app in ~/homelab/jafner-net/config/*; do echo "===== SHUTTING DOWN $app =====" && cd $app && docker-compose down; done`
5. Shut down the host: `sudo shutdown now`. Wait 30 seconds. If the green power LED doesn't turn off, hold the power button until it does. 5. Shut down the host: `sudo shutdown now`. Wait 30 seconds. If the green power LED doesn't turn off, hold the power button until it does.
### Boot ### Boot
6. Press the power button on the front of the chassis to begin booting. Take note of any POST beeps during this time. Wait for the host to be accessible via SSH. 6. Press the power button on the front of the chassis to begin booting. Take note of any POST beeps during this time. Wait for the host to be accessible via SSH.
7. Check current running docker containers 7. Check current running docker containers
8. Confirm all SMB shares are mounted with `mount -t cifs`. If not mounted, run `mount -a` for all shares. 8. Confirm all SMB shares are mounted with `mount -t cifs`. If not mounted, run `mount -a` for all shares.
9. Start most services: `for app in ~/homelab/server/config/*; do echo "===== STARTING $app =====" && cd $app && docker-compose up -d; done` 9. Start most services: `for app in ~/homelab/jafner-net/config/*; do echo "===== STARTING $app =====" && cd $app && docker-compose up -d; done`
10. Start Minecraft servers: `cd ~/homelab/server/config/minecraft && for service in ./*.yml; do echo "===== STARTING $service =====" && docker-compose -f $service up -d; done` 10. Start Minecraft servers: `cd ~/homelab/jafner-net/config/minecraft && for service in ./*.yml; do echo "===== STARTING $service =====" && docker-compose -f $service up -d; done`
11. Reconfigure the router's DNS resolution: 11. Reconfigure the router's DNS resolution:
``` ```
@ -100,12 +100,12 @@ Note: this is meant to be human-readable, so it prints the container's name befo
### Recreate all Docker containers one-liner ### Recreate all Docker containers one-liner
```bash ```bash
STACKS_RESTARTED=0 && for app in ~/homelab/server/config/*; do echo "===== RECREATING $app =====" && cd $app && docker-compose up -d --force-recreate && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && cd ~/homelab/server/config/minecraft && for service in ./*.yml; do echo "===== RECREATING $service =====" && docker-compose -f $service up -d --force-recreate && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && echo "===== DONE (restarted $STACKS_RESTARTED stacks) =====" STACKS_RESTARTED=0 && for app in ~/homelab/jafner-net/config/*; do echo "===== RECREATING $app =====" && cd $app && docker-compose up -d --force-recreate && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && cd ~/homelab/jafner-net/config/minecraft && for service in ./*.yml; do echo "===== RECREATING $service =====" && docker-compose -f $service up -d --force-recreate && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && echo "===== DONE (restarted $STACKS_RESTARTED stacks) ====="
``` ```
#### Recreate based on list of containers #### Recreate based on list of containers
```bash ```bash
STACKS_RESTARTED=0 && for app in calibre-web homer jdownloader2 librespeed monitoring navidrome qbittorrent send stashapp traefik; do echo "===== RECREATING $app =====" && cd ~/homelab/server/config/$app && docker-compose up -d && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && echo "===== DONE (restarted $STACKS_RESTARTED stacks) =====" && cd ~ STACKS_RESTARTED=0 && for app in calibre-web homer jdownloader2 librespeed monitoring navidrome qbittorrent send stashapp traefik; do echo "===== RECREATING $app =====" && cd ~/homelab/jafner-net/config/$app && docker-compose up -d && STACKS_RESTARTED=$(($STACKS_RESTARTED + 1)); done && echo "===== DONE (restarted $STACKS_RESTARTED stacks) =====" && cd ~
``` ```
## NAS ## NAS

View File

@ -2,5 +2,5 @@
Sometimes it may be necessary to restart the Docker daemon (for example to apply changes made in `/etc/docker/daemon.json`) and recreate all containers. Here's how: Sometimes it may be necessary to restart the Docker daemon (for example to apply changes made in `/etc/docker/daemon.json`) and recreate all containers. Here's how:
1. Shut down and destroy all containers: `docker stop $(docker ps -aq) && docker rm $(docker ps -aq)`. 1. Shut down and destroy all containers: `docker stop $(docker ps -aq) && docker rm $(docker ps -aq)`.
2. *Restart* (not reload) the Docker daemon: `sudo systemctl restart docker`. 2. *Restart* (not reload) the Docker daemon: `sudo systemctl restart docker`.
3. Recreate all containers (to use the new default loki logging): `for app in ~/homelab/server/config/*; do cd $app && docker-compose up -d; done` 3. Recreate all containers (to use the new default loki logging): `for app in ~/homelab/jafner-net/config/*; do cd $app && docker-compose up -d; done`
4. Manually boot Minecraft containers as appropriate: `cd ~/homelab/server/config/minecraft && for server in router vanilla bmcp; do docker-compose -f $server.yml up -d; done` 4. Manually boot Minecraft containers as appropriate: `cd ~/homelab/jafner-net/config/minecraft && for server in router vanilla bmcp; do docker-compose -f $server.yml up -d; done`

View File

@ -41,7 +41,7 @@ ADMIN_EMAIL=joey@jafner.net
## Container volume mapping ## Container volume mapping
DOCKER_DATA=/home/joey/data/<service> DOCKER_DATA=/home/joey/data/<service>
# DOCKER_DATA=/mnt/md0/<service> # for services whose internal data may be large (e.g. modded minecraft servers with large world files) # DOCKER_DATA=/mnt/md0/<service> # for services whose internal data may be large (e.g. modded minecraft servers with large world files)
DOCKER_CONFIG=/home/joey/homelab/server/config/<service>/config DOCKER_CONFIG=/home/joey/homelab/jafner-net/config/<service>/config
## Additional volume mapping ## Additional volume mapping
MEDIA_DIR=/mnt/nas/media MEDIA_DIR=/mnt/nas/media
@ -87,7 +87,7 @@ services:
labels: labels:
- traefik.http.routers.<service>.rule=Host(`<service>.jafner.net`) - traefik.http.routers.<service>.rule=Host(`<service>.jafner.net`)
- traefik.http.routers.<service>.tls.certresolver=lets-encrypt - traefik.http.routers.<service>.tls.certresolver=lets-encrypt
- traefik.http.routers.<service>.middlewares=<middlewares> # available middlewares are available in homelab/server/config/traefik/config/middlewares.yaml - traefik.http.routers.<service>.middlewares=<middlewares> # available middlewares are available in homelab/jafner-net/config/traefik/config/middlewares.yaml
- traefik.http.services.<service>.loadbalancer.server.port=<port> - traefik.http.services.<service>.loadbalancer.server.port=<port>
networks: networks:
- web - web

View File

@ -6,7 +6,7 @@ Our credentials are stored in `ddclient_secrets.env`, which is git-ignored. Addi
So we generate the config file when it must be updated. To update the file, we can run the following command: So we generate the config file when it must be updated. To update the file, we can run the following command:
```bash ```bash
cd ~/homelab/server/config/ddns/ && \ cd ~/homelab/jafner-net/config/ddns/ && \
export $(cat ddclient_secrets.env | xargs) && \ export $(cat ddclient_secrets.env | xargs) && \
envsubst < ./ddclient/ddclient.template > ./ddclient/ddclient.conf && \ envsubst < ./ddclient/ddclient.template > ./ddclient/ddclient.conf && \
unset $(grep -v '^#' ddclient_secrets.env | sed -E 's/(.*)=.*/\1/' | xargs) && \ unset $(grep -v '^#' ddclient_secrets.env | sed -E 's/(.*)=.*/\1/' | xargs) && \

View File

@ -89,7 +89,7 @@ Docker-compose adds a few labels to containers it starts. This feature is not co
| `com.docker.compose.oneoff` | `False` | | `com.docker.compose.oneoff` | `False` |
| `com.docker.compose.project` | `wireguard` | | `com.docker.compose.project` | `wireguard` |
| `com.docker.compose.project.config_files` | `docker-compose.yml` | | `com.docker.compose.project.config_files` | `docker-compose.yml` |
| `com.docker.compose.project.working_dir` | `/home/joey/homelab/server/config/wireguard` | | `com.docker.compose.project.working_dir` | `/home/joey/homelab/jafner-net/config/wireguard` |
| `com.docker.compose.service` | `wg-easy` | | `com.docker.compose.service` | `wg-easy` |
| `com.docker.compose.version` | `1.29.2` | | `com.docker.compose.version` | `1.29.2` |

View File

@ -33,5 +33,5 @@ Prerequisites:
Steps: Steps:
1. Get the URL of the Qbittorrent webUI. `docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' qbittorrent_qbittorrent`. We'll assume the default port of `8080` for the webUI here. 1. Get the URL of the Qbittorrent webUI. `docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' qbittorrent_qbittorrent`. We'll assume the default port of `8080` for the webUI here.
2. Get the username and password for the webUI. These should be in a password manager. 2. Get the username and password for the webUI. These should be in a password manager.
3. Run the script `python3 ~/homelab/server/scripts/remove_trumped_torrents.py`. When prompted, input the `host` like `172.18.0.28:8080` with the IP found in step 1. Use the credentials from step 2 for username and password. 3. Run the script `python3 ~/homelab/jafner-net/scripts/remove_trumped_torrents.py`. When prompted, input the `host` like `172.18.0.28:8080` with the IP found in step 1. Use the credentials from step 2 for username and password.
4. Done. 4. Done.

View File

@ -180,13 +180,13 @@ TODO, not yet designed.
| Backups | server/cron | | Backups | server/cron |
## Offlining dependent services ## Offlining dependent services
- Text: `cd ~/homelab/server/config/calibre-web && docker-compose down ; sudo umount /mnt/nas/calibre` - Text: `cd ~/homelab/jafner-net/config/calibre-web && docker-compose down ; sudo umount /mnt/nas/calibre`
- Torrenting: `cd ~/homelab/seedbox/config/deluge/ ; for DIR in emp ggn mam pub; do cd ./$DIR && docker-compose down && cd ../ ; done ; sudo umount /mnt/torrenting` - Torrenting: `cd ~/homelab/seedbox/config/deluge/ ; for DIR in emp ggn mam pub; do cd ./$DIR && docker-compose down && cd ../ ; done ; sudo umount /mnt/torrenting`
- Media: `cd ~/homelab/server/config/autopirate && docker-compose down ; cd ~/homelab/server/config/plex && docker-compose down ; sudo umount /mnt/nas/media` - Media: `cd ~/homelab/jafner-net/config/autopirate && docker-compose down ; cd ~/homelab/jafner-net/config/plex && docker-compose down ; sudo umount /mnt/nas/media`
- Backups: This cron job runs once per day at midnight. If possible, perform maintenance between runs. If not possible, comment out the jobs via `crontab -e`. - Backups: This cron job runs once per day at midnight. If possible, perform maintenance between runs. If not possible, comment out the jobs via `crontab -e`.
## Online dependent services ## Online dependent services
- Text: `sudo mount /mnt/nas/calibre && cd ~/homelab/server/config/calibre-web && docker-compose up -d` - Text: `sudo mount /mnt/nas/calibre && cd ~/homelab/jafner-net/config/calibre-web && docker-compose up -d`
- Torrenting: `sudo mount /mnt/torrenting && cd ~/homelab/seedbox/config/deluge/ ; for DIR in emp ggn mam pub; do cd ./$DIR && docker-compose up -d && cd ../ ; done` - Torrenting: `sudo mount /mnt/torrenting && cd ~/homelab/seedbox/config/deluge/ ; for DIR in emp ggn mam pub; do cd ./$DIR && docker-compose up -d && cd ../ ; done`
- Media: `sudo mount /mnt/nas/media && cd ~/homelab/server/config/autopirate && docker-compose up -d ; cd ~/homelab/server/config/plex && docker-compose up -d` - Media: `sudo mount /mnt/nas/media && cd ~/homelab/jafner-net/config/autopirate && docker-compose up -d ; cd ~/homelab/jafner-net/config/plex && docker-compose up -d`
- Backups: Uncomment the commented lines with `crontab -e`. - Backups: Uncomment the commented lines with `crontab -e`.