Merge branch 'hotfix/v4.3.5'
This commit is contained in:
commit
c2117fce29
33
run-document-server.sh
Normal file → Executable file
33
run-document-server.sh
Normal file → Executable file
@ -3,6 +3,7 @@
|
|||||||
APP_DIR="/var/www/onlyoffice/documentserver"
|
APP_DIR="/var/www/onlyoffice/documentserver"
|
||||||
DATA_DIR="/var/www/onlyoffice/Data"
|
DATA_DIR="/var/www/onlyoffice/Data"
|
||||||
LOG_DIR="/var/log/onlyoffice/documentserver"
|
LOG_DIR="/var/log/onlyoffice/documentserver"
|
||||||
|
CONF_DIR="/etc/onlyoffice/documentserver"
|
||||||
|
|
||||||
ONLYOFFICE_DATA_CONTAINER=${ONLYOFFICE_DATA_CONTAINER:-false}
|
ONLYOFFICE_DATA_CONTAINER=${ONLYOFFICE_DATA_CONTAINER:-false}
|
||||||
ONLYOFFICE_DATA_CONTAINER_HOST=${ONLYOFFICE_DATA_CONTAINER_HOST:-localhost}
|
ONLYOFFICE_DATA_CONTAINER_HOST=${ONLYOFFICE_DATA_CONTAINER_HOST:-localhost}
|
||||||
@ -15,7 +16,7 @@ CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-${SSL_CERTIFICATES_DIR}/ca-certific
|
|||||||
SSL_DHPARAM_PATH=${SSL_DHPARAM_PATH:-${SSL_CERTIFICATES_DIR}/dhparam.pem}
|
SSL_DHPARAM_PATH=${SSL_DHPARAM_PATH:-${SSL_CERTIFICATES_DIR}/dhparam.pem}
|
||||||
SSL_VERIFY_CLIENT=${SSL_VERIFY_CLIENT:-off}
|
SSL_VERIFY_CLIENT=${SSL_VERIFY_CLIENT:-off}
|
||||||
ONLYOFFICE_HTTPS_HSTS_ENABLED=${ONLYOFFICE_HTTPS_HSTS_ENABLED:-true}
|
ONLYOFFICE_HTTPS_HSTS_ENABLED=${ONLYOFFICE_HTTPS_HSTS_ENABLED:-true}
|
||||||
ONLYOFFICE_HTTPS_HSTS_MAXAGE=${ONLYOFFICE_HTTPS_HSTS_MAXAG:-31536000}
|
ONLYOFFICE_HTTPS_HSTS_MAXAGE=${ONLYOFFICE_HTTPS_HSTS_MAXAGE:-31536000}
|
||||||
SYSCONF_TEMPLATES_DIR="/app/onlyoffice/setup/config"
|
SYSCONF_TEMPLATES_DIR="/app/onlyoffice/setup/config"
|
||||||
|
|
||||||
NGINX_CONFD_PATH="/etc/nginx/conf.d";
|
NGINX_CONFD_PATH="/etc/nginx/conf.d";
|
||||||
@ -27,9 +28,11 @@ NGINX_CONFIG_PATH="/etc/nginx/nginx.conf"
|
|||||||
NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-$(grep processor /proc/cpuinfo | wc -l)}
|
NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-$(grep processor /proc/cpuinfo | wc -l)}
|
||||||
NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
|
NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)}
|
||||||
|
|
||||||
ONLYOFFICE_DEFAULT_CONFIG=/etc/onlyoffice/documentserver/default.json
|
ONLYOFFICE_DEFAULT_CONFIG=${CONF_DIR}/default.json
|
||||||
|
ONLYOFFICE_LOG4JS_CONFIG=${CONF_DIR}/log4js/production.json
|
||||||
|
|
||||||
JSON="json -q -f ${ONLYOFFICE_DEFAULT_CONFIG}"
|
JSON="json -q -f ${ONLYOFFICE_DEFAULT_CONFIG}"
|
||||||
|
JSON_LOG="json -q -f ${ONLYOFFICE_LOG4JS_CONFIG}"
|
||||||
|
|
||||||
LOCAL_SERVICES=()
|
LOCAL_SERVICES=()
|
||||||
|
|
||||||
@ -50,6 +53,8 @@ read_setting(){
|
|||||||
|
|
||||||
REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)}
|
REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-$(${JSON} services.CoAuthoring.redis.host)}
|
||||||
REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-$(${JSON} services.CoAuthoring.redis.port)}
|
REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-$(${JSON} services.CoAuthoring.redis.port)}
|
||||||
|
|
||||||
|
DS_LOG_LEVEL=${DS_LOG_LEVEL:-$(${JSON_LOG} levels.nodeJS)}
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_rabbitmq_url(){
|
parse_rabbitmq_url(){
|
||||||
@ -139,7 +144,7 @@ create_postgresql_cluster(){
|
|||||||
|
|
||||||
mv $postgresql_conf $postgresql_conf.backup
|
mv $postgresql_conf $postgresql_conf.backup
|
||||||
mv $hba_conf $hba_conf.backup
|
mv $hba_conf $hba_conf.backup
|
||||||
|
|
||||||
pg_createcluster ${PG_VERSION} ${PG_NAME}
|
pg_createcluster ${PG_VERSION} ${PG_NAME}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,28 +187,26 @@ update_nginx_settings(){
|
|||||||
|
|
||||||
# if dhparam path is valid, add to the config, otherwise remove the option
|
# if dhparam path is valid, add to the config, otherwise remove the option
|
||||||
if [ -r "${SSL_DHPARAM_PATH}" ]; then
|
if [ -r "${SSL_DHPARAM_PATH}" ]; then
|
||||||
sed 's,{{SSL_DHPARAM_PATH}},'"${SSL_DHPARAM_PATH}"',' -i ${NGINX_ONLYOFFICE_PATH}
|
sed 's,\(\#* *\)\?\(ssl_dhparam \).*\(;\)$,'"\2${SSL_DHPARAM_PATH}\3"',' -i ${NGINX_ONLYOFFICE_PATH}
|
||||||
else
|
else
|
||||||
sed '/ssl_dhparam {{SSL_DHPARAM_PATH}};/d' -i ${NGINX_ONLYOFFICE_PATH}
|
sed '/ssl_dhparam/d' -i ${NGINX_ONLYOFFICE_PATH}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed 's,{{SSL_VERIFY_CLIENT}},'"${SSL_VERIFY_CLIENT}"',' -i ${NGINX_ONLYOFFICE_PATH}
|
sed 's,\(ssl_verify_client \).*\(;\)$,'"\1${SSL_VERIFY_CLIENT}\2"',' -i ${NGINX_ONLYOFFICE_PATH}
|
||||||
|
|
||||||
if [ -f "${CA_CERTIFICATES_PATH}" ]; then
|
if [ -f "${CA_CERTIFICATES_PATH}" ]; then
|
||||||
sed 's,{{CA_CERTIFICATES_PATH}},'"${CA_CERTIFICATES_PATH}"',' -i ${NGINX_ONLYOFFICE_PATH}
|
sed '/ssl_verify_client/a '"ssl_client_certificate ${CA_CERTIFICATES_PATH}"';' -i ${NGINX_ONLYOFFICE_PATH}
|
||||||
else
|
|
||||||
sed '/{{CA_CERTIFICATES_PATH}}/d' -i ${NGINX_ONLYOFFICE_PATH}
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${ONLYOFFICE_HTTPS_HSTS_ENABLED}" == "true" ]; then
|
if [ "${ONLYOFFICE_HTTPS_HSTS_ENABLED}" == "true" ]; then
|
||||||
sed 's/{{ONLYOFFICE_HTTPS_HSTS_MAXAGE}}/'"${ONLYOFFICE_HTTPS_HSTS_MAXAGE}"'/' -i ${NGINX_ONLYOFFICE_PATH}
|
sed 's,\(max-age=\).*\(;\)$,'"\1${ONLYOFFICE_HTTPS_HSTS_MAXAGE}\2"',' -i ${NGINX_ONLYOFFICE_PATH}
|
||||||
else
|
else
|
||||||
sed '/{{ONLYOFFICE_HTTPS_HSTS_MAXAGE}}/d' -i ${NGINX_ONLYOFFICE_PATH}
|
sed '/max-age=/d' -i ${NGINX_ONLYOFFICE_PATH}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cp ${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf.template ${NGINX_ONLYOFFICE_PATH}
|
cp ${NGINX_CONFD_PATH}/onlyoffice-documentserver.conf.template ${NGINX_ONLYOFFICE_PATH}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_PATH}" ]; then
|
if [ -f "${NGINX_ONLYOFFICE_EXAMPLE_PATH}" ]; then
|
||||||
sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_PATH}
|
sed 's/linux/docker/' -i ${NGINX_ONLYOFFICE_EXAMPLE_PATH}
|
||||||
fi
|
fi
|
||||||
@ -216,6 +219,10 @@ update_supervisor_settings(){
|
|||||||
cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
|
cp ${SYSCONF_TEMPLATES_DIR}/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_log_settings(){
|
||||||
|
${JSON_LOG} -I -e "this.levels.nodeJS = '${DS_LOG_LEVEL}'"
|
||||||
|
}
|
||||||
|
|
||||||
# create base folders
|
# create base folders
|
||||||
for i in converter docservice spellchecker metrics gc; do
|
for i in converter docservice spellchecker metrics gc; do
|
||||||
mkdir -p "${LOG_DIR}/$i"
|
mkdir -p "${LOG_DIR}/$i"
|
||||||
@ -227,6 +234,8 @@ if [ ${ONLYOFFICE_DATA_CONTAINER_HOST} = "localhost" ]; then
|
|||||||
|
|
||||||
read_setting
|
read_setting
|
||||||
|
|
||||||
|
update_log_settings
|
||||||
|
|
||||||
# update settings by env variables
|
# update settings by env variables
|
||||||
if [ ${POSTGRESQL_SERVER_HOST} != "localhost" ]; then
|
if [ ${POSTGRESQL_SERVER_HOST} != "localhost" ]; then
|
||||||
update_postgresql_settings
|
update_postgresql_settings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user