Skip to content

Commit

Permalink
Merge hotfix/v3.0.1 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
agolybev committed Dec 17, 2024
2 parents 68b6145 + 8b66b94 commit f61eb7a
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 79 deletions.
4 changes: 2 additions & 2 deletions config/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"chunk-size": 10485760,
"url": "/"
},
"viewed-images": [ ".svg", ".bmp", ".gif", ".jpeg", ".jpg", ".png", ".ico", ".tif", ".tiff", ".webp" ],
"viewed-images": [ ".svg", ".bmp", ".gif", ".jpeg", ".jpg", ".png", ".ico", ".tif", ".tiff", ".webp", ".heic" ],
"viewed-media": [ ".aac", ".flac", ".m4a", ".mp3", ".oga", ".ogg", ".wav", ".f4v", ".m4v", ".mov", ".mp4", ".ogv", ".webm" ],
"index": [".pptx", ".xlsx", ".docx", ".pdf"],
"oform": {
Expand Down Expand Up @@ -238,7 +238,7 @@
"csp": {
"default": {
"def": ["'self'", "data:"],
"script": ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
"script": ["'self'", "'unsafe-inline'", "'unsafe-eval'", "blob:"],
"style": ["'self'", "'unsafe-inline'"],
"img": ["'self'", "data:", "blob:"],
"frame": ["'self'"],
Expand Down
8 changes: 4 additions & 4 deletions install/OneClickInstall/install-Debian/install-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ if [ "$DOCUMENT_SERVER_INSTALLED" = "false" ]; then
apt-get install -yq ${ds_pkg_name}
fi

if [ "$MAKESWAP" == "true" ]; then
make_swap
fi

if [ "$PRODUCT_INSTALLED" = "false" ]; then
echo ${product} ${product}/db-pwd select $MYSQL_SERVER_PASS | sudo debconf-set-selections
echo ${product} ${product}/db-user select $MYSQL_SERVER_USER | sudo debconf-set-selections
Expand All @@ -74,10 +78,6 @@ elif [ "$UPDATE" = "true" ] && [ "$PRODUCT_INSTALLED" = "true" ]; then
fi
fi

if [ "$MAKESWAP" == "true" ]; then
make_swap
fi

echo ""
echo "$RES_INSTALL_SUCCESS"
echo "$RES_QUESTIONS"
Expand Down
30 changes: 15 additions & 15 deletions install/OneClickInstall/install-Docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ install_package () {
}

install_docker_compose () {
curl -L "https://github.com/docker/compose/releases/download/v2.30.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
chmod +x /usr/bin/docker-compose
}

Expand Down Expand Up @@ -985,7 +985,7 @@ domain_check () {
fi
fi

[[ -n "${APP_DOMAIN_PORTAL}" ]] && APP_URL_PORTAL="http://${APP_DOMAIN_PORTAL}:${EXTERNAL_PORT}"
APP_URL_PORTAL=${APP_DOMAIN_PORTAL:+http://${APP_DOMAIN_PORTAL}:${EXTERNAL_PORT}}
}

establish_conn() {
Expand Down Expand Up @@ -1026,7 +1026,7 @@ get_tag_from_hub () {
CREDENTIALS=$(jq -r --arg hub "${HUB}" '.auths | to_entries[] | select(.key | contains($hub)).value.auth // empty' "$HOME/.docker/config.json")
fi

[[ -n ${CREDENTIALS} ]] && AUTH_HEADER="Authorization: Basic $CREDENTIALS"
AUTH_HEADER=${CREDENTIALS:+Authorization: Basic $CREDENTIALS}

HUB_URL="https://${HUB}/v2/${1/#$HUB\//}/tags/list"
JQ_FILTER='.tags | join("\n")'
Expand Down Expand Up @@ -1088,7 +1088,7 @@ set_jwt_header () {

set_core_machinekey () {
APP_CORE_MACHINEKEY="${APP_CORE_MACHINEKEY:-$(get_env_parameter "APP_CORE_MACHINEKEY" "${CONTAINER_NAME}")}"
[[ "$UPDATE" != "true" ]] && APP_CORE_MACHINEKEY="${APP_CORE_MACHINEKEY:-$(get_random_str 12))}"
[ "$UPDATE" != "true" ] && APP_CORE_MACHINEKEY="${APP_CORE_MACHINEKEY:-$(get_random_str 12)}"
}

set_mysql_params () {
Expand Down Expand Up @@ -1148,7 +1148,7 @@ set_installation_type_data () {
download_files () {
[ "${OFFLINE_INSTALLATION}" = "false" ] && echo -n "Downloading configuration files to ${BASE_DIR}..." || echo "Unzip docker.tar.gz to ${BASE_DIR}..."

[ -d "${BASE_DIR}" ] && rm -rf "${BASE_DIR}"
rm -rf "${BASE_DIR:?}"
mkdir -p ${BASE_DIR}


Expand Down Expand Up @@ -1422,39 +1422,39 @@ services_check_connection () {
for HOST in "${HOSTS[@]}"; do [[ "${!HOST}" == *CONTAINER_PREFIX* || "${!HOST}" == *$PACKAGE_SYSNAME* ]] && export "$HOST="; done
[[ "${APP_URL_PORTAL}" == *${PACKAGE_SYSNAME}-proxy* ]] && APP_URL_PORTAL=""

[[ ! -z "$MYSQL_HOST" ]] && {
if [[ ! -z "$MYSQL_HOST" ]]; then
establish_conn ${MYSQL_HOST} "${MYSQL_PORT:-3306}" "MySQL"
reconfigure MYSQL_HOST ${MYSQL_HOST}
reconfigure MYSQL_PORT "${MYSQL_PORT:-3306}"
}
[[ ! -z "$DOCUMENT_SERVER_HOST" ]] && {
fi
if [[ ! -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"
reconfigure DOCUMENT_SERVER_URL_EXTERNAL ${DOCUMENT_SERVER_URL_EXTERNAL}
reconfigure DOCUMENT_SERVER_URL_PUBLIC ${DOCUMENT_SERVER_URL_EXTERNAL}
}
[[ ! -z "$RABBIT_HOST" ]] && {
fi
if [[ ! -z "$RABBIT_HOST" ]]; then
establish_conn ${RABBIT_HOST} "${RABBIT_PORT:-5672}" "RabbitMQ"
reconfigure RABBIT_PROTOCOL ${RABBIT_PROTOCOL:-amqp}
reconfigure RABBIT_HOST ${RABBIT_HOST}
reconfigure RABBIT_PORT "${RABBIT_PORT:-5672}"
reconfigure RABBIT_USER_NAME ${RABBIT_USER_NAME}
reconfigure RABBIT_PASSWORD ${RABBIT_PASSWORD}
reconfigure RABBIT_VIRTUAL_HOST "${RABBIT_VIRTUAL_HOST:-/}"
}
[[ ! -z "$REDIS_HOST" ]] && {
fi
if [[ ! -z "$REDIS_HOST" ]]; then
establish_conn ${REDIS_HOST} "${REDIS_PORT:-6379}" "Redis"
reconfigure REDIS_HOST ${REDIS_HOST}
reconfigure REDIS_PORT "${REDIS_PORT:-6379}"
reconfigure REDIS_USER_NAME ${REDIS_USER_NAME}
reconfigure REDIS_PASSWORD ${REDIS_PASSWORD}
}
[[ ! -z "$ELK_HOST" ]] && {
fi
if [[ ! -z "$ELK_HOST" ]]; then
establish_conn ${ELK_HOST} "${ELK_PORT:-9200}" "search engine"
reconfigure ELK_SHEME "${ELK_SHEME:-http}"
reconfigure ELK_HOST ${ELK_HOST}
reconfigure ELK_PORT "${ELK_PORT:-9200}"
}
fi
}

start_installation () {
Expand Down
8 changes: 0 additions & 8 deletions install/OneClickInstall/install-RedHat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ RES_QUESTIONS="In case you have any questions contact us via http://support.only
RES_MARIADB="To continue the installation, you need to remove MariaDB"
INSTALL_FLUENT_BIT="true"

res_unsupported_version () {
RES_CHOICE="Please, enter Y or N"
RES_CHOICE_INSTALLATION="Continue installation [Y/N]? "
RES_UNSPPORTED_VERSION="You have an unsupported version of $DIST installed"
RES_SELECT_INSTALLATION="Select 'N' to cancel the ONLYOFFICE installation (recommended). Select 'Y' to continue installing ONLYOFFICE"
RES_ERROR_REMINDER="Please note, that if you continue with the installation, there may be errors"
}

while [ "$1" != "" ]; do
case $1 in

Expand Down
12 changes: 6 additions & 6 deletions install/OneClickInstall/install-RedHat/install-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,13 @@ expect << EOF
EOF
fi

if [ "$MAKESWAP" == "true" ]; then
make_swap
fi

{ ${package_manager} check-update ${product}; PRODUCT_CHECK_UPDATE=$?; } || true
if [ "$PRODUCT_INSTALLED" = "false" ]; then
${package_manager} install -y ${product} --best --allowerasing
${package_manager} install -y ${product} --best --allowerasing $TESTING_REPO
${product}-configuration \
-mysqlh ${MYSQL_SERVER_HOST} \
-mysqld ${MYSQL_SERVER_DB_NAME} \
Expand All @@ -147,18 +151,14 @@ if [ "$PRODUCT_INSTALLED" = "false" ]; then
elif [[ "${PRODUCT_CHECK_UPDATE}" -eq "${UPDATE_AVAILABLE_CODE}" || "${RECONFIGURE_PRODUCT}" = "true" ]]; then
ENVIRONMENT=$(grep -oP 'ENVIRONMENT=\K.*' /etc/${package_sysname}/${product}/systemd.env || grep -oP 'ENVIRONMENT=\K.*' /usr/lib/systemd/system/${product}-api.service)
CONNECTION_STRING=$(json -f /etc/${package_sysname}/${product}/appsettings.$ENVIRONMENT.json ConnectionStrings.default.connectionString)
${package_manager} -y update ${product} --best --allowerasing
${package_manager} -y update ${product} --best --allowerasing $TESTING_REPO
${product}-configuration \
-mysqlh $(grep -oP 'Server=\K[^;]*' <<< "$CONNECTION_STRING") \
-mysqld $(grep -oP 'Database=\K[^;]*' <<< "$CONNECTION_STRING") \
-mysqlu $(grep -oP 'User ID=\K[^;]*' <<< "$CONNECTION_STRING") \
-mysqlp $(grep -oP 'Password=\K[^;]*' <<< "$CONNECTION_STRING")
fi

if [ "$MAKESWAP" == "true" ]; then
make_swap
fi

echo ""
echo "$RES_INSTALL_SUCCESS"
echo "$RES_QUESTIONS"
Expand Down
21 changes: 3 additions & 18 deletions install/OneClickInstall/install-RedHat/install-preq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,12 @@ ${package_manager} -y install yum-utils
{ yum check-update postgresql; PSQLExitCode=$?; } || true #Checking for postgresql update
{ yum check-update $DIST*-release; exitCode=$?; } || true #Checking for distribution update

UPDATE_AVAILABLE_CODE=100
if [[ $exitCode -eq $UPDATE_AVAILABLE_CODE ]]; then
res_unsupported_version
echo $RES_UNSPPORTED_VERSION
echo $RES_SELECT_INSTALLATION
echo $RES_ERROR_REMINDER
echo $RES_QUESTIONS
read_unsupported_installation
fi

if rpm -qa | grep mariadb.*config >/dev/null 2>&1; then
echo $RES_MARIADB && exit 0
fi

#Add repositories: EPEL, REMI and RPMFUSION
#Add repository EPEL
[ "$DIST" != "fedora" ] && { rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-$REV.noarch.rpm || true; }
rpm -ivh https://rpms.remirepo.net/$REMI_DISTR_NAME/remi-release-$REV.rpm || true
yum install -y --nogpgcheck https://download1.rpmfusion.org/free/$RPMFUSION_DISTR_NAME/rpmfusion-free-release-$REV.noarch.rpm

[ "$REV" = "9" ] && update-crypto-policies --set DEFAULT:SHA1 && ${package_manager} -y install xorg-x11-font-utils
[ "$DIST" = "centos" ] && TESTING_REPO="--enablerepo=$( [ "$REV" = "9" ] && echo "crb" || echo "powertools" )"
[ "$DIST" = "redhat" ] && { /usr/bin/crb enable && yum repolist enabled | grep -qi -e crb -e codeready || echo "Failed to enable or verify CRB repository."; exit 1; }
Expand Down Expand Up @@ -100,17 +87,15 @@ ${package_manager} -y install $([ $DIST != "fedora" ] && echo "epel-release") \
SDL2 \
expect \
java-${JAVA_VERSION}-openjdk-headless \
ffmpeg \
--enablerepo=opensearch-2.x --enablerepo=remi $TESTING_REPO
--enablerepo=opensearch-2.x

# Set Java ${JAVA_VERSION} as the default version
JAVA_PATH=$(find /usr/lib/jvm/ -name "java" -path "*java-${JAVA_VERSION}*" | head -1)
alternatives --install /usr/bin/java java "$JAVA_PATH" 100 && alternatives --set java "$JAVA_PATH"

#add repo, install fluent-bit
if [ ${INSTALL_FLUENT_BIT} == "true" ]; then
curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | bash
[ "$DIST" = "fedora" ] && rm -f /etc/yum.repos.d/fluent-bit.repo
[ "$DIST" != "fedora" ] && curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | bash || yum -y install fluent-bit
${package_manager} -y install opensearch-dashboards-${DASHBOARDS_VERSION} --enablerepo=opensearch-dashboards-2.x
fi

Expand Down
16 changes: 1 addition & 15 deletions install/OneClickInstall/install-RedHat/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,7 @@ if [ "$SKIP_HARDWARE_CHECK" != "true" ]; then
check_hardware
fi

read_unsupported_installation () {
read -p "$RES_CHOICE_INSTALLATION " CHOICE_INSTALLATION
case "$CHOICE_INSTALLATION" in
y|Y ) yum -y install $DIST*-release
;;

n|N ) exit 0;
;;

* ) echo $RES_CHOICE;
read_unsupported_installation
;;
esac
}

UPDATE_AVAILABLE_CODE=100
DIST=$(rpm -qa --queryformat '%{NAME}\n' | grep -E 'centos-release|redhat-release|fedora-release' | awk -F '-' '{print $1}' | head -n 1)
DIST=${DIST:-$(awk -F= '/^ID=/ {gsub(/"/, "", $2); print tolower($2)}' /etc/os-release)};
[[ "$DIST" =~ ^(centos|redhat|fedora)$ ]] || DIST="centos"
Expand Down
14 changes: 5 additions & 9 deletions install/common/product-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -476,19 +476,15 @@ setup_openresty(){
sed "s!\(^worker_processes\).*;!\1 ${NGINX_WORKER_PROCESSES:-$(grep processor /proc/cpuinfo | wc -l)};!" -i "${OPENRESTY_CONF}"
sed "s!\(worker_connections\).*;!\1 ${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)};!" -i "${OPENRESTY_CONF}"

# Check for old configuration files
if [ -f "${OPENRESTY_DIR}/conf.d/${PACKAGE_SYSNAME}-proxy.conf.dpkg-old" ]; then
PROXY_CONF="${OPENRESTY_DIR}/conf.d/${PACKAGE_SYSNAME}-proxy.conf.dpkg-old"
elif [ -f "${OPENRESTY_DIR}/conf.d/${PACKAGE_SYSNAME}-proxy.conf.rpmsave" ]; then
PROXY_CONF="${OPENRESTY_DIR}/conf.d/${PACKAGE_SYSNAME}-proxy.conf.rpmsave"
fi

# If the configuration file is found, extract the paths to the certificate and key
PROXY_CONF="${OPENRESTY_DIR}/conf.d/${PACKAGE_SYSNAME}-proxy.conf"
if [ ! -z "${PROXY_CONF}" ]; then
DOMAIN=$(json -f ${USER_CONF} files.docservice.url.portal | awk -F[/:] '{if ($1 == "https") print $4; else print ""}')
DOMAIN=$(json -f ${USER_CONF} files.docservice.url.portal | awk -F[/:] '{print ($1 == "https") ? $4 : ""}')
CERTIFICATE_PATH=$(grep -oP 'ssl_certificate\s+\K\S+' "${PROXY_CONF}" | tr -d ';')
CERTIFICATE_KEY_PATH=$(grep -oP 'ssl_certificate_key\s+\K\S+' "${PROXY_CONF}" | tr -d ';')

# (DS v3.0.0) Fix the problem related to environment change
[[ -f "${APP_DIR}/appsettings.production.json" ]] && DOMAIN=${DOMAIN:-$(json -f "$APP_DIR/appsettings.production.json" files.docservice.url.portal | awk -F[/:] '{print ($1 == "https") ? $4 : ""}')}

# If both values are found, start SSL configuration
if [ ! -z "${DOMAIN}" ] && [ ! -z "${CERTIFICATE_PATH}" ] && [ ! -z "${CERTIFICATE_KEY_PATH}" ]; then
/usr/bin/${PRODUCT}-ssl-setup -f "${DOMAIN}" "${CERTIFICATE_PATH}" "${CERTIFICATE_KEY_PATH}"
Expand Down
2 changes: 1 addition & 1 deletion install/docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
MYSQL_VERSION=8.3.0
PROXY_VERSION=latest
REDIS_VERSION=7
RABBITMQ_VERSION=3
RABBITMQ_VERSION=3.13.6
ELK_VERSION=2.11.1
FLUENT_BIT_VERSION=3.0.2
DASHBOARDS_VERSION=2.11.1
Expand Down
2 changes: 1 addition & 1 deletion install/rpm/SPECS/package.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Summary: Files-services
Group: Applications/Internet
Requires: %name-common = %version-%release
Requires: dotnet-sdk-8.0
Requires: ffmpeg
Requires: ffmpeg-free
AutoReqProv: no
BuildArch: noarch
%description files-services
Expand Down

0 comments on commit f61eb7a

Please sign in to comment.