Compare commits

...

5 Commits

Author SHA1 Message Date
3wc 7c03834602 chore: publish 0.4.0+4.3.2 release
continuous-integration/drone/push Build is passing Details
2024-03-18 11:57:37 -03:00
3wc 81de69d8cb Further improvements to shared local users 2024-03-18 11:57:00 -03:00
3wc cfe7947f94 Allow shared local users 2024-03-18 11:35:26 -03:00
knoflook 5d41f7539a feat: experimental local users
continuous-integration/drone/push Build is passing Details
2024-03-07 15:44:21 +01:00
3wc 4520d4520f Add initial local user DB support
continuous-integration/drone/push Build is passing Details
2024-03-04 11:34:54 -03:00
6 changed files with 56 additions and 2 deletions

View File

@ -16,6 +16,12 @@ COMPOSE_FILE="compose.yml"
# MSSQL driver
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"
#OIDC_ENABLED=1

View File

@ -1,4 +1,4 @@
export CUSTOM_ENTRYPOINT_VERSION=v15
export CUSTOM_ENTRYPOINT_VERSION=v17
export OIDC_CONF_VERSION=v1
export PAM_EXEC_OAUTH2_YAML_VERSION=v1
export PAM_SCRIPT_AUTH_VERSION=v7

View File

@ -0,0 +1,7 @@
---
version: "3.8"
volumes:
users:
external: true
name: ${LOCAL_USERS_VOLUME}

12
compose.local-users.yml Normal file
View File

@ -0,0 +1,12 @@
---
version: "3.8"
services:
app:
volumes:
- users:/opt/users
environment:
- COPY_USERS=1
volumes:
users:

View File

@ -29,7 +29,7 @@ services:
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version=0.3.0+4.3.2"
- "coop-cloud.${STACK_NAME}.version=0.4.0+4.3.2"
entrypoint: /docker-entrypoint.sh
command: /init

View File

@ -21,6 +21,35 @@ file_env() {
unset "$fileVar"
}
{{ if eq (env "COPY_USERS") "1" }}
cp /opt/users/passwd /etc/passwd || true
cp /opt/users/shadow /etc/shadow || true
cp /opt/users/group /etc/group || true
copy_users() {
while true; do
if [ /etc/passwd -nt /opt/users/passwd ]; then
cp -uv /etc/passwd /opt/users/passwd
else
cp -uv /opt/users/passwd /etc/passwd
fi
if [ /etc/shadow -nt /opt/users/shadow ]; then
cp -uv /etc/shadow /opt/users/shadow
else
cp -uv /opt/users/shadow /etc/shadow
fi
if [ /etc/group -nt /opt/users/group ]; then
cp -uv /etc/group /opt/users/group
else
cp -uv /opt/users/group /etc/group
fi
sleep 60
done
}
copy_users &
{{ end }}
file_env "PASSWORD"
{{ if eq (env "OIDC_ENABLED") "1" }}