From 40dcf57953bacc5db9c487e9852e664e05f87384 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 5 Feb 2021 18:08:21 +0000 Subject: [PATCH] updating configuration --- .gitignore | 3 +++ Makefile | 18 ++++++++++++++++++ docker-compose.yaml | 1 + sent.json | 4 ++-- settings.env.sample | 2 ++ 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 Makefile create mode 100644 settings.env.sample diff --git a/.gitignore b/.gitignore index a460f48..40dd390 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ syntax: glob *.userosscache *.sln.docstates +#settings files +*.env + # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..07f725e --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +#SHELL := /bin/bash + +ARGS = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}` + +update_secrets_sample: + @echo "Masking env files..." + @find . -name *.env | xargs -I{} cp {} {}.sample + @find . -name *.env.sample | xargs -I{} sed -i "s/\=.*/\=xxxxxxxxx/g" {} + +# @cat zigbee2mqtt/settings/configuration.yaml | sed "s/\:.*/\: xxxxxxxxx/g" > zigbee2mqtt/settings/configuration.yaml.sample #mask passwords + +commit: update_secrets_sample + git add . + git diff-index --quiet HEAD || git commit -m "$(call ARGS,\"updating configuration\")" + git push + +%: + @: diff --git a/docker-compose.yaml b/docker-compose.yaml index eb8e9b0..6dbe5a6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,6 +6,7 @@ services: restart: always volumes: - "./sent.json:/app/sent.json" + env_file: ./settings.env environment: - TZ=Europe/Moscow logging: diff --git a/sent.json b/sent.json index 2d22911..2bd2826 100644 --- a/sent.json +++ b/sent.json @@ -1,5 +1,4 @@ [ - 622, 621, 620, 619, @@ -28,5 +27,6 @@ 594, 593, 592, - 591 + 591, + 622 ] \ No newline at end of file diff --git a/settings.env.sample b/settings.env.sample new file mode 100644 index 0000000..9e87f61 --- /dev/null +++ b/settings.env.sample @@ -0,0 +1,2 @@ +token: test +chatid: -1 \ No newline at end of file