Skip to content

Commit 2fc86ca

Browse files
committed
menu: 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 support custom user.
1 parent 15dca57 commit 2fc86ca

File tree

25 files changed

+81
-56
lines changed

25 files changed

+81
-56
lines changed

.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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ n8n:
2222
# - N8N_BASIC_AUTH_USER=<USER>
2323
# - N8N_BASIC_AUTH_PASSWORD=<PASSWORD>
2424

25-
# - PGID=1000
26-
# - PUID=1000
25+
# - PGID=${IOTSTACK_GID:?IOTSTACK_GID must be defined in ~/IOTstack/.env}
26+
# - PUID=${IOTSTACK_UID:?IOTSTACK_UID must be defined in ~/IOTstack/.env}
2727
# - USBDEVICES=/dev/ttyAMA0
2828
# - 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

.templates/plex/service.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ plex:
33
container_name: plex
44
network_mode: host
55
environment:
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
- VERSION=docker
99
volumes:
1010
- ./volumes/plex/config:/config

0 commit comments

Comments
 (0)