├── OLD-docker-backup.sh ├── README.md ├── _config.yml ├── backup.sh ├── dbs └── iot.db ├── dockge ├── README.md └── docker-compose.yml ├── grafana_influxdb ├── .env ├── README.md ├── data │ └── provisioning │ │ └── datasources │ │ └── datasource.yml ├── docker-compose.yml ├── entrypoint.sh └── init-docker-compose.yml ├── homarr ├── .env ├── README.md └── docker-compose.yml ├── homeassistant ├── README.md └── docker-compose.yml ├── iotmenu.sh ├── lemp ├── .env ├── Dockerfile ├── README.md ├── data │ ├── nginx │ │ └── nginx.conf │ └── www │ │ └── index.php └── docker-compose.yml ├── mosquitto ├── .env ├── README.md ├── data │ └── config │ │ └── mosquitto.conf └── docker-compose.yml ├── nodered ├── .env ├── README.md ├── data │ └── audio │ │ └── .gitignore ├── docker-compose.yml ├── setup.sh └── ssh │ └── config ├── npm ├── README.md └── docker-compose.yml ├── phpliteadmin ├── .env ├── README.md └── docker-compose.yml ├── portainer ├── README.md ├── docker-compose.yml └── pass.txt ├── stirling ├── .env ├── README.md └── docker-compose.yml ├── tasmota ├── README.md └── docker-compose.yml ├── watchtower ├── .env ├── README.md └── docker-compose.yml └── zigbee2mqtt ├── .env ├── README.md ├── data └── configuration.yaml └── docker-compose.yml /OLD-docker-backup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ### Bash Environment Setup 4 | # http://redsymbol.net/articles/unofficial-bash-strict-mode/ 5 | # https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html 6 | # set -o xtrace 7 | set -o errexit 8 | set -o errtrace 9 | set -o nounset 10 | set -o pipefail 11 | IFS=$'\n' 12 | 13 | # Fully backup a docker compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases. 14 | project_dir="${1:-$PWD}" 15 | if [ -f "$project_dir/docker-compose.yml" ]; then 16 | echo "[i] Found docker compose config at $project_dir/docker-compose.yml" 17 | else 18 | echo "[X] Could not find a docker-compose.yml file in $project_dir" 19 | exit 1 20 | fi 21 | 22 | project_name=$(basename "$project_dir") 23 | backup_time=$(date +"%Y-%m-%d_%H-%M") 24 | backup_dir="$project_dir/data/backups/$backup_time" 25 | 26 | # Source any needed environment variables 27 | [ -f "$project_dir/docker-compose.env" ] && source "$project_dir/docker-compose.env" 28 | [ -f "$project_dir/.env" ] && source "$project_dir/.env" 29 | 30 | 31 | echo "[+] Backing up $project_name project to $backup_dir" 32 | mkdir -p "$backup_dir" 33 | 34 | echo " - Saving docker-compose.yml config" 35 | cp "$project_dir/docker-compose.yml" "$backup_dir/docker-compose.yml" 36 | 37 | # Optional: pause the containers before backing up to ensure consistency 38 | docker compose pause 39 | 40 | # Optional: run a command inside the contianer to dump your application's state/database to a stable file 41 | echo " - Saving application state to ./dumps" 42 | mkdir -p "$backup_dir/dumps" 43 | # your database/stateful service export commands to run inside docker go here, e.g. 44 | # docker compose exec postgres env PGPASSWORD="$POSTGRES_PASSWORD" pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB" | gzip -9 > "$backup_dir/dumps/$POSTGRES_DB.sql.gz" 45 | # docker compose exec redis redis-cli SAVE 46 | # docker compose exec redis cat /data/dump.rdb | gzip -9 > "$backup_dir/dumps/redis.rdb.gz" 47 | 48 | for service_name in $(docker compose config --services); do 49 | image_id=$(docker compose images -q "$service_name") 50 | image_name=$(docker image inspect --format '{{json .RepoTags}}' "$image_id" | jq -r '.[0]') 51 | container_id=$(docker compose ps -q "$service_name") 52 | 53 | service_dir="$backup_dir/$service_name" 54 | echo "[*] Backing up ${project_name}__${service_name} to ./$service_name..." 55 | mkdir -p "$service_dir" 56 | 57 | # save image 58 | echo " - Saving $image_name image to ./$service_name/image.tar" 59 | docker save --output "$service_dir/image.tar" "$image_id" 60 | 61 | if [[ -z "$container_id" ]]; then 62 | echo " - Warning: $service_name has no container yet." 63 | echo " (has it been started at least once?)" 64 | continue 65 | fi 66 | 67 | # save config 68 | echo " - Saving container config to ./$service_name/config.json" 69 | docker inspect "$container_id" > "$service_dir/config.json" 70 | 71 | # save logs 72 | echo " - Saving stdout/stderr logs to ./$service_name/docker.{out,err}" 73 | docker logs "$container_id" > "$service_dir/docker.out" 2> "$service_dir/docker.err" 74 | 75 | # save data volumes 76 | mkdir -p "$service_dir/volumes" 77 | for source in $(docker inspect -f '{{range .Mounts}}{{println .Source}}{{end}}' "$container_id"); do 78 | volume_dir="$service_dir/volumes$source" 79 | echo " - Saving $source volume to ./$service_name/volumes$source" 80 | mkdir -p "$(dirname "$volume_dir")" 81 | cp -a -r "$source" "$volume_dir" 82 | done 83 | 84 | # save container filesystem 85 | echo " - Saving container filesystem to ./$service_name/container.tar" 86 | docker export --output "$service_dir/container.tar" "$container_id" 87 | 88 | # save entire container root dir 89 | echo " - Saving container root to $service_dir/root" 90 | cp -a -r "/var/lib/docker/containers/$container_id" "$service_dir/root" 91 | done 92 | 93 | echo "[*] Compressing backup folder to $backup_dir.tar.gz" 94 | tar -zcf "$backup_dir.tar.gz" --totals "$backup_dir" && rm -Rf "$backup_dir" 95 | 96 | echo "[√] Finished Backing up $project_name to $backup_dir.tar.gz." 97 | 98 | # Resume the containers if paused above 99 | docker compose unpause 100 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to DockerIOT 2 | 3 | Inspired by the excellent work of Peter Scargill ("[The Script](https://www.esp-go.com)") about an automatic installer of everything you need to start a platform useful to manage IOT devices, I'd like to convert that to a Docker container based setup, keeping all the easy install features you already are used to. 4 | 5 | ## Goals 6 | 7 | - **easy install**: just run a script to select what you want to install, choose your credentials, let it run. 8 | - **easy backup**: all user data will be in a single folder, which can be ported on an other device with Docker support and reinstalled in as low downtime as possible, or backupped via RSYNC or other methods via network or attached storage. 9 | - **easy management**: thanks to scripts with a coherent user interface and to a user friendly web GUI ([Portainer](https://portainer.io)) 10 | - **easy update**: being based on Docker, you just need to drop your actual container, pull down an updated image, deploy a new container from that, start it again, finding all you previous data and configs just there, ready to work. 11 | - **multi platform**: testing started on X86 hardware (a [CoreOS](https://coreos.com) virtual machine, really), but of course I'll do my best to port everything on SBCs like Raspberry Pi, Orange Pi, FriendlyArm NanoPi, Pine64 Rock64, and the like, on whatever platform a Docker daemon is available. 12 | - **reuse of existing containers**: I don't want to reinvent the wheel, and I'll use standard, possibly official, containers whenever it's possible, and I'd like to use [Alpine Linux](https://hub.docker.com/_/alpine) Docker images if available, to reduce even more container size. 13 | 14 | ## What you'll get 15 | 16 | - [Dockge](https://github.com/louislam/dockge) | A fancy, easy-to-use and reactive self-hosted docker compose.yaml stack-oriented manager 17 | - [Grafana](https://grafana.com) | The open platform for analytics and monitoring, already integrated with [InfluxDB](https://www.influxdata.com) | Time Series Database Monitoring & Analytics 18 | - [Homarr](https://homarr.dev/) | A service dashboard 19 | - [LEMP] | Linux/Nginx/MariaDB/PhpMyAdmin, full web stack 20 | - [Home Assistant](https://www.home-assistant.io) | Open source home automation that puts local control and privacy first 21 | - [Mosquitto](https://mosquitto.org) | An open source MQTT broker 22 | - [NodeRED](https://nodered.org) | Flow-based programming for the Internet of Things 23 | - [phpLiteAdmin](https://www.phpliteadmin.org) Web-based SQLite database admin tool written in PHP with support for SQLite3 and SQLite2, with [Peter Scargill](https://tech.scargill.net)'s IOT.DB already setup and connected 24 | - [Portainer](https://portainer.io) | Simple management UI for Docker 25 | - [WatchTower](https://github.com/containrrr/watchtower) | A process for automating Docker container base image updates 26 | - [zigbee2mqtt](https://www.zigbee2mqtt.io/) | Zigbee to MQTT bridge, get rid of your proprietary Zigbee bridges 27 | - More to come... 28 | 29 | ## enable user root and root ssh login 30 | 31 | I know, this is far from being secure and should be avoided, but as this simplifies operations for not skilled people, and in the end it's a local setup, this is what should be done to avoid me the headaches of having to help people with permission issues. You don't agree? Then feel free to study proper security measures and fix this yourself :) 32 | 33 | # give root user a password 34 | sudo passwd root 35 | 36 | # change these 2 lines in /etc/ssh/sshd_config to allow root login via ssh 37 | PermitRootLogin yes 38 | PasswordAuthentication yes 39 | 40 | # now restart ssh to apply changes without reboot 41 | sudo systemctl restart ssh 42 | 43 | from now on, EVERY command you'll see MUST be run as root, so you'll not find any reference to sudo anymore 44 | 45 | ## basic tools requirements 46 | 47 | before going on, you'll need some basic tools, like `jq` and `dialog` (both used by my new menu), and of course `git`, so please install them with something similar to this (adapt to your linux distro if it's not debian based): 48 | 49 | apt install -y jq dialog git 50 | 51 | ## install docker 52 | 53 | curl -fsSL https://get.docker.com -o get-docker.sh 54 | sh ./get-docker.sh 55 | docker --version 56 | 57 | ## install docker compose 58 | 59 | mkdir -p ~/.docker/cli-plugins/ 60 | curl -SL https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-linux-$(uname -m) -o ~/.docker/cli-plugins/docker-compose 61 | chmod +x ~/.docker/cli-plugins/docker-compose 62 | docker compose version 63 | 64 | ## get a copy of this repo 65 | 66 | cd; git clone https://github.com/fragolinux/DockerIOT 67 | 68 | ## most common docker compose commands 69 | 70 | startup: 71 | 72 | docker compose up -d 73 | 74 | shutdown: 75 | 76 | docker compose down 77 | 78 | logs (following): 79 | 80 | docker compose logs -f 81 | 82 | update: 83 | 84 | docker compose down 85 | docker compose pull 86 | docker compose up -d --force-recreate 87 | 88 | feel free to check `docker --help` and `docker compose --help` to learn a lot more, but this is enough to deal with this setup 89 | 90 | ## useful aliases 91 | 92 | alias docker-compose="docker compose" 93 | alias dstart="docker compose up -d" 94 | alias dstop="docker compose down" 95 | alias drestart="docker compose down; docker compose up -d" 96 | alias dlogs="docker compose logs -f" 97 | alias dupdate="docker compose down; docker compose pull; docker compose up -d --force-recreate" 98 | alias dsh="docker compose exec \$(grep -A1 services docker-compose.yml|tail -1|cut -d: -f1|awk '{\$1=\$1};1') /bin/sh" 99 | alias dbash="docker compose exec \$(grep -A1 services docker-compose.yml|tail -1|cut -d: -f1|awk '{\$1=\$1};1') /bin/bash" 100 | 101 | note: the last 2 commands need a bit of tuning for docker-compose files containing more than a single service, I'll work on them ASAP 102 | 103 | ## BASIC BACKUP COMMANDS, to be run ALWAYS as root, till a proper backup procedure will be added 104 | 105 | # compress a full folder, PRESERVING permissions (change the date as you want) 106 | cd && tar cvzfp DockerIOT-20240414.tgz DockerIOT 107 | 108 | # decompress a full folder, PRESERVING permissions 109 | # BEWARE, risk of overwrite if something is already there in same folder, so better renaming the old one before with "mv DockerIOT DockerIOT-orig" 110 | cd && tar xvzfp DockerIOT-20240414.tgz 111 | 112 | # copy a folder from a linux system to an other, directly without windows: 113 | # BEWARE, risk of overwrite if something is already on the remote system... 114 | cd && scp -r DockerIOT root@192.168.1.X:/root 115 | 116 | # copy a single file from 1 system to an other: 117 | # SAFER way, as file is compressed and has a date in its name: 118 | cd && scp DockerIOT-20240414.tgz root@192.168.1.X:/root 119 | 120 | ## custom menu system 121 | 122 | the `iotmenu.sh` script (call it using `bash iotmenu.sh` from inside the main DockerIOT folder) allows easy access to all the services, showing which one is running and on which ports, and all the above docker commands without having to remember their syntax. 123 | 124 | ## use consistent naming 125 | 126 | you MUST add a line like this to your `/etc/hosts` file pointing your device ip (change the X) with a name `host` 127 | 128 | 192.168.1.X host 129 | 130 | every service in this repository is already configured to use `host` to access other services, or ad hoc notes are present in each service README file, if needed. So, in nodered, point influxdb on `host`, same for mqtt or whatever other service (ssh exec nodes, too). 131 | 132 | ## backup 133 | 134 | a basic backup script is now added to this repo, it will create a folder for each week day under ./backup and under them 1 folder for each service, containing a tgz file with full datetime as name. If service is running, it will be stopped for consistent backup before, and restarted as soon as backup completed, while stopped services will just be compressed in the tgz without any other intervention. 135 | 136 | you can run the backup script as is, with `bash backup.sh`, or pass a folder name, in this case it will backup only that folder: `bash backup.sh nodered`, for example. For easier access, it has been added to the `iotmenu.sh` script, too, as 1st element for each service. 137 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | remote_theme: pages-themes/hacker@v0.2.0 2 | plugins: 3 | - jekyll-remote-theme # add this line to the plugins list if you already have one 4 | -------------------------------------------------------------------------------- /backup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Define color escape codes 4 | GREEN='\033[0;32m' 5 | RED='\033[0;31m' 6 | YELLOW='\033[1;33m' 7 | NC='\033[0m' # No Color 8 | 9 | # Define the root folder containing your subfolders with docker-compose.yml files 10 | ROOT_FOLDER="." 11 | BACKUP_ROOT="./backup" 12 | 13 | # Create the backup root directory if it doesn't exist 14 | mkdir -p "$BACKUP_ROOT" 15 | 16 | # Get the current day of the week (1 for Monday, 7 for Sunday) 17 | DAY_OF_WEEK=$(date +%u) 18 | # Get the current date and time for the backup file naming 19 | TIMESTAMP=$(date +%F-%H-%M) 20 | 21 | # Function to backup a folder and handle Docker containers 22 | backup_folder() { 23 | local dir="$1" 24 | local dirname=$(basename "$dir") 25 | local was_running=false 26 | local container_status="stopped_color" 27 | 28 | if [ -f "$dir/docker-compose.yml" ]; then 29 | # Check if any container is running in this folder 30 | if docker compose -f "$dir/docker-compose.yml" ps | grep -q 'Up'; then 31 | was_running=true 32 | container_status="${GREEN}running${NC}" 33 | echo -e "Stopping containers in ${YELLOW}$dir${NC}" 34 | docker compose -f "$dir/docker-compose.yml" down 35 | else 36 | container_status="${RED}stopped${NC}" 37 | fi 38 | 39 | echo -e "Performing backup of $container_status container: ${YELLOW}$dirname${NC}" 40 | 41 | # Create the backup directory structure 42 | backup_dir="$BACKUP_ROOT/$DAY_OF_WEEK-$(date +%A)/$dirname" 43 | mkdir -p "$backup_dir" 44 | backup_file="$backup_dir/$TIMESTAMP.tgz" 45 | 46 | # Create the tar.gz backup 47 | echo "Backing up $dir to $backup_file" 48 | tar --create --gzip --preserve-permissions --file="$backup_file" -C "$ROOT_FOLDER" "$dirname" 49 | 50 | # Restart the containers if they were running before 51 | if [ "$was_running" = true ]; then 52 | echo -e "Starting containers in ${YELLOW}$dir${NC}" 53 | docker compose -f "$dir/docker-compose.yml" up -d 54 | fi 55 | 56 | # Print an empty line before the footer line 57 | echo "" 58 | 59 | # Print the footer line 60 | echo "########################################" 61 | fi 62 | } 63 | 64 | # Main script execution 65 | if [ $# -eq 0 ]; then 66 | for dir in "$ROOT_FOLDER"/*/; do 67 | if [ -d "$dir" ]; then 68 | backup_folder "$dir" 69 | fi 70 | done 71 | else 72 | backup_folder "$1" 73 | fi 74 | -------------------------------------------------------------------------------- /dbs/iot.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fragolinux/DockerIOT/82b567b52b0791507341a8a9301731ae83cb0748/dbs/iot.db -------------------------------------------------------------------------------- /dockge/README.md: -------------------------------------------------------------------------------- 1 | # DOCKGE SETUP 2 | 3 | just check the docker-compose.yml notes, those 3 paths are needed to be all the same, requirement by original author 4 | -------------------------------------------------------------------------------- /dockge/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | dockge: 3 | image: louislam/dockge:latest 4 | restart: unless-stopped 5 | ports: 6 | - 5001:5001 7 | volumes: 8 | - /var/run/docker.sock:/var/run/docker.sock 9 | - ./data:/app/data 10 | 11 | # following is a must stated by dockge author (notes are his ones), I had to put full paths here... 12 | # Stacks Directory 13 | # ⚠️ READ IT CAREFULLY. If you did it wrong, your data could end up writing into a WRONG PATH. 14 | # ⚠️ 1. FULL path only. No relative path (MUST) 15 | # ⚠️ 2. Left Stacks Path === Right Stacks Path (MUST) 16 | - /root/DockerIOT:/root/DockerIOT 17 | environment: 18 | # Tell Dockge where is your stacks directory 19 | - DOCKGE_STACKS_DIR=/root/DockerIOT 20 | -------------------------------------------------------------------------------- /grafana_influxdb/.env: -------------------------------------------------------------------------------- 1 | TZ=UTC 2 | GRAFANA_USERNAME=admin 3 | GRAFANA_PASSWORD=password 4 | DOCKER_INFLUXDB_INIT_USERNAME=admin 5 | DOCKER_INFLUXDB_INIT_PASSWORD=password 6 | DOCKER_INFLUXDB_INIT_ORG=org 7 | DOCKER_INFLUXDB_INIT_BUCKET=buck 8 | 9 | # DO NOT TOUCH ANYTHING BELOW HERE, IF YOU DO NOT KNOW WHAT YOU ARE DOING 10 | DOCKER_INFLUXDB_INIT_MODE=setup 11 | DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=0f3b0f87-1f88-40f4-b538-47973e860083 # uuidgen generated - DO ***NOT*** TOUCH! 12 | DOCKER_INFLUXDB_INIT_RETENTION=4w 13 | DOCKER_INFLUXDB_INIT_PORT=8086 14 | DOCKER_INFLUXDB_INIT_HOST=influxdb # DO ***NOT*** TOUCH! 15 | GRAFANA_PORT=3000 16 | -------------------------------------------------------------------------------- /grafana_influxdb/README.md: -------------------------------------------------------------------------------- 1 | # GRAFANA and INFLUXDB SETUP 2 | 3 | change all the needed parameters in both `.env` and `data/provisioning/datasources/datasource.yml` files 4 | 5 | in nodered, setup an influxdb node using version 2.0, add url as `http://host:8086` and the token above, then complete the setup adding the same organization and bucket configured above, and add a measurement 6 | 7 | NOTE: you MUST have a line in your `/etc/hosts` file pointing your device ip with a name `host` 8 | 9 | ## ONLY FOR 1st RUN! 10 | 11 | on 1st run, use this different startup line: 12 | 13 | docker compose -f init-docker-compose.yml up -d 14 | 15 | then monitor with 16 | 17 | docker compose -f init-docker-compose.yml logs -f 18 | 19 | to see when everything is complete (logs are still, not going on), then shutdown with 20 | 21 | docker compose -f init-docker-compose.yml down 22 | -------------------------------------------------------------------------------- /grafana_influxdb/data/provisioning/datasources/datasource.yml: -------------------------------------------------------------------------------- 1 | apiVersion: 1 2 | datasources: 3 | - name: InfluxDB 4 | type: influxdb 5 | access: proxy 6 | user: admin # change in .env file, too 7 | database: buck # change in .env file, too 8 | url: http://influxdb:8086 # DO ***NOT*** TOUCH! 9 | isDefault: true 10 | editable: false 11 | jsonData: 12 | organization: org # change in .env file, too 13 | dbName: buck # change in .env file, too 14 | httpMode: POST 15 | httpHeaderName1: "Authorization" 16 | secureJsonData: 17 | httpHeaderValue1: "Token 0f3b0f87-1f88-40f4-b538-47973e860083" # DO ***NOT*** TOUCH! 18 | -------------------------------------------------------------------------------- /grafana_influxdb/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | influxdb: 3 | image: influxdb:latest 4 | ports: 5 | - ${DOCKER_INFLUXDB_INIT_PORT}:8086 6 | volumes: 7 | - ./data/influxdb2/data:/var/lib/influxdb2 8 | - ./data/influxdb2/config:/etc/influxdb2 9 | - ./data/influxdb2/backup:/var/lib/backup 10 | environment: 11 | - TZ=${TZ} 12 | - INFLUXDB_DB=${DOCKER_INFLUXDB_INIT_BUCKET} 13 | - INFLUXDB_ADMIN_USER=${DOCKER_INFLUXDB_INIT_USERNAME} 14 | - INFLUXDB_ADMIN_PASSWORD=${DOCKER_INFLUXDB_INIT_PASSWORD} 15 | restart: unless-stopped 16 | env_file: 17 | - .env 18 | 19 | grafana: 20 | image: grafana/grafana:latest 21 | user: root 22 | ports: 23 | - ${GRAFANA_PORT}:3000 24 | volumes: 25 | - ./data/grafana:/var/lib/grafana 26 | - ./data/provisioning/:/etc/grafana/provisioning 27 | depends_on: 28 | - influxdb 29 | environment: 30 | - GF_SECURITY_ADMIN_USER=${GRAFANA_USERNAME} 31 | - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} 32 | restart: unless-stopped 33 | -------------------------------------------------------------------------------- /grafana_influxdb/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Protects script from continuing with an error 4 | set -eu -o pipefail 5 | 6 | # Ensures environment variables are set 7 | export DOCKER_INFLUXDB_INIT_MODE=$DOCKER_INFLUXDB_INIT_MODE 8 | export DOCKER_INFLUXDB_INIT_USERNAME=$DOCKER_INFLUXDB_INIT_USERNAME 9 | export DOCKER_INFLUXDB_INIT_PASSWORD=$DOCKER_INFLUXDB_INIT_PASSWORD 10 | export DOCKER_INFLUXDB_INIT_ORG=$DOCKER_INFLUXDB_INIT_ORG 11 | export DOCKER_INFLUXDB_INIT_BUCKET=$DOCKER_INFLUXDB_INIT_BUCKET 12 | export DOCKER_INFLUXDB_INIT_RETENTION=$DOCKER_INFLUXDB_INIT_RETENTION 13 | export DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=$DOCKER_INFLUXDB_INIT_ADMIN_TOKEN 14 | export DOCKER_INFLUXDB_INIT_PORT=$DOCKER_INFLUXDB_INIT_PORT 15 | export DOCKER_INFLUXDB_INIT_HOST=$DOCKER_INFLUXDB_INIT_HOST 16 | 17 | # Conducts initial InfluxDB using the CLI 18 | influx setup --skip-verify --force \ 19 | --bucket "${DOCKER_INFLUXDB_INIT_BUCKET}" \ 20 | --retention "${DOCKER_INFLUXDB_INIT_RETENTION}" \ 21 | --token "${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN}" \ 22 | --org "${DOCKER_INFLUXDB_INIT_ORG}" \ 23 | --username "${DOCKER_INFLUXDB_INIT_USERNAME}" \ 24 | --password "${DOCKER_INFLUXDB_INIT_PASSWORD}" \ 25 | --host http://"${DOCKER_INFLUXDB_INIT_HOST}":8086 26 | -------------------------------------------------------------------------------- /grafana_influxdb/init-docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | influxdb: 3 | image: influxdb:latest 4 | ports: 5 | - ${DOCKER_INFLUXDB_INIT_PORT}:8086 6 | volumes: 7 | - ./data/influxdb2/data:/var/lib/influxdb2 8 | - ./data/influxdb2/config:/etc/influxdb2 9 | - ./data/influxdb2/backup:/var/lib/backup 10 | environment: 11 | - TZ=${TZ} 12 | - DOCKER_INFLUXDB_INIT_MODE=${DOCKER_INFLUXDB_INIT_MODE} 13 | - DOCKER_INFLUXDB_INIT_USERNAME=${DOCKER_INFLUXDB_INIT_USERNAME} 14 | - DOCKER_INFLUXDB_INIT_PASSWORD=${DOCKER_INFLUXDB_INIT_PASSWORD} 15 | - DOCKER_INFLUXDB_INIT_ORG=${DOCKER_INFLUXDB_INIT_ORG} 16 | - DOCKER_INFLUXDB_INIT_BUCKET=${DOCKER_INFLUXDB_INIT_BUCKET} 17 | - DOCKER_INFLUXDB_INIT_RETENTION=${DOCKER_INFLUXDB_INIT_RETENTION} 18 | - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN} 19 | - INFLUXDB_DB=${DOCKER_INFLUXDB_INIT_BUCKET} 20 | - INFLUXDB_ADMIN_USER=${DOCKER_INFLUXDB_INIT_USERNAME} 21 | - INFLUXDB_ADMIN_PASSWORD=${DOCKER_INFLUXDB_INIT_PASSWORD} 22 | restart: unless-stopped 23 | env_file: 24 | - .env 25 | entrypoint: ["./entrypoint.sh"] 26 | -------------------------------------------------------------------------------- /homarr/.env: -------------------------------------------------------------------------------- 1 | TZ=UTC 2 | -------------------------------------------------------------------------------- /homarr/README.md: -------------------------------------------------------------------------------- 1 | # HOMARR SETUP 2 | 3 | set timezone in `.env` file 4 | -------------------------------------------------------------------------------- /homarr/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | homarr: 3 | container_name: homarr 4 | image: ghcr.io/ajnart/homarr:latest 5 | restart: unless-stopped 6 | volumes: 7 | - /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration 8 | - ./data/configs:/app/data/configs 9 | - ./data/icons:/app/public/icons 10 | - ./data/data:/data 11 | ports: 12 | - '7575:7575' 13 | environment: 14 | - TZ=${TZ} 15 | env_file: 16 | - .env 17 | -------------------------------------------------------------------------------- /homeassistant/README.md: -------------------------------------------------------------------------------- 1 | # HOME ASSISTANT SETUP 2 | 3 | add these 2 lines in case of error: `: Unsupported system page size`, they're already in the `docker-compose.yml` but commented out 4 | 5 | environment: 6 | - DISABLE_JEMALLOC=true 7 | 8 | if you want to use zigbee dongles directly with ZHA integration (without using zigbee2mqtt), check the correct device under `/dev/serial/by-id` on the host, and change the DEVICE_ID in the following lines in the `docker-compose.yml` 9 | 10 | devices: 11 | - /dev/serial/by-id/DEVICE_ID:/dev/ttyUSB0 12 | 13 | same can be done to pass bluetooth adapter to the container, please check on Home Assistant site and forums for info and help. 14 | -------------------------------------------------------------------------------- /homeassistant/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | homeassistant: 3 | container_name: homeassistant 4 | image: "ghcr.io/home-assistant/home-assistant:stable" 5 | volumes: 6 | - ./data:/config 7 | - /etc/localtime:/etc/localtime:ro 8 | - /run/dbus:/run/dbus:ro 9 | restart: unless-stopped 10 | privileged: true 11 | ports: 12 | - '8123:8123' 13 | # enable following 2 lines in case of error: ": Unsupported system page size" 14 | # environment: 15 | # - DISABLE_JEMALLOC=true 16 | # enable following 2 lines to pass zigbee dongles directly to the container, details in README.md 17 | # devices: 18 | # - /dev/serial/by-id/DEVICE_ID:/dev/ttyUSB0 19 | -------------------------------------------------------------------------------- /iotmenu.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | if ! command -v dialog $> /dev/null; then 5 | echo \"dialog\" executable missing, please install it... exiting 6 | exit 1 7 | fi 8 | 9 | if ! command -v jq $> /dev/null; then 10 | echo \"jq\" executable missing, please install it... exiting 11 | exit 1 12 | fi 13 | 14 | if ! command -v docker $> /dev/null; then 15 | echo \"docker\" executable missing, please install it... exiting 16 | exit 1 17 | fi 18 | 19 | set +e 20 | docker compose &>/dev/null 21 | if [ $? -ne 0 ]; then 22 | echo Docker \"compose\" plugin missing, please install it... exiting 23 | exit 1 24 | fi 25 | set -e 26 | 27 | export NCURSES_NO_UTF8_ACS=1 28 | 29 | get_service_ports() { 30 | local folder="$1" 31 | ports=$(docker compose -f "$folder"/docker-compose.yml ps --format '{{if index .Publishers 0}}{{range .Publishers}}{{if ne .PublishedPort 0}}{{$.Service}} {{.PublishedPort}} |{{end}}{{end}}{{end}}' | awk NF | tr '\n' ' ') 32 | if [[ "$ports" == "" ]]; then 33 | if [[ $(docker compose -f "$folder"/docker-compose.yml ps --format '{{.State}}') == "running" ]]; then 34 | echo "Running (no ports exposed)" 35 | else 36 | echo "Not Running" 37 | fi 38 | else 39 | echo "[ ${ports::-3} ]" 40 | fi 41 | } 42 | 43 | get_service_status() { 44 | local folder="$1" 45 | docker compose -f "$folder"/docker-compose.yml ps --format json 46 | } 47 | 48 | # Function to display service menu and execute action 49 | perform_service_action() { 50 | local folder="$1" 51 | service_status=$(get_service_status "$folder") 52 | 53 | # Define service action options as an array 54 | service_actions=() 55 | tot_actions=0 56 | service_actions+=("backup" "Backup $folder services") && ((tot_actions+=1)) 57 | [ "$service_status" = "" ] && service_actions+=("start" "Start $folder services") && ((tot_actions+=1)) 58 | [ "$service_status" != "" ] && service_actions+=("stop" "Stop $folder services") && ((tot_actions+=1)) 59 | [ "$service_status" != "" ] && service_actions+=("restart" "Restart $folder services") && ((tot_actions+=1)) 60 | [ "$service_status" != "" ] && service_actions+=("logs" "Show $folder services logs") && ((tot_actions+=1)) 61 | service_actions+=("update" "Update $folder services image") && ((tot_actions+=1)) 62 | # for now commented out shell access, it needs to select the specific container in the service 63 | # [ "$service_status" != "" ] && service_actions+=("sh" "Run SH shell in $folder services") && ((tot_actions+=1)) 64 | # [ "$service_status" != "" ] && service_actions+=("bash" "Run BASH shell $folder services") && ((tot_actions+=1)) 65 | 66 | # Get user selection from menu 67 | a1=$((tot_actions+7)) 68 | a2=$((tot_actions+2)) 69 | selected_action=$(dialog --title "Select Action" --menu "What do do on $folder service:" $a1 60 $a2 "${service_actions[@]}" 3>&1 1>&2 2>&3) 70 | echo "$selected_action" 71 | 72 | DC="docker compose -f $folder/docker-compose.yml" 73 | # Check exit status and selected action 74 | exit_status=$? 75 | if [[ $exit_status -eq 1 ]]; then 76 | echo "Action cancelled." 77 | elif [[ $exit_status -eq 255 ]]; then 78 | echo "An error occurred." 79 | else 80 | # Simulate command execution (replace with actual execution for production use) 81 | # You can use libraries like subprocess to execute the command in production 82 | if [[ "$selected_action" == "backup" ]]; then 83 | echo "Executing: backup.sh $folder" 84 | bash backup.sh "$folder" 85 | elif [[ "$selected_action" == "start" ]]; then 86 | echo "Executing: $DC up -d" 87 | $DC up -d 88 | elif [[ "$selected_action" == "stop" ]]; then 89 | echo "Executing: $DC down" 90 | $DC down 91 | elif [[ "$selected_action" == "restart" ]]; then 92 | echo "Executing: $DC down; $DC up -d" 93 | $DC down; $DC up -d 94 | elif [[ "$selected_action" == "logs" ]]; then 95 | echo "Executing: $DC logs -f" 96 | $DC logs -f 97 | elif [[ "$selected_action" == "update" ]]; then 98 | echo "Executing: $DC down; $DC pull; $DC up -d" 99 | $DC down; $DC pull; $DC up -d 100 | # these 2 could not work if more than 1 container in docker compose, it needs to select the specific container in the service # TODO 101 | elif [[ "$selected_action" == "sh" ]]; then 102 | echo "Executing: $DC exec $folder /bin/sh" 103 | $DC exec "$folder" /bin/sh 104 | elif [[ "$selected_action" == "bash" ]]; then 105 | echo "Executing: $DC exec $folder /bin/bash" 106 | $DC exec "$folder" /bin/bash 107 | fi 108 | fi 109 | } 110 | 111 | # Get all docker-compose.yml files in the current directory and one subdirectory 112 | # shellcheck disable=SC2207 113 | folders=( $(find . -maxdepth 2 -name 'docker-compose.yml' -print | sed 's/\/docker-compose.yml//' | sort ) ) 114 | 115 | # Check if any files found 116 | if [[ ${#folders[@]} -eq 0 ]]; then 117 | dialog --msgbox "Error: No docker-compose.yml files found in current directory or subdirectories." 10 30 118 | exit 1 119 | fi 120 | 121 | # Loop through folders and build menu options with stripped folder names 122 | options=() 123 | tot_folders=0 124 | max_length=0 125 | for folder in "${folders[@]}"; do 126 | # Remove leading ./ from folder name using parameter expansion 127 | ((tot_folders+=1)) 128 | folder_name="${folder##*/}" 129 | service_ports=$(get_service_ports "$folder") 130 | total_length=$(( ${#folder_name} + ${#service_ports} )) 131 | [[ "$total_length" -gt "$max_length" ]] && max_length="$total_length" 132 | options+=( "$folder_name" "$service_ports" ) 133 | done 134 | 135 | f1=$((tot_folders+7)) 136 | f2=$((tot_folders+2)) 137 | lenght=$((max_length+22)) 138 | # Display menu with folder name (without ./) and service name (without trailing colon) 139 | choice=$(dialog --title "Select Service to access Actions" --menu "Services ports shown, if service running:" $f1 $lenght $f2 "${options[@]}" 3>&1 1>&2 2>&3) 140 | 141 | # Exit status check (user cancellation or error) 142 | exit_status=$? 143 | if [[ $exit_status -eq 1 ]]; then 144 | echo "Selection cancelled." 145 | elif [[ $exit_status -eq 255 ]]; then 146 | echo "An error occurred." 147 | else 148 | # Extract selected folder and service name (if selection happened) 149 | selected_folder="${choice%% *}" 150 | 151 | # Call function to display service action menu 152 | perform_service_action "$selected_folder" 153 | fi 154 | -------------------------------------------------------------------------------- /lemp/.env: -------------------------------------------------------------------------------- 1 | MYSQL_ROOT_PASSWORD=Passw0rd 2 | -------------------------------------------------------------------------------- /lemp/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-fpm 2 | 3 | RUN apt-get update && apt-get install -y zip libzip-dev libpng-dev 4 | 5 | RUN docker-php-ext-install mysqli pdo pdo_mysql gd zip 6 | -------------------------------------------------------------------------------- /lemp/README.md: -------------------------------------------------------------------------------- 1 | # LEMP SETUP 2 | 3 | This will bring up a full LEMP stack (Linux/Nginx/MariaDB/PhpMyAdmin). BEWARE: 1st run will be slower because it needs to build the php container image, next runs will be much quicker. 4 | 5 | Nginx docs folder is under `data/www` and contains a default `index.php` to show it works, exposed on default port `80` (no ssl for now, if requested I could add it, with self signed certificates). 6 | 7 | PhpMyAdmin is on port `8080`, user is `root` and password is the same of MariaDB, which should be set in the `.env` file. 8 | -------------------------------------------------------------------------------- /lemp/data/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | listen [::]:80 default_server; 4 | 5 | server_name host; 6 | 7 | root /var/www/html; 8 | index index.php index.html; 9 | 10 | location / { 11 | try_files $uri $uri/ /index.php?$args; 12 | } 13 | 14 | location ~* \.php$ { 15 | fastcgi_pass php:9000; 16 | include fastcgi_params; 17 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 18 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lemp/data/www/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lemp/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mariadb: 3 | image: mariadb:latest 4 | ports: 5 | - 3306:3306 6 | environment: 7 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} 8 | env_file: 9 | - .env 10 | volumes: 11 | - ./data/mysql:/var/lib/mysql 12 | restart: unless-stopped 13 | 14 | phpmyadmin: 15 | image: phpmyadmin:latest 16 | ports: 17 | - 8080:80 18 | environment: 19 | PMA_HOST: mariadb 20 | depends_on: 21 | - mariadb 22 | restart: unless-stopped 23 | 24 | php: 25 | build: . 26 | volumes: 27 | - './data/www:/var/www/html' 28 | depends_on: 29 | - mariadb 30 | restart: unless-stopped 31 | 32 | nginx: 33 | image: nginx:latest 34 | ports: 35 | - 80:80 36 | links: 37 | - 'php' 38 | volumes: 39 | - './data/www:/var/www/html' 40 | - './data/nginx:/etc/nginx/conf.d' 41 | depends_on: 42 | - php 43 | restart: unless-stopped 44 | -------------------------------------------------------------------------------- /mosquitto/.env: -------------------------------------------------------------------------------- 1 | # these are your BROKER admin credentials 2 | CEDALO_MC_BROKER_USERNAME=admin 3 | CEDALO_MC_BROKER_PASSWORD=password 4 | 5 | # these instead are the web gui admin credentials 6 | CEDALO_MC_USERNAME=admin 7 | CEDALO_MC_PASSWORD=password 8 | -------------------------------------------------------------------------------- /mosquitto/README.md: -------------------------------------------------------------------------------- 1 | # MOSQUITTO SETUP 2 | 3 | create the hashed passwd file (change username and password in last bits of next command) running this from current folder: 4 | 5 | docker run -it --rm \ 6 | -v $PWD/data/config:/mosquitto/config \ 7 | -v $PWD/data/data:/mosquitto/data \ 8 | -v $PWD/data/log:/mosquitto/log \ 9 | eclipse-mosquitto mosquitto_passwd -b \ 10 | -c /mosquitto/config/passwd username password 11 | 12 | ## management console 13 | 14 | put same user and password you used above in the broker section in the `.env` file, and add the desidered web gui (port:8088) credentials there. 15 | 16 | In the docker-compose file you’ll find 2 images available, official most updated and feature rich one, but only x86 arch available, and older (but raspberry compatible) one, choose accordingly. 17 | -------------------------------------------------------------------------------- /mosquitto/data/config/mosquitto.conf: -------------------------------------------------------------------------------- 1 | persistence true 2 | persistence_location /mosquitto/data/ 3 | log_dest file /mosquitto/log/mosquitto.log 4 | listener 1883 5 | allow_anonymous false 6 | password_file /mosquitto/config/passwd 7 | -------------------------------------------------------------------------------- /mosquitto/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | mosquitto: 3 | image: eclipse-mosquitto 4 | container_name: mosquitto 5 | restart: unless-stopped 6 | volumes: 7 | - ./data/config:/mosquitto/config 8 | - ./data/data:/mosquitto/data 9 | - ./data/log:/mosquitto/log 10 | ports: 11 | - 1883:1883 12 | - 9001:9001 13 | mqtt-mgmt: 14 | # official updated image, but available only for x86 arch 15 | image: cedalo/management-center:dev 16 | # unofficial, older version with less features, available for arm arch, too (use this for raspberry) 17 | # image: dotwee/mosquitto-cedalo-management-center-arm64:latest 18 | container_name: management-center 19 | environment: 20 | CEDALO_MC_BROKER_USERNAME: ${CEDALO_MC_BROKER_USERNAME} 21 | CEDALO_MC_BROKER_PASSWORD: ${CEDALO_MC_BROKER_PASSWORD} 22 | CEDALO_MC_USERNAME: ${CEDALO_MC_USERNAME} 23 | CEDALO_MC_PASSWORD: ${CEDALO_MC_PASSWORD} 24 | CEDALO_MC_BROKER_ID: mosquitto 25 | CEDALO_MC_BROKER_NAME: Mosquitto 26 | CEDALO_MC_BROKER_URL: mqtt://mosquitto:1883 27 | CEDALO_MC_PROXY_CONFIG_DIR: /management-center/config/config.json 28 | ports: 29 | - 8088:8088 30 | volumes: 31 | - ./data/mcconfig:/management-center/backend/config 32 | -------------------------------------------------------------------------------- /nodered/.env: -------------------------------------------------------------------------------- 1 | TZ=UTC 2 | DEVICE=usb-1a86_USB_Serial-if00-port0 3 | -------------------------------------------------------------------------------- /nodered/README.md: -------------------------------------------------------------------------------- 1 | # NODERED SETUP 2 | 3 | set timezone in `.env` file, then run this, which will set up everything automatically, fixing permissions, creating ssh keys, etc: 4 | 5 | bash setup.sh 6 | 7 | ## OPTIONAL: to access the sqlite db (if needeed) 8 | 9 | the `dbs` line is already uncommented in the docker compose file and will be available in nodered under `/dbs`, so, for example, `/dbs/iot.db` is the default. 10 | 11 | ## OPTIONAL: to allow access to host devices, like serial ports, or bluetooth, or whatever 12 | 13 | check the device id you want to pass through to the container: 14 | 15 | ls /dev/serial/by-id 16 | 17 | then set this device in `.env` file, uncomment the 4 lines you see in the `docker-compose.yml` file, and RESTART the container. 18 | 19 | ## OPTIONAL: to add EXEC permission on the host 20 | 21 | BEWARE, HIGHLY INSECURE if nodered exposed to public and not well protected, the ssh keypair that will be used will allow FULL ROOT ACCESS to the underlying HOST OS!!! 22 | 23 | The setup script above will take care of everything you need to use ssh from nodered container to host with no password needed, and the needed volume with the generated ssh keys is already mounted in the docker compose file. 24 | 25 | Sample flow showing how to run commands on the host: DON'T TOUCH the COMMAND text box you see, it MUST be `ssh host`, exactly this, as `host` is the name configured in the ssh config file, it's CORRECT this way! 26 | 27 | This command will ALWAYS be the same, while you need to add the command you want to exec on the host in the second text box of the node, the one between "append" and "output" (`ls /root/DockerIOT` in this example): 28 | 29 | [{"id":"1b1395421945f1a2","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"365e3bba8d3fb277","type":"inject","z":"1b1395421945f1a2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":320,"y":320,"wires":[["d889a35bfcc63c2f"]]},{"id":"d889a35bfcc63c2f","type":"exec","z":"1b1395421945f1a2","command":"ssh host","addpay":"","append":"ls /root/DockerIOT","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"SSH-HOST","x":550,"y":320,"wires":[["2bbd7f95a746914a"],[],[]]},{"id":"2bbd7f95a746914a","type":"debug","z":"1b1395421945f1a2","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":320,"wires":[]}] 30 | 31 | inject a timestamp, you'll get the content of that folder in the debug node, there will be a little delay, about 1 second, between injection and result, only the 1st time you use it, while next injection will be much faster, as I enabled connection persistance in the ssh config file. 32 | -------------------------------------------------------------------------------- /nodered/data/audio/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /nodered/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | nodered: 3 | container_name: nodered 4 | image: nodered/node-red 5 | volumes: 6 | - ./data:/data 7 | # OPTIONAL, enable only if you want root access to the host, via ssh 8 | - ./ssh:/usr/src/node-red/.ssh 9 | # OPTIONAL, enables access to the sqlite folder, so the 10 | # default db will be available at /dbs/iot.db in nodered 11 | - "../dbs:/dbs" 12 | - /etc/hosts:/etc/hosts:ro 13 | ports: 14 | - 1880:1880 15 | restart: unless-stopped 16 | environment: 17 | - TZ=${TZ} 18 | env_file: 19 | - .env 20 | # next 4 lines are OPTIONAL, enable only if you need access to host serial port 21 | # devices: 22 | # - /dev/serial/by-id/${DEVICE}:/dev/ttyUSB0 23 | # group_add: 24 | # - dialout 25 | -------------------------------------------------------------------------------- /nodered/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | # IP=$(ip route get 1.1.1.1 | grep -oP 'src \K\S+') 5 | PORT=$(grep "^Port" /etc/ssh/sshd_config|cut -d\ -f 2) 6 | 7 | #echo "Fixing container ssh config with detected IP: ${IP} and PORT: ${PORT}" 8 | echo "Fixing container ssh config with detected PORT: ${PORT}" 9 | # sed -i -e "s/Hostname.*/Hostname ${IP}/" ssh/config 10 | sed -i -e "s/Port.*/Port ${PORT}/" ssh/config 11 | 12 | echo "Generating ssh keys and adding them to host authorized_keys file" 13 | ssh-keygen -f ssh/id_nr -t ed25519 -q -N "" 14 | cat ssh/id_nr.pub >> "$HOME"/.ssh/authorized_keys 15 | 16 | echo "Assuring data, ssh and dbs folders and their content are owned by 1000:1000" 17 | chown -R 1000:1000 data ssh ../dbs 18 | 19 | echo "Starting Node-RED container" 20 | docker compose up -d 21 | 22 | echo "Testing ssh connection from container to host." 23 | echo "You should see the HOST release file content below:" 24 | docker compose exec nodered /bin/bash -c "ssh host cat /etc/*rele*" 25 | -------------------------------------------------------------------------------- /nodered/ssh/config: -------------------------------------------------------------------------------- 1 | Host host 2 | Hostname host 3 | Port 22 4 | IdentityFile ~/.ssh/id_nr 5 | User root 6 | StrictHostKeyChecking accept-new 7 | PreferredAuthentications publickey 8 | Compression yes 9 | ControlMaster auto 10 | ControlPath ~/.ssh/control:%h:%p:%r 11 | ControlPersist 10m 12 | -------------------------------------------------------------------------------- /npm/README.md: -------------------------------------------------------------------------------- 1 | # NGINX PROXY MANAGER SETUP 2 | 3 | Default Administrator User 4 | 5 | Email: `admin@example.com` 6 | Password: `changeme` 7 | 8 | Immediately after logging in with this default user you will be asked to modify your details and change your password. 9 | -------------------------------------------------------------------------------- /npm/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | app: 3 | image: 'jc21/nginx-proxy-manager:latest' 4 | restart: unless-stopped 5 | ports: 6 | # These ports are in format : 7 | - '80:80' # Public HTTP Port 8 | - '443:443' # Public HTTPS Port 9 | - '81:81' # Admin Web Port 10 | # Add any other Stream port you want to expose 11 | # - '21:21' # FTP 12 | 13 | # Uncomment the next line if you uncomment anything in the section 14 | # environment: 15 | # Uncomment this if you want to change the location of 16 | # the SQLite DB file within the container 17 | # DB_SQLITE_FILE: "/data/database.sqlite" 18 | 19 | # Uncomment this if IPv6 is not enabled on your host 20 | # DISABLE_IPV6: 'true' 21 | 22 | volumes: 23 | - ./data:/data 24 | - ./letsencrypt:/etc/letsencrypt 25 | -------------------------------------------------------------------------------- /phpliteadmin/.env: -------------------------------------------------------------------------------- 1 | PHPLITEADMIN_PASSWORD=Passw0rd 2 | -------------------------------------------------------------------------------- /phpliteadmin/README.md: -------------------------------------------------------------------------------- 1 | # PHPLITEADMIN SETUP 2 | 3 | put your sqlite DBs in the `dbs` folder, 1 level up of this one, and change password in `.env` file. 4 | -------------------------------------------------------------------------------- /phpliteadmin/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | phpliteadmin: 3 | image: ojooss/phpliteadmin:latest 4 | volumes: 5 | - "../dbs:/dbs" 6 | environment: 7 | PHPLITEADMIN_PASSWORD: ${PHPLITEADMIN_PASSWORD} 8 | PHPLITEADMIN_THEME: 'Sheep' 9 | PHPLITEADMIN_LANGUAGE: 'en' 10 | PHPLITEADMIN_DIRECTORY: '/dbs' 11 | #PHPLITEADMIN_DATABASES: '[{"path":"/dbs/sample.db","name":"Sample"}]' 12 | PHPLITEADMIN_ROWSNUM: '50' 13 | PHPLITEADMIN_CHARSNUM: '500' 14 | PHPLITEADMIN_MAXSAVEDQUERIES: '20' 15 | PHPLITEADMIN_COOKIE_NAME: 'pla' 16 | #PHPLITEADMIN_DEBUG: 'true' 17 | env_file: 18 | - .env 19 | ports: 20 | - "3080:80" 21 | restart: unless-stopped 22 | -------------------------------------------------------------------------------- /portainer/README.md: -------------------------------------------------------------------------------- 1 | # PORTAINER SETUP 2 | 3 | change password in `pass.txt` (MUST be at least 12 chars...) 4 | -------------------------------------------------------------------------------- /portainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | portainer: 3 | image: portainer/portainer-ce:latest 4 | command: --admin-password-file /tmp/portainer_password -H unix:///var/run/docker.sock 5 | security_opt: 6 | - no-new-privileges:true 7 | volumes: 8 | - /etc/localtime:/etc/localtime:ro 9 | - ./pass.txt:/tmp/portainer_password:ro 10 | - /var/run/docker.sock:/var/run/docker.sock:ro 11 | - ./data:/data 12 | ports: 13 | - 9000:9000 14 | restart: unless-stopped 15 | -------------------------------------------------------------------------------- /portainer/pass.txt: -------------------------------------------------------------------------------- 1 | passwd12char 2 | -------------------------------------------------------------------------------- /stirling/.env: -------------------------------------------------------------------------------- 1 | LANG=en_US 2 | -------------------------------------------------------------------------------- /stirling/README.md: -------------------------------------------------------------------------------- 1 | # STIRLING PDF SETUP 2 | 3 | change default lang in `.env` file. Default user: `admin` and pass: `stirling` (change after 1st login) 4 | -------------------------------------------------------------------------------- /stirling/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | stirling-pdf: 3 | image: frooodle/s-pdf:latest 4 | ports: 5 | - '8421:8080' 6 | volumes: 7 | - ./data/trainingData:/usr/share/tesseract-ocr/4.00/tessdata #Required for extra OCR languages 8 | - ./data/extraConfigs:/configs 9 | - ./data/customFiles:/customFiles/ 10 | - ./data/logs:/logs 11 | environment: 12 | - DOCKER_ENABLE_SECURITY=true 13 | - INSTALL_BOOK_AND_ADVANCED_HTML_OPS=false 14 | - LANGS=${LANG} 15 | - SYSTEM_DEFAULTLOCALE=${LANG} 16 | - SECURITY_ENABLELOGIN=true 17 | - SECURITY_CSRFDISABLED=true 18 | -------------------------------------------------------------------------------- /tasmota/README.md: -------------------------------------------------------------------------------- 1 | # TASMOTA SUPPORT SETUP 2 | 3 | TasmoAdmin is on port `8258` and TasmoBackup on port `8259`. 4 | 5 | Set TasmoAdmin user and pass on 1st login. 6 | -------------------------------------------------------------------------------- /tasmota/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | tasmoadmin: 3 | container_name: TasmoAdmin 4 | image: ghcr.io/tasmoadmin/tasmoadmin:latest 5 | ports: 6 | - 8258:80 7 | restart: unless-stopped 8 | volumes: 9 | - ./data/tasmoadmin:/data/tasmoadmin 10 | 11 | tasmobackup: 12 | container_name: TasmoBackup 13 | image: 'danmed/tasmobackupv1' 14 | ports: 15 | - 8259:80 16 | restart: unless-stopped 17 | volumes: 18 | - ./data/tasmobackup:/var/www/html/data 19 | environment: 20 | - DBTYPE=sqlite 21 | - DBNAME=data/tasmobackup 22 | -------------------------------------------------------------------------------- /watchtower/.env: -------------------------------------------------------------------------------- 1 | TZ=UTC 2 | -------------------------------------------------------------------------------- /watchtower/README.md: -------------------------------------------------------------------------------- 1 | # WATCHTOWER SETUP 2 | 3 | set timezone in `.env` file 4 | -------------------------------------------------------------------------------- /watchtower/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | watchtower: 3 | image: containrrr/watchtower 4 | volumes: 5 | - /var/run/docker.sock:/var/run/docker.sock 6 | environment: 7 | - WATCHTOWER_CLEANUP=true 8 | - TZ=${TZ} 9 | restart: unless-stopped 10 | -------------------------------------------------------------------------------- /zigbee2mqtt/.env: -------------------------------------------------------------------------------- 1 | TZ=UTC 2 | DEVICE=usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220714082122-if00 3 | -------------------------------------------------------------------------------- /zigbee2mqtt/README.md: -------------------------------------------------------------------------------- 1 | # ZIGBEE2MQTT SETUP 2 | 3 | set timezone in `.env` file, change your mqtt settings under `data/configuration.yaml` (DO ***NOT*** TOUCH the serial port there!), then connect your usb zigbee dongle, check under `/dev/serial/by-id/` its device name and put it in the `.env` file 4 | -------------------------------------------------------------------------------- /zigbee2mqtt/data/configuration.yaml: -------------------------------------------------------------------------------- 1 | # MQTT settings 2 | mqtt: 3 | # MQTT base topic for zigbee2mqtt MQTT messages 4 | base_topic: zigbee2mqtt 5 | # MQTT server URL 6 | server: 'mqtt://host' # DO ***NOT*** TOUCH! 7 | # MQTT server authentication, uncomment if required: 8 | # user: my_user 9 | # password: my_password 10 | 11 | # Home Assistant integration (MQTT discovery) 12 | homeassistant: false 13 | 14 | # allow new devices to join 15 | permit_join: false 16 | 17 | # Serial settings 18 | serial: 19 | # Location of CC2531 USB sniffer 20 | port: /dev/ttyACM0 # DO ***NOT*** TOUCH! 21 | 22 | frontend: 23 | port: 9099 # DO ***NOT*** TOUCH! 24 | host: 0.0.0.0 # DO ***NOT*** TOUCH! 25 | -------------------------------------------------------------------------------- /zigbee2mqtt/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | zigbee2mqtt: 3 | container_name: zigbee2mqtt 4 | image: koenkk/zigbee2mqtt 5 | restart: unless-stopped 6 | volumes: 7 | - ./data:/app/data 8 | - /run/udev:/run/udev:ro 9 | - /etc/hosts:/etc/hosts:ro 10 | environment: 11 | - TZ=${TZ} 12 | devices: 13 | - /dev/serial/by-id/${DEVICE}:/dev/ttyACM0 14 | ports: 15 | - "9099:9099" 16 | --------------------------------------------------------------------------------