From de642d462df68402611d91d80ac46cf72a8ae18e Mon Sep 17 00:00:00 2001 From: soup-bowl Date: Tue, 31 Jan 2023 21:30:16 +0000 Subject: [PATCH] Added more region env support. --- beta/alpine-beta/docker-entrypoint.sh | 12 +++++++++--- build/latest/docker-entrypoint.sh | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/beta/alpine-beta/docker-entrypoint.sh b/beta/alpine-beta/docker-entrypoint.sh index 2f2ddfa..7685e91 100755 --- a/beta/alpine-beta/docker-entrypoint.sh +++ b/beta/alpine-beta/docker-entrypoint.sh @@ -19,9 +19,11 @@ if [ ! -e OpenSim.ini ]; then StorageProvider = \"OpenSim.Data.MySQL.dll\" ConectionString = \"Data Source=${MYSQL_SERVER:-db};Database=${MYSQL_DATABASE:-opensim};User ID=${MYSQL_USER:-root};Password=${MYSQL_PASSWORD};Old Guids=true;\"" >> OpenSim.ini fi +else + echo >&2 "INFO: OpenSimulator general configuration found. Skipping..." fi -if [ ! -e config-include/StandaloneCommon.ini ]; then +if [ ! -e config-include/StandaloneCommon.ini ] || [ ! -e config-include/GridCommon.ini ]; then echo >&2 "INFO: No Grid Common configuration found, pulling one together." cp defaults/StandaloneCommon.ini config-include/StandaloneCommon.ini @@ -45,6 +47,8 @@ if [ ! -e config-include/StandaloneCommon.ini ]; then if [ -n "${GRID_NAME}" ]; then sed -i -e "s/OpenSimulator Instance/${GRID_NAME}/g" config-include/StandaloneCommon.ini fi +else + echo >&2 "INFO: Standalone or Grid configuration found. Skipping..." fi if [ `find Regions -maxdepth 1 -name '*.ini' | wc -l` -eq 0 ]; then @@ -52,11 +56,13 @@ if [ `find Regions -maxdepth 1 -name '*.ini' | wc -l` -eq 0 ]; then echo "[${REGION_NAME:-Region}] RegionUUID = $(uuidgen) - Location = 1000,1000 + Location = ${REGION_LOCATION:-1000,1000} InternalAddress = 0.0.0.0 InternalPort = 9000 AllowAlternatePorts = False - ExternalHostName = localhost" >> Regions/Regions.ini + ExternalHostName = ${REGION_EXTERNAL_HOSTNAME:-localhost}" >> Regions/Regions.ini +else + echo >&2 "INFO: Looks like there's region definitions. Skipping..." fi if [ ! -e config-include/storage/SQLiteStandalone.ini ]; then diff --git a/build/latest/docker-entrypoint.sh b/build/latest/docker-entrypoint.sh index a1b4360..f6749fd 100755 --- a/build/latest/docker-entrypoint.sh +++ b/build/latest/docker-entrypoint.sh @@ -19,9 +19,11 @@ if [ ! -e OpenSim.ini ]; then StorageProvider = \"OpenSim.Data.MySQL.dll\" ConectionString = \"Data Source=${MYSQL_SERVER:-db};Database=${MYSQL_DATABASE:-opensim};User ID=${MYSQL_USER:-root};Password=${MYSQL_PASSWORD};Old Guids=true;\"" >> OpenSim.ini fi +else + echo >&2 "INFO: OpenSimulator general configuration found. Skipping..." fi -if [ ! -e config-include/StandaloneCommon.ini ]; then +if [ ! -e config-include/StandaloneCommon.ini ] || [ ! -e config-include/GridCommon.ini ]; then echo >&2 "INFO: No Grid Common configuration found, pulling one together." cp defaults/StandaloneCommon.ini config-include/StandaloneCommon.ini @@ -45,6 +47,8 @@ if [ ! -e config-include/StandaloneCommon.ini ]; then if [ -n "${GRID_NAME}" ]; then sed -i -e "s/OpenSimulator Instance/${GRID_NAME}/g" config-include/StandaloneCommon.ini fi +else + echo >&2 "INFO: Standalone or Grid configuration found. Skipping..." fi if [ `find Regions -maxdepth 1 -name '*.ini' | wc -l` -eq 0 ]; then @@ -52,11 +56,13 @@ if [ `find Regions -maxdepth 1 -name '*.ini' | wc -l` -eq 0 ]; then echo "[${REGION_NAME:-Region}] RegionUUID = $(uuidgen) - Location = 1000,1000 + Location = ${REGION_LOCATION:-1000,1000} InternalAddress = 0.0.0.0 InternalPort = 9000 AllowAlternatePorts = False - ExternalHostName = localhost" >> Regions/Regions.ini + ExternalHostName = ${REGION_EXTERNAL_HOSTNAME:-localhost}" >> Regions/Regions.ini +else + echo >&2 "INFO: Looks like there's region definitions. Skipping..." fi if [ ! -e config-include/storage/SQLiteStandalone.ini ]; then