Skip to content

Commit

Permalink
Add dummy script to deploy configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dantefromhell authored Dec 18, 2023
1 parent 17fa80b commit 0eaf5d7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions base/docker-entrypoint.d/95-configure-humhub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
# This script reads configuration options for a file provided via environment variable
# HUMHUB_CONFIG_FILE and applies the settings sequentially to this container during startup.

#TODO: Disable when mature
set -x

echo "Configuring HumHub options"
CONFIG_FILE="${HUMHUB_CONFIG_FILE:-none}"

# Stop if nothing needs to be done.
if [[ "${CONFIG_FILE}" == "none" ]]; then
echo -e "No config file (or name none) provided, aborting..."
exit 0
fi

# Check the file actually exists and is readable and has content.
if [[ ! -r "${CONFIG_FILE}" ]]; then
echo -e "Config file ${CONFIG_FILE} either does not exist or is not readable."
fi
if [[ ! -s "${CONFIG_FILE}" ]]; then
echo -e "Config file ${CONFIG_FILE} seems to be empty."
fi

# Actually do the stuff.
grep -v '^#' "${CONFIG_FILE}" | while read -r LINE; do
# su -s /bin/sh nginx -c "php yii settings/set "${moduleId}" "${name}" "${value}" --interactive=0"
# su -s /bin/sh nginx -c "php yii settings/set ${LINE} --interactive=0"
echo -e "Found config line: ${LINE}"
done

0 comments on commit 0eaf5d7

Please sign in to comment.