Files
app/all-apps/nextcloud/34/make-nextcloud-env.sh

48 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2025-08-31 09:49:35 -07:00
#!/bin/bash
2026-07-10 17:06:01 -07:00
# 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/>.
2025-08-31 09:49:35 -07:00
set -e
2025-09-15 15:00:26 -07:00
. $1 # source the apps.config file with then env vars
2025-08-31 09:49:35 -07:00
read -r -a APP_CONFIGS <<< "$APP_CONFIGS"
nextcloud_subdomain=
for config_string in ${APP_CONFIGS[@]}; do
IFS=','
read -r -a config <<< "$config_string"
app=${config[0]}
subdomain=${config[1]}
if [ "$app" = "nextcloud" ]; then
nextcloud_subdomain="$subdomain"
fi
done
# write container env file
echo "DOMAIN=\"$nextcloud_subdomain.$ROOT_DOMAIN\"" > app/nextcloud/nextcloud.env
cat app/nextcloud/nextcloud.env.tmpl >> app/nextcloud/nextcloud.env
2025-12-08 10:11:29 -08:00
# write secrets
echo "$NEXTCLOUD_POSTGRES_DB" > app/nextcloud/nextcloud_postgres_db
echo "$NEXTCLOUD_POSTGRES_USER" > app/nextcloud/nextcloud_postgres_user
echo "$NEXTCLOUD_POSTGRES_PASSWORD" > app/nextcloud/nextcloud_postgres_password
echo "$NEXTCLOUD_REDIS_PASSWORD" > app/nextcloud/nextcloud_redis_password