Skip to content

Commit 79782cd

Browse files
authored
Merge pull request #157 from chillymattster/configure_uid_gid
feat: improve security - configure container uid and gid
2 parents afe6399 + 4d2ad78 commit 79782cd

5 files changed

Lines changed: 13 additions & 0 deletions

File tree

.env.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ TRAEFIK_ACCESS_LOG=
6969
# Configure the log level for Traefik.
7070
# Possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL" and "PANIC". Default is "ERROR".
7171
TRAEFIK_LOG_LEVEL=
72+
# The default for traefik is to run in privileged mode.
73+
# If you want to run traefik non-privileged, use the following variable and the format [UID]:[GID] to set user and group of your choice.
74+
# Ensure that the user has access to docker.sock and traefik volumes defined in traefik/opencloud.yml
75+
#TRAEFIK_CONTAINER_UID_GID="1000:1000"
7276

7377

7478
## OpenCloud Settings ##
@@ -80,6 +84,11 @@ OC_DOCKER_IMAGE=opencloudeu/opencloud-rolling
8084
# The openCloud container version.
8185
# Defaults to "latest" and points to the latest stable tag.
8286
OC_DOCKER_TAG=
87+
# The default id used in opencloud containers is 1000 for user and group.
88+
# If you want to change the default, use the following variable and the format [UID]:[GID].
89+
# The change affects all containers with access to data volumes.
90+
# Ensure that the user has access to all volumes defined in docker-compose.yml
91+
#OC_CONTAINER_UID_GID="1000:1000"
8392
# Domain of openCloud, where you can find the frontend.
8493
# Defaults to "cloud.opencloud.test"
8594
OC_DOMAIN=

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
image: ${OC_DOCKER_IMAGE:-opencloudeu/opencloud-rolling}:${OC_DOCKER_TAG:-latest}
55
# changelog: https://github.com/opencloud-eu/opencloud/tree/main/changelog
66
# release notes: https://docs.opencloud.eu/opencloud_release_notes.html
7+
user: ${OC_CONTAINER_UID_GID:-1000:1000}
78
networks:
89
opencloud-net:
910
entrypoint:

radicale/radicale.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
- ./config/opencloud/proxy.yaml:/etc/opencloud/proxy.yaml
77
radicale:
88
image: ${RADICALE_DOCKER_IMAGE:-opencloudeu/radicale}:${RADICALE_DOCKER_TAG:-latest}
9+
user: ${OC_CONTAINER_UID_GID:-1000:1000}
910
networks:
1011
opencloud-net:
1112
logging:

traefik/opencloud.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
traefik:
1212
image: traefik:v3
1313
# release notes: https://github.com/traefik/traefik/releases
14+
user: ${TRAEFIK_CONTAINER_UID_GID:-0:0}
1415
networks:
1516
opencloud-net:
1617
aliases:

weboffice/collabora.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ services:
1414

1515
collaboration:
1616
image: ${OC_DOCKER_IMAGE:-opencloudeu/opencloud-rolling}:${OC_DOCKER_TAG:-latest}
17+
user: ${OC_CONTAINER_UID_GID:-1000:1000}
1718
networks:
1819
opencloud-net:
1920
depends_on:

0 commit comments

Comments
 (0)