Finishing make app refactor.
This commit is contained in:
4
all-apps/nextcloud/34/Caddyfile
Normal file
4
all-apps/nextcloud/34/Caddyfile
Normal file
@@ -0,0 +1,4 @@
|
||||
{$nextcloud_SUBDOMAIN}.{$ROOT_DOMAIN} {
|
||||
import maintenance_intercept
|
||||
reverse_proxy http://nextcloud:80
|
||||
}
|
||||
23
all-apps/nextcloud/34/Makefile
Normal file
23
all-apps/nextcloud/34/Makefile
Normal file
@@ -0,0 +1,23 @@
|
||||
IMAGE_DEPS := $(IMAGE_DEPS) \
|
||||
app/nextcloud/nextcloud_admin_user \
|
||||
app/nextcloud/nextcloud_admin_password \
|
||||
app/nextcloud/postgres_db \
|
||||
app/nextcloud/postgres_user \
|
||||
app/nextcloud/postgres_password \
|
||||
app/nextcloud/redis_password \
|
||||
app/nextcloud/nextcloud.env
|
||||
|
||||
app/nextcloud/nextcloud_admin_user: $(apps_config)
|
||||
bash -c 'source $(apps_config); printf "%s\n" "$$NEXTCLOUD_ADMIN_USER" > $@'
|
||||
app/nextcloud/nextcloud_admin_password: $(apps_config)
|
||||
bash -c 'source $(apps_config); printf "%s\n" "$$NEXTCLOUD_ADMIN_PASSWORD" > $@'
|
||||
app/nextcloud/postgres_db: $(apps_config)
|
||||
bash -c 'source ./$(apps_config); printf "%s\n" "$$NEXTCLOUD_POSTGRES_DB" > $@'
|
||||
app/nextcloud/postgres_user: $(apps_config)
|
||||
bash -c 'source ./$(apps_config); printf "%s\n" "$$NEXTCLOUD_POSTGRES_USER" > $@'
|
||||
app/nextcloud/postgres_password: $(apps_config)
|
||||
bash -c 'source ./$(apps_config); printf "%s\n" "$$NEXTCLOUD_POSTGRES_PASSWORD" > $@'
|
||||
app/nextcloud/redis_password: $(apps_config)
|
||||
bash -c 'source ./$(apps_config); printf "%s\n" "$$NEXTCLOUD_REDIS_PASSWORD" > $@'
|
||||
app/nextcloud/nextcloud.env: $(apps_config) app/nextcloud/nextcloud.env.tmpl app/nextcloud/make-nextcloud-env.sh
|
||||
./app/nextcloud/make-nextcloud-env.sh $(apps_config)
|
||||
31
all-apps/nextcloud/34/make-nextcloud-env.sh
Executable file
31
all-apps/nextcloud/34/make-nextcloud-env.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
. $1 # source the apps.config file with then env vars
|
||||
|
||||
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
|
||||
|
||||
# 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
|
||||
Reference in New Issue
Block a user