From cfe7947f948c75ef0349d68d3012968c00e3677c Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Mon, 18 Mar 2024 11:35:26 -0300 Subject: [PATCH] Allow shared local users --- .env.sample | 3 +++ compose.local-users-shared.yml | 7 +++++++ entrypoint.sh.tmpl | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 compose.local-users-shared.yml diff --git a/.env.sample b/.env.sample index ef1d3d8..1fed438 100644 --- a/.env.sample +++ b/.env.sample @@ -18,6 +18,9 @@ MSSQL_ENABLED="1" # Comment out if you are using keycloak or oidc COMPOSE_FILE="$COMPOSE_FILE:compose.local-users.yml" +# Share the local user database with other instances +#COMPOSE_FILE="$COMPOSE_FILE:compose.local-users-shared.yml" +#LOCAL_USERS_VOLUME=rstudio_example_com_users # OpenID Connect (SSO) #COMPOSE_FILE="$COMPOSE_FILE:compose.oidc.yml" diff --git a/compose.local-users-shared.yml b/compose.local-users-shared.yml new file mode 100644 index 0000000..85dce76 --- /dev/null +++ b/compose.local-users-shared.yml @@ -0,0 +1,7 @@ +--- +version: "3.8" + +volumes: + users: + external: true + name: ${LOCAL_USERS_VOLUME} diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 1c8ec66..7b74ffc 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -28,9 +28,9 @@ cp /opt/users/group /etc/group || true copy_users() { while true; do - cp /etc/passwd /opt/users/passwd - cp /etc/shadow /opt/users/shadow - cp /etc/group /opt/users/group + cp -u /etc/passwd /opt/users/passwd + cp -u /etc/shadow /opt/users/shadow + cp -u /etc/group /opt/users/group sleep 60 done }