From d45ba97a8fea59571a035069dec2cdeb7f6696c7 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sun, 19 May 2024 17:17:51 -0500 Subject: [PATCH] some updates --- .gitmodules | 8 ++++++++ docker-compose.yml | 4 +++- docker-observation | 1 + scripts/backup.sh | 17 +++++++++++++++++ scripts/create_password.sh | 2 +- 5 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .gitmodules create mode 160000 docker-observation create mode 100755 scripts/backup.sh diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2c83b4d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,8 @@ +[submodule "backup"] + path = backup + url = ssh://gitea/john/file-backups.git + branch = new +[submodule "docker-observation"] + path = docker-observation + url = https://gitea.john-stream.com/john/docker-observation.git + branch = main diff --git a/docker-compose.yml b/docker-compose.yml index 23543dc..ee2c063 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,6 @@ -version: "3" +include: + - ./docker-observation/docker-compose.yml + services: mqtt: container_name: mosquitto diff --git a/docker-observation b/docker-observation new file mode 160000 index 0000000..da4a933 --- /dev/null +++ b/docker-observation @@ -0,0 +1 @@ +Subproject commit da4a933be78b21ee514f6fcf09eb8063d560fb96 diff --git a/scripts/backup.sh b/scripts/backup.sh new file mode 100755 index 0000000..8ae8417 --- /dev/null +++ b/scripts/backup.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +SCRIPT_DIR=$(readlink -f $(dirname "${BASH_SOURCE[0]}")) +DATA_DIR=$SCRIPT_DIR/data + +ENV_FILE=$SCRIPT_DIR/.env +source $ENV_FILE + +docker run -it --rm \ +--hostname $HOSTNAME \ +--env-file $ENV_FILE \ +-v /etc/localtime:/etc/localtime:ro \ +-v /etc/timezone:/etc/timezone:ro \ +-v $DATA_DIR:/data \ +-v $RESTIC_REPO:/repo \ +-e RESTIC_REPOSITORY=/repo \ +restic/restic:latest "$@" diff --git a/scripts/create_password.sh b/scripts/create_password.sh index 1089390..d35e6ba 100755 --- a/scripts/create_password.sh +++ b/scripts/create_password.sh @@ -6,7 +6,7 @@ REPO_DIR=$(dirname $SCRIPT_DIR) COMPOSE_FILE=$REPO_DIR/docker-compose.yml ENV_FILE=$REPO_DIR/.env -echo "Please the mosquitto password:" +echo "Please input the mosquitto password:" read -s MOSQUITTO_PASSWORD docker compose -f $COMPOSE_FILE run -it --rm mqtt mosquitto_passwd -b -c /mosquitto/config/pwfile homeassistant $MOSQUITTO_PASSWORD