49 lines
1.7 KiB
Bash
Executable File
49 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright 2025-2026 Thomas Hintz
|
|
|
|
# This file is part of Nassella.
|
|
|
|
# Nassella is free software: you can redistribute it and/or modify it under the
|
|
# terms of the GNU Affero General Public License as published by the Free
|
|
# Software Foundation, either version 3 of the License, or (at your option) any
|
|
# later version.
|
|
|
|
# Nassella 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 Affero General Public License
|
|
# along with Nassella. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
set -e
|
|
|
|
. $1 # source the apps.config file with then env vars
|
|
|
|
read -r -a APP_CONFIGS <<< "$APP_CONFIGS"
|
|
|
|
ghost_subdomain=
|
|
|
|
for config_string in ${APP_CONFIGS[@]}; do
|
|
IFS=','
|
|
read -r -a config <<< "$config_string"
|
|
|
|
app=${config[0]}
|
|
subdomain=${config[1]}
|
|
|
|
if [ "$app" = "ghost" ]; then
|
|
ghost_subdomain="$subdomain"
|
|
fi
|
|
done
|
|
|
|
# write compose env file
|
|
echo "GHOST_DOMAIN=\"$ghost_subdomain.$ROOT_DOMAIN\"" > app/ghost/.compose-env
|
|
echo "GHOST_DATABASE_ROOT_PASSWORD=\"$GHOST_DATABASE_ROOT_PASSWORD\"" >> app/ghost/.compose-env
|
|
echo "GHOST_DATABASE_PASSWORD=\"$GHOST_DATABASE_PASSWORD\"" >> app/ghost/.compose-env
|
|
echo "mail__options__host=\"$SMTP_HOST\"" >> app/ghost/.compose-env
|
|
echo "mail__options__port=\"$SMTP_PORT\"" >> app/ghost/.compose-env
|
|
echo "mail__options__auth__user=\"$SMTP_AUTH_USER\"" >> app/ghost/.compose-env
|
|
echo "mail__options__auth__pass=\"$SMTP_AUTH_PASSWORD\"" >> app/ghost/.compose-env
|
|
echo "mail__from=\"$SMTP_FROM\"" >> app/ghost/.compose-env
|
|
cat app/ghost/.compose.env.tmpl >> app/ghost/.compose-env
|