Skip to content

Commit

Permalink
Merge branch 'release/v3.0.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeySafronov committed Oct 24, 2024
2 parents a1823da + f2a9ac7 commit ca8de7d
Show file tree
Hide file tree
Showing 36 changed files with 379 additions and 200 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/ci-oci-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ on:

workflow_dispatch:
inputs:
centos8s:
type: boolean
description: 'CentOS 8 Stream'
default: true
centos9s:
type: boolean
description: 'CentOS 9 Stream'
Expand Down Expand Up @@ -77,7 +73,6 @@ jobs:
run: |
matrix=$(echo '{
"include": [
{"execute": '${{ github.event.inputs.centos8s || true }}', "name": "CentOS8S", "os": "centos8s", "distr": "generic"},
{"execute": '${{ github.event.inputs.centos9s || true }}', "name": "CentOS9S", "os": "centos9s", "distr": "generic"},
{"execute": '${{ github.event.inputs.debian11 || true }}', "name": "Debian11", "os": "debian11", "distr": "generic"},
{"execute": '${{ github.event.inputs.debian12 || true }}', "name": "Debian12", "os": "debian12", "distr": "generic"},
Expand All @@ -91,17 +86,16 @@ jobs:
matrix=$(jq -c --arg REDHAT_CHANGED "${{ env.redhat_changed }}" --arg DEBIAN_CHANGED "${{ env.debian_changed }}" '
{ include: [.[] | select(
($REDHAT_CHANGED == "true" and $DEBIAN_CHANGED == "true" and .execute == true) or
($REDHAT_CHANGED == $DEBIAN_CHANGED and .execute == true) or
($REDHAT_CHANGED == "true" and (.name | test("CentOS|Fedora"))) or
($DEBIAN_CHANGED == "true" and (.name | test("Debian|Ubuntu"))) or
($REDHAT_CHANGED == "false" and $DEBIAN_CHANGED == "false" and .execute == true))]
($DEBIAN_CHANGED == "true" and (.name | test("Debian|Ubuntu"))))]
}' <<< "$matrix")
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
vagrant-up:
name: "Test DocSpace with ${{ matrix.name}}"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: prepare
strategy:
fail-fast: false
Expand All @@ -119,6 +113,8 @@ jobs:
- name: Get update and install vagrant
run: |
set -eux
sudo wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
sudo echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update -y
sudo apt install vagrant virtualbox -y
Expand All @@ -141,7 +137,7 @@ jobs:
DISTR='${{ matrix.distr }}' \
OS='${{ matrix.os }}' \
DOWNLOAD_SCRIPT='-ds true' \
RAM='5100' \
RAM='8192' \
CPU='3' \
ARGUMENTS="-arg '--skiphardwarecheck true'" \
vagrant up
Expand All @@ -152,7 +148,7 @@ jobs:
vagrant destroy --force
- name: "Test Local scripts with ${{matrix.name}}"
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
uses: nick-fields/retry@v3
with:
max_attempts: 2
Expand All @@ -164,7 +160,7 @@ jobs:
TEST_CASE='--local-install' \
DISTR='${{ matrix.distr }}' \
OS='${{matrix.os}}' \
RAM='5100' \
RAM='8192' \
CPU='3' \
DOWNLOAD_SCRIPT='-ds false' \
TEST_REPO='-tr true' \
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ci-oci-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:

workflow_dispatch:
inputs:
centos8s:
type: boolean
description: 'CentOS 8 Stream'
default: true
centos9s:
type: boolean
description: 'CentOS 9 Stream'
Expand Down Expand Up @@ -46,7 +42,6 @@ jobs:
run: |
matrix=$(echo '{
"include": [
{"execute": '${{ github.event.inputs.centos8s || true }}', "name": "CentOS8S", "os": "centos8s", "distr": "onlyoffice"},
{"execute": '${{ github.event.inputs.centos9s || true }}', "name": "CentOS9S", "os": "centos9s", "distr": "onlyoffice"},
{"execute": '${{ github.event.inputs.debian11 || true }}', "name": "Debian11", "os": "debian11", "distr": "onlyoffice"},
{"execute": '${{ github.event.inputs.debian12 || true }}', "name": "Debian12", "os": "debian12", "distr": "onlyoffice"},
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/rebuild-boxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Rebuild boxes
on:
workflow_dispatch:
inputs:
centos8s:
type: boolean
description: 'CentOS 8 Stream'
default: true
centos9s:
type: boolean
description: 'CentOS 9 Stream'
Expand Down Expand Up @@ -44,7 +40,6 @@ jobs:
run: |
matrix=$(echo '{
"include": [
{"execute": '${{ github.event.inputs.centos8s || true }}', "name": "CentOS8S", "os": "centos8s", "distr": "generic"},
{"execute": '${{ github.event.inputs.centos9s || true }}', "name": "CentOS9S", "os": "centos9s", "distr": "generic"},
{"execute": '${{ github.event.inputs.debian11 || true }}', "name": "Debian11", "os": "debian11", "distr": "generic"},
{"execute": '${{ github.event.inputs.debian12 || true }}', "name": "Debian12", "os": "debian12", "distr": "generic"},
Expand Down
32 changes: 32 additions & 0 deletions install/OneClickInstall/install-Debian/install-preq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,28 @@ if [ ${INSTALL_FLUENT_BIT} == "true" ]; then
DASHBOARDS_VERSION="2.11.1"
fi

#add rabbitmq & erlang repo
if [[ "${DISTRIB_CODENAME}" =~ ^(focal|bullseye)$ ]]; then
[ ! -f /etc/apt/sources.list.d/rabbitmq.list ] && RABBITMQ_REPO=false
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-erlang.E495BB49CC4BBE5B.key | gpg --dearmor > /usr/share/keyrings/erlang.gpg
curl -1sLf https://github.com/rabbitmq/signing-keys/releases/download/3.0/cloudsmith.rabbitmq-server.9F4587F226208342.key | gpg --dearmor > /usr/share/keyrings/rabbitmq.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/erlang.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-erlang/deb/${DIST} ${DISTRIB_CODENAME} main" > /etc/apt/sources.list.d/rabbitmq.list
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/rabbitmq.gpg] https://ppa1.rabbitmq.com/rabbitmq/rabbitmq-server/deb/${DIST} ${DISTRIB_CODENAME} main" >> /etc/apt/sources.list.d/rabbitmq.list
if dpkg -l | grep -q rabbitmq-server && [ "${RABBITMQ_REPO}" = false ]; then
echo "You have an old version of RabbitMQ installed. The update will cause the RabbitMQ database to be deleted."
echo "If you use the database only in the ONLYOFFICE configuration, then the update will be safe for you."
echo "Select 'Y' to install the new version of RabbitMQ. Select 'N' to abort the installation."
read -r -p "Please, enter Y or N: " CHOICE_INSTALLATION
if [ "${CHOICE_INSTALLATION}" =~ ^[Yy]$ ]]; then
rm -rf /var/lib/rabbitmq/mnesia/$(rabbitmqctl eval "node().")
apt-get remove -y rabbitmq-server erlang*
else
rm -f /etc/apt/sources.list.d/rabbitmq.list
exit 1
fi
fi
fi

# add nodejs repo
NODE_VERSION="18"
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash -
Expand Down Expand Up @@ -110,6 +132,12 @@ curl -fsSL https://openresty.org/package/pubkey.gpg | gpg --no-default-keyring -
echo "deb [signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/package/$DIST $OPENRESTY_DIST_CODENAME $([ "$DIST" = "ubuntu" ] && echo "main" || echo "openresty" )" | tee /etc/apt/sources.list.d/openresty.list
chmod 644 /usr/share/keyrings/openresty.gpg
#add java repo
curl -fsSL https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /usr/share/keyrings/adoptium.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb $DISTRIB_CODENAME main" | tee /etc/apt/sources.list.d/adoptium.list
chmod 644 /usr/share/keyrings/adoptium.gpg
JAVA_VERSION="21"
# setup msttcorefonts
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
Expand All @@ -127,11 +155,15 @@ apt-get install -o DPkg::options::="--force-confnew" -yq \
postgresql \
redis-server \
rabbitmq-server \
temurin-${JAVA_VERSION}-jre \
ffmpeg
if ! dpkg -l | grep -q "opensearch"; then
apt-get install -yq opensearch=${ELASTIC_VERSION}
fi
# Set Java ${JAVA_VERSION} as the default version
JAVA_PATH=$(find /usr/lib/jvm/ -name "java" -path "*temurin-${JAVA_VERSION}*" | head -1)
update-alternatives --install /usr/bin/java java "$JAVA_PATH" 100 && update-alternatives --set java "$JAVA_PATH"
if [ ${INSTALL_FLUENT_BIT} == "true" ]; then
[[ "$DISTRIB_CODENAME" =~ noble ]] && FLUENTBIT_DIST_CODENAME="jammy" || FLUENTBIT_DIST_CODENAME="${DISTRIB_CODENAME}"
Expand Down
2 changes: 2 additions & 0 deletions install/OneClickInstall/install-Debian/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ make_swap () {
EXIST=$(swapon -s | awk '{ print $1 }' | { grep -x ${SWAPFILE} || true; });

if [[ -z $EXIST ]] && [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ] && [ ${AVAILABLE_DISK_SPACE} -gt ${DISK_REQUIREMENTS} ]; then
touch "${SWAPFILE}"
[[ "$(df -T / | awk 'NR==2{print $2}')" = "btrfs" ]] && chattr +C "${SWAPFILE}"
fallocate -l 6G ${SWAPFILE}
chmod 600 ${SWAPFILE}
mkswap ${SWAPFILE}
Expand Down
3 changes: 3 additions & 0 deletions install/OneClickInstall/install-Docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,9 @@ install_product () {
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}"
#Fix for bug 70537 to ensure proper migration to version 3.0.0
elif [ "${UPDATE}" = "true" ] && [ -f "/etc/cron.d/${PRODUCT}-letsencrypt" ]; then
bash $BASE_DIR/config/${PRODUCT}-ssl-setup -r
fi
elif [ "$INSTALL_PRODUCT" == "pull" ]; then
docker-compose -f $BASE_DIR/identity.yml pull
Expand Down
6 changes: 6 additions & 0 deletions install/OneClickInstall/install-RedHat/install-preq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ OPENRESTY_REPO_FILE=$( [[ "$REV" -ge 9 && "$DIST" != "fedora" ]] && echo "openre
curl -o /etc/yum.repos.d/openresty.repo "https://openresty.org/package/${OPENRESTY_DISTR_NAME}/${OPENRESTY_REPO_FILE}"
[ "$DIST" == "fedora" ] && sed -i "s/\$releasever/$OPENRESTY_REV/g" /etc/yum.repos.d/openresty.repo

JAVA_VERSION=21
${package_manager} -y install $([ $DIST != "fedora" ] && echo "epel-release") \
python3 \
nodejs ${NODEJS_OPTION} \
Expand All @@ -98,8 +99,13 @@ ${package_manager} -y install $([ $DIST != "fedora" ] && echo "epel-release") \
redis --enablerepo=remi \
SDL2 $POWERTOOLS_REPO \
expect \
java-${JAVA_VERSION}-openjdk-headless \
ffmpeg $TESTING_REPO

# 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
Expand Down
9 changes: 4 additions & 5 deletions install/OneClickInstall/install-RedHat/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ function make_swap () {

if [[ -z $EXIST ]] && [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ] && [ ${AVAILABLE_DISK_SPACE} -gt ${DISK_REQUIREMENTS} ]; then
touch "$SWAPFILE"
# No Copy-on-Write - no compression
[[ "$DIST" == "fedora" ]] && chattr +C "$SWAPFILE"
# Allocate 6 GB, much faster than: dd if=/dev/zero of=${SWAPFILE} count=6144 bs=1MiB
[[ "$(df -T / | awk 'NR==2{print $2}')" = "btrfs" ]] && chattr +C "$SWAPFILE"
fallocate -l 6G "$SWAPFILE"
chmod 600 "$SWAPFILE"
mkswap "$SWAPFILE"
# Activate, enable upon system boot
swapon "$SWAPFILE"
echo "$SWAPFILE none swap sw 0 0" >> /etc/fstab
fi
Expand Down Expand Up @@ -95,7 +92,9 @@ if [ "$DIST" == "fedora" ]; then
fi

# Check if it's Centos less than 8 or Fedora release is out of service
if [ "${REV}" -lt 8 ] || [ "$SUPPORTED_FEDORA_FLAG" == "false" ]; then
if { [[ "${DIST}" == "centos" && "${REV}" -lt 9 ]] || \
[[ "${DIST}" == "redhat" && "${REV}" -lt 8 ]] || \
[[ "$SUPPORTED_FEDORA_FLAG" == "false" ]]; }; then
echo "Your ${DIST} ${REV} operating system has reached the end of its service life."
echo "Please consider upgrading your operating system or using a Docker installation."
exit 1
Expand Down
6 changes: 3 additions & 3 deletions install/common/build-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ echo "== BACK-END-BUILD =="

cd ${SRC_PATH}/server
dotnet build ASC.Web.slnf ${ARGS}
dotnet build ASC.Migrations.sln -o ${SRC_PATH}/server/ASC.Migration.Runner/service/
dotnet build ASC.Migrations.sln --property:OutputPath=${SRC_PATH}/server/ASC.Migration.Runner/service/

cd ${SRC_PATH}/client
# Array of names backend services in directory common (Nodejs)
Expand All @@ -71,9 +71,9 @@ IDENTITY_MODULES+=("infrastructure/infrastructure-migration-runner")
cd ${SRC_PATH}/server/common/ASC.Identity/

# Build and publish identity services
mvn dependency:go-offline
mvn -B dependency:go-offline
for i in "${!IDENTITY_NAMES[@]}"; do
echo "== Build ${IDENTITY_NAMES[$i]} project =="
mvn clean package -DskipTests -pl "${IDENTITY_MODULES[$i]}" -am
mvn clean package -B -DskipTests -pl "${IDENTITY_MODULES[$i]}" -am
mkdir -p ${IDENTITY_NAMES[$i]} && cp -rf "${IDENTITY_MODULES[$i]}/target/"*.jar "${IDENTITY_NAMES[$i]}/app.jar"
done
13 changes: 13 additions & 0 deletions install/common/plugins-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -xe

SRC_PATH=${1:-"/plugins"}

for PLUGIN_DIR in $(ls -d ${SRC_PATH}/*); do
[[ -f ${PLUGIN_DIR}/yarn.lock || -f ${PLUGIN_DIR}/package.json ]] || continue
PLUGIN_NAME=$(basename ${PLUGIN_DIR})
echo "Building plugin: ${PLUGIN_NAME}"
cd ${PLUGIN_DIR} && yarn install && yarn run build
mkdir -p "${SRC_PATH}/publish/${PLUGIN_NAME}"
unzip "${PLUGIN_DIR}/dist/plugin.zip" -d "${SRC_PATH}/publish/${PLUGIN_NAME}"
done
42 changes: 26 additions & 16 deletions install/common/product-configuration
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ while [ "$1" != "" ]; do
-rbh | --rabbitmqhost )
if [ "$2" != "" ]; then
RABBITMQ_HOST=$2
check_localhost "$REDIS_HOST" && EXTERNAL_RABBITMQ_FLAG="true"
check_localhost "$RABBITMQ_HOST" && EXTERNAL_RABBITMQ_FLAG="true"
shift
fi
;;
Expand Down Expand Up @@ -254,8 +254,6 @@ set_core_machinekey () {
save_undefined_param "${USER_CONF}" "core['base-domain']" "${APP_HOST}" "rewrite"
save_undefined_param "${APP_DIR}/apisystem.${ENVIRONMENT}.json" "core.machinekey" "${CORE_MACHINEKEY}"
save_undefined_param "${APP_DIR}/apisystem.${ENVIRONMENT}.json" "core['base-domain']" "${APP_HOST}" "rewrite"

sed "s^\(machine_key\)\s*=.*^\1 = ${CORE_MACHINEKEY}^g" -i $APP_DIR/radicale.config
}

install_json() {
Expand Down Expand Up @@ -285,24 +283,27 @@ save_undefined_param() {
restart_services() {
chown -R ${PACKAGE_SYSNAME}:${PACKAGE_SYSNAME} $APP_DIR $PRODUCT_DIR $LOG_DIR /var/www/$PACKAGE_SYSNAME/Data

sed "s_\(ENVIRONMENT=\).*_\1${ENVIRONMENT}_i" -i ${SYSTEMD_DIR}/${PRODUCT}*.service >/dev/null 2>&1
sed "s_\(--ENVIRONMENT=\).*_\1${ENVIRONMENT}_i" -i ${SYSTEMD_DIR}/${PRODUCT}*.service >/dev/null 2>&1
systemctl daemon-reload

echo -n "Updating database... "
systemctl start ${PRODUCT}-migration-runner >/dev/null 2>&1 || true
while systemctl is-active ${PRODUCT}-migration-runner &>/dev/null; do
sleep 5
for SERVICE in "${PRODUCT}-migration-runner" "${PRODUCT}-identity-migration"; do
systemctl start "$SERVICE" >/dev/null 2>&1 || true
while systemctl is-active "$SERVICE" &>/dev/null; do
sleep 5
done
done
echo "OK"

echo -n "Restarting services... "
for SVC in login api socket studio-notify notify \
SERVICES=(login api socket studio-notify notify \
people-server files files-services studio backup api-system \
clear-events backup-background ssoauth doceditor healthchecks
do
systemctl enable ${PRODUCT}-$SVC >/dev/null 2>&1
systemctl restart ${PRODUCT}-$SVC
done
clear-events backup-background ssoauth doceditor healthchecks \
identity-authorization identity-api)
SERVICES_LIST=("${SERVICES[@]/#/${PRODUCT}-}")

systemctl enable "${SERVICES_LIST[@]}" >/dev/null 2>&1
systemctl restart "${SERVICES_LIST[@]}"
echo "OK"
}

Expand Down Expand Up @@ -364,6 +365,7 @@ Character Set=utf8; AutoEnlist=false; SSL Mode=none;AllowPublicKeyRetrieval=true
save_undefined_param "${APP_DIR}/apisystem.${ENVIRONMENT}.json" "ConnectionStrings.default.connectionString" "${CONNECTION_STRING}"

sed "s&\(\"ConnectionString\":\).*&\1 \"$(printf "%q" "${CONNECTION_STRING}")\"&" -i $PRODUCT_DIR/services/ASC.Migration.Runner/appsettings.runner.json
echo -e "JDBC_URL=${DB_HOST}:${DB_PORT}\nJDBC_DATABASE=${DB_NAME}\nJDBC_USER_NAME=${DB_USER}\nJDBC_PASSWORD=${DB_PWD}" >> "${APP_DIR}/identity.env"

#Enable database migration
save_undefined_param "${USER_CONF}" "migration.enabled" "true"
Expand Down Expand Up @@ -533,7 +535,9 @@ setup_openresty(){
PORTS+=('5032') #ASC.Data.Backup.BackgroundTasks
PORTS+=('5033') #ASC.Web.HealthChecks
PORTS+=('5100') #ASC.ApiCache
PORTS+=('8081') #Storybook
PORTS+=('8080') #ASC.Identity.Authorization
PORTS+=('8081') #ASC.Identity.Migration
PORTS+=('9090') #ASC.Identity.API
PORTS+=('9834') #ASC.SsoAuth
PORTS+=('9899') #ASC.Socket.IO
setsebool -P httpd_can_network_connect on
Expand Down Expand Up @@ -749,7 +753,7 @@ setup_dashboards() {
# set basePath variable to get access to Dashboards from a remote host
sed 's_.*\(server.basePath:\).*_\1 "/dashboards"_' -i ${DASHBOARDS_CONF_PATH}

systemctl enable opensearch-dashboards
systemctl enable opensearch-dashboards >/dev/null 2>&1
systemctl restart opensearch-dashboards
echo "OK"
}
Expand All @@ -761,7 +765,7 @@ setup_fluentbit() {
sed -i "s/OPENSEARCH_HOST/$ELK_HOST/g; s/OPENSEARCH_PORT/$ELK_PORT/g; s/OPENSEARCH_INDEX/$OPENSEARCH_INDEX/g; s/OPENSEARCH_SCHEME/$ELK_SHEME/g" ${APP_DIR}/fluent-bit.conf
cp -f ${APP_DIR}/fluent-bit.conf /etc/fluent-bit/fluent-bit.conf

systemctl enable fluent-bit
systemctl enable fluent-bit >/dev/null 2>&1
systemctl restart fluent-bit
echo "OK"
}
Expand All @@ -770,6 +774,7 @@ setup_redis() {
echo -n "Configuring redis... "

$JSON $APP_DIR/redis.$ENVIRONMENT.json -e "this.Redis={'Hosts': [ { Host: \"${REDIS_HOST}\", Port: \"${REDIS_PORT}\" } ] }" >/dev/null 2>&1
echo -e "REDIS_HOST=${REDIS_HOST}\nREDIS_PORT=${REDIS_PORT}" >> "${APP_DIR}/identity.env"

sed -i "s~\(redis_host =\).*~\1 \"$REDIS_HOST\"~" "${OPENRESTY_DIR}/conf.d/${PACKAGE_SYSNAME}.conf"
sed -i "s~\(redis_port =\).*~\1 $REDIS_PORT~" "${OPENRESTY_DIR}/conf.d/${PACKAGE_SYSNAME}.conf"
Expand Down Expand Up @@ -804,6 +809,8 @@ setup_rabbitmq() {
save_undefined_param "${APP_DIR}/rabbitmq.${ENVIRONMENT}.json" "RabbitMQ.Uri" "${RABBITMQ_PROTOCOL}://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@${RABBITMQ_HOST}:${RABBITMQ_PORT}/"
fi

echo -e "RABBIT_URI=${RABBITMQ_PROTOCOL}://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@${RABBITMQ_HOST}:${RABBITMQ_PORT}/" >> "${APP_DIR}/identity.env"

if [ $1 == "LOCAL_RABBITMQ_SERVER" ]; then
systemctl enable rabbitmq-server >/dev/null 2>&1
systemctl restart rabbitmq-server
Expand All @@ -825,6 +832,9 @@ product_configuration(){
fi
done

echo "SPRING_PROFILES_ACTIVE=prod" > "$APP_DIR/identity.env"
chmod o-rwx "$APP_DIR/identity.env"

set_core_machinekey

echo "OK"
Expand Down
Loading

0 comments on commit ca8de7d

Please sign in to comment.