diff --git a/build_data/gwc-gs.xml b/build_data/gwc-gs.xml index 4d16ee9e..d5d01098 100644 --- a/build_data/gwc-gs.xml +++ b/build_data/gwc-gs.xml @@ -1,10 +1,10 @@ 1.1.0 ${WMS_DIR_INTEGRATION} - true - true - true - false + ${REQUIRE_TILED_PARAMETER} + ${WMSC_ENABLED} + ${TMS_ENABLED} + ${SECURITY_ENABLED} false true class org.geowebcache.storage.blobstore.memory.guava.GuavaCacheProvider diff --git a/scripts/env-data.sh b/scripts/env-data.sh index 59845fd8..405a9935 100644 --- a/scripts/env-data.sh +++ b/scripts/env-data.sh @@ -18,6 +18,25 @@ if [ -z "${WMS_DIR_INTEGRATION}" ]; then WMS_DIR_INTEGRATION=false fi +if [ -z "${REQUIRE_TILED_PARAMETER}" ]; then + REQUIRE_TILED_PARAMETER=true +fi + + +if [ -z "${WMSC_ENABLED}" ]; then + WMSC_ENABLED=true +fi + + +if [ -z "${TMS_ENABLED}" ]; then + TMS_ENABLED=true +fi + + +if [ -z "${SECURITY_ENABLED}" ]; then + SECURITY_ENABLED=false +fi + if [ -z "${DISK_QUOTA_SIZE}" ]; then DISK_QUOTA_SIZE=20 fi diff --git a/scripts/functions.sh b/scripts/functions.sh index 91606183..73284801 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -34,7 +34,6 @@ function create_dir() { DATA_PATH=$1 if [[ ! -d ${DATA_PATH} ]]; then - echo "Creating" "${DATA_PATH}" "directory" mkdir -p "${DATA_PATH}" fi } @@ -85,7 +84,6 @@ function web_cors() { # Useful if CORS is handled outside of Tomcat (e.g. in a proxying webserver like nginx) ### if [[ "${DISABLE_CORS}" =~ [Tt][Rr][Uu][Ee] ]]; then - echo "Deactivating Tomcat CORS filter" sed -i 's/\n/-->/' \ ${CATALINA_HOME}/conf/web.xml fi @@ -247,6 +245,7 @@ function install_plugin() { if [[ -f "${DATA_PATH}"/"${EXT}".zip ]];then unzip "${DATA_PATH}"/"${EXT}".zip -d /tmp/gs_plugin + echo -e "\e[32m Enabling ${EXT} for GeoServer \033[0m" if [[ -f /geoserver/start.jar ]]; then cp -r -u -p /tmp/gs_plugin/*.jar /geoserver/webapps/geoserver/WEB-INF/lib/ else @@ -285,7 +284,7 @@ function jdbc_disk_quota_config() { fi } -function enable_direct_integration_wms() { +function activate_gwc_global_configs() { if [[ ! -f "${GEOSERVER_DATA_DIR}"/gwc-gs.xml ]]; then if [[ -f "${EXTRA_CONFIG_DIR}"/gwc-gs.xml ]]; then envsubst < "${EXTRA_CONFIG_DIR}"/gwc-gs.xml < "${GEOSERVER_DATA_DIR}"/gwc-gs.xml diff --git a/scripts/start.sh b/scripts/start.sh index 1becc588..bf330043 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -33,26 +33,21 @@ geoserver_logging # Activate sample data if [[ ${SAMPLE_DATA} =~ [Tt][Rr][Uu][Ee] ]]; then - echo "Activating default data directory" cp -r "${CATALINA_HOME}"/data/* "${GEOSERVER_DATA_DIR}" fi # Recreate DISK QUOTA config, useful to change between H2 and jdbc and change connection or schema if [[ "${RECREATE_DISKQUOTA}" =~ [Tt][Rr][Uu][Ee] ]]; then - - echo "Remove old geowebcache disk quota xml." if [[ -f "${GEOWEBCACHE_CACHE_DIR}"/geowebcache-diskquota.xml ]]; then rm "${GEOWEBCACHE_CACHE_DIR}"/geowebcache-diskquota.xml - echo "${GEOWEBCACHE_CACHE_DIR}/geowebcache-diskquota.xml removed" fi if [[ -f "${GEOWEBCACHE_CACHE_DIR}"/geowebcache-diskquota-jdbc.xml ]]; then rm "${GEOWEBCACHE_CACHE_DIR}"/geowebcache-diskquota-jdbc.xml - echo "${GEOWEBCACHE_CACHE_DIR}/geowebcache-diskquota-jdbc.xml removed" fi fi -export DISK_QUOTA_SIZE +export DISK_QUOTA_FREQUENCY DISK_QUOTA_SIZE if [[ ${DB_BACKEND} =~ [Pp][Oo][Ss][Tt][Gg][Rr][Ee][Ss] ]]; then postgres_ssl_setup export DISK_QUOTA_BACKEND=JDBC @@ -60,7 +55,7 @@ if [[ ${DB_BACKEND} =~ [Pp][Oo][Ss][Tt][Gg][Rr][Ee][Ss] ]]; then default_disk_quota_config jdbc_disk_quota_config - echo -e "[Entrypoint] Checking PostgreSQL connection to see if init tables are loaded: \033[0m" + echo -e "[Entrypoint] Checking PostgreSQL connection to see if diskquota tables are loaded: \033[0m" export PGPASSWORD="${POSTGRES_PASS}" postgres_ready_status ${HOST} ${POSTGRES_PORT} ${POSTGRES_USER} $POSTGRES_DB create_gwc_tile_tables ${HOST} ${POSTGRES_PORT} ${POSTGRES_USER} $POSTGRES_DB $POSTGRES_SCHEMA @@ -69,14 +64,12 @@ else default_disk_quota_config fi -# Direct Integration with GeoServer WMS -echo "Direct Integration with Geoserver WMS option" -enable_direct_integration_wms +# GWC Global Config options GeoServer WMS +export WMS_DIR_INTEGRATION REQUIRE_TILED_PARAMETER WMSC_ENABLED TMS_ENABLED SECURITY_ENABLED +activate_gwc_global_configs # Install stable plugins -if [[ -z "${STABLE_EXTENSIONS}" ]]; then - echo -e "\e[32m STABLE_EXTENSIONS is unset, so we do not install any stable extensions \033[0m" -else +if [[ ! -z "${STABLE_EXTENSIONS}" ]]; then if [[ ${FORCE_DOWNLOAD_STABLE_EXTENSIONS} =~ [Tt][Rr][Uu][Ee] ]];then rm -rf /stable_plugins/*.zip for plugin in $(cat /stable_plugins/stable_plugins.txt); do @@ -84,12 +77,10 @@ else download_extension "${approved_plugins_url}" "${plugin}" /stable_plugins done for ext in $(echo "${STABLE_EXTENSIONS}" | tr ',' ' '); do - echo "Enabling ${ext} for GeoServer ${GS_VERSION}" install_plugin /stable_plugins/ "${ext}" done else for ext in $(echo "${STABLE_EXTENSIONS}" | tr ',' ' '); do - echo "Enabling ${ext} for GeoServer ${GS_VERSION}" if [[ ! -f /stable_plugins/${ext}.zip ]]; then approved_plugins_url="${STABLE_PLUGIN_BASE_URL}/${GS_VERSION}/extensions/geoserver-${GS_VERSION}-${ext}.zip" download_extension "${approved_plugins_url}" "${ext}" /stable_plugins/ @@ -106,7 +97,6 @@ if [[ ${ACTIVATE_ALL_STABLE_EXTENSIONS} =~ [Tt][Rr][Uu][Ee] ]];then pushd /stable_plugins/ || exit for val in *.zip; do ext=${val%.*} - echo "Enabling ${ext} for GeoServer ${GS_VERSION}" install_plugin /stable_plugins/ "${ext}" done pushd "${GEOSERVER_HOME}" || exit @@ -116,15 +106,9 @@ fi # Function to install community extensions export S3_SERVER_URL S3_USERNAME S3_PASSWORD -function community_config() { - echo -e "\e[32m Installing ${ext} \033[0m" - install_plugin /community_plugins "${ext}" -} # Install community modules plugins -if [[ -z ${COMMUNITY_EXTENSIONS} ]]; then - echo -e "\e[32m COMMUNITY_EXTENSIONS is unset, so we do not install any community extensions \033[0m" -else +if [[ ! -z ${COMMUNITY_EXTENSIONS} ]]; then if [[ ${FORCE_DOWNLOAD_COMMUNITY_EXTENSIONS} =~ [Tt][Rr][Uu][Ee] ]];then rm -rf /community_plugins/*.zip for plugin in $(cat /community_plugins/community_plugins.txt); do @@ -132,18 +116,16 @@ else download_extension "${community_plugins_url}" "${plugin}" /community_plugins done for ext in $(echo "${COMMUNITY_EXTENSIONS}" | tr ',' ' '); do - echo "Enabling ${ext} for GeoServer ${GS_VERSION}" - community_config + install_plugin /community_plugins "${ext}" done else for ext in $(echo "${COMMUNITY_EXTENSIONS}" | tr ',' ' '); do - echo "Enabling ${ext} for GeoServer ${GS_VERSION}" if [[ ! -f /community_plugins/${ext}.zip ]]; then community_plugins_url="https://build.geoserver.org/geoserver/${GS_VERSION:0:5}x/community-latest/geoserver-${GS_VERSION:0:4}-SNAPSHOT-${ext}.zip" download_extension "${community_plugins_url}" "${ext}" /community_plugins - community_config + install_plugin /community_plugins "${ext}" else - community_config + install_plugin /community_plugins "${ext}" fi done fi @@ -154,8 +136,7 @@ if [[ ${ACTIVATE_ALL_COMMUNITY_EXTENSIONS} =~ [Tt][Rr][Uu][Ee] ]];then pushd /community_plugins/ || exit for val in *.zip; do ext=${val%.*} - echo -e "\e[32m Enabling ${ext} for GeoServer ${GS_VERSION} \033[0m" - community_config + install_plugin /community_plugins "${ext}" done pushd "${GEOSERVER_HOME}" || exit fi diff --git a/scripts/update_passwords.sh b/scripts/update_passwords.sh index 800cdc5a..2fcd7e6c 100644 --- a/scripts/update_passwords.sh +++ b/scripts/update_passwords.sh @@ -27,6 +27,7 @@ else if [ ! -d "${GEOSERVER_DATA_DIR}/security" ]; then echo -e "\e[32m Copying default security folder \033[0m" cp -r ${CATALINA_HOME}/security ${GEOSERVER_DATA_DIR} + sed -i 's/pbePasswordEncoder/strongPbePasswordEncoder/g' ${GEOSERVER_DATA_DIR}/security/config.xml fi fi fi