From a8a4d24f53d2045abfeebfd7be607a5f41187176 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 15 Apr 2025 22:40:04 +0200 Subject: [PATCH] Added esphome --- .static-ips.yml | 3 + ...a Docker container in a specific order.txt | 26 + _instructions/Electric Eel install.txt | 10 + _instructions/add mapping for media.txt | 8 + _instructions/backup databases.txt | 171 +++++++ .../bulk operations - docker compose .txt | 12 + _instructions/cnpg.txt | 14 + _instructions/connecting servers.txt | 44 ++ ...on with traefik basic-auth middlewares.txt | 32 ++ _instructions/docker networking.txt | 38 ++ ...ker networks before containers install.txt | 38 ++ _instructions/docker-config.txt | 94 ++++ ...able automatic ssh login on truenas server | 28 ++ _instructions/inplace-rebalancing.xlsx | Bin 0 -> 13781 bytes _instructions/jailmaker.txt | 457 ++++++++++++++++++ _instructions/restoring databases-psql.txt | 54 +++ _instructions/restoring databases.txt | 161 ++++++ .../set ACL permissions for media.txt | 14 + _instructions/static ips.txt | 22 + ... copy file from truenas k3s container .txt | 13 + _instructions/to install and use htpasswd.txt | 7 + .../to list networks with subnets.txt | 5 + .../to reset postgresql database password.txt | 55 +++ _instructions/to upgrade postgresql.txt | 62 +++ .../troubleshooting container network.txt | 39 ++ ...bleshooting containers default gateway.txt | 86 ++++ _instructions/troubleshooting mounts.txt | 3 + _instructions/zfs rename dataset.txt | 4 + dashy/data/config/config.yml | 7 + esphome/Connecting esp32.txt | 22 + esphome/esphome_jm.txt | 35 ++ esphome/logs_sthome-24g4_rename.txt | 358 ++++++++++++++ esphome/stacks/.env | 15 + esphome/stacks/.esphome.env | 6 + esphome/stacks/compose.yml | 62 +++ esphome/sthome-24g4-firmware.factory.bin | Bin 0 -> 978992 bytes esphome/sthome-24g4.yaml | 47 ++ external/traefik-users/frigate.txt | 4 +- grafana/stacks/compose.yml | 4 +- ...ginner's Guide...Step by Step 3ed 2021.pdf | Bin 0 -> 6590340 bytes ... Essentials. A Step-by-Step Guide 2023.pdf | Bin 0 -> 5769717 bytes .../Programming in Lua - 4th Edition.epub | Bin 0 -> 536378 bytes .../Programming in Lua - 4th Edition.mobi | Bin 0 -> 2246111 bytes .../Programming in Lua - 4th Edition.pdf | Bin 0 -> 1389825 bytes home-assistant/home-automation.txt | 1 + home-assistant/stacks/.env | 10 +- home-assistant/stacks/.esphome.env | 6 + home-assistant/stacks/compose.yml | 66 +-- kavita/stacks/compose.yml | 15 +- mdns-reflector/stacks/.env | 2 + mdns-reflector/stacks/.mdns-reflector.env | 2 + mdns-reflector/stacks/compose.yml | 20 + networks/stacks/compose.yml | 51 +- wg-easy/stacks/.env | 2 +- 54 files changed, 2174 insertions(+), 61 deletions(-) create mode 100644 _instructions/Adding a new NIC to a Docker container in a specific order.txt create mode 100644 _instructions/Electric Eel install.txt create mode 100644 _instructions/add mapping for media.txt create mode 100644 _instructions/backup databases.txt create mode 100644 _instructions/bulk operations - docker compose .txt create mode 100644 _instructions/cnpg.txt create mode 100644 _instructions/connecting servers.txt create mode 100644 _instructions/creating user password hash strings for user authorisation with traefik basic-auth middlewares.txt create mode 100644 _instructions/docker networking.txt create mode 100644 _instructions/docker networks before containers install.txt create mode 100644 _instructions/docker-config.txt create mode 100644 _instructions/enable automatic ssh login on truenas server create mode 100644 _instructions/inplace-rebalancing.xlsx create mode 100644 _instructions/jailmaker.txt create mode 100644 _instructions/restoring databases-psql.txt create mode 100644 _instructions/restoring databases.txt create mode 100644 _instructions/set ACL permissions for media.txt create mode 100644 _instructions/static ips.txt create mode 100644 _instructions/to copy file from truenas k3s container .txt create mode 100644 _instructions/to install and use htpasswd.txt create mode 100644 _instructions/to list networks with subnets.txt create mode 100644 _instructions/to reset postgresql database password.txt create mode 100644 _instructions/to upgrade postgresql.txt create mode 100644 _instructions/troubleshooting container network.txt create mode 100644 _instructions/troubleshooting containers default gateway.txt create mode 100644 _instructions/troubleshooting mounts.txt create mode 100644 _instructions/zfs rename dataset.txt create mode 100644 esphome/Connecting esp32.txt create mode 100644 esphome/esphome_jm.txt create mode 100644 esphome/logs_sthome-24g4_rename.txt create mode 100644 esphome/stacks/.env create mode 100644 esphome/stacks/.esphome.env create mode 100644 esphome/stacks/compose.yml create mode 100644 esphome/sthome-24g4-firmware.factory.bin create mode 100644 esphome/sthome-24g4.yaml create mode 100644 home-assistant/Alves C. Lua Programming. The Ultimate Beginner's Guide...Step by Step 3ed 2021/Alves C. Lua Programming. The Ultimate Beginner's Guide...Step by Step 3ed 2021.pdf create mode 100644 home-assistant/Alves C. Lua Programming. The Ultimate Beginner's Guide...Step by Step 3ed 2021/Coutinho C. Roblox Lua Scripting Essentials. A Step-by-Step Guide 2023.pdf create mode 100644 home-assistant/Programming in Lua - 4th Edition/Programming in Lua - 4th Edition.epub create mode 100644 home-assistant/Programming in Lua - 4th Edition/Programming in Lua - 4th Edition.mobi create mode 100644 home-assistant/Programming in Lua - 4th Edition/Programming in Lua - 4th Edition.pdf create mode 100644 home-assistant/home-automation.txt create mode 100644 home-assistant/stacks/.esphome.env create mode 100644 mdns-reflector/stacks/.env create mode 100644 mdns-reflector/stacks/.mdns-reflector.env create mode 100644 mdns-reflector/stacks/compose.yml diff --git a/.static-ips.yml b/.static-ips.yml index 084b3ba..9f421d3 100644 --- a/.static-ips.yml +++ b/.static-ips.yml @@ -16,3 +16,6 @@ firefly-importer: 10.255.239.31 # 192.168.2.240/28 range is excluded for DHCP on the DHCP server, so we can use it for static ips # the range for the local lan network is 192.168.2.0/24 syncthing: 192.168.2.241 + + +MDNS_REFLECTOR_IP: 10.0.2.254 \ No newline at end of file diff --git a/_instructions/Adding a new NIC to a Docker container in a specific order.txt b/_instructions/Adding a new NIC to a Docker container in a specific order.txt new file mode 100644 index 0000000..11c2ccc --- /dev/null +++ b/_instructions/Adding a new NIC to a Docker container in a specific order.txt @@ -0,0 +1,26 @@ +https://forums.docker.com/t/adding-a-new-nic-to-a-docker-container-in-a-specific-order/19173/2 +Solution 1: +Just right after your solution, if you only need a different MAC address, just change the corresponding device’s MAC address in the container by some basic tools, say, ifconfig. If you don’t have it in your container, just install net-tools package. +To change the mac use this: ifconfig eth1 hw ether 08:00:AA:AA:AA:FF + +Solution 2: +Since docker is also using linux’s networking namespaces you can do this in the rock-bottom layer as well. Unfortunately, Docker tries to hide this from the user, but the namespaces are still existing under the hood. In order to get them to be managed by ip netns tool, do the following: + +get the process id (pid) of your running container: +$ sudo docker inspect -f '{{.State.Pid}}' +is not your label:tag name, it is the name that docker automatically assign to it once a container is fired up - get yours viadocker ps command and look for the last column (NAME). +create a symlink from the /proc/ filesystem to /var/run/ +2.1. First, create a netns directory in /var/run/ +$ sudo mkdir -p /var/run/netns +2.2. Using the PID you have just obtained, create the symlink +$ sudo ln -sf /proc//ns/net /var/run/netns/ +Now, if you execute ip netns list, you will see the networking namespace of your container. +From now on, there is no docker specific stuffs, just create a veth pair, bring them up, and attach one end of it to the container and you are fine: +$ sudo ip link add veth1_container type veth peer name veth1_root +$ sudo ifconfig veth1_container up +$ sudo ifconfig veth1_root up +$ sudo ip link set veth1_container netns +$ sudo ip netns exec ifconfig veth1_container up +The last command might be a bit overcomplicated, but it seemed that bringing up this interface natively in the container is not possible due to missing permissions :face_with_raised_eyebrow: + +Note that the MAC address could also be changed in the same way I have shown in solution 1, before attaching it to the container, or after - does not really matter, just different commands need to be used (recall the permission issue just mentioned above). \ No newline at end of file diff --git a/_instructions/Electric Eel install.txt b/_instructions/Electric Eel install.txt new file mode 100644 index 0000000..4fd7a08 --- /dev/null +++ b/_instructions/Electric Eel install.txt @@ -0,0 +1,10 @@ +Electric Eel +------------ +# After EE installation, and before starting Docker jail +# Go to Apps->Configuration - click down arrow and select Settings +# Update the following settings: +# Install NVIDIA Drivers: +# Click Save + +# Go to Apps->Configuration +# Click Choose Pool and select appropriate pool for your apps diff --git a/_instructions/add mapping for media.txt b/_instructions/add mapping for media.txt new file mode 100644 index 0000000..0c5bbbc --- /dev/null +++ b/_instructions/add mapping for media.txt @@ -0,0 +1,8 @@ +add mapping for media on container config +----------------------------------------- + +# assuming that the folder where media is stored is /mnt/tank/data1/Media: +# on Truenas shell: +jlmkr edit docker +# add the following args to "systemd_nspawn_user_args": +--bind='/mnt/tank/data1/Media:/mnt/media' diff --git a/_instructions/backup databases.txt b/_instructions/backup databases.txt new file mode 100644 index 0000000..385ab22 --- /dev/null +++ b/_instructions/backup databases.txt @@ -0,0 +1,171 @@ +NB!: List of filenames is at end of this file + +Log in to pgAdmin +User name: stuurmcp@telkomsa.net +Password: + +Connect to servers; refer to "connecting to servers.txt" + +Globals +******* +Navigate to Servers => authentik +Right click on authentik server and select Backup Globals... +Enter the following on the dialog box that opened: +General +------- +Filename: /2024-08-23/databases/authentik-cnpg-backup-globals.sql +Role name: postgres +Click Backup + +Servers +******* +Navigate to Servers => authentik +Right click on authentik server and select Backup Server... +Enter the following on the dialog box that opened (leave all other tabs with default settings): +General +------- +Filename: /2024-08-23/servers/authentik-cnpg-backup-servers.sql +Role name: postgres +Click Backup +----------------------------------------------------------------------------------------------------------------- +Databases +********* +Plain text backup +================= +Navigate to Servers => authentik -> Databases -> authentik +Right click on authentik database and select Backup... +Enter the following on the different tabs of dialog box that opened: +General +------- +Filename: /2024-08-28/authentik-backup.sql (this maps to: /mnt/stpool1/apps/pgadmin/storage/stuurmcp_telkomsa.net/2024-08-28/authentik-backup.sql on truenas) +Format: Plain +Encoding: UTF8 +Role name: authentik +Data Options +------------ +Sections: +Pre-data: +Post-data: -> Edit +# scroll to Postgresql; the password should be visible in the Password field +# Option 2: +# open truenas shell / ssh as root +cd /mnt/stpool1/Users//truestuff +./tcdbinfo.sh +# log in to pgAdmin +# from here onwards, it assumed that authentik is the server to be connected to: + +Register server +=============== +# If server is already registered, right click on authentik server and select Properties, otherwise: +# Right click on Servers and select Register -> Server... + +# Enter the following in the dialog box that opened: +General +------- +Name: authentik +Server group: Servers +Background: +Foreground: +Connect now? +Email: +UID: (note) +Create New Primary Group: