In between commit LDAP integration

This commit is contained in:
2025-01-21 14:09:06 +01:00
parent 02ae02634b
commit 936fdbad66
14 changed files with 144 additions and 119 deletions

View File

@@ -11,7 +11,7 @@ services:
PDS_ADMIN_EMAIL: "{{bluesky_administrator_email}}"
PDS_SERVICE_DID: "did:web:{{domain_api}}"
# See https://mattdyson.org/blog/2024/11/self-hosting-bluesky-pds/
PDS_SERVICE_HANDLE_DOMAINS: ".{{top_domain}}"
PDS_SERVICE_HANDLE_DOMAINS: ".{{primary_domain}}"
PDS_JWT_SECRET: "{{bluesky_pds_jwt_secret}}"
PDS_ADMIN_PASSWORD: "{{bluesky_pds_admin_password}}"
PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: "{{bluesky_pds_plc_rotation_key_k256_private_key_hex}}"
@@ -47,7 +47,7 @@ services:
args:
REACT_APP_PDS_URL: "http://{{domain_api}}" # URL des PDS
REACT_APP_API_URL: "http://{{domain_api}}" # API-URL des PDS
REACT_APP_SITE_NAME: "{{top_domain | upper}} - Bluesky"
REACT_APP_SITE_NAME: "{{primary_domain | upper}} - Bluesky"
REACT_APP_SITE_DESCRIPTION: "Decentral Social "
restart: {{docker_restart_policy}}
ports:

View File

@@ -1,36 +1,42 @@
version: '2'
networks:
my-network:
driver: bridge
services:
openldap:
image: bitnami/openldap:2
ports:
- '389:1389'
- '636:1636'
environment:
- LDAP_ADMIN_USERNAME=admin
- LDAP_ADMIN_PASSWORD=adminpassword
- LDAP_USERS=user01,user02 # Comma separated list of LDAP users to create in the default LDAP tree. Default: user01,user02
- LDAP_PASSWORDS=password1,password2 #Comma separated list of passwords to use for LDAP users. Default: bitnami1,bitnami2
- LDAP_ROOT=dc=example,dc=org
- LDAP_ADMIN_DN=cn=admin,dc=example,dc=org
{% include 'templates/docker/services/' + database_type + '.yml.j2' %}
- MARIADB_ROOT_PASSWORD=root-password
- MARIADB_GALERA_MARIABACKUP_PASSWORD=backup-password
- MARIADB_USER=customuser
- MARIADB_DATABASE=customdatabase
- MARIADB_ENABLE_LDAP=yes
networks:
- my-network
openldap:
image: bitnami/openldap:{{ldap_version}}
logging:
driver: journald
restart: {{docker_restart_policy}}
ports:
- '127.0.0.1:389:1389' # Expose just on local host for security reasons
- '636:636' # Expose to internet
environment:
# GENERAL
LDAP_ADMIN_USERNAME: {{ldap_administrator_username}} # LDAP database admin user.
LDAP_ADMIN_PASSWORD: {{ldap_administrator_password}} # LDAP database admin password.
#LDAP_USERS: user01,user02 # Comma separated list of LDAP users to create in the default LDAP tree. Default: user01,user02
#LDAP_PASSWORDS: password1,password2 # Comma separated list of passwords to use for LDAP users. Default: bitnami1,bitnami
LDAP_ROOT: {{ldap_root}} # LDAP baseDN (or suffix) of the LDAP tree. Default: dc=example,dc=org
LDAP_ADMIN_DN: {{ldap_admin_dn}}
# TLS
LDAP_ENABLE_TLS: yes # Whether to enable TLS for traffic or not. Defaults to no
LDAP_REQUIRE_TLS: yes # Whether connections must use TLS. Will only be applied with LDAP_ENABLE_TLS active. Defaults to no
LDAP_LDAPS_PORT_NUMBER: 636 # Port used for TLS secure traffic. Priviledged port is supported (e.g. 636). Default: 1636 (non privileged port).
LDAP_TLS_CERT_FILE: File containing the certificate file for the TLS traffic. No defaults.
LDAP_TLS_KEY_FILE: File containing the key for certificate. No defaults.
LDAP_TLS_CA_FILE: File containing the CA of the certificate. No defaults.
LDAP_TLS_DH_PARAMS_FILE: File containing the DH parameters. No defaults.
# Database Configuration
MARIADB_ROOT_PASSWORD=root-password
MARIADB_USER=customuser
MARIADB_DATABASE=customdatabase
MARIADB_ENABLE_LDAP=yes
volumes:
- 'openldap_data:/bitnami/openldap'
myapp:
image: 'YOUR_APPLICATION_IMAGE'
networks:
- my-network
volumes:
openldap_data:
driver: local
- 'data:/bitnami/openldap'
{% include 'templates/docker/container/depends-on-just-database.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
{% include 'templates/docker/compose/volumes.yml.j2' %}
data:
{% include 'templates/docker/compose/networks.yml.j2' %}

View File

@@ -0,0 +1,5 @@
docker_compose_project_name: "ldap"
database_type: "postgres"
database_password: "{{ldap_database_password}}"
ldap_root: "dc={{primary_domain_sld}},dc={{primary_domain_tld}}"
ldap_admin_dm: "cn={{ldap_administrator_username}},{{ldap_root}}"

View File

@@ -68,7 +68,7 @@
- name: execute database migration
command:
cmd: "docker compose -p mailu exec admin flask mailu admin admin {{top_domain}} {{mailu_initial_root_password}}"
cmd: "docker compose -p mailu exec admin flask mailu admin admin {{primary_domain}} {{mailu_initial_root_password}}"
chdir: "{{docker_compose_instance_directory}}"
ignore_errors: true
when: mode_setup |bool

View File

@@ -5,7 +5,7 @@
"server_name": "{{domain_matrix_synapse}}"
},
"m.identity_server": {
"base_url": "https://{{top_domain}}"
"base_url": "https://{{primary_domain}}"
}
},
"brand": "Element",

