Merge branch 'release/v2.5.0' into develop

This commit is contained in:
Alexey Safronov 2024-03-26 14:39:38 +04:00
commit 3c49230199
11 changed files with 56 additions and 57 deletions

View File

@ -33,7 +33,7 @@
"auth" : { "auth" : {
"allowskip" : { "allowskip" : {
"default" : false, "default" : false,
"registerportal": true "registerportal": false
} }
}, },
"ConnectionStrings": { "ConnectionStrings": {

View File

@ -79,7 +79,7 @@ elif [ "$UPDATE" = "true" ] && [ "$PRODUCT_INSTALLED" = "true" ]; then
CURRENT_VERSION=$(dpkg-query -W -f='${Version}' ${product} 2>/dev/null) CURRENT_VERSION=$(dpkg-query -W -f='${Version}' ${product} 2>/dev/null)
AVAILABLE_VERSIONS=$(apt show ${product} 2>/dev/null | grep -E '^Version:' | awk '{print $2}') AVAILABLE_VERSIONS=$(apt show ${product} 2>/dev/null | grep -E '^Version:' | awk '{print $2}')
if [[ "$AVAILABLE_VERSIONS" != *"$CURRENT_VERSION"* ]]; then if [[ "$AVAILABLE_VERSIONS" != *"$CURRENT_VERSION"* ]]; then
apt-get install -o DPkg::options::="--force-confnew" -y --only-upgrade ${product} elasticsearch=${ELASTIC_VERSION} apt-get install -o DPkg::options::="--force-confnew" -y --only-upgrade ${product} opensearch=${ELASTIC_VERSION}
elif [ "${RECONFIGURE_PRODUCT}" = "true" ]; then elif [ "${RECONFIGURE_PRODUCT}" = "true" ]; then
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure ${product} DEBIAN_FRONTEND=noninteractive dpkg-reconfigure ${product}
fi fi

View File

@ -31,12 +31,10 @@ fi
locale-gen en_US.UTF-8 locale-gen en_US.UTF-8
# add elasticsearch repo # add opensearch repo
ELASTIC_VERSION="7.16.3" curl -o- https://artifacts.opensearch.org/publickeys/opensearch.pgp | gpg --dearmor --batch --yes -o /usr/share/keyrings/opensearch-keyring
ELASTIC_DIST=$(echo $ELASTIC_VERSION | awk '{ print int($1) }') echo "deb [signed-by=/usr/share/keyrings/opensearch-keyring] https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt stable main" >> /etc/apt/sources.list.d/opensearch-2.x.list
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/elastic-${ELASTIC_DIST}.x.gpg --import ELASTIC_VERSION="2.11.1"
echo "deb [signed-by=/usr/share/keyrings/elastic-${ELASTIC_DIST}.x.gpg] https://artifacts.elastic.co/packages/${ELASTIC_DIST}.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-${ELASTIC_DIST}.x.list
chmod 644 /usr/share/keyrings/elastic-${ELASTIC_DIST}.x.gpg
# add nodejs repo # add nodejs repo
NODE_VERSION="18" NODE_VERSION="18"
@ -114,8 +112,8 @@ apt-get install -o DPkg::options::="--force-confnew" -yq \
rabbitmq-server \ rabbitmq-server \
ffmpeg ffmpeg
if ! dpkg -l | grep -q "elasticsearch"; then if ! dpkg -l | grep -q "opensearch"; then
apt-get install -yq elasticsearch=${ELASTIC_VERSION} apt-get install -yq opensearch=${ELASTIC_VERSION}
fi fi
# disable apparmor for mysql # disable apparmor for mysql

View File

@ -61,20 +61,9 @@ if ! rpm -q mysql-community-server; then
MYSQL_FIRST_TIME_INSTALL="true"; MYSQL_FIRST_TIME_INSTALL="true";
fi fi
#add elasticsearch repo #add opensearch repo
ELASTIC_VERSION="7.16.3" curl -SL https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/opensearch-2.x.repo -o /etc/yum.repos.d/opensearch-2.x.repo
ELASTIC_DIST=$(echo $ELASTIC_VERSION | awk '{ print int($1) }') ELASTIC_VERSION="2.11.1"
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
cat > /etc/yum.repos.d/elasticsearch.repo <<END
[elasticsearch]
name=Elasticsearch repository for ${ELASTIC_DIST}.x packages
baseurl=https://artifacts.elastic.co/packages/${ELASTIC_DIST}.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
END
# add nginx repo, Fedora doesn't need it # add nginx repo, Fedora doesn't need it
if [ "$DIST" != "fedora" ]; then if [ "$DIST" != "fedora" ]; then
@ -98,7 +87,7 @@ ${package_manager} -y install $([ $DIST != "fedora" ] && echo "epel-release") \
python3 \ python3 \
nodejs ${NODEJS_OPTION} \ nodejs ${NODEJS_OPTION} \
dotnet-sdk-8.0 \ dotnet-sdk-8.0 \
elasticsearch-${ELASTIC_VERSION} --enablerepo=elasticsearch \ opensearch-${ELASTIC_VERSION} --enablerepo=opensearch-2.x \
mysql-community-server \ mysql-community-server \
postgresql \ postgresql \
postgresql-server \ postgresql-server \

View File

@ -493,7 +493,7 @@ setup_openresty(){
if [ "$DIST" = "RedHat" ]; then if [ "$DIST" = "RedHat" ]; then
# Remove default nginx settings [error] port 80 is already in use # Remove default nginx settings [error] port 80 is already in use
if [ -f /etc/nginx/nginx.conf ]; if [ -f /etc/nginx/nginx.conf ]; then
if grep -q "server {" /etc/nginx/nginx.conf ; then if grep -q "server {" /etc/nginx/nginx.conf ; then
sed -e '$a}' -e '/server {/,$d' -i /etc/nginx/nginx.conf sed -e '$a}' -e '/server {/,$d' -i /etc/nginx/nginx.conf
fi fi
@ -608,15 +608,26 @@ setup_enterprise() {
change_elasticsearch_config(){ change_elasticsearch_config(){
systemctl stop elasticsearch systemctl stop opensearch
systemctl is-active --quiet elasticsearch && systemctl stop elasticsearch
local ELASTIC_SEARCH_CONF_PATH="/etc/elasticsearch/elasticsearch.yml" ELASTIC_VERSION=$(awk '/build:/{f=1} f&&/version:/{gsub(/"/,"",$2);print $2; exit}' /usr/share/opensearch/manifest.yml 2>/dev/null || echo "2.11.1")
local ELASTIC_SEARCH_JAVA_CONF_PATH="/etc/elasticsearch/jvm.options"; [[ -f "$APP_DIR/.private/opensearch-version" && $(cat $APP_DIR/.private/opensearch-version) != *$ELASTIC_VERSION* ]] && $MYSQL "$DB_NAME" -e "TRUNCATE webstudio_index";
if /usr/share/elasticsearch/bin/elasticsearch-plugin list | grep -q "ingest-attachment"; then echo "$ELASTIC_VERSION" > $APP_DIR/.private/opensearch-version
/usr/share/elasticsearch/bin/elasticsearch-plugin remove -s ingest-attachment chmod o-rwx $APP_DIR/.private/opensearch-version
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
local ELASTIC_SEARCH_CONF_PATH="/etc/opensearch/opensearch.yml"
local ELASTIC_SEARCH_JAVA_CONF_PATH="/etc/opensearch/jvm.options";
if /usr/share/opensearch/bin/opensearch-plugin list | grep -q "ingest-attachment"; then
/usr/share/opensearch/bin/opensearch-plugin remove -s ingest-attachment
fi fi
/usr/share/elasticsearch/bin/elasticsearch-plugin install -s -b ingest-attachment /usr/share/opensearch/bin/opensearch-plugin install -s -b ingest-attachment
if [ -f ${ELASTIC_SEARCH_CONF_PATH}.rpmnew ]; then if [ -f ${ELASTIC_SEARCH_CONF_PATH}.rpmnew ]; then
cp -rf ${ELASTIC_SEARCH_CONF_PATH}.rpmnew ${ELASTIC_SEARCH_CONF_PATH}; cp -rf ${ELASTIC_SEARCH_CONF_PATH}.rpmnew ${ELASTIC_SEARCH_CONF_PATH};
@ -648,12 +659,6 @@ change_elasticsearch_config(){
sed -i "s/Dlog4j2.formatMsgNoLookups.*/Dlog4j2.formatMsgNoLookups=true/" ${ELASTIC_SEARCH_JAVA_CONF_PATH} sed -i "s/Dlog4j2.formatMsgNoLookups.*/Dlog4j2.formatMsgNoLookups=true/" ${ELASTIC_SEARCH_JAVA_CONF_PATH}
fi fi
if ! grep -q "ingest.geoip.downloader.enabled" ${ELASTIC_SEARCH_CONF_PATH}; then
echo "ingest.geoip.downloader.enabled: false" >> ${ELASTIC_SEARCH_CONF_PATH}
else
sed -i "s/ingest.geoip.downloader.enabled.*/ingest.geoip.downloader.enabled: false/" ${ELASTIC_SEARCH_CONF_PATH}
fi
local TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1); local TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);
local MEMORY_REQUIREMENTS=12000; #RAM ~12Gb local MEMORY_REQUIREMENTS=12000; #RAM ~12Gb
@ -675,13 +680,13 @@ change_elasticsearch_config(){
echo "-Xmx${ELASTICSEATCH_MEMORY}" >> "${ELASTIC_SEARCH_JAVA_CONF_PATH}" echo "-Xmx${ELASTICSEATCH_MEMORY}" >> "${ELASTIC_SEARCH_JAVA_CONF_PATH}"
fi fi
if [ -d /etc/elasticsearch/ ]; then if [ -d /etc/opensearch/ ]; then
chmod g+ws /etc/elasticsearch/ chmod g+ws /etc/opensearch/
fi fi
} }
setup_elasticsearch() { setup_elasticsearch() {
echo -n "Configuring elasticsearch... " echo -n "Configuring opensearch... "
#Save elasticsearch parameters in .json #Save elasticsearch parameters in .json
[[ $1 == "EXTERNAL_ELASTIC_SERVER" ]] && local EXTERNAL_ELASTIC_FLAG="rewrite" [[ $1 == "EXTERNAL_ELASTIC_SERVER" ]] && local EXTERNAL_ELASTIC_FLAG="rewrite"
@ -693,8 +698,8 @@ setup_elasticsearch() {
if [ $1 == "LOCAL_ELASTIC_SERVER" ]; then if [ $1 == "LOCAL_ELASTIC_SERVER" ]; then
change_elasticsearch_config change_elasticsearch_config
systemctl enable elasticsearch >/dev/null 2>&1 systemctl enable opensearch >/dev/null 2>&1
systemctl restart elasticsearch systemctl restart opensearch
fi fi
echo "OK" echo "OK"
} }
@ -811,7 +816,7 @@ fi
if [[ ! -z $EXTERNAL_ELK_FLAG ]]; then if [[ ! -z $EXTERNAL_ELK_FLAG ]]; then
check_connection_external_services "$ELK_HOST" "$ELK_PORT" "Elasticsearch" check_connection_external_services "$ELK_HOST" "$ELK_PORT" "Elasticsearch"
setup_elasticsearch "EXTERNAL_ELASTIC_SERVER" setup_elasticsearch "EXTERNAL_ELASTIC_SERVER"
elif $PACKAGE_MANAGER elasticsearch >/dev/null 2>&1; then elif $PACKAGE_MANAGER opensearch >/dev/null 2>&1; then
setup_elasticsearch "LOCAL_ELASTIC_SERVER" setup_elasticsearch "LOCAL_ELASTIC_SERVER"
fi fi

View File

@ -24,10 +24,12 @@ help(){
echo " Use comma to register multiple emails, ex:" echo " Use comma to register multiple emails, ex:"
echo " u1@example.com,u2@example.com." echo " u1@example.com,u2@example.com."
echo " DOMAIN Domain name to apply" echo " DOMAIN Domain name to apply"
echo " Use comma to register multiple domains, ex:"
echo " example.com,s1.example.com,s2.example.com."
echo "" echo ""
echo "Using your own certificates via the -f or --file parameter:" echo "Using your own certificates via the -f or --file parameter:"
echo " docspace-ssl-setup --file DOMAIN CERTIFICATE PRIVATEKEY" echo " docspace-ssl-setup --file DOMAIN CERTIFICATE PRIVATEKEY"
echo " DOMAIN Domain name to apply." echo " DOMAIN Main domain name to apply."
echo " CERTIFICATE Path to the certificate file for the domain." echo " CERTIFICATE Path to the certificate file for the domain."
echo " PRIVATEKEY Path to the private key file for the certificate." echo " PRIVATEKEY Path to the private key file for the certificate."
echo "" echo ""
@ -72,7 +74,8 @@ case $1 in
* ) * )
if [ "$#" -ge "2" ]; then if [ "$#" -ge "2" ]; then
MAIL=$1 MAIL=$1
DOMAIN=$2 DOMAINS=$2
DOMAIN=$(cut -d ',' -f 1 <<< "$DOMAINS")
LETSENCRYPT_ENABLE="true" LETSENCRYPT_ENABLE="true"
# Install certbot if not already installed # Install certbot if not already installed
@ -88,8 +91,8 @@ case $1 in
echo "Generating Let's Encrypt SSL Certificates..." echo "Generating Let's Encrypt SSL Certificates..."
# Request and generate Let's Encrypt SSL certificate # Request and generate Let's Encrypt SSL certificate
echo certbot certonly --expand --webroot -w ${WEBROOT_PATH} --cert-name ${PRODUCT} --noninteractive --agree-tos --email ${MAIL} -d ${DOMAIN} > /var/log/le-start.log echo certbot certonly --expand --webroot -w ${WEBROOT_PATH} --cert-name ${PRODUCT} --noninteractive --agree-tos --email ${MAIL} -d ${DOMAINS[@]} > /var/log/le-start.log
certbot certonly --expand --webroot -w ${WEBROOT_PATH} --cert-name ${PRODUCT} --noninteractive --agree-tos --email ${MAIL} -d ${DOMAIN} > /var/log/le-new.log certbot certonly --expand --webroot -w ${WEBROOT_PATH} --cert-name ${PRODUCT} --noninteractive --agree-tos --email ${MAIL} -d ${DOMAINS[@]} > /var/log/le-new.log
else else
help help
fi fi

View File

@ -120,7 +120,7 @@ reassign_values (){
WORK_DIR="${BASE_DIR}/products/ASC.Files/service/" WORK_DIR="${BASE_DIR}/products/ASC.Files/service/"
EXEC_FILE="ASC.Files.Service.dll" EXEC_FILE="ASC.Files.Service.dll"
CORE_EVENT_BUS=" --core:eventBus:subscriptionClientName=asc_event_bus_files_service_queue" CORE_EVENT_BUS=" --core:eventBus:subscriptionClientName=asc_event_bus_files_service_queue"
DEPENDENCY_LIST="${DEPENDENCY_LIST} elasticsearch.service" DEPENDENCY_LIST="${DEPENDENCY_LIST} opensearch.service"
;; ;;
studio ) studio )
SERVICE_PORT="5003" SERVICE_PORT="5003"

View File

@ -56,7 +56,7 @@ Package: {{product}}-files
Architecture: all Architecture: all
Multi-Arch: foreign Multi-Arch: foreign
Depends: {{product}}-common (= {{package_header_tag_version}}), dotnet-sdk-8.0, ${misc:Depends}, ${shlibs:Depends} Depends: {{product}}-common (= {{package_header_tag_version}}), dotnet-sdk-8.0, ${misc:Depends}, ${shlibs:Depends}
Recommends: elasticsearch (= 7.16.3) Recommends: opensearch (= 2.11.1)
Description: {{product}}-files Description: {{product}}-files
The service which handles API requests related to The service which handles API requests related to
documents and launches the OFormService service documents and launches the OFormService service
@ -65,7 +65,7 @@ Package: {{product}}-files-services
Architecture: all Architecture: all
Multi-Arch: foreign Multi-Arch: foreign
Depends: {{product}}-common (= {{package_header_tag_version}}), dotnet-sdk-8.0, ${misc:Depends}, ${shlibs:Depends} Depends: {{product}}-common (= {{package_header_tag_version}}), dotnet-sdk-8.0, ${misc:Depends}, ${shlibs:Depends}
Recommends: ffmpeg, elasticsearch (= 7.16.3) Recommends: ffmpeg, opensearch (= 2.11.1)
Description: {{product}}-files-services Description: {{product}}-files-services
The service which launches additional services related to file management: The service which launches additional services related to file management:
- ElasticSearchIndexService - indexes documents using elasticsearch; - ElasticSearchIndexService - indexes documents using elasticsearch;
@ -79,7 +79,7 @@ Package: {{product}}-notify
Architecture: all Architecture: all
Multi-Arch: foreign Multi-Arch: foreign
Depends: {{product}}-common (= {{package_header_tag_version}}), dotnet-sdk-8.0, ${misc:Depends}, ${shlibs:Depends} Depends: {{product}}-common (= {{package_header_tag_version}}), dotnet-sdk-8.0, ${misc:Depends}, ${shlibs:Depends}
Recommends: ffmpeg, elasticsearch (= 7.16.3) Recommends: ffmpeg, opensearch (= 2.11.1)
Description: {{product}}-notify Description: {{product}}-notify
The service which launches additional services The service which launches additional services
related to notifications about DocSpace events: related to notifications about DocSpace events:

View File

@ -28,10 +28,12 @@ help(){
echo " Use comma to register multiple emails, ex:" echo " Use comma to register multiple emails, ex:"
echo " u1@example.com,u2@example.com." echo " u1@example.com,u2@example.com."
echo " DOMAIN Domain name to apply" echo " DOMAIN Domain name to apply"
echo " Use comma to register multiple domains, ex:"
echo " example.com,s1.example.com,s2.example.com."
echo "" echo ""
echo "Using your own certificates via the -f or --file parameter:" echo "Using your own certificates via the -f or --file parameter:"
echo " docspace-ssl-setup --file DOMAIN CERTIFICATE PRIVATEKEY" echo " docspace-ssl-setup --file DOMAIN CERTIFICATE PRIVATEKEY"
echo " DOMAIN Domain name to apply." echo " DOMAIN Main domain name to apply."
echo " CERTIFICATE Path to the certificate file for the domain." echo " CERTIFICATE Path to the certificate file for the domain."
echo " PRIVATEKEY Path to the private key file for the certificate." echo " PRIVATEKEY Path to the private key file for the certificate."
echo "" echo ""
@ -89,7 +91,8 @@ case $1 in
* ) * )
if [ "$#" -ge "2" ]; then if [ "$#" -ge "2" ]; then
MAIL=$1 MAIL=$1
DOMAIN=$2 DOMAINS=$2
DOMAIN=$(cut -d ',' -f 1 <<< "$DOMAINS")
LETSENCRYPT_ENABLE="true" LETSENCRYPT_ENABLE="true"
if ! docker volume inspect "onlyoffice_webroot_path" &> /dev/null; then if ! docker volume inspect "onlyoffice_webroot_path" &> /dev/null; then
@ -110,7 +113,7 @@ case $1 in
-v onlyoffice_webroot_path:${WEBROOT_PATH} \ -v onlyoffice_webroot_path:${WEBROOT_PATH} \
certbot/certbot certonly \ certbot/certbot certonly \
--expand --webroot -w ${WEBROOT_PATH} \ --expand --webroot -w ${WEBROOT_PATH} \
--cert-name ${PRODUCT} --non-interactive --agree-tos --email ${MAIL} -d ${DOMAIN} --cert-name ${PRODUCT} --non-interactive --agree-tos --email ${MAIL} -d ${DOMAINS[@]}
else else
help help
fi fi

View File

@ -39,6 +39,7 @@ cp -rf %{_builddir}/publish/web/public/* "%{buildroot}%{buildpath}/public/"
cp -rf %{_builddir}/publish/web/login/* "%{buildroot}%{buildpath}/products/ASC.Login/login/" cp -rf %{_builddir}/publish/web/login/* "%{buildroot}%{buildpath}/products/ASC.Login/login/"
cp -rf %{_builddir}/publish/web/editor/* "%{buildroot}%{buildpath}/products/ASC.Files/editor/" cp -rf %{_builddir}/publish/web/editor/* "%{buildroot}%{buildpath}/products/ASC.Files/editor/"
cp -rf %{_builddir}/publish/web/editor/.next/* "%{buildroot}%{buildpath}/products/ASC.Files/editor/.next/" cp -rf %{_builddir}/publish/web/editor/.next/* "%{buildroot}%{buildpath}/products/ASC.Files/editor/.next/"
cp -rf %{_builddir}/server/products/ASC.Files/Server/DocStore/* "%{buildroot}%{buildpath}/products/ASC.Files/server/DocStore/"
cp -rf %{_builddir}/publish/web/client/* "%{buildroot}%{buildpath}/client/" cp -rf %{_builddir}/publish/web/client/* "%{buildroot}%{buildpath}/client/"
cp -rf %{_builddir}/server/publish/services/ASC.Web.Studio/service/* "%{buildroot}%{buildpath}/studio/ASC.Web.Studio/" cp -rf %{_builddir}/server/publish/services/ASC.Web.Studio/service/* "%{buildroot}%{buildpath}/studio/ASC.Web.Studio/"
cp -rf %{_builddir}/server/publish/services/ASC.Web.HealthChecks.UI/service/* "%{buildroot}%{buildpath}/services/ASC.Web.HealthChecks.UI/" cp -rf %{_builddir}/server/publish/services/ASC.Web.HealthChecks.UI/service/* "%{buildroot}%{buildpath}/services/ASC.Web.HealthChecks.UI/"

View File

@ -66,8 +66,8 @@ rm -rf %{_rpmdir}/%{_arch}/%{name}-* %{_builddir}/*
tar -xf %{SOURCE0} --transform='s,^[^/]\+,buildtools,' -C %{_builddir} tar -xf %{SOURCE0} --transform='s,^[^/]\+,buildtools,' -C %{_builddir}
tar -xf %{SOURCE1} --transform='s,^[^/]\+,client,' -C %{_builddir} tar -xf %{SOURCE1} --transform='s,^[^/]\+,client,' -C %{_builddir}
tar -xf %{SOURCE2} --transform='s,^[^/]\+,server,' -C %{_builddir} tar -xf %{SOURCE2} --transform='s,^[^/]\+,server,' -C %{_builddir}
tar -xf %{SOURCE3} --transform='s,^[^/]\+,dictionaries,' -C %{_builddir}/client/common/Tests/Frontend.Translations.Tests tar -xf %{SOURCE4} --transform='s,^[^/]\+,dictionaries,' -C %{_builddir}/client/common/Tests/Frontend.Translations.Tests
tar -xf %{SOURCE4} --transform='s,^[^/]\+,DocStore,' -C %{_builddir}/server/products/ASC.Files/Server tar -xf %{SOURCE3} --transform='s,^[^/]\+,DocStore,' -C %{_builddir}/server/products/ASC.Files/Server
cp %{SOURCE5} . cp %{SOURCE5} .
%include build.spec %include build.spec