commit f9d16ab07827b87bf809d250a7cc359e186006fb Author: diaco Date: Tue Nov 25 12:27:53 2025 +0330 initial commit diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..efa8ee7 --- /dev/null +++ b/.env.example @@ -0,0 +1,312 @@ +## Basic Settings ## +# Define the docker compose log driver used. +# Defaults to local +LOG_DRIVER= +# If you're on an internet facing server, comment out following line. +# It skips certificate validation for various parts of OpenCloud and is +# needed when self signed certificates are used. +INSECURE=true + +## Features ## +# The following variable is a convenience variable to enable or disable features of this compose project. +# Example: if you want to use traefik and letsencrypt, you can set the variable to +#COMPOSE_FILE=docker-compose.yml:traefik/opencloud.yml +# This enables you to just run `docker compose up -d` and the compose files will be added to the stack. +# As alternative approach you can run `docker compose -f docker-compose.yml -f docker-compose.traefik.yml up -d` +# Default: OpenCloud and Collabora with traefik and letsencypt +# This needs DNS entries for the domain names used in the .env file. +#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml +# If you want to use the external proxy, you can use the following combination. +# DNS entries and certificates need to be managed by the external environment. +# The domain names need to be entered into the .env file. +#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml +# Keycloak Shared User Directory +#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml:idm/ldap-keycloak.yml:traefik/ldap-keycloak.yml +# OpenCloud, Planka and Gitea +#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:project/planka.yml:version-control/gitea.yml:traefik/opencloud.yml:traefik/planka.yml:database/postgres.yml:traefik/gitea.yml +# Odoo, Gitea, opencloud +#Compose_File=docker-compose.yml:odoo/odoo.yml:opencloud/opencloud.yml:version-control/gitea.yml:traefik/opencloud.yml:traefik/planka.yml:database/postgres.yml:traefik/gitea.yml:traefik/odoo.yml + +## Traefik Settings ## +# Note: Traefik is always enabled and can't be disabled. +# Serve Traefik dashboard. +# Defaults to "false". +TRAEFIK_DASHBOARD= +# Domain of Traefik, where you can find the dashboard. +# Defaults to "traefik.opencloud.test" +TRAEFIK_DOMAIN= +# Basic authentication for the traefik dashboard. +# Defaults to user "admin" and password "admin" (written as: "admin:$2y$05$KDHu3xq92SPaO3G8Ybkc7edd51pPLJcG1nWk3lmlrIdANQ/B6r5pq"). +# To create user:password pair, it's possible to use this command: +# echo $(htpasswd -nB user) | sed -e s/\\$/\\$\\$/g +TRAEFIK_BASIC_AUTH_USERS= +# Email address for obtaining LetsEncrypt certificates. +# Needs only be changed if this is a public facing server. +TRAEFIK_ACME_MAIL= +# Set to the following for testing to check the certificate process: +# "https://acme-staging-v02.api.letsencrypt.org/directory" +# With staging configured, there will be an SSL error in the browser. +# When certificates are displayed and are emitted by # "Fake LE Intermediate X1", +# the process went well and the envvar can be reset to empty to get valid certificates. +TRAEFIK_ACME_CASERVER= +# Enable the Traefik ACME (Automatic Certificate Management Environment) for automatic SSL certificate management. +TRAEFIK_SERVICES_TLS_CONFIG="tls.certresolver=letsencrypt" +# Enable Traefik to use local certificates. +#TRAEFIK_SERVICES_TLS_CONFIG="tls=true" +# You also need to provide a config file in ./config/traefik/dynamic/certs.yml +# Example: +# cat ./config/traefik/dynamic/certs.yml +# tls: +# certificates: +# - certFile: /certs/opencloud.test.crt +# keyFile: /certs/opencloud.test.key +# stores: +# - default +# +# The certificates need to be copied into ./certs/, the absolute path inside the container is /certs/. +# You can also use TRAEFIK_CERTS_DIR=/path/on/host to set the path to the certificates directory. +# Enable the access log for Traefik by setting the following variable to true. +TRAEFIK_ACCESS_LOG= +# Configure the log level for Traefik. +# Possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL" and "PANIC". Default is "ERROR". +TRAEFIK_LOG_LEVEL= + + +## OpenCloud Settings ## +# The opencloud container image. +# For production releases: "opencloudeu/opencloud" +# For rolling releases: "opencloudeu/opencloud-rolling" +# Defaults to production if not set otherwise +OC_DOCKER_IMAGE=opencloudeu/opencloud-rolling +# The openCloud container version. +# Defaults to "latest" and points to the latest stable tag. +OC_DOCKER_TAG= +# Domain of openCloud, where you can find the frontend. +# Defaults to "cloud.opencloud.test" +OC_DOMAIN= +# Demo users should not be created on a production instance, +# because their passwords are public. Defaults to "false". +# If demo users is set to "true", the following user accounts are created automatically: +# alan, mary, margaret, dennis and lynn - the password is 'demo' for all. +DEMO_USERS= +# Admin Password for the OpenCloud admin user. +# NOTE: This is only needed when using the built-in LDAP server (idm). +# If you are using an external LDAP server, the admin password is managed by the LDAP server. +# NOTE: This variable needs to be set before the first start of OpenCloud. Changes to this variable after the first start will be IGNORED. +# If not set, opencloud will not work properly. The container will be restarting. +# After the first initialization, the admin password can only be changed via the OpenCloud User Settings UI or by using the OpenCloud CLI. +# Documentation: https://docs.opencloud.eu/docs/admin/resources/common-issues#-change-admin-password-set-in-env +INITIAL_ADMIN_PASSWORD= +# Define the openCloud loglevel used. +# +LOG_LEVEL= +# Define the kind of logging. +# The default log can be read by machines. +# Set this to true to make the log human readable. +# LOG_PRETTY=true +# +# Define the openCloud storage location. Set the paths for config and data to a local path. +# Ensure that the configuration and data directories are owned by the user and group with ID 1000:1000. +# This matches the default user inside the container and avoids permission issues when accessing files. +# Note that especially the data directory can grow big. +# Leaving it default stores data in docker internal volumes. +# OC_CONFIG_DIR=/your/local/opencloud/config +# OC_DATA_DIR=/your/local/opencloud/data +# OpenCloud Web can load extensions from a local directory. +# The default uses the bind mount to the config/opencloud/apps directory. +# Example: curl -L https://github.com/opencloud-eu/web-extensions/releases/download/unzip-v1.0.2/unzip-1.0.2.zip | tar -xz -C config/opencloud/apps +# NOTE: you need to restart the openCloud container to load the new extensions. +# OC_APPS_DIR=/your/local/opencloud/apps + +# Define the ldap-server storage location. Set the paths for config and data to a local path. +# LDAP_CERTS_DIR= +# LDAP_DATA_DIR= + +# S3 Storage configuration - optional +# OpenCloud supports S3 storage as primary storage. +# Per default, S3 storage is disabled and the decomposed storage driver is used. +# To enable S3 storage, add `storage/decomposeds3.yml` to the COMPOSE_FILE variable or to +# your startup command (`docker compose -f docker-compose.yml -f storage/decomposeds3.yml up`). +# +# Configure the S3 storage endpoint. Defaults to "http://minio:9000" for testing purposes. +DECOMPOSEDS3_ENDPOINT= +# S3 region. Defaults to "default". +DECOMPOSEDS3_REGION= +# S3 access key. Defaults to "opencloud" +DECOMPOSEDS3_ACCESS_KEY= +# S3 secret. Defaults to "opencloud-secret-key" +DECOMPOSEDS3_SECRET_KEY= +# S3 bucket. Defaults to "opencloud" +DECOMPOSEDS3_BUCKET= + + +# Define SMTP settings if you would like to send OpenCloud email notifications. +# To actually send notifications, you also need to enable the 'notifications' service +# by adding it to the START_ADDITIONAL_SERVICES variable below. +# +# NOTE: when configuring Inbucket, these settings have no effect, see inbucket.yml for details. +# SMTP host to connect to. +SMTP_HOST= +# Port of the SMTP host to connect to. +SMTP_PORT= +# An eMail address that is used for sending OpenCloud notification eMails +# like "opencloud notifications ". +SMTP_SENDER= +# Username for the SMTP host to connect to. +SMTP_USERNAME= +# Password for the SMTP host to connect to. +SMTP_PASSWORD= +# Authentication method for the SMTP communication. +SMTP_AUTHENTICATION= +# Encryption method for the SMTP communication. Possible values are 'starttls', 'ssltls' and 'none' +SMTP_TRANSPORT_ENCRYPTION= +# Allow insecure connections to the SMTP server. Defaults to false. +SMTP_INSECURE= + +# Additional services to be started on opencloud startup +# The following list of services is not started automatically and must be +# manually defined for startup: +# IMPORTANT: Add any services to the startup list comma separated like "notifications,antivirus" etc. +START_ADDITIONAL_SERVICES="" + + +## Default Enabled Services ## + +### Apache Tika Content Analysis Toolkit ### +# Tika (search) is disabled by default due to performance reasons. +# Tika is used to extract metadata and text from various file formats. +# Enable it by adding the following to the COMPOSE_FILE variable: +# search/tika.yml or by using the following command: +# docker compose -f docker-compose.yml -f search/tika.yml up -d +# Set the desired docker image tag or digest. +# Defaults to "apache/tika:latest-full" +TIKA_IMAGE= + +### IMPORTANT Note for Online Office Apps ### +# To avoid app interlocking issues, you should select only one app to be active/configured. +# This is due the fact that there is currently no app interlocking for the same file and one +# has to wait for a lock release to open the file with another app. + +### Collabora Settings ### +# Domain of Collabora, where you can find the frontend. +# Defaults to "collabora.opencloud.test" +COLLABORA_DOMAIN= +# Domain of the wopiserver which handles Collabora. +# Defaults to "wopiserver.opencloud.test" +WOPISERVER_DOMAIN= +# Admin user for Collabora. +# Defaults to "admin". +# Collabora Admin Panel URL: +# https://{COLLABORA_DOMAIN}/browser/dist/admin/admin.html +COLLABORA_ADMIN_USER= +# Admin password for Collabora. +# Defaults to "admin". +COLLABORA_ADMIN_PASSWORD= +# Set to true to enable SSL handling in Collabora Online, this is only required if you are not using a reverse proxy. +# Default is true if not specified. +COLLABORA_SSL_ENABLE=false +# If you're on an internet-facing server, enable SSL verification for Collabora Online. +# Please comment out the following line: +COLLABORA_SSL_VERIFICATION=false + + +### Virusscanner Settings ### +# IMPORTANT: If you enable antivirus, you also MUST configure the START_ADDITIONAL_SERVICES +# envvar in the OpenCloud Settings above by adding 'antivirus' to the list. +# The maximum scan size the virus scanner can handle, needs adjustment in the scanner config as well. +# Usable common abbreviations: [KB, KiB, MB, MiB, GB, GiB, TB, TiB, PB, PiB, EB, EiB], example: 2GB. +# Defaults to "100MB" +#ANTIVIRUS_MAX_SCAN_SIZE= +# Usable modes: partial, skip. +# Defaults to "partial" +#ANTIVIRUS_MAX_SCAN_SIZE_MODE= +# Image version of the ClamAV container. +# Defaults to "latest" +CLAMAV_DOCKER_TAG= + + +### Inbucket Settings ### +# Inbucket is a mail catcher tool for testing purposes. +# DO NOT use in Production. +# email server (in this case inbucket acts as mail catcher). +# Domain for Inbucket. Defaults to "mail.opencloud.test". +INBUCKET_DOMAIN= + + +### Compose Configuration ### +# Path separator for supplemental compose files specified in COMPOSE_FILE. +COMPOSE_PATH_SEPARATOR=: + +### Ldap Settings ### +# LDAP is always needed for OpenCloud to store user data as there is no relational database. +# The built-in LDAP server should used for testing purposes or small installations only. +# For production installations, it is recommended to use an external LDAP server. +# We are using OpenLDAP as the default LDAP server because it is proven to be stable and reliable. +# This LDAP configuration is known to work with OpenCloud and provides a blueprint for +# configuring an external LDAP server based on other products like Microsoft Active Directory or other LDAP servers. +# +# Password of LDAP bind user "cn=admin,dc=opencloud,dc=eu". Defaults to "admin" +LDAP_BIND_PASSWORD= +# The LDAP server also creates an openCloud admin user dn: uid=admin,ou=users,dc=opencloud,dc=eu +# The initial password for this user is "admin" +# NOTE: This password can only be set once, if you want to change it later, you have to use the OpenCloud User Settings UI. +# If you changed the password and lost it, you need to execute the following LDAP query to reset it: +# enter the ldap-server container with `docker compose exec ldap-server sh` +# and run the following command to change the password: +# ldappasswd -H ldap://127.0.0.1:1389 -D "cn=admin,dc=opencloud,dc=eu" -W "uid=admin,ou=users,dc=opencloud,dc=eu" +# You will be prompted for the LDAP bind password. +# The output should provide you a new password for the admin user. + + +### Keycloak Settings ### +# Keycloak is an open-source identity and access management solution. +# We are using Keycloak as the default identity provider on production installations. +# It can be used to federate authentication with other identity providers like +# Microsoft Entra ID, ADFS or other SAML/OIDC providers. +# The use of Keycloak as bridge between OpenCloud and other identity providers creates more control over the +# authentication process, the allowed clients and the session management. +# Keycloak also manages the Role Based Access Control (RBAC) for OpenCloud. +# Keycloak can be used in two different modes: +# 1. Autoprovisioning: New users are automatically created in openCloud when they log in for the first time. +# 2. Shared User Directory: Users are created in Keycloak and can be used in OpenCloud immediately +# because the LDAP server is connected to both Keycloak and OpenCloud. +# Only use one of the two modes at a time. + +## Autoprovisioning Mode ## +# Use together with idm/external-idp.yml +# If you want to use a keycloak for local testing, you can use testing/external-keycloak.yml and testing/ldap-manager.yml +# Domain of your Identity Provider. +IDP_DOMAIN= +# IdP Issuer URL, which is used to identify the Identity Provider. +# We need the complete URL, including the protocol (http or https) and the realm. +# Example: "https://keycloak.opencloud.test/realms/openCloud" +IDP_ISSUER_URL= +# Url of the account edit page from your Identity Provider. +IDP_ACCOUNT_URL= + +## Shared User Directory Mode ## +# Use together with idm/ldap-keycloak.yml and traefik/ldap-keycloak.yml +# Domain for Keycloak. Defaults to "keycloak.opencloud.test". +KEYCLOAK_DOMAIN= +# Admin user login name. Defaults to "kcadmin". +KEYCLOAK_ADMIN= +# Admin user login password. Defaults to "admin". +KEYCLOAK_ADMIN_PASSWORD= +# Keycloak Database username. Defaults to "keycloak". +KC_DB_USERNAME= +# Keycloak Database password. Defaults to "keycloak". +KC_DB_PASSWORD= + +### Radicale Setting ### +# Radicale is a small open-source CalDAV (calendars, to-do lists) and CardDAV (contacts) server. +# When enabled OpenCloud is configured as a reverse proxy for Radicale, providing all authenticated +# OpenCloud users access to a Personal Calendar and Addressbook +# Docker image to use for the Radicale Container +#RADICALE_DOCKER_IMAGE=opencloudeu/radicale +# Docker tag to pull for the Radicale Container +#RADICALE_DOCKER_TAG=latest +# Define the storage location for the Radicale data. Set the path to a local path. +# Ensure that the configuration and data directories are owned by the user and group with ID 1000:1000. +# This matches the default user inside the container and avoids permission issues when accessing files. +# Leaving it default stores data in docker internal volumes. +#RADICALE_DATA_DIR=/your/local/radicale/data diff --git a/.env.local b/.env.local new file mode 100644 index 0000000..a840a85 --- /dev/null +++ b/.env.local @@ -0,0 +1,334 @@ +## Basic Settings ## +# Define the docker compose log driver used. +# Defaults to local +LOG_DRIVER= +# If you're on an internet facing server, comment out following line. +# It skips certificate validation for various parts of OpenCloud and is +# needed when self signed certificates are used. +INSECURE=true + +## Features ## +# The following variable is a convenience variable to enable or disable features of this compose project. +# Example: if you want to use traefik and letsencrypt, you can set the variable to +#COMPOSE_FILE=docker-compose.yml:traefik/opencloud.yml +# This enables you to just run `docker compose up -d` and the compose files will be added to the stack. +# As alternative approach you can run `docker compose -f docker-compose.yml -f docker-compose.traefik.yml up -d` +# Default: OpenCloud and Collabora with traefik and letsencypt +# This needs DNS entries for the domain names used in the .env file. +#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml +# If you want to use the external proxy, you can use the following combination. +# DNS entries and certificates need to be managed by the external environment. +# The domain names need to be entered into the .env file. +#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml +# Keycloak Shared User Directory +#COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml:idm/ldap-keycloak.yml:traefik/ldap-keycloak.yml +# OpenCloud, Planka and Gitea +#COMPOSE_FILE=docker-compose.yml:opencloud/opencloud.yml:project/planka.yml:version-control/gitea.yml:traefik/opencloud.yml:traefik/planka.yml:database/postgres.yml:traefik/gitea.yml +# Odoo, Gitea, opencloud +COMPOSE_FILE=docker-compose.yml:odoo/odoo.yml:opencloud/opencloud.yml:version-control/gitea.yml:database/postgres.yml:backup/backup.yml:odoo/odoo-init.yml:backup/restore.yml + +## Traefik Settings ## +# Note: Traefik is always enabled and can't be disabled. +# Serve Traefik dashboard. +# Defaults to "false". +TRAEFIK_DASHBOARD=true +# Domain of Traefik, where you can find the dashboard. +# Defaults to "traefik.opencloud.test" +TRAEFIK_DOMAIN= +# Basic authentication for the traefik dashboard. +# Defaults to user "admin" and password "admin" (written as: "admin:$2y$05$KDHu3xq92SPaO3G8Ybkc7edd51pPLJcG1nWk3lmlrIdANQ/B6r5pq"). +# To create user:password pair, it's possible to use this command: +# echo $(htpasswd -nB user) | sed -e s/\\$/\\$\\$/g +TRAEFIK_BASIC_AUTH_USERS='rhino:$2y$05$eLdVPpxgk45NTnAkYSO2l.ilaIk8O3gdUToThih1iqn8XFTIMvkKC' +# Email address for obtaining LetsEncrypt certificates. +# Needs only be changed if this is a public facing server. +TRAEFIK_ACME_MAIL= +# Set to the following for testing to check the certificate process: +# "https://acme-staging-v02.api.letsencrypt.org/directory" +# With staging configured, there will be an SSL error in the browser. +# When certificates are displayed and are emitted by # "Fake LE Intermediate X1", +# the process went well and the envvar can be reset to empty to get valid certificates. +TRAEFIK_ACME_CASERVER= +# Enable the Traefik ACME (Automatic Certificate Management Environment) for automatic SSL certificate management. +#TRAEFIK_SERVICES_TLS_CONFIG="tls.certresolver=letsencrypt" +# Enable Traefik to use local certificates. +TRAEFIK_SERVICES_TLS_CONFIG="tls=true" +# You also need to provide a config file in ./config/traefik/dynamic/certs.yml +# Example: +# cat ./config/traefik/dynamic/certs.yml +# tls: +# certificates: +# - certFile: /certs/opencloud.test.crt +# keyFile: /certs/opencloud.test.key +# stores: +# - default +# +# The certificates need to be copied into ./certs/, the absolute path inside the container is /certs/. +# You can also use TRAEFIK_CERTS_DIR=/path/on/host to set the path to the certificates directory. +# Enable the access log for Traefik by setting the following variable to true. +TRAEFIK_ACCESS_LOG= +# Configure the log level for Traefik. +# Possible values are "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL" and "PANIC". Default is "ERROR". +TRAEFIK_LOG_LEVEL= + + +## OpenCloud Settings ## +# The opencloud container image. +# For production releases: "opencloudeu/opencloud" +# For rolling releases: "opencloudeu/opencloud-rolling" +# Defaults to production if not set otherwise +OC_DOCKER_IMAGE=opencloudeu/opencloud +# The openCloud container version. +# Defaults to "latest" and points to the latest stable tag. +OC_DOCKER_TAG= +# Domain of openCloud, where you can find the frontend. +# Defaults to "cloud.opencloud.test" +OC_DOMAIN= +# Demo users should not be created on a production instance, +# because their passwords are public. Defaults to "false". +# If demo users is set to "true", the following user accounts are created automatically: +# alan, mary, margaret, dennis and lynn - the password is 'demo' for all. +DEMO_USERS= +# Admin Password for the OpenCloud admin user. +# NOTE: This is only needed when using the built-in LDAP server (idm). +# If you are using an external LDAP server, the admin password is managed by the LDAP server. +# NOTE: This variable needs to be set before the first start of OpenCloud. Changes to this variable after the first start will be IGNORED. +# If not set, opencloud will not work properly. The container will be restarting. +# After the first initialization, the admin password can only be changed via the OpenCloud User Settings UI or by using the OpenCloud CLI. +# Documentation: https://docs.opencloud.eu/docs/admin/resources/common-issues#-change-admin-password-set-in-env +INITIAL_ADMIN_PASSWORD=6789054321 +# Define the openCloud loglevel used. +# +LOG_LEVEL="WARN" +# Define the kind of logging. +# The default log can be read by machines. +# Set this to true to make the log human readable. +# LOG_PRETTY=true +# +# Define the openCloud storage location. Set the paths for config and data to a local path. +# Ensure that the configuration and data directories are owned by the user and group with ID 1000:1000. +# This matches the default user inside the container and avoids permission issues when accessing files. +# Note that especially the data directory can grow big. +# Leaving it default stores data in docker internal volumes. +# OC_CONFIG_DIR=./opencloud_data/config +# OC_DATA_DIR=./opencloud_data/data +# OpenCloud Web can load extensions from a local directory. +# The default uses the bind mount to the config/opencloud/apps directory. +# Example: curl -L https://github.com/opencloud-eu/web-extensions/releases/download/unzip-v1.0.2/unzip-1.0.2.zip | tar -xz -C config/opencloud/apps +# NOTE: you need to restart the openCloud container to load the new extensions. +# OC_APPS_DIR=/your/local/opencloud/apps + +# Define the ldap-server storage location. Set the paths for config and data to a local path. +# LDAP_CERTS_DIR= +# LDAP_DATA_DIR= + +# S3 Storage configuration - optional +# OpenCloud supports S3 storage as primary storage. +# Per default, S3 storage is disabled and the decomposed storage driver is used. +# To enable S3 storage, add `storage/decomposeds3.yml` to the COMPOSE_FILE variable or to +# your startup command (`docker compose -f docker-compose.yml -f storage/decomposeds3.yml up`). +# +# Configure the S3 storage endpoint. Defaults to "http://minio:9000" for testing purposes. +DECOMPOSEDS3_ENDPOINT= +# S3 region. Defaults to "default". +DECOMPOSEDS3_REGION= +# S3 access key. Defaults to "opencloud" +DECOMPOSEDS3_ACCESS_KEY= +# S3 secret. Defaults to "opencloud-secret-key" +DECOMPOSEDS3_SECRET_KEY= +# S3 bucket. Defaults to "opencloud" +DECOMPOSEDS3_BUCKET= + + +# Define SMTP settings if you would like to send OpenCloud email notifications. +# To actually send notifications, you also need to enable the 'notifications' service +# by adding it to the START_ADDITIONAL_SERVICES variable below. +# +# NOTE: when configuring Inbucket, these settings have no effect, see inbucket.yml for details. +# SMTP host to connect to. +SMTP_HOST= +# Port of the SMTP host to connect to. +SMTP_PORT= +# An eMail address that is used for sending OpenCloud notification eMails +# like "opencloud notifications ". +SMTP_SENDER= +# Username for the SMTP host to connect to. +SMTP_USERNAME= +# Password for the SMTP host to connect to. +SMTP_PASSWORD= +# Authentication method for the SMTP communication. +SMTP_AUTHENTICATION= +# Encryption method for the SMTP communication. Possible values are 'starttls', 'ssltls' and 'none' +SMTP_TRANSPORT_ENCRYPTION= +# Allow insecure connections to the SMTP server. Defaults to false. +SMTP_INSECURE= + +# Additional services to be started on opencloud startup +# The following list of services is not started automatically and must be +# manually defined for startup: +# IMPORTANT: Add any services to the startup list comma separated like "notifications,antivirus" etc. +START_ADDITIONAL_SERVICES="" + + +## Default Enabled Services ## + +### Apache Tika Content Analysis Toolkit ### +# Tika (search) is disabled by default due to performance reasons. +# Tika is used to extract metadata and text from various file formats. +# Enable it by adding the following to the COMPOSE_FILE variable: +# search/tika.yml or by using the following command: +# docker compose -f docker-compose.yml -f search/tika.yml up -d +# Set the desired docker image tag or digest. +# Defaults to "apache/tika:latest-full" +TIKA_IMAGE= + +### IMPORTANT Note for Online Office Apps ### +# To avoid app interlocking issues, you should select only one app to be active/configured. +# This is due the fact that there is currently no app interlocking for the same file and one +# has to wait for a lock release to open the file with another app. + +### Collabora Settings ### +# Domain of Collabora, where you can find the frontend. +# Defaults to "collabora.opencloud.test" +COLLABORA_DOMAIN= +# Domain of the wopiserver which handles Collabora. +# Defaults to "wopiserver.opencloud.test" +WOPISERVER_DOMAIN= +# Admin user for Collabora. +# Defaults to "admin". +# Collabora Admin Panel URL: +# https://{COLLABORA_DOMAIN}/browser/dist/admin/admin.html +COLLABORA_ADMIN_USER= +# Admin password for Collabora. +# Defaults to "admin". +COLLABORA_ADMIN_PASSWORD= +# Set to true to enable SSL handling in Collabora Online, this is only required if you are not using a reverse proxy. +# Default is true if not specified. +COLLABORA_SSL_ENABLE=false +# If you're on an internet-facing server, enable SSL verification for Collabora Online. +# Please comment out the following line: +COLLABORA_SSL_VERIFICATION=false + + +### Virusscanner Settings ### +# IMPORTANT: If you enable antivirus, you also MUST configure the START_ADDITIONAL_SERVICES +# envvar in the OpenCloud Settings above by adding 'antivirus' to the list. +# The maximum scan size the virus scanner can handle, needs adjustment in the scanner config as well. +# Usable common abbreviations: [KB, KiB, MB, MiB, GB, GiB, TB, TiB, PB, PiB, EB, EiB], example: 2GB. +# Defaults to "100MB" +#ANTIVIRUS_MAX_SCAN_SIZE= +# Usable modes: partial, skip. +# Defaults to "partial" +#ANTIVIRUS_MAX_SCAN_SIZE_MODE= +# Image version of the ClamAV container. +# Defaults to "latest" +CLAMAV_DOCKER_TAG= + + +### Inbucket Settings ### +# Inbucket is a mail catcher tool for testing purposes. +# DO NOT use in Production. +# email server (in this case inbucket acts as mail catcher). +# Domain for Inbucket. Defaults to "mail.opencloud.test". +INBUCKET_DOMAIN= + + +### Compose Configuration ### +# Path separator for supplemental compose files specified in COMPOSE_FILE. +COMPOSE_PATH_SEPARATOR=: + +### Ldap Settings ### +# LDAP is always needed for OpenCloud to store user data as there is no relational database. +# The built-in LDAP server should used for testing purposes or small installations only. +# For production installations, it is recommended to use an external LDAP server. +# We are using OpenLDAP as the default LDAP server because it is proven to be stable and reliable. +# This LDAP configuration is known to work with OpenCloud and provides a blueprint for +# configuring an external LDAP server based on other products like Microsoft Active Directory or other LDAP servers. +# +# Password of LDAP bind user "cn=admin,dc=opencloud,dc=eu". Defaults to "admin" +LDAP_BIND_PASSWORD= +# The LDAP server also creates an openCloud admin user dn: uid=admin,ou=users,dc=opencloud,dc=eu +# The initial password for this user is "admin" +# NOTE: This password can only be set once, if you want to change it later, you have to use the OpenCloud User Settings UI. +# If you changed the password and lost it, you need to execute the following LDAP query to reset it: +# enter the ldap-server container with `docker compose exec ldap-server sh` +# and run the following command to change the password: +# ldappasswd -H ldap://127.0.0.1:1389 -D "cn=admin,dc=opencloud,dc=eu" -W "uid=admin,ou=users,dc=opencloud,dc=eu" +# You will be prompted for the LDAP bind password. +# The output should provide you a new password for the admin user. + + +### Keycloak Settings ### +# Keycloak is an open-source identity and access management solution. +# We are using Keycloak as the default identity provider on production installations. +# It can be used to federate authentication with other identity providers like +# Microsoft Entra ID, ADFS or other SAML/OIDC providers. +# The use of Keycloak as bridge between OpenCloud and other identity providers creates more control over the +# authentication process, the allowed clients and the session management. +# Keycloak also manages the Role Based Access Control (RBAC) for OpenCloud. +# Keycloak can be used in two different modes: +# 1. Autoprovisioning: New users are automatically created in openCloud when they log in for the first time. +# 2. Shared User Directory: Users are created in Keycloak and can be used in OpenCloud immediately +# because the LDAP server is connected to both Keycloak and OpenCloud. +# Only use one of the two modes at a time. + +## Autoprovisioning Mode ## +# Use together with idm/external-idp.yml +# If you want to use a keycloak for local testing, you can use testing/external-keycloak.yml and testing/ldap-manager.yml +# Domain of your Identity Provider. +IDP_DOMAIN= +# IdP Issuer URL, which is used to identify the Identity Provider. +# We need the complete URL, including the protocol (http or https) and the realm. +# Example: "https://keycloak.opencloud.test/realms/openCloud" +IDP_ISSUER_URL= +# Url of the account edit page from your Identity Provider. +IDP_ACCOUNT_URL= + +## Shared User Directory Mode ## +# Use together with idm/ldap-keycloak.yml and traefik/ldap-keycloak.yml +# Domain for Keycloak. Defaults to "keycloak.opencloud.test". +KEYCLOAK_DOMAIN= +# Admin user login name. Defaults to "kcadmin". +KEYCLOAK_ADMIN= +# Admin user login password. Defaults to "admin". +KEYCLOAK_ADMIN_PASSWORD= +# Keycloak Database username. Defaults to "keycloak". +KC_DB_USERNAME= +# Keycloak Database password. Defaults to "keycloak". +KC_DB_PASSWORD= + +### Radicale Setting ### +# Radicale is a small open-source CalDAV (calendars, to-do lists) and CardDAV (contacts) server. +# When enabled OpenCloud is configured as a reverse proxy for Radicale, providing all authenticated +# OpenCloud users access to a Personal Calendar and Addressbook +# Docker image to use for the Radicale Container +#RADICALE_DOCKER_IMAGE=opencloudeu/radicale +# Docker tag to pull for the Radicale Container +#RADICALE_DOCKER_TAG=latest +# Define the storage location for the Radicale data. Set the path to a local path. +# Ensure that the configuration and data directories are owned by the user and group with ID 1000:1000. +# This matches the default user inside the container and avoids permission issues when accessing files. +# Leaving it default stores data in docker internal volumes. +#RADICALE_DATA_DIR=/your/local/radicale/data + +### Gitea Setting ### +GITEA_DB=giteadb # Database name for Gitea +GITEA_DB_USER=giteauser +GITEA_DB_PASSWORD=1pmOwO9bqj9WCu +GITEA_HOST= + +### odoo Setting ### +ODOO_DB=odoo # Database name for Odoo +ODOO_DB_USER=odoouser +ODOO_DB_PASSWORD=56onjP9wJfWrnv +ODOO_DB_HOST=postgres + +### Postgresql Settings ### +POSTGRES_ADMIN_USER=postgres +POSTGRES_ADMIN_PASSWORD=o8OhiiivPW45pp + +### Backup Settings ### +BKP_DB_LIST="${ODOO_DB} ${GITEA_DB}" +BKP_RETENTION_COUNT=5 +BKP_RETENTION_DAYS=7 +TIMEZONE=Asia/Tehran \ No newline at end of file diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..6c696c9 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,6 @@ +--- +applyTo: "**/*.yml" +--- +# Project coding standards for docker compose +- Use dictionaries for defining key-value pairs, such as service configurations. +- Use lists for defining multiple items, like environment variables or commands diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..77bdad7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +.idea +# exclude the .env file which will be created from env.example +.env + +# exclude the apps folder +/config/opencloud/apps/* +!/config/opencloud/apps/.gitkeep + +# exclude custom compose files +/custom + +# exclude certificates +/certs/* +!/certs/.gitkeep + +# exclude the certificates config folder +/config/traefik/dynamic/* +!/config/traefik/dynamic/.gitkeep +.DS_Store +secrets/caddy_email +secrets/opencloud_jwt_secret +secrets/opencloud_transfer_secret +secrets/openproject_secret_key_base +secrets/traefik +Persistent Backup/2025-11-24_18-10/gitea_data_2025-11-24_18-10.tar.gz +Persistent Backup/2025-11-24_18-10/giteadb_2025-11-24_18-10.sql.gz +Persistent Backup/2025-11-24_18-10/odoo_2025-11-24_18-10.sql.gz +Persistent Backup/2025-11-24_18-10/odoo_config_2025-11-24_18-10.tar.gz +Persistent Backup/2025-11-24_18-10/odoo_db_data_2025-11-24_18-10.tar.gz +Persistent Backup/2025-11-24_18-10/opencloud_config_2025-11-24_18-10.tar.gz +Persistent Backup/2025-11-24_18-10/opencloud_data_2025-11-24_18-10.tar.gz diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..1d21fc6 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "ms-azuretools.vscode-containers" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7db46d9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "github.copilot.chat.commitMessageGeneration.instructions": [] +} \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..74026df --- /dev/null +++ b/README.md @@ -0,0 +1,507 @@ +# OpenCloud Compose + +This repository provides Docker Compose configurations for deploying OpenCloud in various environments. + +## Overview + +OpenCloud Compose offers a modular approach to deploying OpenCloud with several configuration options: + +- **Standard deployment** with Traefik reverse proxy and Let's Encrypt certificates or certificates from files +- **External proxy** support for environments with existing reverse proxies (like Nginx, Caddy, etc.) +- **Collabora Online** integration for document editing +- **Keycloak and LDAP** integration for centralized identity management +- **Full text search** with Apache Tika for content extraction and metadata analysis +- **Monitoring** with metrics endpoints for observability and performance monitoring +- **Radicale** integration for Calendar and Contacts + +## Quick Start Guide + +### Prerequisites + +- Docker and Docker Compose v2 installed. +- Domain names pointing to your server (for production deployment) +- Basic understanding of Docker Compose concepts + +> [!IMPORTANT] +> Please use the docker installation guide from the [Official Documentation](https://docs.docker.com/engine/install/) to ensure using docker compose v2. Official linux distro package repositories might still contain docker compose v1, e.g. Debian 12 "Bookworm". Using docker compose v1 will lead to a broken docker deployment. + +### Local Development + +1. **Clone the repository**: + ```bash + git clone https://github.com/opencloud-eu/opencloud-compose.git + cd opencloud-compose + ``` + +2. **Create environment file**: + ```bash + cp .env.example .env + ``` + + > **Note**: The repository includes `.env.example` as a template with default settings and documentation. Your actual `.env` file is excluded from version control (via `.gitignore`) to prevent accidentally committing sensitive information like passwords and domain-specific settings. + +3. **Set admin password**: + set `INITIAL_ADMIN_PASSWORD=your_secure_password` environment variable in your `.env` file +4. **Domain**: + optionally, set `OC_DOMAIN=your-domain.com` to overwrite the default `cloud.opencloud.test` +5. **Configure deployment options**: + + You can deploy using explicit `-f` flags: + ```bash + docker compose -f docker-compose.yml -f traefik/opencloud.yml up -d + ``` + + Or by adding the `COMPOSE_FILE` variable in `.env`: + ``` + COMPOSE_FILE=docker-compose.yml:traefik/opencloud.yml + ``` + + Then simply run: + ```bash + docker compose up -d + ``` + +6. **Add local domains to `/etc/hosts`** (for local development only): + ``` + 127.0.0.1 cloud.opencloud.test + 127.0.0.1 traefik.opencloud.test + 127.0.0.1 keycloak.opencloud.test + ``` + +7. **Access OpenCloud**: + - URL: https://cloud.opencloud.test + - Username: `admin` + - Password: value of your `INITIAL_ADMIN_PASSWORD` + +### Production Deployment + +> **DNS Requirements**: For production deployments, you need real DNS entries pointing to your server for all required subdomains. You can either create individual DNS A/AAAA records for each subdomain (e.g., `cloud.example.com`, `collabora.example.com`, `keycloak.example.com`) or use a wildcard DNS entry (`*.example.com`) that covers all subdomains. + +1. **Edit the `.env` file** and configure: + - Domain names (replace `.opencloud.test` domains with your real domains) + - Admin password + - SSL certificate email + - Storage paths + +2. **Configure deployment options** in `.env`: + ``` + COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml + ``` + +3. **Start OpenCloud**: + ```bash + docker compose up -d + ``` + +## Deployment Options + +### With Keycloak and LDAP using a Shared User Directory + +OpenCloud can be deployed with Keycloak for identity management and LDAP for the shared user directory: + +> **DNS Requirements**: This setup requires DNS entries for both the main OpenCloud domain and the Keycloak subdomain. Configure DNS A/AAAA records for your domains (e.g., `cloud.example.com`, `keycloak.example.com`) or use a wildcard DNS entry (`*.example.com`). + +Using `-f` flags: +```bash +docker compose -f docker-compose.yml -f idm/ldap-keycloak.yml -f traefik/opencloud.yml -f traefik/ldap-keycloak.yml up -d +``` + +Or by setting in `.env`: +``` +COMPOSE_FILE=docker-compose.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/ldap-keycloak.yml +``` + +> **For local development only**: Add to `/etc/hosts`: +> ``` +> 127.0.0.1 keycloak.opencloud.test +> ``` + +This setup includes: +- Keycloak for authentication and identity management +- Shared LDAP server as a user directory with demo users and groups +- Integration with Keycloak using OpenCloud clients (`web`, `OpenCloudDesktop`, `OpenCloudAndroid`, `OpenCloudIOS`) + +### With Collabora Online + +Include Collabora for document editing using either method: + +> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain, Collabora subdomain, and WOPI server subdomain. Configure DNS A/AAAA records for your domains (e.g., `cloud.example.com`, `collabora.example.com`, `wopiserver.example.com`) or use a wildcard DNS entry (`*.example.com`). + +Using `-f` flags: +```bash +docker compose -f docker-compose.yml -f weboffice/collabora.yml -f traefik/opencloud.yml -f traefik/collabora.yml up -d +``` + +Or by setting in `.env`: +``` +COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml +``` + +> **For local development only**: Add to `/etc/hosts`: +> ``` +> 127.0.0.1 collabora.opencloud.test +> 127.0.0.1 wopiserver.opencloud.test +> ``` + +### With Full Text Search + +Enable full text search capabilities with Apache Tika using either method: + +> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain. Configure a DNS A/AAAA record for your domain (e.g., `cloud.example.com`) or use a wildcard DNS entry (`*.example.com`). + +Using `-f` flags: +```bash +docker compose -f docker-compose.yml -f search/tika.yml -f traefik/opencloud.yml up -d +``` + +Or by setting in `.env`: +``` +COMPOSE_FILE=docker-compose.yml:search/tika.yml:traefik/opencloud.yml +``` + +This setup includes: +- Apache Tika for text extraction and metadata analysis from various file formats +- Full text search functionality in the OpenCloud interface +- Support for documents, PDFs, images, and other file types + +### With Radicale + +Enable CalDAV (calendars, to-do lists) and CardDAV (contacts) server. + +> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain. Configure a DNS A/AAAA record for your domain (e.g., `cloud.example.com`) or use a wildcard DNS entry (`*.example.com`). + +Using `-f` flags: +```bash +docker compose -f docker-compose.yml -f radicale/radicale.yml -f traefik/opencloud.yml up -d +``` + +Or by setting in `.env`: +``` +COMPOSE_FILE=docker-compose.yml:radicale/radicale.yml:traefik/opencloud.yml +``` + +This setup includes: +- Radicale as a CalDAV (calendars, to-do lists) and CardDAV (contacts) server +- Users access to a Personal Calendar and Addressbook + +### With Monitoring + +Enable monitoring capabilities with metrics endpoints using either method: + +> **DNS Requirements**: This setup requires DNS entries for the main OpenCloud domain. Configure a DNS A/AAAA record for your domain (e.g., `cloud.example.com`) or use a wildcard DNS entry (`*.example.com`). + +Using `-f` flags: +```bash +docker compose -f docker-compose.yml -f monitoring/monitoring.yml -f traefik/opencloud.yml up -d +``` + +Or by setting in `.env`: +``` +COMPOSE_FILE=docker-compose.yml:monitoring/monitoring.yml:traefik/opencloud.yml +``` + +This setup includes: +- Metrics endpoints for OpenCloud proxy service (port 9205) +- Metrics endpoints for collaboration service (port 9304) +- Performance monitoring and observability data +- Prometheus-compatible metrics format + +Access metrics endpoints: +- OpenCloud metrics: `http://localhost:9205/metrics` +- Collaboration metrics: `http://localhost:9304/metrics` + +> **Note**: The monitoring configuration uses an external network `opencloud-net`. You need to create this network manually before starting the services: +> ```bash +> docker network create opencloud-net +> ``` + +### Behind External Proxy + +If you already have a reverse proxy (Nginx, Caddy, etc.), use either method: + +> **DNS Requirements**: When using an external proxy, you need to configure your external proxy to handle DNS and SSL termination. Ensure your DNS entries point to your external proxy server, and configure your proxy to forward requests to the exposed OpenCloud ports. + +Using `-f` flags: +```bash +docker compose -f docker-compose.yml -f weboffice/collabora.yml -f external-proxy/opencloud.yml -f external-proxy/collabora.yml up -d +``` + +Or by setting in `.env`: +``` +COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:external-proxy/opencloud.yml:external-proxy/collabora.yml +``` + +This exposes the necessary ports: +- OpenCloud: 9200 +- Collabora: 9980 +- WOPI server: 9300 + +**Please note:** +If you're using **Nginx Proxy Manager (NPM)**, you **should NOT** activate **"Block Common Exploits"** for the Proxy Host. +Otherwise, the desktop app authentication will return **error 403 Forbidden**. + + +## SSL Certificate Support + +OpenCloud Compose supports adding SSL certificates for public domains and development environments. This feature enables you to use the "Let's Encrypt ACME challenge" to generate certificates for your public domains as well as using your own certificates. + +### Use Let's Encrypt with ACME Challenge + +1. **Enable Let's Encrypt**: + - Set `TRAEFIK_LETSENCRYPT_EMAIL` to your email address for the ACME challenge + - Set `TRAEFIK_SERVICES_TLS_CONFIG="tls.certresolver=letsencrypt"` to use Let's Encrypt (default value) + + ```bash + # In your .env file + TRAEFIK_LETSENCRYPT_EMAIL=devops@your-domain.tld + TRAEFIK_SERVICES_TLS_CONFIG="tls.certresolver=letsencrypt" + ``` + +### Use Certificates from the `certs/` directory + +1. **Place your certificates**: + - Copy your certificate files (`.crt`, `.pem`, `.key`) to the `certs/` directory + - The directory structure is flexible - organize as needed for your setup + +2. **Configure Traefik dynamic configuration**: + - Place Traefik dynamic configuration files in `config/traefik/dynamic/` + + Example `config/traefik/dynamic/certs.yml`: + ```yaml + tls: + certificates: + - certFile: /certs/opencloud.test.crt + keyFile: /certs/opencloud.test.key + stores: + - default + - certFile: /certs/wildcard.example.com.crt + keyFile: /certs/wildcard.example.com.key + stores: + - default + ``` + +3. **Configure environment variables**: + - Set `TRAEFIK_SERVICES_TLS_CONFIG="tls=true"` to use your local certificates + + ```bash + # In your .env file + TRAEFIK_SERVICES_TLS_CONFIG="tls=true" + ``` + +The certificate directory and configuration directories are now available and automatically mounted in the containers: +- `certs/` → `/certs/` (inside the Traefik container) +- `config/traefik/dynamic/` → dynamic configuration loading + +> [!TIP] +> +> **Local development or testing with mkcert** +> For local development, you can use `mkcert` to generate self-signed certificates for your local domains. This allows you to test SSL/TLS configurations without needing a public domain or Let's Encrypt. It also brings the advantage that you don't have to accept self-signed certificates in your browser all the time. +> ```bash +> # Install mkcert (if not already installed) +> # macOS: brew install mkcert +> # Linux: apt install mkcert or similar +> # Windows: choco install mkcert or download from GitHub +> +> # Install the local CA +> mkcert -install +> +> # Generate certificates for your local domains +> mkcert -cert-file certs/opencloud.test.crt -key-file certs/opencloud.test.key "*.opencloud.test" opencloud.test +> ``` + +> [!IMPORTANT] +> The contents of the `certs/` directory and configuration directories are ignored by git to prevent accidentally committing sensitive certificate files. + +## Configuration + +### Environment Variables + +The configuration is managed through environment variables in the `.env` file: + +- We provide `.env.example` as a template with documentation for all options +- Your personal `.env` file is ignored by git to keep sensitive information private +- This pattern allows everyone to customize their deployment without affecting the repository + +Key variables: + +| Variable | Description | Default | +|-------------------------------|-------------------------------------------------------|------------------------------| +| `COMPOSE_FILE` | Colon-separated list of compose files to use | (commented out) | +| `OC_DOMAIN` | OpenCloud domain | cloud.opencloud.test | +| `INITIAL_ADMIN_PASSWORD ` | OpenCloud password for the admin user | (no value) | +| `OC_DOCKER_TAG` | OpenCloud image tag | latest | +| `OC_CONFIG_DIR` | Config directory path | (Docker volume) | +| `OC_DATA_DIR` | Data directory path | (Docker volume) | +| `INSECURE` | Skip certificate validation | true | +| `COLLABORA_DOMAIN` | Collabora domain | collabora.opencloud.test | +| `WOPISERVER_DOMAIN` | WOPI server domain | wopiserver.opencloud.test | +| `TIKA_IMAGE` | Apache Tika image tag | apache/tika:latest-full | +| `KEYCLOAK_DOMAIN` | Keycloak domain | keycloak.opencloud.test | +| `KEYCLOAK_ADMIN` | Keycloak admin username | kcadmin | +| `KEYCLOAK_ADMIN_PASSWORD` | Keycloak admin password | admin | +| `LDAP_BIND_PASSWORD` | LDAP password for the bind user | admin | +| `KC_DB_USERNAME` | Database user for keycloak | keycloak | +| `KC_DB_PASSWORD` | Database password for keycloak | keycloak | +| `TRAEFIK_LETSENCRYPT_EMAIL` | Email Address for the Let's Encrypt ACME challenge | example@example.org | +| `TRAEFIK_SERVICES_TLS_CONFIG` | Tell traefik and the services which TLS config to use | tls.certresolver=letsencrypt | +| `TRAEFIK_CERTS_DIR` | Directory for custom certificates. | ./certs | + +See `.env.example` for all available options and their documentation. + +### Admin Password Configuration + +The `INITIAL_ADMIN_PASSWORD` environment variable is **required** for OpenCloud to work properly: + +- **Only needed when using the built-in LDAP server (idm)** +- **Must be set before the first start of OpenCloud. Changes in the ENV variable after the first startup will be ignored.** +- If not set, OpenCloud will not work properly and the container will keep restarting +- After first initialization, the admin password can only be changed via: + - OpenCloud User Settings UI + - OpenCloud CLI + +For external LDAP servers, the admin password is managed by the LDAP server itself. + +**Important**: Set this variable in your `.env` file before starting OpenCloud for the first time: +``` +INITIAL_ADMIN_PASSWORD=your-secure-password-here +``` + +For more details, see the [OpenCloud documentation](https://docs.opencloud.eu/docs/admin/resources/common-issues#-change-admin-password-set-in-env). + +### Persistent Storage + +For production, configure persistent storage: + +``` +OC_CONFIG_DIR=/path/to/opencloud/config +OC_DATA_DIR=/path/to/opencloud/data +``` + +Ensure proper permissions: +```bash +mkdir -p /path/to/opencloud/{config,data} +chown -R 1000:1000 /path/to/opencloud +``` + +#### Odoo Volume Permissions (First-Time Setup) + +When deploying Odoo for the first time, the named volumes are created with root ownership by default. To allow Odoo to write to its filestore and other directories, fix the ownership before starting the services: + +```bash +# Detect Odoo UID:GID and fix volume ownership +OG=$(docker run --rm odoo:19 sh -c "printf \"%s:%s\" \"\$(id -u odoo)\" \"\$(id -g odoo)\"") +for v in odoo-filestore odoo-db-data odoo-config odoo-logs odoo-web-data odoo-addons; do + docker run --rm -v "${v}:/data" alpine chown -R "$OG" /data +done +``` + +This ensures Odoo can create attachments, logs, and configuration files without permission errors. + +### Compose File Structure + +This repository uses a modular approach with multiple compose files: + +- `docker-compose.yml` - Core OpenCloud service +- `weboffice/` - Web office integrations (Collabora Online) +- `storage/` - Storage backend configurations (decomposeds3) +- `search/` - Search and content analysis services (Apache Tika) +- `monitoring/` - Monitoring and metrics configurations +- `idm/` - Identity management configurations (Keycloak & LDAP) +- `traefik/` - Traefik reverse proxy configurations +- `external-proxy/` - Configuration for external reverse proxies +- `radicale/` - Radicale configuration +- `config/` - Configuration files for OpenCloud, Keycloak, and LDAP + +## Advanced Usage + +### Understanding the COMPOSE_FILE Variable + +The `COMPOSE_FILE` environment variable is a powerful way to manage complex Docker Compose deployments: + +- It uses colons (`:`) as separators between files (configurable with `COMPOSE_PATH_SEPARATOR`) +- Files are processed in order, with later files overriding settings from earlier ones +- It allows you to run just `docker compose up -d` without specifying `-f` flags +- Perfect for automation, CI/CD pipelines, and consistent deployments + +Example configurations: + +Production with Collabora: +``` +COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml +``` + +Production with Keycloak and LDAP: +``` +COMPOSE_FILE=docker-compose.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/ldap-keycloak.yml +``` + +Production with both Collabora and Keycloak/LDAP: +``` +COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:idm/ldap-keycloak.yml:traefik/opencloud.yml:traefik/collabora.yml:traefik/ldap-keycloak.yml +``` + +Production with monitoring: +``` +COMPOSE_FILE=docker-compose.yml:monitoring/monitoring.yml:traefik/opencloud.yml +``` + +### Automation and GitOps + +For automated deployments, using the `COMPOSE_FILE` variable in `.env` is recommended: + +``` +COMPOSE_FILE=docker-compose.yml:weboffice/collabora.yml:traefik/opencloud.yml:traefik/collabora.yml +``` + +This allows tools like Ansible or CI/CD pipelines to deploy the stack without modifying the compose files. + +### Custom compose file overrides + +You can create custom compose files to override specific settings after creating a `custom` directory: +```bash +mkdir -p custom +``` + +Then create a `docker-compose.override.yml` file in the `custom` directory with your overrides. + +This folder is ignored by git, allowing you to customize your deployment without affecting the repository. This can be useful in scenarios like portainer where the git repository is configured as a stack. + +You can for example add custom labels to the OpenCloud service: + +```yaml +services: + opencloud: + labels: + - "traefik.enable=true" + - "traefik.http.routers.opencloud.rule=Host(`cloud.opencloud.test`)" + - "traefik.http.services.opencloud.loadbalancer.server.port=80" + - "traefik.http.routers.opencloud.tls.certresolver=my-resolver" +``` + +## Troubleshooting + +### Common Issues + +- **SSL Certificate Errors**: For local development, accept self-signed certificates by visiting each domain directly in your browser. +- **Port Conflicts**: If you have services already using ports 80/443, use the external proxy configuration. +- **Permission Issues**: Ensure data and config directories have proper permissions (owned by user/group 1000). + +### Logs + +View logs with: +```bash +docker compose logs -f +``` + +For specific service logs: +```bash +docker compose logs -f opencloud +``` + +## Contributing + +Contributions are welcome! Please feel free to submit a Pull Request. + +## License + +This project is licensed under the GNU General Public License v3 (GPLv3). diff --git a/backup/README.md b/backup/README.md new file mode 100644 index 0000000..40a43b4 --- /dev/null +++ b/backup/README.md @@ -0,0 +1,101 @@ +# Backup helper services + +This directory holds the lightweight services that create and restore the stack backups. They are kept separate from the main `docker-compose.yml` so you can start them on demand. + +## Files + +- `backup.yml` – defines the scheduled backup sidecars: + - `pgbackup` dumps the configured Postgres databases into `./backups/databases`. + - `backup-manager` waits for the latest DB dump, archives mounted application volumes, and rotates dated backup folders in `./backups`. +- `restore.yml` – provides a one-shot `restore` helper container that mounts the same named volumes and the `./backups` directory for restores. +- `../scripts/backup/*.sh` – shell scripts that power the services: + - `pg-dump.sh`, `manage-backups.sh`, `restore.sh` – generic helpers used by the containers. + - `restore-odoo.sh`, `restore-gitea.sh`, `restore-opencloud.sh` – wrappers that restore their respective volumes and (for Odoo/Gitea) the matching Postgres database dump in one shot. + +## Configuring backups (`backup.yml`) + +Environment variables (usually sourced from `.env`) let you control what gets dumped and how long backups are kept: + +| Variable | Used by | Purpose | +| --- | --- | --- | +| `POSTGRES_ADMIN_USER`, `POSTGRES_ADMIN_PASSWORD` | `pgbackup` | Credentials for the Postgres superuser/operator running `pg_dump`. | +| `BKP_DB_LIST` | `pgbackup` | Space-separated list of database names to dump each run. | +| `BKP_RETENTION_DAYS` | `backup-manager` | Delete dated backup directories and SQL dumps older than this many days (default 7). | +| `BKP_RETENTION_COUNT` | `backup-manager` | Keep only the newest N dated directories when >0 (directories newer than the day threshold are kept regardless). | + +`backup-manager` mounts the live volumes (`odoo-filestore`, `odoo-config`, `gitea_data`, etc.) read-only so it can archive their contents into timestamped tarballs. It also moves the SQL dumps from `./backups/databases` into each dated directory after the dump job finishes. The script writes a marker file (`.last_backup_complete`) so the manager only starts once the database dump completes; adjust `DB_BACKUP_TIMEOUT` in the environment if you want to change the wait time (default 600 s). + +To start the scheduled backup helpers alongside the stack: + +```bash +docker compose -f docker-compose.yml -f backup/backup.yml up -d pgbackup backup-manager +``` + +## Restoring backups (`restore.yml`) + +The restore helper uses the same Postgres image so it already ships with `psql`, `tar`, and `gzip`. Run the helper with your main compose file so the volumes resolve correctly: + +```bash +# Open a shell inside the helper +docker compose -f docker-compose.yml -f backup/restore.yml run --rm restore sh +``` + +Or call the bundled restore script directly via the helper entrypoint: + +```bash +# List dated backup directories +docker compose -f docker-compose.yml -f backup/restore.yml run --rm restore list + +# Restore the Odoo filestore archive into the named volume (services should be stopped first) +docker compose -f docker-compose.yml -f backup/restore.yml run --rm restore \ + restore-volume odoo-filestore /backups/2025-11-13/odoo_filestore_2025-11-13.tar.gz + +# Restore a database dump (uses POSTGRES_HOST env, defaults to `postgres`) +docker compose -f docker-compose.yml -f backup/restore.yml run --rm restore \ + restore-db /backups/2025-11-13/odoodb_2025-11-13.sql odoodb postgres "$POSTGRES_ADMIN_PASSWORD" +``` + +### Shortcut restore scripts + +For the most common restore scenarios, use the convenience wrappers in `scripts/backup/`: + +- `restore-odoo.sh BACKUP_ID [DB_NAME] [DB_USER]` – stops the `odoo` service, restores the filestore/config/addons/web/logs/db-data archives and, when `ODOO_DB_PASSWORD` is present, replays the `backups//_.sql(.gz)` dump that was moved into the same dated folder. Defaults: DB name from `ODOO_DB`/`ODOO_DB_NAME`, user from `ODOO_DB_USER`, fallbacks `odoo`/`odoouser`. +- `restore-gitea.sh BACKUP_ID [DB_NAME] [DB_USER]` – stops the `gitea` service, restores the data archive and, when `GITEA_DB_PASSWORD` is available, the `backups//_.sql(.gz)` dump residing alongside the volume archives. Defaults: DB name/user from `GITEA_DB`/`GITEA_DB_NAME` and `GITEA_DB_USER`, fallback `gitea`. +- `restore-opencloud.sh BACKUP_ID` – stops the `opencloud` service and restores the OpenCloud data archive before starting the service again. + +All three scripts automatically source the repository `.env` (if present) for credentials, run from the repository root, and restart the stopped service once extraction finishes. If a matching SQL dump is found but the corresponding password variable is not set the script skips the database restore with a warning so you can retry after exporting the secret. They expect `docker compose` to be on the PATH and the helper `restore` service available. +The restore helper now defaults to the service database user/password for connectivity (so values like `ODOO_DB_USER`, `ODOO_DB_PASSWORD`, `ODOO_DB_HOST`, etc. are enough for most restores). By default it drops the existing database before replaying the dump (`DROP_EXISTING_DB=1`, overridable per service via `ODOO_DROP_EXISTING_DB` / `GITEA_DROP_EXISTING_DB`). Set the flag to `0` if you prefer to manage cleanup manually. If the configured user lacks the privileges to drop/create databases you can export `POSTGRES_ADMIN_USER`, `POSTGRES_ADMIN_PASSWORD`, and optionally `POSTGRES_ADMIN_DB` to elevate the operation; otherwise prepare the database yourself before rerunning the script. + +Example: + +```bash +# Restore Odoo from a dated backup directory and replay its DB dump +./scripts/backup/restore-odoo.sh 2025-11-13_04-15 + +# Restore Gitea using custom database credentials +GITEA_DB_PASSWORD=supersecret ./scripts/backup/restore-gitea.sh 2025-11-13_04-15 giteadb gitea + +# Restore OpenCloud files only +./scripts/backup/restore-opencloud.sh 2025-11-13_04-15 +``` + +Under the hood the helper mounts: + +- `./backups` (read-only) so you can access tarballs and SQL dumps. +- The named volumes (`odoo-filestore`, `odoo-config`, `odoo-addons`, `gitea_data`, `opencloud-data`, etc.) so extraction happens directly into the running stack’s storage. +- `restore.sh`, which provides the `list`, `restore-volume`, and `restore-db` commands (run `restore help` for usage inside the container). + +## Best practices + +- Stop (or put into maintenance) any service that uses a target volume or database before restoring to avoid live writes fighting the restore. +- After a restore, restart the services you paused and verify permissions inside the volume; you might need to run a `chown` if the target container expects a different UID/GID. +- Test your backup/restore workflow in a safe environment so you know the round-trip works before you need it in production. +- Keep an eye on `/var/log/backup.log` inside the `pgbackup` and `backup-manager` containers if you need to confirm when jobs run or troubleshoot failures. + +## Troubleshooting + +- **Backups didn’t rotate:** confirm `BKP_RETENTION_DAYS`/`BKP_RETENTION_COUNT` are exported and that cron has run long enough for the age threshold to be exceeded. +- **Manager starts too early:** raise `DB_BACKUP_TIMEOUT` or make sure the database list in `BKP_DB_LIST` only contains existing databases. +- **Restore fails with permission errors:** ensure the target volume is mounted read-write for the restore step, or restore into a temporary directory and adjust ownership manually. + +If you need frequently used restore commands, consider adding shell aliases or Makefile targets (e.g., `make restore-odoo DATE=2025-11-13`). diff --git a/backup/backup.yml b/backup/backup.yml new file mode 100644 index 0000000..beb86ed --- /dev/null +++ b/backup/backup.yml @@ -0,0 +1,53 @@ +--- +services: + pgbackup: + image: postgres:18-alpine + container_name: pgbackup + restart: always + environment: + PGPASSWORD: ${POSTGRES_ADMIN_PASSWORD} + POSTGRES_HOST: postgres + POSTGRES_USER: ${POSTGRES_ADMIN_USER} + DB_LIST: ${BKP_DB_LIST} + TIMEZONE: ${TIMEZONE} + volumes: + - ./backups:/backups + - ./scripts/backup/pg-dump.sh:/pg-dump.sh + - ./scripts/backup/pg-dump.cron:/etc/crontabs/root + entrypoint: ["/bin/sh", "-c", "# map host /backups ownership to container backup user\nHOST_UID=$$(stat -c '%u' /backups 2>/dev/null || echo 1000) && HOST_GID=$$(stat -c '%g' /backups 2>/dev/null || echo 1000) && addgroup -g \"$$HOST_GID\" backup 2>/dev/null || true && adduser -D -u \"$$HOST_UID\" -G backup backup 2>/dev/null || true && mkdir -p /var/log /backups && chown -R \"$$HOST_UID\":\"$$HOST_GID\" /var/log /backups 2>/dev/null || true && chmod +x /pg-dump.sh && chown root:root /etc/crontabs/root 2>/dev/null || true && crond -f"] + + backup-manager: + image: alpine:latest + container_name: backup-manager + restart: always + depends_on: + - pgbackup + environment: + BACKUP_RETENTION_COUNT: ${BKP_RETENTION_COUNT} + BACKUP_RETENTION_DAYS: ${BKP_RETENTION_DAYS} + TIMEZONE: ${TIMEZONE} + volumes: + - ./backups:/backups + - type: volume + source: odoo-db-data + target: /odoo_db_data + read_only: true + - type: volume + source: odoo-config + target: /odoo_config + read_only: true + - type: volume + source: gitea_data + target: /gitea_data + read_only: true + - type: volume + source: opencloud-data + target: /opencloud_data + read_only: true + - type: volume + source: opencloud-config + target: /opencloud_config + read_only: true + - ./scripts/backup/manage-backups.sh:/manage-backups.sh + - ./scripts/backup/backup-manager.cron:/etc/crontabs/root + entrypoint: ["/bin/sh", "-c", "# install bsdtar for xattr-aware archives\napk add --no-cache libarchive-tools attr >/dev/null \n# map host /backups ownership to container backup user\nHOST_UID=$$(stat -c '%u' /backups 2>/dev/null || echo 1000) && HOST_GID=$$(stat -c '%g' /backups 2>/dev/null || echo 1000) && addgroup -g \"$$HOST_GID\" backup 2>/dev/null || true && adduser -D -u \"$$HOST_UID\" -G backup backup 2>/dev/null || true && mkdir -p /var/log /backups && chown -R \"$$HOST_UID\":\"$$HOST_GID\" /var/log /backups 2>/dev/null || true && chmod +x /manage-backups.sh && chown root:root /etc/crontabs/root 2>/dev/null || true && crond -f"] diff --git a/backup/restore.yml b/backup/restore.yml new file mode 100644 index 0000000..fbcddd6 --- /dev/null +++ b/backup/restore.yml @@ -0,0 +1,36 @@ +--- +# One-shot helper service for restores. Run with your main compose file so +# volumes and networks resolve to the same project. +services: + restore: + image: postgres:18-alpine + container_name: restore + restart: "no" + environment: + IN_CONTAINER: "1" + POSTGRES_HOST: postgres + volumes: + - ./backups:/backups:ro + - type: volume + source: odoo-db-data + target: /odoo_db_data + - type: volume + source: odoo-config + target: /odoo_config + - type: volume + source: gitea_data + target: /gitea_data + - type: volume + source: opencloud-data + target: /opencloud_data + - type: volume + source: opencloud-config + target: /opencloud_config + - ./scripts/backup/restore.sh:/restore.sh:ro + entrypoint: + - /bin/sh + - -c + - | + apk add --no-cache libarchive-tools attr >/dev/null + exec /restore.sh "$@" + - -- diff --git a/certs/.gitkeep b/certs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/.DS_Store b/config/.DS_Store new file mode 100644 index 0000000..2e2eb04 Binary files /dev/null and b/config/.DS_Store differ diff --git a/config/keycloak/clients/OpenCloudAndroid.json b/config/keycloak/clients/OpenCloudAndroid.json new file mode 100644 index 0000000..c21838d --- /dev/null +++ b/config/keycloak/clients/OpenCloudAndroid.json @@ -0,0 +1,63 @@ +{ + "clientId": "OpenCloudAndroid", + "name": "OpenCloud Android App", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "oc://android.opencloud.eu" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "post.logout.redirect.uris": "oc://android.opencloud.eu", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ], + "access": { + "view": true, + "configure": true, + "manage": true + } +} \ No newline at end of file diff --git a/config/keycloak/clients/OpenCloudDesktop.json b/config/keycloak/clients/OpenCloudDesktop.json new file mode 100644 index 0000000..d17a7cb --- /dev/null +++ b/config/keycloak/clients/OpenCloudDesktop.json @@ -0,0 +1,64 @@ +{ + "clientId": "OpenCloudDesktop", + "name": "OpenCloud Desktop Client", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "http://127.0.0.1", + "http://localhost" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "post.logout.redirect.uris": "+", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ], + "access": { + "view": true, + "configure": true, + "manage": true + } +} \ No newline at end of file diff --git a/config/keycloak/clients/OpenCloudIOS.json b/config/keycloak/clients/OpenCloudIOS.json new file mode 100644 index 0000000..d09e089 --- /dev/null +++ b/config/keycloak/clients/OpenCloudIOS.json @@ -0,0 +1,63 @@ +{ + "clientId": "OpenCloudIOS", + "name": "OpenCloud iOS App", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "oc://ios.opencloud.eu" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "post.logout.redirect.uris": "oc://ios.opencloud.eu", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ], + "access": { + "view": true, + "configure": true, + "manage": true + } +} \ No newline at end of file diff --git a/config/keycloak/clients/cyberduck.json b/config/keycloak/clients/cyberduck.json new file mode 100644 index 0000000..5143323 --- /dev/null +++ b/config/keycloak/clients/cyberduck.json @@ -0,0 +1,66 @@ +{ + "clientId": "Cyberduck", + "name": "Cyberduck", + "description": "File transfer utility client", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "x-cyberduck-action:oauth", + "x-mountainduck-action:oauth" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "oauth2.device.authorization.grant.enabled": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "oidc.ciba.grant.enabled": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ], + "access": { + "view": true, + "configure": true, + "manage": true + } +} \ No newline at end of file diff --git a/config/keycloak/clients/web.json b/config/keycloak/clients/web.json new file mode 100644 index 0000000..9ab819a --- /dev/null +++ b/config/keycloak/clients/web.json @@ -0,0 +1,74 @@ +{ + "clientId": "web", + "name": "OpenCloud Web App", + "description": "", + "rootUrl": "{{OC_URL}}", + "adminUrl": "{{OC_URL}}", + "baseUrl": "", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "{{OC_URL}}/", + "{{OC_URL}}/oidc-callback.html", + "{{OC_URL}}/oidc-silent-redirect.html" + ], + "webOrigins": [ + "{{OC_URL}}" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "post.logout.redirect.uris": "+", + "oauth2.device.authorization.grant.enabled": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "oidc.ciba.grant.enabled": "false", + "backchannel.logout.url": "{{OC_URL}}/backchannel_logout", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ], + "access": { + "view": true, + "configure": true, + "manage": true + } +} \ No newline at end of file diff --git a/config/keycloak/docker-entrypoint-override.sh b/config/keycloak/docker-entrypoint-override.sh new file mode 100644 index 0000000..4809750 --- /dev/null +++ b/config/keycloak/docker-entrypoint-override.sh @@ -0,0 +1,8 @@ +#!/bin/bash +printenv +# replace openCloud domain and LDAP password in keycloak realm import +mkdir /opt/keycloak/data/import +sed -e "s/cloud.opencloud.test/${OC_DOMAIN}/g" -e "s/ldap-admin-password/${LDAP_ADMIN_PASSWORD:-admin}/g" /opt/keycloak/data/import-dist/openCloud-realm.json > /opt/keycloak/data/import/openCloud-realm.json + +# run original docker-entrypoint +/opt/keycloak/bin/kc.sh "$@" diff --git a/config/keycloak/opencloud-realm-autoprovisioning.dist.json b/config/keycloak/opencloud-realm-autoprovisioning.dist.json new file mode 100644 index 0000000..989616a --- /dev/null +++ b/config/keycloak/opencloud-realm-autoprovisioning.dist.json @@ -0,0 +1,2285 @@ +{ + "id" : "openCloud", + "realm" : "openCloud", + "displayName" : "OpenCloud", + "notBefore" : 0, + "defaultSignatureAlgorithm" : "RS256", + "revokeRefreshToken" : false, + "refreshTokenMaxReuse" : 0, + "accessTokenLifespan" : 300, + "accessTokenLifespanForImplicitFlow" : 900, + "ssoSessionIdleTimeout" : 1800, + "ssoSessionMaxLifespan" : 36000, + "ssoSessionIdleTimeoutRememberMe" : 0, + "ssoSessionMaxLifespanRememberMe" : 0, + "offlineSessionIdleTimeout" : 2592000, + "offlineSessionMaxLifespanEnabled" : false, + "offlineSessionMaxLifespan" : 5184000, + "clientSessionIdleTimeout" : 0, + "clientSessionMaxLifespan" : 0, + "clientOfflineSessionIdleTimeout" : 0, + "clientOfflineSessionMaxLifespan" : 0, + "accessCodeLifespan" : 60, + "accessCodeLifespanUserAction" : 300, + "accessCodeLifespanLogin" : 1800, + "actionTokenGeneratedByAdminLifespan" : 43200, + "actionTokenGeneratedByUserLifespan" : 300, + "oauth2DeviceCodeLifespan" : 600, + "oauth2DevicePollingInterval" : 5, + "enabled" : true, + "sslRequired" : "external", + "registrationAllowed" : false, + "registrationEmailAsUsername" : false, + "rememberMe" : false, + "verifyEmail" : false, + "loginWithEmailAllowed" : true, + "duplicateEmailsAllowed" : false, + "resetPasswordAllowed" : false, + "editUsernameAllowed" : false, + "bruteForceProtected" : true, + "permanentLockout" : false, + "maxTemporaryLockouts" : 0, + "maxFailureWaitSeconds" : 900, + "minimumQuickLoginWaitSeconds" : 60, + "waitIncrementSeconds" : 60, + "quickLoginCheckMilliSeconds" : 1000, + "maxDeltaTimeSeconds" : 43200, + "failureFactor" : 30, + "roles" : { + "realm" : [ { + "id" : "2d576514-4aae-46aa-9d9c-075f55f4d988", + "name" : "uma_authorization", + "description" : "${role_uma_authorization}", + "composite" : false, + "clientRole" : false, + "containerId" : "openCloud", + "attributes" : { } + }, { + "id" : "2aadd357-682c-406b-8874-293091995fdd", + "name" : "opencloudSpaceAdmin", + "description" : "", + "composite" : false, + "clientRole" : false, + "containerId" : "openCloud", + "attributes" : { } + }, { + "id" : "38071a68-456a-4553-846a-fa67bf5596cc", + "name" : "opencloudGuest", + "description" : "", + "composite" : false, + "clientRole" : false, + "containerId" : "openCloud", + "attributes" : { } + }, { + "id" : "71881883-1768-46bd-a24d-a356a2afdf7f", + "name" : "opencloudAdmin", + "description" : "", + "composite" : false, + "clientRole" : false, + "containerId" : "openCloud", + "attributes" : { } + }, { + "id" : "e2145b30-bf6f-49fb-af3f-1b40168bfcef", + "name" : "offline_access", + "description" : "${role_offline-access}", + "composite" : false, + "clientRole" : false, + "containerId" : "openCloud", + "attributes" : { } + }, { + "id" : "82e13ea7-aac4-4d2c-9fc7-cff8333dbe19", + "name" : "default-roles-opencloud", + "description" : "${role_default-roles}", + "composite" : true, + "composites" : { + "realm" : [ "offline_access", "uma_authorization" ], + "client" : { + "account" : [ "manage-account", "view-profile" ] + } + }, + "clientRole" : false, + "containerId" : "openCloud", + "attributes" : { } + }, { + "id" : "d7beeea8-8ff4-406b-8fb6-ab2dd81e6b11", + "name" : "opencloudUser", + "description" : "", + "composite" : false, + "clientRole" : false, + "containerId" : "openCloud", + "attributes" : { } + } ], + "client" : { + "_system" : [ ], + "realm-management" : [ { + "id" : "979ce053-a671-4b50-81d5-da4bdf7404c9", + "name" : "view-clients", + "description" : "${role_view-clients}", + "composite" : true, + "composites" : { + "client" : { + "realm-management" : [ "query-clients" ] + } + }, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "4bec4791-e888-4dac-bc95-71720d5981b9", + "name" : "query-users", + "description" : "${role_query-users}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "955b4406-b04f-432d-a61a-571675874341", + "name" : "manage-authorization", + "description" : "${role_manage-authorization}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "baa219af-2773-4d59-b06b-485f10fbbab3", + "name" : "view-events", + "description" : "${role_view-events}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "f280bc03-d079-478d-be06-3590580b25e9", + "name" : "manage-users", + "description" : "${role_manage-users}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "db698163-84ad-46c9-958f-bb5f80ae78b5", + "name" : "query-clients", + "description" : "${role_query-clients}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "36c04d89-abf7-4a2c-a808-8efa9aca1435", + "name" : "manage-clients", + "description" : "${role_manage-clients}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "06eae953-11d5-4344-b089-ffce1e68d5d8", + "name" : "query-realms", + "description" : "${role_query-realms}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "afe8aa78-2f06-43a5-8c99-cf68a1f5a86a", + "name" : "realm-admin", + "description" : "${role_realm-admin}", + "composite" : true, + "composites" : { + "client" : { + "realm-management" : [ "view-clients", "query-users", "manage-authorization", "view-events", "manage-users", "query-clients", "manage-clients", "query-realms", "impersonation", "manage-realm", "manage-identity-providers", "view-authorization", "create-client", "query-groups", "view-users", "view-realm", "view-identity-providers", "manage-events" ] + } + }, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "22ee128a-b28e-4c6a-aa8e-ad4136d74e1b", + "name" : "impersonation", + "description" : "${role_impersonation}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "89d4f119-7f87-44d9-8eef-d207304de778", + "name" : "manage-realm", + "description" : "${role_manage-realm}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "ebffeff4-6794-4003-a2ab-a79eff7d1baa", + "name" : "manage-identity-providers", + "description" : "${role_manage-identity-providers}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "2361a7ff-d2b3-43f5-b360-ad0e44fba65c", + "name" : "view-authorization", + "description" : "${role_view-authorization}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "f7bf6d7a-a861-49c6-8f6f-225c18d0a03a", + "name" : "create-client", + "description" : "${role_create-client}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "34ccce1c-5a7e-4268-8836-2276545be900", + "name" : "query-groups", + "description" : "${role_query-groups}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "430f7831-8f22-4518-bd15-2998eae45a51", + "name" : "view-users", + "description" : "${role_view-users}", + "composite" : true, + "composites" : { + "client" : { + "realm-management" : [ "query-groups", "query-users" ] + } + }, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "371a31e6-4494-4b74-b3ea-d030663423ed", + "name" : "view-realm", + "description" : "${role_view-realm}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "e875775b-7a3e-4a5d-9e4e-376351b78626", + "name" : "view-identity-providers", + "description" : "${role_view-identity-providers}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + }, { + "id" : "3dce7929-ee1f-40cd-9be1-7addcae92cef", + "name" : "manage-events", + "description" : "${role_manage-events}", + "composite" : false, + "clientRole" : true, + "containerId" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes" : { } + } ], + "OpenCloudDesktop" : [ ], + "web" : [ ], + "security-admin-console" : [ ], + "OpenCloudAndroid" : [ ], + "admin-cli" : [ ], + "OpenCloudIOS" : [ ], + "account-console" : [ ], + "broker" : [ { + "id" : "81fad68a-8dd8-4d79-9a8f-206a82460145", + "name" : "read-token", + "description" : "${role_read-token}", + "composite" : false, + "clientRole" : true, + "containerId" : "002faf0a-716c-4230-81c7-ce22d1eb832c", + "attributes" : { } + } ], + "account" : [ { + "id" : "c49a49da-8ad0-44cb-b518-6d7d72cbe494", + "name" : "manage-account", + "description" : "${role_manage-account}", + "composite" : true, + "composites" : { + "client" : { + "account" : [ "manage-account-links" ] + } + }, + "clientRole" : true, + "containerId" : "9850adad-7910-4b67-a790-da6444361618", + "attributes" : { } + }, { + "id" : "9dc2244e-b8a7-44f1-b173-d2b929fedcca", + "name" : "view-consent", + "description" : "${role_view-consent}", + "composite" : false, + "clientRole" : true, + "containerId" : "9850adad-7910-4b67-a790-da6444361618", + "attributes" : { } + }, { + "id" : "ce115327-99c9-44d4-ba7d-820397dc11e6", + "name" : "manage-account-links", + "description" : "${role_manage-account-links}", + "composite" : false, + "clientRole" : true, + "containerId" : "9850adad-7910-4b67-a790-da6444361618", + "attributes" : { } + }, { + "id" : "2ffdf854-084b-467a-91c6-7f07844efc9a", + "name" : "view-groups", + "description" : "${role_view-groups}", + "composite" : false, + "clientRole" : true, + "containerId" : "9850adad-7910-4b67-a790-da6444361618", + "attributes" : { } + }, { + "id" : "8c45ca71-32aa-4547-932d-412da5e371ed", + "name" : "view-profile", + "description" : "${role_view-profile}", + "composite" : false, + "clientRole" : true, + "containerId" : "9850adad-7910-4b67-a790-da6444361618", + "attributes" : { } + }, { + "id" : "cbeecf6d-9af8-4746-877b-74800a894c35", + "name" : "view-applications", + "description" : "${role_view-applications}", + "composite" : false, + "clientRole" : true, + "containerId" : "9850adad-7910-4b67-a790-da6444361618", + "attributes" : { } + }, { + "id" : "ea798f64-b5f8-417f-9fe0-d3cd9172884f", + "name" : "delete-account", + "description" : "${role_delete-account}", + "composite" : false, + "clientRole" : true, + "containerId" : "9850adad-7910-4b67-a790-da6444361618", + "attributes" : { } + }, { + "id" : "e73aaf6d-e67b-491a-9cc3-78c32c82b42c", + "name" : "manage-consent", + "description" : "${role_manage-consent}", + "composite" : true, + "composites" : { + "client" : { + "account" : [ "view-consent" ] + } + }, + "clientRole" : true, + "containerId" : "9850adad-7910-4b67-a790-da6444361618", + "attributes" : { } + } ] + } + }, + "groups" : [ { + "id" : "6c80a8fa-46cd-4b35-be85-870b0b958e05", + "name" : "apollos", + "path" : "/apollos", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "9f66dc0f-cc44-4027-84d7-ce03dcdb5087", + "name" : "basic-haters", + "path" : "/basic-haters", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "0fef936b-b54a-4b2b-a86b-c35e08ef5048", + "name" : "bible-readers", + "path" : "/bible-readers", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "e7dfcc97-3025-4db7-96a3-758b05459277", + "name" : "chess-lovers", + "path" : "/chess-lovers", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "cd9d7c10-9f35-4178-85c4-422fa1c29fb6", + "name" : "machine-lovers", + "path" : "/machine-lovers", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "ccff9d71-70c3-4a96-b674-bc4fc80317fe", + "name" : "programmers", + "path" : "/programmers", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "77b31946-728d-43a4-83f9-78987dc36fc7", + "name" : "unix-lovers", + "path" : "/unix-lovers", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "1f85df7f-0531-439a-97a3-026e59dce5c6", + "name" : "users", + "path" : "/users", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + }, { + "id" : "8fb43876-9bf6-4db7-8552-61f6ae8c5f11", + "name" : "vlsi-lovers", + "path" : "/vlsi-lovers", + "subGroups" : [ ], + "attributes" : { }, + "realmRoles" : [ ], + "clientRoles" : { } + } ], + "defaultRole" : { + "id" : "82e13ea7-aac4-4d2c-9fc7-cff8333dbe19", + "name" : "default-roles-opencloud", + "description" : "${role_default-roles}", + "composite" : true, + "clientRole" : false, + "containerId" : "openCloud" + }, + "requiredCredentials" : [ "password" ], + "otpPolicyType" : "totp", + "otpPolicyAlgorithm" : "HmacSHA1", + "otpPolicyInitialCounter" : 0, + "otpPolicyDigits" : 6, + "otpPolicyLookAheadWindow" : 1, + "otpPolicyPeriod" : 30, + "otpPolicyCodeReusable" : false, + "otpSupportedApplications" : [ "totpAppFreeOTPName", "totpAppGoogleName", "totpAppMicrosoftAuthenticatorName" ], + "localizationTexts" : { }, + "webAuthnPolicyRpEntityName" : "keycloak", + "webAuthnPolicySignatureAlgorithms" : [ "ES256" ], + "webAuthnPolicyRpId" : "", + "webAuthnPolicyAttestationConveyancePreference" : "not specified", + "webAuthnPolicyAuthenticatorAttachment" : "not specified", + "webAuthnPolicyRequireResidentKey" : "not specified", + "webAuthnPolicyUserVerificationRequirement" : "not specified", + "webAuthnPolicyCreateTimeout" : 0, + "webAuthnPolicyAvoidSameAuthenticatorRegister" : false, + "webAuthnPolicyAcceptableAaguids" : [ ], + "webAuthnPolicyExtraOrigins" : [ ], + "webAuthnPolicyPasswordlessRpEntityName" : "keycloak", + "webAuthnPolicyPasswordlessSignatureAlgorithms" : [ "ES256" ], + "webAuthnPolicyPasswordlessRpId" : "", + "webAuthnPolicyPasswordlessAttestationConveyancePreference" : "not specified", + "webAuthnPolicyPasswordlessAuthenticatorAttachment" : "not specified", + "webAuthnPolicyPasswordlessRequireResidentKey" : "not specified", + "webAuthnPolicyPasswordlessUserVerificationRequirement" : "not specified", + "webAuthnPolicyPasswordlessCreateTimeout" : 0, + "webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister" : false, + "webAuthnPolicyPasswordlessAcceptableAaguids" : [ ], + "webAuthnPolicyPasswordlessExtraOrigins" : [ ], + "users" : [ { + "id" : "0ab77e6d-23b4-4ba3-9843-a3b3efdcfc53", + "username" : "admin", + "firstName" : "Admin", + "email" : "admin@example.org", + "emailVerified" : true, + "createdTimestamp" : 1743086161853, + "enabled" : true, + "totp" : false, + "credentials" : [ { + "id" : "e637b1d3-26a9-4df1-bf6a-33ef404194aa", + "type" : "password", + "userLabel" : "My password", + "createdDate" : 1743086173787, + "secretData" : "{\"value\":\"EZgBDLSPYAw7TDpjmzPZONXc49EdyGnE3kYF7HQwvMs=\",\"salt\":\"BOQfraUlcLUBtPbChIoanQ==\",\"additionalParameters\":{}}", + "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" + } ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "opencloudAdmin", "default-roles-opencloud" ], + "notBefore" : 0, + "groups" : [ "/users" ] + }, { + "id" : "9b06fea1-729b-45b9-a264-cdc4318b36ce", + "username" : "alan", + "firstName" : "Alan", + "lastName" : "Turing", + "email" : "alan@example.org", + "emailVerified" : true, + "createdTimestamp" : 1743086820550, + "enabled" : true, + "totp" : false, + "credentials" : [ { + "id" : "c0b7e92d-b328-4619-bb40-b862595c676b", + "type" : "password", + "userLabel" : "My password", + "createdDate" : 1743086831206, + "secretData" : "{\"value\":\"DZm1M4KmP9iH78U7r3tfRe5iAnHpew7dRu8Wn9o2WiI=\",\"salt\":\"LLKr5fYFCreH9I4qdgNNLg==\",\"additionalParameters\":{}}", + "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" + } ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "default-roles-opencloud", "opencloudUser" ], + "notBefore" : 0, + "groups" : [ "/chess-lovers", "/machine-lovers", "/programmers", "/users" ] + }, { + "id" : "a0b207c7-69e1-47da-8279-07596d8271fc", + "username" : "dennis", + "firstName" : "Dennis", + "lastName" : "Ritchie", + "email" : "dennis@example.org", + "emailVerified" : true, + "createdTimestamp" : 1743086900197, + "enabled" : true, + "totp" : false, + "credentials" : [ { + "id" : "f9adca7d-ad6a-4290-ae50-540774fcd93f", + "type" : "password", + "userLabel" : "My password", + "createdDate" : 1743086912368, + "secretData" : "{\"value\":\"f+LIZnxSY/sEo7DKGqWZFSeaEFTTIhAmBVTVvIPLTV4=\",\"salt\":\"58Lzve1a1V8NrY9K7GUHgA==\",\"additionalParameters\":{}}", + "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" + } ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "opencloudAdmin", "default-roles-opencloud" ], + "notBefore" : 0, + "groups" : [ "/basic-haters", "/programmers", "/unix-lovers", "/users" ] + }, { + "id" : "c5212e4a-1b85-4028-b5e4-03484c46bd1c", + "username" : "lynn", + "firstName" : "Lynn", + "lastName" : "Conway", + "email" : "lynn@example.org", + "emailVerified" : true, + "createdTimestamp" : 1743086963636, + "enabled" : true, + "totp" : false, + "credentials" : [ { + "id" : "e68b2724-8856-4892-a6d9-3c45b035ec1b", + "type" : "password", + "userLabel" : "My password", + "createdDate" : 1743086975605, + "secretData" : "{\"value\":\"xlnjYqq8JCpk+XMZ1W2EB+b8mizrxfFz24na73hL1Wc=\",\"salt\":\"ArB8wLvsFEiWI9OLIDJFNQ==\",\"additionalParameters\":{}}", + "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" + } ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "default-roles-opencloud", "opencloudUser" ], + "notBefore" : 0, + "groups" : [ "/programmers", "/users", "/vlsi-lovers" ] + }, { + "id" : "932f373d-0935-4cae-85a4-a46f7091cc26", + "username" : "margaret", + "firstName" : "Margaret", + "lastName" : "Hamilton", + "email" : "margaret@example.org", + "emailVerified" : true, + "createdTimestamp" : 1743087042652, + "enabled" : true, + "totp" : false, + "credentials" : [ { + "id" : "0512312a-06f6-44dd-b02d-2a5698de4e20", + "type" : "password", + "userLabel" : "My password", + "createdDate" : 1743087054145, + "secretData" : "{\"value\":\"/C6K2MGtckKOSenXZqj6BM3OAAeowEL6vR3Ya11ByTg=\",\"salt\":\"qpdRtjJyN/kM+1VSQ0dAJw==\",\"additionalParameters\":{}}", + "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" + } ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "opencloudSpaceAdmin", "default-roles-opencloud" ], + "notBefore" : 0, + "groups" : [ "/apollos", "/programmers", "/users" ] + }, { + "id" : "13c3b0db-b6a5-49b5-8f9e-d23729517d9d", + "username" : "mary", + "firstName" : "Mary", + "lastName" : "Kenneth Keller", + "email" : "mary@example.org", + "emailVerified" : true, + "createdTimestamp" : 1743087096263, + "enabled" : true, + "totp" : false, + "credentials" : [ { + "id" : "d7b7ee6d-7122-4cf9-94de-e66caa5faa80", + "type" : "password", + "userLabel" : "My password", + "createdDate" : 1743087105788, + "secretData" : "{\"value\":\"oqauYuZpnCxtBFSVEhmY+vtONnvSC9VOAMBUK5gC8+8=\",\"salt\":\"HPRafx27pEj0GpedUMt09A==\",\"additionalParameters\":{}}", + "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" + } ], + "disableableCredentialTypes" : [ ], + "requiredActions" : [ ], + "realmRoles" : [ "default-roles-opencloud", "opencloudUser" ], + "notBefore" : 0, + "groups" : [ "/bible-readers", "/users" ] + } ], + "scopeMappings" : [ { + "clientScope" : "offline_access", + "roles" : [ "offline_access" ] + }, { + "clientScope" : "roles", + "roles" : [ "opencloudGuest", "opencloudAdmin", "opencloudSpaceAdmin", "opencloudUser" ] + } ], + "clientScopeMappings" : { + "account" : [ { + "client" : "account-console", + "roles" : [ "manage-account", "view-groups" ] + } ] + }, + "clients" : [ { + "id" : "294b6cf4-b646-4f6c-bab2-616546ec3167", + "clientId" : "_system", + "name" : "_system", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "secret" : "**********", + "redirectUris" : [ ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : false, + "serviceAccountsEnabled" : false, + "publicClient" : false, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "client.secret.creation.time" : "1718778122", + "post.logout.redirect.uris" : "+" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "defaultClientScopes" : [ "web-origins", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "offline_access", "microprofile-jwt" ] + }, { + "id" : "9850adad-7910-4b67-a790-da6444361618", + "clientId" : "account", + "name" : "${client_account}", + "rootUrl" : "${authBaseUrl}", + "baseUrl" : "/realms/openCloud/account/", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "secret" : "**********", + "redirectUris" : [ "/realms/openCloud/account/*" ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : false, + "serviceAccountsEnabled" : false, + "publicClient" : false, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "client.secret.creation.time" : "1718778122", + "post.logout.redirect.uris" : "+" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "defaultClientScopes" : [ "basic" ], + "optionalClientScopes" : [ ] + }, { + "id" : "55bb4cdc-045b-422a-8830-61245949d6aa", + "clientId" : "account-console", + "name" : "${client_account-console}", + "rootUrl" : "${authBaseUrl}", + "baseUrl" : "/realms/openCloud/account/", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "redirectUris" : [ "/realms/openCloud/account/*" ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : false, + "serviceAccountsEnabled" : false, + "publicClient" : true, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "post.logout.redirect.uris" : "+", + "pkce.code.challenge.method" : "S256" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "protocolMappers" : [ { + "id" : "9bf413ed-402f-438d-a72c-033f3c45dab2", + "name" : "audience resolve", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-audience-resolve-mapper", + "consentRequired" : false, + "config" : { } + } ], + "defaultClientScopes" : [ "web-origins", "acr", "profile", "roles", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "offline_access", "microprofile-jwt" ] + }, { + "id" : "2969b8ff-2ab3-4907-aaa7-091a7a627ccb", + "clientId" : "admin-cli", + "name" : "${client_admin-cli}", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "redirectUris" : [ ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : false, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : true, + "serviceAccountsEnabled" : false, + "publicClient" : true, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "post.logout.redirect.uris" : "+" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "defaultClientScopes" : [ "basic" ], + "optionalClientScopes" : [ ] + }, { + "id" : "002faf0a-716c-4230-81c7-ce22d1eb832c", + "clientId" : "broker", + "name" : "${client_broker}", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "secret" : "**********", + "redirectUris" : [ ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : false, + "serviceAccountsEnabled" : false, + "publicClient" : false, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "client.secret.creation.time" : "1718778122", + "post.logout.redirect.uris" : "+" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "defaultClientScopes" : [ "basic" ], + "optionalClientScopes" : [ ] + }, { + "id" : "c8367556-1d13-4979-b4f6-5e2cff1f82ae", + "clientId" : "OpenCloudAndroid", + "name" : "OpenCloud Android App", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "secret" : "**********", + "redirectUris" : [ "oc://android.opencloud.eu" ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : true, + "serviceAccountsEnabled" : false, + "publicClient" : true, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "saml.assertion.signature" : "false", + "saml.force.post.binding" : "false", + "saml.multivalued.roles" : "false", + "saml.encrypt" : "false", + "post.logout.redirect.uris" : "oc://android.opencloud.eu", + "backchannel.logout.revoke.offline.tokens" : "false", + "saml.server.signature" : "false", + "saml.server.signature.keyinfo.ext" : "false", + "exclude.session.state.from.auth.response" : "false", + "backchannel.logout.session.required" : "true", + "client_credentials.use_refresh_token" : "false", + "saml_force_name_id_format" : "false", + "saml.client.signature" : "false", + "tls.client.certificate.bound.access.tokens" : "false", + "saml.authnstatement" : "false", + "display.on.consent.screen" : "false", + "saml.onetimeuse.condition" : "false" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : true, + "nodeReRegistrationTimeout" : -1, + "defaultClientScopes" : [ "web-origins", "profile", "roles", "groups", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "offline_access", "microprofile-jwt" ] + }, { + "id" : "6ae0e3da-38ff-47a4-a76e-b59eec0a2de9", + "clientId" : "OpenCloudIOS", + "name" : "OpenCloud iOS App", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "secret" : "**********", + "redirectUris" : [ "oc://ios.opencloud.eu" ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : true, + "serviceAccountsEnabled" : false, + "publicClient" : true, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "saml.assertion.signature" : "false", + "saml.force.post.binding" : "false", + "saml.multivalued.roles" : "false", + "saml.encrypt" : "false", + "post.logout.redirect.uris" : "oc://ios.opencloud.eu", + "backchannel.logout.revoke.offline.tokens" : "false", + "saml.server.signature" : "false", + "saml.server.signature.keyinfo.ext" : "false", + "exclude.session.state.from.auth.response" : "false", + "backchannel.logout.session.required" : "true", + "client_credentials.use_refresh_token" : "false", + "saml_force_name_id_format" : "false", + "saml.client.signature" : "false", + "tls.client.certificate.bound.access.tokens" : "false", + "saml.authnstatement" : "false", + "display.on.consent.screen" : "false", + "saml.onetimeuse.condition" : "false" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : true, + "nodeReRegistrationTimeout" : -1, + "defaultClientScopes" : [ "web-origins", "profile", "roles", "groups", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "offline_access", "microprofile-jwt" ] + }, { + "id" : "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "clientId" : "realm-management", + "name" : "${client_realm-management}", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "redirectUris" : [ ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : true, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : false, + "serviceAccountsEnabled" : false, + "publicClient" : false, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "post.logout.redirect.uris" : "+" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "defaultClientScopes" : [ ], + "optionalClientScopes" : [ ] + }, { + "id" : "97264f49-a8c1-4585-99b6-e706339c62f8", + "clientId" : "security-admin-console", + "name" : "${client_security-admin-console}", + "rootUrl" : "${authAdminUrl}", + "baseUrl" : "/admin/openCloud/console/", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "redirectUris" : [ "/admin/openCloud/console/*" ], + "webOrigins" : [ "+" ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : false, + "serviceAccountsEnabled" : false, + "publicClient" : true, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "post.logout.redirect.uris" : "+", + "pkce.code.challenge.method" : "S256" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : false, + "nodeReRegistrationTimeout" : 0, + "protocolMappers" : [ { + "id" : "96092024-21dd-4d31-a004-2c5b96031da3", + "name" : "locale", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "locale", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "locale", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + } ], + "defaultClientScopes" : [ "basic" ], + "optionalClientScopes" : [ ] + }, { + "id" : "54b18eca-cf79-4263-9db9-2d79f8a1c831", + "clientId" : "web", + "name" : "OpenCloud Web App", + "description" : "", + "rootUrl" : "https://cloud.opencloud.test", + "adminUrl" : "https://cloud.opencloud.test", + "baseUrl" : "", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "redirectUris" : [ "https://cloud.opencloud.test/", "https://cloud.opencloud.test/oidc-callback.html", "https://cloud.opencloud.test/oidc-silent-redirect.html" ], + "webOrigins" : [ "https://cloud.opencloud.test" ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : true, + "serviceAccountsEnabled" : false, + "publicClient" : true, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "saml.assertion.signature" : "false", + "saml.force.post.binding" : "false", + "saml.multivalued.roles" : "false", + "saml.encrypt" : "false", + "post.logout.redirect.uris" : "+", + "oauth2.device.authorization.grant.enabled" : "false", + "backchannel.logout.revoke.offline.tokens" : "false", + "saml.server.signature" : "false", + "saml.server.signature.keyinfo.ext" : "false", + "exclude.session.state.from.auth.response" : "false", + "oidc.ciba.grant.enabled" : "false", + "backchannel.logout.session.required" : "true", + "backchannel.logout.url" : "https://cloud.opencloud.test/backchannel_logout", + "client_credentials.use_refresh_token" : "false", + "saml_force_name_id_format" : "false", + "saml.client.signature" : "false", + "tls.client.certificate.bound.access.tokens" : "false", + "saml.authnstatement" : "false", + "display.on.consent.screen" : "false", + "saml.onetimeuse.condition" : "false" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : true, + "nodeReRegistrationTimeout" : -1, + "defaultClientScopes" : [ "web-origins", "profile", "roles", "groups", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "offline_access", "microprofile-jwt" ] + }, { + "id" : "fc7d8a8e-cb92-4cb0-b404-d723c07d8d4f", + "clientId" : "OpenCloudDesktop", + "name" : "OpenCloud Desktop Client", + "surrogateAuthRequired" : false, + "enabled" : true, + "alwaysDisplayInConsole" : false, + "clientAuthenticatorType" : "client-secret", + "secret" : "**********", + "redirectUris" : [ "http://127.0.0.1", "http://localhost" ], + "webOrigins" : [ ], + "notBefore" : 0, + "bearerOnly" : false, + "consentRequired" : false, + "standardFlowEnabled" : true, + "implicitFlowEnabled" : false, + "directAccessGrantsEnabled" : true, + "serviceAccountsEnabled" : false, + "publicClient" : true, + "frontchannelLogout" : false, + "protocol" : "openid-connect", + "attributes" : { + "saml.assertion.signature" : "false", + "saml.force.post.binding" : "false", + "saml.multivalued.roles" : "false", + "saml.encrypt" : "false", + "post.logout.redirect.uris" : "+", + "backchannel.logout.revoke.offline.tokens" : "false", + "saml.server.signature" : "false", + "saml.server.signature.keyinfo.ext" : "false", + "exclude.session.state.from.auth.response" : "false", + "backchannel.logout.session.required" : "true", + "client_credentials.use_refresh_token" : "false", + "saml_force_name_id_format" : "false", + "saml.client.signature" : "false", + "tls.client.certificate.bound.access.tokens" : "false", + "saml.authnstatement" : "false", + "display.on.consent.screen" : "false", + "saml.onetimeuse.condition" : "false" + }, + "authenticationFlowBindingOverrides" : { }, + "fullScopeAllowed" : true, + "nodeReRegistrationTimeout" : -1, + "defaultClientScopes" : [ "web-origins", "profile", "roles", "groups", "basic", "email" ], + "optionalClientScopes" : [ "address", "phone", "offline_access", "microprofile-jwt" ] + } ], + "clientScopes" : [ { + "id" : "258e56a8-1eeb-49ea-957b-aff8df4656ba", + "name" : "email", + "description" : "OpenID Connect built-in scope: email", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${emailScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "068bcfb6-4a17-4c20-b083-ae542a7f76c8", + "name" : "email verified", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-property-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "emailVerified", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "email_verified", + "jsonType.label" : "boolean", + "userinfo.token.claim" : "true" + } + }, { + "id" : "c00d6c21-2fd1-435f-9ee9-87e011048cbe", + "name" : "email", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-property-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "email", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "email", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + } ] + }, { + "id" : "b3e1e47e-3912-4b55-ba89-b0198e767682", + "name" : "address", + "description" : "OpenID Connect built-in scope: address", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${addressScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "876baab9-39d1-4845-abb4-561a58aa152d", + "name" : "address", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-address-mapper", + "consentRequired" : false, + "config" : { + "user.attribute.formatted" : "formatted", + "user.attribute.country" : "country", + "user.attribute.postal_code" : "postal_code", + "userinfo.token.claim" : "true", + "user.attribute.street" : "street", + "id.token.claim" : "true", + "user.attribute.region" : "region", + "access.token.claim" : "true", + "user.attribute.locality" : "locality" + } + } ] + }, { + "id" : "9cae7ced-e7d9-4f7b-8e54-7402125f6ead", + "name" : "offline_access", + "description" : "OpenID Connect built-in scope: offline_access", + "protocol" : "openid-connect", + "attributes" : { + "consent.screen.text" : "${offlineAccessScopeConsentText}", + "display.on.consent.screen" : "true" + } + }, { + "id" : "8eb1f69b-b941-4185-bca1-f916953f7cf5", + "name" : "role_list", + "description" : "SAML role list", + "protocol" : "saml", + "attributes" : { + "consent.screen.text" : "${samlRoleListScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "fb587847-806f-4443-bab0-501efc0f0b46", + "name" : "role list", + "protocol" : "saml", + "protocolMapper" : "saml-role-list-mapper", + "consentRequired" : false, + "config" : { + "single" : "false", + "attribute.nameformat" : "Basic", + "attribute.name" : "Role" + } + } ] + }, { + "id" : "947da1ff-f614-48fc-9ecb-c98cbcfd3390", + "name" : "profile", + "description" : "OpenID Connect built-in scope: profile", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${profileScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "46fec552-2f92-408a-84cf-ba98bf8e35fd", + "name" : "family name", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-property-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "lastName", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "family_name", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "c7ed5458-4d32-423e-8ea1-d112c45045d4", + "name" : "middle name", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "middleName", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "middle_name", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "e18d1ce4-3969-4ec1-9941-a27fd7555245", + "name" : "picture", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "picture", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "picture", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "dab85a5e-9af8-4fcd-88e4-9d3ae50dd5b6", + "name" : "locale", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "locale", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "locale", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "7484f47e-3bb1-48d0-ba64-e8330dcefe6e", + "name" : "profile", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "profile", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "profile", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "fcd00995-9693-4803-8f41-c84044be83ed", + "name" : "website", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "website", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "website", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "f09e7268-5284-449b-849b-cf8225523584", + "name" : "full name", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-full-name-mapper", + "consentRequired" : false, + "config" : { + "id.token.claim" : "true", + "access.token.claim" : "true", + "userinfo.token.claim" : "true" + } + }, { + "id" : "0317f4b3-3f7b-47ab-88d3-5d6f604d944d", + "name" : "nickname", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "nickname", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "nickname", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "db81244c-e739-461b-8822-52ceaa11bdf4", + "name" : "updated at", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "updatedAt", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "updated_at", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "c6a16bf9-9370-4dff-a718-be53131bb238", + "name" : "gender", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "gender", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "gender", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "32d76647-b542-484c-9062-edc34eb350e0", + "name" : "birthdate", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "birthdate", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "birthdate", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "ac6530db-6463-446b-99da-32d5298b5fa0", + "name" : "zoneinfo", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "zoneinfo", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "zoneinfo", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "ed10983b-8700-415e-933e-226ce3f397a6", + "name" : "given name", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-property-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "firstName", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "given_name", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "8205ccd0-1266-4060-b5df-3a6eb229d91e", + "name" : "username", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-property-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "username", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "preferred_username", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + } ] + }, { + "id" : "79713daf-89ca-4ed4-ad97-a88b13ee9a18", + "name" : "phone", + "description" : "OpenID Connect built-in scope: phone", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "consent.screen.text" : "${phoneScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "b5f4f5ed-1008-42ba-8b3b-7d8851a2a680", + "name" : "phone number", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "phoneNumber", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "phone_number", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + }, { + "id" : "08a246f1-2b4c-4def-af5c-aefc31b4820d", + "name" : "phone number verified", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-attribute-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "phoneNumberVerified", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "phone_number_verified", + "jsonType.label" : "boolean", + "userinfo.token.claim" : "true" + } + } ] + }, { + "id" : "c3a6224b-49aa-4a25-953d-7e326d66893d", + "name" : "basic", + "description" : "OpenID Connect scope for add all basic claims to the token", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "false", + "display.on.consent.screen" : "false" + }, + "protocolMappers" : [ { + "id" : "2d4f3f17-1ab7-429e-88e1-cdf08d3533c6", + "name" : "auth_time", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usersessionmodel-note-mapper", + "consentRequired" : false, + "config" : { + "user.session.note" : "AUTH_TIME", + "introspection.token.claim" : "true", + "userinfo.token.claim" : "true", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "auth_time", + "jsonType.label" : "long" + } + }, { + "id" : "3e7da934-3de3-4bd1-a565-8ac62419c138", + "name" : "sub", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-sub-mapper", + "consentRequired" : false, + "config" : { + "introspection.token.claim" : "true", + "access.token.claim" : "true" + } + } ] + }, { + "id" : "0c72b80b-28d5-48d8-b593-c99030aab58d", + "name" : "roles", + "description" : "OpenID Connect scope for add user roles to the access token", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "false", + "consent.screen.text" : "${rolesScopeConsentText}", + "display.on.consent.screen" : "true" + }, + "protocolMappers" : [ { + "id" : "bc7f015e-329f-4e99-be6b-72382f4310c7", + "name" : "client roles", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-client-role-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "foo", + "access.token.claim" : "true", + "claim.name" : "resource_access.${client_id}.roles", + "jsonType.label" : "String", + "multivalued" : "true" + } + }, { + "id" : "215f645f-ad0b-4523-9ece-f09f69ead5c4", + "name" : "audience resolve", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-audience-resolve-mapper", + "consentRequired" : false, + "config" : { } + }, { + "id" : "4a10b958-d34d-413a-b349-1415d02cdcde", + "name" : "realm roles", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-realm-role-mapper", + "consentRequired" : false, + "config" : { + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "roles", + "jsonType.label" : "String", + "userinfo.token.claim" : "true", + "multivalued" : "true" + } + } ] + }, { + "id" : "7438d93e-b07a-4913-9419-3273be364c4b", + "name" : "groups", + "description" : "OpenID Connect scope for add user groups to the access token", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "false", + "display.on.consent.screen" : "true", + "gui.order" : "", + "consent.screen.text" : "" + }, + "protocolMappers" : [ { + "id" : "5349faf2-64a6-481f-b207-39ffef2cd597", + "name" : "groups", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-group-membership-mapper", + "consentRequired" : false, + "config" : { + "full.path" : "false", + "introspection.token.claim" : "true", + "userinfo.token.claim" : "true", + "multivalued" : "true", + "id.token.claim" : "true", + "lightweight.claim" : "false", + "access.token.claim" : "true", + "claim.name" : "groups" + } + } ] + }, { + "id" : "5ce87358-3bca-4874-a6f0-6dccae6209a8", + "name" : "web-origins", + "description" : "OpenID Connect scope for add allowed web origins to the access token", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "false", + "consent.screen.text" : "", + "display.on.consent.screen" : "false" + }, + "protocolMappers" : [ { + "id" : "bbd23c51-918d-4ea6-9ac0-db68b512fb0a", + "name" : "allowed web origins", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-allowed-origins-mapper", + "consentRequired" : false, + "config" : { } + } ] + }, { + "id" : "86883395-e439-4cab-9d8d-31d71389969c", + "name" : "acr", + "description" : "OpenID Connect scope for add acr (authentication context class reference) to the token", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "false", + "display.on.consent.screen" : "false" + }, + "protocolMappers" : [ { + "id" : "b849b14b-7c9c-4b7b-9329-c56debefb47c", + "name" : "acr loa level", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-acr-mapper", + "consentRequired" : false, + "config" : { + "id.token.claim" : "true", + "access.token.claim" : "true", + "userinfo.token.claim" : "true" + } + } ] + }, { + "id" : "bdb3e320-76c8-4ad7-9d0f-a08efc060101", + "name" : "microprofile-jwt", + "description" : "Microprofile - JWT built-in scope", + "protocol" : "openid-connect", + "attributes" : { + "include.in.token.scope" : "true", + "display.on.consent.screen" : "false" + }, + "protocolMappers" : [ { + "id" : "1d08316c-493b-42ab-afa3-66f621860661", + "name" : "groups", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-realm-role-mapper", + "consentRequired" : false, + "config" : { + "multivalued" : "true", + "userinfo.token.claim" : "true", + "user.attribute" : "foo", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "groups", + "jsonType.label" : "String" + } + }, { + "id" : "52061d2d-7a41-4f1d-ba1b-3c4a53e739e4", + "name" : "upn", + "protocol" : "openid-connect", + "protocolMapper" : "oidc-usermodel-property-mapper", + "consentRequired" : false, + "config" : { + "user.attribute" : "username", + "id.token.claim" : "true", + "access.token.claim" : "true", + "claim.name" : "upn", + "jsonType.label" : "String", + "userinfo.token.claim" : "true" + } + } ] + } ], + "defaultDefaultClientScopes" : [ "role_list", "profile", "email", "roles", "web-origins", "acr", "basic", "groups" ], + "defaultOptionalClientScopes" : [ "offline_access", "address", "phone", "microprofile-jwt" ], + "browserSecurityHeaders" : { + "contentSecurityPolicyReportOnly" : "", + "xContentTypeOptions" : "nosniff", + "referrerPolicy" : "no-referrer", + "xRobotsTag" : "none", + "xFrameOptions" : "SAMEORIGIN", + "contentSecurityPolicy" : "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", + "xXSSProtection" : "1; mode=block", + "strictTransportSecurity" : "max-age=31536000; includeSubDomains" + }, + "smtpServer" : { }, + "loginTheme": "opencloud", + "accountTheme": "", + "adminTheme": "", + "emailTheme": "", + "eventsEnabled" : false, + "eventsListeners" : [ "jboss-logging" ], + "enabledEventTypes" : [ ], + "adminEventsEnabled" : false, + "adminEventsDetailsEnabled" : false, + "identityProviders" : [ ], + "identityProviderMappers" : [ ], + "components" : { + "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy" : [ { + "id" : "4682fe74-f3a9-445a-a7ab-557fb532fe6b", + "name" : "Consent Required", + "providerId" : "consent-required", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { } + }, { + "id" : "c46009e5-c8b5-4051-bf7f-7b1481a9aa86", + "name" : "Max Clients Limit", + "providerId" : "max-clients", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { + "max-clients" : [ "200" ] + } + }, { + "id" : "43edf979-28d2-46c8-9f93-48b3de185570", + "name" : "Allowed Protocol Mapper Types", + "providerId" : "allowed-protocol-mappers", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { + "allowed-protocol-mapper-types" : [ "saml-user-attribute-mapper", "oidc-address-mapper", "oidc-full-name-mapper", "oidc-usermodel-property-mapper", "oidc-sha256-pairwise-sub-mapper", "saml-role-list-mapper", "saml-user-property-mapper", "oidc-usermodel-attribute-mapper" ] + } + }, { + "id" : "6fc7d765-7da8-4985-ba0b-e83827b04bd3", + "name" : "Allowed Client Scopes", + "providerId" : "allowed-client-templates", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { + "allow-default-scopes" : [ "true" ] + } + }, { + "id" : "5a9aef85-98a6-4e90-b30f-8aa715e1f5e6", + "name" : "Allowed Protocol Mapper Types", + "providerId" : "allowed-protocol-mappers", + "subType" : "authenticated", + "subComponents" : { }, + "config" : { + "allowed-protocol-mapper-types" : [ "oidc-sha256-pairwise-sub-mapper", "oidc-usermodel-property-mapper", "oidc-address-mapper", "oidc-usermodel-attribute-mapper", "oidc-full-name-mapper", "saml-role-list-mapper", "saml-user-attribute-mapper", "saml-user-property-mapper" ] + } + }, { + "id" : "e3eadb04-8862-4567-869c-a76485268159", + "name" : "Allowed Client Scopes", + "providerId" : "allowed-client-templates", + "subType" : "authenticated", + "subComponents" : { }, + "config" : { + "allow-default-scopes" : [ "true" ] + } + }, { + "id" : "c788e6bf-2f57-4a82-b32e-ac8d48a4f676", + "name" : "Full Scope Disabled", + "providerId" : "scope", + "subType" : "anonymous", + "subComponents" : { }, + "config" : { } + }, + { + "id": "c016f2b3-cf74-410e-a852-f6c7b49e0f5a", + "name": "Block Client Registration", + "providerId": "trusted-hosts", + "subType": "anonymous", + "subComponents": {}, + "config": { + "host-sending-registration-request-must-match": [ + "true" + ], + "client-uris-must-match": [ + "true" + ] + } + } + ], + "org.keycloak.userprofile.UserProfileProvider" : [ { + "id" : "28d6b4ce-33d4-40c0-adef-b27e35b7e122", + "providerId" : "declarative-user-profile", + "subComponents" : { }, + "config" : { + "kc.user.profile.config" : [ "{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}],\"unmanagedAttributePolicy\":\"ENABLED\"}" ] + } + } ], + "org.keycloak.keys.KeyProvider" : [ { + "id" : "0e3d0048-cb16-49c3-8a9a-05d83f0daeca", + "name" : "rsa-generated", + "providerId" : "rsa-generated", + "subComponents" : { }, + "config" : { + "privateKey" : [ "MIIEpAIBAAKCAQEAwxeLRFBDpJcw/7Fob14CGSDlADK9kuT7kua/3IDmu7Vjd6a49evFJtCORBvLHz4/XNyycyNpAUWAIDKJ3Pkx/qcdYl2Ec0n5Yy2XYfnZybYhFsB7G5ZXG/ySj1E6aXWoC15WWgk+bjvd8LcWB2fKPKzqqd2TiHnRZds4D0rbpC8F7bsMhApTHGO68hggrYA/RPg/znd1bGwN2xb6XU0LK/BKZQB9etIW5tWmI28H24nFOnk1YpbijTavkdNwIEYWeyD5EJBHOO6CPO49SyLernPrlTnXS28Tn8IQNsU9v6n7vZS2hvJD7MoZqW7C6UGZvLecpMwsCJSNeeQ8gQWSyQIDAQABAoIBAA1OPwWY+tAQLruVqDOGRBreIzg0/bh1zRGrErVRhksRlzfbI1zEaIUZ7sYG5j7agjxNYg9XwCrhyFgJ0lzDky0UzTx+99BcIHnq61r3jSrEdPPGC29pfMXwHzfOmK8GIwCpfba00DD4/M1U01gMdF7YhUWyEsSZWFZ70dI7Lwk+vEsDeZ3ua9D9twXmnWvIObG1Yihni6JYEv+c4uaLQzf+zwuG1ZCBOk95GzuBWO6p9K8H21xgfbo0bny5P5o5yI0O3lRVSu3fQsKDT3C5PHKPxb9wmX4DWKq1t46DuSgjjPtkQgx1rCojn9TSGBTJtx5qdqB35YnnTiSOWZkuUkECgYEA4JHglqoLD+RJFIPFtH2jVMkvrr9gpsglbT4mA5d+6lVucaj/FJRBT5amLHbO+NX93msvA+RZTy/c5b4MRr5LVCgt6Bs6VTpCNzTFWs0K8TGD32V/bYMeNUTkrORNopX0VwS/oMPKTmq/sie7pRVb4JVIR/ChGKP3pTU+nOoF4GkCgYEA3mWAww/nbCV5Vl6mT3hSA4fDehcGMg+qtU6N4RzhfHJyuVfpdsx9Oui5lFuI/sUBVgz8XUQAX1zw0q53AKJC/ocoxFfMABp390DMsNWKZOMWX+/2YgPyf+Dgx89sPeLOkKLwox28hTgOCvva13HifhyIqGYwQjYojX85aOuN02ECgYEA3fVw/Jku+9MPpDYlx6JSN+/tsBM5rT6vN00w92XaLDSqR67YB3gNIWPt9I6tPOcM17QqsPcWipztASoZKibVf2WDEiEvQ6OkZLpEwd1djkz5YWkJTK1GwzHHr1aroSIDcaqg2H4Ly/vYYnbBEYaN2+jQm0Irh5Ywo9p/e0oW6tkCgYEAziUwMZ9wWGJ0EocxicBx5SvXGjh1WboD9oOWJ/BpYr2DciH3GlN6UTyfqNEgL2fVUTpAQwNhhQPVhrSJQmEl0GDgfP8U7ZObV+kM021dFx8YAl2f+ELIaZi9QvkV0FeIObGPdON/d8z511yVAddipps0YUQ3v2gMNvyS7ppJoIECgYBP6ljL98KwNYSBfwah7ACxzdggEJuOjFp7e6tPZEop+X0HEt0pxlerexK+v9wUYbl6dWRURefbr/t/GNpFIOmGWbkpmK7jAiYNacsvVpupewyIKNOXHnTHNialtRAxk7TY8JOEmIRl4vk6ZwqENGFo4tU/yYn9oP9Nz2/1jgVIUA==" ], + "certificate" : [ "MIICoTCCAYkCBgGV1yVaSDANBgkqhkiG9w0BAQsFADAUMRIwEAYDVQQDDAlvcGVuQ2xvdWQwHhcNMjUwMzI3MTAyNjQ0WhcNMzUwMzI3MTAyODI0WjAUMRIwEAYDVQQDDAlvcGVuQ2xvdWQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDF4tEUEOklzD/sWhvXgIZIOUAMr2S5PuS5r/cgOa7tWN3prj168Um0I5EG8sfPj9c3LJzI2kBRYAgMonc+TH+px1iXYRzSfljLZdh+dnJtiEWwHsbllcb/JKPUTppdagLXlZaCT5uO93wtxYHZ8o8rOqp3ZOIedFl2zgPStukLwXtuwyEClMcY7ryGCCtgD9E+D/Od3VsbA3bFvpdTQsr8EplAH160hbm1aYjbwfbicU6eTViluKNNq+R03AgRhZ7IPkQkEc47oI87j1LIt6uc+uVOddLbxOfwhA2xT2/qfu9lLaG8kPsyhmpbsLpQZm8t5ykzCwIlI155DyBBZLJAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAGPTwCeraemz1GDGzVueX6Y5TbMK0d/n2fngPzNSm1rvgvu0ytK5nNd12j5E+YPl3hhe28bi0LhibXsTCvmDNPyLW1oxEVOCSnTiUs099KKSAkvLK1FTZ4HfDNbywNusxo493mXEYb4A+WhO9Gec/x5xnaC279f5WjBMBw7s+AbGngIKpWtTLtYHSD2V657oOca5dJGbHmxq/QanLX0v3o+NCVKhKtWCMofu3HYSwq7865Yun4b6RnX3FpGNYSNmZjmiQpBzXaCdbxoPYr1KiSCYF/tvoo2ADU8dfbPmhCsfQbM0sVAZT+b8wjgXq0HCdJSKQIdVZmJHqRV+ljrwQPY=" ], + "priority" : [ "100" ] + } + }, { + "id" : "f92ecf31-c3c7-4c3b-af20-839fc05bcf99", + "name" : "hmac-generated", + "providerId" : "hmac-generated", + "subComponents" : { }, + "config" : { + "kid" : [ "a57cc5a8-181d-4942-9093-b0568b672dba" ], + "secret" : [ "pNpCYTnhYgUc-t_PpJIBhq4-9RcQmB9vnsT58Q7mbEkT1RhzwXwZf1POPvNPX8Z7uAlyqyiEUCc5s32CU5geK5qZa4t38GnSLFapvIXRutfViWk79wDkY-XkZh9xm7ORR_oSa2TCAJRhbk6J67TvHoTt2l30BpnwyfvlcLvUQN8" ], + "priority" : [ "100" ], + "algorithm" : [ "HS256" ] + } + }, { + "id" : "a137a686-5876-4faf-8d1e-e3a59f55095e", + "name" : "hmac-generated-hs512", + "providerId" : "hmac-generated", + "subComponents" : { }, + "config" : { + "kid" : [ "551622db-d7f1-47cf-9b83-6dc3a82301f9" ], + "secret" : [ "xdV-rQ9wlN6Ch7OVQaOCRYg79WX5jt_WsEa3Q1m6yHVwQhLYAE97fEuL1QJPt2crUjt19198m91M-Eio4YYoruQsg4NuKVQ2N7qLKZJLKFP8gWbINqUVO0YWGQskRlxfcWODnZLgONJZ-mkJHh8cHihwoqnL7Lu_oZJ9czLe2k4" ], + "priority" : [ "100" ], + "algorithm" : [ "HS512" ] + } + }, { + "id" : "992dcc80-dc41-4b00-bab8-6ec1c839f3a4", + "name" : "aes-generated", + "providerId" : "aes-generated", + "subComponents" : { }, + "config" : { + "kid" : [ "2181e50d-35ca-4caf-9ed3-c3c7f12f0069" ], + "secret" : [ "SVLTDd1ufHzK1ByoiCGEDA" ], + "priority" : [ "100" ] + } + } ] + }, + "internationalizationEnabled" : false, + "supportedLocales" : [ ], + "authenticationFlows" : [ { + "id" : "8964f931-b866-4a05-ab1c-89331a566887", + "alias" : "Account verification options", + "description" : "Method with which to verity the existing account", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "idp-email-verification", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "ALTERNATIVE", + "priority" : 20, + "autheticatorFlow" : true, + "flowAlias" : "Verify Existing Account by Re-authentication", + "userSetupAllowed" : false + } ] + }, { + "id" : "123e5711-1ee5-4f7e-ac9c-64c644daaea9", + "alias" : "Browser - Conditional OTP", + "description" : "Flow to determine if the OTP is required for the authentication", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "conditional-user-configured", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "auth-otp-form", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "be73b7f5-9a66-487c-b7dd-80e0f7ac0c7c", + "alias" : "Direct Grant - Conditional OTP", + "description" : "Flow to determine if the OTP is required for the authentication", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "conditional-user-configured", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "direct-grant-validate-otp", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "597ca917-91fc-4898-a279-cd592af286e3", + "alias" : "First broker login - Conditional OTP", + "description" : "Flow to determine if the OTP is required for the authentication", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "conditional-user-configured", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "auth-otp-form", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "3daadb6b-4d63-4be1-a89e-ec8e41e72afa", + "alias" : "Handle Existing Account", + "description" : "Handle what to do if there is existing account with same email/username like authenticated identity provider", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "idp-confirm-link", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : true, + "flowAlias" : "Account verification options", + "userSetupAllowed" : false + } ] + }, { + "id" : "5942598c-d7e9-4941-b13e-4a8a75e2c2a3", + "alias" : "Reset - Conditional OTP", + "description" : "Flow to determine if the OTP should be reset or not. Set to REQUIRED to force.", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "conditional-user-configured", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "reset-otp", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "6e4b336e-eb5f-423c-8d32-4ab94d1122e6", + "alias" : "User creation or linking", + "description" : "Flow for the existing/non-existing user alternatives", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticatorConfig" : "create unique user config", + "authenticator" : "idp-create-user-if-unique", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "ALTERNATIVE", + "priority" : 20, + "autheticatorFlow" : true, + "flowAlias" : "Handle Existing Account", + "userSetupAllowed" : false + } ] + }, { + "id" : "35ac1997-b6af-44ff-ab27-c34f9be32e56", + "alias" : "Verify Existing Account by Re-authentication", + "description" : "Reauthentication of existing account", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "idp-username-password-form", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "CONDITIONAL", + "priority" : 20, + "autheticatorFlow" : true, + "flowAlias" : "First broker login - Conditional OTP", + "userSetupAllowed" : false + } ] + }, { + "id" : "a3473070-fe69-4de1-a0b2-dd54b8a769d5", + "alias" : "browser", + "description" : "browser based authentication", + "providerId" : "basic-flow", + "topLevel" : true, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "auth-cookie", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "auth-spnego", + "authenticatorFlow" : false, + "requirement" : "DISABLED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "identity-provider-redirector", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 25, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "ALTERNATIVE", + "priority" : 30, + "autheticatorFlow" : true, + "flowAlias" : "forms", + "userSetupAllowed" : false + } ] + }, { + "id" : "cc714857-b114-4df6-9030-b464bbb3964d", + "alias" : "clients", + "description" : "Base authentication for clients", + "providerId" : "client-flow", + "topLevel" : true, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "client-secret", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "client-jwt", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "client-secret-jwt", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 30, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "client-x509", + "authenticatorFlow" : false, + "requirement" : "ALTERNATIVE", + "priority" : 40, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "0ebe891c-1a72-4842-bf29-a9abe9c2a4d2", + "alias" : "direct grant", + "description" : "OpenID Connect Resource Owner Grant", + "providerId" : "basic-flow", + "topLevel" : true, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "direct-grant-validate-username", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "direct-grant-validate-password", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "CONDITIONAL", + "priority" : 30, + "autheticatorFlow" : true, + "flowAlias" : "Direct Grant - Conditional OTP", + "userSetupAllowed" : false + } ] + }, { + "id" : "d97d5579-b3d4-49c4-a60e-0e1e6b1c9d79", + "alias" : "docker auth", + "description" : "Used by Docker clients to authenticate against the IDP", + "providerId" : "basic-flow", + "topLevel" : true, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "docker-http-basic-authenticator", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "009f7c28-0f41-4237-9911-9091c3d751b7", + "alias" : "first broker login", + "description" : "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", + "providerId" : "basic-flow", + "topLevel" : true, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticatorConfig" : "review profile config", + "authenticator" : "idp-review-profile", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : true, + "flowAlias" : "User creation or linking", + "userSetupAllowed" : false + } ] + }, { + "id" : "f9911022-b3cf-4d96-9a96-51bc53c437eb", + "alias" : "forms", + "description" : "Username, password, otp and other auth forms.", + "providerId" : "basic-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "auth-username-password-form", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "CONDITIONAL", + "priority" : 20, + "autheticatorFlow" : true, + "flowAlias" : "Browser - Conditional OTP", + "userSetupAllowed" : false + } ] + }, { + "id" : "c53eb19d-49e9-4252-8a10-4d5c6a12e61b", + "alias" : "registration", + "description" : "registration flow", + "providerId" : "basic-flow", + "topLevel" : true, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "registration-page-form", + "authenticatorFlow" : true, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : true, + "flowAlias" : "registration form", + "userSetupAllowed" : false + } ] + }, { + "id" : "3b4f48d3-1706-4630-80e0-e0542780a1f7", + "alias" : "registration form", + "description" : "registration form", + "providerId" : "form-flow", + "topLevel" : false, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "registration-user-creation", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "registration-password-action", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 50, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "registration-recaptcha-action", + "authenticatorFlow" : false, + "requirement" : "DISABLED", + "priority" : 60, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + }, { + "id" : "5520aa89-cd76-438a-abae-7ccd3a2d7615", + "alias" : "reset credentials", + "description" : "Reset credentials for a user if they forgot their password or something", + "providerId" : "basic-flow", + "topLevel" : true, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "reset-credentials-choose-user", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "reset-credential-email", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 20, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticator" : "reset-password", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 30, + "autheticatorFlow" : false, + "userSetupAllowed" : false + }, { + "authenticatorFlow" : true, + "requirement" : "CONDITIONAL", + "priority" : 40, + "autheticatorFlow" : true, + "flowAlias" : "Reset - Conditional OTP", + "userSetupAllowed" : false + } ] + }, { + "id" : "cce548d6-9bef-4449-88ea-99b949488fe7", + "alias" : "saml ecp", + "description" : "SAML ECP Profile Authentication Flow", + "providerId" : "basic-flow", + "topLevel" : true, + "builtIn" : true, + "authenticationExecutions" : [ { + "authenticator" : "http-basic-authenticator", + "authenticatorFlow" : false, + "requirement" : "REQUIRED", + "priority" : 10, + "autheticatorFlow" : false, + "userSetupAllowed" : false + } ] + } ], + "authenticatorConfig" : [ { + "id" : "0848606c-7510-4b09-ba0e-4dc2ef3d63f8", + "alias" : "create unique user config", + "config" : { + "require.password.update.after.registration" : "false" + } + }, { + "id" : "91a8dee7-c679-4202-866e-234eb4164cfd", + "alias" : "review profile config", + "config" : { + "update.profile.on.first.login" : "missing" + } + } ], + "requiredActions" : [ { + "alias" : "CONFIGURE_TOTP", + "name" : "Configure OTP", + "providerId" : "CONFIGURE_TOTP", + "enabled" : true, + "defaultAction" : false, + "priority" : 10, + "config" : { } + }, { + "alias" : "TERMS_AND_CONDITIONS", + "name" : "Terms and Conditions", + "providerId" : "TERMS_AND_CONDITIONS", + "enabled" : false, + "defaultAction" : false, + "priority" : 20, + "config" : { } + }, { + "alias" : "UPDATE_PASSWORD", + "name" : "Update Password", + "providerId" : "UPDATE_PASSWORD", + "enabled" : true, + "defaultAction" : false, + "priority" : 30, + "config" : { } + }, { + "alias" : "UPDATE_PROFILE", + "name" : "Update Profile", + "providerId" : "UPDATE_PROFILE", + "enabled" : true, + "defaultAction" : false, + "priority" : 40, + "config" : { } + }, { + "alias" : "VERIFY_EMAIL", + "name" : "Verify Email", + "providerId" : "VERIFY_EMAIL", + "enabled" : true, + "defaultAction" : false, + "priority" : 50, + "config" : { } + }, { + "alias" : "delete_account", + "name" : "Delete Account", + "providerId" : "delete_account", + "enabled" : false, + "defaultAction" : false, + "priority" : 60, + "config" : { } + }, { + "alias" : "delete_credential", + "name" : "Delete Credential", + "providerId" : "delete_credential", + "enabled" : true, + "defaultAction" : false, + "priority" : 100, + "config" : { } + }, { + "alias" : "update_user_locale", + "name" : "Update User Locale", + "providerId" : "update_user_locale", + "enabled" : true, + "defaultAction" : false, + "priority" : 1000, + "config" : { } + } ], + "browserFlow" : "browser", + "registrationFlow" : "registration", + "directGrantFlow" : "direct grant", + "resetCredentialsFlow" : "reset credentials", + "clientAuthenticationFlow" : "clients", + "dockerAuthenticationFlow" : "docker auth", + "firstBrokerLoginFlow" : "first broker login", + "attributes" : { + "cibaBackchannelTokenDeliveryMode" : "poll", + "cibaAuthRequestedUserHint" : "login_hint", + "clientOfflineSessionMaxLifespan" : "0", + "oauth2DevicePollingInterval" : "5", + "clientSessionIdleTimeout" : "0", + "clientOfflineSessionIdleTimeout" : "0", + "cibaInterval" : "5", + "realmReusableOtpCode" : "false", + "cibaExpiresIn" : "120", + "oauth2DeviceCodeLifespan" : "600", + "parRequestUriLifespan" : "60", + "clientSessionMaxLifespan" : "0", + "organizationsEnabled" : "false" + }, + "keycloakVersion" : "25.0.0", + "userManagedAccessAllowed" : false, + "organizationsEnabled" : false, + "clientProfiles" : { + "profiles" : [ ] + }, + "clientPolicies" : { + "policies" : [ ] + } +} diff --git a/config/keycloak/opencloud-realm.dist.json b/config/keycloak/opencloud-realm.dist.json new file mode 100644 index 0000000..552b427 --- /dev/null +++ b/config/keycloak/opencloud-realm.dist.json @@ -0,0 +1,3052 @@ +{ + "id": "openCloud", + "realm": "openCloud", + "displayName": "OpenCloud", + "displayNameHtml": "
OpenCloud
", + "loginTheme": "opencloud", + "notBefore": 0, + "defaultSignatureAlgorithm": "RS256", + "revokeRefreshToken": false, + "refreshTokenMaxReuse": 0, + "accessTokenLifespan": 300, + "accessTokenLifespanForImplicitFlow": 900, + "ssoSessionIdleTimeout": 1800, + "ssoSessionMaxLifespan": 36000, + "ssoSessionIdleTimeoutRememberMe": 0, + "ssoSessionMaxLifespanRememberMe": 0, + "offlineSessionIdleTimeout": 2592000, + "offlineSessionMaxLifespanEnabled": false, + "offlineSessionMaxLifespan": 5184000, + "clientSessionIdleTimeout": 0, + "clientSessionMaxLifespan": 0, + "clientOfflineSessionIdleTimeout": 0, + "clientOfflineSessionMaxLifespan": 0, + "accessCodeLifespan": 60, + "accessCodeLifespanUserAction": 300, + "accessCodeLifespanLogin": 1800, + "actionTokenGeneratedByAdminLifespan": 43200, + "actionTokenGeneratedByUserLifespan": 300, + "oauth2DeviceCodeLifespan": 600, + "oauth2DevicePollingInterval": 5, + "enabled": true, + "sslRequired": "external", + "registrationAllowed": false, + "registrationEmailAsUsername": false, + "rememberMe": true, + "verifyEmail": false, + "loginWithEmailAllowed": true, + "duplicateEmailsAllowed": false, + "resetPasswordAllowed": true, + "editUsernameAllowed": false, + "bruteForceProtected": true, + "permanentLockout": false, + "maxTemporaryLockouts": 0, + "maxFailureWaitSeconds": 900, + "minimumQuickLoginWaitSeconds": 60, + "waitIncrementSeconds": 60, + "quickLoginCheckMilliSeconds": 1000, + "maxDeltaTimeSeconds": 43200, + "failureFactor": 30, + "roles": { + "realm": [ + { + "id": "2d576514-4aae-46aa-9d9c-075f55f4d988", + "name": "uma_authorization", + "description": "${role_uma_authorization}", + "composite": false, + "clientRole": false, + "containerId": "openCloud", + "attributes": {} + }, + { + "id": "2aadd357-682c-406b-8874-293091995fdd", + "name": "opencloudSpaceAdmin", + "description": "", + "composite": false, + "clientRole": false, + "containerId": "openCloud", + "attributes": {} + }, + { + "id": "38071a68-456a-4553-846a-fa67bf5596cc", + "name": "opencloudGuest", + "description": "", + "composite": false, + "clientRole": false, + "containerId": "openCloud", + "attributes": {} + }, + { + "id": "71881883-1768-46bd-a24d-a356a2afdf7f", + "name": "opencloudAdmin", + "description": "", + "composite": false, + "clientRole": false, + "containerId": "openCloud", + "attributes": {} + }, + { + "id": "e2145b30-bf6f-49fb-af3f-1b40168bfcef", + "name": "offline_access", + "description": "${role_offline-access}", + "composite": false, + "clientRole": false, + "containerId": "openCloud", + "attributes": {} + }, + { + "id": "82e13ea7-aac4-4d2c-9fc7-cff8333dbe19", + "name": "default-roles-opencloud", + "description": "${role_default-roles}", + "composite": true, + "composites": { + "realm": [ + "opencloudGuest", + "offline_access", + "uma_authorization" + ], + "client": { + "account": [ + "manage-account", + "view-profile" + ] + } + }, + "clientRole": false, + "containerId": "openCloud", + "attributes": {} + }, + { + "id": "d7beeea8-8ff4-406b-8fb6-ab2dd81e6b11", + "name": "opencloudUser", + "description": "", + "composite": false, + "clientRole": false, + "containerId": "openCloud", + "attributes": {} + } + ], + "client": { + "_system": [], + "realm-management": [ + { + "id": "979ce053-a671-4b50-81d5-da4bdf7404c9", + "name": "view-clients", + "description": "${role_view-clients}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-clients" + ] + } + }, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "4bec4791-e888-4dac-bc95-71720d5981b9", + "name": "query-users", + "description": "${role_query-users}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "955b4406-b04f-432d-a61a-571675874341", + "name": "manage-authorization", + "description": "${role_manage-authorization}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "baa219af-2773-4d59-b06b-485f10fbbab3", + "name": "view-events", + "description": "${role_view-events}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "f280bc03-d079-478d-be06-3590580b25e9", + "name": "manage-users", + "description": "${role_manage-users}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "db698163-84ad-46c9-958f-bb5f80ae78b5", + "name": "query-clients", + "description": "${role_query-clients}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "36c04d89-abf7-4a2c-a808-8efa9aca1435", + "name": "manage-clients", + "description": "${role_manage-clients}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "06eae953-11d5-4344-b089-ffce1e68d5d8", + "name": "query-realms", + "description": "${role_query-realms}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "afe8aa78-2f06-43a5-8c99-cf68a1f5a86a", + "name": "realm-admin", + "description": "${role_realm-admin}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "view-clients", + "query-users", + "manage-authorization", + "view-events", + "manage-users", + "query-clients", + "manage-clients", + "query-realms", + "impersonation", + "manage-realm", + "manage-identity-providers", + "view-authorization", + "create-client", + "query-groups", + "view-users", + "view-realm", + "view-identity-providers", + "manage-events" + ] + } + }, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "22ee128a-b28e-4c6a-aa8e-ad4136d74e1b", + "name": "impersonation", + "description": "${role_impersonation}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "89d4f119-7f87-44d9-8eef-d207304de778", + "name": "manage-realm", + "description": "${role_manage-realm}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "ebffeff4-6794-4003-a2ab-a79eff7d1baa", + "name": "manage-identity-providers", + "description": "${role_manage-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "2361a7ff-d2b3-43f5-b360-ad0e44fba65c", + "name": "view-authorization", + "description": "${role_view-authorization}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "f7bf6d7a-a861-49c6-8f6f-225c18d0a03a", + "name": "create-client", + "description": "${role_create-client}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "34ccce1c-5a7e-4268-8836-2276545be900", + "name": "query-groups", + "description": "${role_query-groups}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "430f7831-8f22-4518-bd15-2998eae45a51", + "name": "view-users", + "description": "${role_view-users}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-groups", + "query-users" + ] + } + }, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "371a31e6-4494-4b74-b3ea-d030663423ed", + "name": "view-realm", + "description": "${role_view-realm}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "e875775b-7a3e-4a5d-9e4e-376351b78626", + "name": "view-identity-providers", + "description": "${role_view-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + }, + { + "id": "3dce7929-ee1f-40cd-9be1-7addcae92cef", + "name": "manage-events", + "description": "${role_manage-events}", + "composite": false, + "clientRole": true, + "containerId": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "attributes": {} + } + ], + "OpenCloudDesktop": [], + "web": [], + "security-admin-console": [], + "OpenCloudIOS": [], + "admin-cli": [], + "OpenCloudAndroid": [], + "account-console": [], + "broker": [ + { + "id": "81fad68a-8dd8-4d79-9a8f-206a82460145", + "name": "read-token", + "description": "${role_read-token}", + "composite": false, + "clientRole": true, + "containerId": "002faf0a-716c-4230-81c7-ce22d1eb832c", + "attributes": {} + } + ], + "account": [ + { + "id": "c49a49da-8ad0-44cb-b518-6d7d72cbe494", + "name": "manage-account", + "description": "${role_manage-account}", + "composite": true, + "composites": { + "client": { + "account": [ + "manage-account-links" + ] + } + }, + "clientRole": true, + "containerId": "9850adad-7910-4b67-a790-da6444361618", + "attributes": {} + }, + { + "id": "9dc2244e-b8a7-44f1-b173-d2b929fedcca", + "name": "view-consent", + "description": "${role_view-consent}", + "composite": false, + "clientRole": true, + "containerId": "9850adad-7910-4b67-a790-da6444361618", + "attributes": {} + }, + { + "id": "ce115327-99c9-44d4-ba7d-820397dc11e6", + "name": "manage-account-links", + "description": "${role_manage-account-links}", + "composite": false, + "clientRole": true, + "containerId": "9850adad-7910-4b67-a790-da6444361618", + "attributes": {} + }, + { + "id": "2ffdf854-084b-467a-91c6-7f07844efc9a", + "name": "view-groups", + "description": "${role_view-groups}", + "composite": false, + "clientRole": true, + "containerId": "9850adad-7910-4b67-a790-da6444361618", + "attributes": {} + }, + { + "id": "8c45ca71-32aa-4547-932d-412da5e371ed", + "name": "view-profile", + "description": "${role_view-profile}", + "composite": false, + "clientRole": true, + "containerId": "9850adad-7910-4b67-a790-da6444361618", + "attributes": {} + }, + { + "id": "cbeecf6d-9af8-4746-877b-74800a894c35", + "name": "view-applications", + "description": "${role_view-applications}", + "composite": false, + "clientRole": true, + "containerId": "9850adad-7910-4b67-a790-da6444361618", + "attributes": {} + }, + { + "id": "ea798f64-b5f8-417f-9fe0-d3cd9172884f", + "name": "delete-account", + "description": "${role_delete-account}", + "composite": false, + "clientRole": true, + "containerId": "9850adad-7910-4b67-a790-da6444361618", + "attributes": {} + }, + { + "id": "e73aaf6d-e67b-491a-9cc3-78c32c82b42c", + "name": "manage-consent", + "description": "${role_manage-consent}", + "composite": true, + "composites": { + "client": { + "account": [ + "view-consent" + ] + } + }, + "clientRole": true, + "containerId": "9850adad-7910-4b67-a790-da6444361618", + "attributes": {} + } + ] + } + }, + "groups": [ + { + "id": "ed57d574-3bd9-4b51-9691-5d1b6aef7c68", + "name": "administrators", + "path": "/administrators", + "subGroups": [], + "attributes": {}, + "realmRoles": [ + "opencloudAdmin" + ], + "clientRoles": {} + }, + { + "id": "1bf1a677-302d-4c28-ac53-e83c87372a81", + "name": "apollos", + "path": "/apollos", + "subGroups": [], + "attributes": {}, + "realmRoles": [ + "opencloudSpaceAdmin" + ], + "clientRoles": {} + }, + { + "id": "12611514-517a-4fe6-a85d-41a018e98598", + "name": "basic-haters", + "path": "/basic-haters", + "subGroups": [], + "attributes": {}, + "realmRoles": [], + "clientRoles": {} + }, + { + "id": "7a56c37d-3b86-487e-abe5-144452678255", + "name": "bible-readers", + "path": "/bible-readers", + "subGroups": [], + "attributes": {}, + "realmRoles": [], + "clientRoles": {} + }, + { + "id": "03a5d51c-5e55-40ab-b8c8-5b796f77ab34", + "name": "chess-lovers", + "path": "/chess-lovers", + "subGroups": [], + "attributes": {}, + "realmRoles": [], + "clientRoles": {} + }, + { + "id": "255c4aea-a3c6-41f5-bca5-0dec59cca3ee", + "name": "machine-lovers", + "path": "/machine-lovers", + "subGroups": [], + "attributes": {}, + "realmRoles": [], + "clientRoles": {} + }, + { + "id": "d1d0f574-6a8e-49da-981b-bd0f667ec650", + "name": "programmers", + "path": "/programmers", + "subGroups": [], + "attributes": {}, + "realmRoles": [], + "clientRoles": {} + }, + { + "id": "f8ab7ab3-e44b-445b-86a7-26d61259a6a6", + "name": "unix-lovers", + "path": "/unix-lovers", + "subGroups": [], + "attributes": {}, + "realmRoles": [ + "opencloudAdmin" + ], + "clientRoles": {} + }, + { + "id": "c3e5bec3-a125-4043-b872-5c38dc659a13", + "name": "users", + "path": "/users", + "subGroups": [], + "attributes": {}, + "realmRoles": [ + "opencloudUser" + ], + "clientRoles": {} + }, + { + "id": "ed1c5f92-4938-494f-83d3-a73be393a270", + "name": "vlsi-lovers", + "path": "/vlsi-lovers", + "subGroups": [], + "attributes": {}, + "realmRoles": [], + "clientRoles": {} + } + ], + "defaultRole": { + "id": "82e13ea7-aac4-4d2c-9fc7-cff8333dbe19", + "name": "default-roles-opencloud", + "description": "${role_default-roles}", + "composite": true, + "clientRole": false, + "containerId": "openCloud" + }, + "requiredCredentials": [ + "password" + ], + "otpPolicyType": "totp", + "otpPolicyAlgorithm": "HmacSHA1", + "otpPolicyInitialCounter": 0, + "otpPolicyDigits": 6, + "otpPolicyLookAheadWindow": 1, + "otpPolicyPeriod": 30, + "otpPolicyCodeReusable": false, + "otpSupportedApplications": [ + "totpAppFreeOTPName", + "totpAppGoogleName", + "totpAppMicrosoftAuthenticatorName" + ], + "localizationTexts": {}, + "webAuthnPolicyRpEntityName": "keycloak", + "webAuthnPolicySignatureAlgorithms": [ + "ES256" + ], + "webAuthnPolicyRpId": "", + "webAuthnPolicyAttestationConveyancePreference": "not specified", + "webAuthnPolicyAuthenticatorAttachment": "not specified", + "webAuthnPolicyRequireResidentKey": "not specified", + "webAuthnPolicyUserVerificationRequirement": "not specified", + "webAuthnPolicyCreateTimeout": 0, + "webAuthnPolicyAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyAcceptableAaguids": [], + "webAuthnPolicyExtraOrigins": [], + "webAuthnPolicyPasswordlessRpEntityName": "keycloak", + "webAuthnPolicyPasswordlessSignatureAlgorithms": [ + "ES256" + ], + "webAuthnPolicyPasswordlessRpId": "", + "webAuthnPolicyPasswordlessAttestationConveyancePreference": "not specified", + "webAuthnPolicyPasswordlessAuthenticatorAttachment": "not specified", + "webAuthnPolicyPasswordlessRequireResidentKey": "not specified", + "webAuthnPolicyPasswordlessUserVerificationRequirement": "not specified", + "webAuthnPolicyPasswordlessCreateTimeout": 0, + "webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyPasswordlessAcceptableAaguids": [], + "webAuthnPolicyPasswordlessExtraOrigins": [], + "scopeMappings": [ + { + "clientScope": "offline_access", + "roles": [ + "offline_access" + ] + }, + { + "clientScope": "roles", + "roles": [ + "opencloudGuest", + "opencloudAdmin", + "opencloudSpaceAdmin", + "opencloudUser" + ] + } + ], + "clientScopeMappings": { + "account": [ + { + "client": "account-console", + "roles": [ + "manage-account", + "view-groups" + ] + } + ] + }, + "clients": [ + { + "id": "c8367556-1d13-4979-b4f6-5e2cff1f82ae", + "clientId": "OpenCloudAndroid", + "name": "OpenCloud Android App", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "oc://android.opencloud.eu" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "post.logout.redirect.uris": "oc://android.opencloud.eu", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "OpenCloudUnique_ID", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "fc7d8a8e-cb92-4cb0-b404-d723c07d8d4f", + "clientId": "OpenCloudDesktop", + "name": "OpenCloud Desktop Client", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "http://127.0.0.1", + "http://localhost" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "post.logout.redirect.uris": "+", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "OpenCloudUnique_ID", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "6ae0e3da-38ff-47a4-a76e-b59eec0a2de9", + "clientId": "OpenCloudIOS", + "name": "OpenCloud iOS App", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "oc://ios.opencloud.eu" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "post.logout.redirect.uris": "oc://ios.opencloud.eu", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "OpenCloudUnique_ID", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "294b6cf4-b646-4f6c-bab2-616546ec3167", + "clientId": "_system", + "name": "_system", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "client.secret.creation.time": "1718778122", + "post.logout.redirect.uris": "+" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "9850adad-7910-4b67-a790-da6444361618", + "clientId": "account", + "name": "${client_account}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/openCloud/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "/realms/openCloud/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "client.secret.creation.time": "1718778122", + "post.logout.redirect.uris": "+" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "basic" + ], + "optionalClientScopes": [] + }, + { + "id": "55bb4cdc-045b-422a-8830-61245949d6aa", + "clientId": "account-console", + "name": "${client_account-console}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/openCloud/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "/realms/openCloud/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "post.logout.redirect.uris": "+", + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "9bf413ed-402f-438d-a72c-033f3c45dab2", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + } + ], + "defaultClientScopes": [ + "web-origins", + "acr", + "profile", + "roles", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "2969b8ff-2ab3-4907-aaa7-091a7a627ccb", + "clientId": "admin-cli", + "name": "${client_admin-cli}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": false, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "post.logout.redirect.uris": "+" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "basic" + ], + "optionalClientScopes": [] + }, + { + "id": "002faf0a-716c-4230-81c7-ce22d1eb832c", + "clientId": "broker", + "name": "${client_broker}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "client.secret.creation.time": "1718778122", + "post.logout.redirect.uris": "+" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "basic" + ], + "optionalClientScopes": [] + }, + { + "id": "7848ee94-cc9b-40db-946f-a86ac73dc9b7", + "clientId": "realm-management", + "name": "${client_realm-management}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": true, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "post.logout.redirect.uris": "+" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [], + "optionalClientScopes": [] + }, + { + "id": "97264f49-a8c1-4585-99b6-e706339c62f8", + "clientId": "security-admin-console", + "name": "${client_security-admin-console}", + "rootUrl": "${authAdminUrl}", + "baseUrl": "/admin/openCloud/console/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "/admin/openCloud/console/*" + ], + "webOrigins": [ + "+" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "post.logout.redirect.uris": "+", + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "96092024-21dd-4d31-a004-2c5b96031da3", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + } + ], + "defaultClientScopes": [ + "basic" + ], + "optionalClientScopes": [] + }, + { + "id": "54b18eca-cf79-4263-9db9-2d79f8a1c831", + "clientId": "web", + "name": "OpenCloud Web App", + "description": "", + "rootUrl": "https://cloud.opencloud.test", + "adminUrl": "https://cloud.opencloud.test", + "baseUrl": "", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "redirectUris": [ + "https://cloud.opencloud.test/", + "https://cloud.opencloud.test/oidc-silent-redirect.html", + "https://cloud.opencloud.test/oidc-callback.html" + ], + "webOrigins": [ + "https://cloud.opencloud.test" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "post.logout.redirect.uris": "+", + "oauth2.device.authorization.grant.enabled": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "oidc.ciba.grant.enabled": "false", + "backchannel.logout.session.required": "true", + "backchannel.logout.url": "https://cloud.opencloud.test/backchannel_logout", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "profile", + "roles", + "groups", + "OpenCloudUnique_ID", + "basic", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + } + ], + "clientScopes": [ + { + "id": "258e56a8-1eeb-49ea-957b-aff8df4656ba", + "name": "email", + "description": "OpenID Connect built-in scope: email", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${emailScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "068bcfb6-4a17-4c20-b083-ae542a7f76c8", + "name": "email verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "user.attribute": "emailVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email_verified", + "jsonType.label": "boolean", + "userinfo.token.claim": "true" + } + }, + { + "id": "c00d6c21-2fd1-435f-9ee9-87e011048cbe", + "name": "email", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "user.attribute": "email", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + } + ] + }, + { + "id": "b3e1e47e-3912-4b55-ba89-b0198e767682", + "name": "address", + "description": "OpenID Connect built-in scope: address", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${addressScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "876baab9-39d1-4845-abb4-561a58aa152d", + "name": "address", + "protocol": "openid-connect", + "protocolMapper": "oidc-address-mapper", + "consentRequired": false, + "config": { + "user.attribute.formatted": "formatted", + "user.attribute.country": "country", + "user.attribute.postal_code": "postal_code", + "userinfo.token.claim": "true", + "user.attribute.street": "street", + "id.token.claim": "true", + "user.attribute.region": "region", + "access.token.claim": "true", + "user.attribute.locality": "locality" + } + } + ] + }, + { + "id": "9cae7ced-e7d9-4f7b-8e54-7402125f6ead", + "name": "offline_access", + "description": "OpenID Connect built-in scope: offline_access", + "protocol": "openid-connect", + "attributes": { + "consent.screen.text": "${offlineAccessScopeConsentText}", + "display.on.consent.screen": "true" + } + }, + { + "id": "79713daf-89ca-4ed4-ad97-a88b13ee9a18", + "name": "phone", + "description": "OpenID Connect built-in scope: phone", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${phoneScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "b5f4f5ed-1008-42ba-8b3b-7d8851a2a680", + "name": "phone number", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "phoneNumber", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "08a246f1-2b4c-4def-af5c-aefc31b4820d", + "name": "phone number verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "phoneNumberVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number_verified", + "jsonType.label": "boolean", + "userinfo.token.claim": "true" + } + } + ] + }, + { + "id": "5ce87358-3bca-4874-a6f0-6dccae6209a8", + "name": "web-origins", + "description": "OpenID Connect scope for add allowed web origins to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "consent.screen.text": "", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "bbd23c51-918d-4ea6-9ac0-db68b512fb0a", + "name": "allowed web origins", + "protocol": "openid-connect", + "protocolMapper": "oidc-allowed-origins-mapper", + "consentRequired": false, + "config": {} + } + ] + }, + { + "id": "bdb3e320-76c8-4ad7-9d0f-a08efc060101", + "name": "microprofile-jwt", + "description": "Microprofile - JWT built-in scope", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "1d08316c-493b-42ab-afa3-66f621860661", + "name": "groups", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "multivalued": "true", + "userinfo.token.claim": "true", + "user.attribute": "foo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "groups", + "jsonType.label": "String" + } + }, + { + "id": "52061d2d-7a41-4f1d-ba1b-3c4a53e739e4", + "name": "upn", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "upn", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + } + ] + }, + { + "id": "d68b434c-c589-45d4-ada1-5370b7e65cae", + "name": "OpenCloudUnique_ID", + "description": "Id to be used in OpenCloud and Keycloak", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false", + "gui.order": "", + "consent.screen.text": "" + }, + "protocolMappers": [ + { + "id": "d84f29ea-54d4-477e-9b36-cf5d7bec8f0c", + "name": "Unique ID", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "user.attribute": "uuid", + "id.token.claim": "true", + "lightweight.claim": "true", + "access.token.claim": "true", + "claim.name": "uuid", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "8eb1f69b-b941-4185-bca1-f916953f7cf5", + "name": "role_list", + "description": "SAML role list", + "protocol": "saml", + "attributes": { + "consent.screen.text": "${samlRoleListScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "fb587847-806f-4443-bab0-501efc0f0b46", + "name": "role list", + "protocol": "saml", + "protocolMapper": "saml-role-list-mapper", + "consentRequired": false, + "config": { + "single": "false", + "attribute.nameformat": "Basic", + "attribute.name": "Role" + } + } + ] + }, + { + "id": "947da1ff-f614-48fc-9ecb-c98cbcfd3390", + "name": "profile", + "description": "OpenID Connect built-in scope: profile", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "consent.screen.text": "${profileScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "46fec552-2f92-408a-84cf-ba98bf8e35fd", + "name": "family name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "user.attribute": "lastName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "family_name", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "c7ed5458-4d32-423e-8ea1-d112c45045d4", + "name": "middle name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "middleName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "middle_name", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "e18d1ce4-3969-4ec1-9941-a27fd7555245", + "name": "picture", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "picture", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "picture", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "dab85a5e-9af8-4fcd-88e4-9d3ae50dd5b6", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "7484f47e-3bb1-48d0-ba64-e8330dcefe6e", + "name": "profile", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "profile", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "profile", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "fcd00995-9693-4803-8f41-c84044be83ed", + "name": "website", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "website", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "website", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "f09e7268-5284-449b-849b-cf8225523584", + "name": "full name", + "protocol": "openid-connect", + "protocolMapper": "oidc-full-name-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + }, + { + "id": "0317f4b3-3f7b-47ab-88d3-5d6f604d944d", + "name": "nickname", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "nickname", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "nickname", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "db81244c-e739-461b-8822-52ceaa11bdf4", + "name": "updated at", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "updatedAt", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "updated_at", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "c6a16bf9-9370-4dff-a718-be53131bb238", + "name": "gender", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "gender", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "gender", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "32d76647-b542-484c-9062-edc34eb350e0", + "name": "birthdate", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "birthdate", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "birthdate", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "ac6530db-6463-446b-99da-32d5298b5fa0", + "name": "zoneinfo", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "user.attribute": "zoneinfo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "zoneinfo", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "ed10983b-8700-415e-933e-226ce3f397a6", + "name": "given name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "user.attribute": "firstName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "given_name", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + }, + { + "id": "8205ccd0-1266-4060-b5df-3a6eb229d91e", + "name": "username", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "preferred_username", + "jsonType.label": "String", + "userinfo.token.claim": "true" + } + } + ] + }, + { + "id": "c3a6224b-49aa-4a25-953d-7e326d66893d", + "name": "basic", + "description": "OpenID Connect scope for add all basic claims to the token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "2d4f3f17-1ab7-429e-88e1-cdf08d3533c6", + "name": "auth_time", + "protocol": "openid-connect", + "protocolMapper": "oidc-usersessionmodel-note-mapper", + "consentRequired": false, + "config": { + "user.session.note": "AUTH_TIME", + "introspection.token.claim": "true", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "auth_time", + "jsonType.label": "long" + } + }, + { + "id": "3e7da934-3de3-4bd1-a565-8ac62419c138", + "name": "sub", + "protocol": "openid-connect", + "protocolMapper": "oidc-sub-mapper", + "consentRequired": false, + "config": { + "introspection.token.claim": "true", + "access.token.claim": "true" + } + } + ] + }, + { + "id": "0c72b80b-28d5-48d8-b593-c99030aab58d", + "name": "roles", + "description": "OpenID Connect scope for add user roles to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "consent.screen.text": "${rolesScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "bc7f015e-329f-4e99-be6b-72382f4310c7", + "name": "client roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-client-role-mapper", + "consentRequired": false, + "config": { + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "resource_access.${client_id}.roles", + "jsonType.label": "String", + "multivalued": "true" + } + }, + { + "id": "215f645f-ad0b-4523-9ece-f09f69ead5c4", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + }, + { + "id": "4a10b958-d34d-413a-b349-1415d02cdcde", + "name": "realm roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "roles", + "jsonType.label": "String", + "userinfo.token.claim": "true", + "multivalued": "true" + } + } + ] + }, + { + "id": "7438d93e-b07a-4913-9419-3273be364c4b", + "name": "groups", + "description": "OpenID Connect scope for add user groups to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "true", + "gui.order": "", + "consent.screen.text": "" + }, + "protocolMappers": [ + { + "id": "5349faf2-64a6-481f-b207-39ffef2cd597", + "name": "groups", + "protocol": "openid-connect", + "protocolMapper": "oidc-group-membership-mapper", + "consentRequired": false, + "config": { + "full.path": "false", + "introspection.token.claim": "true", + "multivalued": "true", + "userinfo.token.claim": "true", + "id.token.claim": "true", + "lightweight.claim": "false", + "access.token.claim": "true", + "claim.name": "groups" + } + } + ] + }, + { + "id": "86883395-e439-4cab-9d8d-31d71389969c", + "name": "acr", + "description": "OpenID Connect scope for add acr (authentication context class reference) to the token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "b849b14b-7c9c-4b7b-9329-c56debefb47c", + "name": "acr loa level", + "protocol": "openid-connect", + "protocolMapper": "oidc-acr-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + } + ] + } + ], + "defaultDefaultClientScopes": [ + "role_list", + "profile", + "email", + "roles", + "web-origins", + "acr", + "basic", + "groups", + "OpenCloudUnique_ID" + ], + "defaultOptionalClientScopes": [ + "offline_access", + "address", + "phone", + "microprofile-jwt" + ], + "browserSecurityHeaders": { + "contentSecurityPolicyReportOnly": "", + "xContentTypeOptions": "nosniff", + "referrerPolicy": "no-referrer", + "xRobotsTag": "none", + "xFrameOptions": "SAMEORIGIN", + "contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", + "xXSSProtection": "1; mode=block", + "strictTransportSecurity": "max-age=31536000; includeSubDomains" + }, + "smtpServer": {}, + "eventsEnabled": false, + "eventsListeners": [ + "jboss-logging" + ], + "enabledEventTypes": [ + "SEND_RESET_PASSWORD", + "UPDATE_CONSENT_ERROR", + "GRANT_CONSENT", + "VERIFY_PROFILE_ERROR", + "REMOVE_TOTP", + "REVOKE_GRANT", + "UPDATE_TOTP", + "LOGIN_ERROR", + "CLIENT_LOGIN", + "RESET_PASSWORD_ERROR", + "IMPERSONATE_ERROR", + "CODE_TO_TOKEN_ERROR", + "CUSTOM_REQUIRED_ACTION", + "OAUTH2_DEVICE_CODE_TO_TOKEN_ERROR", + "RESTART_AUTHENTICATION", + "IMPERSONATE", + "UPDATE_PROFILE_ERROR", + "LOGIN", + "OAUTH2_DEVICE_VERIFY_USER_CODE", + "UPDATE_PASSWORD_ERROR", + "CLIENT_INITIATED_ACCOUNT_LINKING", + "OAUTH2_EXTENSION_GRANT", + "USER_DISABLED_BY_PERMANENT_LOCKOUT", + "TOKEN_EXCHANGE", + "AUTHREQID_TO_TOKEN", + "LOGOUT", + "REGISTER", + "DELETE_ACCOUNT_ERROR", + "CLIENT_REGISTER", + "IDENTITY_PROVIDER_LINK_ACCOUNT", + "USER_DISABLED_BY_TEMPORARY_LOCKOUT", + "DELETE_ACCOUNT", + "UPDATE_PASSWORD", + "CLIENT_DELETE", + "FEDERATED_IDENTITY_LINK_ERROR", + "IDENTITY_PROVIDER_FIRST_LOGIN", + "CLIENT_DELETE_ERROR", + "VERIFY_EMAIL", + "CLIENT_LOGIN_ERROR", + "RESTART_AUTHENTICATION_ERROR", + "EXECUTE_ACTIONS", + "REMOVE_FEDERATED_IDENTITY_ERROR", + "TOKEN_EXCHANGE_ERROR", + "PERMISSION_TOKEN", + "FEDERATED_IDENTITY_OVERRIDE_LINK", + "SEND_IDENTITY_PROVIDER_LINK_ERROR", + "EXECUTE_ACTION_TOKEN_ERROR", + "OAUTH2_EXTENSION_GRANT_ERROR", + "SEND_VERIFY_EMAIL", + "OAUTH2_DEVICE_AUTH", + "EXECUTE_ACTIONS_ERROR", + "REMOVE_FEDERATED_IDENTITY", + "OAUTH2_DEVICE_CODE_TO_TOKEN", + "IDENTITY_PROVIDER_POST_LOGIN", + "IDENTITY_PROVIDER_LINK_ACCOUNT_ERROR", + "FEDERATED_IDENTITY_OVERRIDE_LINK_ERROR", + "OAUTH2_DEVICE_VERIFY_USER_CODE_ERROR", + "UPDATE_EMAIL", + "REGISTER_ERROR", + "REVOKE_GRANT_ERROR", + "EXECUTE_ACTION_TOKEN", + "LOGOUT_ERROR", + "UPDATE_EMAIL_ERROR", + "CLIENT_UPDATE_ERROR", + "AUTHREQID_TO_TOKEN_ERROR", + "INVITE_ORG_ERROR", + "UPDATE_PROFILE", + "CLIENT_REGISTER_ERROR", + "FEDERATED_IDENTITY_LINK", + "INVITE_ORG", + "SEND_IDENTITY_PROVIDER_LINK", + "SEND_VERIFY_EMAIL_ERROR", + "RESET_PASSWORD", + "CLIENT_INITIATED_ACCOUNT_LINKING_ERROR", + "OAUTH2_DEVICE_AUTH_ERROR", + "UPDATE_CONSENT", + "REMOVE_TOTP_ERROR", + "VERIFY_EMAIL_ERROR", + "SEND_RESET_PASSWORD_ERROR", + "CLIENT_UPDATE", + "CUSTOM_REQUIRED_ACTION_ERROR", + "IDENTITY_PROVIDER_POST_LOGIN_ERROR", + "UPDATE_TOTP_ERROR", + "CODE_TO_TOKEN", + "VERIFY_PROFILE", + "GRANT_CONSENT_ERROR", + "IDENTITY_PROVIDER_FIRST_LOGIN_ERROR" + ], + "adminEventsEnabled": false, + "adminEventsDetailsEnabled": false, + "identityProviders": [], + "identityProviderMappers": [], + "components": { + "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy": [ + { + "id": "4682fe74-f3a9-445a-a7ab-557fb532fe6b", + "name": "Consent Required", + "providerId": "consent-required", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "c46009e5-c8b5-4051-bf7f-7b1481a9aa86", + "name": "Max Clients Limit", + "providerId": "max-clients", + "subType": "anonymous", + "subComponents": {}, + "config": { + "max-clients": [ + "200" + ] + } + }, + { + "id": "43edf979-28d2-46c8-9f93-48b3de185570", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "oidc-full-name-mapper", + "saml-user-attribute-mapper", + "oidc-usermodel-property-mapper", + "saml-role-list-mapper", + "oidc-usermodel-attribute-mapper", + "saml-user-property-mapper", + "oidc-address-mapper", + "oidc-sha256-pairwise-sub-mapper" + ] + } + }, + { + "id": "6fc7d765-7da8-4985-ba0b-e83827b04bd3", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "c016f2b3-cf74-410e-a852-f6c7b49e0f5a", + "name": "Block Client Registration", + "providerId": "trusted-hosts", + "subType": "anonymous", + "subComponents": {}, + "config": { + "host-sending-registration-request-must-match": [ + "true" + ], + "client-uris-must-match": [ + "true" + ] + } + }, + { + "id": "5a9aef85-98a6-4e90-b30f-8aa715e1f5e6", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "oidc-full-name-mapper", + "saml-user-property-mapper", + "saml-role-list-mapper", + "oidc-address-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-usermodel-property-mapper", + "oidc-usermodel-attribute-mapper", + "saml-user-attribute-mapper" + ] + } + }, + { + "id": "e3eadb04-8862-4567-869c-a76485268159", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "c788e6bf-2f57-4a82-b32e-ac8d48a4f676", + "name": "Full Scope Disabled", + "providerId": "scope", + "subType": "anonymous", + "subComponents": {}, + "config": {} + } + ], + "org.keycloak.userprofile.UserProfileProvider": [ + { + "id": "28d6b4ce-33d4-40c0-adef-b27e35b7e122", + "providerId": "declarative-user-profile", + "subComponents": {}, + "config": { + "kc.user.profile.config": [ + "{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"required\":{\"roles\":[\"user\"]},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"uuid\",\"displayName\":\"Unique LDAP ID\",\"validations\":{},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}]}" + ] + } + } + ], + "org.keycloak.storage.UserStorageProvider": [ + { + "id": "91da1f3b-b9f4-4759-aed4-50124d9b9f3e", + "name": "ldap", + "providerId": "ldap", + "subComponents": { + "org.keycloak.storage.ldap.mappers.LDAPStorageMapper": [ + { + "id": "5ce17b39-efb7-45a2-b600-55c57d3a3021", + "name": "email", + "providerId": "user-attribute-ldap-mapper", + "subComponents": {}, + "config": { + "ldap.attribute": [ + "mail" + ], + "is.mandatory.in.ldap": [ + "false" + ], + "always.read.value.from.ldap": [ + "false" + ], + "read.only": [ + "false" + ], + "user.model.attribute": [ + "email" + ] + } + }, + { + "id": "7bf4374a-10d6-4192-9fb5-119ebf87f9f6", + "name": "modify date", + "providerId": "user-attribute-ldap-mapper", + "subComponents": {}, + "config": { + "ldap.attribute": [ + "modifyTimestamp" + ], + "is.mandatory.in.ldap": [ + "false" + ], + "always.read.value.from.ldap": [ + "true" + ], + "read.only": [ + "true" + ], + "user.model.attribute": [ + "modifyTimestamp" + ] + } + }, + { + "id": "9fe968b5-c338-4419-93c4-f339cbad5ef8", + "name": "username", + "providerId": "user-attribute-ldap-mapper", + "subComponents": {}, + "config": { + "ldap.attribute": [ + "uid" + ], + "is.mandatory.in.ldap": [ + "true" + ], + "read.only": [ + "false" + ], + "always.read.value.from.ldap": [ + "false" + ], + "user.model.attribute": [ + "username" + ] + } + }, + { + "id": "330d06e9-3e12-492e-af5e-53b1b950a122", + "name": "uuid", + "providerId": "user-attribute-ldap-mapper", + "subComponents": {}, + "config": { + "ldap.attribute": [ + "entryUUID" + ], + "attribute.force.default": [ + "false" + ], + "is.mandatory.in.ldap": [ + "false" + ], + "is.binary.attribute": [ + "false" + ], + "always.read.value.from.ldap": [ + "true" + ], + "read.only": [ + "true" + ], + "user.model.attribute": [ + "uuid" + ] + } + }, + { + "id": "79e83df0-9406-4609-b78f-b27de957bc41", + "name": "last name", + "providerId": "user-attribute-ldap-mapper", + "subComponents": {}, + "config": { + "ldap.attribute": [ + "sn" + ], + "is.mandatory.in.ldap": [ + "true" + ], + "read.only": [ + "false" + ], + "always.read.value.from.ldap": [ + "true" + ], + "user.model.attribute": [ + "lastName" + ] + } + }, + { + "id": "f75541bb-4819-424f-bc81-b6dc600dd730", + "name": "ldap-groups", + "providerId": "group-ldap-mapper", + "subComponents": {}, + "config": { + "mode": [ + "LDAP_ONLY" + ], + "membership.attribute.type": [ + "DN" + ], + "user.roles.retrieve.strategy": [ + "LOAD_GROUPS_BY_MEMBER_ATTRIBUTE" + ], + "group.name.ldap.attribute": [ + "cn" + ], + "membership.ldap.attribute": [ + "member" + ], + "preserve.group.inheritance": [ + "true" + ], + "ignore.missing.groups": [ + "false" + ], + "membership.user.ldap.attribute": [ + "uid" + ], + "groups.dn": [ + "ou=groups,dc=opencloud,dc=eu" + ], + "memberof.ldap.attribute": [ + "memberOf" + ], + "group.object.classes": [ + "groupOfNames" + ], + "groups.path": [ + "/" + ], + "drop.non.existing.groups.during.sync": [ + "true" + ] + } + }, + { + "id": "96bc2621-a714-4f15-ac1d-bc32df94382d", + "name": "display name", + "providerId": "full-name-ldap-mapper", + "subComponents": {}, + "config": { + "read.only": [ + "false" + ], + "write.only": [ + "true" + ], + "ldap.full.name.attribute": [ + "displayName" + ] + } + }, + { + "id": "cab8b569-0f50-4e13-b2a5-d24ee513cd8b", + "name": "first name", + "providerId": "user-attribute-ldap-mapper", + "subComponents": {}, + "config": { + "ldap.attribute": [ + "cn" + ], + "is.mandatory.in.ldap": [ + "true" + ], + "read.only": [ + "false" + ], + "always.read.value.from.ldap": [ + "true" + ], + "user.model.attribute": [ + "firstName" + ] + } + }, + { + "id": "30cec76e-539e-4ac4-9816-8a0ae4a49798", + "name": "creation date", + "providerId": "user-attribute-ldap-mapper", + "subComponents": {}, + "config": { + "ldap.attribute": [ + "createTimestamp" + ], + "is.mandatory.in.ldap": [ + "false" + ], + "read.only": [ + "true" + ], + "always.read.value.from.ldap": [ + "true" + ], + "user.model.attribute": [ + "createTimestamp" + ] + } + } + ] + }, + "config": { + "fullSyncPeriod": [ + "86400" + ], + "pagination": [ + "false" + ], + "startTls": [ + "false" + ], + "connectionPooling": [ + "false" + ], + "usersDn": [ + "ou=users,dc=opencloud,dc=eu" + ], + "cachePolicy": [ + "EVICT_DAILY" + ], + "evictionHour": [ + "0" + ], + "useKerberosForPasswordAuthentication": [ + "false" + ], + "importEnabled": [ + "true" + ], + "enabled": [ + "true" + ], + "bindCredential": [ + "ldap-admin-password" + ], + "bindDn": [ + "cn=admin,dc=opencloud,dc=eu" + ], + "usernameLDAPAttribute": [ + "uid" + ], + "changedSyncPeriod": [ + "3600" + ], + "lastSync": [ + "1745440869" + ], + "vendor": [ + "other" + ], + "uuidLDAPAttribute": [ + "entryUUID" + ], + "connectionUrl": [ + "ldap://ldap-server:1389" + ], + "allowKerberosAuthentication": [ + "false" + ], + "syncRegistrations": [ + "true" + ], + "authType": [ + "simple" + ], + "krbPrincipalAttribute": [ + "krb5PrincipalName" + ], + "customUserSearchFilter": [ + "(objectclass=inetOrgPerson)" + ], + "searchScope": [ + "1" + ], + "useTruststoreSpi": [ + "always" + ], + "usePasswordModifyExtendedOp": [ + "true" + ], + "trustEmail": [ + "false" + ], + "userObjectClasses": [ + "top,person,organizationalPerson,inetOrgPerson" + ], + "evictionMinute": [ + "0" + ], + "rdnLDAPAttribute": [ + "uid" + ], + "editMode": [ + "WRITABLE" + ], + "validatePasswordPolicy": [ + "false" + ] + } + } + ], + "org.keycloak.keys.KeyProvider": [ + { + "id": "0e3d0048-cb16-49c3-8a9a-05d83f0daeca", + "name": "rsa-generated", + "providerId": "rsa-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + }, + { + "id": "f92ecf31-c3c7-4c3b-af20-839fc05bcf99", + "name": "hmac-generated", + "providerId": "hmac-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ], + "algorithm": [ + "HS256" + ] + } + }, + { + "id": "a137a686-5876-4faf-8d1e-e3a59f55095e", + "name": "hmac-generated-hs512", + "providerId": "hmac-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ], + "algorithm": [ + "HS512" + ] + } + }, + { + "id": "992dcc80-dc41-4b00-bab8-6ec1c839f3a4", + "name": "aes-generated", + "providerId": "aes-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + } + ] + }, + "internationalizationEnabled": false, + "supportedLocales": [], + "authenticationFlows": [ + { + "id": "8964f931-b866-4a05-ab1c-89331a566887", + "alias": "Account verification options", + "description": "Method with which to verity the existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-email-verification", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Verify Existing Account by Re-authentication", + "userSetupAllowed": false + } + ] + }, + { + "id": "123e5711-1ee5-4f7e-ac9c-64c644daaea9", + "alias": "Browser - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-otp-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "be73b7f5-9a66-487c-b7dd-80e0f7ac0c7c", + "alias": "Direct Grant - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "direct-grant-validate-otp", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "597ca917-91fc-4898-a279-cd592af286e3", + "alias": "First broker login - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-otp-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "3daadb6b-4d63-4be1-a89e-ec8e41e72afa", + "alias": "Handle Existing Account", + "description": "Handle what to do if there is existing account with same email/username like authenticated identity provider", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-confirm-link", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Account verification options", + "userSetupAllowed": false + } + ] + }, + { + "id": "5942598c-d7e9-4941-b13e-4a8a75e2c2a3", + "alias": "Reset - Conditional OTP", + "description": "Flow to determine if the OTP should be reset or not. Set to REQUIRED to force.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-otp", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "6e4b336e-eb5f-423c-8d32-4ab94d1122e6", + "alias": "User creation or linking", + "description": "Flow for the existing/non-existing user alternatives", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "create unique user config", + "authenticator": "idp-create-user-if-unique", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Handle Existing Account", + "userSetupAllowed": false + } + ] + }, + { + "id": "35ac1997-b6af-44ff-ab27-c34f9be32e56", + "alias": "Verify Existing Account by Re-authentication", + "description": "Reauthentication of existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-username-password-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "First broker login - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "a3473070-fe69-4de1-a0b2-dd54b8a769d5", + "alias": "browser", + "description": "browser based authentication", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-cookie", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "auth-spnego", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "identity-provider-redirector", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 25, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "ALTERNATIVE", + "priority": 30, + "autheticatorFlow": true, + "flowAlias": "forms", + "userSetupAllowed": false + } + ] + }, + { + "id": "cc714857-b114-4df6-9030-b464bbb3964d", + "alias": "clients", + "description": "Base authentication for clients", + "providerId": "client-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "client-secret", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-jwt", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-secret-jwt", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 30, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "client-x509", + "authenticatorFlow": false, + "requirement": "ALTERNATIVE", + "priority": 40, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "0ebe891c-1a72-4842-bf29-a9abe9c2a4d2", + "alias": "direct grant", + "description": "OpenID Connect Resource Owner Grant", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "direct-grant-validate-username", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "direct-grant-validate-password", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 30, + "autheticatorFlow": true, + "flowAlias": "Direct Grant - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "d97d5579-b3d4-49c4-a60e-0e1e6b1c9d79", + "alias": "docker auth", + "description": "Used by Docker clients to authenticate against the IDP", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "docker-http-basic-authenticator", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "009f7c28-0f41-4237-9911-9091c3d751b7", + "alias": "first broker login", + "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "review profile config", + "authenticator": "idp-review-profile", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "User creation or linking", + "userSetupAllowed": false + } + ] + }, + { + "id": "f9911022-b3cf-4d96-9a96-51bc53c437eb", + "alias": "forms", + "description": "Username, password, otp and other auth forms.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-username-password-form", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 20, + "autheticatorFlow": true, + "flowAlias": "Browser - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "c53eb19d-49e9-4252-8a10-4d5c6a12e61b", + "alias": "registration", + "description": "registration flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-page-form", + "authenticatorFlow": true, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": true, + "flowAlias": "registration form", + "userSetupAllowed": false + } + ] + }, + { + "id": "3b4f48d3-1706-4630-80e0-e0542780a1f7", + "alias": "registration form", + "description": "registration form", + "providerId": "form-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-user-creation", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "registration-password-action", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 50, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "registration-recaptcha-action", + "authenticatorFlow": false, + "requirement": "DISABLED", + "priority": 60, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + }, + { + "id": "5520aa89-cd76-438a-abae-7ccd3a2d7615", + "alias": "reset credentials", + "description": "Reset credentials for a user if they forgot their password or something", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "reset-credentials-choose-user", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-credential-email", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 20, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticator": "reset-password", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 30, + "autheticatorFlow": false, + "userSetupAllowed": false + }, + { + "authenticatorFlow": true, + "requirement": "CONDITIONAL", + "priority": 40, + "autheticatorFlow": true, + "flowAlias": "Reset - Conditional OTP", + "userSetupAllowed": false + } + ] + }, + { + "id": "cce548d6-9bef-4449-88ea-99b949488fe7", + "alias": "saml ecp", + "description": "SAML ECP Profile Authentication Flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "http-basic-authenticator", + "authenticatorFlow": false, + "requirement": "REQUIRED", + "priority": 10, + "autheticatorFlow": false, + "userSetupAllowed": false + } + ] + } + ], + "authenticatorConfig": [ + { + "id": "0848606c-7510-4b09-ba0e-4dc2ef3d63f8", + "alias": "create unique user config", + "config": { + "require.password.update.after.registration": "false" + } + }, + { + "id": "91a8dee7-c679-4202-866e-234eb4164cfd", + "alias": "review profile config", + "config": { + "update.profile.on.first.login": "missing" + } + } + ], + "requiredActions": [ + { + "alias": "CONFIGURE_TOTP", + "name": "Configure OTP", + "providerId": "CONFIGURE_TOTP", + "enabled": true, + "defaultAction": false, + "priority": 10, + "config": {} + }, + { + "alias": "TERMS_AND_CONDITIONS", + "name": "Terms and Conditions", + "providerId": "TERMS_AND_CONDITIONS", + "enabled": false, + "defaultAction": false, + "priority": 20, + "config": {} + }, + { + "alias": "UPDATE_PASSWORD", + "name": "Update Password", + "providerId": "UPDATE_PASSWORD", + "enabled": true, + "defaultAction": false, + "priority": 30, + "config": {} + }, + { + "alias": "UPDATE_PROFILE", + "name": "Update Profile", + "providerId": "UPDATE_PROFILE", + "enabled": true, + "defaultAction": false, + "priority": 40, + "config": {} + }, + { + "alias": "VERIFY_EMAIL", + "name": "Verify Email", + "providerId": "VERIFY_EMAIL", + "enabled": true, + "defaultAction": false, + "priority": 50, + "config": {} + }, + { + "alias": "delete_account", + "name": "Delete Account", + "providerId": "delete_account", + "enabled": false, + "defaultAction": false, + "priority": 60, + "config": {} + }, + { + "alias": "delete_credential", + "name": "Delete Credential", + "providerId": "delete_credential", + "enabled": true, + "defaultAction": false, + "priority": 100, + "config": {} + }, + { + "alias": "update_user_locale", + "name": "Update User Locale", + "providerId": "update_user_locale", + "enabled": true, + "defaultAction": false, + "priority": 1000, + "config": {} + } + ], + "browserFlow": "browser", + "registrationFlow": "registration", + "directGrantFlow": "direct grant", + "resetCredentialsFlow": "reset credentials", + "clientAuthenticationFlow": "clients", + "dockerAuthenticationFlow": "docker auth", + "firstBrokerLoginFlow": "first broker login", + "attributes": { + "cibaBackchannelTokenDeliveryMode": "poll", + "cibaAuthRequestedUserHint": "login_hint", + "clientOfflineSessionMaxLifespan": "0", + "oauth2DevicePollingInterval": "5", + "clientSessionIdleTimeout": "0", + "clientOfflineSessionIdleTimeout": "0", + "cibaInterval": "5", + "realmReusableOtpCode": "false", + "cibaExpiresIn": "120", + "oauth2DeviceCodeLifespan": "600", + "parRequestUriLifespan": "60", + "clientSessionMaxLifespan": "0", + "organizationsEnabled": "false" + }, + "keycloakVersion": "25.0.0", + "userManagedAccessAllowed": false, + "organizationsEnabled": false, + "clientProfiles": { + "profiles": [] + }, + "clientPolicies": { + "policies": [] + } +} diff --git a/config/keycloak/themes/opencloud/login/resources/css/theme.css b/config/keycloak/themes/opencloud/login/resources/css/theme.css new file mode 100644 index 0000000..4a52947 --- /dev/null +++ b/config/keycloak/themes/opencloud/login/resources/css/theme.css @@ -0,0 +1,38 @@ +:root { + --pf-global--primary-color--100: #e2baff; + --pf-global--primary-color--200: #e2baff; + --pf-global--primary-color--dark-100: #e2baff; + --pf-global--Color--light-100: #20434f; +} + +@font-face { + font-family: OpenCloud; + src: url('../fonts/OpenCloud500-Regular.woff2') format('woff2'); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: OpenCloud; + src: url('../fonts/OpenCloud750-Bold.woff2') format('woff2'); + font-weight: bold; + font-style: normal; +} + +body { + font-family: "OpenCloud", "Open Sans", Helvetica, Arial, sans-serif; + background: url(../img/background.png) no-repeat center !important; + background-size: cover !important; +} + +.kc-logo-text { + background-image: url(../img/logo.svg) !important; + background-size: contain; + width: 400px; + margin: 0 !important; +} + +#kc-header-wrapper{ + display: flex; + justify-content: center; +} \ No newline at end of file diff --git a/config/keycloak/themes/opencloud/login/resources/fonts/OpenCloud500-Regular.woff2 b/config/keycloak/themes/opencloud/login/resources/fonts/OpenCloud500-Regular.woff2 new file mode 100644 index 0000000..219abd8 Binary files /dev/null and b/config/keycloak/themes/opencloud/login/resources/fonts/OpenCloud500-Regular.woff2 differ diff --git a/config/keycloak/themes/opencloud/login/resources/fonts/OpenCloud750-Bold.woff2 b/config/keycloak/themes/opencloud/login/resources/fonts/OpenCloud750-Bold.woff2 new file mode 100644 index 0000000..1bc7076 Binary files /dev/null and b/config/keycloak/themes/opencloud/login/resources/fonts/OpenCloud750-Bold.woff2 differ diff --git a/config/keycloak/themes/opencloud/login/resources/img/background.png b/config/keycloak/themes/opencloud/login/resources/img/background.png new file mode 100644 index 0000000..9eaad2c Binary files /dev/null and b/config/keycloak/themes/opencloud/login/resources/img/background.png differ diff --git a/config/keycloak/themes/opencloud/login/resources/img/logo.svg b/config/keycloak/themes/opencloud/login/resources/img/logo.svg new file mode 100644 index 0000000..c8e40ea --- /dev/null +++ b/config/keycloak/themes/opencloud/login/resources/img/logo.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/config/keycloak/themes/opencloud/login/resources/js/script.js b/config/keycloak/themes/opencloud/login/resources/js/script.js new file mode 100644 index 0000000..9c1d516 --- /dev/null +++ b/config/keycloak/themes/opencloud/login/resources/js/script.js @@ -0,0 +1,19 @@ +document.addEventListener("DOMContentLoaded", function () { + const setLogoUrl = (url) => { + const logoTextSelector = document.querySelector(".kc-logo-text"); + + if (!logoTextSelector) { + return + } + + const link = document.createElement("a"); + link.href = url; + link.target = "_blank"; + + const parent = logoTextSelector.parentNode; + parent.insertBefore(link, logoTextSelector); + link.appendChild(logoTextSelector); + } + + setLogoUrl('https://opencloud.eu') +}); \ No newline at end of file diff --git a/config/keycloak/themes/opencloud/login/theme.properties b/config/keycloak/themes/opencloud/login/theme.properties new file mode 100644 index 0000000..767efe4 --- /dev/null +++ b/config/keycloak/themes/opencloud/login/theme.properties @@ -0,0 +1,5 @@ +parent=keycloak +import=common/keycloak + +styles=css/login.css css/theme.css +scripts=js/script.js \ No newline at end of file diff --git a/config/ldap/docker-entrypoint-override.sh b/config/ldap/docker-entrypoint-override.sh new file mode 100644 index 0000000..67dc850 --- /dev/null +++ b/config/ldap/docker-entrypoint-override.sh @@ -0,0 +1,9 @@ +#!/bin/bash +echo "Running custom LDAP entrypoint script..." + +if [ ! -f /opt/bitnami/openldap/share/openldap.key ] +then + openssl req -x509 -newkey rsa:4096 -keyout /opt/bitnami/openldap/share/openldap.key -out /opt/bitnami/openldap/share/openldap.crt -sha256 -days 365 -batch -nodes +fi +# run original docker-entrypoint +/opt/bitnami/scripts/openldap/entrypoint.sh "$@" diff --git a/config/ldap/init-ldap-acls.sh b/config/ldap/init-ldap-acls.sh new file mode 100755 index 0000000..8141a20 --- /dev/null +++ b/config/ldap/init-ldap-acls.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -eu + +# apply acls +echo -n "Applying acls... " +slapmodify -F /opt/bitnami/openldap/etc/slapd.d -b cn=config -l /opt/bitnami/openldap/etc/schema/50_acls.ldif +if [ $? -eq 0 ]; then + echo "done." +else + echo "failed." +fi diff --git a/config/ldap/ldif/10_base.ldif b/config/ldap/ldif/10_base.ldif new file mode 100644 index 0000000..3e4e418 --- /dev/null +++ b/config/ldap/ldif/10_base.ldif @@ -0,0 +1,24 @@ +dn: dc=opencloud,dc=eu +objectClass: organization +objectClass: dcObject +dc: opencloud +o: openCloud + +dn: ou=users,dc=opencloud,dc=eu +objectClass: organizationalUnit +ou: users + +dn: cn=admin,dc=opencloud,dc=eu +objectClass: inetOrgPerson +objectClass: person +cn: admin +sn: admin +uid: ldapadmin + +dn: ou=groups,dc=opencloud,dc=eu +objectClass: organizationalUnit +ou: groups + +dn: ou=custom,ou=groups,dc=opencloud,dc=eu +objectClass: organizationalUnit +ou: custom diff --git a/config/ldap/ldif/20_admin.ldif b/config/ldap/ldif/20_admin.ldif new file mode 100644 index 0000000..966cbea --- /dev/null +++ b/config/ldap/ldif/20_admin.ldif @@ -0,0 +1,20 @@ +dn: uid=admin,ou=users,dc=opencloud,dc=eu +objectClass: inetOrgPerson +objectClass: organizationalPerson +objectClass: person +objectClass: top +uid: admin +givenName: Admin +sn: Admin +cn: admin +displayName: Admin +description: An admin for this OpenCloud instance. +mail: admin@example.org +userPassword:: e1NTSEF9UWhmaFB3dERydTUydURoWFFObDRMbzVIckI3TkI5Nmo== + +dn: cn=administrators,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: administrators +description: OpenCloud Administrators +member: uid=admin,ou=users,dc=opencloud,dc=eu diff --git a/config/ldap/ldif/30_demo_users.ldif b/config/ldap/ldif/30_demo_users.ldif new file mode 100644 index 0000000..6ed0bdd --- /dev/null +++ b/config/ldap/ldif/30_demo_users.ldif @@ -0,0 +1,70 @@ +# Start dn with uid (user identifier / login), not cn (Firstname + Surname) +dn: uid=alan,ou=users,dc=opencloud,dc=eu +objectClass: inetOrgPerson +objectClass: organizationalPerson +objectClass: person +objectClass: top +uid: alan +givenName: Alan +sn: Turing +cn: alan +displayName: Alan Turing +description: An English mathematician, computer scientist, logician, cryptanalyst, philosopher and theoretical biologist. He was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine. +mail: alan@example.org +userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg= + +dn: uid=lynn,ou=users,dc=opencloud,dc=eu +objectClass: inetOrgPerson +objectClass: organizationalPerson +objectClass: person +objectClass: top +uid: lynn +givenName: Lynn +sn: Conway +cn: lynn +displayName: Lynn Conway +description: An American computer scientist, electrical engineer, and transgender activist. +mail: lynn@example.org +userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg= + +dn: uid=mary,ou=users,dc=opencloud,dc=eu +objectClass: inetOrgPerson +objectClass: organizationalPerson +objectClass: person +objectClass: top +uid: mary +givenName: Mary +sn: Kenneth Keller +cn: mary +displayName: Mary Kenneth Keller +description: Mary Kenneth Keller of the Sisters of Charity of the Blessed Virgin Mary was a pioneer in computer science. +mail: mary@example.org +userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg= + +dn: uid=margaret,ou=users,dc=opencloud,dc=eu +objectClass: inetOrgPerson +objectClass: organizationalPerson +objectClass: person +objectClass: top +uid: margaret +givenName: Margaret +sn: Hamilton +cn: margaret +displayName: Margaret Hamilton +description: A director of the Software Engineering Division of the MIT Instrumentation Laboratory, which developed on-board flight software for NASA's Apollo program. +mail: margaret@example.org +userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg= + +dn: uid=dennis,ou=users,dc=opencloud,dc=eu +objectClass: inetOrgPerson +objectClass: organizationalPerson +objectClass: person +objectClass: top +uid: dennis +givenName: Dennis +sn: Ritchie +cn: dennis +displayName: Dennis Ritchie +description: American computer scientist. He created the C programming language and the Unix operating system and B language with long-time colleague Ken Thompson. +mail: dennis@example.org +userPassword:: e1NTSEF9Y2ZMdVlqMTBDUFpLWE44VC9mQ0FzYnFHQmtyZExJeGg= diff --git a/config/ldap/ldif/40_demo_groups.ldif b/config/ldap/ldif/40_demo_groups.ldif new file mode 100644 index 0000000..28cf5a0 --- /dev/null +++ b/config/ldap/ldif/40_demo_groups.ldif @@ -0,0 +1,70 @@ +dn: cn=users,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: users +description: Users +member: uid=alan,ou=users,dc=opencloud,dc=eu +member: uid=mary,ou=users,dc=opencloud,dc=eu +member: uid=margaret,ou=users,dc=opencloud,dc=eu +member: uid=dennis,ou=users,dc=opencloud,dc=eu +member: uid=lynn,ou=users,dc=opencloud,dc=eu +member: uid=admin,ou=users,dc=opencloud,dc=eu + +dn: cn=chess-lovers,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: chess-lovers +description: Chess lovers +member: uid=alan,ou=users,dc=opencloud,dc=eu + +dn: cn=machine-lovers,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: machine-lovers +description: Machine Lovers +member: uid=alan,ou=users,dc=opencloud,dc=eu + +dn: cn=bible-readers,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: bible-readers +description: Bible readers +member: uid=mary,ou=users,dc=opencloud,dc=eu + +dn: cn=apollos,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: apollos +description: Contributors to the Apollo mission +member: uid=margaret,ou=users,dc=opencloud,dc=eu + +dn: cn=unix-lovers,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: unix-lovers +description: Unix lovers +member: uid=dennis,ou=users,dc=opencloud,dc=eu + +dn: cn=basic-haters,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: basic-haters +description: Haters of the Basic programming language +member: uid=dennis,ou=users,dc=opencloud,dc=eu + +dn: cn=vlsi-lovers,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: vlsi-lovers +description: Lovers of VLSI microchip design +member: uid=lynn,ou=users,dc=opencloud,dc=eu + +dn: cn=programmers,ou=groups,dc=opencloud,dc=eu +objectClass: groupOfNames +objectClass: top +cn: programmers +description: Computer Programmers +member: uid=alan,ou=users,dc=opencloud,dc=eu +member: uid=margaret,ou=users,dc=opencloud,dc=eu +member: uid=dennis,ou=users,dc=opencloud,dc=eu +member: uid=lynn,ou=users,dc=opencloud,dc=eu diff --git a/config/ldap/ldif/50_acls.ldif b/config/ldap/ldif/50_acls.ldif new file mode 100644 index 0000000..5698f73 --- /dev/null +++ b/config/ldap/ldif/50_acls.ldif @@ -0,0 +1,9 @@ +# OpenCloud ldap acl file which gets applied during the first db initialisation +dn: olcDatabase={2}mdb,cn=config +changetype: modify +replace: olcAccess +olcAccess: {0}to dn.subtree="dc=opencloud,dc=eu" attrs=entry,uid,objectClass,entryUUID + by * read +olcAccess: {1}to attrs=userPassword + by self write + by * auth diff --git a/config/ldap/schemas/10_opencloud_schema.ldif b/config/ldap/schemas/10_opencloud_schema.ldif new file mode 100644 index 0000000..faf2404 --- /dev/null +++ b/config/ldap/schemas/10_opencloud_schema.ldif @@ -0,0 +1,39 @@ +# This LDIF files describes the OpenCloud schema +dn: cn=opencloud,cn=schema,cn=config +objectClass: olcSchemaConfig +cn: opencloud +olcObjectIdentifier: openCloudOid 1.3.6.1.4.1.63016 +# We'll use openCloudOid:1 subarc for LDAP related stuff +# openCloudOid:1.1 for AttributeTypes and openCloudOid:1.2 for ObjectClasses +olcAttributeTypes: ( openCloudOid:1.1.1 NAME 'openCloudUUID' + DESC 'A non-reassignable and persistent account ID)' + EQUALITY uuidMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.1.16.1 SINGLE-VALUE ) +olcAttributeTypes: ( openCloudOid:1.1.2 NAME 'openCloudExternalIdentity' + DESC 'A triple separated by "$" representing the objectIdentity resource type of the Graph API ( signInType $ issuer $ issuerAssignedId )' + EQUALITY caseIgnoreMatch + SUBSTR caseIgnoreSubstringsMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) +olcAttributeTypes: ( openCloudOid:1.1.3 NAME 'openCloudUserEnabled' + DESC 'A boolean value indicating if the user is enabled' + EQUALITY booleanMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE) +olcAttributeTypes: ( openCloudOid:1.1.4 NAME 'openCloudUserType' + DESC 'User type (e.g. Member or Guest)' + EQUALITY caseIgnoreMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) +olcAttributeTypes: ( openCloudOid:1.1.5 NAME 'openCloudLastSignInTimestamp' + DESC 'The timestamp of the last sign-in' + EQUALITY generalizedTimeMatch + ORDERING generalizedTimeOrderingMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE ) +olcObjectClasses: ( openCloudOid:1.2.1 NAME 'openCloudObject' + DESC 'OpenCloud base objectclass' + AUXILIARY + MAY ( openCloudUUID ) ) +olcObjectClasses: ( openCloudOid:1.2.2 NAME 'openCloudUser' + DESC 'OpenCloud User objectclass' + SUP openCloudObject + AUXILIARY + MAY ( openCloudExternalIdentity $ openCloudUserEnabled $ openCloudUserType $ openCloudLastSignInTimestamp) ) diff --git a/config/opencloud/apps/.gitkeep b/config/opencloud/apps/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/opencloud/banned-password-list.txt b/config/opencloud/banned-password-list.txt new file mode 100644 index 0000000..934b181 --- /dev/null +++ b/config/opencloud/banned-password-list.txt @@ -0,0 +1,5 @@ +password +12345678 +123 +OpenCloud +OpenCloud-1 diff --git a/config/opencloud/csp.yaml b/config/opencloud/csp.yaml new file mode 100644 index 0000000..5ee27ed --- /dev/null +++ b/config/opencloud/csp.yaml @@ -0,0 +1,46 @@ +directives: + child-src: + - '''self''' + connect-src: + - '''self''' + - 'blob:' + - 'https://${COMPANION_DOMAIN|companion.opencloud.test}/' + - 'wss://${COMPANION_DOMAIN|companion.opencloud.test}/' + - 'https://raw.githubusercontent.com/opencloud-eu/awesome-apps/' + - 'https://${IDP_DOMAIN|keycloak.opencloud.test}/' + - 'https://update.opencloud.eu/' + default-src: + - '''none''' + font-src: + - '''self''' + frame-ancestors: + - '''self''' + frame-src: + - '''self''' + - 'blob:' + - 'https://embed.diagrams.net/' + # In contrary to bash and docker the default is given after the | character + - 'https://${COLLABORA_DOMAIN|collabora.opencloud.test}/' + # This is needed for the external-sites web extension when embedding sites + - 'https://docs.opencloud.eu' + img-src: + - '''self''' + - 'data:' + - 'blob:' + - 'https://raw.githubusercontent.com/opencloud-eu/awesome-apps/' + # In contrary to bash and docker the default is given after the | character + - 'https://${COLLABORA_DOMAIN|collabora.opencloud.test}/' + manifest-src: + - '''self''' + media-src: + - '''self''' + object-src: + - '''self''' + - 'blob:' + script-src: + - '''self''' + - '''unsafe-inline''' + - 'https://${IDP_DOMAIN|keycloak.opencloud.test}/' + style-src: + - '''self''' + - '''unsafe-inline''' diff --git a/config/opencloud/proxy.yaml b/config/opencloud/proxy.yaml new file mode 100644 index 0000000..93d34af --- /dev/null +++ b/config/opencloud/proxy.yaml @@ -0,0 +1,40 @@ +# This adds four additional routes to the proxy. Forwarding +# request on '/carddav/', '/caldav/' and the respective '/.well-knwown' +# endpoints to the radicale container and setting the required headers. +additional_policies: + - name: default + routes: + - endpoint: /caldav/ + backend: http://radicale:5232 + remote_user_header: X-Remote-User + skip_x_access_token: true + additional_headers: + - X-Script-Name: /caldav + - endpoint: /.well-known/caldav + backend: http://radicale:5232 + remote_user_header: X-Remote-User + skip_x_access_token: true + additional_headers: + - X-Script-Name: /caldav + - endpoint: /carddav/ + backend: http://radicale:5232 + remote_user_header: X-Remote-User + skip_x_access_token: true + additional_headers: + - X-Script-Name: /carddav + - endpoint: /.well-known/carddav + backend: http://radicale:5232 + remote_user_header: X-Remote-User + skip_x_access_token: true + additional_headers: + - X-Script-Name: /carddav +# To enable the radicale web UI add this rule. +# "unprotected" is True because the Web UI itself ask for +# the password. +# Also set "type" to "internal" in the config/radicale/config +# - endpoint: /caldav/.web/ +# backend: http://radicale:5232/ +# unprotected: true +# skip_x_access_token: true +# additional_headers: +# - X-Script-Name: /caldav diff --git a/config/postgres/init-db/init.sh b/config/postgres/init-db/init.sh new file mode 100755 index 0000000..c21d0eb --- /dev/null +++ b/config/postgres/init-db/init.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e +set -u + +function create_database_grant_privilege() { + local database=$1 + echo " Creating database '$database' and granting privileges to '$POSTGRES_USER'" + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL + CREATE DATABASE $database; + GRANT ALL PRIVILEGES ON DATABASE $database TO $POSTGRES_USER; +EOSQL +} + +if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then + echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES" + for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do + create_database_grant_privilege $db + done + echo "Multiple databases created" +fi \ No newline at end of file diff --git a/config/postgres/init.sql b/config/postgres/init.sql new file mode 100644 index 0000000..215d634 --- /dev/null +++ b/config/postgres/init.sql @@ -0,0 +1,2 @@ +CREATE DATABASE giteadb; +CREATE DATABASE odoodb; diff --git a/config/postgres/rotate-backups.sh b/config/postgres/rotate-backups.sh new file mode 100755 index 0000000..cdacbf0 --- /dev/null +++ b/config/postgres/rotate-backups.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -e + +TIMESTAMP=$(date +%Y%m%d_%H%M%S) + +# Backup Gitea +pg_dump -h db -U "$POSTGRES_ADMIN_USER" "$GITEA_DB" | gzip > /backups/backup_${TIMESTAMP}_gitea.dump.gz + +# Backup Odoo +pg_dump -h db -U "$POSTGRES_ADMIN_USER" "$ODOO_DB" | gzip > /backups/backup_${TIMESTAMP}_odoo.dump.gz + +# Send backups to nextcloud. Also could use rclone. +# Upload Gitea backup +curl -T /backups/backup_${TIMESTAMP}_gitea.dump.gz -u "$NEXTCLOUD_USER:$NEXTCLOUD_PASS" "$NEXTCLOUD_URL/remote.php/dav/files/$NEXTCLOUD_USER/gitea/backup_${TIMESTAMP}_gitea.dump.gz" + +# Upload Odoo backup +curl -T /backups/backup_${TIMESTAMP}_odoo.dump.gz -u "$NEXTCLOUD_USER:$NEXTCLOUD_PASS" "$NEXTCLOUD_URL/remote.php/dav/files/$NEXTCLOUD_USER/odoo/backup_${TIMESTAMP}_odoo.dump.gz" + +# Cleanup Gitea backups +ls -tp /backups/*_gitea.dump.gz | grep -v '/$' | tail -n +${BACKUP_RETAIN_COUNT:-10} | while read file; do + echo "$(date) Deleted Gitea backup: $file" >> /backups/cleanup.log + rm "$file" +done + +# Cleanup Odoo backups +ls -tp /backups/*_odoo.dump.gz | grep -v '/$' | tail -n +${BACKUP_RETAIN_COUNT:-10} | while read file; do + echo "$(date) Deleted Odoo backup: $file" >> /backups/cleanup.log + rm "$file" +done + +sleep 86400 diff --git a/config/radicale/config b/config/radicale/config new file mode 100644 index 0000000..56df156 --- /dev/null +++ b/config/radicale/config @@ -0,0 +1,325 @@ +# -*- mode: conf -*- +# vim:ft=cfg + +# Config file for Radicale - A simple calendar server +# +# Place it into /etc/radicale/config (global) +# or ~/.config/radicale/config (user) +# +# The current values are the default ones + + +[server] + +# CalDAV server hostnames separated by a comma +# IPv4 syntax: address:port +# IPv6 syntax: [address]:port +# Hostname syntax (using "getaddrinfo" to resolve to IPv4/IPv6 adress(es)): hostname:port +# For example: 0.0.0.0:9999, [::]:9999, localhost:9999 +hosts = 0.0.0.0:5232 + +# Max parallel connections +#max_connections = 8 + +# Max size of request body (bytes) +#max_content_length = 100000000 + +# Socket timeout (seconds) +#timeout = 30 + +# SSL flag, enable HTTPS protocol +#ssl = False + +# SSL certificate path +#certificate = /etc/ssl/radicale.cert.pem + +# SSL private key +#key = /etc/ssl/radicale.key.pem + +# CA certificate for validating clients. This can be used to secure +# TCP traffic between Radicale and a reverse proxy +#certificate_authority = + +# SSL protocol, secure configuration: ALL -SSLv3 -TLSv1 -TLSv1.1 +#protocol = (default) + +# SSL ciphersuite, secure configuration: DHE:ECDHE:-NULL:-SHA (see also "man openssl-ciphers") +#ciphersuite = (default) + +# script name to strip from URI if called by reverse proxy +#script_name = (default taken from HTTP_X_SCRIPT_NAME or SCRIPT_NAME) + + +[encoding] + +# Encoding for responding requests +#request = utf-8 + +# Encoding for storing local collections +#stock = utf-8 + + +[auth] + +# Authentication method +# Value: none | htpasswd | remote_user | http_x_remote_user | dovecot | ldap | oauth2 | pam | denyall +type = http_x_remote_user + +# Cache logins for until expiration time +#cache_logins = false + +# Expiration time for caching successful logins in seconds +#cache_successful_logins_expiry = 15 + +## Expiration time of caching failed logins in seconds +#cache_failed_logins_expiry = 90 + +# Ignore modifyTimestamp and createTimestamp attributes. Required e.g. for Authentik LDAP server +#ldap_ignore_attribute_create_modify_timestamp = false + +# URI to the LDAP server +#ldap_uri = ldap://localhost + +# The base DN where the user accounts have to be searched +#ldap_base = ##BASE_DN## + +# The reader DN of the LDAP server +#ldap_reader_dn = CN=ldapreader,CN=Users,##BASE_DN## + +# Password of the reader DN +#ldap_secret = ldapreader-secret + +# Path of the file containing password of the reader DN +#ldap_secret_file = /run/secrets/ldap_password + +# the attribute to read the group memberships from in the user's LDAP entry (default: not set) +#ldap_groups_attribute = memberOf + +# The filter to find the DN of the user. This filter must contain a python-style placeholder for the login +#ldap_filter = (&(objectClass=person)(uid={0})) + +# the attribute holding the value to be used as username after authentication +#ldap_user_attribute = cn + +# Use ssl on the ldap connection +# Soon to be deprecated, use ldap_security instead +#ldap_use_ssl = False + +# the encryption mode to be used: tls, starttls, default is none +#ldap_security = none + +# The certificate verification mode. Works for ssl and starttls. NONE, OPTIONAL, default is REQUIRED +#ldap_ssl_verify_mode = REQUIRED + +# The path to the CA file in pem format which is used to certificate the server certificate +#ldap_ssl_ca_file = + +# Connection type for dovecot authentication (AF_UNIX|AF_INET|AF_INET6) +# Note: credentials are transmitted in cleartext +#dovecot_connection_type = AF_UNIX + +# The path to the Dovecot client authentication socket (eg. /run/dovecot/auth-client on Fedora). Radicale must have read / write access to the socket. +#dovecot_socket = /var/run/dovecot/auth-client + +# Host of via network exposed dovecot socket +#dovecot_host = localhost + +# Port of via network exposed dovecot socket +#dovecot_port = 12345 + +# IMAP server hostname +# Syntax: address | address:port | [address]:port | imap.server.tld +#imap_host = localhost + +# Secure the IMAP connection +# Value: tls | starttls | none +#imap_security = tls + +# OAuth2 token endpoint URL +#oauth2_token_endpoint = + +# PAM service +#pam_serivce = radicale + +# PAM group user should be member of +#pam_group_membership = + +# Htpasswd filename +#htpasswd_filename = /etc/radicale/users + +# Htpasswd encryption method +# Value: plain | bcrypt | md5 | sha256 | sha512 | autodetect +# bcrypt requires the installation of 'bcrypt' module. +#htpasswd_encryption = autodetect + +# Enable caching of htpasswd file based on size and mtime_ns +#htpasswd_cache = False + +# Incorrect authentication delay (seconds) +#delay = 1 + +# Message displayed in the client when a password is needed +#realm = Radicale - Password Required + +# Convert username to lowercase, must be true for case-insensitive auth providers +#lc_username = False + +# Strip domain name from username +#strip_domain = False + + +[rights] + +# Rights backend +# Value: authenticated | owner_only | owner_write | from_file +#type = owner_only + +# File for rights management from_file +#file = /etc/radicale/rights + +# Permit delete of a collection (global) +#permit_delete_collection = True + +# Permit overwrite of a collection (global) +#permit_overwrite_collection = True + + +[storage] + +# Storage backend +# Value: multifilesystem | multifilesystem_nolock +#type = multifilesystem + +# Folder for storing local collections, created if not present +#filesystem_folder = /var/lib/radicale/collections + +# Folder for storing cache of local collections, created if not present +# Note: only used in case of use_cache_subfolder_* options are active +# Note: can be used on multi-instance setup to cache files on local node (see below) +#filesystem_cache_folder = (filesystem_folder) + +# Use subfolder 'collection-cache' for 'item' cache file structure instead of inside collection folder +# Note: can be used on multi-instance setup to cache 'item' on local node +#use_cache_subfolder_for_item = False + +# Use subfolder 'collection-cache' for 'history' cache file structure instead of inside collection folder +# Note: use only on single-instance setup, will break consistency with client in multi-instance setup +#use_cache_subfolder_for_history = False + +# Use subfolder 'collection-cache' for 'sync-token' cache file structure instead of inside collection folder +# Note: use only on single-instance setup, will break consistency with client in multi-instance setup +#use_cache_subfolder_for_synctoken = False + +# Use last modifiction time (nanoseconds) and size (bytes) for 'item' cache instead of SHA256 (improves speed) +# Note: check used filesystem mtime precision before enabling +# Note: conversion is done on access, bulk conversion can be done offline using storage verification option: radicale --verify-storage +#use_mtime_and_size_for_item_cache = False + +# Use configured umask for folder creation (not applicable for OS Windows) +# Useful value: 0077 | 0027 | 0007 | 0022 +#folder_umask = (system default, usual 0022) + +# Delete sync token that are older (seconds) +#max_sync_token_age = 2592000 + +# Skip broken item instead of triggering an exception +#skip_broken_item = True + +# Command that is run after changes to storage, default is emtpy +# Supported placeholders: +# %(user)s: logged-in user +# %(cwd)s : current working directory +# %(path)s: full path of item +# Command will be executed with base directory defined in filesystem_folder +# For "git" check DOCUMENTATION.md for bootstrap instructions +# Example(test): echo \"user=%(user)s path=%(path)s cwd=%(cwd)s\" +# Example(git): git add -A && (git diff --cached --quiet || git commit -m "Changes by \"%(user)s\"") +#hook = + +# Create predefined user collections +# +# json format: +# +# { +# "def-addressbook": { +# "D:displayname": "Personal Address Book", +# "tag": "VADDRESSBOOK" +# }, +# "def-calendar": { +# "C:supported-calendar-component-set": "VEVENT,VJOURNAL,VTODO", +# "D:displayname": "Personal Calendar", +# "tag": "VCALENDAR" +# } +# } +# +predefined_collections = { + "def-addressbook": { + "D:displayname": "Personal Address Book", + "tag": "VADDRESSBOOK" + }, + "def-calendar": { + "C:supported-calendar-component-set": "VEVENT,VJOURNAL,VTODO", + "D:displayname": "Personal Calendar", + "tag": "VCALENDAR" + } + } + + +[web] + +# Web interface backend +# Value: none | internal +type = none + + +[logging] + +# Threshold for the logger +# Value: debug | info | warning | error | critical +#level = info + +# Don't include passwords in logs +#mask_passwords = True + +# Log bad PUT request content +#bad_put_request_content = False + +# Log backtrace on level=debug +#backtrace_on_debug = False + +# Log request header on level=debug +#request_header_on_debug = False + +# Log request content on level=debug +#request_content_on_debug = False + +# Log response content on level=debug +#response_content_on_debug = False + +# Log rights rule which doesn't match on level=debug +#rights_rule_doesnt_match_on_debug = False + +# Log storage cache actions on level=debug +#storage_cache_actions_on_debug = False + +[headers] + +# Additional HTTP headers +#Access-Control-Allow-Origin = * + + +[hook] + +# Hook types +# Value: none | rabbitmq +#type = none +#rabbitmq_endpoint = +#rabbitmq_topic = +#rabbitmq_queue_type = classic + + +[reporting] + +# When returning a free-busy report, limit the number of returned +# occurences per event to prevent DOS attacks. +#max_freebusy_occurrence = 10000 diff --git a/config/traefik/docker-entrypoint-override.sh b/config/traefik/docker-entrypoint-override.sh new file mode 100644 index 0000000..456a62d --- /dev/null +++ b/config/traefik/docker-entrypoint-override.sh @@ -0,0 +1,72 @@ +set -e + +printenv +# Function to add arguments to the command +add_arg() { + TRAEFIK_CMD="$TRAEFIK_CMD $1" +} + +# Initialize the base command +TRAEFIK_CMD="traefik" + +# Base Traefik arguments (from your existing configuration) +add_arg "--log.level=${TRAEFIK_LOG_LEVEL:-ERROR}" +# enable dashboard +add_arg "--api.dashboard=true" +# define entrypoints +add_arg "--entryPoints.http.address=:80" +add_arg "--entryPoints.http.http.redirections.entryPoint.to=https" +add_arg "--entryPoints.http.http.redirections.entryPoint.scheme=https" +add_arg "--entryPoints.https.address=:443" +# change default timeouts for long-running requests +# this is needed for webdav clients that do not support the TUS protocol +add_arg "--entryPoints.https.transport.respondingTimeouts.readTimeout=12h" +add_arg "--entryPoints.https.transport.respondingTimeouts.writeTimeout=12h" +add_arg "--entryPoints.https.transport.respondingTimeouts.idleTimeout=3m" +# docker provider (get configuration from container labels) +add_arg "--providers.docker.endpoint=unix:///var/run/docker.sock" +add_arg "--providers.docker.exposedByDefault=false" +# access log +add_arg "--accessLog=${TRAEFIK_ACCESS_LOG:-false}" +add_arg "--accessLog.format=json" +add_arg "--accessLog.fields.headers.names.X-Request-Id=keep" + +# Add Let's Encrypt configuration if enabled +if [ "${TRAEFIK_SERVICES_TLS_CONFIG}" = "tls.certresolver=letsencrypt" ]; then + echo "Configuring Traefik with Let's Encrypt..." + add_arg "--certificatesResolvers.letsencrypt.acme.email=${TRAEFIK_ACME_MAIL:-example@example.org}" + add_arg "--certificatesResolvers.letsencrypt.acme.storage=/certs/acme.json" + add_arg "--certificatesResolvers.letsencrypt.acme.httpChallenge.entryPoint=http" + add_arg "--certificatesResolvers.letsencrypt.acme.caserver=${TRAEFIK_ACME_CASERVER:-https://acme-v02.api.letsencrypt.org/directory}" +fi + +# Add local certificate configuration if enabled +if [ "${TRAEFIK_SERVICES_TLS_CONFIG}" = "tls=true" ]; then + echo "Configuring Traefik with local certificates..." + add_arg "--providers.file.directory=/etc/traefik/dynamic" + add_arg "--providers.file.watch=true" +fi + +# Warning if neither certificate method is enabled +if [ "${TRAEFIK_SERVICES_TLS_CONFIG}" != "tls=true" ] && [ "${TRAEFIK_SERVICES_TLS_CONFIG}" != "tls.certresolver=letsencrypt" ]; then + echo "WARNING: Neither Let's Encrypt nor local certificates are enabled." + echo "HTTPS will not work properly without certificate configuration." +fi + +# Add any custom arguments from environment variable +if [ -n "${TRAEFIK_CUSTOM_ARGS}" ]; then + echo "Adding custom Traefik arguments: ${TRAEFIK_CUSTOM_ARGS}" + TRAEFIK_CMD="$TRAEFIK_CMD $TRAEFIK_CUSTOM_ARGS" +fi + +# Add any additional arguments passed to the script +for arg in "$@"; do + add_arg "$arg" +done + +# Print the final command for debugging +echo "Starting Traefik with command:" +echo "$TRAEFIK_CMD" + +# Execute Traefik +exec $TRAEFIK_CMD diff --git a/config/traefik/dynamic/.gitkeep b/config/traefik/dynamic/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/database/postgres.yml b/database/postgres.yml new file mode 100644 index 0000000..2b1d773 --- /dev/null +++ b/database/postgres.yml @@ -0,0 +1,42 @@ +--- +services: + gitea: + depends_on: + postgres: + condition: service_healthy + odoo: + depends_on: + postgres: + condition: service_healthy + + odoo-init: + depends_on: + postgres: + condition: service_healthy + + postgres: + image: postgres:18-alpine + container_name: postgres + restart: on-failure + volumes: + - pgdata:/var/lib/postgresql + - ./scripts/postgres/init-db:/docker-entrypoint-initdb.d:ro + environment: + POSTGRES_USER: ${POSTGRES_ADMIN_USER} + POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD} + # Gitea dedicated DB and user (defaults provided if env vars are not set) + GITEA_DB: ${GITEA_DB:-giteadb} + GITEA_DB_USER: ${GITEA_DB_USER:-gitea} + GITEA_DB_PASSWORD: ${GITEA_DB_PASSWORD:-giteapass} + # Odoo dedicated DB and user (defaults provided if env vars are not set) + ODOO_DB: ${ODOO_DB:-odoodb} + ODOO_DB_USER: ${ODOO_DB_USER:-odoo} + ODOO_DB_PASSWORD: ${ODOO_DB_PASSWORD:-odoopass} + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_ADMIN_USER}"] + interval: 5s + timeout: 5s + retries: 5 + +volumes: + pgdata: \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c9f375a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +name: selfhost +--- +services: + traefik: + image: traefik:v3 + container_name: traefik + entrypoint: [ "/bin/sh", "/opt/traefik/bin/docker-entrypoint-override.sh"] + environment: + - "TRAEFIK_SERVICES_TLS_CONFIG=${TRAEFIK_SERVICES_TLS_CONFIG:-tls.certresolver=letsencrypt}" + - "TRAEFIK_ACME_MAIL=${TRAEFIK_ACME_MAIL:-example@example.org}" + - "TRAEFIK_ACME_CASERVER=${TRAEFIK_ACME_CASERVER:-https://acme-v02.api.letsencrypt.org/directory}" + - "TRAEFIK_LOG_LEVEL=${TRAEFIK_LOG_LEVEL:-ERROR}" + - "TRAEFIK_ACCESS_LOG=${TRAEFIK_ACCESS_LOG:-false}" + ports: + - "80:80" + - "443:443" + volumes: + - "${DOCKER_SOCKET_PATH:-/var/run/docker.sock}:/var/run/docker.sock:ro" + - "./config/traefik/docker-entrypoint-override.sh:/opt/traefik/bin/docker-entrypoint-override.sh" + - "${TRAEFIK_CERTS_DIR:-./certs}:/certs" + - "./config/traefik/dynamic:/etc/traefik/dynamic" + labels: + - "traefik.enable=${TRAEFIK_DASHBOARD:-false}" + - "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_BASIC_AUTH_USERS:-admin:$$apr1$$4vqie50r$$YQAmQdtmz5n9rEALhxJ4l.}" + - "traefik.http.routers.traefik.entrypoints=https" + - "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DOMAIN:-traefik.opencloud.test}`)" + - "traefik.http.routers.traefik.middlewares=traefik-auth" + - "traefik.http.routers.traefik.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.traefik.service=api@internal" + logging: + driver: ${LOG_DRIVER:-local} + restart: always diff --git a/external-proxy/collabora.yml b/external-proxy/collabora.yml new file mode 100644 index 0000000..3a16c43 --- /dev/null +++ b/external-proxy/collabora.yml @@ -0,0 +1,10 @@ +--- +services: + collaboration: + ports: + # expose the wopi server + - "9300:9300" + collabora: + ports: + # expose the collabora server + - "9980:9980" diff --git a/external-proxy/keycloak.yml b/external-proxy/keycloak.yml new file mode 100644 index 0000000..8f59ca0 --- /dev/null +++ b/external-proxy/keycloak.yml @@ -0,0 +1,6 @@ + +services: + keycloak: + ports: + - "9000:9000" + - "8080:8080" diff --git a/external-proxy/opencloud.yml b/external-proxy/opencloud.yml new file mode 100644 index 0000000..121c51d --- /dev/null +++ b/external-proxy/opencloud.yml @@ -0,0 +1,9 @@ +--- +services: + opencloud: + environment: + # bind to all interfaces + PROXY_HTTP_ADDR: "0.0.0.0:9200" + ports: + # expose the opencloud server + - "9200:9200" diff --git a/idm/external-authelia.yml b/idm/external-authelia.yml new file mode 100644 index 0000000..bc42d07 --- /dev/null +++ b/idm/external-authelia.yml @@ -0,0 +1,36 @@ +--- +services: + opencloud: + environment: + # enable opaque access tokens + PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: "none" + PROXY_OIDC_SKIP_VERIFICATION: "false" + + # Enable authelia usernames as username in OpenCloud (instead of an id) + # PROXY_USER_OIDC_CLAIM: "preferred_username" + # PROXY_AUTOPROVISION_CLAIM_USERNAME: "preferred_username" + + PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM: "groups" + WEB_OIDC_SCOPE: "openid profile email groups" + + # The desktop client currently doesn't work when oidc assignment driver is used : https://github.com/opencloud-eu/desktop/issues/217 + # That's why you only can use it to bootstrap your admin user currently (if you want to use the desktop client). + # + # 1. *Before* first startup: Switch to `PROXY_ROLE_ASSIGNMENT_DRIVER: "oidc"` + # 2. Start opencloud container to generate initial config: `docker compose up -d` + # 3. Map the `opencloud-admin` group from authelia to the `admin` role from OpenCloud in opencloud-config/opencloud.yaml : + # + # proxy: + # role_assignment: + # oidc_role_mapper: + # role_claim: groups + # role_mapping: + # - role_name: admin + # claim_value: opencloud-admin + # + # 4. Restart opencloud container: `docker compose restart opencloud` + # 5. Login with your admin user (the one with the `opencloud-admin` group) + # 6. Switch back to `PROXY_ROLE_ASSIGNMENT_DRIVER: "default"`` + # 7. Recreate opencloud container: `docker compose up -d opencloud` + PROXY_ROLE_ASSIGNMENT_DRIVER: "default" + GRAPH_ASSIGN_DEFAULT_USER_ROLE: "true" diff --git a/idm/external-idp.yml b/idm/external-idp.yml new file mode 100644 index 0000000..ff8a6a4 --- /dev/null +++ b/idm/external-idp.yml @@ -0,0 +1,72 @@ +--- +services: + opencloud: + environment: + # Ldap IDP specific configuration + OC_LDAP_URI: ldaps://ldap-server:1636 + OC_LDAP_INSECURE: "true" + OC_LDAP_BIND_DN: "cn=admin,dc=opencloud,dc=eu" + OC_LDAP_BIND_PASSWORD: ${LDAP_BIND_PASSWORD:-admin} + OC_LDAP_GROUP_BASE_DN: "ou=groups,dc=opencloud,dc=eu" + OC_LDAP_USER_BASE_DN: "ou=users,dc=opencloud,dc=eu" + OC_LDAP_USER_FILTER: "(objectclass=inetOrgPerson)" + GRAPH_LDAP_SERVER_UUID: "false" + GRAPH_LDAP_REFINT_ENABLED: "true" # osixia has refint enabled. + FRONTEND_READONLY_USER_ATTRIBUTES: "user.onPremisesSamAccountName,user.displayName,user.mail,user.passwordProfile,user.accountEnabled,user.appRoleAssignments" + PROXY_OIDC_REWRITE_WELLKNOWN: "true" + WEB_OIDC_CLIENT_ID: ${OC_OIDC_CLIENT_ID:-web} + PROXY_ROLE_ASSIGNMENT_DRIVER: "oidc" + OC_OIDC_ISSUER: ${IDP_ISSUER_URL:-https://keycloak.opencloud.test/realms/openCloud} + # This specifies to start all services except idm and idp. These are replaced by external services. + OC_EXCLUDE_RUN_SERVICES: idm,idp + # IdP specific configuration for auto-provisioning + OC_LDAP_SERVER_WRITE_ENABLED: "true" + PROXY_AUTOPROVISION_ACCOUNTS: "true" + # Use the `sub` claim from the IdP for the user ID + # Most IdPs use the internal user ID as the `sub` claim + PROXY_USER_OIDC_CLAIM: "sub" + # Use the `sub` claim as identifier during autoprovisioning + # That mitigates problems when a user is renamed in the IdP + PROXY_AUTOPROVISION_CLAIM_USERNAME: "sub" + PROXY_USER_CS3_CLAIM: "username" + # This is the default value, we need to set it here because we overwrite the values + OC_LDAP_USER_SCHEMA_ID: "opencloudUUID" + # This is the default value, we need to set it here because we overwrite the values + OC_LDAP_GROUP_SCHEMA_ID: "opencloudUUID" + # This is the default value, we need to set it here because we overwrite the values + OC_LDAP_DISABLE_USER_MECHANISM: "attribute" + OC_ADMIN_USER_ID: "" + SETTINGS_SETUP_DEFAULT_ASSIGNMENTS: "false" + GRAPH_ASSIGN_DEFAULT_USER_ROLE: "false" + GRAPH_USERNAME_MATCH: "none" + # We need to set the IDP_DOMAIN to allow the CSP rules to be set correctly + IDP_DOMAIN: ${IDP_DOMAIN:-keycloak.opencloud.test} + # The openCloud users need to be able to edit their account in the externa IdP + WEB_OPTION_ACCOUNT_EDIT_LINK_HREF: ${IDP_ACCOUNT_URL} + ldap-server: + image: bitnamilegacy/openldap:2.6 + networks: + opencloud-net: + entrypoint: [ "/bin/sh", "/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh", "/opt/bitnami/scripts/openldap/run.sh" ] + environment: + BITNAMI_DEBUG: true + LDAP_TLS_VERIFY_CLIENT: never + LDAP_ENABLE_TLS: "yes" + LDAP_TLS_CA_FILE: /opt/bitnami/openldap/share/openldap.crt + LDAP_TLS_CERT_FILE: /opt/bitnami/openldap/share/openldap.crt + LDAP_TLS_KEY_FILE: /opt/bitnami/openldap/share/openldap.key + LDAP_ROOT: "dc=opencloud,dc=eu" + LDAP_ADMIN_PASSWORD: ${LDAP_BIND_PASSWORD:-admin} + volumes: + # Only use the base ldif file to create the base structure + - ./config/ldap/ldif/10_base.ldif:/ldifs/10_base.ldif + # Use the custom schema from opencloud because we are in full control of the ldap server + - ./config/ldap/schemas/10_opencloud_schema.ldif:/schemas/10_opencloud_schema.ldif + - ./config/ldap/docker-entrypoint-override.sh:/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh + - ${LDAP_CERTS_DIR:-ldap-certs}:/opt/bitnami/openldap/share + - ${LDAP_DATA_DIR:-ldap-data}:/bitnami/openldap + restart: always + +volumes: + ldap-certs: + ldap-data: diff --git a/idm/ldap-keycloak.yml b/idm/ldap-keycloak.yml new file mode 100644 index 0000000..038b049 --- /dev/null +++ b/idm/ldap-keycloak.yml @@ -0,0 +1,112 @@ +--- +services: + opencloud: + environment: + # Ldap IDP specific configuration + OC_LDAP_URI: ldaps://ldap-server:1636 + OC_LDAP_INSECURE: "true" + OC_LDAP_BIND_DN: "cn=admin,dc=opencloud,dc=eu" + OC_LDAP_BIND_PASSWORD: ${LDAP_BIND_PASSWORD:-admin} + OC_LDAP_GROUP_BASE_DN: "ou=groups,dc=opencloud,dc=eu" + OC_LDAP_GROUP_SCHEMA_ID: "entryUUID" + OC_LDAP_USER_BASE_DN: "ou=users,dc=opencloud,dc=eu" + OC_LDAP_USER_FILTER: "(objectclass=inetOrgPerson)" + OC_LDAP_USER_SCHEMA_ID: "entryUUID" + OC_LDAP_DISABLE_USER_MECHANISM: "none" + GRAPH_LDAP_SERVER_UUID: "true" + GRAPH_LDAP_GROUP_CREATE_BASE_DN: "ou=custom,ou=groups,dc=opencloud,dc=eu" + GRAPH_LDAP_REFINT_ENABLED: "true" # osixia has refint enabled. + FRONTEND_READONLY_USER_ATTRIBUTES: "user.onPremisesSamAccountName,user.displayName,user.mail,user.passwordProfile,user.accountEnabled,user.appRoleAssignments" + OC_LDAP_SERVER_WRITE_ENABLED: "false" # the ldap is managed by Keycloak, so it is not writable by OpenCloud + # This specifies to start all services except idm and idp. These are replaced by external services. + OC_EXCLUDE_RUN_SERVICES: idm,idp + # Keycloak IDP specific configuration + PROXY_AUTOPROVISION_ACCOUNTS: "false" + PROXY_ROLE_ASSIGNMENT_DRIVER: "oidc" + OC_OIDC_ISSUER: https://${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}/realms/openCloud + PROXY_OIDC_REWRITE_WELLKNOWN: "true" + WEB_OIDC_CLIENT_ID: ${OC_OIDC_CLIENT_ID:-web} + PROXY_USER_OIDC_CLAIM: "uuid" + PROXY_USER_CS3_CLAIM: "userid" + WEB_OPTION_ACCOUNT_EDIT_LINK_HREF: "https://${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}/realms/openCloud/account" + # admin and demo accounts must be created in Keycloak + OC_ADMIN_USER_ID: "" + SETTINGS_SETUP_DEFAULT_ASSIGNMENTS: "false" + GRAPH_ASSIGN_DEFAULT_USER_ROLE: "false" + GRAPH_USERNAME_MATCH: "none" + # This is needed to set the correct CSP rules for OpenCloud + IDP_DOMAIN: ${KEYCLOAK_DOMAIN:-keycloak.opencloud.test} + + ldap-server: + image: bitnamilegacy/openldap:2.6 + networks: + opencloud-net: + entrypoint: [ "/bin/sh", "/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh", "/opt/bitnami/scripts/openldap/run.sh" ] + environment: + BITNAMI_DEBUG: true + LDAP_TLS_VERIFY_CLIENT: never + LDAP_ENABLE_TLS: "yes" + LDAP_TLS_CA_FILE: /opt/bitnami/openldap/share/openldap.crt + LDAP_TLS_CERT_FILE: /opt/bitnami/openldap/share/openldap.crt + LDAP_TLS_KEY_FILE: /opt/bitnami/openldap/share/openldap.key + LDAP_ROOT: "dc=opencloud,dc=eu" + LDAP_ADMIN_PASSWORD: ${LDAP_BIND_PASSWORD:-admin} + volumes: + - ./config/ldap/ldif/10_base.ldif:/ldifs/10_base.ldif + - ./config/ldap/ldif/20_admin.ldif:/ldifs/20_admin.ldif + - ./config/ldap/ldif/50_acls.ldif:/opt/bitnami/openldap/etc/schema/50_acls.ldif + - ./config/ldap/init-ldap-acls.sh:/docker-entrypoint-initdb.d/init-ldap-acls.sh + - ./config/ldap/docker-entrypoint-override.sh:/opt/bitnami/scripts/openldap/docker-entrypoint-override.sh + - ldap-certs:/opt/bitnami/openldap/share + - ldap-data:/bitnami/openldap + logging: + driver: ${LOG_DRIVER:-local} + restart: always + + postgres: + image: postgres:17-alpine + networks: + opencloud-net: + volumes: + - keycloak_postgres_data:/var/lib/postgresql/data + environment: + POSTGRES_DB: keycloak + POSTGRES_USER: ${KC_DB_USERNAME:-keycloak} + POSTGRES_PASSWORD: ${KC_DB_PASSWORD:-keycloak} + logging: + driver: ${LOG_DRIVER:-local} + restart: always + + keycloak: + image: quay.io/keycloak/keycloak:26.3.3 + networks: + opencloud-net: + command: [ "start", "--spi-connections-http-client-default-disable-trust-manager=${INSECURE:-false}", "--import-realm" ] + entrypoint: [ "/bin/sh", "/opt/keycloak/bin/docker-entrypoint-override.sh" ] + volumes: + - "./config/keycloak/docker-entrypoint-override.sh:/opt/keycloak/bin/docker-entrypoint-override.sh" + - "./config/keycloak/opencloud-realm.dist.json:/opt/keycloak/data/import-dist/openCloud-realm.json" + - "./config/keycloak/themes/opencloud:/opt/keycloak/themes/opencloud" + environment: + LDAP_ADMIN_PASSWORD: ${LDAP_BIND_PASSWORD:-admin} + OC_DOMAIN: ${OC_DOMAIN:-cloud.opencloud.test} + KC_HOSTNAME: ${KEYCLOAK_DOMAIN:-keycloak.opencloud.test} + KC_DB: postgres + KC_DB_URL: "jdbc:postgresql://postgres:5432/keycloak" + KC_DB_USERNAME: ${KC_DB_USERNAME:-keycloak} + KC_DB_PASSWORD: ${KC_DB_PASSWORD:-keycloak} + KC_FEATURES: impersonation + KC_PROXY_HEADERS: xforwarded + KC_HTTP_ENABLED: true + KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-kcadmin} + KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin} + depends_on: + - postgres + logging: + driver: ${LOG_DRIVER:-local} + restart: always + +volumes: + keycloak_postgres_data: + ldap-certs: + ldap-data: diff --git a/monitoring/monitoring-collaboration.yml b/monitoring/monitoring-collaboration.yml new file mode 100644 index 0000000..948c45b --- /dev/null +++ b/monitoring/monitoring-collaboration.yml @@ -0,0 +1,7 @@ +--- + +services: + collaboration: + environment: + # metrics + COLLABORATION_DEBUG_ADDR: 0.0.0.0:9304 diff --git a/monitoring/monitoring.yml b/monitoring/monitoring.yml new file mode 100644 index 0000000..ce7c93b --- /dev/null +++ b/monitoring/monitoring.yml @@ -0,0 +1,13 @@ +--- + +services: + opencloud: + environment: + # metrics + # if OpenCloud runs as a single process, all /metrics endpoints + # will expose the same metrics, so it's sufficient to query one endpoint + PROXY_DEBUG_ADDR: 0.0.0.0:9205 + +networks: + opencloud-net: + external: true \ No newline at end of file diff --git a/odoo/addons/project_html_rtl/__init__.py b/odoo/addons/project_html_rtl/__init__.py new file mode 100644 index 0000000..54376c0 --- /dev/null +++ b/odoo/addons/project_html_rtl/__init__.py @@ -0,0 +1,7 @@ +from . import hooks +from . import models + + +def post_init(cr, registry): + """Post install hook proxy for older Odoo hooks invocation style.""" + hooks.post_init(cr, registry) diff --git a/odoo/addons/project_html_rtl/__manifest__.py b/odoo/addons/project_html_rtl/__manifest__.py new file mode 100644 index 0000000..a5c1e19 --- /dev/null +++ b/odoo/addons/project_html_rtl/__manifest__.py @@ -0,0 +1,18 @@ +{ + "name": "Project HTML editor + RTL", + "version": "1.0.0", + "summary": "Enable HTML editor for project task descriptions and notes, and force RTL when needed", + "description": "This small addon configures project task description fields to use the HTML editor and injects a small JS to enable RTL rendering in the editor on project task forms.", + "category": "Project", + "author": "Automated", + "depends": ["project", "html_editor"], + "license": "LGPL-3", + "data": [ + "views/project_task_view.xml", + ], + "installable": True, + "application": False, + "assets": { + "web.assets_backend": ["project_html_rtl/static/src/js/html_field_patch.js"], + }, +} diff --git a/odoo/addons/project_html_rtl/__pycache__/__init__.cpython-312.pyc b/odoo/addons/project_html_rtl/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..ca0e20d Binary files /dev/null and b/odoo/addons/project_html_rtl/__pycache__/__init__.cpython-312.pyc differ diff --git a/odoo/addons/project_html_rtl/__pycache__/hooks.cpython-312.pyc b/odoo/addons/project_html_rtl/__pycache__/hooks.cpython-312.pyc new file mode 100644 index 0000000..8497632 Binary files /dev/null and b/odoo/addons/project_html_rtl/__pycache__/hooks.cpython-312.pyc differ diff --git a/odoo/addons/project_html_rtl/hooks.py b/odoo/addons/project_html_rtl/hooks.py new file mode 100644 index 0000000..c8063a5 --- /dev/null +++ b/odoo/addons/project_html_rtl/hooks.py @@ -0,0 +1,5 @@ +def post_init(cr, registry): + # Lightweight post-init: nothing heavy here. This placeholder can be + # extended later if database changes are desired at install time. + # Keep this simple to avoid unexpected side-effects. + print("project_html_rtl: post_init hook called") diff --git a/odoo/addons/project_html_rtl/models/__init__.py b/odoo/addons/project_html_rtl/models/__init__.py new file mode 100644 index 0000000..edf2d36 --- /dev/null +++ b/odoo/addons/project_html_rtl/models/__init__.py @@ -0,0 +1 @@ +from . import project_task diff --git a/odoo/addons/project_html_rtl/models/__pycache__/__init__.cpython-312.pyc b/odoo/addons/project_html_rtl/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..0ec5077 Binary files /dev/null and b/odoo/addons/project_html_rtl/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/odoo/addons/project_html_rtl/models/__pycache__/project_task.cpython-312.pyc b/odoo/addons/project_html_rtl/models/__pycache__/project_task.cpython-312.pyc new file mode 100644 index 0000000..5d47fe6 Binary files /dev/null and b/odoo/addons/project_html_rtl/models/__pycache__/project_task.cpython-312.pyc differ diff --git a/odoo/addons/project_html_rtl/models/project_task.py b/odoo/addons/project_html_rtl/models/project_task.py new file mode 100644 index 0000000..02da110 --- /dev/null +++ b/odoo/addons/project_html_rtl/models/project_task.py @@ -0,0 +1,11 @@ +from odoo import models, fields + + +class ProjectTask(models.Model): + _inherit = "project.task" + + rtl_enable = fields.Boolean( + string="Force RTL in HTML editor", + help="When set, the HTML editor on this task will render in right-to-left direction", + default=False, + ) diff --git a/odoo/addons/project_html_rtl/static/src/js/editor_rtl.js.bak b/odoo/addons/project_html_rtl/static/src/js/editor_rtl.js.bak new file mode 100644 index 0000000..c1be95c --- /dev/null +++ b/odoo/addons/project_html_rtl/static/src/js/editor_rtl.js.bak @@ -0,0 +1,178 @@ +/** + * Small script to force RTL direction on HTML editors inside project task forms. + * It finds HTML editor fields added by our view extension and sets dir="rtl" on + * the editable area so the editor displays in right-to-left mode. + */ +(function () { + 'use strict'; + + function setEditorRTL() { + // Target editable areas that we marked via the view (data-project-html="1") + var elems = document.querySelectorAll('[data-project-html="1"]'); + elems.forEach(function (el) { + var editable = el.querySelector('[contenteditable]'); + var shouldRTL = false; + // Try to detect a nearby boolean field named rtl_enable in the same form + var form = el.closest('form'); + if (form) { + // Look for a checkbox input (classic boolean) by name + var cb = form.querySelector('input[name="rtl_enable"]'); + if (cb) { + shouldRTL = cb.checked; + } else { + // Fallback: look for any element with data-field="rtl_enable" + var df = form.querySelector('[data-field="rtl_enable"]'); + if (df) { + // Try to find checkbox inside + var inner = df.querySelector('input[type="checkbox"]'); + if (inner) shouldRTL = inner.checked; + } + } + } + if (editable) { + if (shouldRTL) { + editable.setAttribute('dir', 'rtl'); + editable.style.direction = 'rtl'; + } else { + editable.removeAttribute('dir'); + editable.style.direction = ''; + } + } + }); + } + + // Run after DOM ready and also on Odoo bus events when views are re-rendered. + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', function () { + setEditorRTL(); + // start observer after body exists + startObserver(); + }); + } else { + setEditorRTL(); + startObserver(); + } + + function startObserver() { + // Odoo may dynamically rerender; observe mutations under the document body + // and re-apply the RTL attribute when new nodes appear. + try { + if (!document.body) return; + var observer = new MutationObserver(function () { + setEditorRTL(); + }); + observer.observe(document.body, { childList: true, subtree: true }); + } catch (e) { + // Fail silently — we don't want to break the client if MutationObserver isn't available + console.warn('project_html_rtl: could not start MutationObserver', e && e.message); + } + } + +})(); +/** + * Small script to force RTL direction on HTML editors inside project task forms. + * It finds HTML editor fields added by our view extension and sets dir="rtl" on + * the editable area so the editor displays in right-to-left mode. + */ +(function () { + 'use strict'; + + function setEditorRTL() { + // Target editable areas that we marked via the view (data-project-html="1") + var elems = document.querySelectorAll('[data-project-html="1"]'); + elems.forEach(function (el) { + var editable = el.querySelector('[contenteditable]'); + var shouldRTL = false; + // Try to detect a nearby boolean field named rtl_enable in the same form + var form = el.closest('form'); + if (form) { + // Look for a checkbox input (classic boolean) by name + var cb = form.querySelector('input[name="rtl_enable"]'); + if (cb) { + shouldRTL = cb.checked; + } else { + // Fallback: look for any element with data-field="rtl_enable" + var df = form.querySelector('[data-field="rtl_enable"]'); + if (df) { + // Try to find checkbox inside + var inner = df.querySelector('input[type="checkbox"]'); + if (inner) shouldRTL = inner.checked; + } + } + } + if (editable) { + if (shouldRTL) { + editable.setAttribute('dir', 'rtl'); + editable.style.direction = 'rtl'; + /** + * Small script to force RTL direction on HTML editors inside project task forms. + * It finds HTML editor fields added by our view extension and sets dir="rtl" on + * the editable area so the editor displays in right-to-left mode. + */ + (function () { + 'use strict'; + + function setEditorRTL() { + // Target editable areas that we marked via the view (data-project-html="1") + var elems = document.querySelectorAll('[data-project-html="1"]'); + elems.forEach(function (el) { + var editable = el.querySelector('[contenteditable]'); + var shouldRTL = false; + // Try to detect a nearby boolean field named rtl_enable in the same form + var form = el.closest('form'); + if (form) { + // Look for a checkbox input (classic boolean) by name + var cb = form.querySelector('input[name="rtl_enable"]'); + if (cb) { + shouldRTL = cb.checked; + } else { + // Fallback: look for any element with data-field="rtl_enable" + var df = form.querySelector('[data-field="rtl_enable"]'); + if (df) { + // Try to find checkbox inside + var inner = df.querySelector('input[type="checkbox"]'); + if (inner) shouldRTL = inner.checked; + } + } + } + if (editable) { + if (shouldRTL) { + editable.setAttribute('dir', 'rtl'); + editable.style.direction = 'rtl'; + } else { + editable.removeAttribute('dir'); + editable.style.direction = ''; + } + } + }); + } + + // Run after DOM ready and also on Odoo bus events when views are re-rendered. + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', function () { + setEditorRTL(); + // start observer after body exists + startObserver(); + }); + } else { + setEditorRTL(); + startObserver(); + } + + function startObserver() { + // Odoo may dynamically rerender; observe mutations under the document body + // and re-apply the RTL attribute when new nodes appear. + try { + if (!document.body) return; + var observer = new MutationObserver(function () { + setEditorRTL(); + }); + observer.observe(document.body, { childList: true, subtree: true }); + } catch (e) { + // Fail silently — we don't want to break the client if MutationObserver isn't available + console.warn('project_html_rtl: could not start MutationObserver', e && e.message); + } + } + + })(); + } else { diff --git a/odoo/addons/project_html_rtl/static/src/js/editor_rtl_v2.js b/odoo/addons/project_html_rtl/static/src/js/editor_rtl_v2.js new file mode 100644 index 0000000..2a529b0 --- /dev/null +++ b/odoo/addons/project_html_rtl/static/src/js/editor_rtl_v2.js @@ -0,0 +1,132 @@ +/** + * editor_rtl_v2.js — safer version of the RTL injector for the HTML editor. + */ +(function () { + 'use strict'; + + var MANAGED_FLAG = 'data-project-html-rtl-managed'; + var IFRAME_LISTENER_FLAG = 'data-project-html-rtl-listener'; + var TARGET_FIELDS = ['description', 'notes']; + + function findRtlCheckbox(form) { + if (!form) { + return null; + } + var direct = form.querySelector('input[name="rtl_enable"]'); + if (direct) { + return direct; + } + var wrapper = form.querySelector('[data-field="rtl_enable"]'); + if (!wrapper) { + return null; + } + return wrapper.querySelector('input[type="checkbox"]'); + } + + function eachTargetField(callback) { + TARGET_FIELDS.forEach(function (fieldName) { + var containers = document.querySelectorAll('[data-field="' + fieldName + '"]'); + containers.forEach(function (container) { + callback(container, fieldName); + }); + }); + } + + function getEditableFromContainer(container) { + if (!container) { + return null; + } + + // Try the standard inline editable div first + var editable = container.querySelector('.odoo-editor-editable'); + if (editable) { + return editable; + } + + // Older/editor fallback: any contenteditable descendant + editable = container.querySelector('[contenteditable="true"]'); + if (editable) { + return editable; + } + + // Some variants render inside an iframe + var iframe = container.querySelector('iframe'); + if (iframe) { + if (!iframe.hasAttribute(IFRAME_LISTENER_FLAG)) { + iframe.setAttribute(IFRAME_LISTENER_FLAG, '1'); + iframe.addEventListener('load', function () { + setEditorRTL(); + }); + } + try { + if (iframe.contentDocument && iframe.contentDocument.body) { + return iframe.contentDocument.body; + } + } catch (err) { + console.warn('project_html_rtl v2: unable to access iframe body', err && err.message); + } + } + + return null; + } + + function setEditorRTL() { + eachTargetField(function (container) { + try { + var editable = getEditableFromContainer(container); + if (!editable) { + return; + } + var form = container.closest('form'); + var cb = findRtlCheckbox(form); + var shouldRTL = cb ? cb.checked : false; + var isManaged = editable.hasAttribute(MANAGED_FLAG); + + if (shouldRTL) { + editable.setAttribute('dir', 'rtl'); + editable.style.direction = 'rtl'; + if (!isManaged) { + editable.setAttribute(MANAGED_FLAG, '1'); + } + } else if (isManaged) { + editable.removeAttribute('dir'); + editable.style.direction = ''; + editable.removeAttribute(MANAGED_FLAG); + } + } catch (e) { + // Don't break the app if something unexpected happens + console.warn('project_html_rtl v2: error applying RTL', e && e.message); + } + }); + } + + function startObserver() { + try { + if (!document.body) return; + var observer = new MutationObserver(function () { + setEditorRTL(); + }); + observer.observe(document.body, { childList: true, subtree: true }); + } catch (e) { + console.warn('project_html_rtl v2: could not start MutationObserver', e && e.message); + } + } + + document.addEventListener('change', function (ev) { + var target = ev.target; + if (target && target.name === 'rtl_enable') { + setEditorRTL(); + } + }); + + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', function () { + setEditorRTL(); + startObserver(); + }); + } else { + setEditorRTL(); + startObserver(); + } + +})(); diff --git a/odoo/addons/project_html_rtl/static/src/js/html_field_patch.js b/odoo/addons/project_html_rtl/static/src/js/html_field_patch.js new file mode 100644 index 0000000..1b585a6 --- /dev/null +++ b/odoo/addons/project_html_rtl/static/src/js/html_field_patch.js @@ -0,0 +1,87 @@ +odoo.define('project_html_rtl.html_field_patch', [], function (require) { + 'use strict'; + + const { patch } = require('@web/core/utils/patch'); + const { useEffect } = require('@odoo/owl'); + const { HtmlField } = require('@html_editor/fields/html_field'); + + // Capture original methods so we can call them from our patch. + const origSetup = HtmlField.prototype.setup; + const origOnEditorLoad = HtmlField.prototype.onEditorLoad; + const origOnBlur = HtmlField.prototype.onBlur; + + const TARGET_MODEL = 'project.task'; + const TARGET_FIELDS = new Set(['description', 'notes']); + const MANAGED_FLAG = 'data-project-html-rtl-managed'; + + function isTarget(component) { + return ( + component.props?.record?.resModel === TARGET_MODEL && + TARGET_FIELDS.has(component.props?.name) + ); + } + + function applyDirection(component) { + if (!isTarget(component) || component.state?.showCodeView) { + return; + } + const editor = component.editor; + if (!editor || !editor.editable) { + return; + } + const shouldRtl = !!component.props.record?.data?.rtl_enable; + const editable = editor.editable; + const isManaged = editable.hasAttribute(MANAGED_FLAG); + + if (shouldRtl) { + editable.setAttribute('dir', 'rtl'); + editable.style.direction = 'rtl'; + if (!isManaged) { + editable.setAttribute(MANAGED_FLAG, '1'); + } + } else if (isManaged) { + editable.removeAttribute('dir'); + editable.style.direction = ''; + editable.removeAttribute(MANAGED_FLAG); + } + } + + patch( + HtmlField.prototype, + { + setup() { + // Call the original setup implementation if present + if (typeof origSetup === 'function') { + origSetup.apply(this, arguments); + } + if (!isTarget(this)) { + return; + } + useEffect( + () => { + applyDirection(this); + }, + () => [this.props.record?.data?.rtl_enable, this.state?.showCodeView] + ); + }, + + onEditorLoad() { + if (typeof origOnEditorLoad === 'function') { + origOnEditorLoad.apply(this, arguments); + } + if (isTarget(this)) { + applyDirection(this); + } + }, + + onBlur() { + const result = typeof origOnBlur === 'function' ? origOnBlur.apply(this, arguments) : undefined; + if (isTarget(this)) { + applyDirection(this); + } + return result; + }, + }, + 'project_html_rtl' + ); +}); diff --git a/odoo/addons/project_html_rtl/views/project_task_view.xml b/odoo/addons/project_html_rtl/views/project_task_view.xml new file mode 100644 index 0000000..1f3d85e --- /dev/null +++ b/odoo/addons/project_html_rtl/views/project_task_view.xml @@ -0,0 +1,21 @@ + + + + project.task.form.inherit.html + project.task + + + + + html + 1 + + + + + + + + + + diff --git a/odoo/odoo-init.yml b/odoo/odoo-init.yml new file mode 100644 index 0000000..0cb737e --- /dev/null +++ b/odoo/odoo-init.yml @@ -0,0 +1,33 @@ +--- + # One-shot init service: creates and initializes the Odoo database and installs + # the `base` module on first start. It waits for Postgres and will exit after + # successful initialization. +services: + odoo: + depends_on: + odoo-init: + condition: service_completed_successfully + odoo-init: + image: odoo:19 + container_name: odoo-init + restart: "no" + # Run the wrapper as root so it can chown volumes. The wrapper will drop to + # the 'odoo' user before executing the init script. + user: "0:0" + volumes: + - odoo-db-data:/var/lib/odoo + - odoo-config:/etc/odoo + - ./scripts/odoo/init-odoo.sh:/init-odoo.sh + - ./scripts/odoo/init-wrapper.sh:/init-wrapper.sh:ro + # Use a small wrapper script (mounted from host) to fix permissions, then run init + entrypoint: ["/bin/sh","/init-wrapper.sh"] + command: [] + environment: + - HOST=${ODOO_DB_HOST} + - USER=${ODOO_DB_USER} + - PASSWORD=${ODOO_DB_PASSWORD} + - DB_NAME=${ODOO_DB} + +volumes: + odoo-db-data: + odoo-config: \ No newline at end of file diff --git a/odoo/odoo.yml b/odoo/odoo.yml new file mode 100644 index 0000000..3ec1d35 --- /dev/null +++ b/odoo/odoo.yml @@ -0,0 +1,27 @@ +--- +services: + odoo: + image: odoo:19 + container_name: odoo + restart: always + environment: + - HOST=${ODOO_DB_HOST} + - USER=${ODOO_DB_USER} + - PASSWORD=${ODOO_DB_PASSWORD} + - DB_NAME=${ODOO_DB} + volumes: + # Persistent Odoo data (filestore, sessions, attachments) + - odoo-db-data:/var/lib/odoo + # Keep local ./addons for development; you can remove this to use the named volume instead + - ./odoo/addons:/mnt/extra-addons + # Odoo configuration and custom config files + - odoo-config:/etc/odoo + labels: + - "traefik.enable=true" + - "traefik.http.routers.odoo.entrypoints=https" + - "traefik.http.routers.odoo.rule=Host(`${ODOO_HOST:-odoo.opencloud.test}`)" + - "traefik.http.services.odoo.loadbalancer.server.port=8069" + - "traefik.http.routers.odoo.service=odoo" + - "traefik.http.routers.odoo.${TRAEFIK_SERVICES_TLS_CONFIG}" + + diff --git a/opencloud/opencloud.yml b/opencloud/opencloud.yml new file mode 100644 index 0000000..004ce63 --- /dev/null +++ b/opencloud/opencloud.yml @@ -0,0 +1,73 @@ +--- +services: + opencloud: + image: ${OC_DOCKER_IMAGE:-opencloudeu/opencloud-rolling}:${OC_DOCKER_TAG:-latest} + container_name: opencloud + entrypoint: + - /bin/sh + # run opencloud init to initialize a configuration file with random secrets + # it will fail on subsequent runs, because the config file already exists + # therefore we ignore the error and then start the opencloud server + command: ["-c", "opencloud init || true; opencloud server"] + environment: + # enable services that are not started automatically + OC_ADD_RUN_SERVICES: ${START_ADDITIONAL_SERVICES} + OC_URL: https://${OC_DOMAIN:-cloud.opencloud.test} + OC_LOG_LEVEL: ${LOG_LEVEL:-info} + OC_LOG_COLOR: "${LOG_PRETTY:-false}" + OC_LOG_PRETTY: "${LOG_PRETTY:-false}" + # do not use SSL between the reverse proxy and OpenCloud + PROXY_TLS: "false" + # INSECURE: needed if OpenCloud / reverse proxy is using self generated certificates + OC_INSECURE: "${INSECURE:-false}" + # basic auth (not recommended, but needed for eg. WebDav clients that do not support OpenID Connect) + PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}" + # demo users + IDM_CREATE_DEMO_USERS: "${DEMO_USERS:-false}" + # admin password + IDM_ADMIN_PASSWORD: "${INITIAL_ADMIN_PASSWORD}" + # email server (if configured) + NOTIFICATIONS_SMTP_HOST: "${SMTP_HOST}" + NOTIFICATIONS_SMTP_PORT: "${SMTP_PORT}" + NOTIFICATIONS_SMTP_SENDER: "${SMTP_SENDER:-OpenCloud Notifications }" + NOTIFICATIONS_SMTP_USERNAME: "${SMTP_USERNAME}" + NOTIFICATIONS_SMTP_PASSWORD: "${SMTP_PASSWORD}" + NOTIFICATIONS_SMTP_INSECURE: "${SMTP_INSECURE}" + NOTIFICATIONS_SMTP_AUTHENTICATION: "${SMTP_AUTHENTICATION}" + NOTIFICATIONS_SMTP_ENCRYPTION: "${SMTP_TRANSPORT_ENCRYPTION:-none}" + FRONTEND_ARCHIVER_MAX_SIZE: "10000000000" + PROXY_CSP_CONFIG_FILE_LOCATION: /etc/opencloud/csp.yaml + # enable to allow using the banned passwords list + OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST: banned-password-list.txt + # control the password enforcement and policy for public shares + OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD: "${OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD:-true}" + OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD: "${OC_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD:-true}" + OC_PASSWORD_POLICY_DISABLED: "${OC_PASSWORD_POLICY_DISABLED:-false}" + OC_PASSWORD_POLICY_MIN_CHARACTERS: "${OC_PASSWORD_POLICY_MIN_CHARACTERS:-8}" + OC_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS: "${OC_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS:-1}" + OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS: "${OC_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS:-1}" + OC_PASSWORD_POLICY_MIN_DIGITS: "${OC_PASSWORD_POLICY_MIN_DIGITS:-1}" + OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS: "${OC_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS:-1}" + volumes: + - ./config/opencloud/csp.yaml:/etc/opencloud/csp.yaml + - ./config/opencloud/banned-password-list.txt:/etc/opencloud/banned-password-list.txt + # configure the .env file to use own paths instead of docker internal volumes + - ${OC_CONFIG_DIR:-opencloud-config}:/etc/opencloud + - ${OC_DATA_DIR:-opencloud-data}:/var/lib/opencloud + - ${OC_APPS_DIR:-./config/opencloud/apps}:/var/lib/opencloud/web/assets/apps + extra_hosts: + - "${OC_DOMAIN:-cloud.opencloud.test}:host-gateway" + logging: + driver: ${LOG_DRIVER:-local} + restart: always + labels: + - "traefik.enable=true" + - "traefik.http.routers.opencloud.entrypoints=https" + - "traefik.http.routers.opencloud.rule=Host(`${OC_DOMAIN:-cloud.opencloud.test}`)" + - "traefik.http.routers.opencloud.service=opencloud" + - "traefik.http.services.opencloud.loadbalancer.server.port=9200" + - "traefik.http.routers.opencloud.${TRAEFIK_SERVICES_TLS_CONFIG}" + +volumes: + opencloud-config: + opencloud-data: diff --git a/radicale/radicale.yml b/radicale/radicale.yml new file mode 100644 index 0000000..6e0edd8 --- /dev/null +++ b/radicale/radicale.yml @@ -0,0 +1,18 @@ +--- +services: + opencloud: + volumes: + # external sites needs to have additional routes configured in the proxy + - ./config/opencloud/proxy.yaml:/etc/opencloud/proxy.yaml + radicale: + image: ${RADICALE_DOCKER_IMAGE:-opencloudeu/radicale}:${RADICALE_DOCKER_TAG:-latest} + networks: + opencloud-net: + logging: + driver: ${LOG_DRIVER:-local} + restart: always + volumes: + - ./config/radicale/config:/etc/radicale/config + - ${RADICALE_DATA_DIR:-radicale-data}:/var/lib/radicale +volumes: + radicale-data: diff --git a/scripts/backup/backup-manager.cron b/scripts/backup/backup-manager.cron new file mode 100644 index 0000000..0e408c2 --- /dev/null +++ b/scripts/backup/backup-manager.cron @@ -0,0 +1,2 @@ +# Run backup management every minute for testing (change to '15 2 * * *' for daily at 02:15) +0 2 * * * /manage-backups.sh 2>&1 | tee -a /var/log/backup.log \ No newline at end of file diff --git a/scripts/backup/manage-backups.sh b/scripts/backup/manage-backups.sh new file mode 100755 index 0000000..451b284 --- /dev/null +++ b/scripts/backup/manage-backups.sh @@ -0,0 +1,197 @@ +#!/bin/sh +set -eu + +# Minimal PATH for cron-like environments +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +log() { + printf '%s %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$*" +} + +err() { + log "ERROR: $*" >&2 +} + +log "manage-backups.sh starting" + +BACKUP_BASE=/backups + +date_formatted() { + local format="${1:-%F_%H-%M}" + # Determine timezone to use. Priority: + # 1. $TIMEZONE environment variable + # 2. /etc/timezone file (common in many images) + # 3. /etc/localtime symlink target (if present and pointing into zoneinfo) + # 4. fall back to UTC + local tz="${TIMEZONE:-}" + if [ -z "$tz" ] && [ -f /etc/timezone ]; then + tz=$(cat /etc/timezone 2>/dev/null || true) + fi + if [ -z "$tz" ] && [ -L /etc/localtime ]; then + # readlink output might be like /usr/share/zoneinfo/Region/City + local target + target=$(readlink /etc/localtime 2>/dev/null || true) + case "$target" in + */usr/share/zoneinfo/*) tz=${target#*/usr/share/zoneinfo/} ;; + *) tz="" ;; + esac + fi + # If still empty, try reading the container PID 1 environment (docker-compose env vars live there) + if [ -z "$tz" ] && [ -r /proc/1/environ ]; then + tz=$(tr '\0' '\n' < /proc/1/environ 2>/dev/null | sed -n 's/^TIMEZONE=//p' | head -n1 || true) + fi + if [ -n "$tz" ]; then + # Prefer the system's zoneinfo if available. We consider TZ working + # if the timezone offset (%%z) differs from UTC's offset. + local utc_z tz_z + utc_z=$(date -u +%z) + tz_z=$(TZ="$tz" date +%z 2>/dev/null || true) + if [ -n "$tz_z" ] && [ "$tz_z" != "$utc_z" ]; then + TZ="$tz" date +"$format" + return + fi + + # Fallback: some minimal images (alpine without tzdata) don't have + # zoneinfo. As a pragmatic fallback map a few common timezones to + # their current standard offsets (in seconds). This is best-effort + # and does not handle historical DST transitions. + local offset_secs=0 + case "$tz" in + Asia/Tehran) offset_secs=12600 ;; # +03:30 + Asia/Kolkata) offset_secs=19800 ;; # +05:30 + Europe/London) offset_secs=0 ;; # UTC (note: ignores BST) + Europe/Paris) offset_secs=3600 ;; # +01:00 (ignores CEST) + America/New_York) offset_secs=-18000 ;; # -05:00 (ignores EDT) + America/Los_Angeles) offset_secs=-28800 ;; # -08:00 (ignores PDT) + UTC|Etc/UTC) offset_secs=0 ;; + *) offset_secs=0 ;; + esac + + # Compute local epoch by adding offset to UTC epoch and format via UTC + local epoch_utc epoch_local + epoch_utc=$(date -u +%s) + epoch_local=$((epoch_utc + offset_secs)) + # Most busybox/git images support -d "@SECONDS" with -u + date -u -d "@${epoch_local}" +"$format" + else + date +"$format" + fi +} + +wait_for_database_backups() { + local timeout="${DB_BACKUP_TIMEOUT:-600}" + local start_ts + start_ts=$(date -u +%s) + local status_file="$BACKUP_BASE/databases/.last_backup_complete" + log "Waiting for database backup completion marker at $status_file (timeout ${timeout}s)" + + while :; do + if [ -f "$status_file" ]; then + local last_ts + last_ts=$(head -n1 "$status_file" 2>/dev/null || echo 0) + case "$last_ts" in + (""|*[!0-9]*) last_ts=0 ;; + esac + if [ "$last_ts" -ge "$start_ts" ]; then + log "Detected recent database backup completion at epoch $last_ts" + return 0 + fi + fi + + local now + now=$(date -u +%s) + if [ $(( now - start_ts )) -ge "$timeout" ]; then + err "Timed out waiting for database backups to finish" + return 1 + fi + sleep 5 + done +} + +cleanup_old_backups() { + local retention_days="${BACKUP_RETENTION_DAYS:-7}" + local retention_count="${BACKUP_RETENTION_COUNT:-0}" + + case "$retention_days" in + ''|*[!0-9]*) retention_days=7 ;; + esac + case "$retention_count" in + ''|*[!0-9]*) retention_count=0 ;; + esac + + log "Cleaning up old backups older than ${retention_days} days (keep ${retention_count} newest)" + + if [ "$retention_days" -ge 0 ] 2>/dev/null; then + find "$BACKUP_BASE" -maxdepth 1 -mindepth 1 -type d ! -name databases -mtime +"${retention_days}" -exec rm -rf {} \; 2>/dev/null || true + find "$BACKUP_BASE/databases" -type f -mtime +"${retention_days}" -delete 2>/dev/null || true + fi + + if [ "$retention_count" -gt 0 ] 2>/dev/null; then + local idx=0 + local entry + local old_ifs="$IFS" + IFS=' +' + set -- $(ls -1dt "$BACKUP_BASE"/*/ 2>/dev/null || echo) + IFS="$old_ifs" + for entry in "$@"; do + [ -z "$entry" ] && continue + case "$entry" in + "$BACKUP_BASE/databases"|"$BACKUP_BASE/databases/") + continue + ;; + esac + idx=$((idx + 1)) + if [ "$idx" -le "$retention_count" ]; then + continue + fi + log "Removing old backup directory $entry (exceeds retention count)" + rm -rf "$entry" 2>/dev/null || err "Failed to remove $entry" + done + fi +} +# Prepare dated backup directory +DATED_DIR="$BACKUP_BASE/$(date_formatted)" +mkdir -p "$DATED_DIR" + +wait_for_database_backups || exit 1 + +# Archive application data +log "Archiving data paths..." +# Archive multiple paths if they exist. Keeps one archive per path. +archive_path() { + local src="$1" prefix="$2" + if [ -d "$src" ]; then + log "Archiving $src" + if bsdtar --xattrs --same-owner --numeric-owner -czf "$DATED_DIR/${prefix}_$(date_formatted).tar.gz" -C "$src" .; then + log "$src archived successfully" + # (reverted) do not force ownership changes here + else + err "Failed to archive $src" + return 1 + fi + else + log "Source path $src not found; skipping" + fi +} + +# Prefer canonical paths mounted into the backup-manager container +archive_path /odoo_db_data odoo_db_data || true +archive_path /odoo_config odoo_config || true +archive_path /gitea_data gitea_data || true +archive_path /opencloud_data opencloud_data || true +archive_path /opencloud_config opencloud_config || true + +# Find and Move today's database dumps to dated directory +log "Moving files from database dump to dated directory..." +# list the names of the files to move +#log "Files to move:" +ls -1 "$BACKUP_BASE/databases"/* 2>/dev/null || true +log "Moving database dumps to dated directory..." +mv "$BACKUP_BASE/databases"/*_$(date_formatted)*.sql.gz "$DATED_DIR"/ 2>/dev/null || true + +cleanup_old_backups + +# (reverted) do not change ownership of the dated directory + +log "manage-backups.sh finished successfully" \ No newline at end of file diff --git a/scripts/backup/pg-dump.cron b/scripts/backup/pg-dump.cron new file mode 100644 index 0000000..9cb0fe7 --- /dev/null +++ b/scripts/backup/pg-dump.cron @@ -0,0 +1,2 @@ +# Run database dumps every minute for testing (change to '0 2 * * *' for daily at 02:00) +0 2 * * * /pg-dump.sh 2>&1 | tee -a /var/log/backup.log \ No newline at end of file diff --git a/scripts/backup/pg-dump.sh b/scripts/backup/pg-dump.sh new file mode 100755 index 0000000..0660a3d --- /dev/null +++ b/scripts/backup/pg-dump.sh @@ -0,0 +1,69 @@ +#!/bin/sh +set -eu + +# Minimal PATH for cron-like environments +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +log() { + printf '%s %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$*" +} + +err() { + log "ERROR: $*" >&2 +} + +log "pg-dump.sh starting" + +# Validate required env vars +: "${POSTGRES_USER:?POSTGRES_USER not set}" +: "${POSTGRES_HOST:?POSTGRES_HOST not set}" + +date_formatted() { + local format="${1:-%F_%H-%M}" + # Use TIMEZONE env var if present; fall back to UTC + if [ -n "${TIMEZONE:-}" ]; then + TZ="$TIMEZONE" date +"$format" + else + date +"$format" + fi +} + +BACKUP_DIR=/backups/databases +mkdir -p "$BACKUP_DIR" +log "Using backup dir: $BACKUP_DIR" + +STATUS_FILE="$BACKUP_DIR/.last_backup_complete" + +# Function to dump a specific database +dump_database() { + local db=$1 + log "Checking existence of $db database..." + local db_exists + db_exists=$(psql -U "$POSTGRES_USER" -h "$POSTGRES_HOST" -tAc "SELECT 1 FROM pg_database WHERE datname='$db'") + if [[ "$db_exists" != "1" ]]; then + err "Database '$db' does not exist. Skipping dump." + return 2 + fi + + log "Dumping $db database..." + local outfile="$BACKUP_DIR/${db}_$(date_formatted).sql.gz" + if pg_dump -U "$POSTGRES_USER" -h "$POSTGRES_HOST" "$db" | gzip > "$outfile"; then + log "$db database dumped and compressed: $outfile" + return 0 + else + err "Failed to dump $db database" + return 1 + fi +} + +# Dump each database +for db in $DB_LIST; do + dump_database "$db" || exit 1 +done + +tmp_status=$(mktemp "$BACKUP_DIR/.last_backup_complete.XXXXXX") +date -u +%s > "$tmp_status" +mv "$tmp_status" "$STATUS_FILE" +log "Recorded database backup completion marker at $STATUS_FILE" + +log "pg-dump.sh finished successfully" \ No newline at end of file diff --git a/scripts/backup/restore-gitea.sh b/scripts/backup/restore-gitea.sh new file mode 100755 index 0000000..cdbf13e --- /dev/null +++ b/scripts/backup/restore-gitea.sh @@ -0,0 +1,117 @@ +#!/bin/sh +set -eu + +usage() { + cat <&2 + exit 1 +fi + +BACKUP_ID=$1 +ROOT_DIR=$(cd "$(dirname "$0")/../.." && pwd) +BACKUPS_DIR="$ROOT_DIR/backups/$BACKUP_ID" + +load_env_file() { + local file=$1 + if [ -f "$file" ]; then + # shellcheck disable=SC1090 + set -a + . "$file" + set +a + fi +} + +# Load shared or service-specific environment files if present +load_env_file "$ROOT_DIR/.env" + +DB_NAME=${GITEA_DB:-${GITEA_DB_NAME:-gitea}} +DB_USER=${GITEA_DB_USER:-gitea} +DB_PASSWORD=${GITEA_DB_PASSWORD:-${GITEA_DB_PASS:-}} + +DB_NAME=${2:-$DB_NAME} +DB_USER=${3:-$DB_USER} + +if [ ! -d "$BACKUPS_DIR" ]; then + printf 'Backup directory not found: %s\n' "$BACKUPS_DIR" >&2 + exit 1 +fi + +COMPOSE_CMD="docker compose" +cd "$ROOT_DIR" + +printf 'Stopping Gitea service before restore...\n' +if ! $COMPOSE_CMD stop gitea >/dev/null 2>&1; then + printf 'Warning: could not stop Gitea service (it may already be stopped).\n' >&2 +fi + +ARCHIVE="gitea_data_${BACKUP_ID}.tar.gz" +HOST_FILE="$BACKUPS_DIR/$ARCHIVE" +CONTAINER_PATH="/backups/$BACKUP_ID/$ARCHIVE" + +if [ ! -f "$HOST_FILE" ]; then + printf 'Archive missing: %s\n' "$HOST_FILE" >&2 + exit 1 +fi + +printf 'Restoring gitea_data from %s\n' "$HOST_FILE" +$COMPOSE_CMD run --rm restore restore-volume gitea_data "$CONTAINER_PATH" + +DB_DUMP_DIR="$BACKUPS_DIR" +DB_DUMP_FILE="$DB_DUMP_DIR/${DB_NAME}_${BACKUP_ID}.sql" +DB_DUMP_GZ="$DB_DUMP_FILE.gz" + +if [ -f "$DB_DUMP_GZ" ]; then + DB_SOURCE="$DB_DUMP_GZ" +elif [ -f "$DB_DUMP_FILE" ]; then + DB_SOURCE="$DB_DUMP_FILE" +else + DB_SOURCE="" +fi + +if [ -n "$DB_SOURCE" ]; then + if [ -z "$DB_PASSWORD" ]; then + printf 'Database dump found (%s) but GITEA_DB_PASSWORD not set; skipping DB restore.\n' "$DB_SOURCE" >&2 + else + printf 'Restoring database %s from %s\n' "$DB_NAME" "$DB_SOURCE" + DROP_FLAG=${GITEA_DROP_EXISTING_DB:-${DROP_EXISTING_DB:-1}} + RESTORE_ENV_ARGS="-e PGPASSWORD=$DB_PASSWORD -e DROP_EXISTING_DB=$DROP_FLAG" + if [ -n "${POSTGRES_ADMIN_USER:-}" ] && [ -n "${POSTGRES_ADMIN_PASSWORD:-}" ]; then + RESTORE_ENV_ARGS="$RESTORE_ENV_ARGS -e POSTGRES_ADMIN_USER=$POSTGRES_ADMIN_USER -e POSTGRES_ADMIN_PASSWORD=$POSTGRES_ADMIN_PASSWORD" + fi + if [ -n "${POSTGRES_ADMIN_DB:-}" ]; then + RESTORE_ENV_ARGS="$RESTORE_ENV_ARGS -e POSTGRES_ADMIN_DB=$POSTGRES_ADMIN_DB" + fi + if [ -n "${GITEA_DB_HOST:-}" ]; then + RESTORE_ENV_ARGS="$RESTORE_ENV_ARGS -e POSTGRES_HOST=$GITEA_DB_HOST" + elif [ -n "${POSTGRES_HOST:-}" ]; then + RESTORE_ENV_ARGS="$RESTORE_ENV_ARGS -e POSTGRES_HOST=$POSTGRES_HOST" + fi + # shellcheck disable=SC2086 + $COMPOSE_CMD run --rm $RESTORE_ENV_ARGS restore \ + restore-db "/backups/$BACKUP_ID/$(basename "$DB_SOURCE")" "$DB_NAME" "$DB_USER" "$DB_PASSWORD" + fi +else + printf 'No database dump found for %s in %s\n' "$DB_NAME" "$DB_DUMP_DIR" >&2 +fi + +printf '\nRestore command completed. Restart Gitea when ready.\n' + +printf 'Starting Gitea service...\n' +if ! $COMPOSE_CMD up -d gitea; then + printf 'Warning: failed to start Gitea service. Please start it manually.\n' >&2 +fi diff --git a/scripts/backup/restore-odoo.sh b/scripts/backup/restore-odoo.sh new file mode 100755 index 0000000..5566288 --- /dev/null +++ b/scripts/backup/restore-odoo.sh @@ -0,0 +1,123 @@ +#!/bin/sh +set -eu + +usage() { + cat <&2 + exit 1 +fi + +BACKUP_ID=$1 +ROOT_DIR=$(cd "$(dirname "$0")/../.." && pwd) +BACKUPS_DIR="$ROOT_DIR/backups/$BACKUP_ID" + +load_env_file() { + local file=$1 + if [ -f "$file" ]; then + # shellcheck disable=SC1090 + set -a + . "$file" + set +a + fi +} + +# Load credentials from .env files if present +load_env_file "$ROOT_DIR/.env" + +DB_NAME=${ODOO_DB:-odoo} +DB_USER=${ODOO_DB_USER:-odoodbuser} +DB_PASSWORD=${ODOO_DB_PASSWORD:-} + +DB_NAME=${2:-$DB_NAME} +DB_USER=${3:-$DB_USER} + +if [ ! -d "$BACKUPS_DIR" ]; then + printf 'Backup directory not found: %s\n' "$BACKUPS_DIR" >&2 + exit 1 +fi + +COMPOSE_CMD="docker compose" +cd "$ROOT_DIR" + +printf 'Stopping Odoo service before restore...\n' +if ! $COMPOSE_CMD stop odoo >/dev/null 2>&1; then + printf 'Warning: could not stop Odoo service (it may already be stopped).\n' >&2 +fi + +restore_volume() { + volume=$1 + archive_name=$2 + host_file="$BACKUPS_DIR/$archive_name" + container_path="/backups/$BACKUP_ID/$archive_name" + + if [ ! -f "$host_file" ]; then + printf 'Skipping %s: archive missing (%s)\n' "$volume" "$host_file" >&2 + return 0 + fi + + printf 'Restoring %s from %s\n' "$volume" "$host_file" + $COMPOSE_CMD run --rm restore restore-volume "$volume" "$container_path" +} + +restore_volume odoo-config "odoo_config_${BACKUP_ID}.tar.gz" +restore_volume odoo-db-data "odoo_db_data_${BACKUP_ID}.tar.gz" + +DB_DUMP_DIR="$BACKUPS_DIR" +DB_DUMP_FILE="$DB_DUMP_DIR/${DB_NAME}_${BACKUP_ID}.sql" +DB_DUMP_GZ="$DB_DUMP_FILE.gz" + +if [ -f "$DB_DUMP_GZ" ]; then + DB_SOURCE="$DB_DUMP_GZ" +elif [ -f "$DB_DUMP_FILE" ]; then + DB_SOURCE="$DB_DUMP_FILE" +else + DB_SOURCE="" +fi + +if [ -n "$DB_SOURCE" ]; then + if [ -z "$DB_PASSWORD" ]; then + printf 'Database dump found (%s) but ODOO_DB_PASSWORD not set; skipping DB restore.\n' "$DB_SOURCE" >&2 + else + printf 'Restoring database %s from %s\n' "$DB_NAME" "$DB_SOURCE" + DROP_FLAG=${ODOO_DROP_EXISTING_DB:-${DROP_EXISTING_DB:-1}} + RESTORE_ENV_ARGS="-e PGPASSWORD=$DB_PASSWORD -e DROP_EXISTING_DB=$DROP_FLAG" + if [ -n "${POSTGRES_ADMIN_USER:-}" ] && [ -n "${POSTGRES_ADMIN_PASSWORD:-}" ]; then + RESTORE_ENV_ARGS="$RESTORE_ENV_ARGS -e POSTGRES_ADMIN_USER=$POSTGRES_ADMIN_USER -e POSTGRES_ADMIN_PASSWORD=$POSTGRES_ADMIN_PASSWORD" + fi + if [ -n "${POSTGRES_ADMIN_DB:-}" ]; then + RESTORE_ENV_ARGS="$RESTORE_ENV_ARGS -e POSTGRES_ADMIN_DB=$POSTGRES_ADMIN_DB" + fi + if [ -n "${ODOO_DB_HOST:-}" ]; then + RESTORE_ENV_ARGS="$RESTORE_ENV_ARGS -e POSTGRES_HOST=$ODOO_DB_HOST" + elif [ -n "${POSTGRES_HOST:-}" ]; then + RESTORE_ENV_ARGS="$RESTORE_ENV_ARGS -e POSTGRES_HOST=$POSTGRES_HOST" + fi + # shellcheck disable=SC2086 + $COMPOSE_CMD run --rm $RESTORE_ENV_ARGS restore \ + restore-db "/backups/$BACKUP_ID/$(basename "$DB_SOURCE")" "$DB_NAME" "$DB_USER" "$DB_PASSWORD" + fi +else + printf 'No database dump found for %s in %s\n' "$DB_NAME" "$DB_DUMP_DIR" >&2 +fi + +printf '\nRestore commands completed. Restart the dependent services when ready.\n' + +printf 'Starting Odoo service...\n' +if ! $COMPOSE_CMD up -d odoo; then + printf 'Warning: failed to start Odoo service. Please start it manually.\n' >&2 +fi diff --git a/scripts/backup/restore-opencloud.sh b/scripts/backup/restore-opencloud.sh new file mode 100755 index 0000000..58850e1 --- /dev/null +++ b/scripts/backup/restore-opencloud.sh @@ -0,0 +1,81 @@ +#!/bin/sh +set -eu + +usage() { + cat <&2 + exit 1 +fi + +BACKUP_ID=$1 +ROOT_DIR=$(cd "$(dirname "$0")/../.." && pwd) +BACKUPS_DIR="$ROOT_DIR/backups/$BACKUP_ID" + +if [ ! -d "$BACKUPS_DIR" ]; then + printf 'Backup directory not found: %s\n' "$BACKUPS_DIR" >&2 + exit 1 +fi + +load_env_file() { + local file=$1 + if [ -f "$file" ]; then + # shellcheck disable=SC1090 + set -a + . "$file" + set +a + fi +} + +# Load shared/service env if present (not strictly required but keeps behavior consistent) +load_env_file "$ROOT_DIR/.env" + +COMPOSE_CMD="docker compose" +cd "$ROOT_DIR" + +printf 'Stopping OpenCloud service before restore...\n' +if ! $COMPOSE_CMD stop opencloud >/dev/null 2>&1; then + printf 'Warning: could not stop OpenCloud service (it may already be stopped).\n' >&2 +fi + +DATA_ARCHIVE="opencloud_data_${BACKUP_ID}.tar.gz" +CONFIG_ARCHIVE="opencloud_config_${BACKUP_ID}.tar.gz" +DATA_HOST_FILE="$BACKUPS_DIR/$DATA_ARCHIVE" +CONFIG_HOST_FILE="$BACKUPS_DIR/$CONFIG_ARCHIVE" +DATA_CONTAINER_PATH="/backups/$BACKUP_ID/$DATA_ARCHIVE" +CONFIG_CONTAINER_PATH="/backups/$BACKUP_ID/$CONFIG_ARCHIVE" + +if [ ! -f "$DATA_HOST_FILE" ]; then + printf 'Archive missing: %s\n' "$DATA_HOST_FILE" >&2 + exit 1 +fi + +if [ ! -f "$CONFIG_HOST_FILE" ]; then + printf 'Archive missing: %s\n' "$CONFIG_HOST_FILE" >&2 + exit 1 +fi + +printf 'Restoring opencloud-data from %s\n' "$DATA_HOST_FILE" +$COMPOSE_CMD run --rm restore restore-volume opencloud-data "$DATA_CONTAINER_PATH" + +printf 'Restoring opencloud-config from %s\n' "$CONFIG_HOST_FILE" +$COMPOSE_CMD run --rm restore restore-volume opencloud-config "$CONFIG_CONTAINER_PATH" + +printf '\nRestore command completed. Restart OpenCloud services when ready.\n' + +printf 'Starting OpenCloud service...\n' +if ! $COMPOSE_CMD up -d opencloud; then + printf 'Warning: failed to start OpenCloud service. Please start it manually.\n' >&2 +fi diff --git a/scripts/backup/restore.sh b/scripts/backup/restore.sh new file mode 100755 index 0000000..a0c0b5b --- /dev/null +++ b/scripts/backup/restore.sh @@ -0,0 +1,219 @@ +#!/bin/sh +set -eu + +# Simple restore helper for backups produced by this stack. +# Usage: +# ./restore.sh list # list backups in ./backups +# ./restore.sh restore-volume +# ./restore.sh restore-db +# +# Notes: +# - This assumes you use `docker compose` in the repo root and the postgres service +# is named `postgres` in your compose stack. Adjust POSTGRES_SERVICE if different. +# - Stop services that use the target volume/database before restoring to avoid conflicts. + +BACKUPS_DIR="${BACKUPS_DIR:-./backups}" +POSTGRES_SERVICE="${POSTGRES_SERVICE:-postgres}" +COMPOSE="docker compose" + +require_bsdtar() { + if ! command -v bsdtar >/dev/null 2>&1; then + err "bsdtar not found. Please install libarchive/bsdtar in the current environment." + exit 2 + fi +} + +require_bsdtar + +log() { printf '%s %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$*"; } +err() { log "ERROR: $*" >&2; } + +usage() { + cat < [args] + +Commands: + list + List dated backup directories under $BACKUPS_DIR + + restore-volume + Extract a tar.gz archive into a named docker volume. + Example: $0 restore-volume odoo-db-data backups/2025-11-13/odoo_filestore_2025-11-13.tar.gz + + restore-db + Restore a SQL dump into the running Postgres service. + Example: $0 restore-db backups/2025-11-13/odoodb_2025-11-13.sql odoodb admin adminpass + +EOF +} + +list_backups() { + ls -1 "$BACKUPS_DIR" || true +} + +restore_volume() { + volume="$1" + archive="$2" + + if [ ! -f "$archive" ]; then + err "Archive not found: $archive" + exit 2 + fi + + # log "*** IMPORTANT: stop services that use volume '$volume' before running this restore." + # log "Proceeding in 5 seconds; press Ctrl-C to abort..." + # sleep 5 + + if [ "${IN_CONTAINER:-0}" = "1" ]; then + log "Running in-container restore: mapping volume name to mounted path." + target="" + + case "$volume" in + opencloud-config*|*opencloud-config*) [ -d "/opencloud_config" ] && target="/opencloud_config" ;; + opencloud-data*|*opencloud-data*) [ -d "/opencloud_data" ] && target="/opencloud_data" ;; + odoo-config*|*odoo-config*) [ -d "/odoo_config" ] && target="/odoo_config" ;; + odoo-db-data*|*odoo-db-data*|*odoo*) [ -d "/odoo_db_data" ] && target="/odoo_db_data" ;; + gitea*|*gitea*) [ -d "/gitea_data" ] && target="/gitea_data" ;; + esac + + if [ -z "$target" ]; then + err "Could not determine mount path for volume '$volume' inside container." + exit 4 + fi + + log "Extracting $archive into $target" + bsdtar --xattrs --same-owner --numeric-owner -xpf "$archive" -C "$target" + log "Restore finished. You may need to adjust ownership inside the target container if required." + return 0 + fi + + log "Restoring archive $archive into volume $volume" + docker run --rm -v "$volume":/data -v "$(pwd)/$archive":/backup.tar.gz alpine \ + sh -c "apk add --no-cache libarchive-tools >/dev/null && bsdtar --xattrs --same-owner --numeric-owner -xpf /backup.tar.gz -C /data" + log "Restore finished. You may need to adjust ownership inside the target container if required." +} + +restore_db() { + dumpfile="$1" + dbname="$2" + dbuser="$3" + dbpass="$4" + + if [ ! -f "$dumpfile" ]; then + err "Dump file not found: $dumpfile" + exit 2 + fi + + host="${POSTGRES_HOST:-$POSTGRES_SERVICE}" + admin_db="${POSTGRES_ADMIN_DB:-postgres}" + admin_user="${POSTGRES_ADMIN_USER:-$dbuser}" + admin_pass="${POSTGRES_ADMIN_PASSWORD:-$dbpass}" + in_container="${IN_CONTAINER:-0}" + drop_existing="${DROP_EXISTING_DB:-1}" + + stream_dump() { + case "$dumpfile" in + *.gz) gunzip -c "$dumpfile" ;; + *) cat "$dumpfile" ;; + esac + } + + if [ "$in_container" = "1" ]; then + cont_id="" + else + cont_id="$($COMPOSE ps -q "$POSTGRES_SERVICE" || true)" + if [ -z "$cont_id" ]; then + err "Postgres service '$POSTGRES_SERVICE' not running. Start it with: $COMPOSE up -d $POSTGRES_SERVICE" + exit 3 + fi + fi + + run_psql_sql() { + user="$1" + pass="$2" + database="$3" + sql="$4" + + if [ "$in_container" = "1" ]; then + PGPASSWORD="$pass" psql -h "$host" -U "$user" -d "$database" -v ON_ERROR_STOP=1 -v psql_restricted=off -tAc "$sql" + else + docker exec -i "$cont_id" env PGPASSWORD="$pass" psql -U "$user" -d "$database" -v ON_ERROR_STOP=1 -v psql_restricted=off -tAc "$sql" + fi + } + + createdb_with_admin() { + if [ "$in_container" = "1" ]; then + PGPASSWORD="$admin_pass" createdb -h "$host" -U "$admin_user" -O "$dbuser" "$dbname" + else + docker exec -i "$cont_id" env PGPASSWORD="$admin_pass" createdb -U "$admin_user" -O "$dbuser" "$dbname" + fi + } + + dropdb_with_admin() { + terminate_sql="SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname='$dbname' AND pid <> pg_backend_pid();" + run_psql_sql "$admin_user" "$admin_pass" "$admin_db" "$terminate_sql" >/dev/null 2>&1 || true + + if [ "$in_container" = "1" ]; then + PGPASSWORD="$admin_pass" dropdb -h "$host" -U "$admin_user" "$dbname" + else + docker exec -i "$cont_id" env PGPASSWORD="$admin_pass" dropdb -U "$admin_user" "$dbname" + fi + } + + ensure_database() { + db_exists=$(run_psql_sql "$admin_user" "$admin_pass" "$admin_db" "SELECT 1 FROM pg_database WHERE datname='$dbname'" 2>/dev/null | tr -d '[:space:]' || true) + if [ "$db_exists" = "1" ]; then + if [ "$drop_existing" = "1" ]; then + log "Database '$dbname' already exists. Dropping before restore (DROP_EXISTING_DB=1)." + if ! dropdb_with_admin 2>/dev/null; then + err "Failed to drop existing database '$dbname'. Ensure the configured credentials have DROP DATABASE privileges or set DROP_EXISTING_DB=0 to skip dropping." + return 4 + fi + else + log "Database '$dbname' already exists; continuing without dropping (DROP_EXISTING_DB=0)." + return 0 + fi + fi + + log "Creating database '$dbname' owned by '$dbuser' using user '$admin_user'." + if createdb_with_admin 2>/dev/null; then + return 0 + fi + + err "Failed to create database '$dbname' with user '$admin_user'. Ensure the user has CREATEDB privileges or create the database manually." + return 4 + } + + log "Restoring SQL dump into $dbname on host/service ${host}." + log "*** IMPORTANT: stop users/applications that use the database or run in maintenance mode." + + if ! ensure_database; then + return 4 + fi + + if [ "$in_container" = "1" ]; then + stream_dump | env PGPASSWORD="$dbpass" psql -h "$host" -U "$dbuser" -d "$dbname" -v ON_ERROR_STOP=1 -v psql_restricted=off >/dev/null + else + stream_dump | docker exec -i "$cont_id" env PGPASSWORD="$dbpass" psql -U "$dbuser" -d "$dbname" -v ON_ERROR_STOP=1 -v psql_restricted=off >/dev/null + fi + + log "Database restore finished." +} + +case "${1:-}" in + list) + list_backups + ;; + restore-volume) + if [ $# -ne 3 ]; then usage; exit 2; fi + restore_volume "$2" "$3" + ;; + restore-db) + if [ $# -ne 5 ]; then usage; exit 2; fi + restore_db "$2" "$3" "$4" "$5" + ;; + *) + usage + exit 2 + ;; +esac diff --git a/scripts/odoo/README.md b/scripts/odoo/README.md new file mode 100644 index 0000000..9ea5180 --- /dev/null +++ b/scripts/odoo/README.md @@ -0,0 +1,50 @@ +# odoo init helper + +This folder contains helper scripts used to initialize the Odoo container on +first boot. The `odoo-init` one-shot runs a small wrapper (`init-wrapper.sh`) +that fixes filesystem ownerships for the Odoo named volumes and then runs the +actual initialization script (`init-odoo.sh`). + +Why the wrapper runs as root +--------------------------- +- The wrapper must run as `root` so it can chown the Docker named volumes after + they are created. Named volumes are created with root ownership by Docker on + many hosts, which causes Odoo (a non-root process inside the container) to + fail when writing the filestore. +- The wrapper drops to the `odoo` user before executing the init script so the + actual Odoo commands run with the correct, unprivileged uid/gid. + +What it does +----------- +- Creates any missing directories the image expects (filestore, web, addons, + logs, config) and sets their ownership to the numeric `odoo` UID:GID. +- Writes a marker file `/var/lib/odoo/.odoo-init-done` to indicate the + one-shot ran successfully. +- Checks `/init-odoo.sh` is present and readable. If the script is missing or + unreadable the wrapper exits with status `2` and logs an error. + +Troubleshooting +--------------- +- If you see PermissionError writing `/var/lib/odoo/filestore/*`: + - Ensure the named volumes are not mounted on the host with root-only + permissions. The wrapper attempts to chown them on container start; if that + fails check the host mount permissions. + - You can run the wrapper manually in a container to inspect output: + + ```sh + docker compose run --rm --entrypoint /bin/sh odoo-init -c /init-wrapper.sh + ``` + +- If the wrapper logs `ERROR: /init-odoo.sh missing or not readable`: + - Verify `./scripts/odoo/init-odoo.sh` exists in the repo and that it is + mounted into the container in `odoo-init.yml` at `/init-odoo.sh`. + +Notes +----- +- `odoo-init.yml` intentionally runs the `odoo-init` service as `root` so the + wrapper can perform chown. The wrapper drops privileges before running the + init logic. +- The marker file is a simple heuristic other tooling (or manual checks) can + use to detect that initialization already ran. Removing the named volumes + and re-creating them will require re-running the wrapper (it runs on every + start of the `odoo-init` one-shot service). diff --git a/scripts/odoo/init-odoo-with-perms.sh b/scripts/odoo/init-odoo-with-perms.sh new file mode 100755 index 0000000..7053f4c --- /dev/null +++ b/scripts/odoo/init-odoo-with-perms.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Wrapper for odoo init: fix named volume ownership then run the original init script +set -eu + +OG="$(id -u odoo 2>/dev/null || id -u):$(id -g odoo 2>/dev/null || id -g)" +echo "Fixing Odoo volumes to UID:GID=$OG" +for d in /var/lib/odoo /etc/odo; do + echo " -> chown $OG $d" + chown -R "$OG" "$d" || true + ls -ldn "$d" || true +done + +echo "Running Odoo init script" +if command -v su >/dev/null 2>&1; then + echo "Dropping to 'odoo' user to run init script via su" + su -s /bin/sh odoo -c "/init-odoo.sh $*" +else + echo "su not available; running init script as current user" + exec /init-odoo.sh "$@" +fi diff --git a/scripts/odoo/init-odoo.sh b/scripts/odoo/init-odoo.sh new file mode 100755 index 0000000..d74bc67 --- /dev/null +++ b/scripts/odoo/init-odoo.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +echo "Checking if Odoo DB '$DB_NAME' exists and base module is installed..." +retries=0 +max_retries=10 + +install_base_via_odoo() { + echo "Installing base module into '$DB_NAME' via Odoo CLI" + # Use --stop-after-init so the command exits after installing + if odoo -d "$DB_NAME" -i base --stop-after-init --db_host="$HOST" --db_user="$USER" --db_password="$PASSWORD"; then + echo "Base module installed successfully" + return 0 + fi + echo "Failed to install base module via Odoo CLI" + return 1 +} + +while true; do + # Try to install base into the DB. If the DB exists and base is already + # installed this will succeed or be a no-op. If the DB doesn't exist + # the command will fail and we'll proceed to initialize it. + if install_base_via_odoo; then + echo "Odoo DB '$DB_NAME' is ready with base module installed." + break + fi + retries=$((retries+1)) + if [ "$retries" -ge "$max_retries" ]; then + echo "Initialization failed after $retries attempts. Exiting with error." + exit 1 + fi + echo "Retry #$retries: waiting before next attempt..." + sleep 2 +done \ No newline at end of file diff --git a/scripts/odoo/init-wrapper.sh b/scripts/odoo/init-wrapper.sh new file mode 100755 index 0000000..67ea64f --- /dev/null +++ b/scripts/odoo/init-wrapper.sh @@ -0,0 +1,90 @@ +#!/bin/sh +set -eu + +log() { printf '%s %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$*"; } + +# Determine the numeric UID:GID for the odoo user if present; otherwise +# fall back to the UID:GID of the current user (likely root when the +# wrapper runs as root inside the container). +OG_UID="$(id -u odoo 2>/dev/null || true)" +OG_GID="$(id -g odoo 2>/dev/null || true)" +if [ -n "$OG_UID" ] && [ -n "$OG_GID" ]; then + OG="$OG_UID:$OG_GID" +else + OG="$(id -u):$(id -g)" +fi + +log "Fixing Odoo volumes to UID:GID=$OG" + +# Paths we expect to ensure ownership for. If a path is missing we create it +# with sensible defaults so Odoo can write into it later. +for d in /var/lib/odo /etc/odoo; do + if [ -e "$d" ]; then + log " -> chown $OG $d" + if chown -R "$OG" "$d"; then + log " chown succeeded for $d" + else + log " WARNING: chown failed for $d (continuing)" + fi + ls -ldn "$d" || true + else + log " -> path $d does not exist, creating" + if mkdir -p "$d"; then + log " created $d" + chown -R "$OG" "$d" || log " WARNING: chown failed after creating $d" + ls -ldn "$d" || true + else + log " ERROR: failed to create $d" + fi + fi +done + +# Touch a marker so other tooling can detect that the one-shot ran. +MARKER=/var/lib/odoo/.odoo-init-done +log "Creating marker $MARKER" +if touch "$MARKER"; then + chown "$OG" "$MARKER" || true +else + log "WARNING: could not create marker $MARKER" +fi + +# Ensure the init script exists and is readable. If not, fail early with +# a clear exit code so upstream tooling can detect the problem. +if [ ! -r /init-odoo.sh ]; then + log "ERROR: /init-odoo.sh missing or not readable" + exit 2 +fi + +# Try to make it executable for the target user only if the file is writable. +# This avoids noisy "Read-only file system" errors when /init-odoo.sh is mounted +# read-only from the host. +if [ -w /init-odoo.sh ]; then + chmod +x /init-odoo.sh || log "WARNING: chmod /init-odoo.sh failed" +else + log "Skipping chmod: /init-odoo.sh is not writable (read-only mount)" +fi + +log "Executing init script as 'odoo' user" +# Run the init script as the odoo user while passing DB env vars inline so +# they are visible even when using su which doesn't preserve the current +# environment by default. +exec su -s /bin/sh -c "DB_NAME=\"$DB_NAME\" HOST=\"$HOST\" USER=\"$USER\" PASSWORD=\"$PASSWORD\" /init-odoo.sh" odoo +#!/bin/sh +set -eu + +OG="$(id -u odoo 2>/dev/null || id -u):$(id -g odoo 2>/dev/null || id -g)" + +echo "Fixing Odoo volumes to UID:GID=$OG" + +for d in /var/lib/odo /etc/odoo; do + echo " -> chown $OG $d" + chown -R "$OG" "$d" || true + ls -ldn "$d" || true +done + +# Execute the original init script as the 'odoo' user (we run this wrapper as root). +# When switching user with su, the target user's environment is reset; pass the +# needed DB env vars inline so the init script sees them. +exec su -s /bin/sh -c \ + "DB_NAME=\"$DB_NAME\" HOST=\"$HOST\" USER=\"$USER\" PASSWORD=\"$PASSWORD\" /init-odoo.sh" \ + odoo diff --git a/scripts/pgbackup/backup-script.sh b/scripts/pgbackup/backup-script.sh new file mode 100755 index 0000000..63ac601 --- /dev/null +++ b/scripts/pgbackup/backup-script.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +echo "Starting backup..." +BACKUP_DIR=/backups +DATE=$(date +%F) + +# Gitea +tar -czf $BACKUP_DIR/gitea-$DATE.tar.gz -C /backup gitea + +# Odoo +tar -czf $BACKUP_DIR/odoo-$DATE.tar.gz -C /backup odoo + +# OpenCloud +tar -czf $BACKUP_DIR/opencloud-$DATE.tar.gz -C /backup opencloud + +# PostgreSQL dump (all DBs) +pg_dump -h postgres -U admin -F c -b -v -f $BACKUP_DIR/postgres-$DATE.dump + +# Rotation: keep only 10 newest backups per service +for svc in gitea odoo opencloud postgres; do + ls -1t $BACKUP_DIR/${svc}-* | tail -n +11 | xargs -r rm -- +done +echo "Backup completed." diff --git a/scripts/postgres/init-db/10-create-roles.sh b/scripts/postgres/init-db/10-create-roles.sh new file mode 100755 index 0000000..ace916c --- /dev/null +++ b/scripts/postgres/init-db/10-create-roles.sh @@ -0,0 +1,33 @@ +#!/bin/sh +set -eu +set -o pipefail 2>/dev/null || true + +# Create application roles/users (idempotent). +# Runs early to ensure roles exist before databases are created. + +: "${GITEA_DB_USER:=gitea}" +: "${GITEA_DB_PASSWORD:=giteapass}" +: "${ODOO_DB_USER:=odoo}" +: "${ODOO_DB_PASSWORD:=odoopass}" + +echo "[init] create-roles: gitea_user=${GITEA_DB_USER}, odoo_user=${ODOO_DB_USER}" + +role_exists() { + psql -tAc "SELECT 1 FROM pg_roles WHERE rolname='$1'" | grep -q 1 || return 1 +} + +create_role() { + local role="$1"; shift + local pass="$1"; shift + if role_exists "$role"; then + echo "[init] role '$role' already exists, skipping" + else + echo "[init] creating role '$role'" + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -c "CREATE USER \"${role}\" WITH ENCRYPTED PASSWORD '${pass}';" + fi +} + +create_role "${GITEA_DB_USER}" "${GITEA_DB_PASSWORD}" +create_role "${ODOO_DB_USER}" "${ODOO_DB_PASSWORD}" + +echo "[init] create-roles finished" diff --git a/scripts/postgres/init-db/20-create-databases.sh b/scripts/postgres/init-db/20-create-databases.sh new file mode 100755 index 0000000..c069a19 --- /dev/null +++ b/scripts/postgres/init-db/20-create-databases.sh @@ -0,0 +1,45 @@ +#!/bin/sh +set -eu +set -o pipefail 2>/dev/null || true + +# Create application databases and ensure ownership and grants (idempotent). + +: "${GITEA_DB:=giteadb}" +: "${GITEA_DB_USER:=gitea}" +: "${ODOO_DB:=odoodb}" +: "${ODOO_DB_USER:=odoo}" + +echo "[init] create-databases: gitea_db=${GITEA_DB}, odoo_db=${ODOO_DB}" + +db_exists() { + psql -tAc "SELECT 1 FROM pg_database WHERE datname='$1'" | grep -q 1 || return 1 +} + +db_owner() { + psql -tAc "SELECT pg_catalog.pg_get_userbyid(datdba) FROM pg_database WHERE datname='$1'" | tr -d '[:space:]' +} + +create_or_alter_db() { + local db="$1"; shift + local owner="$1"; shift + + if db_exists "$db"; then + echo "[init] database '$db' already exists" + current_owner=$(db_owner "$db") || current_owner="" + if [ "$current_owner" != "$owner" ]; then + echo "[init] changing owner of '$db' from '$current_owner' to '$owner'" + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -c "ALTER DATABASE \"${db}\" OWNER TO \"${owner}\";" + fi + else + echo "[init] creating database '$db' with owner '$owner'" + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -c "CREATE DATABASE \"${db}\" OWNER \"${owner}\";" + fi + + echo "[init] granting privileges on ${db} to ${owner}" + psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -c "GRANT ALL PRIVILEGES ON DATABASE \"${db}\" TO \"${owner}\";" +} + +create_or_alter_db "${GITEA_DB}" "${GITEA_DB_USER}" +create_or_alter_db "${ODOO_DB}" "${ODOO_DB_USER}" + +echo "[init] create-databases finished" diff --git a/search/tika.yml b/search/tika.yml new file mode 100644 index 0000000..081f287 --- /dev/null +++ b/search/tika.yml @@ -0,0 +1,17 @@ +--- +services: + tika: + image: ${TIKA_IMAGE:-apache/tika:latest-full} + # release notes: https://tika.apache.org + networks: + opencloud-net: + restart: always + logging: + driver: ${LOG_DRIVER:-local} + + opencloud: + environment: + # fulltext search + SEARCH_EXTRACTOR_TYPE: tika + SEARCH_EXTRACTOR_TIKA_TIKA_URL: http://tika:9998 + FRONTEND_FULL_TEXT_SEARCH_ENABLED: "true" diff --git a/storage/decomposeds3.yml b/storage/decomposeds3.yml new file mode 100644 index 0000000..9845780 --- /dev/null +++ b/storage/decomposeds3.yml @@ -0,0 +1,15 @@ +--- +services: + opencloud: + environment: + # activate decomposeds3 storage driver + STORAGE_USERS_DRIVER: decomposeds3 + # keep system data on opencloud storage since this are only small files atm + STORAGE_SYSTEM_DRIVER: decomposed + # decomposeds3 specific settings + STORAGE_USERS_DECOMPOSEDS3_ENDPOINT: ${DECOMPOSEDS3_ENDPOINT:-http://minio:9000} + STORAGE_USERS_DECOMPOSEDS3_REGION: ${DECOMPOSEDS3_REGION:-default} + STORAGE_USERS_DECOMPOSEDS3_ACCESS_KEY: ${DECOMPOSEDS3_ACCESS_KEY:-opencloud} + STORAGE_USERS_DECOMPOSEDS3_SECRET_KEY: ${DECOMPOSEDS3_SECRET_KEY:-opencloud-secret-key} + STORAGE_USERS_DECOMPOSEDS3_BUCKET: ${DECOMPOSEDS3_BUCKET:-opencloud-bucket} + STORAGE_USERS_EVENTS_NUM_CONSUMERS: ${DECOMPOSEDS3_EVENTS_NUM_CONSUMERS:-5} \ No newline at end of file diff --git a/testing/external-keycloak.yml b/testing/external-keycloak.yml new file mode 100644 index 0000000..2808fa4 --- /dev/null +++ b/testing/external-keycloak.yml @@ -0,0 +1,46 @@ +--- +services: + postgres: + image: postgres:17-alpine + networks: + opencloud-net: + volumes: + - keycloak_postgres_data:/var/lib/postgresql/data + environment: + POSTGRES_DB: keycloak + POSTGRES_USER: ${KC_DB_USERNAME:-keycloak} + POSTGRES_PASSWORD: ${KC_DB_PASSWORD:-keycloak} + logging: + driver: ${LOG_DRIVER:-local} + restart: always + + keycloak: + image: quay.io/keycloak/keycloak:26.3.3 + networks: + opencloud-net: + command: [ "start", "--spi-connections-http-client-default-disable-trust-manager=${INSECURE:-false}", "--import-realm" ] + entrypoint: [ "/bin/sh", "/opt/keycloak/bin/docker-entrypoint-override.sh" ] + volumes: + - "./config/keycloak/docker-entrypoint-override.sh:/opt/keycloak/bin/docker-entrypoint-override.sh" + - "./config/keycloak/opencloud-realm-autoprovisioning.dist.json:/opt/keycloak/data/import-dist/openCloud-realm.json" + - "./config/keycloak/themes/opencloud:/opt/keycloak/themes/opencloud" + environment: + OC_DOMAIN: ${OC_DOMAIN:-cloud.opencloud.test} + KC_HOSTNAME: ${KEYCLOAK_DOMAIN:-keycloak.opencloud.test} + KC_DB: postgres + KC_DB_URL: "jdbc:postgresql://postgres:5432/keycloak" + KC_DB_USERNAME: ${KC_DB_USERNAME:-keycloak} + KC_DB_PASSWORD: ${KC_DB_PASSWORD:-keycloak} + KC_FEATURES: impersonation + KC_PROXY_HEADERS: xforwarded + KC_HTTP_ENABLED: true + KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-kcadmin} + KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-admin} + depends_on: + - postgres + logging: + driver: ${LOG_DRIVER:-local} + restart: always + +volumes: + keycloak_postgres_data: diff --git a/testing/ldap-manager.yml b/testing/ldap-manager.yml new file mode 100644 index 0000000..2374ffe --- /dev/null +++ b/testing/ldap-manager.yml @@ -0,0 +1,24 @@ +--- +# This file can be used to be added to the opencloud_full example +# to browse the LDAP server with a web interface. +# This is not a production ready setup. +services: + ldap-manager: + image: phpldapadmin/phpldapadmin:latest + networks: + opencloud-net: + environment: + LDAP_HOST: ldap-server + LDAP_PORT: 1389 + LDAP_LOGIN_OBJECTCLASS: "inetOrgPerson" + APP_URL: "https://${LDAP_MANAGER_DOMAIN:-ldap.opencloud.test}" + labels: + - "traefik.enable=true" + - "traefik.http.routers.ldap-manager.entrypoints=https" + - "traefik.http.routers.ldap-manager.rule=Host(`${LDAP_MANAGER_DOMAIN:-ldap.opencloud.test}`)" + - "traefik.http.routers.ldap-manager.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.ldap-manager.service=ldap-manager" + - "traefik.http.services.ldap-manager.loadbalancer.server.port=8080" + logging: + driver: ${LOG_DRIVER:-local} + restart: always \ No newline at end of file diff --git a/traefik/collabora.yml b/traefik/collabora.yml new file mode 100644 index 0000000..74182ee --- /dev/null +++ b/traefik/collabora.yml @@ -0,0 +1,24 @@ +--- +services: + traefik: + networks: + opencloud-net: + aliases: + - ${COLLABORA_DOMAIN:-collabora.opencloud.test} + - ${WOPISERVER_DOMAIN:-wopiserver.opencloud.test} + collaboration: + labels: + - "traefik.enable=true" + - "traefik.http.routers.collaboration.entrypoints=https" + - "traefik.http.routers.collaboration.rule=Host(`${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}`)" + - "traefik.http.routers.collaboration.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.collaboration.service=collaboration" + - "traefik.http.services.collaboration.loadbalancer.server.port=9300" + collabora: + labels: + - "traefik.enable=true" + - "traefik.http.routers.collabora.entrypoints=https" + - "traefik.http.routers.collabora.rule=Host(`${COLLABORA_DOMAIN:-collabora.opencloud.test}`)" + - "traefik.http.routers.collabora.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.collabora.service=collabora" + - "traefik.http.services.collabora.loadbalancer.server.port=9980" diff --git a/traefik/gitea.yml b/traefik/gitea.yml new file mode 100644 index 0000000..985796e --- /dev/null +++ b/traefik/gitea.yml @@ -0,0 +1,15 @@ +--- +services: + traefik: + networks: + opencloud-net: + aliases: + - ${GITEA_DOMAIN:-git.opencloud.test} + gitea: + labels: + - "traefik.enable=true" + - "traefik.http.routers.gitea.entrypoints=https" + - "traefik.http.routers.gitea.rule=Host(`git.opencloud.test`)" + - "traefik.http.routers.gitea.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.gitea.service=gitea" + - "traefik.http.services.gitea.loadbalancer.server.port=3000" diff --git a/traefik/ldap-keycloak.yml b/traefik/ldap-keycloak.yml new file mode 100644 index 0000000..1905e8e --- /dev/null +++ b/traefik/ldap-keycloak.yml @@ -0,0 +1,15 @@ +--- +services: + traefik: + networks: + opencloud-net: + aliases: + - ${KEYCLOAK_DOMAIN:-keycloak.opencloud.test} + keycloak: + labels: + - "traefik.enable=true" + - "traefik.http.routers.keycloak.entrypoints=https" + - "traefik.http.routers.keycloak.rule=Host(`${KEYCLOAK_DOMAIN:-keycloak.opencloud.test}`)" + - "traefik.http.routers.keycloak.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.keycloak.service=keycloak" + - "traefik.http.services.keycloak.loadbalancer.server.port=8080" diff --git a/traefik/opencloud.yml b/traefik/opencloud.yml new file mode 100644 index 0000000..3dafafd --- /dev/null +++ b/traefik/opencloud.yml @@ -0,0 +1,16 @@ +--- +services: + opencloud: + labels: + - "traefik.enable=true" + - "traefik.http.routers.opencloud.entrypoints=https" + - "traefik.http.routers.opencloud.rule=Host(`${OC_DOMAIN:-cloud.opencloud.test}`)" + - "traefik.http.routers.opencloud.service=opencloud" + - "traefik.http.services.opencloud.loadbalancer.server.port=9200" + - "traefik.http.routers.opencloud.${TRAEFIK_SERVICES_TLS_CONFIG}" + traefik: + image: traefik:v3 + networks: + opencloud-net: + aliases: + - ${OC_DOMAIN:-cloud.opencloud.test} diff --git a/traefik/openproject.yml b/traefik/openproject.yml new file mode 100644 index 0000000..fce44dc --- /dev/null +++ b/traefik/openproject.yml @@ -0,0 +1,15 @@ +--- +services: + traefik: + networks: + opencloud-net: + aliases: + - ${OPENPROJECT_DOMAIN:-project.opencloud.test} + openproject: + labels: + - "traefik.enable=true" + - "traefik.http.routers.openproject.entrypoints=https" + - "traefik.http.routers.openproject.rule=Host(`${OPENPROJECT_DOMAIN:-project.opencloud.test}`)" + - "traefik.http.routers.openproject.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.openproject.service=openproject" + - "traefik.http.services.openproject.loadbalancer.server.port=8080" diff --git a/traefik/planka.yml b/traefik/planka.yml new file mode 100644 index 0000000..ff4e3eb --- /dev/null +++ b/traefik/planka.yml @@ -0,0 +1,15 @@ +--- +services: + traefik: + networks: + opencloud-net: + aliases: + - ${PLANKA_DOMAIN:-project.opencloud.test} + planka: + labels: + - "traefik.enable=true" + - "traefik.http.routers.planka.entrypoints=https" + - "traefik.http.routers.planka.rule=Host(`${PLANKA_DOMAIN:-project.opencloud.test}`)" + - "traefik.http.routers.planka.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.planka.service=planka" + - "traefik.http.services.planka.loadbalancer.server.port=1337" diff --git a/traefik/vikunja.yml b/traefik/vikunja.yml new file mode 100644 index 0000000..250719b --- /dev/null +++ b/traefik/vikunja.yml @@ -0,0 +1,15 @@ +--- +services: + traefik: + networks: + opencloud-net: + aliases: + - ${VIKUNJA_DOMAIN:-project.opencloud.test} + vikunja: + labels: + - "traefik.enable=true" + - "traefik.http.routers.vikunja.entrypoints=https" + - "traefik.http.routers.vikunja.rule=Host(`${VIKUNJA_DOMAIN:-project.opencloud.test}`)" + - "traefik.http.routers.vikunja.${TRAEFIK_SERVICES_TLS_CONFIG}" + - "traefik.http.routers.vikunja.service=vikunja" + - "traefik.http.services.vikunja.loadbalancer.server.port=3456" diff --git a/version-control/README.md b/version-control/README.md new file mode 100644 index 0000000..c62a1e0 --- /dev/null +++ b/version-control/README.md @@ -0,0 +1,172 @@ +# Gitea Version Control + +This directory contains the Docker Compose configuration for Gitea, a self-hosted Git service. + +## Overview + +Gitea is configured with: +- PostgreSQL database backend +- SSH access on port 2222 +- HTTPS access via Traefik reverse proxy +- Persistent data storage + +## SSH Access + +Gitea SSH is accessible on **port 2222** (mapped from container port 22) to avoid conflicts with the host SSH service. + +### Prerequisites + +1. **Generate an SSH key** (if you don't have one): + ```bash + ssh-keygen -t ed25519 -C "your_email@example.com" + ``` + +2. **Add your public key to Gitea**: + - Go to https://git.opencloud.test (or your configured domain) + - Log in to your account + - Click your avatar (top right) → **Settings** + - Go to **SSH / GPG Keys** tab + - Click **Add Key** + - Paste your public key (found in `~/.ssh/id_ed25519.pub`) + - Give it a descriptive name + - Click **Add Key** + +### SSH Configuration + +To use Git with the standard SSH syntax (without specifying port 2222 each time), add this to your `~/.ssh/config`: + +``` +Host git.opencloud.test + Port 2222 + User git + IdentityFile ~/.ssh/id_ed25519 +``` + +Replace `IdentityFile` with the path to your private key if different. + +### Test SSH Connection + +```bash +ssh -T git@git.opencloud.test +``` + +You should see: +``` +Hi there, ! You've successfully authenticated with the key named , +but Gitea does not provide shell access. +``` + +### Using Git with SSH + +Once SSH is configured, you can use standard Git commands: + +**Clone a repository:** +```bash +git clone git@git.opencloud.test:username/repo.git +``` + +**Add a remote:** +```bash +git remote add origin git@git.opencloud.test:username/repo.git +``` + +**Push changes:** +```bash +git push origin main +``` + +**Pull changes:** +```bash +git pull origin main +``` + +### Without SSH Config + +If you prefer not to modify your SSH config, you can specify the port in the URL: + +```bash +# Clone +git clone ssh://git@git.opencloud.test:2222/username/repo.git + +# Add remote +git remote add origin ssh://git@git.opencloud.test:2222/username/repo.git + +# Or test connection +ssh -T -p 2222 git@git.opencloud.test +``` + +## HTTPS Access + +Gitea web interface is available at: +- Local development: https://git.opencloud.test +- Production: https://your-configured-domain + +You can also clone repositories via HTTPS if SSH is not available: +```bash +git clone https://git.opencloud.test/username/repo.git +``` + +## Configuration + +Key environment variables (configured in `.env`): + +| Variable | Description | Default | +|----------|-------------|---------| +| `GITEA_HOST` | Domain for Gitea | `git.opencloud.test` | +| `GITEA_DB` | Database name | `giteadb` | +| `GITEA_DB_USER` | Database user | `giteauser` | +| `GITEA_DB_PASSWORD` | Database password | `giteapass` | + +## Troubleshooting + +### SSH Connection Refused + +If you get "Connection refused": +1. Check that the Gitea container is running: `docker ps | grep gitea` +2. Verify port mapping: `docker ps -f name=gitea --format "{{.Ports}}"` +3. Should show: `0.0.0.0:2222->22/tcp` + +### Permission Denied (publickey) + +If you get "Permission denied (publickey)": +1. Ensure you've added your SSH public key to your Gitea account +2. Verify the correct key is being used: + ```bash + ssh -vT git@git.opencloud.test + ``` +3. Check your `~/.ssh/config` points to the correct `IdentityFile` + +### Wrong Port in Git URLs + +If you created repositories before configuring SSH, you may need to update the remote URL: + +```bash +# Check current remote +git remote -v + +# Update to use correct format +git remote set-url origin git@git.opencloud.test:username/repo.git +``` + +## Data Persistence + +Gitea data is stored in the Docker volume `gitea_data`, which includes: +- Git repositories +- SQLite database (if not using PostgreSQL) +- Configuration files +- Avatars and attachments + +To backup: +```bash +docker run --rm -v gitea_data:/data -v $(pwd)/backup:/backup alpine tar czf /backup/gitea_data.tar.gz -C /data . +``` + +To restore: +```bash +docker run --rm -v gitea_data:/data -v $(pwd)/backup:/backup alpine tar xzf /backup/gitea_data.tar.gz -C /data +``` + +## Additional Resources + +- [Gitea Documentation](https://docs.gitea.io/) +- [Gitea SSH Configuration](https://docs.gitea.io/en-us/install-with-docker/#ssh-container-passthrough) diff --git a/version-control/gitea.yml b/version-control/gitea.yml new file mode 100644 index 0000000..aba7227 --- /dev/null +++ b/version-control/gitea.yml @@ -0,0 +1,31 @@ +--- +services: + gitea: + image: gitea/gitea:latest + container_name: gitea + restart: always + environment: + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=postgres:5432 + - GITEA__database__NAME=${GITEA_DB} + - GITEA__database__USER=${GITEA_DB_USER} + - GITEA__database__PASSWD=${GITEA_DB_PASSWORD} + - GITEA__server__ROOT_URL=${GITEA_ROOT_URL:-https://${GITEA_HOST:-git.opencloud.test}/} + - GITEA__server__DOMAIN=${GITEA_HOST:-git.opencloud.test} + - GITEA__server__SSH_DOMAIN=${GITEA_HOST:-git.opencloud.test} + - GITEA__server__SSH_PORT=${GITEA_SSH_PORT:-2222} + - USER_UID=1000 + - USER_GID=1000 + volumes: + - gitea_data:/data + ports: + - "2222:22" + labels: + - "traefik.enable=true" + - "traefik.http.routers.gitea.entrypoints=https" + - "traefik.http.routers.gitea.rule=Host(`${GITEA_HOST:-git.opencloud.test}`)" + - "traefik.http.services.gitea.loadbalancer.server.port=3000" + - "traefik.http.routers.gitea.service=gitea" + - "traefik.http.routers.gitea.${TRAEFIK_SERVICES_TLS_CONFIG}" +volumes: + gitea_data: diff --git a/weboffice/collabora.yml b/weboffice/collabora.yml new file mode 100644 index 0000000..fe697f8 --- /dev/null +++ b/weboffice/collabora.yml @@ -0,0 +1,75 @@ +--- +services: + + opencloud: + environment: + # this is needed for setting the correct CSP header + COLLABORA_DOMAIN: ${COLLABORA_DOMAIN:-collabora.opencloud.test} + # expose nats and the reva gateway for the collaboration service + NATS_NATS_HOST: 0.0.0.0 + GATEWAY_GRPC_ADDR: 0.0.0.0:9142 + # make collabora the secure view app + FRONTEND_APP_HANDLER_SECURE_VIEW_APP_ADDR: eu.opencloud.api.collaboration.CollaboraOnline + GRAPH_AVAILABLE_ROLES: "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6" + + collaboration: + image: ${OC_DOCKER_IMAGE:-opencloudeu/opencloud-rolling}:${OC_DOCKER_TAG:-latest} + networks: + opencloud-net: + depends_on: + opencloud: + condition: service_started + collabora: + condition: service_healthy + entrypoint: + - /bin/sh + command: [ "-c", "opencloud collaboration server" ] + environment: + COLLABORATION_GRPC_ADDR: 0.0.0.0:9301 + COLLABORATION_HTTP_ADDR: 0.0.0.0:9300 + MICRO_REGISTRY: "nats-js-kv" + MICRO_REGISTRY_ADDRESS: "opencloud:9233" + COLLABORATION_WOPI_SRC: https://${WOPISERVER_DOMAIN:-wopiserver.opencloud.test} + COLLABORATION_APP_NAME: "CollaboraOnline" + COLLABORATION_APP_PRODUCT: "Collabora" + COLLABORATION_APP_ADDR: https://${COLLABORA_DOMAIN:-collabora.opencloud.test} + COLLABORATION_APP_ICON: https://${COLLABORA_DOMAIN:-collabora.opencloud.test}/favicon.ico + COLLABORATION_APP_INSECURE: "${INSECURE:-true}" + COLLABORATION_CS3API_DATAGATEWAY_INSECURE: "${INSECURE:-true}" + COLLABORATION_LOG_LEVEL: ${LOG_LEVEL:-info} + OC_URL: https://${OC_DOMAIN:-cloud.opencloud.test} + volumes: + # configure the .env file to use own paths instead of docker internal volumes + - ${OC_CONFIG_DIR:-opencloud-config}:/etc/opencloud + logging: + driver: ${LOG_DRIVER:-local} + restart: always + + collabora: + image: collabora/code:25.04.4.2.1 + # release notes: https://www.collaboraonline.com/release-notes/ + networks: + opencloud-net: + environment: + aliasgroup1: https://${WOPISERVER_DOMAIN:-wopiserver.opencloud.test}:443 + DONT_GEN_SSL_CERT: "YES" + extra_params: | + --o:ssl.enable=${COLLABORA_SSL_ENABLE:-true} \ + --o:ssl.ssl_verification=${COLLABORA_SSL_VERIFICATION:-true} \ + --o:ssl.termination=true \ + --o:welcome.enable=false \ + --o:net.frame_ancestors=${OC_DOMAIN:-cloud.opencloud.test} + username: ${COLLABORA_ADMIN_USER:-admin} + password: ${COLLABORA_ADMIN_PASSWORD:-admin} + cap_add: + - MKNOD + logging: + driver: ${LOG_DRIVER:-local} + restart: always + entrypoint: ['/bin/bash', '-c'] + command: ['coolconfig generate-proof-key && /start-collabora-online.sh'] + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:9980/hosting/discovery" ] + interval: 15s + timeout: 10s + retries: 5