Skip to content

Commit

Permalink
F*ck it, let's start from scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
notthebee committed Nov 4, 2022
1 parent 7917f5c commit cf55731
Show file tree
Hide file tree
Showing 198 changed files with 147 additions and 4,896 deletions.
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc.yaml

This file was deleted.

105 changes: 4 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# notthebee/infra


### WARNING: I don't use this playbook to configure my system anymore, since I switched to Unraid


An Ansible playbook that sets up an Ubuntu-based home media server/NAS with reasonable security, auto-updates, e-mail notifications for S.M.A.R.T. and Snapraid errors and dynamic DNS.
An Ansible playbook that sets up an Ubuntu-based server with reasonable security, auto-updates, e-mail notifications for S.M.A.R.T. and Snapraid errors. Currently being completely rewritten

It assumes a fresh Ubuntu Server 20.04 install, access to a non-root user with sudo privileges and a public SSH key. This can be configured during the installation process.

Expand All @@ -19,100 +15,7 @@ The playbook is mostly being developed for personal use, so stuff is going to be
* Jake Howard and Alex Kretzschmar for the [snapraid](https://github.com/RealOrangeOne/ansible-role-snapraid/commits?author=IronicBadger) role

## Services included:
#### Media
* [Plex](https://hub.docker.com/r/linuxserver/plex) (A media server)
* [Jellyfin](https://hub.docker.com/r/linuxserver/jellyfin) (Yet another media server)
* [Radarr](https://hub.docker.com/r/linuxserver/radarr) (A movie tracker/downloader)
* [Jackett](https://hub.docker.com/r/linuxserver/jackett) (A torrent/NZB indexer)
* [Booksonic](https://hub.docker.com/r/linuxserver/booksonic) (An audiobook server)
* [Sonarr](https://hub.docker.com/r/linuxserver/sonarr) (A TV show tracker/downloader)
* [arch-delugevpn](https://hub.docker.com/r/binhex/arch-delugevpn) (An Arch Linux container running Deluge and an Wireguard/OpenVPN client with a kill switch)

#### Services
* [Authelia](https://hub.docker.com/r/authelia/authelia) (An authentication provider)
* [cloudflare-ddns](https://hub.docker.com/r/oznu/cloudflare-ddns) (A dynamic DNS updater for Cloudflare)
* [UniFi Controller](https://hub.docker.com/r/linuxserver/unifi-controller) (A controller for UniFi devices)
* [Homer](https://hub.docker.com/r/b4bz/homer) (A static home page)
* [Flame](https://github.com/pawelmalak/flame) (Another static home page)
* [Nextcloud](https://hub.docker.com/r/linuxserver/nextcloud) (A self-hosted cloud platform)
* [PhotoPrism](https://hub.docker.com/r/linuxserver/photoprism) (A photo library)
* [PiHole + Unbound](https://github.com/chriscrowe/docker-pihole-unbound) (An all-in-one DNS solution with built-in ad-blocking)
* [MariaDB](https://hub.docker.com/r/linuxserver/mariadb) (A database server for Nextcloud)
* [Vaultwarden](https://hub.docker.com/r/vaultwarden/server) (A FOSS Bitwarden fork written in Rust)
* [Wireguard](https://hub.docker.com/r/linuxserver/wireguard) (A VPN server)
* [IKEv2](https://hub.docker.com/r/notthebee/ikev2) (An IKEv2 VPN server for Apple devices)

#### Misc
* [Watchtower](https://hub.docker.com/r/containrrr/watchtower) (An automated updater for Docker images)
* [DuckDNS](https://hub.docker.com/r/linuxserver/duckdns/) (A dynamic DNS client for DuckDNS)
* [SWAG](https://hub.docker.com/r/linuxserver/swag) (A reverse proxy with built-in support for dynamic DNS, Certbot and fail2ban)
* [bunkerized-nginx](https://github.com/bunkerity/bunkerized-nginx) (A NGINX-based web server focused on security)

#### Home Automation
* [Home Assistant](https://hub.docker.com/r/homeassistant/home-assistant) (A FOSS smart home hub)
* [Phoscon-GW](https://hub.docker.com/r/marthoc/deconz) (A Zigbee gateway)

## Other features:
* MergerFS with Snapraid
* Samba
* Fail2Ban for Nextcloud, Vaultwarden and endlessh with Cloudflare support
* CrowdSec with the iptables bouncer
* endlessh

## Usage
Install Ansible (macOS):
```
brew install ansible
```

Clone the repository:
```
git clone https://github.com/notthebee/infra
```

Create a host varialbe file and adjust the variables:
```
cd infra/
mkdir -p host_vars/YOUR_HOSTNAME
vi host_vars/YOUR_HOSTNAME/vars.yml
```

Create a Keychain item for your Ansible Vault password (on macOS):
```
security add-generic-password \
-a YOUR_USERNAME \
-s ansible-vault-password \
-w
```

The `pass.sh` script will extract the Ansible Vault password from your Keychain automatically each time Ansible requests it.

Create an encrypted `secret.yml` file and adjust the variables:
```
ansible-vault create host_vars/YOUR_HOSTNAME/secret.yml
ansible-vault edit host_vars/YOUR_HOSTNAME/secret.yml
```

Add your custom inventory file to `hosts`:
```
cp hosts_example hosts
vi hosts
```

Install the dependencies:
```
ansible-galaxy install -r requirements.yml
```

Finally, run the playbook:
```
ansible-playbook run.yml -l your-host-here -K
```
The "-K" parameter is only necessary for the first run, since the playbook configures passwordless sudo for the main login user

For consecutive runs, if you only want to update the Docker containers, you can run the playbook like this:
```
ansible-playbook run.yml --tags="port,containers"
```

* [Home Assistant](https://hub.docker.com/r/homeassistant/home-assistant)
* [Phoscon-GW](https://hub.docker.com/r/marthoc/deconz)
* [nginx-proxy-manager](https://nginxproxymanager.com/)

19 changes: 0 additions & 19 deletions files/colorschemes/dracula

This file was deleted.

36 changes: 0 additions & 36 deletions files/colorschemes/gruvbox

This file was deleted.

47 changes: 0 additions & 47 deletions files/colorschemes/nord

This file was deleted.

56 changes: 0 additions & 56 deletions files/colorschemes/solarized

This file was deleted.

Binary file removed files/icons/booksonic.png
Binary file not shown.
Binary file removed files/icons/deconz.png
Binary file not shown.
Binary file removed files/icons/deezerdownloader.png
Binary file not shown.
Binary file removed files/icons/deluge.png
Binary file not shown.
16 changes: 0 additions & 16 deletions files/icons/deluge.svg

This file was deleted.

Binary file removed files/icons/docker.png
Binary file not shown.
Binary file removed files/icons/fritzbox.png
Binary file not shown.
Binary file removed files/icons/grafana.png
Binary file not shown.
Binary file removed files/icons/homeassistant.png
Binary file not shown.
Binary file removed files/icons/jackett.png
Binary file not shown.
Binary file removed files/icons/jellyfin.png
Binary file not shown.
Binary file removed files/icons/lidarr.png
Binary file not shown.
Binary file removed files/icons/logo.jpg
Binary file not shown.
Binary file removed files/icons/nextcloud.png
Binary file not shown.
Binary file removed files/icons/openbooks.png
Binary file not shown.
Binary file removed files/icons/openwrt.png
Binary file not shown.
Binary file removed files/icons/photoprism.png
Binary file not shown.
Binary file removed files/icons/pihole.png
Binary file not shown.
Binary file removed files/icons/pikvm.png
Binary file not shown.
Binary file removed files/icons/piped.png
Binary file not shown.
Binary file removed files/icons/radarr.png
Binary file not shown.
Binary file removed files/icons/readarr.png
Binary file not shown.
Binary file removed files/icons/sonarr.png
Binary file not shown.
Binary file removed files/icons/syncthing.png
Binary file not shown.
Binary file removed files/icons/unifi.png
Binary file not shown.
Binary file removed files/icons/vaultwarden.png
Diff not rendered.
Binary file removed files/icons/wireguard.png
Diff not rendered.
Loading

0 comments on commit cf55731

Please sign in to comment.