Add support to deb package (#266)

This commit is contained in:
Sergey Kirichenko 2021-09-30 15:05:43 +03:00 committed by GitHub
parent 88f87d7a82
commit dbc174e955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 1205 additions and 187 deletions

View File

@ -39,7 +39,7 @@ product="appserver"
while [ "$1" != "" ]; do
case $1 in
-ls | --local_scripts )
-ls | --localscripts )
if [ "$2" == "true" ] || [ "$2" == "false" ]; then
PARAMETERS="$PARAMETERS ${1}";
LOCAL_SCRIPTS=$2

View File

@ -0,0 +1,85 @@
#!/bin/bash
set -e
package_sysname="onlyoffice";
DS_COMMON_NAME="onlyoffice";
product="appserver"
RES_APP_INSTALLED="is already installed";
RES_APP_CHECK_PORTS="uses ports"
RES_CHECK_PORTS="please, make sure that the ports are free.";
RES_INSTALL_SUCCESS="Thank you for installing ONLYOFFICE ${product^^}.";
RES_QUESTIONS="In case you have any questions contact us via http://support.onlyoffice.com or visit our forum at http://dev.onlyoffice.org"
while [ "$1" != "" ]; do
case $1 in
-u | --update )
if [ "$2" != "" ]; then
UPDATE=$2
shift
fi
;;
-ls | --localscripts )
if [ "$2" != "" ]; then
LOCAL_SCRIPTS=$2
shift
fi
;;
-? | -h | --help )
echo " Usage $0 [PARAMETER] [[PARAMETER], ...]"
echo " Parameters:"
echo " -it, --installation_type installation type (COMMUNITY|ENTERPRISE|DEVELOPER)"
echo " -u, --update use to update existing components (true|false)"
echo " -ls, --local_scripts use 'true' to run local scripts (true|false)"
echo " -?, -h, --help this help"
echo
exit 0
;;
esac
shift
done
if [ -z "${UPDATE}" ]; then
UPDATE="false";
fi
if [ -z "${LOCAL_SCRIPTS}" ]; then
LOCAL_SCRIPTS="false";
fi
if [ $(dpkg-query -W -f='${Status}' curl 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
apt-get update;
apt-get install -yq curl;
fi
DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}/develop/build/install/OneClickInstall/install-Debian"
if [ "${LOCAL_SCRIPTS}" == "true" ]; then
source install-Debian/bootstrap.sh
else
source <(curl ${DOWNLOAD_URL_PREFIX}/bootstrap.sh)
fi
# add onlyoffice repo
echo "deb http://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
echo "deb http://static.teamlab.info.s3.amazonaws.com/repo/4testing/debian stable main" | sudo tee /etc/apt/sources.list.d/onlyoffice4testing.list
declare -x LANG="en_US.UTF-8"
declare -x LANGUAGE="en_US:en"
declare -x LC_ALL="en_US.UTF-8"
if [ "${LOCAL_SCRIPTS}" == "true" ]; then
source install-Debian/tools.sh
source install-Debian/check-ports.sh
source install-Debian/install-preq.sh
source install-Debian/install-app.sh
else
source <(curl ${DOWNLOAD_URL_PREFIX}/tools.sh)
source <(curl ${DOWNLOAD_URL_PREFIX}/check-ports.sh)
source <(curl ${DOWNLOAD_URL_PREFIX}/install-preq.sh)
source <(curl ${DOWNLOAD_URL_PREFIX}/install-app.sh)
fi

View File

@ -0,0 +1,23 @@
#!/bin/bash
set -e
cat<<EOF
#######################################
# BOOTSTRAP
#######################################
EOF
if ! dpkg -l | grep -q "sudo"; then
apt-get install -yq sudo
fi
if ! dpkg -l | grep -q "net-tools"; then
apt-get install -yq net-tools
fi
if ! dpkg -l | grep -q "dirmngr"; then
apt-get install -yq dirmngr
fi

View File

@ -0,0 +1,39 @@
#!/bin/bash
set -e
cat<<EOF
#######################################
# CHECK PORTS
#######################################
EOF
if dpkg -l | grep -q "${product}"; then
echo "${product} $RES_APP_INSTALLED"
APPSERVER_INSTALLED="true";
elif [ $UPDATE != "true" ] && netstat -lnp | awk '{print $4}' | grep -qE ":80$|:8081$|:8083$|:5001$|:5002$|:8080$|:80$"; then
echo "${product} $RES_APP_CHECK_PORTS: 80, 8081, 8083, 5001, 5002";
echo "$RES_CHECK_PORTS"
exit
else
APPSERVER_INSTALLED="false";
fi
if dpkg -l | grep -q "${package_sysname}-documentserver"; then
echo "${package_sysname}-documentserver $RES_APP_INSTALLED"
DOCUMENT_SERVER_INSTALLED="true";
elif [ $UPDATE != "true" ] && netstat -lnp | awk '{print $4}' | grep -qE ":8083$|:5432$|:5672$|:6379$|:8000$|:8080$"; then
echo "${package_sysname}-documentserver $RES_APP_CHECK_PORTS: 8083, 5432, 5672, 6379, 8000, 8080";
echo "$RES_CHECK_PORTS"
exit
else
DOCUMENT_SERVER_INSTALLED="false";
fi
if [ "$APPSERVER_INSTALLED" = "true" ] || [ "$DOCUMENT_SERVER_INSTALLED" = "true" ]; then
if [ "$UPDATE" != "true" ]; then
exit;
fi
fi

View File

@ -0,0 +1,144 @@
#!/bin/bash
set -e
cat<<EOF
#######################################
# INSTALL APP
#######################################
EOF
apt-get -y update
if [ "$DOCUMENT_SERVER_INSTALLED" = "false" ]; then
DS_PORT=${DS_PORT:-8083};
DS_DB_HOST=localhost;
DS_DB_NAME=$DS_COMMON_NAME;
DS_DB_USER=$DS_COMMON_NAME;
DS_DB_PWD=$DS_COMMON_NAME;
DS_JWT_ENABLED=${DS_JWT_ENABLED:-true};
DS_JWT_SECRET="$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12)";
DS_JWT_HEADER="AuthorizationJwt";
if ! su - postgres -s /bin/bash -c "psql -lqt" | cut -d \| -f 1 | grep -q ${DS_DB_NAME}; then
su - postgres -s /bin/bash -c "psql -c \"CREATE DATABASE ${DS_DB_NAME};\""
su - postgres -s /bin/bash -c "psql -c \"CREATE USER ${DS_DB_USER} WITH password '${DS_DB_PWD}';\""
su - postgres -s /bin/bash -c "psql -c \"GRANT ALL privileges ON DATABASE ${DS_DB_NAME} TO ${DS_DB_USER};\""
fi
echo ${package_sysname}-documentserver $DS_COMMON_NAME/ds-port select $DS_PORT | sudo debconf-set-selections
echo ${package_sysname}-documentserver $DS_COMMON_NAME/db-pwd select $DS_DB_PWD | sudo debconf-set-selections
echo ${package_sysname}-documentserver $DS_COMMON_NAME/db-user $DS_DB_USER | sudo debconf-set-selections
echo ${package_sysname}-documentserver $DS_COMMON_NAME/db-name $DS_DB_NAME | sudo debconf-set-selections
echo ${package_sysname}-documentserver-de $DS_COMMON_NAME/jwt-enabled select ${DS_JWT_ENABLED} | sudo debconf-set-selections
echo ${package_sysname}-documentserver-de $DS_COMMON_NAME/jwt-secret select ${DS_JWT_SECRET} | sudo debconf-set-selections
echo ${package_sysname}-documentserver-de $DS_COMMON_NAME/jwt-header select ${DS_JWT_HEADER} | sudo debconf-set-selections
echo ${package_sysname}-documentserver-ee $DS_COMMON_NAME/jwt-enabled select ${DS_JWT_ENABLED} | sudo debconf-set-selections
echo ${package_sysname}-documentserver-ee $DS_COMMON_NAME/jwt-secret select ${DS_JWT_SECRET} | sudo debconf-set-selections
echo ${package_sysname}-documentserver-ee $DS_COMMON_NAME/jwt-header select ${DS_JWT_HEADER} | sudo debconf-set-selections
apt-get install -yq ${package_sysname}-documentserver
elif [ "$UPDATE" = "true" ] && [ "$DOCUMENT_SERVER_INSTALLED" = "true" ]; then
apt-get install -y --only-upgrade ${package_sysname}-documentserver
fi
NGINX_ROOT_DIR="/etc/nginx"
NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-$(grep processor /proc/cpuinfo | wc -l)};
NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)};
sed 's/^worker_processes.*/'"worker_processes ${NGINX_WORKER_PROCESSES};"'/' -i ${NGINX_ROOT_DIR}/nginx.conf
sed 's/worker_connections.*/'"worker_connections ${NGINX_WORKER_CONNECTIONS};"'/' -i ${NGINX_ROOT_DIR}/nginx.conf
if ! id "nginx" &>/dev/null; then
systemctl stop nginx
rm -dfr /var/log/nginx/*
rm -dfr /var/cache/nginx/*
useradd -s /bin/false nginx
systemctl start nginx
else
systemctl reload nginx
fi
APPSERVER_INSTALLED_VERSION=$(apt-cache policy ${product} | awk 'NR==2{print $2}')
APPSERVER_LATEST_VERSION=$(apt-cache policy ${product} | awk 'NR==3{print $2}')
if [ "$APPSERVER_INSTALLED_VERSION" != "$APPSERVER_LATEST_VERSION" ]; then
APPSERVER_NEED_UPDATE="true"
fi
if [ "$APPSERVER_INSTALLED" = "false" ]; then
apt-get install -y ${product} || true #Fix error 'Failed to fetch'
apt-get install -y ${product}
elif [ "$APPSERVER_NEED_UPDATE" = "true" ]; then
ENVIRONMENT="$(cat /lib/systemd/system/${product}-api.service | grep -oP 'ENVIRONMENT=\K.*')"
USER_CONNECTIONSTRING=$(json -f /etc/onlyoffice/${product}/appsettings.$ENVIRONMENT.json ConnectionStrings.default.connectionString)
MYSQL_SERVER_HOST=$(echo $USER_CONNECTIONSTRING | grep -oP 'Server=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_DB_NAME=$(echo $USER_CONNECTIONSTRING | grep -oP 'Database=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_USER=$(echo $USER_CONNECTIONSTRING | grep -oP 'User ID=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_PORT=$(echo $USER_CONNECTIONSTRING | grep -oP 'Port=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_PASS=$(echo $USER_CONNECTIONSTRING | grep -oP 'Password=\K.*' | grep -o '^[^;]*')
expect << EOF || true
set timeout -1
log_user 1
spawn apt-get install -y --only-upgrade ${product} elasticsearch=${ELASTIC_VERSION}
expect {
"*** elasticsearch.yml (Y/I/N/O/D/Z)" {
send "\025Y\r"
expect {
"*** jvm.options (Y/I/N/O/D/Z)" {
send "\025Y\r"
}
"/etc/elasticsearch/elasticsearch.yml" {}
}
}
"*** jvm.options (Y/I/N/O/D/Z)" {
send "\025Y\r"
}
}
expect eof
EOF
fi
if [ "${APPSERVER_INSTALLED}" = "false" ] || [ "${APPSERVER_NEED_UPDATE}" = "true" ]; then
expect << EOF
set timeout -1
log_user 1
if { "${UPDATE}" == "true" } {
spawn ${product}-configuration.sh -e ${ENVIRONMENT}
} else {
spawn ${product}-configuration.sh
}
expect -re "Database host:"
send "\025$MYSQL_SERVER_HOST\r"
expect -re "Database name:"
send "\025$MYSQL_SERVER_DB_NAME\r"
expect -re "Database user:"
send "\025$MYSQL_SERVER_USER\r"
expect -re "Database password:"
send "\025$MYSQL_SERVER_PASS\r"
expect eof
EOF
APPSERVER_INSTALLED="true";
fi
echo ""
echo "$RES_INSTALL_SUCCESS"
echo "$RES_QUESTIONS"
echo ""

View File

@ -0,0 +1,192 @@
#!/bin/bash
set -e
cat<<EOF
#######################################
# INSTALL PREREQUISITES
#######################################
EOF
if [ "$DIST" = "debian" ] && [ $(apt-cache search ttf-mscorefonts-installer | wc -l) -eq 0 ]; then
echo "deb http://ftp.uk.debian.org/debian/ $DISTRIB_CODENAME main contrib" >> /etc/apt/sources.list
echo "deb-src http://ftp.uk.debian.org/debian/ $DISTRIB_CODENAME main contrib" >> /etc/apt/sources.list
fi
apt-get -y update
if ! dpkg -l | grep -q "locales"; then
apt-get install -yq locales
fi
if ! dpkg -l | grep -q "dirmngr"; then
apt-get install -yq dirmngr
fi
if ! dpkg -l | grep -q "software-properties-common"; then
apt-get install -yq software-properties-common
fi
if [ $(dpkg-query -W -f='${Status}' curl 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
apt-get install -yq curl;
fi
locale-gen en_US.UTF-8
# add elasticsearch repo
ELASTIC_VERSION="7.13.1"
ELASTIC_DIST=$(echo $ELASTIC_VERSION | awk '{ print int($1) }')
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
echo "deb https://artifacts.elastic.co/packages/${ELASTIC_DIST}.x/apt stable main" | tee /etc/apt/sources.list.d/elastic-${ELASTIC_DIST}.x.list
# add nodejs repo
curl -sL https://deb.nodesource.com/setup_12.x | bash -
#add yarn repo
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
#add dotnet repo
wget https://packages.microsoft.com/config/$DIST/$REV/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
#install kafka
PRODUCT_DIR="/var/www/${product}"
if [ "$(ls -A "$PRODUCT_DIR/services/kafka" 2> /dev/null)" == "" ]; then
mkdir -p ${PRODUCT_DIR}/services/
if ! cat /etc/passwd | grep -q "kafka"; then
adduser --quiet --home ${PRODUCT_DIR}/services/kafka --system kafka
fi
cd ${PRODUCT_DIR}/services/kafka
wget https://downloads.apache.org/kafka/2.7.0/kafka_2.13-2.7.0.tgz
tar xzf kafka_*.tgz --strip 1 && rm -rf kafka_*.tgz
chown -R kafka ${PRODUCT_DIR}/services/kafka
cd -
fi
if [ ! -e /lib/systemd/system/zookeeper.service ]; then
cat > /lib/systemd/system/zookeeper.service <<END
[Unit]
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple
User=kafka
ExecStart=/bin/sh -c '${PRODUCT_DIR}/services/kafka/bin/zookeeper-server-start.sh ${PRODUCT_DIR}/services/kafka/config/zookeeper.properties > ${PRODUCT_DIR}/services/kafka/zookeeper.log 2>&1'
ExecStop=${PRODUCT_DIR}/services/kafka/bin/zookeeper-server-stop.sh
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
END
fi
if [ ! -e /lib/systemd/system/kafka.service ]; then
cat > /lib/systemd/system/kafka.service <<END
[Unit]
Requires=zookeeper.service
After=zookeeper.service
[Service]
Type=simple
User=kafka
ExecStart=/bin/sh -c '${PRODUCT_DIR}/services/kafka/bin/kafka-server-start.sh ${PRODUCT_DIR}/services/kafka/config/server.properties > ${PRODUCT_DIR}/services/kafka/kafka.log 2>&1'
ExecStop=${PRODUCT_DIR}/services/kafka/bin/kafka-server-stop.sh
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
END
fi
if ! dpkg -l | grep -q "mysql-server"; then
MYSQL_SERVER_HOST=${MYSQL_SERVER_HOST:-"localhost"}
MYSQL_SERVER_DB_NAME=${MYSQL_SERVER_DB_NAME:-"${package_sysname}"}
MYSQL_SERVER_USER=${MYSQL_SERVER_USER:-"root"}
MYSQL_SERVER_PASS=${MYSQL_SERVER_PASS:-"$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 12)"}
# setup mysql 8.0 package
curl -OL http://dev.mysql.com/get/mysql-apt-config_0.8.15-1_all.deb
echo "mysql-apt-config mysql-apt-config/repo-codename select $DISTRIB_CODENAME" | debconf-set-selections
echo "mysql-apt-config mysql-apt-config/repo-distro select $DIST" | debconf-set-selections
echo "mysql-apt-config mysql-apt-config/select-server select mysql-8.0" | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg -i mysql-apt-config_0.8.15-1_all.deb
rm -f mysql-apt-config_0.8.15-1_all.deb
echo mysql-community-server mysql-community-server/root-pass password ${MYSQL_SERVER_PASS} | debconf-set-selections
echo mysql-community-server mysql-community-server/re-root-pass password ${MYSQL_SERVER_PASS} | debconf-set-selections
echo mysql-community-server mysql-server/default-auth-override select "Use Strong Password Encryption (RECOMMENDED)" | debconf-set-selections
echo mysql-server-8.0 mysql-server/root_password password ${MYSQL_SERVER_PASS} | debconf-set-selections
echo mysql-server-8.0 mysql-server/root_password_again password ${MYSQL_SERVER_PASS} | debconf-set-selections
apt-get -y update
elif dpkg -l | grep -q "mysql-server"; then
expect << EOF || true
set timeout -1
log_user 1
spawn apt-get install -y --only-upgrade mysql-server mysql-client
expect "*** mysqld.cnf (Y/I/N/O/D/Z)"
send "\025N\r"
expect eof
EOF
fi
# add redis repo
if [ "$DIST" = "ubuntu" ]; then
add-apt-repository -y ppa:chris-lea/redis-server
fi
#add nginx repo
wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key
echo "deb [arch=$ARCH] http://nginx.org/packages/$DIST $DISTRIB_CODENAME nginx" | tee /etc/apt/sources.list.d/nginx.list
rm nginx_signing.key
# setup msttcorefonts
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
# install
apt-get install -yq wget \
expect \
nano \
nodejs \
gcc \
g++ \
make \
yarn \
dotnet-sdk-5.0 \
mysql-server \
mysql-client \
postgresql \
redis-server \
rabbitmq-server \
nginx-extras \
default-jdk
if [ -e /etc/redis/redis.conf ]; then
sed -i "s/bind .*/bind 127.0.0.1/g" /etc/redis/redis.conf
sed -r "/^save\s[0-9]+/d" -i /etc/redis/redis.conf
service redis-server restart
fi
if [ ! -e /usr/bin/json ]; then
npm i json -g >/dev/null 2>&1
fi
if ! dpkg -l | grep -q "elasticsearch"; then
apt-get install -yq elasticsearch=${ELASTIC_VERSION}
fi
# disable apparmor for mysql
if which apparmor_parser && [ ! -f /etc/apparmor.d/disable/usr.sbin.mysqld ] && [ -f /etc/apparmor.d/disable/usr.sbin.mysqld ]; then
ln -sf /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/;
apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld;
fi

