Skip to content

Commit 93b3333

Browse files
Added option to fix permissions and update Readme
1 parent 74d7366 commit 93b3333

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Additionally you should run c't-Smart-Home behind a reverse proxy like [Traefik]
8585
—————————————————————————————
8686
Usage:
8787
start.sh update – to update this copy of the repo
88+
start.sh fix – correct the permissions in the data folder
8889
start.sh start – run all containers
8990
start.sh stop – stop all containers
9091
start.sh data – set up the data folder needed for the containers, but run none of them. Useful for personalized setups.
@@ -134,6 +135,10 @@ You could try, but we don't support it on a Mac.
134135

135136
We probably removed some unnecessary or outdated nodes. Check which are missing and look in the palette for them. Most likely you can reinstall them from there.
136137

138+
### Node-RED won't start after an update. The logs show permission errors. How do I fix this?
139+
140+
For security reasons the Node-RED service won't run as root anymore. It now runs with the GID and UID 1000. To fix this issue you must set the GID and UID of data/nodered and all of its content to 1000. You can use `start.sh fix` to correct those issues.
141+
137142
## Container images and Versions
138143

139144
The Node-RED container image is a variation on [the official one](https://hub.docker.com/r/nodered/node-red) provided by the Node-RED project. We provide versions based on Node.js versions 10 (Maintenance LTS), 12 (Maintenance LTS) and 14 (Active LTS). See Node.js [releases page](https://nodejs.org/en/about/releases/) for support cycles. The container image based on Active LTS will always be the default. You can freely modify your copy of the compose file to use a different container image or even create your own image.

start.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ echo '⚠️ Disable permit_join in data/zigbee/configuration.yaml or the Zigbe
7474

7575
}
7676

77+
function fix_permissions {
78+
echo '📄 Setting the permissions of the configurations in the data folder.'
79+
sudo chown 1883:1883 data/mqtt
80+
sudo chown -Rf 1883:1883 data/mqtt/*
81+
sudo chown 1000:1000 data/nodered
82+
sudo chown -Rf 1000:1000 data/nodered/*
83+
}
84+
85+
7786
function build_data_structure {
7887
echo '📄 Configuration folder ./data is missing. Creating it from scratch.'
7988
mkdir -p data/mqtt/config
@@ -88,10 +97,7 @@ function build_data_structure {
8897
create_zigbee2mqtt_config
8998
fi
9099

91-
sudo chown 1883:1883 data/mqtt
92-
sudo chown -R 1883:1883 data/mqtt/*
93-
sudo chown 1000:1000 data/nodered
94-
sudo chown -Rf 1000:1000 data/nodered/*
100+
fix_permissions
95101
}
96102

97103
function check_dependencies {
@@ -143,7 +149,7 @@ Then copy the current version from GitHub to this folder and run
143149
./start.sh start.
144150
145151
Alternatively create a Git clone of the repository."
146-
exit 1
152+
exit 1
147153
fi
148154
echo '☠️ Shutting down all running containers and removing them.'
149155
docker-compose down --remove-orphans
@@ -163,6 +169,7 @@ exit 1
163169
echo '⚠️ Updating failed. Please check the repository on GitHub.'
164170
fi
165171
start
172+
fix_permissions
166173
}
167174

168175
check_dependencies
@@ -177,6 +184,9 @@ case "$1" in
177184
"update")
178185
update
179186
;;
187+
"fix")
188+
fix_permissions
189+
;;
180190
"data")
181191
build_data_structure
182192
;;
@@ -186,6 +196,7 @@ case "$1" in
186196
—————————————————————————————
187197
Usage:
188198
start.sh update – update to the latest release version
199+
start.sh fix – correct the permissions in the data folder
189200
start.sh start – run all containers
190201
start.sh stop – stop all containers
191202
start.sh data – set up the data folder needed for the containers, but run none of them. Useful for personalized setups.

0 commit comments

Comments
 (0)