View File

@@ -8,8 +8,8 @@
### Multi Domain Installation
If you want to access your mybb over multiple domains, keep the following in mind:
- Set Cookie Domain to nothing
- Access mybb for installation via mybb.<top_domain>
- Set the Board Url to mybb.<top_domain>
- Access mybb for installation via mybb.<primary_domain>
- Set the Board Url to mybb.<primary_domain>
### Manual Installation of MyBB Plugins

View File

@@ -3,6 +3,6 @@ docker_compose_project_name: "mybb"
docker_compose_instance_confd_directory: "{{docker_compose_instance_directory}}conf.d/"
docker_compose_instance_confd_defaultconf_file: "{{docker_compose_instance_confd_directory}}default.conf"
target_mount_conf_d_directory: "{{nginx_servers_directory}}"
source_domain: "mybb.{{top_domain}}"
source_domain: "mybb.{{primary_domain}}"
database_password: "{{mybb_database_password}}"
database_type: "mariadb"

View File

@@ -3,5 +3,5 @@ more_set_headers "Content-Security-Policy: ";
# sub filters to integrate matomo tracking code in nginx websites
sub_filter '</head>' '<script>{{matomo_tracking_code_one_liner}}</script></head>';
sub_filter '</body>' '<noscript><p><img src="//matomo.{{top_domain}}/matomo.php?idsite={{matomo_site_id}}&rec=1" style="border:0;" alt="" /></p></noscript></body>';
sub_filter '</body>' '<noscript><p><img src="//matomo.{{primary_domain}}/matomo.php?idsite={{matomo_site_id}}&rec=1" style="border:0;" alt="" /></p></noscript></body>';
sub_filter_once off;

View File

@@ -1,2 +1,2 @@
matomo_domain: "matomo.{{top_domain}}"
matomo_domain: "matomo.{{primary_domain}}"
base_domain: "{{ domain | regex_replace('^(?:.*\\.)?(.+\\..+)$', '\\1') }}"

View File

@@ -14,7 +14,7 @@ This Ansible role configures an Nginx server to serve a static homepage. It hand
- `nginx_homepage_root`: The directory where the homepage content will be stored (default: `/usr/share/nginx/homepage`)
- `domain`: The domain name for the Nginx server configuration
- `administrator_email`: The email used for SSL certificate registration with Let's Encrypt
- `nginx_homepage_repository_address`: The Git repository address containing the homepage content
- `nginx_static_repository_address`: The Git repository address containing the homepage content
## Dependencies

View File

@@ -1,16 +1,16 @@
---
- name: "pull homepage from {{nginx_homepage_repository_address}}"
- name: "pull homepage from {{nginx_static_repository_address}}"
git:
repo: "{{nginx_homepage_repository_address}}"
repo: "{{nginx_static_repository_address}}"
dest: "{{nginx_homepage_root}}"
update: yes
ignore_errors: true
- name: configure {{top_domain}}.conf
- name: configure {{primary_domain}}.conf
template:
src: "static.nginx.conf.j2"
dest: "{{nginx_servers_directory}}{{top_domain}}.conf"
dest: "{{nginx_servers_directory}}{{primary_domain}}.conf"
vars:
domain: "{{top_domain}}"
domain: "{{primary_domain}}"
notify: restart nginx
when: run_once_nginx is not defined

View File

@@ -33,7 +33,7 @@
include_tasks: certbot-matomo.yml
when: run_once_nginx is not defined
vars:
domain: "{{top_domain}}"
domain: "{{primary_domain}}"
when: run_once_nginx is not defined
- name: flush nginx service