View File

@ -0,0 +1,33 @@
#!/bin/bash
set -e
command_exists () {
type "$1" &> /dev/null;
}
ARCH="$(dpkg --print-architecture)"
if [ "$ARCH" != "amd64" ]; then
echo "ONLYOFFICE ${product^^} doesn't support architecture '$ARCH'"
exit;
fi
REV=`cat /etc/debian_version`
DIST='Debian'
if [ -f /etc/lsb-release ] ; then
DIST=`cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }'`
REV=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }'`
DISTRIB_CODENAME=`cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }'`
DISTRIB_RELEASE=`cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }'`
elif [ -f /etc/lsb_release ] || [ -f /usr/bin/lsb_release ] ; then
DIST=`lsb_release -a 2>&1 | grep 'Distributor ID:' | awk -F ":" '{print $2 }' | tr -d '[:space:]'`
REV=`lsb_release -a 2>&1 | grep 'Release:' | awk -F ":" '{print $2 }' | tr -d '[:space:]'`
DISTRIB_CODENAME=`lsb_release -a 2>&1 | grep 'Codename:' | awk -F ":" '{print $2 }' | tr -d '[:space:]'`
DISTRIB_RELEASE=`lsb_release -a 2>&1 | grep 'Release:' | awk -F ":" '{print $2 }' | tr -d '[:space:]'`
elif [ -f /etc/os-release ] ; then
DISTRIB_CODENAME=$(grep "VERSION=" /etc/os-release |awk -F= {' print $2'}|sed s/\"//g |sed s/[0-9]//g | sed s/\)$//g |sed s/\(//g | tr -d '[:space:]')
DISTRIB_RELEASE=$(grep "VERSION_ID=" /etc/os-release |awk -F= {' print $2'}|sed s/\"//g |sed s/[0-9]//g | sed s/\)$//g |sed s/\(//g | tr -d '[:space:]')
fi
DIST=`echo "$DIST" | tr '[:upper:]' '[:lower:]' | xargs`;
DISTRIB_CODENAME=`echo "$DISTRIB_CODENAME" | tr '[:upper:]' '[:lower:]' | xargs`;

View File

@ -34,6 +34,7 @@
PRODUCT="onlyoffice"
BASE_DIR="/app/$PRODUCT";
STATUS=""
SRV_VERSION=""
NETWORK=${PRODUCT}
@ -251,11 +252,18 @@ while [ "$1" != "" ]; do
fi
;;
-ls | --local_scripts )
-ls | --localscripts )
if [ "$2" != "" ]; then
shift
fi
;;
-vas | --versionappserver )
if [ "$2" != "" ]; then
SRV_VERSION=$2
shift
fi
;;
-? | -h | --help )
echo " Usage: bash $HELP_TARGET [PARAMETER] [[PARAMETER], ...]"
@ -265,6 +273,7 @@ while [ "$1" != "" ]; do
echo " -un, --username dockerhub username"
echo " -p, --password dockerhub password"
echo " -ias, --installappserver install or update appserver (true|false)"
echo " -vas, --versionappserver select the version to install appserver (latest|develop|version number)"
echo " -ids, --installdocumentserver install or update document server (true|false)"
echo " -imysql, --installmysql install or update mysql (true|false)"
echo " -mysqlrp, --mysqlrootpassword mysql server root password"
@ -828,6 +837,7 @@ install_appserver () {
reconfigure SERVICE_PORT ${SERVICE_PORT}
reconfigure APP_CORE_MACHINEKEY ${APP_CORE_MACHINEKEY}
reconfigure APP_CORE_BASE_DOMAIN ${APP_CORE_BASE_DOMAIN}
reconfigure SRV_VERSION ${SRV_VERSION}
if [[ -n $EXTERNAL_PORT ]]; then
sed -i "s/8092:8092/${EXTERNAL_PORT}:8092/g" $BASE_DIR/appserver.yml

View File

@ -31,7 +31,7 @@ while [ "$1" != "" ]; do
fi
;;
-ls | --local_scripts )
-ls | --localscripts )
if [ "$2" != "" ]; then
LOCAL_SCRIPTS=$2
shift

