mirror of
https://github.com/zokradonh/kopano-docker.git
synced 2026-08-11 16:32:59 +00:00
prepare ldap for multiserver (#169)
* add multi-server attributes to ldif * add example compose file for a multiserver * add readme * add script for database creation within the existing database instance * add generation of admin.pem * add own certificate for kopano_server_2 * add admin.pem to compose (only for multiserver) * add spooler for 2nd node * add link to ldap demo readme
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Database helpers
|
||||
|
||||
# create-multiple-databases.sh
|
||||
|
||||
Script to create additional databases during the initial container startup. Based on https://github.com/mrts/docker-postgresql-multiple-databases.
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
mysql=${mysql:?}
|
||||
|
||||
function create_user_and_database() {
|
||||
local database=$1
|
||||
echo " Creating database '$database'"
|
||||
echo "CREATE DATABASE IF NOT EXISTS ${database};" | "${mysql[@]}"
|
||||
echo "GRANT ALL PRIVILEGES ON ${database}.* TO '${MYSQL_USER}';" | "${mysql[@]}"
|
||||
}
|
||||
|
||||
if [ -n "$MYSQL_ADDITIONAL_DATABASES" ]; then
|
||||
echo "Multiple database creation requested: $MYSQL_ADDITIONAL_DATABASES"
|
||||
for db in $(echo "$MYSQL_ADDITIONAL_DATABASES" | tr ',' ' '); do
|
||||
create_user_and_database "$db"
|
||||
done
|
||||
echo "Additional databases created"
|
||||
fi
|
||||
Reference in New Issue
Block a user