2022-02-08 16:33:56 -08:00
|
|
|
# homelab
|
|
|
|
|
2022-02-11 10:10:55 -08:00
|
|
|
Monolithic repository for my homelab
|
|
|
|
|
2022-07-08 12:48:34 -07:00
|
|
|
# Navigation
|
|
|
|
This repo is (mostly) organized into the following structure:
|
|
|
|
```bash
|
2022-07-08 15:05:18 -07:00
|
|
|
/
|
|
|
|
# The root contains repository meta-information like .gitignore,
|
|
|
|
# .gitlab-ci.yml, .gitmodules, and README.md.
|
|
|
|
docs/
|
|
|
|
# The /docs directory is for all self-contained documentation
|
|
|
|
# that is not tied to a specific service. Service-specific documentation
|
|
|
|
# is contained in /$host/config/$service/README.md
|
|
|
|
img/
|
|
|
|
# supporting images for use in docs
|
2022-07-08 12:48:34 -07:00
|
|
|
|
2022-07-08 15:05:18 -07:00
|
|
|
$host/
|
|
|
|
# There are separate directories for the details and configuration of
|
|
|
|
# each host. At the root of `/$host/` we have non-authoritative
|
|
|
|
# documentation and reference. This includes printouts of hardware
|
|
|
|
# configs (`inxi -b`), host-specific procedure docs, useful scripts, etc.
|
2022-08-06 14:23:22 -07:00
|
|
|
scripts/
|
|
|
|
# if a host has scripts for automating recurring tasks,
|
|
|
|
# they will be placed here.
|
2022-07-08 15:05:18 -07:00
|
|
|
config/
|
|
|
|
# Anything in the `/$host/config` directory is used as a source of
|
|
|
|
# truth from which hosts pull and apply the defined configuration.
|
|
|
|
$service/
|
|
|
|
# for Docker-enabled hosts each service stack will be
|
|
|
|
# configured within a directory
|
|
|
|
docker-compose.yml
|
|
|
|
# all services (except minecraft, which needed a
|
|
|
|
# more modular system) use docker-compose.yml to
|
|
|
|
# define their stack configuration.
|
|
|
|
.env
|
|
|
|
# contains environment variables to be used by multiple
|
|
|
|
# containers within a stack
|
|
|
|
README.md
|
|
|
|
# if a service stack has documentation specific to itself,
|
|
|
|
# it will be contained within this file. This usually contains
|
|
|
|
# procedure for interacting with a container and system configuration
|
|
|
|
# changes that could not be tracked in code (e.g. /etc/fstab or
|
|
|
|
# crontab or /etc/docker/daemon.json)
|
2022-07-08 12:48:34 -07:00
|
|
|
```
|
|
|
|
|
2022-02-25 15:34:43 -08:00
|
|
|
# Getting an SSH Key
|
2022-02-25 15:42:12 -08:00
|
|
|
1. `TMP=$(echo "$HOME/.ssh/$(echo $HOSTNAME)_id_rsa") && ssh-keygen -b 8192 -t rsa -C "$USER@$HOSTNAME" -f $TMP -N "" && echo "IdentityFile $TMP" > $HOME/.ssh/config && cat $(echo "$TMP").pub`
|
2022-02-25 15:34:43 -08:00
|
|
|
2. Go to Jafner -> Preferences -> SSH Keys.
|
|
|
|
3. Add the pubkey and save.
|
|
|
|
|
2022-02-11 10:10:55 -08:00
|
|
|
# Pulling Only Relevant Subdir
|
|
|
|
Per: https://stackoverflow.com/questions/4114887
|
|
|
|
|
|
|
|
```bash
|
|
|
|
~$ mkdir homelab && cd homelab/
|
|
|
|
git init
|
|
|
|
git config core.sparseCheckout true
|
|
|
|
git remote add -f origin ssh://git@gitlab.jafner.net:2229/Jafner/homelab.git
|
|
|
|
echo "<deployment name; e.g. server/>" > .git/info/sparse-checkout
|
|
|
|
git checkout main
|
|
|
|
```
|
2022-05-11 01:24:55 -07:00
|
|
|
|
|
|
|
## Disabling Sparse Checkout
|
|
|
|
To disable sparse checkout, simply run `git sparse-checkout disable`.
|
2022-05-11 01:25:40 -07:00
|
|
|
With this, it can also be re-eneabled with `git sparse-checkout init`.
|
|
|
|
You can use these two commands to toggle sparse checkout.
|
2022-07-08 12:48:34 -07:00
|
|
|
Per: https://stackoverflow.com/questions/36190800/how-to-disable-sparse-checkout-after-enabled
|