View File

@ -54,14 +54,6 @@ if [ "${MYSQL_FIRST_TIME_INSTALL}" = "true" ]; then
systemctl restart mysqld
fi
elif [ "${UPDATE}" = "true" ] && [ "${MYSQL_FIRST_TIME_INSTALL}" != "true" ]; then
ENVIRONMENT="$(cat /etc/systemd/system/${product}-api.service | grep -oP 'ENVIRONMENT=\K.*')"
USER_CONNECTIONSTRING=$(json -f /etc/onlyoffice/${product}/appsettings.$ENVIRONMENT.json ConnectionStrings.default.connectionString)
MYSQL_SERVER_HOST=$(echo $USER_CONNECTIONSTRING | grep -oP 'Server=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_DB_NAME=$(echo $USER_CONNECTIONSTRING | grep -oP 'Database=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_USER=$(echo $USER_CONNECTIONSTRING | grep -oP 'User ID=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_PORT=$(echo $USER_CONNECTIONSTRING | grep -oP 'Port=\K.*' | grep -o '^[^;]*')
MYSQL_ROOT_PASS=$(echo $USER_CONNECTIONSTRING | grep -oP 'Password=\K.*' | grep -o '^[^;]*')
fi
if [ "$DOCUMENT_SERVER_INSTALLED" = "false" ]; then
@ -115,11 +107,6 @@ expect << EOF
expect -re "Password"
send "\025$DS_DB_PWD\r"
if { "${INSTALLATION_TYPE}" == "ENTERPRISE" || "${INSTALLATION_TYPE}" == "DEVELOPER" } {
expect "Configuring redis access..."
send "\025$DS_REDIS_HOST\r"
}
expect "Configuring AMQP access... "
expect -re "Host"
send "\025$DS_RABBITMQ_HOST\r"
@ -152,43 +139,51 @@ if rpm -q "firewalld"; then
systemctl restart firewalld.service
fi
if [ "$APPSERVER_INSTALLED" = "false" ] || [ "$UPDATE" = "true" ]; then
if [ "$APPSERVER_INSTALLED" = "false" ]; then
${package_manager} install -y ${package_sysname}-${product}
else
${package_manager} -y update ${package_sysname}-${product}
fi
{ ${package_manager} check-update ${package_sysname}-${product}; APPSERVER_CHECK_UPDATE=$?; } || true
if [[ $APPSERVER_CHECK_UPDATE -eq $UPDATE_AVAILABLE_CODE ]]; then
APPSERVER_NEED_UPDATE="true"
fi
if [ "${MYSQL_FIRST_TIME_INSTALL}" = "true" ] || [ "$UPDATE" = "true" ]; then
if [ "$APPSERVER_INSTALLED" = "false" ]; then
${package_manager} install -y ${package_sysname}-${product}
elif [ "$APPSERVER_NEED_UPDATE" = "true" ]; then
ENVIRONMENT="$(cat /lib/systemd/system/${product}-api.service | grep -oP 'ENVIRONMENT=\K.*')"
USER_CONNECTIONSTRING=$(json -f /etc/onlyoffice/${product}/appsettings.$ENVIRONMENT.json ConnectionStrings.default.connectionString)
MYSQL_SERVER_HOST=$(echo $USER_CONNECTIONSTRING | grep -oP 'Server=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_DB_NAME=$(echo $USER_CONNECTIONSTRING | grep -oP 'Database=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_USER=$(echo $USER_CONNECTIONSTRING | grep -oP 'User ID=\K.*' | grep -o '^[^;]*')
MYSQL_SERVER_PORT=$(echo $USER_CONNECTIONSTRING | grep -oP 'Port=\K.*' | grep -o '^[^;]*')
MYSQL_ROOT_PASS=$(echo $USER_CONNECTIONSTRING | grep -oP 'Password=\K.*' | grep -o '^[^;]*')
${package_manager} -y update ${package_sysname}-${product}
fi
if [ "${APPSERVER_INSTALLED}" = "false" ] || [ "$APPSERVER_NEED_UPDATE" = "true" ]; then
expect << EOF
set timeout -1
log_user 1
set timeout -1
log_user 1
if { "${UPDATE}" == "true" } {
spawn ${product}-configuration.sh -e ${ENVIRONMENT}
} else {
spawn ${product}-configuration.sh
}
if { "${UPDATE}" == "true" } {
spawn ${product}-configuration.sh -e ${ENVIRONMENT}
} else {
spawn ${product}-configuration.sh
}
expect -re "Database host:"
send "\025$MYSQL_SERVER_HOST\r"
expect -re "Database host:"
send "\025$MYSQL_SERVER_HOST\r"
expect -re "Database name:"
send "\025$MYSQL_SERVER_DB_NAME\r"
expect -re "Database name:"
send "\025$MYSQL_SERVER_DB_NAME\r"
expect -re "Database user:"
send "\025$MYSQL_SERVER_USER\r"
expect -re "Database user:"
send "\025$MYSQL_SERVER_USER\r"
expect -re "Database password:"
send "\025$MYSQL_ROOT_PASS\r"
expect -re "Database password:"
send "\025$MYSQL_ROOT_PASS\r"
expect eof
expect eof
EOF
APPSERVER_INSTALLED="true";
else
bash ${product}-configuration.sh
APPSERVER_INSTALLED="true";
fi
APPSERVER_INSTALLED="true";
fi
echo ""

View File

@ -79,11 +79,13 @@ if ! rpm -q mysql-community-server; then
fi
#add elasticsearch repo
ELASTIC_VERSION="7.13.1"
ELASTIC_DIST=$(echo $ELASTIC_VERSION | awk '{ print int($1) }')
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
cat > /etc/yum.repos.d/elasticsearch.repo <<END
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
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
@ -93,15 +95,18 @@ END
#install kafka
PRODUCT_DIR="/var/www/${product}"
mkdir -p ${PRODUCT_DIR}/services/
getent passwd kafka >/dev/null || useradd -m -d ${PRODUCT_DIR}/services/kafka -s /sbin/nologin -p kafka kafka
cd ${PRODUCT_DIR}/services/kafka
wget https://downloads.apache.org/kafka/2.7.0/kafka_2.13-2.7.0.tgz
tar xzf kafka_*.tgz --strip 1 && rm -rf kafka_*.tgz
chown -R kafka ${PRODUCT_DIR}/services/kafka
cd -
if [ "$(ls -A "$PRODUCT_DIR/services/kafka" 2> /dev/null)" == "" ]; then
mkdir -p ${PRODUCT_DIR}/services/
getent passwd kafka >/dev/null || useradd -m -d ${PRODUCT_DIR}/services/kafka -s /sbin/nologin -p kafka kafka
cd ${PRODUCT_DIR}/services/kafka
wget https://downloads.apache.org/kafka/2.7.0/kafka_2.13-2.7.0.tgz
tar xzf kafka_*.tgz --strip 1 && rm -rf kafka_*.tgz
chown -R kafka ${PRODUCT_DIR}/services/kafka
cd -
fi
cat > /etc/systemd/system/zookeeper.service <<END
if [ ! -e /lib/systemd/system/zookeeper.service ]; then
cat > /lib/systemd/system/zookeeper.service <<END
[Unit]
Requires=network.target remote-fs.target
After=network.target remote-fs.target
@ -114,8 +119,10 @@ Restart=on-abnormal
[Install]
WantedBy=multi-user.target
END
fi
cat > /etc/systemd/system/kafka.service <<END
if [ ! -e /lib/systemd/system/kafka.service ]; then
cat > /lib/systemd/system/kafka.service <<END
[Unit]
Requires=zookeeper.service
After=zookeeper.service
@ -128,6 +135,7 @@ Restart=on-abnormal
[Install]
WantedBy=multi-user.target
END
fi
# add nginx repo
cat > /etc/yum.repos.d/nginx.repo <<END
@ -169,14 +177,15 @@ ${package_manager} -y install epel-release \
make \
yarn \
dotnet-sdk-5.0 \
elasticsearch-7.13.1 --enablerepo=elasticsearch \
elasticsearch-${ELASTIC_VERSION} --enablerepo=elasticsearch \
mysql-server \
nginx \
supervisor \
postgresql \
postgresql-server \
rabbitmq-server$rabbitmq_version \
redis --enablerepo=remi
redis --enablerepo=remi \
java
postgresql-setup initdb || true

View File

@ -1,11 +1,15 @@
#!/bin/bash
set -e
PRODUCT="appserver"
ENVIRONMENT="production"
APP_DIR="/etc/onlyoffice/${PRODUCT}"
USER_CONF="$APP_DIR/appsettings.$ENVIRONMENT.json"
NGINX_CONF="/etc/nginx/conf.d"
SYSTEMD_DIR="/etc/systemd/system"
NGINX_DIR="/etc/nginx"
NGINX_CONF="${NGINX_DIR}/conf.d"
SYSTEMD_DIR="/lib/systemd/system"
MYSQL=""
DB_HOST=""
@ -167,7 +171,7 @@ install_json() {
set_core_machinekey
$JSON_USERCONF "this.core={'base-domain': \"$APP_HOST\", 'machinekey': \"$CORE_MACHINEKEY\" }" \
-e "this.urlshortener={ 'path': '../ASC.UrlShortener/index.js' }" -e "this.thumb={ 'path': '../ASC.Thumbnails/' }" \
-e "this.socket={ 'path': '../ASC.Socket.IO/' }" >/dev/null 2>&1
-e "this.socket={ 'path': '../ASC.Socket.IO/' }" -e "this.ssoauth={ 'path': '../ASC.SsoAuth/' }" >/dev/null 2>&1
$JSON $APP_DIR/appsettings.json -e "this.core.products.subfolder='server'" >/dev/null 2>&1
$JSON $APP_DIR/appsettings.services.json -e "this.core={ 'products': { 'folder': '../../products', 'subfolder': 'server'} }" >/dev/null 2>&1
@ -177,21 +181,18 @@ install_json() {
restart_services() {
echo -n "Restarting services... "
sed -i "s/Type=.*/Type=simple/" $SYSTEMD_DIR/${PRODUCT}-calendar.service >/dev/null 2>&1 #Fix non-start of service
sed -i "s/ENVIRONMENT=.*/ENVIRONMENT=$ENVIRONMENT/" $SYSTEMD_DIR/${PRODUCT}*.service >/dev/null 2>&1
systemctl daemon-reload
for SVC in nginx mysqld ${PRODUCT}-api ${PRODUCT}-api-system ${PRODUCT}-urlshortener ${PRODUCT}-thumbnails \
for SVC in nginx ${MYSQL_PACKAGE} ${PRODUCT}-api ${PRODUCT}-api-system ${PRODUCT}-urlshortener ${PRODUCT}-thumbnails \
${PRODUCT}-socket ${PRODUCT}-studio-notify ${PRODUCT}-notify ${PRODUCT}-people-server ${PRODUCT}-files \
${PRODUCT}-files-services ${PRODUCT}-studio ${PRODUCT}-backup ${PRODUCT}-storage-encryption \
${PRODUCT}-storage-migration ${PRODUCT}-projects-server ${PRODUCT}-telegram-service ${PRODUCT}-crm \
${PRODUCT}-calendar ${PRODUCT}-mail elasticsearch kafka zookeeper
do
if systemctl is-active $SVC | grep -q "active"; then
systemctl restart $SVC.service >/dev/null 2>&1
else
systemctl enable $SVC.service >/dev/null 2>&1
systemctl start $SVC.service >/dev/null 2>&1
fi
systemctl enable $SVC.service >/dev/null 2>&1
systemctl restart $SVC.service
done
echo "OK"
}
@ -235,7 +236,7 @@ establish_mysql_conn(){
$MYSQL -e ";" >/dev/null 2>&1
ERRCODE=$?
if [ $ERRCODE -ne 0 ]; then
systemctl mysqld start >/dev/null 2>&1
systemctl ${MYSQL_PACKAGE} start >/dev/null 2>&1
$MYSQL -e ";" >/dev/null 2>&1 || { echo "FAILURE"; exit 1; }
fi
@ -246,35 +247,45 @@ establish_mysql_conn(){
echo "OK"
}
mysql_check_connection() {
while ! $MYSQL -e ";" >/dev/null 2>&1; do
sleep 1
done
}
change_mysql_config(){
local CNF_PATH="/etc/my.cnf";
local CNF_SERVICE_PATH="/usr/lib/systemd/system/mysqld.service";
if ! grep -q "\[mysqld\]" ${CNF_PATH}; then
CNF_PATH="/etc/my.cnf.d/server.cnf";
if [ "$DIST" = "RedHat" ]; then
local CNF_PATH="/etc/my.cnf";
local CNF_SERVICE_PATH="/usr/lib/systemd/system/mysqld.service";
if ! grep -q "\[mysqld\]" ${CNF_PATH}; then
exit 1;
fi
fi
CNF_PATH="/etc/my.cnf.d/server.cnf";
if ! grep -q "\[Unit\]" ${CNF_SERVICE_PATH}; then
CNF_SERVICE_PATH="/lib/systemd/system/mysqld.service";
if ! grep -q "\[Unit\]" ${CNF_SERVICE_PATH}; then
CNF_SERVICE_PATH="/lib/systemd/system/mariadb.service";
if ! grep -q "\[Unit\]" ${CNF_SERVICE_PATH}; then
if ! grep -q "\[mysqld\]" ${CNF_PATH}; then
exit 1;
fi
fi
if ! grep -q "\[Unit\]" ${CNF_SERVICE_PATH}; then
CNF_SERVICE_PATH="/lib/systemd/system/mysqld.service";
if ! grep -q "\[Unit\]" ${CNF_SERVICE_PATH}; then
CNF_SERVICE_PATH="/lib/systemd/system/mariadb.service";
if ! grep -q "\[Unit\]" ${CNF_SERVICE_PATH}; then
exit 1;
fi
fi
fi
elif [ "$DIST" = "Debian" ]; then
sed "s/#max_connections.*/max_connections = 1000/" -i /etc/mysql/my.cnf || true # ignore errors
CNF_PATH="/etc/mysql/mysql.conf.d/mysqld.cnf";
CNF_SERVICE_PATH="/lib/systemd/system/mysql.service";
if mysql -V | grep -q "MariaDB"; then
CNF_PATH="/etc/mysql/mariadb.conf.d/50-server.cnf";
CNF_SERVICE_PATH="/lib/systemd/system/mariadb.service";
fi
fi
fi
sed '/skip-networking/d' -i ${CNF_PATH} || true # ignore errors
@ -319,28 +330,34 @@ change_mysql_config(){
else
sed "s/default-authentication-plugin.*/default-authentication-plugin = mysql_native_password/" -i ${CNF_PATH} || true # ignore errors
fi
if ! grep -q "^LimitNOFILE" ${CNF_SERVICE_PATH}; then
sed '/\[Service\]/a LimitNOFILE = infinity' -i ${CNF_SERVICE_PATH}
else
sed "s/LimitNOFILE.*/LimitNOFILE = infinity/" -i ${CNF_SERVICE_PATH} || true # ignore errors
fi
if ! grep -q "^LimitMEMLOCK" ${CNF_SERVICE_PATH}; then
sed '/\[Service\]/a LimitMEMLOCK = infinity' -i ${CNF_SERVICE_PATH}
else
sed "s/LimitMEMLOCK.*/LimitMEMLOCK = infinity/" -i ${CNF_SERVICE_PATH} || true # ignore errors
if [ -e ${CNF_SERVICE_PATH} ]; then
if ! grep -q "^LimitNOFILE" ${CNF_SERVICE_PATH}; then
sed '/\[Service\]/a LimitNOFILE = infinity' -i ${CNF_SERVICE_PATH}
else
sed "s/LimitNOFILE.*/LimitNOFILE = infinity/" -i ${CNF_SERVICE_PATH} || true # ignore errors
fi
if ! grep -q "^LimitMEMLOCK" ${CNF_SERVICE_PATH}; then
sed '/\[Service\]/a LimitMEMLOCK = infinity' -i ${CNF_SERVICE_PATH}
else
sed "s/LimitMEMLOCK.*/LimitMEMLOCK = infinity/" -i ${CNF_SERVICE_PATH} || true # ignore errors
fi
fi
systemctl daemon-reload >/dev/null 2>&1
systemctl restart mysqld >/dev/null 2>&1
systemctl restart ${MYSQL_PACKAGE} >/dev/null 2>&1
}
execute_mysql_script(){
change_mysql_config
mysql_check_connection
while ! $MYSQL -e ";" >/dev/null 2>&1; do
sleep 1
done
if [ "$DB_USER" = "root" ] && [ ! "$(mysql -V | grep ' 5.5.')" ]; then
# allow connect via mysql_native_password with root and empty password
@ -356,7 +373,7 @@ execute_mysql_script(){
echo -n "Installing MYSQL database... "
#Adding data to the db
sed -i -e '1 s/^/SET SQL_MODE='ALLOW_INVALID_DATES';\n/;' $SQL_DIR/onlyoffice.sql
sed -i -e '1 s/^/SET SQL_MODE='ALLOW_INVALID_DATES';\n/;' $SQL_DIR/onlyoffice.sql #Fix a bug related to an incorrect date
$MYSQL -e "CREATE DATABASE IF NOT EXISTS $DB_NAME CHARACTER SET utf8 COLLATE 'utf8_general_ci';" >/dev/null 2>&1
echo 'CREATE TABLE IF NOT EXISTS `Tenants` ( `id` varchar(200) NOT NULL, `Status` varchar(200) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;' >> $SQL_DIR/onlyoffice.sql #Fix non-existent tables Tenants
$MYSQL "$DB_NAME" < "$SQL_DIR/createdb.sql" >/dev/null 2>&1
@ -377,35 +394,44 @@ execute_mysql_script(){
setup_nginx(){
echo -n "Configuring nginx... "
mv -f $NGINX_CONF/default.conf $NGINX_CONF/default.conf.old >/dev/null 2>&1
# Remove default nginx website
rm -f $NGINX_CONF/default.conf >/dev/null 2>&1 || rm -f $NGINX_DIR/sites-enabled/default >/dev/null 2>&1
sed -i "s/listen.*;/listen $APP_PORT;/" $NGINX_CONF/onlyoffice.conf
shopt -s nocasematch
PORTS=()
if $(getenforce) >/dev/null 2>&1; then
case $(getenforce) in
enforcing|permissive)
PORTS+=('8081') #Storybook
PORTS+=("$DOCUMENT_SERVER_PORT")
PORTS+=('5001') #ASC.Web.Studio
PORTS+=('5002') #ASC.People
PORTS+=('5008') #ASC.Files/client
PORTS+=('5013') #ASC.Files/editor
PORTS+=('5014') #ASC.CRM
setsebool -P httpd_can_network_connect on
;;
disabled)
:
;;
esac
if [ "$DIST" = "RedHat" ]; then
# Remove default nginx settings
DELETION_LINE=$(sed -n '/server {/=' /etc/nginx/nginx.conf | head -n 1)
if [ -n "$DELETION_LINE" ]; then
sed "$DELETION_LINE,\$d" -i /etc/nginx/nginx.conf
echo "}" >> /etc/nginx/nginx.conf
fi
for PORT in ${PORTS[@]}; do
semanage port -a -t http_port_t -p tcp $PORT >/dev/null 2>&1 || \
semanage port -m -t http_port_t -p tcp $PORT >/dev/null 2>&1 || \
true
done
shopt -s nocasematch
PORTS=()
if $(getenforce) >/dev/null 2>&1; then
case $(getenforce) in
enforcing|permissive)
PORTS+=('8081') #Storybook
PORTS+=("$DOCUMENT_SERVER_PORT")
PORTS+=('5001') #ASC.Web.Studio
PORTS+=('5002') #ASC.People
PORTS+=('5008') #ASC.Files/client
PORTS+=('5013') #ASC.Files/editor
PORTS+=('5014') #ASC.CRM
setsebool -P httpd_can_network_connect on
;;
disabled)
:
;;
esac
for PORT in ${PORTS[@]}; do
semanage port -a -t http_port_t -p tcp $PORT >/dev/null 2>&1 || \
semanage port -m -t http_port_t -p tcp $PORT >/dev/null 2>&1 || \
true
done
fi
fi
chown nginx:nginx /etc/nginx/* -R
sudo sed -e 's/#//' -i $NGINX_CONF/onlyoffice.conf
@ -427,8 +453,8 @@ setup_docs() {
$JSON_DSCONF "this.services.CoAuthoring.token.enable.request.inbox='true'" >/dev/null 2>&1
$JSON_DSCONF "this.services.CoAuthoring.token.enable.request.outbox='true'" >/dev/null 2>&1
local DOCUMENT_SERVER_JWT_SECRET=$(cat ${DS_CONF} | json services.CoAuthoring.secret.inbox.string)
local DOCUMENT_SERVER_JWT_HEADER=$(cat ${DS_CONF} | json services.CoAuthoring.token.inbox.header)
local DOCUMENT_SERVER_JWT_SECRET=$(json -f ${DS_CONF} services.CoAuthoring.secret.inbox.string)
local DOCUMENT_SERVER_JWT_HEADER=$(json -f ${DS_CONF} services.CoAuthoring.token.inbox.header)
#Save Docs address and JWT in .json
$JSON_USERCONF "this.files={'docservice': {\
@ -436,14 +462,16 @@ setup_docs() {
'url': {'public': '/ds-vpath/','internal': \"http://${DOCUMENT_SERVER_HOST}:${DOCUMENT_SERVER_PORT}\",'portal': \"http://$APP_HOST:$APP_PORT\"}}}" >/dev/null 2>&1
#Enable ds-example autostart
sudo sed 's,autostart=false,autostart=true,' -i /etc/supervisord.d/ds-example.ini
sudo supervisorctl start ds:example >/dev/null 2>&1
sed 's,autostart=false,autostart=true,' -i /etc/supervisord.d/ds-example.ini >/dev/null 2>&1 || sed 's,autostart=false,autostart=true,' -i /etc/supervisor/conf.d/ds-example.conf >/dev/null 2>&1
supervisorctl start ds:example >/dev/null 2>&1
echo "OK"
}
change_elasticsearch_config(){
local ELASTIC_SEARCH_VERSION=$(rpm -qi elasticsearch | grep Version | tail -n1 | awk -F': ' '/Version/ {print $2}');
systemctl stop elasticsearch
local ELASTIC_SEARCH_CONF_PATH="/etc/elasticsearch/elasticsearch.yml"
local ELASTIC_SEARCH_JAVA_CONF_PATH="/etc/elasticsearch/jvm.options";
@ -496,6 +524,8 @@ change_elasticsearch_config(){
if [ -d /etc/elasticsearch/ ]; then
chmod g+ws /etc/elasticsearch/
fi
systemctl start elasticsearch
}
setup_elasticsearch() {
@ -511,13 +541,13 @@ setup_elasticsearch() {
setup_kafka() {
local KAFKA_SERVICE=$(systemctl --type=service | grep 'kafka' | tr -d '●' | awk '{print $1;}')
KAFKA_SERVICE=$(systemctl list-units --no-legend "*kafka*" | cut -f1 -d' ')
if [ -n ${KAFKA_SERVICE} ]; then
echo -n "Configuring kafka... "
local KAFKA_DIR="$(cat $SYSTEMD_DIR/$KAFKA_SERVICE | grep ExecStop= | cut -c 10- | rev | cut -c 26- | rev)"
local KAFKA_DIR="$(grep -oP '(?<=ExecStop=).*(?=/bin)' $SYSTEMD_DIR/$KAFKA_SERVICE)"
local KAFKA_CONF="${KAFKA_DIR}/config"
#Change kafka config
@ -531,40 +561,43 @@ setup_kafka() {
#Save kafka parameters in .json
$JSON_USERCONF "this.kafka={'BootstrapServers': \"${KAFKA_HOST}:${KAFKA_PORT}\"}" >/dev/null 2>&1
#Add topics for kafka
KAFKA_TOPICS=( ascchannelQuotaCacheItemAny
ascchannelTariffCacheItemRemove
ascchannelTenantCacheItemInsertOrUpdate
ascchannelTenantSettingRemove )
for i in "${KAFKA_TOPICS[@]}"
do
${KAFKA_DIR}/bin/kafka-topics.sh --create --zookeeper ${ZOOKEEPER_HOST}:${ZOOKEEPER_PORT} --topic $i --replication-factor 1 --partitions 3 >/dev/null 2>&1
done
echo "OK"
fi
}
if command -v yum >/dev/null 2>&1; then
DIST="RedHat"
PACKAGE_MANAGER="rpm -q"
MYSQL_PACKAGE="mysqld"
elif command -v apt >/dev/null 2>&1; then
DIST="Debian"
PACKAGE_MANAGER="dpkg -l"
MYSQL_PACKAGE="mysql"
mkdir -p /var/log/onlyoffice/appserver/ /etc/onlyoffice/appserver/.private/
chown -R onlyoffice:onlyoffice /var/www/appserver/ /var/log/onlyoffice/appserver/ /etc/onlyoffice/appserver/
chown -R kafka /var/www/appserver/services/kafka/
systemctl restart kafka zookeeper
fi
install_json
if rpm -q mysql-community-client >/dev/null; then
if $PACKAGE_MANAGER mysql-client >/dev/null 2>&1 || $PACKAGE_MANAGER mysql-community-client >/dev/null 2>&1; then
input_db_params
establish_mysql_conn || exit $?
execute_mysql_script || exit $?
fi
if rpm -q nginx >/dev/null; then
if $PACKAGE_MANAGER nginx >/dev/null 2>&1; then
setup_nginx
fi
if rpm -q onlyoffice-documentserver >/dev/null || rpm -q onlyoffice-documentserver-de >/dev/null || rpm -q onlyoffice-documentserver-ee >/dev/null; then
if $PACKAGE_MANAGER onlyoffice-documentserver >/dev/null 2>&1 || $PACKAGE_MANAGER onlyoffice-documentserver-de >/dev/null 2>&1 || $PACKAGE_MANAGER onlyoffice-documentserver-ee >/dev/null 2>&1; then
setup_docs
fi
if rpm -q elasticsearch >/dev/null; then
if $PACKAGE_MANAGER elasticsearch >/dev/null 2>&1; then
setup_elasticsearch
fi

View File

@ -60,6 +60,7 @@ SERVICE_NAME=(
crm
calendar
mail
ssoauth
)
reassign_values (){
@ -163,6 +164,11 @@ reassign_values (){
WORK_DIR="${BASE_DIR}/products/ASC.Mail/server/"
EXEC_FILE="ASC.Mail.dll"
;;
ssoauth )
SERVICE_PORT="9833"
WORK_DIR="${BASE_DIR}/services/ASC.SsoAuth.Svc/"
EXEC_FILE="ASC.SsoAuth.Svc.dll"
;;
esac
SERVICE_NAME="$1"
EXEC_START="${DOTNET_RUN} ${WORK_DIR}${EXEC_FILE} --urls=${APP_URLS}:${SERVICE_PORT} --pathToConf=${PATH_TO_CONF} \

View File

@ -0,0 +1 @@
src/var/www/services/ASC.ApiSystem/service/* var/www/appserver/services/ASC.ApiSystem

View File

@ -0,0 +1 @@
src/var/www/services/ASC.Web.Api/service/* var/www/appserver/studio/api

View File

@ -0,0 +1 @@
src/var/www/services/ASC.Data.Backup/service/* var/www/appserver/services/ASC.Data.Backup

View File

@ -0,0 +1 @@
src/var/www/products/ASC.Calendar/server var/www/appserver/products/ASC.Calendar

View File

@ -0,0 +1,3 @@
../../../config/*.json etc/onlyoffice/appserver
../../../config/*.config etc/onlyoffice/appserver
../docker/config/*.sql var/www/appserver/sql

View File

@ -0,0 +1,20 @@
#!/bin/bash
#
# see: dh_installdeb(1)
set -e
if ! cat /etc/passwd | grep -q "onlyoffice:"; then
adduser --quiet --home /var/www/appserver --system --group onlyoffice
fi
if ! cat /etc/group | grep -q "nginx:"; then
addgroup --quiet --system nginx
fi
if ! cat /etc/passwd | grep -q "nginx:"; then
adduser --quiet --system nginx
usermod -aG nginx nginx
fi
usermod -aG onlyoffice,nginx onlyoffice

View File

@ -0,0 +1 @@
../common/appserver-configuration.sh usr/bin

View File

@ -0,0 +1 @@
src/var/www/products/ASC.CRM/server var/www/appserver/products/ASC.CRM

View File

@ -0,0 +1 @@
src/var/www/services/ASC.Files.Service/service var/www/appserver/products/ASC.Files

View File

@ -0,0 +1,2 @@
src/var/www/products/ASC.Files/server var/www/appserver/products/ASC.Files
../../../products/ASC.Files/Server/DocStore var/www/appserver/products/ASC.Files/server

View File

@ -0,0 +1 @@
src/var/www/products/ASC.Mail/server var/www/appserver/products/ASC.Mail

View File

@ -0,0 +1 @@
src/var/www/services/ASC.Notify/service/* var/www/appserver/services/ASC.Notify

View File

@ -0,0 +1 @@
src/var/www/products/ASC.People/server var/www/appserver/products/ASC.People

View File

@ -0,0 +1 @@
src/var/www/products/ASC.Projects/server var/www/appserver/products/ASC.Projects

View File

@ -0,0 +1,17 @@
## COPY PUBLIC ##
../../../config/nginx/onlyoffice*.conf etc/nginx/conf.d
../../../config/nginx/includes/onlyoffice*.conf etc/nginx/includes
../../../public/* var/www/appserver/public
../../../public/images/* var/www/appserver/public/images
../../../public/offline/* var/www/appserver/public/offline
../../../public/thirdparty/* var/www/appserver/public/thirdparty
../../../products/ASC.Calendar/Client/dist/* var/www/appserver/products/ASC.Calendar/client
../../../products/ASC.CRM/Client/dist/* var/www/appserver/products/ASC.CRM/client
../../../products/ASC.Projects/Client/dist/* var/www/appserver/products/ASC.Projects/client
../../../products/ASC.Calendar/Client/dist/* var/www/appserver/products/ASC.Calendar/client
../../../products/ASC.People/Client/dist/* var/www/appserver/products/ASC.People/client
../../../products/ASC.Mail/Client/dist/* var/www/appserver/products/ASC.Mail/client
../../../products/ASC.Files/Client/dist/* var/www/appserver/products/ASC.Files/client
../../../web/ASC.Web.Editor/dist/* var/www/appserver/products/ASC.Files/editor
../../../web/ASC.Web.Client/dist/* var/www/appserver/studio/client
../../../web/ASC.Web.Login/dist/* var/www/appserver/studio/login

View File

@ -0,0 +1,2 @@
src/var/www/services/ASC.Socket.IO/service/* var/www/appserver/services/ASC.Socket.IO
src/var/www/services/ASC.Socket.IO.Svc/service/* var/www/appserver/services/ASC.Socket.IO.Svc

View File

@ -0,0 +1,2 @@
src/var/www/services/ASC.SsoAuth/service/* var/www/appserver/services/ASC.SsoAuth
src/var/www/services/ASC.SsoAuth.Svc/service/* var/www/appserver/services/ASC.SsoAuth.Svc

View File

@ -0,0 +1 @@
src/var/www/services/ASC.Data.Storage.Encryption/service/* var/www/appserver/services/ASC.Data.Storage.Encryption

View File

@ -0,0 +1 @@
src/var/www/services/ASC.Data.Storage.Migration/service/* var/www/appserver/services/ASC.Data.Storage.Migration

View File

@ -0,0 +1 @@
src/var/www/services/ASC.Studio.Notify/service/* var/www/appserver/services/ASC.Studio.Notify

View File

@ -0,0 +1 @@
src/var/www/services/ASC.Web.Studio/service/* var/www/appserver/studio/server

View File

@ -0,0 +1 @@
src/var/www/services/ASC.TelegramService/service/* var/www/appserver/services/ASC.TelegramService

View File

@ -0,0 +1,2 @@
src/var/www/services/ASC.Thumbnails.Svc/service/* var/www/appserver/services/ASC.Thumbnails.Svc
src/var/www/services/ASC.Thumbnails/service/* var/www/appserver/services/ASC.Thumbnails

View File

@ -0,0 +1,2 @@
src/var/www/services/ASC.UrlShortener/service/* var/www/appserver/services/ASC.UrlShortener
src/var/www/services/ASC.UrlShortener.Svc/service/* var/www/appserver/services/ASC.UrlShortener.Svc

View File

@ -0,0 +1,5 @@
appserver (0.1-10) unstable; urgency=medium
* Initial Release.
-- Ascensio System SIA <support@onlyoffice.com> Fri, 19 Mar 2021 18:39:30 +0300

View File

@ -0,0 +1 @@
9

3
build/install/deb/debian/configure vendored Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh -e
set -e

View File

@ -0,0 +1,232 @@
Source: appserver
Section: web
Priority: optional
Maintainer: onlyoffice
Build-Depends: debhelper (>= 10), nodejs (>=10), dotnet-sdk-5.0, yarn
Standards-Version: 0.1-10
Homepage: https://www.onlyoffice.com/
Architecture: any
Package: appserver
Architecture: any
Depends: appserver-api-system,
appserver-backup,
appserver-calendar,
appserver-crm,
appserver-storage-encryption,
appserver-files,
appserver-files-services,
appserver-mail,
appserver-storage-migration,
appserver-notify,
appserver-people-server,
appserver-projects-server,
appserver-socket,
appserver-ssoauth,
appserver-studio-notify,
appserver-telegram-service,
appserver-thumbnails,
appserver-urlshortener,
appserver-api,
appserver-studio,
appserver-proxy
Description: Description
Package: appserver-common
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: Description
Package: appserver-configuration
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: Description
Package: appserver-api-system
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-backup
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-calendar
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-crm
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-storage-encryption
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-files
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-files-services
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-mail
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-storage-migration
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-notify
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-people-server
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-projects-server
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-socket
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
nodejs (>=10),
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-studio-notify
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-telegram-service
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-thumbnails
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
nodejs (>=10),
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-urlshortener
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
nodejs (>=10),
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-api
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-studio
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
${misc:Depends},
${shlibs:Depends}
Description: Description
Package: appserver-proxy
Architecture: any
Depends: nginx, ${misc:Depends}, ${shlibs:Depends}
Description: Description
Package: appserver-ssoauth
Architecture: any
Depends: appserver-common,
appserver-configuration,
dotnet-sdk-5.0,
nodejs (>=10),
${misc:Depends},
${shlibs:Depends}
Description: Description

View File

@ -0,0 +1,34 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ONLYOFFICE-AppServer
Source: http://onlyoffice.com
Files: *
Copyright: (c) Copyright Ascensio System SIA, 2021 support@onlyoffice.com
License: AGPLv3
This program is a free software product. You can redistribute it and/or
modify it under the terms of the GNU Affero General Public License (AGPL)
version 3 as published by the Free Software Foundation. In accordance with
Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
that Ascensio System SIA expressly excludes the warranty of non-infringement
of any third-party rights.
This program is distributed WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
EU, LV-1021.
The interactive user interfaces in modified source and object code versions
of the Program must display Appropriate Legal Notices, as required under
Section 5 of the GNU AGPL version 3.
Pursuant to Section 7(b) of the License you must retain the original Product
logo when distributing the program. Pursuant to Section 7(e) we decline to
grant you any rights under trademark law for use of our trademarks.
All the Product's GUI elements, including illustrations and icon sets, as
well as technical writing content are licensed under the terms of the
Creative Commons Attribution-ShareAlike 4.0 International. See the License
terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode

48
build/install/deb/debian/rules Executable file
View File

@ -0,0 +1,48 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
export DH_OPTIONS=-v
%:
dh $@ --with=systemd
PRODUCT=appserver
CURRENT_PATH=${CURDIR}
BUILD_PATH=var/www
SRC_PATH=$(shell cd ../../../; pwd)
SCRIPT_PATH=build/install/common
override_dh_auto_clean:
@echo "RULES.$@"
dh_testdir
rm -rf ${CURRENT_PATH}/src
rm -rf ${CURRENT_PATH}/debian/*.service
rm -rf ${SRC_PATH}/build/install/${PRODUCT}*
override_dh_auto_configure:
@echo "RULES.$@"
dh_testdir
dh_auto_configure
override_dh_auto_build:
mkdir -p ${CURRENT_PATH}/src/${BUILD_PATH}
cd ${SRC_PATH}/${SCRIPT_PATH}/systemd; \
bash build.sh -bp "${CURRENT_PATH}/debian/"; \
cd ${SRC_PATH}/${SCRIPT_PATH}; \
bash build-frontend.sh -sp ${SRC_PATH}; \
bash build-backend.sh -sp ${SRC_PATH}; \
bash publish-backend.sh -sp ${SRC_PATH} -bp ${CURRENT_PATH}/src/${BUILD_PATH}
sed -i "s@var/www@var/www/${PRODUCT}@g" ${SRC_PATH}/config/nginx/*.conf
sed -i "s@var/www@var/www/${PRODUCT}@g" ${SRC_PATH}/config/nginx/includes/*.conf
override_dh_auto_install:
dh_installinit
override_dh_strip:
# dh_strip --exclude=/site-packages/
override_dh_shlibdeps:
# dh_shlibdeps --exclude=/site-packages/

View File

@ -0,0 +1,39 @@
Template: appserver/db-host
Type: string
Default: localhost
Description: MySQL host:
Template: appserver/db-user
Type: string
Default: root
Description: MySQL user:
Template: appserver/db-pwd
Type: password
Description: MySQL password:
Template: appserver/db-name
Type: string
Default: onlyoffice
Description: MySQL database name:
Template: appserver/remove-db
Type: boolean
Default: false
Description: Remove database?
This operation will remove the database which contain all data. It is recommended to take backup before removing the database.
Template: appserver/ds-jwt-enabled
Type: boolean
Default: false
Description: To enabled Document Server JWT?:
Template: appserver/ds-jwt-secret
Type: string
Default: {{package_sysname}}
Description: Document Server JWT Secret:
Template: appserver/ds-jwt-secret-header
Type: string
Default: AuthorizationJwt
Description: Document Server Secret Header:

View File

@ -32,6 +32,7 @@ Requires: %name-notify
Requires: %name-people-server
Requires: %name-projects-server
Requires: %name-socket
Requires: %name-ssoauth
Requires: %name-studio-notify
Requires: %name-telegram-service
Requires: %name-thumbnails

View File

@ -4,6 +4,6 @@ bash build/install/common/systemd/build.sh
bash build/install/common/build-frontend.sh --srcpath %{_builddir}/%{sourcename}
bash build/install/common/build-backend.sh --srcpath %{_builddir}/%{sourcename}
bash build/install/common/publish-backend.sh --srcpath %{_builddir}/%{sourcename} --arguments "--disable-parallel"
bash build/install/common/publish-backend.sh --srcpath %{_builddir}/%{sourcename}
sed -i "s@var/www@var/www/%{product}@" config/nginx/onlyoffice-*.conf && sed -i "s@var/www@var/www/%{product}@" config/nginx/includes/onlyoffice-*.conf
sed -i "s@var/www@var/www/%{product}@g" config/nginx/*.conf && sed -i "s@var/www@var/www/%{product}@g" config/nginx/includes/*.conf

View File

@ -8,7 +8,7 @@
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-api.service
/lib/systemd/system/%{product}-api.service
%dir %{buildpath}/studio/
%dir %{buildpath}/products/ASC.People/
%dir %{buildpath}/products/ASC.People/server/
@ -26,7 +26,7 @@
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-backup.service
/lib/systemd/system/%{product}-backup.service
%dir %{buildpath}/services/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.People/
@ -53,7 +53,7 @@
%{buildpath}/products/ASC.People/server/ASC.People*.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-files-services.service
/lib/systemd/system/%{product}-files-services.service
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.People/
%dir %{buildpath}/products/ASC.People/server
@ -71,7 +71,7 @@
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-notify.service
/lib/systemd/system/%{product}-notify.service
%dir %{buildpath}/services/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.People/
@ -89,7 +89,7 @@
%{buildpath}/products/ASC.People/server/ASC.People.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-files.service
/lib/systemd/system/%{product}-files.service
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.Files/
%dir %{buildpath}/products/ASC.People/
@ -102,7 +102,7 @@
%files api-system
%defattr(-, onlyoffice, onlyoffice, -)
%{buildpath}/services/ASC.ApiSystem/
%{_sysconfdir}/systemd/system/%{product}-api-system.service
/lib/systemd/system/%{product}-api-system.service
%dir %{buildpath}/services/
%files proxy
@ -111,14 +111,14 @@
%{_sysconfdir}/nginx/conf.d/*
%{buildpath}/public/
%{buildpath}/studio/client/
%{buildpath}/studio/login
%{buildpath}/studio/login/
%{buildpath}/products/ASC.People/client/
%{buildpath}/products/ASC.Files/client/
%{buildpath}/products/ASC.Files/editor/
%{buildpath}/products/ASC.CRM/client/
%{buildpath}/products/ASC.Projects/client
%{buildpath}/products/ASC.Projects/client/
%{buildpath}/products/ASC.Calendar/client/
%{buildpath}/products/ASC.Mail/client
%{buildpath}/products/ASC.Mail/client/
%dir %{buildpath}/studio/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.People/
@ -135,7 +135,7 @@
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-studio-notify.service
/lib/systemd/system/%{product}-studio-notify.service
%dir %{buildpath}/services/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.People/
@ -153,7 +153,7 @@
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-people-server.service
/lib/systemd/system/%{product}-people-server.service
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.People/
%dir %{buildpath}/products/ASC.Files/
@ -167,25 +167,25 @@
%defattr(-, onlyoffice, onlyoffice, -)
%{buildpath}/services/ASC.UrlShortener/
%{buildpath}/services/ASC.UrlShortener.Svc/
%{_sysconfdir}/systemd/system/%{product}-urlshortener.service
/lib/systemd/system/%{product}-urlshortener.service
%dir %{buildpath}/services/
%files thumbnails
%defattr(-, onlyoffice, onlyoffice, -)
%{buildpath}/services/ASC.Thumbnails/
%{buildpath}/services/ASC.Thumbnails.Svc/
%{_sysconfdir}/systemd/system/%{product}-thumbnails.service
/lib/systemd/system/%{product}-thumbnails.service
%dir %{buildpath}/services/
%files socket
%defattr(-, onlyoffice, onlyoffice, -)
%{buildpath}/services/ASC.Socket.IO/
%{buildpath}/services/ASC.Socket.IO.Svc/
%{buildpath}/products/ASC.Files/server/
%{buildpath}/products/ASC.People/server/
%{buildpath}/products/ASC.CRM/server/
%{buildpath}/products/ASC.Projects/server/
%{_sysconfdir}/systemd/system/%{product}-socket.service
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.People/server/ASC.People.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
/lib/systemd/system/%{product}-socket.service
%dir %{buildpath}/services/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.Files/
@ -200,7 +200,7 @@
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-studio.service
/lib/systemd/system/%{product}-studio.service
%dir %{buildpath}/studio/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.People/
@ -219,7 +219,7 @@
%{buildpath}/products/ASC.People/server/ASC.People.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-storage-encryption.service
/lib/systemd/system/%{product}-storage-encryption.service
%dir %{buildpath}/services/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.Files/
@ -234,11 +234,11 @@
%files storage-migration
%defattr(-, onlyoffice, onlyoffice, -)
%{buildpath}/services/ASC.Data.Storage.Migration/
%{buildpath}/products/ASC.Files/server/
%{buildpath}/products/ASC.People/server/
%{buildpath}/products/ASC.CRM/server/
%{buildpath}/products/ASC.Projects/server/
%{_sysconfdir}/systemd/system/%{product}-storage-migration.service
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.People/server/ASC.People.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
/lib/systemd/system/%{product}-storage-migration.service
%dir %{buildpath}/services/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.Files/
@ -252,7 +252,7 @@
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.People/server/ASC.People.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{_sysconfdir}/systemd/system/%{product}-projects-server.service
/lib/systemd/system/%{product}-projects-server.service
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.Files/
%dir %{buildpath}/products/ASC.Files/server/
@ -269,7 +269,7 @@
%{buildpath}/products/ASC.People/server/ASC.People.dll
%{buildpath}/products/ASC.CRM/server/ASC.CRM*.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-telegram-service.service
/lib/systemd/system/%{product}-telegram-service.service
%dir %{buildpath}/services/
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.Files/
@ -287,7 +287,7 @@
%{buildpath}/products/ASC.Files/server/ASC.Files*.dll
%{buildpath}/products/ASC.People/server/ASC.People.dll
%{buildpath}/products/ASC.Projects/server/ASC.Projects*.dll
%{_sysconfdir}/systemd/system/%{product}-crm.service
/lib/systemd/system/%{product}-crm.service
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.CRM/
%dir %{buildpath}/products/ASC.Files/
@ -298,13 +298,20 @@
%files calendar
%defattr(-, onlyoffice, onlyoffice, -)
%{buildpath}/products/ASC.Calendar/server/
%{_sysconfdir}/systemd/system/%{product}-calendar.service
/lib/systemd/system/%{product}-calendar.service
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.Calendar/
%files mail
%defattr(-, onlyoffice, onlyoffice, -)
%{buildpath}/products/ASC.Mail/server/
%{_sysconfdir}/systemd/system/%{product}-mail.service
/lib/systemd/system/%{product}-mail.service
%dir %{buildpath}/products/
%dir %{buildpath}/products/ASC.Mail/
%files ssoauth
%defattr(-, onlyoffice, onlyoffice, -)
%{buildpath}/services/ASC.SsoAuth/
%{buildpath}/services/ASC.SsoAuth.Svc/
/lib/systemd/system/%{product}-ssoauth.service
%dir %{buildpath}/services/

View File

@ -5,8 +5,8 @@ mkdir -p "%{buildroot}%{_sysconfdir}/nginx/includes/"
mkdir -p "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/"
mkdir -p "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/.private/"
mkdir -p "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/data/"
mkdir -p "%{buildroot}%{_sysconfdir}/systemd/system/"
mkdir -p "%{buildroot}%{_var}/log/onlyoffice/%{product}/"
mkdir -p "%{buildroot}/lib/systemd/system/"
mkdir -p "%{buildroot}%{buildpath}/products/ASC.Calendar/client/"
mkdir -p "%{buildroot}%{buildpath}/products/ASC.Calendar/server/"
mkdir -p "%{buildroot}%{buildpath}/products/ASC.CRM/client/"
@ -24,6 +24,8 @@ mkdir -p "%{buildroot}%{buildpath}/products/ASC.Projects/server/"
mkdir -p "%{buildroot}%{buildpath}/public/"
mkdir -p "%{buildroot}%{buildpath}/services/ASC.Socket.IO/"
mkdir -p "%{buildroot}%{buildpath}/services/ASC.Socket.IO.Svc/"
mkdir -p "%{buildroot}%{buildpath}/services/ASC.SsoAuth/"
mkdir -p "%{buildroot}%{buildpath}/services/ASC.SsoAuth.Svc/"
mkdir -p "%{buildroot}%{buildpath}/services/ASC.ApiSystem/"
mkdir -p "%{buildroot}%{buildpath}/services/ASC.Data.Backup/"
mkdir -p "%{buildroot}%{buildpath}/services/ASC.Notify/"
@ -52,6 +54,8 @@ cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Data.Backup/service/* "%{
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Notify/service/* "%{buildroot}%{buildpath}/services/ASC.Notify/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Socket.IO/service/* "%{buildroot}%{buildpath}/services/ASC.Socket.IO/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Socket.IO.Svc/service/* "%{buildroot}%{buildpath}/services/ASC.Socket.IO.Svc/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.SsoAuth/service/* "%{buildroot}%{buildpath}/services/ASC.SsoAuth/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.SsoAuth.Svc/service/* "%{buildroot}%{buildpath}/services/ASC.SsoAuth.Svc/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Data.Storage.Encryption/service/* "%{buildroot}%{buildpath}/services/ASC.Data.Storage.Encryption/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Data.Storage.Migration/service/* "%{buildroot}%{buildpath}/services/ASC.Data.Storage.Migration/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Studio.Notify/service/* "%{buildroot}%{buildpath}/services/ASC.Studio.Notify/"
@ -62,9 +66,9 @@ cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.UrlShortener/service/* "%
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.UrlShortener.Svc/service/* "%{buildroot}%{buildpath}/services/ASC.UrlShortener.Svc/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Web.Api/service/* "%{buildroot}%{buildpath}/studio/api/"
cp -rf %{_builddir}/%{sourcename}/publish/services/ASC.Web.Studio/service/* "%{buildroot}%{buildpath}/studio/server/"
cp -rf %{_builddir}/%{sourcename}/build/install/common/systemd/modules/* "%{buildroot}%{_sysconfdir}/systemd/system/"
cp -rf %{_builddir}/%{sourcename}/build/install/common/systemd/modules/* "%{buildroot}/lib/systemd/system/"
cp -rf %{_builddir}/%{sourcename}/build/install/docker/config/*.sql "%{buildroot}%{buildpath}/sql/"
cp -rf %{_builddir}/%{sourcename}/build/install/rpm/*.sh "%{buildroot}%{_bindir}/"
cp -rf %{_builddir}/%{sourcename}/build/install/common/%{product}-configuration.sh "%{buildroot}%{_bindir}/"
cp -rf %{_builddir}/%{sourcename}/config/* "%{buildroot}%{_sysconfdir}/onlyoffice/%{product}/"
cp -rf %{_builddir}/%{sourcename}/config/nginx/includes/onlyoffice*.conf "%{buildroot}%{_sysconfdir}/nginx/includes/"
cp -rf %{_builddir}/%{sourcename}/config/nginx/onlyoffice*.conf "%{buildroot}%{_sysconfdir}/nginx/conf.d/"

View File

@ -166,3 +166,12 @@ Requires: %name-common
Requires: dotnet-sdk-5.0
AutoReqProv: no
%description mail
%package ssoauth
Summary: ssoauth
Group: Applications/Internet
Requires: %name-common
Requires: dotnet-sdk-5.0
Requires: nodejs >= 12.0
AutoReqProv: no
%description ssoauth

@ -1 +1 @@
Subproject commit 8177bad15d567d997a79478a65d32662a6f773b1
Subproject commit b1063eae56d183b5c0b6eb887115c378f3941ebe