├── .bash_aliases ├── .gitignore ├── .native ├── rpieasy.sh └── rtl_433.sh ├── .templates ├── adminer │ └── service.yml ├── blynk_server │ ├── Dockerfile │ └── service.yml ├── diyhue │ ├── diyhue.env │ └── service.yml ├── espruinohub │ └── service.yml ├── grafana │ ├── grafana.env │ └── service.yml ├── homebridge │ ├── homebridge.env │ └── service.yml ├── influxdb │ ├── influxdb.env │ ├── service.yml │ └── terminal.sh ├── mariadb │ ├── mariadb.env │ ├── service.yml │ └── terminal.sh ├── mosquitto │ ├── directoryfix.sh │ ├── mosquitto.conf │ ├── service.yml │ └── terminal.sh ├── motioneye │ └── service.yml ├── nextcloud │ └── service.yml ├── nodered │ ├── build.sh │ ├── nodered.env │ ├── service.yml │ └── terminal.sh ├── openhab │ └── service.yml ├── pihole │ ├── pihole.env │ └── service.yml ├── plex │ └── service.yml ├── portainer │ └── service.yml ├── postgres │ ├── postgres.env │ ├── service.yml │ └── terminal.sh ├── python │ ├── Dockerfile │ ├── directoryfix.sh │ └── service.yml ├── qbittorrent │ └── service.yml ├── rtl_433 │ ├── Dockerfile │ ├── rtl_433.env │ └── service.yml ├── tasmoadmin │ └── service.yml ├── telegraf │ ├── service.yml │ └── telegraf.conf ├── webthings_gateway │ └── service.yml ├── zigbee2mqtt │ └── service.yml └── zigbee2mqttassistant │ ├── service.yml │ └── zigbee2mqttassistant.env ├── LICENSE ├── README.md ├── duck └── duck.sh ├── menu.sh └── scripts ├── backup_influxdb.sh ├── docker_backup.sh ├── prune-images.sh ├── prune-volumes.sh ├── restart.sh ├── start.sh ├── stop-all.sh ├── stop.sh └── update.sh /.bash_aliases: -------------------------------------------------------------------------------- 1 | alias iotstack_up="docker-compose -f ~/IOTstack/docker-compose.yml up -d" 2 | alias iotstack_down="docker-compose -f ~/IOTstack/docker-compose.yml down" 3 | alias iotstack_start="docker-compose -f ~/IOTstack/docker-compose.yml start" 4 | alias iotstack_stop="docker-compose -f ~/IOTstack/docker-compose.yml stop" 5 | alias iotstack_update="docker-compose -f ~/IOTstack/docker-compose.yml pull" 6 | alias iotstack_build="docker-compose -f ~/IOTstack/docker-compose.yml build" 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #ignore data folders for containers 2 | /services/ 3 | /volumes/ 4 | /backups/ 5 | docker-compose.yml 6 | .outofdate -------------------------------------------------------------------------------- /.native/rpieasy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Updating and installing requirements" 4 | sudo apt-get update && sudo apt-get install -y python3-pip screen alsa-utils wireless-tools wpasupplicant zip unzip git 5 | 6 | sudo pip3 install jsonpickle 7 | 8 | if [ -d ~/rpieasy ]; then 9 | pushd ~/rpieasy 10 | echo "Detected RPIEasy directory, updating project" 11 | git pull origin master 12 | popd 13 | else 14 | git clone https://github.com/enesbcs/rpieasy.git ~/rpieasy 15 | fi 16 | 17 | echo "RPIEasy has been installed or updated" 18 | echo "You can run with 'sudo ~/rpieasy/RPIEasy.py'" -------------------------------------------------------------------------------- /.native/rtl_433.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | sudo touch /etc/modprobe.d/blacklist-rtl.conf 3 | [ $(grep -c rtl28xxu /etc/modprobe.d/blacklist-rtl.conf) -eq 0 ] && sudo echo "blacklist dvb_usb_rtl28xxu" >>/etc/modprobe.d/blacklist-rtl.conf 4 | 5 | sudo touch /etc/modprobe.d/blacklist-rtl8xxxu.conf 6 | [ $(grep -c rtl8xxxu /etc/modprobe.d/blacklist-rtl8xxxu.conf) -eq 0 ] && sudo echo "blacklist rtl8xxxu" >>/etc/modprobe.d/blacklist-rtl8xxxu.conf 7 | 8 | sudo apt-get update 9 | sudo apt-get install -y libtool \ 10 | libusb-1.0.0-dev \ 11 | librtlsdr-dev \ 12 | rtl-sdr \ 13 | doxygen \ 14 | cmake \ 15 | automake 16 | 17 | git clone https://github.com/merbanan/rtl_433.git ~/rtl_433 18 | cd ~/rtl_433/ 19 | mkdir build 20 | cd build 21 | cmake ../ 22 | make 23 | sudo make install 24 | 25 | echo "you should reboot for changes to take effect" -------------------------------------------------------------------------------- /.templates/adminer/service.yml: -------------------------------------------------------------------------------- 1 | adminer: 2 | container_name: adminer 3 | image: adminer 4 | restart: unless-stopped 5 | ports: 6 | - 9080:8080 7 | -------------------------------------------------------------------------------- /.templates/blynk_server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM adoptopenjdk/openjdk11 2 | MAINTAINER Graham Garner 3 | 4 | #RUN apt-get update 5 | #RUN apt-get install -y apt-utils 6 | #RUN apt-get install -y default-jdk curl 7 | 8 | ENV BLYNK_SERVER_VERSION 0.41.10 9 | RUN mkdir /blynk 10 | RUN curl -L https://github.com/blynkkk/blynk-server/releases/download/v${BLYNK_SERVER_VERSION}/server-${BLYNK_SERVER_VERSION}.jar > /blynk/server.jar 11 | 12 | # Create data folder. To persist data, map a volume to /data 13 | RUN mkdir /data 14 | 15 | # Create configuration folder. To persist data, map a file to /config/server.properties 16 | RUN mkdir /config && touch /config/server.properties 17 | VOLUME ["/config", "/data/backup"] 18 | 19 | # IP port listing: 20 | # 8080: Hardware without ssl/tls support 21 | # 9443: Blynk app, https, web sockets, admin port 22 | EXPOSE 8080 9443 23 | 24 | WORKDIR /data 25 | ENTRYPOINT ["java", "-jar", "/blynk/server.jar", "-dataFolder", "/data", "-serverConfig", "/config/server.properties"] -------------------------------------------------------------------------------- /.templates/blynk_server/service.yml: -------------------------------------------------------------------------------- 1 | blynk_server: 2 | build: ./services/blynk_server/. 3 | container_name: blynk_server 4 | restart: unless-stopped 5 | ports: 6 | - 8180:8080 7 | - 8441:8441 8 | - 9443:9443 9 | volumes: 10 | - ./volumes/blynk_server/data:/data 11 | 12 | -------------------------------------------------------------------------------- /.templates/diyhue/diyhue.env: -------------------------------------------------------------------------------- 1 | IP=your_Pi's_IP_here 2 | MAC=your_Pi's_MAC_here 3 | -------------------------------------------------------------------------------- /.templates/diyhue/service.yml: -------------------------------------------------------------------------------- 1 | diyhue: 2 | container_name: diyhue 3 | image: diyhue/core:latest 4 | ports: 5 | - "8070:80/tcp" 6 | - "1900:1900/udp" 7 | - "1982:1982/udp" 8 | - "2100:2100/udp" 9 | # - "443:443/tcp" 10 | env_file: 11 | - ./services/diyhue/diyhue.env 12 | volumes: 13 | - ./volumes/diyhue/:/opt/hue-emulator/export/ 14 | restart: unless-stopped 15 | -------------------------------------------------------------------------------- /.templates/espruinohub/service.yml: -------------------------------------------------------------------------------- 1 | espruinohub: 2 | container_name: espruinohub 3 | image: humbertosales/espruinohub-docker-rpi 4 | network_mode: host 5 | privileged: true 6 | restart: unless-stopped 7 | -------------------------------------------------------------------------------- /.templates/grafana/grafana.env: -------------------------------------------------------------------------------- 1 | #TZ=Africa/Johannesburg 2 | GF_PATHS_DATA=/var/lib/grafana 3 | GF_PATHS_LOGS=/var/log/grafana 4 | # [SERVER] 5 | #GF_SERVER_ROOT_URL=http://localhost:3000/grafana 6 | #GF_SERVER_SERVE_FROM_SUB_PATH=true 7 | # [SECURITY] 8 | #GF_SECURITY_ADMIN_USER=admin 9 | #GF_SECURITY_ADMIN_PASSWORD=admin 10 | -------------------------------------------------------------------------------- /.templates/grafana/service.yml: -------------------------------------------------------------------------------- 1 | grafana: 2 | container_name: grafana 3 | image: grafana/grafana:6.3.6 4 | restart: unless-stopped 5 | user: "0" 6 | ports: 7 | - 3000:3000 8 | env_file: 9 | - ./services/grafana/grafana.env 10 | volumes: 11 | - ./volumes/grafana/data:/var/lib/grafana 12 | - ./volumes/grafana/log:/var/log/grafana 13 | -------------------------------------------------------------------------------- /.templates/homebridge/homebridge.env: -------------------------------------------------------------------------------- 1 | TZ=Europe/London 2 | PGID=1000 3 | PUID=1000 4 | HOMEBRIDGE_CONFIG_UI=1 5 | HOMEBRIDGE_CONFIG_UI_PORT=8080 6 | -------------------------------------------------------------------------------- /.templates/homebridge/service.yml: -------------------------------------------------------------------------------- 1 | homebridge: 2 | container_name: homebridge 3 | image: oznu/homebridge:no-avahi-arm32v6 4 | restart: unless-stopped 5 | network_mode: host 6 | env_file: ./services/homebridge/homebridge.env 7 | volumes: 8 | - ./volumes/homebridge:/homebridge 9 | -------------------------------------------------------------------------------- /.templates/influxdb/influxdb.env: -------------------------------------------------------------------------------- 1 | #INFLUXDB_DB=mydb 2 | INFLUXDB_DATA_ENGINE=tsm1 3 | INFLUXDB_REPORTING_DISABLED=false 4 | #INFLUXDB_HTTP_AUTH_ENABLED=true 5 | INFLUXDB_ADMIN_ENABLED=true 6 | #INFLUXDB_ADMIN_USER=myadminuser 7 | #INFLUXDB_ADMIN_PASSWORD=myadminpassword 8 | INFLUXDB_USER=nodered 9 | INFLUXDB_USER_PASSWORD=nodered 10 | #INFLUXDB_READ_USER=myreaduser 11 | #INFLUXDB_READ_USER_PASSWORD=myreadpassword 12 | #INFLUXDB_WRITE_USER=mywriteuser 13 | #INFLUXDB_WRITE_USER_PASSWORD=mywritepassword 14 | -------------------------------------------------------------------------------- /.templates/influxdb/service.yml: -------------------------------------------------------------------------------- 1 | influxdb: 2 | container_name: influxdb 3 | image: "influxdb:latest" 4 | restart: unless-stopped 5 | ports: 6 | - 8086:8086 7 | - 8083:8083 8 | - 2003:2003 9 | env_file: 10 | - ./services/influxdb/influxdb.env 11 | volumes: 12 | - ./volumes/influxdb/data:/var/lib/influxdb 13 | - ./backups/influxdb/db:/var/lib/influxdb/backup 14 | -------------------------------------------------------------------------------- /.templates/influxdb/terminal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "You are about to enter the influxdb console:" 4 | echo "" 5 | echo "to create a db: CREATE DATABASE myname" 6 | echo "to show existing a databases: SHOW DATABASES" 7 | echo "to use a specific db: USE myname" 8 | echo "" 9 | echo "to exit type: EXIT" 10 | echo "" 11 | 12 | docker exec -it influxdb influx 13 | -------------------------------------------------------------------------------- /.templates/mariadb/mariadb.env: -------------------------------------------------------------------------------- 1 | TZ=Europe/London 2 | PUID=1000 3 | PGID=1000 4 | MYSQL_ROOT_PASSWORD=ROOT_ACCESS_PASSWORD 5 | #MYSQL_DATABASE=USER_DB_NAME 6 | #MYSQL_USER=MYSQL_USER 7 | #MYSQL_PASSWORD=DATABASE_PASSWORD -------------------------------------------------------------------------------- /.templates/mariadb/service.yml: -------------------------------------------------------------------------------- 1 | mariadb: 2 | image: linuxserver/mariadb 3 | container_name: mariadb 4 | env_file: 5 | - ./services/mariadb/mariadb.env 6 | volumes: 7 | - ./volumes/mariadb/config:/config 8 | ports: 9 | - 3306:3306 10 | restart: unless-stopped 11 | 12 | -------------------------------------------------------------------------------- /.templates/mariadb/terminal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "run 'mysql -uroot -p' for terminal access" 4 | docker exec -it mariadb bash 5 | -------------------------------------------------------------------------------- /.templates/mosquitto/directoryfix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ -d ./volumes/mosquitto ] || sudo mkdir -p ./volumes/mosquitto 4 | 5 | #check user 1883 6 | if [ $(grep -c 'user: \"1883\"' ./services/mosquitto/service.yml) -eq 1 ]; then 7 | echo "...found user 1883" 8 | sudo mkdir -p ./volumes/mosquitto/data/ 9 | sudo mkdir -p ./volumes/mosquitto/log/ 10 | sudo chown -R 1883:1883 ./volumes/mosquitto/ 11 | fi 12 | 13 | #check user 0 legacy test 14 | if [ $(grep -c 'user: \"0\"' ./services/mosquitto/service.yml) -eq 1 ]; then 15 | echo "...found user 0 setting ownership for old template" 16 | sudo chown -R root:root ./volumes/mosquitto/ 17 | fi 18 | -------------------------------------------------------------------------------- /.templates/mosquitto/mosquitto.conf: -------------------------------------------------------------------------------- 1 | persistence true 2 | persistence_location /mosquitto/data/ 3 | log_dest file /mosquitto/log/mosquitto.log 4 | #password_file /mosquitto/config/pwfile 5 | -------------------------------------------------------------------------------- /.templates/mosquitto/service.yml: -------------------------------------------------------------------------------- 1 | mosquitto: 2 | container_name: mosquitto 3 | image: eclipse-mosquitto 4 | restart: unless-stopped 5 | user: "1883" 6 | ports: 7 | - 1883:1883 8 | - 9001:9001 9 | volumes: 10 | - ./volumes/mosquitto/data:/mosquitto/data 11 | - ./volumes/mosquitto/log:/mosquitto/log 12 | - ./services/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf 13 | 14 | -------------------------------------------------------------------------------- /.templates/mosquitto/terminal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "you are about to enter the shell for mosquitto" 4 | echo "to add a password: mosquitto_passwd -c /mosquitto/config/pwfile MYUSER" 5 | echo "the command will ask for you password and confirm" 6 | echo "to exit: exit" 7 | 8 | docker exec -it mosquitto sh 9 | -------------------------------------------------------------------------------- /.templates/motioneye/service.yml: -------------------------------------------------------------------------------- 1 | motioneye: 2 | image: "ccrisan/motioneye:master-armhf" 3 | container_name: "motioneye" 4 | restart: unless-stopped 5 | ports: 6 | - 8765:8765 7 | - 8081:8081 8 | volumes: 9 | - /etc/localtime:/etc/localtime:ro 10 | - ./volumes/motioneye/etc_motioneye:/etc/motioneye 11 | - ./volumes/motioneye/var_lib_motioneye:/var/lib/motioneye 12 | #devices: 13 | # - "/dev/video0:/dev/video0" 14 | 15 | -------------------------------------------------------------------------------- /.templates/nextcloud/service.yml: -------------------------------------------------------------------------------- 1 | nextcloud: 2 | image: nextcloud 3 | container_name: nextcloud 4 | ports: 5 | - 9321:80 6 | volumes: 7 | - ./volumes/nextcloud/html:/var/www/html 8 | restart: unless-stopped 9 | depends_on: 10 | - nextcloud_db 11 | links: 12 | - nextcloud_db 13 | 14 | nextcloud_db: 15 | image: linuxserver/mariadb 16 | container_name: nextcloud_db 17 | volumes: 18 | - ./volumes/nextcloud/db:/config 19 | environment: 20 | - MYSQL_ROOT_PASSWORD=password 21 | - MYSQL_PASSWORD=password 22 | - MYSQL_DATABASE=nextcloud 23 | - MYSQL_USER=nextcloud 24 | restart: unless-stopped 25 | 26 | -------------------------------------------------------------------------------- /.templates/nodered/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # build Dockerfile for nodered 4 | 5 | node_selection=$(whiptail --title "Node-RED nodes" --checklist --separate-output \ 6 | "Use the [SPACEBAR] to select the nodes you want preinstalled" 20 78 12 -- \ 7 | "node-red-node-pi-gpiod" " " "ON" \ 8 | "node-red-dashboard" " " "ON" \ 9 | "node-red-node-openweathermap" " " "OFF" \ 10 | "node-red-node-google" " " "OFF" \ 11 | "node-red-node-emoncms" " " "OFF" \ 12 | "node-red-node-geofence" " " "OFF" \ 13 | "node-red-node-ping" " " "OFF" \ 14 | "node-red-node-random" " " "OFF" \ 15 | "node-red-node-smooth" " " "OFF" \ 16 | "node-red-node-darksky" " " "OFF" \ 17 | "node-red-node-sqlite" " " "OFF" \ 18 | "node-red-contrib-influxdb" " " "ON" \ 19 | "node-red-contrib-config" " " "OFF" \ 20 | "node-red-contrib-grove" " " "OFF" \ 21 | "node-red-contrib-diode" " " "OFF" \ 22 | "node-red-contrib-bigtimer" " " "OFF" \ 23 | "node-red-contrib-esplogin" " " "OFF" \ 24 | "node-red-contrib-timeout" " " "OFF" \ 25 | "node-red-contrib-moment" " " "OFF" \ 26 | "node-red-contrib-particle" " " "OFF" \ 27 | "node-red-contrib-web-worldmap" " " "OFF" \ 28 | "node-red-contrib-ramp-thermostat" " " "OFF" \ 29 | "node-red-contrib-isonline" " " "OFF" \ 30 | "node-red-contrib-npm" " " "OFF" \ 31 | "node-red-contrib-file-function" " " "OFF" \ 32 | "node-red-contrib-boolean-logic" " " "OFF" \ 33 | "node-red-contrib-home-assistant-websocket" " " "OFF" \ 34 | "node-red-contrib-blynk-ws" " " "OFF" \ 35 | "node-red-contrib-owntracks" " " "OFF" \ 36 | "node-red-contrib-alexa-local" " " "OFF" \ 37 | "node-red-contrib-heater-controller" " " "OFF" \ 38 | 3>&1 1>&2 2>&3) 39 | 40 | ##echo "$check_selection" 41 | mapfile -t checked_nodes <<<"$node_selection" 42 | 43 | nr_dfile=./services/nodered/Dockerfile 44 | 45 | sqliteflag=0 46 | 47 | touch $nr_dfile 48 | echo "FROM nodered/node-red:latest" >$nr_dfile 49 | #node red install script inspired from https://tech.scargill.net/the-script/ 50 | echo "RUN for addonnodes in \\" >>$nr_dfile 51 | for checked in "${checked_nodes[@]}"; do 52 | #test to see if sqlite is selected and set flag, sqlite require additional flags 53 | if [ "$checked" = "node-red-node-sqlite" ]; then 54 | sqliteflag=1 55 | else 56 | echo "$checked \\" >>$nr_dfile 57 | fi 58 | done 59 | echo "; do \\" >>$nr_dfile 60 | echo "npm install \${addonnodes} ;\\" >>$nr_dfile 61 | echo "done;" >>$nr_dfile 62 | 63 | [ $sqliteflag = 1 ] && echo "RUN npm install --unsafe-perm node-red-node-sqlite" >>$nr_dfile 64 | -------------------------------------------------------------------------------- /.templates/nodered/nodered.env: -------------------------------------------------------------------------------- 1 | #TZ=timezone -------------------------------------------------------------------------------- /.templates/nodered/service.yml: -------------------------------------------------------------------------------- 1 | nodered: 2 | container_name: nodered 3 | build: ./services/nodered/. 4 | restart: unless-stopped 5 | user: "0" 6 | privileged: true 7 | env_file: ./services/nodered/nodered.env 8 | ports: 9 | - 1880:1880 10 | volumes: 11 | - ./volumes/nodered/data:/data 12 | -------------------------------------------------------------------------------- /.templates/nodered/terminal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo 'to generate a new password hash copy the following line and change PASSWORD' 4 | echo $'node -e "console.log(require(\'bcryptjs\').hashSync(process.argv[1], 8));" PASSWORD' 5 | echo 'then "exit"' 6 | 7 | docker exec -it nodered bash 8 | -------------------------------------------------------------------------------- /.templates/openhab/service.yml: -------------------------------------------------------------------------------- 1 | openhab: 2 | image: "openhab/openhab:2.4.0" 3 | container_name: openhab 4 | restart: unless-stopped 5 | network_mode: host 6 | # cap_add: 7 | # - NET_ADMIN 8 | # - NET_RAW 9 | volumes: 10 | - "/etc/localtime:/etc/localtime:ro" 11 | - "/etc/timezone:/etc/timezone:ro" 12 | - "./volumes/openhab/addons:/openhab/addons" 13 | - "./volumes/openhab/conf:/openhab/conf" 14 | - "./volumes/openhab/userdata:/openhab/userdata" 15 | environment: 16 | OPENHAB_HTTP_PORT: "8080" 17 | OPENHAB_HTTPS_PORT: "8443" 18 | EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin" 19 | # # The command node is very important. It overrides 20 | # # the "gosu openhab tini -s ./start.sh" command from Dockerfile and runs as root! 21 | # command: "tini -s ./start.sh server" 22 | -------------------------------------------------------------------------------- /.templates/pihole/pihole.env: -------------------------------------------------------------------------------- 1 | #TZ=America/Chicago 2 | WEBPASSWORD=pihole 3 | #DNS1=8.8.8.8 4 | #DNS2=8.8.4.4 5 | #DNSSEC=false 6 | #DNS_BOGUS_PRIV=True 7 | #CONDITIONAL_FORWARDING=False 8 | #CONDITIONAL_FORWARDING_IP=your_router_ip_here (only if CONDITIONAL_FORWARDING=ture) 9 | #CONDITIONAL_FORWARDING_DOMAIN=optional 10 | #CONDITIONAL_FORWARDING_REVERSE=optional 11 | #ServerIP=your_Pi's_IP_here << recommended 12 | #ServerIPv6= your_Pi's_ipv6_here << Required if using ipv6 13 | #VIRTUAL_HOST=$ServerIP 14 | #IPv6=True 15 | INTERFACE=eth0 16 | #DNSMASQ_LISTENING=local -------------------------------------------------------------------------------- /.templates/pihole/service.yml: -------------------------------------------------------------------------------- 1 | pihole: 2 | container_name: pihole 3 | image: pihole/pihole:latest 4 | ports: 5 | - "53:53/tcp" 6 | - "53:53/udp" 7 | - "67:67/udp" 8 | - "8089:80/tcp" 9 | #- "443:443/tcp" 10 | env_file: 11 | - ./services/pihole/pihole.env 12 | volumes: 13 | - ./volumes/pihole/etc-pihole/:/etc/pihole/ 14 | - ./volumes/pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/ 15 | dns: 16 | - 127.0.0.1 17 | - 1.1.1.1 18 | # Recommended but not required (DHCP needs NET_ADMIN) 19 | # https://github.com/pi-hole/docker-pi-hole#note-on-capabilities 20 | cap_add: 21 | - NET_ADMIN 22 | restart: unless-stopped 23 | -------------------------------------------------------------------------------- /.templates/plex/service.yml: -------------------------------------------------------------------------------- 1 | plex: 2 | image: linuxserver/plex 3 | container_name: plex 4 | network_mode: host 5 | environment: 6 | - PUID=1000 7 | - PGID=1000 8 | - VERSION=docker 9 | #- UMASK_SET=022 #optional 10 | volumes: 11 | - ./volumes/plex/config:/config 12 | #- ~/mnt/HDD/tvseries:/tv 13 | #- ~/mnt/HDD/movies:/movies 14 | - ./volumes/plex/transcode:/transcode 15 | restart: unless-stopped 16 | -------------------------------------------------------------------------------- /.templates/portainer/service.yml: -------------------------------------------------------------------------------- 1 | portainer: 2 | container_name: portainer 3 | image: portainer/portainer 4 | restart: unless-stopped 5 | ports: 6 | - 9000:9000 7 | volumes: 8 | - /var/run/docker.sock:/var/run/docker.sock 9 | - ./volumes/portainer/data:/data 10 | -------------------------------------------------------------------------------- /.templates/postgres/postgres.env: -------------------------------------------------------------------------------- 1 | POSTGRES_USER=postuser 2 | POSTGRES_PASSWORD=postpassword 3 | POSTGRES_DB=postdb -------------------------------------------------------------------------------- /.templates/postgres/service.yml: -------------------------------------------------------------------------------- 1 | postgres: 2 | container_name: postgres 3 | image: postgres 4 | restart: unless-stopped 5 | env_file: 6 | - ./services/postgres/postgres.env 7 | ports: 8 | - 5432:5432 9 | volumes: 10 | - ./volumes/postgres/data:/var/lib/postgresql/data 11 | -------------------------------------------------------------------------------- /.templates/postgres/terminal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo 'Use the command "psql DATABASE USER" to enter your database, replace DATABASE and USER with your values' 4 | echo "Remember to end queries with a semicolon ;" 5 | 6 | docker exec -it postgres bash -------------------------------------------------------------------------------- /.templates/python/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3 2 | 3 | WORKDIR /usr/src/app 4 | 5 | COPY requirements.txt ./ 6 | 7 | RUN pip install --no-cache-dir -r requirements.txt 8 | 9 | CMD [ "python", "./app.py" ] -------------------------------------------------------------------------------- /.templates/python/directoryfix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Directoryfix for python 4 | 5 | if [ ! -d ./volumes/python/app ]; then 6 | sudo mkdir -p ./volumes/python/app 7 | sudo chown -R pi:pi ./volumes/python 8 | echo 'print("hello world")' >./volumes/python/app/app.py 9 | 10 | fi 11 | -------------------------------------------------------------------------------- /.templates/python/service.yml: -------------------------------------------------------------------------------- 1 | python: 2 | container_name: python 3 | build: ./services/python/. 4 | restart: unless-stopped 5 | network_mode: host 6 | volumes: 7 | - ./volumes/python/app:/usr/src/app 8 | -------------------------------------------------------------------------------- /.templates/qbittorrent/service.yml: -------------------------------------------------------------------------------- 1 | qbittorrent: 2 | image: linuxserver/qbittorrent 3 | container_name: qbittorrent 4 | environment: 5 | - PUID=1000 6 | - PGID=1000 7 | - UMASK_SET=022 8 | - WEBUI_PORT=15080 9 | volumes: 10 | - ./volumes/qbittorrent/config:/config 11 | - ./volumes/qbittorrent/downloads:/downloads 12 | ports: 13 | - 6881:6881 14 | - 6881:6881/udp 15 | - 15080:15080 16 | - 1080:1080 17 | -------------------------------------------------------------------------------- /.templates/rtl_433/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim 2 | 3 | ENV MQTT_ADDRESS mosquitto 4 | ENV MQTT_PORT 1883 5 | ENV MQTT_USER "" 6 | ENV MQTT_PASSWORD "" 7 | ENV MQTT_TOPIC RTL_433 8 | 9 | RUN apt-get update && apt-get install -y git libtool libusb-1.0.0-dev librtlsdr-dev rtl-sdr cmake automake && \ 10 | git clone https://github.com/merbanan/rtl_433.git /tmp/rtl_433 && \ 11 | cd /tmp/rtl_433/ && \ 12 | mkdir build && \ 13 | cd build && \ 14 | cmake ../ && \ 15 | make && \ 16 | make install 17 | 18 | CMD ["sh", "-c", "rtl_433 -F mqtt://${MQTT_ADDRESS}:${MQTT_PORT},events=${MQTT_TOPIC},user=${MQTT_USER},pass=${MQTT_PASSWORD}"] 19 | -------------------------------------------------------------------------------- /.templates/rtl_433/rtl_433.env: -------------------------------------------------------------------------------- 1 | TZ=Africa/Johannesburg 2 | MQTT_ADDRESS=mosquitto 3 | MQTT_PORT=1883 4 | #MQTT_USER="" 5 | #MQTT_PASSWORD="" 6 | MQTT_TOPIC=RTL_433 -------------------------------------------------------------------------------- /.templates/rtl_433/service.yml: -------------------------------------------------------------------------------- 1 | rtl_433: 2 | container_name: rtl_433 3 | build: ./services/rtl_433/. 4 | env_file: 5 | - ./services/rtl_433/rtl_433.env 6 | devices: 7 | - /dev/bus/usb 8 | restart: unless-stopped 9 | -------------------------------------------------------------------------------- /.templates/tasmoadmin/service.yml: -------------------------------------------------------------------------------- 1 | tasmoadmin: 2 | container_name: tasmoadmin 3 | image: raymondmm/tasmoadmin 4 | restart: unless-stopped 5 | ports: 6 | - "8088:80" 7 | volumes: 8 | - ./volumes/tasmoadmin/data:/data 9 | 10 | -------------------------------------------------------------------------------- /.templates/telegraf/service.yml: -------------------------------------------------------------------------------- 1 | telegraf: 2 | container_name: telegraf 3 | image: telegraf 4 | volumes: 5 | - ./services/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro 6 | depends_on: 7 | - influxdb 8 | - mosquitto 9 | -------------------------------------------------------------------------------- /.templates/telegraf/telegraf.conf: -------------------------------------------------------------------------------- 1 | # Telegraf Configuration 2 | # 3 | # Telegraf is entirely plugin driven. All metrics are gathered from the 4 | # declared inputs, and sent to the declared outputs. 5 | # 6 | # Plugins must be declared in here to be active. 7 | # To deactivate a plugin, comment out the name and any variables. 8 | # 9 | # Use 'telegraf -config telegraf.conf -test' to see what metrics a config 10 | # file would generate. 11 | # 12 | # Environment variables can be used anywhere in this config file, simply surround 13 | # them with ${}. For strings the variable must be within quotes (ie, "${STR_VAR}"), 14 | # for numbers and booleans they should be plain (ie, ${INT_VAR}, ${BOOL_VAR}) 15 | 16 | 17 | # Global tags can be specified here in key="value" format. 18 | [global_tags] 19 | # dc = "us-east-1" # will tag all metrics with dc=us-east-1 20 | # rack = "1a" 21 | ## Environment variables can be used as tags, and throughout the config file 22 | # user = "$USER" 23 | 24 | 25 | # Configuration for telegraf agent 26 | [agent] 27 | ## Default data collection interval for all inputs 28 | interval = "10s" 29 | ## Rounds collection interval to 'interval' 30 | ## ie, if interval="10s" then always collect on :00, :10, :20, etc. 31 | round_interval = true 32 | 33 | ## Telegraf will send metrics to outputs in batches of at most 34 | ## metric_batch_size metrics. 35 | ## This controls the size of writes that Telegraf sends to output plugins. 36 | metric_batch_size = 1000 37 | 38 | ## Maximum number of unwritten metrics per output. 39 | metric_buffer_limit = 10000 40 | 41 | ## Collection jitter is used to jitter the collection by a random amount. 42 | ## Each plugin will sleep for a random time within jitter before collecting. 43 | ## This can be used to avoid many plugins querying things like sysfs at the 44 | ## same time, which can have a measurable effect on the system. 45 | collection_jitter = "0s" 46 | 47 | ## Default flushing interval for all outputs. Maximum flush_interval will be 48 | ## flush_interval + flush_jitter 49 | flush_interval = "10s" 50 | ## Jitter the flush interval by a random amount. This is primarily to avoid 51 | ## large write spikes for users running a large number of telegraf instances. 52 | ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s 53 | flush_jitter = "0s" 54 | 55 | ## By default or when set to "0s", precision will be set to the same 56 | ## timestamp order as the collection interval, with the maximum being 1s. 57 | ## ie, when interval = "10s", precision will be "1s" 58 | ## when interval = "250ms", precision will be "1ms" 59 | ## Precision will NOT be used for service inputs. It is up to each individual 60 | ## service input to set the timestamp at the appropriate precision. 61 | ## Valid time units are "ns", "us" (or "µs"), "ms", "s". 62 | precision = "" 63 | 64 | ## Log at debug level. 65 | # debug = false 66 | ## Log only error level messages. 67 | # quiet = false 68 | 69 | ## Log file name, the empty string means to log to stderr. 70 | # logfile = "" 71 | 72 | ## The logfile will be rotated after the time interval specified. When set 73 | ## to 0 no time based rotation is performed. Logs are rotated only when 74 | ## written to, if there is no log activity rotation may be delayed. 75 | # logfile_rotation_interval = "0d" 76 | 77 | ## The logfile will be rotated when it becomes larger than the specified 78 | ## size. When set to 0 no size based rotation is performed. 79 | # logfile_rotation_max_size = "0MB" 80 | 81 | ## Maximum number of rotated archives to keep, any older logs are deleted. 82 | ## If set to -1, no archives are removed. 83 | # logfile_rotation_max_archives = 5 84 | 85 | ## Override default hostname, if empty use os.Hostname() 86 | hostname = "" 87 | ## If set to true, do no set the "host" tag in the telegraf agent. 88 | omit_hostname = false 89 | 90 | 91 | ############################################################################### 92 | # OUTPUT PLUGINS # 93 | ############################################################################### 94 | 95 | 96 | # Configuration for sending metrics to InfluxDB 97 | [[outputs.influxdb]] 98 | # The full HTTP or UDP URL for your InfluxDB instance. 99 | # 100 | # Multiple URLs can be specified for a single cluster, only ONE of the 101 | # urls will be written to each interval. 102 | # urls = ["unix:///var/run/influxdb.sock"] 103 | # urls = ["udp://influxdb:8089"] 104 | urls = ["http://influxdb:8086"] 105 | 106 | # The target database for metrics; will be created as needed. 107 | # For UDP url endpoint database needs to be configured on server side. 108 | database = "telegraf" 109 | 110 | # The value of this tag will be used to determine the database. If this 111 | # tag is not set the 'database' option is used as the default. 112 | database_tag = "" 113 | 114 | # If true, the database tag will not be added to the metric. 115 | exclude_database_tag = false 116 | 117 | # If true, no CREATE DATABASE queries will be sent. Set to true when using 118 | # Telegraf with a user without permissions to create databases or when the 119 | # database already exists. 120 | skip_database_creation = false 121 | 122 | # Name of existing retention policy to write to. Empty string writes to 123 | # the default retention policy. Only takes effect when using HTTP. 124 | retention_policy = "" 125 | 126 | # Write consistency (clusters only), can be: "any", "one", "quorum", "all". 127 | # Only takes effect when using HTTP. 128 | write_consistency = "any" 129 | 130 | # Timeout for HTTP messages. 131 | timeout = "5s" 132 | 133 | # HTTP Basic Auth 134 | username = "telegraf" 135 | password = "metricsmetricsmetricsmetrics" 136 | 137 | # HTTP User-Agent 138 | user_agent = "telegraf" 139 | 140 | # UDP payload size is the maximum packet size to send. 141 | udp_payload = "512B" 142 | 143 | ## Optional TLS Config for use on HTTP connections. 144 | # tls_ca = "/etc/telegraf/ca.pem" 145 | # tls_cert = "/etc/telegraf/cert.pem" 146 | # tls_key = "/etc/telegraf/key.pem" 147 | ## Use TLS but skip chain & host verification 148 | # insecure_skip_verify = false 149 | # 150 | ## HTTP Proxy override, if unset values the standard proxy environment 151 | ## variables are consulted to determine which proxy, if any, should be used. 152 | # http_proxy = "http://corporate.proxy:3128" 153 | 154 | ## Additional HTTP headers 155 | # http_headers = {"X-Special-Header" = "Special-Value"} 156 | 157 | ## HTTP Content-Encoding for write request body, can be set to "gzip" to 158 | ## compress body or "identity" to apply no encoding. 159 | # content_encoding = "identity" 160 | 161 | ## When true, Telegraf will output unsigned integers as unsigned values, 162 | ## i.e.: "42u". You will need a version of InfluxDB supporting unsigned 163 | ## integer values. Enabling this option will result in field type errors if 164 | ## existing data has been written. 165 | # influx_uint_support = false 166 | 167 | # Read metrics from MQTT topic(s) 168 | [[inputs.mqtt_consumer]] 169 | ## MQTT broker URLs to be used. The format should be scheme://host:port, 170 | ## schema can be tcp, ssl, or ws. 171 | servers = ["tcp://mosquitto:1883"] 172 | 173 | ## Topics that will be subscribed to. 174 | topics = [ 175 | "telegraf/host01/cpu", 176 | "telegraf/+/mem", 177 | "sensors/#", 178 | ] 179 | 180 | ## The message topic will be stored in a tag specified by this value. If set 181 | ## to the empty string no topic tag will be created. 182 | # topic_tag = "topic" 183 | 184 | ## QoS policy for messages 185 | ## 0 = at most once 186 | ## 1 = at least once 187 | ## 2 = exactly once 188 | ## 189 | ## When using a QoS of 1 or 2, you should enable persistent_session to allow 190 | ## resuming unacknowledged messages. 191 | # qos = 0 192 | 193 | ## Connection timeout for initial connection in seconds 194 | # connection_timeout = "30s" 195 | 196 | ## Maximum messages to read from the broker that have not been written by an 197 | ## output. For best throughput set based on the number of metrics within 198 | ## each message and the size of the output's metric_batch_size. 199 | ## 200 | ## For example, if each message from the queue contains 10 metrics and the 201 | ## output metric_batch_size is 1000, setting this to 100 will ensure that a 202 | ## full batch is collected and the write is triggered immediately without 203 | ## waiting until the next flush_interval. 204 | max_undelivered_messages = 1000 205 | 206 | ## Persistent session disables clearing of the client session on connection. 207 | ## In order for this option to work you must also set client_id to identity 208 | ## the client. To receive messages that arrived while the client is offline, 209 | ## also set the qos option to 1 or 2 and don't forget to also set the QoS when 210 | ## publishing. 211 | # persistent_session = false 212 | 213 | ## If unset, a random client ID will be generated. 214 | # client_id = "" 215 | 216 | ## Username and password to connect MQTT server. 217 | # username = "telegraf" 218 | # password = "metricsmetricsmetricsmetrics" 219 | 220 | ## Optional TLS Config 221 | # tls_ca = "/etc/telegraf/ca.pem" 222 | # tls_cert = "/etc/telegraf/cert.pem" 223 | # tls_key = "/etc/telegraf/key.pem" 224 | ## Use TLS but skip chain & host verification 225 | # insecure_skip_verify = false 226 | 227 | ## Data format to consume. 228 | ## Each data format has its own unique set of configuration options, read 229 | ## more about them here: 230 | ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md 231 | 232 | #data_format = "influx" 233 | data_format = "json" 234 | #tag_keys = [ 235 | # "temperature", 236 | # "humidity" 237 | #] -------------------------------------------------------------------------------- /.templates/webthings_gateway/service.yml: -------------------------------------------------------------------------------- 1 | webthings_gateway: 2 | image: mozillaiot/gateway:arm 3 | container_name: webthings_gateway 4 | network_mode: host 5 | #ports: 6 | # - 8080:8080 7 | # - 4443:4443 8 | #devices: 9 | # - /dev/ttyACM0:/dev/ttyACM0 10 | volumes: 11 | - ./volumes/webthings_gateway/share:/home/node/.mozilla-iot 12 | 13 | -------------------------------------------------------------------------------- /.templates/zigbee2mqtt/service.yml: -------------------------------------------------------------------------------- 1 | zigbee2mqtt: 2 | container_name: zigbee2mqtt 3 | image: koenkk/zigbee2mqtt 4 | volumes: 5 | - ./volumes/zigbee2mqtt/data:/app/data 6 | - /run/udev:/run/udev:ro 7 | devices: 8 | - /dev/ttyAMA0:/dev/ttyACM0 9 | #- /dev/ttyACM0:/dev/ttyACM0 10 | restart: always 11 | network_mode: host 12 | privileged: true 13 | environment: 14 | - TZ=Europe/Amsterdam 15 | -------------------------------------------------------------------------------- /.templates/zigbee2mqttassistant/service.yml: -------------------------------------------------------------------------------- 1 | zigbee2mqttassistant: 2 | container_name: zigbee2mqttassistant 3 | image: carldebilly/zigbee2mqttassistant 4 | restart: unless-stopped 5 | env_file: 6 | - ./services/zigbee2mqttassistant/zigbee2mqttassistant.env 7 | ports: 8 | - 8880:80 9 | environment: 10 | - VIRTUAL_HOST=~^zigbee2mqttassistant\..*\.xip\.io 11 | - VIRTUAL_PORT=8880 12 | -------------------------------------------------------------------------------- /.templates/zigbee2mqttassistant/zigbee2mqttassistant.env: -------------------------------------------------------------------------------- 1 | #TZ=Europe/Budapest \ 2 | Z2MA_SETTINGS__MQTTSERVER=mosquitto 3 | #Z2MA_SETTINGS__MQTTUSERNAME= 4 | #Z2MA_SETTINGS__MQTTPASSWORD= 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IOTStack 2 | 3 | This project has been migrated. Please find the maintained version at: https://github.com/SensorsIot/IOTstack 4 | 5 | ## Announcements !! Migrated !! 6 | 7 | This project has been migrated. Please find the maintained version at: https://github.com/SensorsIot/IOTstack 8 | 9 | To migrate your current IOTstack version, you can run: 10 | 11 | ``` 12 | $ cd ~/IOTstack 13 | $ git remote set-url origin https://github.com/SensorsIot/IOTstack.git 14 | $ git fetch origin master 15 | $ git reset --hard origin/master 16 | $ docker-compose down 17 | $ ./menu.sh 18 | $ docker-compose up -d 19 | ``` 20 | 21 | This will override any changes you've made locally on files git tracks. 22 | 23 | If you have questions about migrating your current stack, or why the migration occured, please ask on the Discord: 24 | https://discord.gg/ZpKHnks 25 | 26 | Any PRs created, or issues raised on this repo may not be answered. 27 | 28 | *** 29 | 30 | *** 31 | 32 | ## Old Readme: 33 | 34 | IOTstack is a builder for docker-compose to easily make and maintain IoT stacks on the Raspberry Pi 35 | 36 | The bulk of the README has moved to the Wiki. Please check it out [here](https://github.com/gcgarner/IOTstack/wiki) 37 | 38 | ## About 39 | 40 | Docker stack for getting started on IoT on the Raspberry Pi. 41 | 42 | This Docker stack consists of: 43 | 44 | * Node-RED 45 | * Grafana 46 | * InfluxDB 47 | * Postgres 48 | * Mosquitto mqtt 49 | * Portainer 50 | * Adminer 51 | * openHAB 52 | * Home Assistant (HASSIO) 53 | * zigbee2mqtt 54 | * Pi-Hole 55 | * TasmoAdmin (parial wiki) 56 | * Plex media server 57 | * Telegraf (wiki coming soon) 58 | * RTL_433 59 | * EspruinoHub (testing) 60 | * MotionEye 61 | * MariaDB 62 | * Plex 63 | * Homebridge 64 | 65 | In addition, there is a write-up and some scripts to get a dynamic DNS via duckdns and VPN up and running. 66 | 67 | Firstly what is docker? The correct question is "what are containers?". Docker is just one of the utilities to run a container. 68 | 69 | A Container can be thought of as ultra-minimal virtual machines, they are a collection of binaries that run in a sandbox environment. You download a preconfigured base image and create a new container. Only the differences between the base and your "VM" are stored. 70 | Containers don't have [GUI](https://en.wikipedia.org/wiki/Graphical_user_interface)s so generally the way you interact with them is via web services or you can launch into a terminal. 71 | One of the major advantages is that the image comes mostly preconfigured. 72 | 73 | There are pro's and cons for using native installs vs containers. For me, one of the best parts of containers is that it doesn't "clutter" your device. If you don't need Postgres anymore then just stop and delete the container. It will be like the container was never there. 74 | 75 | The container will fail if you try to run the docker and native vesions as the same time. It is best to install this on a fresh system. 76 | 77 | For those looking for a script that installs native applications check out [Peter Scargill's script](https://tech.scargill.net/the-script/) 78 | 79 | ## Tested platform 80 | 81 | Raspberry Pi 3B and 4B Raspbian (Buster) 82 | 83 | ### Older Pi's 84 | 85 | Docker will not run on a PiZero or A model 1 because of the CPU. It has not been tested on a Model 2. You can still use Peter Scargill's [script](https://tech.scargill.net/the-script/) 86 | 87 | ## Running under a virtual machine 88 | 89 | For those wanting to test out the script in a Virtual Machine before installing on their Pi there are some limitations. The script is designed to work with Debian based distributions. Not all the container have x86_64 images. For example Portainer does not and will give an error when you try and start the stack. Please see the pinned issue [#29](https://github.com/gcgarner/IOTstack/issues/29), there is more info there. 90 | 91 | ## Feature Requests 92 | 93 | Please direct all feature requests to [Discord](https://discord.gg/W45tD83) 94 | 95 | ## Youtube reference 96 | 97 | This repo was originally inspired by Andreas Spiess's video on using some of these tools. Some containers have been added to extend its functionality. 98 | 99 | [YouTube video](https://www.youtube.com/watch?v=JdV4x925au0): This is an alternative approach to the setup. Be sure to watch the video for the instructions. Just note that the network addresses are different, see the wiki under Docker Networks. 100 | 101 | ### YouTube guide 102 | 103 | @peyanski (Kiril) made a YouTube video on getting started using the project, check it out [here](https://youtu.be/5JMNHuHv134) 104 | 105 | ## Download the project 106 | 107 | 1.On the lite image you will need to install git first 108 | 109 | ```bash 110 | sudo apt-get install git 111 | ``` 112 | 113 | 2.Download the repository with: 114 | 115 | ```bash 116 | git clone https://github.com/gcgarner/IOTstack.git ~/IOTstack 117 | ``` 118 | 119 | Due to some script restraints, this project needs to be stored in ~/IOTstack 120 | 121 | 3.To enter the directory run: 122 | 123 | ```bash 124 | cd ~/IOTstack 125 | ``` 126 | 127 | ## The Menu 128 | 129 | I've added a menu to make things easier. It is good to familiarise yourself with the installation process. 130 | The menu can be used to install docker and build the docker-compose.yml file necessary for starting the stack. It also runs a few common commands. I do recommend you start to learn the docker and docker-compose commands if you plan on using docker in the long run. I've added several helper scripts, have a look inside. 131 | 132 | Navigate to the project folder and run `./menu.sh` 133 | 134 | ### Installing from the menu 135 | 136 | Select the first option and follow the prompts 137 | 138 | ### Build the docker-compose file 139 | 140 | docker-compose uses the `docker-compose.yml` file to configure all the services. Run through the menu to select the options you want to install. 141 | 142 | ### Docker commands 143 | 144 | This menu executes shell scripts in the root of the project. It is not necessary to run them from the menu. Open up the shell script files to see what is inside and what they do. 145 | 146 | ### Miscellaneous commands 147 | 148 | Some helpful commands have been added like disabling swap. 149 | 150 | ## Running Docker commands 151 | 152 | From this point on make sure you are executing the commands from inside the project folder. Docker-compose commands need to be run from the folder where the docker-compose.yml is located. If you want to move the folder make sure you move the whole project folder. 153 | 154 | ## Starting and Stopping containers 155 | 156 | to start the stack navigate to the project folder containing the docker-compose.yml file 157 | 158 | To start the stack run: 159 | `docker-compose up -d` or `./scripts/start.sh` 160 | 161 | To stop: 162 | `docker-compose stop` 163 | 164 | The first time you run 'start' the stack docker will download all the images for the web. Depending on how many containers you selected and your internet speed this can take a long while. 165 | 166 | The `docker-compose down` command stops the containers then deletes them. 167 | 168 | ## Persistent data 169 | 170 | Docker allows you to map folders inside your containers to folders on the disk. This is done with the "volume" key. There are two types of volumes. Modification to the container are reflected in the volume. 171 | 172 | ## See Wiki for further info 173 | 174 | [Wiki](https://github.com/gcgarner/IOTstack/wiki) 175 | 176 | ## Add to the project 177 | 178 | Feel free to add your comments on features or images that you think should be added. 179 | 180 | ## Contributions 181 | 182 | If you use some of the tools in the project please consider donating or contributing on their projects. It doesn't have to be monetary, reporting bugs and PRs help improve the projects for everyone. 183 | 184 | ### Thanks 185 | 186 | @mrmx, @oscrx, @brianimmel, @Slyke, @AugustasV, @Paulf007, @affankingkhan, @877dev, @Paraphraser, @stfnhmplr, @peyanski, @cmskedgell 187 | -------------------------------------------------------------------------------- /duck/duck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Your comma-separated domains list 3 | DOMAINS="YOUR_DOMAINS" 4 | # Your DuckDNS Token 5 | DUCKDNS_TOKEN="YOUR_DUCKDNS_TOKEN" 6 | curl -k -o /var/log/duck.log "https://www.duckdns.org/update?domains=${DOMAINS}&token=${DUCKDNS_TOKEN}&ip=" 7 | -------------------------------------------------------------------------------- /menu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #get path of menu correct 4 | pushd ~/IOTstack 5 | 6 | #This is the Display name for the menu 7 | #structure : [CONTAINER]=MENU Display Text 8 | #One entry per line to simplify PRs 9 | declare -A cont_array=( 10 | [portainer]="Portainer" 11 | [nodered]="Node-RED" 12 | [influxdb]="InfluxDB" 13 | [telegraf]="Telegraf (Requires InfluxDB and Mosquitto)" 14 | [grafana]="Grafana" 15 | [mosquitto]="Eclipse-Mosquitto" 16 | [postgres]="Postgres" 17 | [mariadb]="MariaDB (MySQL fork)" 18 | [adminer]="Adminer" 19 | [openhab]="openHAB" 20 | [zigbee2mqtt]="zigbee2mqtt" 21 | [pihole]="Pi-Hole" 22 | [plex]="Plex media server" 23 | [tasmoadmin]="TasmoAdmin" 24 | [rtl_433]="RTL_433 to mqtt" 25 | [espruinohub]="EspruinoHub" 26 | [motioneye]="motionEye" 27 | [webthings_gateway]="Mozilla webthings-gateway" 28 | [blynk_server]="blynk-server" 29 | [nextcloud]="Next-Cloud" 30 | [nginx]="NGINX by linuxserver" 31 | [diyhue]="diyHue" 32 | [homebridge]="Homebridge" 33 | [python]="Python 3" 34 | [qbittorrent]="qbittorrent" 35 | [zigbee2mqttassistant]="zigbee2mqttassistant" 36 | ) 37 | 38 | #The convension for CONTAINER is that it is the name of the .templates/CONTAINER directory and as the key below for the relevant arch 39 | 40 | # keys for CONTAINER 41 | # One per line to simply PR 42 | declare -a armhf_keys=( 43 | "portainer" 44 | "nodered" 45 | "influxdb" 46 | "grafana" 47 | "mosquitto" 48 | "telegraf" 49 | "mariadb" 50 | "postgres" 51 | "adminer" 52 | "openhab" 53 | "zigbee2mqtt" 54 | "pihole" 55 | "plex" 56 | "tasmoadmin" 57 | "rtl_433" 58 | "espruinohub" 59 | "motioneye" 60 | "webthings_gateway" 61 | "blynk_server" 62 | "nextcloud" 63 | "diyhue" 64 | "homebridge" 65 | "python" 66 | "zigbee2mqttassistant" 67 | "qbittorrent" 68 | ) 69 | 70 | sys_arch=$(uname -m) 71 | 72 | #timezones 73 | timezones() { 74 | 75 | env_file=$1 76 | TZ=$(cat /etc/timezone) 77 | 78 | #test for TZ= 79 | [ $(grep -c "TZ=" $env_file) -ne 0 ] && sed -i "/TZ=/c\TZ=$TZ" $env_file 80 | 81 | } 82 | 83 | # this function creates the volumes, services and backup directories. It then assisgns the current user to the ACL to give full read write access 84 | docker_setfacl() { 85 | [ -d ./services ] || mkdir ./services 86 | [ -d ./volumes ] || mkdir ./volumes 87 | [ -d ./backups ] || mkdir ./backups 88 | 89 | #give current user rwx on the volumes and backups 90 | [ $(getfacl ./volumes | grep -c "default:user:$USER") -eq 0 ] && sudo setfacl -Rdm u:$USER:rwx ./volumes 91 | [ $(getfacl ./backups | grep -c "default:user:$USER") -eq 0 ] && sudo setfacl -Rdm u:$USER:rwx ./backups 92 | } 93 | 94 | #future function add password in build phase 95 | password_dialog() { 96 | while [[ "$passphrase" != "$passphrase_repeat" || ${#passphrase} -lt 8 ]]; do 97 | 98 | passphrase=$(whiptail --passwordbox "${passphrase_invalid_message}Please enter the passphrase (8 chars min.):" 20 78 3>&1 1>&2 2>&3) 99 | passphrase_repeat=$(whiptail --passwordbox "Please repeat the passphrase:" 20 78 3>&1 1>&2 2>&3) 100 | passphrase_invalid_message="Passphrase too short, or not matching! " 101 | done 102 | echo $passphrase 103 | } 104 | #test=$( password_dialog ) 105 | 106 | function command_exists() { 107 | command -v "$@" >/dev/null 2>&1 108 | } 109 | 110 | #function copies the template yml file to the local service folder and appends to the docker-compose.yml file 111 | function yml_builder() { 112 | 113 | service="services/$1/service.yml" 114 | 115 | [ -d ./services/ ] || mkdir ./services/ 116 | 117 | if [ -d ./services/$1 ]; then 118 | #directory already exists prompt user to overwrite 119 | sevice_overwrite=$(whiptail --radiolist --title "Overwrite Option" --notags \ 120 | "$1 service directory has been detected, use [SPACEBAR] to select you overwrite option" 20 78 12 \ 121 | "none" "Do not overwrite" "ON" \ 122 | "env" "Preserve Environment and Config files" "OFF" \ 123 | "full" "Pull full service from template" "OFF" \ 124 | 3>&1 1>&2 2>&3) 125 | 126 | case $sevice_overwrite in 127 | 128 | "full") 129 | echo "...pulled full $1 from template" 130 | rsync -a -q .templates/$1/ services/$1/ --exclude 'build.sh' 131 | ;; 132 | "env") 133 | echo "...pulled $1 excluding env file" 134 | rsync -a -q .templates/$1/ services/$1/ --exclude 'build.sh' --exclude '$1.env' --exclude '*.conf' 135 | ;; 136 | "none") 137 | echo "...$1 service not overwritten" 138 | ;; 139 | 140 | esac 141 | 142 | else 143 | mkdir ./services/$1 144 | echo "...pulled full $1 from template" 145 | rsync -a -q .templates/$1/ services/$1/ --exclude 'build.sh' 146 | fi 147 | 148 | 149 | #if an env file exists check for timezone 150 | [ -f "./services/$1/$1.env" ] && timezones ./services/$1/$1.env 151 | 152 | #add new line then append service 153 | echo "" >>docker-compose.yml 154 | cat $service >>docker-compose.yml 155 | 156 | #test for post build 157 | if [ -f ./.templates/$1/build.sh ]; then 158 | chmod +x ./.templates/$1/build.sh 159 | bash ./.templates/$1/build.sh 160 | fi 161 | 162 | #test for directoryfix.sh 163 | if [ -f ./.templates/$1/directoryfix.sh ]; then 164 | chmod +x ./.templates/$1/directoryfix.sh 165 | echo "...Running directoryfix.sh on $1" 166 | bash ./.templates/$1/directoryfix.sh 167 | fi 168 | 169 | #make sure terminal.sh is executable 170 | [ -f ./services/$1/terminal.sh ] && chmod +x ./services/$1/terminal.sh 171 | 172 | } 173 | 174 | #--------------------------------------------------------------------------------------------------- 175 | # Project updates 176 | echo "checking for project update" 177 | git fetch origin master 178 | 179 | if [ $(git status | grep -c "Your branch is up to date") -eq 1 ]; then 180 | #delete .outofdate if it exisist 181 | [ -f .outofdate ] && rm .outofdate 182 | echo "Project is up to date" 183 | 184 | else 185 | echo "An update is available for the project" 186 | if [ ! -f .outofdate ]; then 187 | whiptail --title "Project update" --msgbox "An update is available for the project\nYou will not be reminded again until you next update" 8 78 188 | touch .outofdate 189 | fi 190 | fi 191 | 192 | 193 | if [ ! -f .migrated ]; then 194 | if (whiptail --title "Project migration" --yesno "Project has been migrated to another repository.\n\nPlease see readme.md\n\nDo you want to exit? Choosing no will hide this prompt in the future.\n\nReadme:\nhttps://github.com/gcgarner/IOTstack/blob/master/README.md\n\n\nMigrated Project Repo:\nhttps://github.com/SensorsIot/IOTstack" 20 78); then 195 | exit 196 | fi 197 | touch .migrated 198 | fi 199 | 200 | #--------------------------------------------------------------------------------------------------- 201 | # Menu system starts here 202 | # Display main menu 203 | mainmenu_selection=$(whiptail --title "Main Menu" --menu --notags \ 204 | "" 20 78 12 -- \ 205 | "install" "Install Docker" \ 206 | "build" "Build Stack" \ 207 | "hassio" "Install Hass.io (Requires Docker)" \ 208 | "native" "Native Installs" \ 209 | "commands" "Docker commands" \ 210 | "backup" "Backup options" \ 211 | "misc" "Miscellaneous commands" \ 212 | "update" "Update IOTstack" \ 213 | 3>&1 1>&2 2>&3) 214 | 215 | case $mainmenu_selection in 216 | #MAINMENU Install docker ------------------------------------------------------------ 217 | "install") 218 | #sudo apt update && sudo apt upgrade -y ;; 219 | 220 | if command_exists docker; then 221 | echo "docker already installed" 222 | else 223 | echo "Install Docker" 224 | curl -fsSL https://get.docker.com | sh 225 | sudo usermod -aG docker $USER 226 | fi 227 | 228 | if command_exists docker-compose; then 229 | echo "docker-compose already installed" 230 | else 231 | echo "Install docker-compose" 232 | sudo apt install -y docker-compose 233 | fi 234 | 235 | if (whiptail --title "Restart Required" --yesno "It is recommended that you restart your device now. Select yes to do so now" 20 78); then 236 | sudo reboot 237 | fi 238 | ;; 239 | #MAINMENU Build stack ------------------------------------------------------------ 240 | "build") 241 | 242 | title=$'Container Selection' 243 | message=$'Use the [SPACEBAR] to select which containers you would like to install' 244 | entry_options=() 245 | 246 | #check architecture and display appropriate menu 247 | if [ $(echo "$sys_arch" | grep -c "arm") ]; then 248 | keylist=("${armhf_keys[@]}") 249 | else 250 | echo "your architecture is not supported yet" 251 | exit 252 | fi 253 | 254 | #loop through the array of descriptions 255 | for index in "${keylist[@]}"; do 256 | entry_options+=("$index") 257 | entry_options+=("${cont_array[$index]}") 258 | 259 | #check selection 260 | if [ -f ./services/selection.txt ]; then 261 | [ $(grep "$index" ./services/selection.txt) ] && entry_options+=("ON") || entry_options+=("OFF") 262 | else 263 | entry_options+=("OFF") 264 | fi 265 | done 266 | 267 | container_selection=$(whiptail --title "$title" --notags --separate-output --checklist \ 268 | "$message" 20 78 12 -- "${entry_options[@]}" 3>&1 1>&2 2>&3) 269 | 270 | mapfile -t containers <<<"$container_selection" 271 | 272 | #if no container is selected then dont overwrite the docker-compose.yml file 273 | if [ -n "$container_selection" ]; then 274 | touch docker-compose.yml 275 | echo "version: '2'" >docker-compose.yml 276 | echo "services:" >>docker-compose.yml 277 | 278 | #set the ACL for the stack 279 | #docker_setfacl 280 | 281 | # store last sellection 282 | [ -f ./services/selection.txt ] && rm ./services/selection.txt 283 | #first run service directory wont exist 284 | [ -d ./services ] || mkdir services 285 | touch ./services/selection.txt 286 | #Run yml_builder of all selected containers 287 | for container in "${containers[@]}"; do 288 | echo "Adding $container container" 289 | yml_builder "$container" 290 | echo "$container" >>./services/selection.txt 291 | done 292 | 293 | # add custom containers 294 | if [ -f ./services/custom.txt ]; then 295 | if (whiptail --title "Custom Container detected" --yesno "custom.txt has been detected do you want to add these containers to the stack?" 20 78); then 296 | mapfile -t containers <<<$(cat ./services/custom.txt) 297 | for container in "${containers[@]}"; do 298 | echo "Adding $container container" 299 | yml_builder "$container" 300 | done 301 | fi 302 | fi 303 | 304 | echo "docker-compose successfully created" 305 | echo "run 'docker-compose up -d' to start the stack" 306 | else 307 | 308 | echo "Build cancelled" 309 | 310 | fi 311 | ;; 312 | #MAINMENU Docker commands ----------------------------------------------------------- 313 | "commands") 314 | 315 | docker_selection=$( 316 | whiptail --title "Docker commands" --menu --notags \ 317 | "Shortcut to common docker commands" 20 78 12 -- \ 318 | "aliases" "Add iotstack_up and iotstack_down aliases" \ 319 | "start" "Start stack" \ 320 | "restart" "Restart stack" \ 321 | "stop" "Stop stack" \ 322 | "stop_all" "Stop any running container regardless of stack" \ 323 | "pull" "Update all containers" \ 324 | "prune_volumes" "Delete all stopped containers and docker volumes" \ 325 | "prune_images" "Delete all images not associated with container" \ 326 | 3>&1 1>&2 2>&3 327 | ) 328 | 329 | case $docker_selection in 330 | "start") ./scripts/start.sh ;; 331 | "stop") ./scripts/stop.sh ;; 332 | "stop_all") ./scripts/stop-all.sh ;; 333 | "restart") ./scripts/restart.sh ;; 334 | "pull") ./scripts/update.sh ;; 335 | "prune_volumes") ./scripts/prune-volumes.sh ;; 336 | "prune_images") ./scripts/prune-images.sh ;; 337 | "aliases") 338 | touch ~/.bash_aliases 339 | if [ $(grep -c 'IOTstack' ~/.bash_aliases) -eq 0 ]; then 340 | echo ". ~/IOTstack/.bash_aliases" >>~/.bash_aliases 341 | echo "added aliases" 342 | else 343 | echo "aliases already added" 344 | fi 345 | source ~/.bashrc 346 | echo "aliases will be available after a reboot" 347 | ;; 348 | esac 349 | ;; 350 | #Backup menu --------------------------------------------------------------------- 351 | "backup") 352 | backup_sellection=$(whiptail --title "Backup Options" --menu --notags \ 353 | "Select backup option" 20 78 12 -- \ 354 | "dropbox-uploader" "Dropbox-Uploader" \ 355 | "rclone" "google drive via rclone" \ 356 | 3>&1 1>&2 2>&3) 357 | 358 | case $backup_sellection in 359 | 360 | "dropbox-uploader") 361 | if [ ! -d ~/Dropbox-Uploader ]; then 362 | git clone https://github.com/andreafabrizi/Dropbox-Uploader.git ~/Dropbox-Uploader 363 | chmod +x ~/Dropbox-Uploader/dropbox_uploader.sh 364 | pushd ~/Dropbox-Uploader && ./dropbox_uploader.sh 365 | popd 366 | else 367 | echo "Dropbox uploader already installed" 368 | fi 369 | 370 | #add enable file for Dropbox-Uploader 371 | [ -d ~/IOTstack/backups ] || sudo mkdir -p ~/IOTstack/backups/ 372 | sudo touch ~/IOTstack/backups/dropbox 373 | ;; 374 | "rclone") 375 | sudo apt install -y rclone 376 | echo "Please run 'rclone config' to configure the rclone google drive backup" 377 | 378 | #add enable file for rclone 379 | [ -d ~/IOTstack/backups ] || sudo mkdir -p ~/IOTstack/backups/ 380 | sudo touch ~/IOTstack/backups/rclone 381 | ;; 382 | esac 383 | ;; 384 | #MAINMENU Misc commands------------------------------------------------------------ 385 | "misc") 386 | misc_sellection=$( 387 | whiptail --title "Miscellaneous Commands" --menu --notags \ 388 | "Some helpful commands" 20 78 12 -- \ 389 | "swap" "Disable swap by uninstalling swapfile" \ 390 | "swappiness" "Disable swap by setting swappiness to 0" \ 391 | "log2ram" "install log2ram to decrease load on sd card, moves /var/log into ram" \ 392 | 3>&1 1>&2 2>&3 393 | ) 394 | 395 | case $misc_sellection in 396 | "swap") 397 | sudo dphys-swapfile swapoff 398 | sudo dphys-swapfile uninstall 399 | sudo update-rc.d dphys-swapfile remove 400 | sudo systemctl disable dphys-swapfile 401 | #sudo apt-get remove dphys-swapfile 402 | echo "Swap file has been removed" 403 | ;; 404 | "swappiness") 405 | if [ $(grep -c swappiness /etc/sysctl.conf) -eq 0 ]; then 406 | echo "vm.swappiness=0" | sudo tee -a /etc/sysctl.conf 407 | echo "updated /etc/sysctl.conf with vm.swappiness=0" 408 | else 409 | sudo sed -i "/vm.swappiness/c\vm.swappiness=0" /etc/sysctl.conf 410 | echo "vm.swappiness found in /etc/sysctl.conf update to 0" 411 | fi 412 | 413 | sudo sysctl vm.swappiness=0 414 | echo "set swappiness to 0 for immediate effect" 415 | ;; 416 | "log2ram") 417 | if [ ! -d ~/log2ram ]; then 418 | git clone https://github.com/azlux/log2ram.git ~/log2ram 419 | chmod +x ~/log2ram/install.sh 420 | pushd ~/log2ram && sudo ./install.sh 421 | popd 422 | else 423 | echo "log2ram already installed" 424 | fi 425 | ;; 426 | esac 427 | ;; 428 | 429 | "hassio") 430 | echo "install requirements for hass.io" 431 | sudo apt install -y bash jq curl avahi-daemon dbus 432 | hassio_machine=$(whiptail --title "Machine type" --menu \ 433 | "Please select you device type" 20 78 12 -- \ 434 | "raspberrypi4" " " \ 435 | "raspberrypi3" " " \ 436 | "raspberrypi2" " " \ 437 | "raspberrypi4-64" " " \ 438 | "raspberrypi3-64" " " \ 439 | "qemux86" " " \ 440 | "qemux86-64" " " \ 441 | "qemuarm" " " \ 442 | "qemuarm-64" " " \ 443 | "orangepi-prime" " " \ 444 | "odroid-xu" " " \ 445 | "odroid-c2" " " \ 446 | "intel-nuc" " " \ 447 | "tinker" " " \ 448 | 3>&1 1>&2 2>&3) 449 | if [ -n "$hassio_machine" ]; then 450 | curl -sL https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh | sudo bash -s -- -m $hassio_machine 451 | else 452 | echo "no selection" 453 | exit 454 | fi 455 | ;; 456 | "update") 457 | echo "Pulling latest project file from Github.com ---------------------------------------------" 458 | git pull origin master 459 | echo "git status ------------------------------------------------------------------------------" 460 | git status 461 | ;; 462 | "native") 463 | 464 | native_selections=$(whiptail --title "Native installs" --menu --notags \ 465 | "Install local applications" 20 78 12 -- \ 466 | "rtl_433" "RTL_433" \ 467 | "rpieasy" "RPIEasy" \ 468 | 3>&1 1>&2 2>&3) 469 | 470 | case $native_selections in 471 | "rtl_433") 472 | bash ./.native/rtl_433.sh 473 | ;; 474 | "rpieasy") 475 | bash ./.native/rpieasy.sh 476 | ;; 477 | esac 478 | ;; 479 | *) ;; 480 | 481 | esac 482 | 483 | popd 484 | -------------------------------------------------------------------------------- /scripts/backup_influxdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #first move the contents of the old backup out and clear the directory 4 | echo "Moving old influxdb backups if they exist" 5 | [ -d ~/IOTstack/backups/influxdb/db_old ] || sudo mkdir ~/IOTstack/backups/influxdb/db_old 6 | sudo rm ~/IOTstack/backups/influxdb/db_old/* >/dev/null 2>&1 7 | sudo mv ~/IOTstack/backups/influxdb/db/* ~/IOTstack/backups/influxdb/db_old/ >/dev/null 2>&1 8 | #sudo rm ~/IOTstack/backups/influxdb/db/* 9 | 10 | #execute the backup command 11 | echo "backing up influxdb database" 12 | docker exec influxdb influxd backup -portable /var/lib/influxdb/backup >/dev/null 2>&1 13 | echo "influxdb backup complete" 14 | -------------------------------------------------------------------------------- /scripts/docker_backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pushd ~/IOTstack 4 | 5 | [ -d ./backups ] || mkdir ./backups 6 | 7 | #create the list of files to backup 8 | echo "./docker-compose.yml" >list.txt 9 | echo "./services/" >>list.txt 10 | echo "./volumes/" >>list.txt 11 | 12 | #if influxdb is running 13 | if [ $(docker ps | grep -c influxdb) -gt 0 ]; then 14 | ./scripts/backup_influxdb.sh 15 | echo "./backups/influxdb/" >>list.txt 16 | fi 17 | 18 | #setup variables 19 | logfile=./backups/log_local.txt 20 | backupfile="backup-$(date +"%Y-%m-%d_%H%M").tar.gz" 21 | 22 | #compress the backups folders to archive 23 | echo "compressing stack folders" 24 | sudo tar -czf \ 25 | ./backups/$backupfile \ 26 | --exclude=./volumes/influxdb/* \ 27 | --exclude=./volumes/nextcloud/* \ 28 | -T list.txt 29 | 30 | rm list.txt 31 | 32 | #set permission for backup files 33 | sudo chown pi:pi ./backups/backup* 34 | 35 | #create local logfile and append the latest backup file to it 36 | echo "backup saved to ./backups/$backupfile" 37 | sudo touch $logfile 38 | sudo chown pi:pi $logfile 39 | echo $backupfile >>$logfile 40 | 41 | #show size of archive file 42 | du -h ./backups/$backupfile 43 | 44 | #remove older local backup files 45 | #to change backups retained, change below +8 to whatever you want (days retained +1) 46 | ls -t1 ./backups/backup* | tail -n +8 | sudo xargs rm -f 47 | echo "last seven local backup files are saved in ~/IOTstack/backups" 48 | 49 | 50 | 51 | #cloud related - dropbox 52 | if [ -f ./backups/dropbox ]; then 53 | 54 | #setup variables 55 | dropboxfolder=/IOTstackBU 56 | dropboxuploader=~/Dropbox-Uploader/dropbox_uploader.sh 57 | dropboxlog=./backups/log_dropbox.txt 58 | 59 | #upload new backup to dropbox 60 | echo "uploading to dropbox" 61 | $dropboxuploader upload ./backups/$backupfile $backupfile 62 | 63 | #list older files to be deleted from cloud (exludes last 7) 64 | #to change dropbox backups retained, change below -7 to whatever you want 65 | echo "checking for old backups on dropbox" 66 | files=$($dropboxuploader list $dropboxfolder | awk {' print $3 '} | tail -n +2 | head -n -7) 67 | 68 | #write files to be deleted to dropbox logfile 69 | sudo touch $dropboxlog 70 | sudo chown pi:pi $dropboxlog 71 | echo $files | tr " " "\n" >$dropboxlog 72 | 73 | #delete files from dropbox as per logfile 74 | echo "deleting old backups from dropbox if they exist - last 7 files are kept" 75 | 76 | #check older files exist on dropbox, if yes then delete them 77 | if [ $( echo "$files" | grep -c "backup") -ne 0 ] ; then 78 | input=$dropboxlog 79 | while IFS= read -r file 80 | do 81 | $dropboxuploader delete $dropboxfolder/$file 82 | done < "$input" 83 | fi 84 | 85 | echo "backups deleted from dropbox" >>$dropboxlog 86 | 87 | fi 88 | 89 | 90 | #cloud related - google drive 91 | if [ -f ./backups/rclone ]; then 92 | echo "synching to Google Drive" 93 | echo "latest 7 backup files are kept" 94 | #sync local backups to gdrive (older gdrive copies will be deleted) 95 | rclone sync -P ./backups --include "/backup*" gdrive:/IOTstackBU/ 96 | echo "synch with Google Drive complete" 97 | fi 98 | 99 | 100 | popd 101 | -------------------------------------------------------------------------------- /scripts/prune-images.sh: -------------------------------------------------------------------------------- 1 | docker image prune -a 2 | -------------------------------------------------------------------------------- /scripts/prune-volumes.sh: -------------------------------------------------------------------------------- 1 | docker system prune --volumes 2 | 3 | -------------------------------------------------------------------------------- /scripts/restart.sh: -------------------------------------------------------------------------------- 1 | docker-compose restart 2 | -------------------------------------------------------------------------------- /scripts/start.sh: -------------------------------------------------------------------------------- 1 | docker-compose up -d -------------------------------------------------------------------------------- /scripts/stop-all.sh: -------------------------------------------------------------------------------- 1 | docker container stop $(docker container ls -aq) 2 | -------------------------------------------------------------------------------- /scripts/stop.sh: -------------------------------------------------------------------------------- 1 | docker-compose down -------------------------------------------------------------------------------- /scripts/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Stopping containers" 4 | docker-compose down 5 | 6 | echo "Downloading latest images from docker hub ... this can take a long time" 7 | docker-compose pull 8 | 9 | echo "Building images if needed" 10 | docker-compose build 11 | 12 | echo "Starting stack up again" 13 | docker-compose up -d 14 | 15 | echo "Consider running prune-images to free up space" 16 | --------------------------------------------------------------------------------