Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
enhanced main readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fragolinux committed Apr 26, 2024
1 parent 88cc03c commit 4bffeb3
Showing 1 changed file with 49 additions and 4 deletions.
53 changes: 49 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ Inspired by the excellent work of Peter Scargill ("[The Script](https://www.esp-
- [zigbee2mqtt](https://www.zigbee2mqtt.io/) | Zigbee to MQTT bridge, get rid of your proprietary Zigbee bridges
- More to come...

## enable user root and root ssh login

I know, this is far from being secure and should be avoided, but as this simplifies operations for not skilled people, and in the end it's a local setup, this is what should be done to avoid me the headaches of having to help people with permission issues. You don't agree? Then feel free to study proper security measures and fix this yourself :)

# give root user a password
sudo passwd root

# change these 2 lines in /etc/ssh/sshd_config to allow root login via ssh
PermitRootLogin yes
PasswordAuthentication yes

# now restart ssh to apply changes without reboot
sudo systemctl restart ssh

from now on, EVERY command you'll see MUST be run as root, so you'll not find any reference to sudo anymore

## basic tools requirements

before going on, you'll need some basic tools, like `jq` and `dialog` (both used by my new menu), and of course `git`, so please install them with something similar to this (adapt to your linux distro if it's not debian based):

apt install -y jq dialog git

## install docker

curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh
docker --version

## install docker compose

mkdir -p ~/.docker/cli-plugins/
Expand Down Expand Up @@ -52,6 +80,8 @@ update:
docker compose pull
docker compose up -d --force-recreate

feel free to check `docker --help` and `docker compose --help` to learn a lot more, but this is enough to deal with this setup

## useful aliases

alias docker-compose="docker compose"
Expand All @@ -63,10 +93,25 @@ update:
alias dsh="docker compose exec \$(grep -A1 services docker compose.yml|tail -1|cut -d: -f1|awk '{\$1=\$1};1') /bin/sh"
alias dbash="docker compose exec \$(grep -A1 services docker compose.yml|tail -1|cut -d: -f1|awk '{\$1=\$1};1') /bin/bash"

## custom menu system
note: the last 2 commands need a bit of tuning for docker-compose files containing more than a single service, I'll work on them ASAP

the `iotmenu.sh` script (call it using `bash iotmenu.sh` from inside the main DockerIOT folder) allows easy access to all the services, showing which one is running and on which ports, and all the above docker commands without having to remember their syntax.
## BASIC BACKUP COMMANDS, to be run ALWAYS as root, till a proper backup procedure will be added

# compress a full folder, PRESERVING permissions (change the date as you want)
cd && tar cvzfp DockerIOT-20240414.tgz DockerIOT

# decompress a full folder, PRESERVING permissions
# BEWARE, risk of overwrite if something is already there in same folder, so better renaming the old one before with "mv DockerIOT DockerIOT-orig"
cd && tar xvzfp DockerIOT-20240414.tgz

NOTE: this requires a few addon binaries, like `jq` and `dialog`, please install them with something similar to:
# copy a folder from a linux system to an other, directly without windows:
# BEWARE, risk of overwrite if something is already on the remote system...
cd && scp -r DockerIOT [email protected]:/root

sudo apt install -y jq dialog
# copy a single file from 1 system to an other:
# SAFER way, as file is compressed and has a date in its name:
cd && scp DockerIOT-20240414.tgz [email protected]:/root

## custom menu system

the `iotmenu.sh` script (call it using `bash iotmenu.sh` from inside the main DockerIOT folder) allows easy access to all the services, showing which one is running and on which ports, and all the above docker commands without having to remember their syntax.

0 comments on commit 4bffeb3

Please sign in to comment.