diff --git a/build.backend.docker.py b/build.backend.docker.py index 0454568a45..452024ad57 100755 --- a/build.backend.docker.py +++ b/build.backend.docker.py @@ -20,10 +20,19 @@ def help(): print("d Run dnsmasq.") print() + rd = os.path.dirname(os.path.abspath(__file__)) dir = os.path.abspath(os.path.join(rd, "..")) dockerDir = os.path.join(dir, "buildtools", "install", "docker") -local_ip = socket.gethostbyname_ex(socket.gethostname())[-1][-1] +networks = socket.gethostbyname_ex(socket.gethostname()) +local_ip = networks[-1][-1] + +if local_ip == "127.0.0.1": + local_ip = networks[-1][0] + +if local_ip == "127.0.0.1": + print("Error: Local IP is 127.0.0.1", networks) + sys.exit(1) doceditor = f"{local_ip}:5013" login = f"{local_ip}:5011" diff --git a/config/appsettings.json b/config/appsettings.json index de335d5d86..99fa69659c 100644 --- a/config/appsettings.json +++ b/config/appsettings.json @@ -251,6 +251,7 @@ "firebase": { "script": ["*.googleapis.com", "*.firebaseio.com"], "frame": ["personal-teamlab-guru.firebaseapp.com"], + "img": ["personal-teamlab-guru.firebaseapp.com"], "connect": ["personal-teamlab-guru.firebaseapp.com", "*.googleapis.com"] }, "oform": { diff --git a/install/OneClickInstall/install-Debian/install-preq.sh b/install/OneClickInstall/install-Debian/install-preq.sh index 9c3e858d53..6c2c0a2821 100644 --- a/install/OneClickInstall/install-Debian/install-preq.sh +++ b/install/OneClickInstall/install-Debian/install-preq.sh @@ -74,6 +74,14 @@ elif dpkg -l | grep -q "mysql-apt-config" && [ "$(apt-cache policy mysql-apt-con rm -f ${MYSQL_PACKAGE_NAME} fi +if ! grep -q "mysql-innovation" /etc/apt/sources.list.d/mysql.list; then + echo "deb [signed-by=/usr/share/keyrings/mysql-apt-config.gpg] http://repo.mysql.com/apt/${DIST} ${DISTRIB_CODENAME} mysql-innovation" | sudo tee -a /etc/apt/sources.list.d/mysql.list + + if apt-get -y update 2>&1 | grep -q "^W: .*mysql-innovation"; then + sudo sed -i '/mysql-innovation/d' /etc/apt/sources.list.d/mysql.list + fi +fi + # add redis repo if [ "$DIST" = "ubuntu" ]; then curl -fsSL https://packages.redis.io/gpg | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/redis.gpg --import diff --git a/install/OneClickInstall/install-Docker.sh b/install/OneClickInstall/install-Docker.sh index ccd68f2fc3..5678b7dcd5 100644 --- a/install/OneClickInstall/install-Docker.sh +++ b/install/OneClickInstall/install-Docker.sh @@ -463,6 +463,13 @@ while [ "$1" != "" ]; do fi ;; + -noni | --noninteractive ) + if [ "$2" != "" ]; then + NON_INTERACTIVE=$2 + shift + fi + ;; + -? | -h | --help ) echo " Usage: bash $HELP_TARGET [PARAMETER] [[PARAMETER], ...]" echo @@ -511,6 +518,7 @@ while [ "$1" != "" ]; do echo " -lem, --letsencryptmail defines the domain administator mail address for Let's Encrypt certificate" echo " -cf, --certfile path to the certificate file for the domain" echo " -ckf, --certkeyfile path to the private key file for the certificate" + echo " -noni, --noninteractive auto confirm all questions (true|false)" echo " -dbm, --databasemigration database migration (true|false)" echo " -ms, --makeswap make swap file (true|false)" echo " -?, -h, --help this help" @@ -884,6 +892,10 @@ create_network () { } read_continue_installation () { + if [[ "${NON_INTERACTIVE}" = "true" ]]; then + return 0 + fi + read -p "Continue installation [Y/N]? " CHOICE_INSTALLATION case "$CHOICE_INSTALLATION" in y|Y ) @@ -1196,10 +1208,12 @@ install_mysql_server () { reconfigure MYSQL_USER ${MYSQL_USER} reconfigure MYSQL_PASSWORD ${MYSQL_PASSWORD} reconfigure MYSQL_ROOT_PASSWORD ${MYSQL_ROOT_PASSWORD} + reconfigure MYSQL_VERSION ${MYSQL_VERSION} - if [[ -z ${MYSQL_HOST} ]] && [ "$INSTALL_MYSQL_SERVER" == "true" ]; then - reconfigure MYSQL_VERSION ${MYSQL_VERSION} + if [[ -z ${MYSQL_HOST} ]] && [ "$INSTALL_MYSQL_SERVER" == "true" ]; then docker-compose -f $BASE_DIR/db.yml up -d + elif [ "$INSTALL_MYSQL_SERVER" == "pull" ]; then + docker-compose -f $BASE_DIR/db.yml pull elif [ ! -z "$MYSQL_HOST" ]; then establish_conn ${MYSQL_HOST} "${MYSQL_PORT:-"3306"}" "MySQL" reconfigure MYSQL_HOST ${MYSQL_HOST} @@ -1210,9 +1224,11 @@ install_mysql_server () { install_document_server () { reconfigure DOCUMENT_SERVER_JWT_HEADER ${DOCUMENT_SERVER_JWT_HEADER} reconfigure DOCUMENT_SERVER_JWT_SECRET ${DOCUMENT_SERVER_JWT_SECRET} + reconfigure DOCUMENT_SERVER_IMAGE_NAME "${DOCUMENT_SERVER_IMAGE_NAME}:${DOCUMENT_SERVER_VERSION:-$(get_available_version "$DOCUMENT_SERVER_IMAGE_NAME")}" if [[ -z ${DOCUMENT_SERVER_HOST} ]] && [ "$INSTALL_DOCUMENT_SERVER" == "true" ]; then - reconfigure DOCUMENT_SERVER_IMAGE_NAME "${DOCUMENT_SERVER_IMAGE_NAME}:${DOCUMENT_SERVER_VERSION:-$(get_available_version "$DOCUMENT_SERVER_IMAGE_NAME")}" docker-compose -f $BASE_DIR/ds.yml up -d + elif [ "$INSTALL_DOCUMENT_SERVER" == "pull" ]; then + docker-compose -f $BASE_DIR/ds.yml pull elif [ ! -z "$DOCUMENT_SERVER_HOST" ]; then APP_URL_PORTAL=${APP_URL_PORTAL:-"http://$(curl -s ifconfig.me):${EXTERNAL_PORT}"} establish_conn ${DOCUMENT_SERVER_HOST} ${DOCUMENT_SERVER_PORT} "${PACKAGE_SYSNAME^^} Docs" @@ -1224,6 +1240,8 @@ install_document_server () { install_rabbitmq () { if [[ -z ${RABBIT_HOST} ]] && [ "$INSTALL_RABBITMQ" == "true" ]; then docker-compose -f $BASE_DIR/rabbitmq.yml up -d + elif [ "$INSTALL_RABBITMQ" == "pull" ]; then + docker-compose -f $BASE_DIR/rabbitmq.yml pull elif [ ! -z "$RABBIT_HOST" ]; then establish_conn ${RABBIT_HOST} "${RABBIT_PORT:-"5672"}" "RabbitMQ" reconfigure RABBIT_HOST ${RABBIT_HOST} @@ -1237,6 +1255,8 @@ install_rabbitmq () { install_redis () { if [[ -z ${REDIS_HOST} ]] && [ "$INSTALL_REDIS" == "true" ]; then docker-compose -f $BASE_DIR/redis.yml up -d + elif [ "$INSTALL_REDIS" == "pull" ]; then + docker-compose -f $BASE_DIR/redis.yml pull elif [ ! -z "$REDIS_HOST" ]; then establish_conn ${REDIS_HOST} "${REDIS_PORT:-"6379"}" "Redis" reconfigure REDIS_HOST ${REDIS_HOST} @@ -1247,14 +1267,16 @@ install_redis () { } install_elasticsearch () { + reconfigure ELK_VERSION ${ELK_VERSION} if [[ -z ${ELK_HOST} ]] && [ "$INSTALL_ELASTICSEARCH" == "true" ]; then if [ $(free --mega | grep -oP '\d+' | head -n 1) -gt "12000" ]; then #RAM ~12Gb sed -i 's/Xms[0-9]g/Xms4g/g; s/Xmx[0-9]g/Xmx4g/g' $BASE_DIR/opensearch.yml else sed -i 's/Xms[0-9]g/Xms1g/g; s/Xmx[0-9]g/Xmx1g/g' $BASE_DIR/opensearch.yml fi - reconfigure ELK_VERSION ${ELK_VERSION} docker-compose -f $BASE_DIR/opensearch.yml up -d + elif [ "$INSTALL_ELASTICSEARCH" == "pull" ]; then + docker-compose -f $BASE_DIR/opensearch.yml pull elif [ ! -z "$ELK_HOST" ]; then establish_conn ${ELK_HOST} "${ELK_PORT:-"9200"}" "search engine" reconfigure ELK_SHEME "${ELK_SHEME:-"http"}" @@ -1266,37 +1288,45 @@ install_elasticsearch () { install_product () { DOCKER_TAG="${DOCKER_TAG:-$(get_available_version ${IMAGE_NAME})}" reconfigure DOCKER_TAG ${DOCKER_TAG} + if [ "$INSTALL_PRODUCT" == "true" ]; then + [ "${UPDATE}" = "true" ] && LOCAL_CONTAINER_TAG="$(docker inspect --format='{{index .Config.Image}}' ${CONTAINER_NAME} | awk -F':' '{print $2}')" - [ "${UPDATE}" = "true" ] && LOCAL_CONTAINER_TAG="$(docker inspect --format='{{index .Config.Image}}' ${CONTAINER_NAME} | awk -F':' '{print $2}')" + if [ "${UPDATE}" = "true" ] && [ "${LOCAL_CONTAINER_TAG}" != "${DOCKER_TAG}" ]; then + docker-compose -f $BASE_DIR/build.yml pull + docker-compose -f $BASE_DIR/migration-runner.yml -f $BASE_DIR/notify.yml -f $BASE_DIR/healthchecks.yml -f ${PROXY_YML} down + docker-compose -f $BASE_DIR/${PRODUCT}.yml down --volumes + fi - if [ "${UPDATE}" = "true" ] && [ "${LOCAL_CONTAINER_TAG}" != "${DOCKER_TAG}" ]; then - docker-compose -f $BASE_DIR/build.yml pull - docker-compose -f $BASE_DIR/migration-runner.yml -f $BASE_DIR/notify.yml -f $BASE_DIR/healthchecks.yml -f ${PROXY_YML} down - docker-compose -f $BASE_DIR/${PRODUCT}.yml down --volumes - fi + reconfigure ENV_EXTENSION ${ENV_EXTENSION} + reconfigure APP_CORE_MACHINEKEY ${APP_CORE_MACHINEKEY} + reconfigure APP_CORE_BASE_DOMAIN ${APP_CORE_BASE_DOMAIN} + reconfigure APP_URL_PORTAL "${APP_URL_PORTAL:-"http://${PACKAGE_SYSNAME}-router:8092"}" + reconfigure EXTERNAL_PORT ${EXTERNAL_PORT} - reconfigure ENV_EXTENSION ${ENV_EXTENSION} - reconfigure APP_CORE_MACHINEKEY ${APP_CORE_MACHINEKEY} - reconfigure APP_CORE_BASE_DOMAIN ${APP_CORE_BASE_DOMAIN} - reconfigure APP_URL_PORTAL "${APP_URL_PORTAL:-"http://${PACKAGE_SYSNAME}-router:8092"}" - reconfigure EXTERNAL_PORT ${EXTERNAL_PORT} + docker-compose -f $BASE_DIR/migration-runner.yml up -d + docker wait ${PACKAGE_SYSNAME}-migration-runner + docker-compose -f $BASE_DIR/${PRODUCT}.yml up -d + docker-compose -f ${PROXY_YML} up -d + docker-compose -f $BASE_DIR/notify.yml up -d + docker-compose -f $BASE_DIR/healthchecks.yml up -d - docker-compose -f $BASE_DIR/migration-runner.yml up -d - docker-compose -f $BASE_DIR/${PRODUCT}.yml up -d - docker-compose -f ${PROXY_YML} up -d - docker-compose -f $BASE_DIR/notify.yml up -d - docker-compose -f $BASE_DIR/healthchecks.yml up -d + if [[ -n "${PREVIOUS_ELK_VERSION}" && "$(get_env_parameter "ELK_VERSION")" != "${PREVIOUS_ELK_VERSION}" ]]; then + MYSQL_TAG=$(docker images --format "{{.Tag}}" mysql | head -n1) + MYSQL_CONTAINER_NAME=$(get_env_parameter "MYSQL_CONTAINER_NAME" | sed "s/\${CONTAINER_PREFIX}/${PACKAGE_SYSNAME}-/g") + docker run --rm --network="$(get_env_parameter "NETWORK_NAME")" mysql:${MYSQL_TAG:-latest} mysql -h "${MYSQL_HOST:-${MYSQL_CONTAINER_NAME}}" -P "${MYSQL_PORT:-3306}" -u "${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" -e "TRUNCATE webstudio_index;" + fi - if [[ -n "${PREVIOUS_ELK_VERSION}" && "$(get_env_parameter "ELK_VERSION")" != "${PREVIOUS_ELK_VERSION}" ]]; then - MYSQL_TAG=$(docker images --format "{{.Tag}}" mysql | head -n1) - MYSQL_CONTAINER_NAME=$(get_env_parameter "MYSQL_CONTAINER_NAME" | sed "s/\${CONTAINER_PREFIX}/${PACKAGE_SYSNAME}-/g") - docker run --rm --network="$(get_env_parameter "NETWORK_NAME")" mysql:${MYSQL_TAG:-latest} mysql -h "${MYSQL_HOST:-${MYSQL_CONTAINER_NAME}}" -P "${MYSQL_PORT:-3306}" -u "${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" -e "TRUNCATE webstudio_index;" - fi - - if [ ! -z "${CERTIFICATE_PATH}" ] && [ ! -z "${CERTIFICATE_KEY_PATH}" ] && [[ ! -z "${APP_DOMAIN_PORTAL}" ]]; then - bash $BASE_DIR/config/${PRODUCT}-ssl-setup -f "${APP_DOMAIN_PORTAL}" "${CERTIFICATE_PATH}" "${CERTIFICATE_KEY_PATH}" - elif [ ! -z "${LETS_ENCRYPT_DOMAIN}" ] && [ ! -z "${LETS_ENCRYPT_MAIL}" ]; then - bash $BASE_DIR/config/${PRODUCT}-ssl-setup "${LETS_ENCRYPT_MAIL}" "${LETS_ENCRYPT_DOMAIN}" + if [ ! -z "${CERTIFICATE_PATH}" ] && [ ! -z "${CERTIFICATE_KEY_PATH}" ] && [[ ! -z "${APP_DOMAIN_PORTAL}" ]]; then + bash $BASE_DIR/config/${PRODUCT}-ssl-setup -f "${APP_DOMAIN_PORTAL}" "${CERTIFICATE_PATH}" "${CERTIFICATE_KEY_PATH}" + elif [ ! -z "${LETS_ENCRYPT_DOMAIN}" ] && [ ! -z "${LETS_ENCRYPT_MAIL}" ]; then + bash $BASE_DIR/config/${PRODUCT}-ssl-setup "${LETS_ENCRYPT_MAIL}" "${LETS_ENCRYPT_DOMAIN}" + fi + elif [ "$INSTALL_PRODUCT" == "pull" ]; then + docker-compose -f $BASE_DIR/migration-runner.yml pull + docker-compose -f $BASE_DIR/${PRODUCT}.yml pull + docker-compose -f ${PROXY_YML} pull + docker-compose -f $BASE_DIR/notify.yml pull + docker-compose -f $BASE_DIR/healthchecks.yml pull fi } @@ -1382,9 +1412,7 @@ start_installation () { install_elasticsearch - if [ "$INSTALL_PRODUCT" == "true" ]; then - install_product - fi + install_product echo "" echo "Thank you for installing ${PACKAGE_SYSNAME^^} ${PRODUCT_NAME}." diff --git a/install/OneClickInstall/install-RedHat/install-preq.sh b/install/OneClickInstall/install-RedHat/install-preq.sh index fc6ccb8847..82194ecf60 100644 --- a/install/OneClickInstall/install-RedHat/install-preq.sh +++ b/install/OneClickInstall/install-RedHat/install-preq.sh @@ -57,6 +57,10 @@ dnf remove -y @mysql && dnf module -y reset mysql && dnf module -y disable mysql MYSQL_REPO_VERSION="$(curl https://repo.mysql.com | grep -oP "mysql80-community-release-${MYSQL_DISTR_NAME}${REV}-\K.*" | grep -o '^[^.]*' | sort | tail -n1)" yum localinstall -y https://repo.mysql.com/mysql80-community-release-${MYSQL_DISTR_NAME}${REV}-${MYSQL_REPO_VERSION}.noarch.rpm || true +if ! yum repolist enabled | grep -q mysql-innovation-community; then + sudo yum-config-manager --enable mysql-innovation-community +fi + if ! rpm -q mysql-community-server; then MYSQL_FIRST_TIME_INSTALL="true"; fi diff --git a/install/common/product-configuration b/install/common/product-configuration index f8dfb12a94..768f64933b 100644 --- a/install/common/product-configuration +++ b/install/common/product-configuration @@ -619,7 +619,9 @@ change_elasticsearch_config(){ sed -i '/^plugins\.security/d' /etc/opensearch/opensearch.yml sed -i '/CN=kirk,OU=client,O=client,L=test, C=de/d' /etc/opensearch/opensearch.yml - /usr/share/opensearch/bin/opensearch-plugin remove opensearch-security + if /usr/share/opensearch/bin/opensearch-plugin list | grep -x "opensearch-security" > /dev/null 2>&1 ; then + /usr/share/opensearch/bin/opensearch-plugin remove opensearch-security > /dev/null 2>&1 + fi local ELASTIC_SEARCH_CONF_PATH="/etc/opensearch/opensearch.yml" local ELASTIC_SEARCH_JAVA_CONF_PATH="/etc/opensearch/jvm.options"; @@ -778,6 +780,16 @@ check_connection_external_services() { return $HOST_RESPONCE } +# Function to prevent package auto-update +hold_package_version(){ + if command -v apt >/dev/null 2>&1 && + dpkg -s $1 >/dev/null 2>&1 && + ! apt-mark showhold | grep -q $1 >/dev/null 2>&1 + then + apt-mark hold $1 >/dev/null 2>&1 + fi +} + if command -v yum >/dev/null 2>&1; then DIST="RedHat" PACKAGE_MANAGER="rpm -q" @@ -790,6 +802,7 @@ elif command -v apt >/dev/null 2>&1; then MYSQL_PACKAGE="mysql" REDIS_PACKAGE="redis-server" SYSTEMD_DIR="$(dirname $(dpkg-query -L ${PRODUCT}-api | grep systemd/system/))" + hold_package_version dotnet-host fi install_json @@ -818,6 +831,7 @@ if [[ ! -z $EXTERNAL_ELK_FLAG ]]; then setup_elasticsearch "EXTERNAL_ELASTIC_SERVER" elif $PACKAGE_MANAGER opensearch >/dev/null 2>&1; then setup_elasticsearch "LOCAL_ELASTIC_SERVER" + hold_package_version opensearch fi if [[ ! -z $EXTERNAL_REDIS_FLAG ]]; then @@ -825,6 +839,7 @@ if [[ ! -z $EXTERNAL_REDIS_FLAG ]]; then setup_redis "EXTERNAL_REDIS_SERVER" elif $PACKAGE_MANAGER $REDIS_PACKAGE >/dev/null 2>&1; then setup_redis "LOCAL_REDIS_SERVER" + hold_package_version $REDIS_PACKAGE fi if [[ ! -z $EXTERNAL_RABBITMQ_FLAG ]]; then @@ -832,6 +847,7 @@ if [[ ! -z $EXTERNAL_RABBITMQ_FLAG ]]; then setup_rabbitmq "EXTERNAL_RABBITMQ_SERVER" elif $PACKAGE_MANAGER rabbitmq-server >/dev/null 2>&1; then setup_rabbitmq "LOCAL_RABBITMQ_SERVER" + hold_package_version rabbitmq-server fi restart_services diff --git a/install/docker/build.yml b/install/docker/build.yml index d7c4817664..c55ce26e04 100644 --- a/install/docker/build.yml +++ b/install/docker/build.yml @@ -1,5 +1,3 @@ -version: "3.8" - services: onlyoffice-backup-background-tasks: build: diff --git a/install/docker/db.yml b/install/docker/db.yml index aeced94056..449ea73da6 100644 --- a/install/docker/db.yml +++ b/install/docker/db.yml @@ -1,5 +1,3 @@ -version: "3.8" - services: onlyoffice-mysql-server: image: ${MYSQL_IMAGE} diff --git a/install/docker/dnsmasq.yml b/install/docker/dnsmasq.yml index dba10133d0..75deb13e17 100644 --- a/install/docker/dnsmasq.yml +++ b/install/docker/dnsmasq.yml @@ -1,4 +1,3 @@ -version: "3.8" services: dnsmasq: image: jpillora/dnsmasq diff --git a/install/docker/docspace.overcome.yml b/install/docker/docspace.overcome.yml index 36013608e0..f8fd748e9d 100644 --- a/install/docker/docspace.overcome.yml +++ b/install/docker/docspace.overcome.yml @@ -1,4 +1,3 @@ -version: "3.8" x-profiles-local: &x-profiles-local profiles: ["backend-local"] environment: diff --git a/install/docker/docspace.profiles.yml b/install/docker/docspace.profiles.yml index 2d2f07c963..0ed60f8cec 100644 --- a/install/docker/docspace.profiles.yml +++ b/install/docker/docspace.profiles.yml @@ -1,4 +1,3 @@ -version: "3.8" x-healthcheck: &x-healthcheck test: curl --fail http://127.0.0.1 || exit 1 interval: 60s diff --git a/install/docker/docspace.yml b/install/docker/docspace.yml index 7b4e7b718c..350da95849 100644 --- a/install/docker/docspace.yml +++ b/install/docker/docspace.yml @@ -1,4 +1,3 @@ -version: "3.8" x-healthcheck: &x-healthcheck test: curl --fail http://127.0.0.1 || exit 1 diff --git a/install/docker/ds.yml b/install/docker/ds.yml index 1f86f9f67b..d5aab2d741 100644 --- a/install/docker/ds.yml +++ b/install/docker/ds.yml @@ -1,4 +1,3 @@ -version: '3.6' services: onlyoffice-document-server: image: "${DOCUMENT_SERVER_IMAGE_NAME}" diff --git a/install/docker/healthchecks.yml b/install/docker/healthchecks.yml index 213c177376..0628001220 100644 --- a/install/docker/healthchecks.yml +++ b/install/docker/healthchecks.yml @@ -1,4 +1,3 @@ -version: "3.8" x-service: &x-service-base container_name: base diff --git a/install/docker/kafka.yml b/install/docker/kafka.yml index c1ae6d2ad5..b9fa72128e 100644 --- a/install/docker/kafka.yml +++ b/install/docker/kafka.yml @@ -1,4 +1,3 @@ -version: "3.6" services: onlyoffice-zookeeper: image: zookeeper:latest diff --git a/install/docker/migration-runner.yml b/install/docker/migration-runner.yml index c786a88d2f..835c742dd0 100644 --- a/install/docker/migration-runner.yml +++ b/install/docker/migration-runner.yml @@ -1,5 +1,3 @@ -version: "3.8" - services: onlyoffice-migration-runner: image: "${REPO}/${DOCKER_IMAGE_PREFIX}-migration-runner:${DOCKER_TAG}" diff --git a/install/docker/notify.yml b/install/docker/notify.yml index 7ecc61559b..46d1828362 100644 --- a/install/docker/notify.yml +++ b/install/docker/notify.yml @@ -1,4 +1,3 @@ -version: "3.8" x-healthcheck: &x-healthcheck test: curl --fail http://127.0.0.1 || exit 1 diff --git a/install/docker/opensearch.yml b/install/docker/opensearch.yml index 27dcac6e7d..389aaa91e2 100644 --- a/install/docker/opensearch.yml +++ b/install/docker/opensearch.yml @@ -1,4 +1,3 @@ -version: "3" services: onlyoffice-opensearch: image: onlyoffice/opensearch:${ELK_VERSION} diff --git a/install/docker/proxy-ssl.yml b/install/docker/proxy-ssl.yml index 75a6a49cb7..c06212bb7d 100644 --- a/install/docker/proxy-ssl.yml +++ b/install/docker/proxy-ssl.yml @@ -1,4 +1,3 @@ -version: "3.8" x-healthcheck: &x-healthcheck test: curl --fail http://127.0.0.1 || exit 1 diff --git a/install/docker/proxy.yml b/install/docker/proxy.yml index b17472f403..d4f1255eef 100644 --- a/install/docker/proxy.yml +++ b/install/docker/proxy.yml @@ -1,4 +1,3 @@ -version: "3.8" x-healthcheck: &x-healthcheck test: curl --fail http://127.0.0.1 || exit 1 diff --git a/install/docker/rabbitmq.yml b/install/docker/rabbitmq.yml index 4c53cde0ca..ef27b0b783 100644 --- a/install/docker/rabbitmq.yml +++ b/install/docker/rabbitmq.yml @@ -1,4 +1,3 @@ -version: "3" services: onlyoffice-rabbitmq: image: rabbitmq:3 diff --git a/install/docker/redis.yml b/install/docker/redis.yml index 2f02b37993..8466e65027 100644 --- a/install/docker/redis.yml +++ b/install/docker/redis.yml @@ -1,4 +1,3 @@ -version: "3" services: onlyoffice-redis: image: redis:7 diff --git a/install/win/DocSpace.aip b/install/win/DocSpace.aip index 789084540e..bb98a5efcd 100644 --- a/install/win/DocSpace.aip +++ b/install/win/DocSpace.aip @@ -33,6 +33,7 @@ + @@ -516,6 +517,7 @@ + @@ -1040,6 +1042,7 @@ + @@ -1287,6 +1290,7 @@ + @@ -1325,6 +1329,7 @@ + @@ -1345,6 +1350,7 @@ + @@ -1587,6 +1593,7 @@ + @@ -1594,7 +1601,8 @@ - + + diff --git a/install/win/build-batch.bat b/install/win/build-batch.bat index 488263b5a5..c1d795b548 100644 --- a/install/win/build-batch.bat +++ b/install/win/build-batch.bat @@ -50,6 +50,7 @@ copy "buildtools\install\docker\config\nginx\onlyoffice-proxy.conf" "buildtools\ copy "buildtools\install\docker\config\nginx\onlyoffice-proxy-ssl.conf" "buildtools\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl" /y copy "buildtools\install\docker\config\nginx\letsencrypt.conf" "buildtools\install\win\Files\nginx\conf\includes\letsencrypt.conf" /y copy "buildtools\install\win\sbin\docspace-ssl-setup.ps1" "buildtools\install\win\Files\sbin\docspace-ssl-setup.ps1" /y +copy "buildtools\install\docker\config\fluent-bit.conf" "buildtools\install\win\Files\config\fluent-bit.conf" /y rmdir buildtools\install\win\publish /s /q REM echo ######## SSL configs ######## @@ -59,6 +60,13 @@ REM echo ######## SSL configs ######## %sed% -i "s/ssl_dhparam \/etc\/ssl\/certs\/dhparam.pem;/#ssl_dhparam \/etc\/ssl\/certs\/dhparam.pem;/" buildtools\install\win\Files\nginx\conf\onlyoffice-proxy-ssl.conf.tmpl %sed% -i "s_\(.*root\).*;_\1 \"{APPDIR}letsencrypt\";_g" -i buildtools\install\win\Files\nginx\conf\includes\letsencrypt.conf %sed% -i "s#/etc/nginx/html#conf/html#g" buildtools\install\win\Files\nginx\conf\onlyoffice.conf +%sed% -i "s/\/etc\/nginx\/\.htpasswd_dashboards/\.htpasswd_dashboards/g" buildtools\install\win\Files\nginx\conf\onlyoffice.conf + +REM echo ######## Configure fluent-bit config for windows ######## +%sed% -i "s/forward/tail/" buildtools\install\win\Files\config\fluent-bit.conf +%sed% -i "s/Port/Path/" buildtools\install\win\Files\config\fluent-bit.conf +%sed% -i "s/24224/{APPDIR}Logs\*.log/" buildtools\install\win\Files\config\fluent-bit.conf +%sed% -i "/Listen\s*127\.0\.0\.1/d" buildtools\install\win\Files\config\fluent-bit.conf REM echo ######## Delete test and dev configs ######## del /f /q buildtools\install\win\Files\config\*.test.json diff --git a/install/win/utils.vbs b/install/win/utils.vbs index 5ab8e307c2..71f1241e21 100644 --- a/install/win/utils.vbs +++ b/install/win/utils.vbs @@ -118,6 +118,13 @@ Function SetDocumentServerJWTSecretProp End Function +Function SetDashboardsPwd + On Error Resume Next + + Session.Property("DASHBOARDS_PWD") = RandomString( 20 ) + +End Function + Function SetMACHINEKEY On Error Resume Next @@ -393,7 +400,21 @@ Function OpenSearchSetup oRE.Pattern = "opensearch.hosts:.*" fileContent = oRE.Replace(fileContent, "opensearch.hosts: [http://localhost:9200]") End if - + + If InStrRev(fileContent, "server.host") = 0 Then + fileContent = fileContent & Chr(13) & Chr(10) & "server.host: 127.0.0.1" + Else + oRE.Pattern = "server.host:.*" + fileContent = oRE.Replace(fileContent, "server.host: 127.0.0.1") + End if + + If InStrRev(fileContent, "server.basePath") = 0 Then + fileContent = fileContent & Chr(13) & Chr(10) & "server.basePath: /dashboards" + Else + oRE.Pattern = "server.basePath:.*" + fileContent = oRE.Replace(fileContent, "server.basePath: /dashboards") + End if + Set objFile = objFSO.OpenTextFile(OPENSEARCH_DASHBOARDS_YML, ForWriting) objFile.WriteLine fileContent @@ -548,7 +569,7 @@ Function MoveConfigs configSslFile = targetFolder & "\onlyoffice-proxy-ssl.conf.tmpl" configFile = targetFolder & "\onlyoffice-proxy.conf" sslScriptPath = Session.Property("APPDIR") & "sbin\docspace-ssl-setup.ps1" - FluentBitSourceFile = Session.Property("APPDIR") & "fluent-bit.conf" + FluentBitSourceFile = Session.Property("APPDIR") & "config\fluent-bit.conf" FluentBitDstFolder = "C:\OpenSearchStack\fluent-bit-2.2.2-win64\conf\" ' Read content and extract SSL certificate and key paths if it exists