Skip to content

Commit 0c6d564

Browse files
committed
remove assumption user ID is 1000
On menu.sh start, store current UID and GID to .env, if they are missing. Use these to run services that use a customized user.
1 parent be46277 commit 0c6d564

File tree

26 files changed

+118
-72
lines changed

26 files changed

+118
-72
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
/.tmp/*
66
__pycache__
77
docker-compose.yml
8+
docker-compose.override.yml
89
compose-override.yml
10+
.env
911
postbuild.sh
1012
pre_backup.sh
1113
post_backup.sh

.templates/blynk_server/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ blynk_server:
77
restart: unless-stopped
88
environment:
99
- TZ=Etc/UTC
10-
- IOTSTACK_UID=1000
11-
- IOTSTACK_GID=1000
10+
- IOTSTACK_UID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
11+
- IOTSTACK_GID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
1212
ports:
1313
- "8180:8080"
1414
- "8440:8440"

.templates/domoticz/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ domoticz:
1010
restart: unless-stopped
1111
network_mode: bridge
1212
environment:
13-
- PUID=1000
14-
- PGID=1000
13+
- PUID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
14+
- PGID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
1515
# - TZ=
1616
# - WEBROOT=domoticz
1717

.templates/gitea/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ gitea:
66
- "7920:3000/tcp"
77
- "2222:22/tcp"
88
environment:
9-
- USER_UID=1000
10-
- USER_GID=1000
9+
- USER_UID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
10+
- USER_GID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
1111
volumes:
1212
- ./volumes/gitea/data:/data
1313
- /etc/timezone:/etc/timezone:ro

.templates/heimdall/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ heimdall:
22
image: ghcr.io/linuxserver/heimdall
33
container_name: heimdall
44
environment:
5-
- PUID=1000
6-
- PGID=1000
5+
- PUID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
6+
- PGID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
77
- TZ=Europe/Paris
88
volumes:
99
- ./volumes/heimdall/config:/config

.templates/homebridge/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ homebridge:
44
restart: unless-stopped
55
environment:
66
- TZ=Etc/UTC
7-
- PGID=1000
8-
- PUID=1000
7+
- PGID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
8+
- PUID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
99
- HOMEBRIDGE_CONFIG_UI=1
1010
- HOMEBRIDGE_CONFIG_UI_PORT=8581
1111
volumes:

.templates/homer/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ homer:
22
image: b4bz/homer:latest
33
container_name: homer
44
environment:
5-
- UID=1000
6-
- GID=1000
5+
- UID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
6+
- GID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
77
volumes:
88
- ./volumes/homer/assets:/www/assets
99
ports:

.templates/mariadb/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ mariadb:
33
container_name: mariadb
44
environment:
55
- TZ=Etc/UTC
6-
- PUID=1000
7-
- PGID=1000
6+
- PUID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
7+
- PGID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
88
- MYSQL_ROOT_PASSWORD=%randomAdminPassword%
99
- MYSQL_DATABASE=default
1010
- MYSQL_USER=mariadbuser

.templates/n8n/service.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ n8n:
2121
# - N8N_BASIC_AUTH_ACTIVE=true
2222
# - N8N_BASIC_AUTH_USER=<USER>
2323
# - N8N_BASIC_AUTH_PASSWORD=<PASSWORD>
24-
25-
# - PGID=1000
26-
# - PUID=1000
27-
# - USBDEVICES=/dev/ttyAMA0
28-
# - PACKAGES=mc
24+
#
25+
# - PGID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
26+
# - PUID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
27+
# - USBDEVICES=/dev/ttyAMA0
28+
# - PACKAGES=mc
2929

.templates/nextcloud/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ nextcloud_db:
2323
restart: unless-stopped
2424
environment:
2525
- TZ=Etc/UTC
26-
- PUID=1000
27-
- PGID=1000
26+
- PUID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
27+
- PGID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
2828
- MYSQL_ROOT_PASSWORD=%randomPassword%
2929
- MYSQL_PASSWORD=%randomMySqlPassword%
3030
- MYSQL_DATABASE=nextcloud

0 commit comments

Comments
 (0)