2024-04-17 12:08:49 +00:00
|
|
|
#!/bin/bash
|
2023-09-28 12:40:36 +00:00
|
|
|
WRONG_PORTAL_NAME_URL=${WRONG_PORTAL_NAME_URL:-""}
|
2023-08-29 09:20:16 +00:00
|
|
|
REDIS_HOST=${REDIS_HOST:-"${REDIS_CONTAINER_NAME}"}
|
|
|
|
REDIS_PORT=${REDIS_PORT:-"6379"}
|
2023-10-05 13:16:10 +00:00
|
|
|
REDIS_PASSWORD=${REDIS_PASSWORD:-""}
|
2022-11-22 08:49:58 +00:00
|
|
|
|
2023-10-10 15:18:22 +00:00
|
|
|
envsubst '$MAP_HASH_BUCKET_SIZE,$COUNT_WORKER_CONNECTIONS' < /etc/nginx/nginx.conf.template > /usr/local/openresty/nginx/conf/nginx.conf
|
2023-08-29 09:20:16 +00:00
|
|
|
sed -i "s~\(redis_host =\).*~\1 \"$REDIS_HOST\"~" /etc/nginx/conf.d/onlyoffice.conf
|
|
|
|
sed -i "s~\(redis_port =\).*~\1 $REDIS_PORT~" /etc/nginx/conf.d/onlyoffice.conf
|
2023-10-05 13:16:10 +00:00
|
|
|
sed -i "s~\(redis_pass =\).*~\1 \"$REDIS_PASSWORD\"~" /etc/nginx/conf.d/onlyoffice.conf
|
2023-09-28 12:40:36 +00:00
|
|
|
sed -i "s~\(\"wrongPortalNameUrl\":\).*,~\1 \"${WRONG_PORTAL_NAME_URL}\",~g" /var/www/public/scripts/config.json
|
2024-04-17 12:08:49 +00:00
|
|
|
echo "${DASHBOARDS_USERNAME:-onlyoffice}:$(openssl passwd -6 -stdin <<< "${DASHBOARDS_PASSWORD:-onlyoffice}")" > /etc/nginx/.htpasswd_dashboards
|