Merge branch 'develop' into feature/backup

This commit is contained in:
Tatiana Lopaeva 2021-10-04 15:21:45 +03:00
commit 01879779cd
196 changed files with 2880 additions and 1242 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,120 @@
#!/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 '^[^;]*')
apt-get install -o DPkg::options::="--force-confnew" -y --only-upgrade ${product} elasticsearch=${ELASTIC_VERSION}
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,177 @@
#!/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) }')
curl 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
curl https://packages.microsoft.com/config/$DIST/$REV/packages-microsoft-prod.deb -O
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
curl https://downloads.apache.org/kafka/2.7.1/kafka_2.13-2.7.1.tgz -O
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
fi
# add redis repo
if [ "$DIST" = "ubuntu" ]; then
add-apt-repository -y ppa:chris-lea/redis-server
fi
#add nginx repo
curl http://nginx.org/keys/nginx_signing.key -O
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 -o DPkg::options::="--force-confnew" -yq \
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

@ -12,6 +12,7 @@ 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"
RES_MARIADB="To continue the installation, you need to remove MariaDB"
res_unsupported_version () {
RES_CHOICE="Please, enter Y or N"
@ -31,7 +32,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

@ -40,6 +40,7 @@ read_unsupported_installation () {
esac
}
{ yum check-update postgresql; PSQLExitCode=$?; } || true #Checking for postgresql update
{ yum check-update $DIST*-release; exitCode=$?; } || true #Checking for distribution update
UPDATE_AVAILABLE_CODE=100
@ -52,6 +53,10 @@ if [[ $exitCode -eq $UPDATE_AVAILABLE_CODE ]]; then
read_unsupported_installation
fi
if rpm -qa | grep mariadb.*config >/dev/null 2>&1; then
echo $RES_MARIADB && exit 0
fi
# add epel repo
rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-$REV.noarch.rpm || true
rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-$REV.rpm || true
@ -79,11 +84,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 +100,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
curl https://downloads.apache.org/kafka/2.7.1/kafka_2.13-2.7.1.tgz -O
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 +124,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 +140,7 @@ Restart=on-abnormal
[Install]
WantedBy=multi-user.target
END
fi
# add nginx repo
cat > /etc/yum.repos.d/nginx.repo <<END
@ -158,7 +171,7 @@ END
fi
${package_manager} -y install yum-plugin-versionlock
${package_manager} -y install python3-dnf-plugin-versionlock || ${package_manager} -y install yum-plugin-versionlock
${package_manager} versionlock clear
${package_manager} -y install epel-release \
@ -169,15 +182,20 @@ ${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
if [[ $PSQLExitCode -eq $UPDATE_AVAILABLE_CODE ]]; then
yum -y install postgresql-upgrade
postgresql-setup --upgrade || true
fi
postgresql-setup initdb || true
semanage permissive -a httpd_t

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

@ -1,6 +1,8 @@
#!/bin/bash
SRC_PATH="/AppServer"
BUILD_ARGS="build"
DEPLOY_ARGS="deploy"
while [ "$1" != "" ]; do
case $1 in
@ -11,11 +13,24 @@ while [ "$1" != "" ]; do
shift
fi
;;
-ba | --build-args )
if [ "$2" != "" ]; then
BUILD_ARGS=$2
shift
fi
;;
-da | --deploy-args )
if [ "$2" != "" ]; then
DEPLOY_ARGS=$2
shift
fi
;;
-? | -h | --help )
echo " Usage: bash build-backend.sh [PARAMETER] [[PARAMETER], ...]"
echo " Parameters:"
echo " -sp, --srcpath path to AppServer root directory"
echo " -ba, --build-args arguments for yarn building"
echo " -da, --deploy-args arguments for yarn deploying"
echo " -?, -h, --help this help"
echo " Examples"
echo " bash build-backend.sh -sp /app/AppServer"
@ -34,5 +49,5 @@ echo "== FRONT-END-BUILD =="
cd ${SRC_PATH}
yarn install
yarn build
yarn deploy
yarn ${BUILD_ARGS}
yarn ${DEPLOY_ARGS}

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

@ -12,6 +12,8 @@ ARG BUILD_NUMBER=0
ARG GIT_BRANCH=master
ARG SRC_PATH
ARG BUILD_PATH
ARG BUILD_ARGS=build
ARG DEPLOY_ARGS=deploy
LABEL onlyoffice.appserver.release-date="${RELEASE_DATE}" \
maintainer="Ascensio System SIA <support@onlyoffice.com>"
@ -46,7 +48,7 @@ RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
sed -i "s/\"number\".*,/\"number\": \"${PRODUCT_VERSION}.${BUILD_NUMBER}\",/g" /app/onlyoffice/config/appsettings.json && \
sed -e 's/#//' -i /etc/nginx/conf.d/onlyoffice.conf && \
cd ${SRC_PATH}/build/install/common/ && \
bash build-frontend.sh -sp ${SRC_PATH} && \
bash build-frontend.sh -sp ${SRC_PATH} -ba ${BUILD_ARGS} -da ${DEPLOY_ARGS} && \
bash build-backend.sh -sp ${SRC_PATH} && \
bash publish-backend.sh -sp ${SRC_PATH} -bp ${BUILD_PATH} && \
cp -rf ${SRC_PATH}/products/ASC.Files/Server/DocStore ${BUILD_PATH}/products/ASC.Files/server/ && \

View File

@ -4,4 +4,6 @@ BUILD_NUMBER="$(date "+%Y%m%d%H")"
docker-compose -f build.yml build \
--build-arg GIT_BRANCH=$SOURCE_BRANCH \
--build-arg PRODUCT_VERSION=$PRODUCT_VERSION \
--build-arg BUILD_NUMBER=$BUILD_NUMBER
--build-arg BUILD_NUMBER=$BUILD_NUMBER \
--build-arg BUILD_ARGS=$BUILD_ARGS \
--build-arg DEPLOY_ARGS=$DEPLOY_ARGS

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

View File

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using ASC.Common;
using ASC.Core;
using ASC.Web.Core;
using ASC.Web.Core.Helpers;
using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.Logging;
@ -16,6 +17,7 @@ namespace ASC.Api.Core.Auth
[Scope]
public class CookieAuthHandler : AuthenticationHandler<AuthenticationSchemeOptions>
{
private AuthorizationHelper AuthorizationHelper { get; }
private SecurityContext SecurityContext { get; }
private CookiesManager CookiesManager { get; }
@ -23,17 +25,20 @@ namespace ASC.Api.Core.Auth
{
}
//
public CookieAuthHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, SecurityContext securityContext, CookiesManager cookiesManager)
public CookieAuthHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock,
AuthorizationHelper authorizationHelper,
SecurityContext securityContext,
CookiesManager cookiesManager)
: this(options, logger, encoder, clock)
{
AuthorizationHelper = authorizationHelper;
SecurityContext = securityContext;
CookiesManager = cookiesManager;
}
protected override Task<AuthenticateResult> HandleAuthenticateAsync()
{
var token = Context.Request.Cookies["asc_auth_key"] ?? Context.Request.Headers["Authorization"];
var result = SecurityContext.AuthenticateMe(token);
var result = AuthorizationHelper.ProcessBasicAuthorization(out _);
if (!result)
{

View File

@ -20,12 +20,25 @@ namespace ASC.Api.Core.Core
Source = source;
var endpoints = Source.Endpoints.Cast<RouteEndpoint>();
Endpoints = endpoints
.Where(r =>
.SelectMany(r =>
{
var endpoints = new List<RouteEndpoint>();
var attr = r.Metadata.OfType<CustomHttpMethodAttribute>().FirstOrDefault();
return attr == null || !attr.DisableFormat;
var enableFormat = attr == null || !attr.DisableFormat;
if (enableFormat)
{
endpoints.Add(new RouteEndpoint(r.RequestDelegate, RoutePatternFactory.Parse(r.RoutePattern.RawText + ".{format}"), r.Order, r.Metadata, r.DisplayName));
}
else
{
endpoints.Add(new RouteEndpoint(r.RequestDelegate, RoutePatternFactory.Parse(r.RoutePattern.RawText + ".json"), r.Order, r.Metadata, r.DisplayName));
endpoints.Add(new RouteEndpoint(r.RequestDelegate, RoutePatternFactory.Parse(r.RoutePattern.RawText + ".xml"), r.Order, r.Metadata, r.DisplayName));
}
return endpoints;
})
.Select(r => new RouteEndpoint(r.RequestDelegate, RoutePatternFactory.Parse(r.RoutePattern.RawText + ".{format}"), r.Order, r.Metadata, r.DisplayName))
.ToList();
}

View File

@ -145,7 +145,7 @@ namespace ASC.Core.Common.Notify
private string GetLink(string token)
{
var tgProvider = (ITelegramLoginProvider)ConsumerFactory.GetByKey("Telegram");
var tgProvider = (ITelegramLoginProvider)ConsumerFactory.GetByKey("telegram");
var botname = tgProvider == null ? default : tgProvider.TelegramBotName;
if (string.IsNullOrEmpty(botname)) return null;

View File

@ -186,7 +186,7 @@ namespace ASC.Data.Backup
{
var amazonSettings = CoreConfiguration.GetSection<AmazonS3Settings>();
var consumer = ConsumerFactory.GetByKey<DataStoreConsumer>("S3");
var consumer = ConsumerFactory.GetByKey<DataStoreConsumer>("s3");
if (!consumer.IsSet)
{
consumer["acesskey"] = amazonSettings.AccessKeyId;

View File

@ -28,15 +28,15 @@ namespace ASC.FederatedLogin
{
public static class ProviderConstants
{
public const string Twitter = "Twitter";
public const string Facebook = "Facebook";
public const string LinkedIn = "LinkedIn";
public const string Twitter = "twitter";
public const string Facebook = "facebook";
public const string LinkedIn = "linkedin";
public const string OpenId = "openid";
public const string Box = "Box";
public const string Google = "Google";
public const string Yandex = "Yandex";
public const string MailRu = "Mailru";
public const string VK = "Vk";
public const string Box = "box";
public const string Google = "google";
public const string Yandex = "yandex";
public const string MailRu = "mailru";
public const string VK = "vk";
public const string GosUslugi = "gosuslugi";
public const string Encryption = "e2e";
}

View File

@ -182,9 +182,9 @@ namespace ASC.ElasticSearch
return true;
}
public bool CanIndexByContent()
public bool CanIndexByContent(T t)
{
return SearchSettingsHelper.CanIndexByContent<T>(TenantManager.GetCurrentTenant().TenantId);
return Support(t) && SearchSettingsHelper.CanIndexByContent<T>(TenantManager.GetCurrentTenant().TenantId);
}
public bool Index(T data, bool immediately = true)

View File

@ -45,7 +45,7 @@
"enabled": "enabled"
},
"version": {
"number": "1.0.0",
"number": "11.5.0",
"release": {
"date": "",
"sign": ""

View File

@ -10,17 +10,17 @@
"type": "ASC.FederatedLogin.LoginProviders.BitlyLoginProvider, ASC.FederatedLogin"
},
{
"key": "Bitly",
"key": "bitly",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Bitly",
"key": "bitly",
"type": "ASC.FederatedLogin.LoginProviders.BitlyLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Bitly",
"name": "bitly",
"order": "13",
"props": {
"bitlyClientId": "",
@ -41,17 +41,17 @@
"type": "ASC.FederatedLogin.LoginProviders.TelegramLoginProvider, ASC.FederatedLogin"
},
{
"key": "Telegram",
"key": "telegram",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Telegram",
"key": "telegram",
"type": "ASC.FederatedLogin.LoginProviders.TelegramLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Telegram",
"name": "telegram",
"order": "13",
"props": {
"telegramBotToken": "",
@ -73,17 +73,17 @@
"type": "ASC.FederatedLogin.LoginProviders.BoxLoginProvider, ASC.FederatedLogin"
},
{
"key": "Box",
"key": "box",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Box",
"key": "box",
"type": "ASC.FederatedLogin.LoginProviders.BoxLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Box",
"name": "box",
"order": "3",
"props": {
"boxClientId": "",
@ -104,17 +104,17 @@
"type": "ASC.Web.Core.Sms.ClickatellProvider, ASC.Web.Core"
},
{
"key": "Clickatell",
"key": "clickatell",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Clickatell",
"key": "clickatell",
"type": "ASC.Web.Core.Sms.ClickatellProvider, ASC.Web.Core"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Clickatell",
"name": "clickatell",
"order": "10",
"props": {
"clickatellapiKey": ""
@ -131,17 +131,17 @@
"type": "ASC.FederatedLogin.LoginProviders.DocuSignLoginProvider, ASC.FederatedLogin"
},
{
"key": "DocuSign",
"key": "docuSign",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "DocuSign",
"key": "docuSign",
"type": "ASC.FederatedLogin.LoginProviders.DocuSignLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "DocuSign",
"name": "docuSign",
"order": "1",
"props": {
"docuSignClientId": "",
@ -163,17 +163,17 @@
"type": "ASC.FederatedLogin.LoginProviders.DropboxLoginProvider, ASC.FederatedLogin"
},
{
"key": "DropBox",
"key": "dropbox",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "DropBox",
"key": "dropbox",
"type": "ASC.FederatedLogin.LoginProviders.DropboxLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "DropBox",
"name": "dropbox",
"order": "2",
"props": {
"dropboxClientId": "",
@ -196,17 +196,17 @@
"type": "ASC.FederatedLogin.LoginProviders.FacebookLoginProvider, ASC.FederatedLogin"
},
{
"key": "Facebook",
"key": "facebook",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Facebook",
"key": "facebook",
"type": "ASC.FederatedLogin.LoginProviders.FacebookLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Facebook",
"name": "facebook",
"order": "6",
"props": {
"facebookClientId": "",
@ -227,17 +227,17 @@
"type": "ASC.Web.Core.Jabber.FireBase, ASC.Web.Core"
},
{
"key": "Firebase",
"key": "firebase",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Firebase",
"key": "firebase",
"type": "ASC.Web.Core.Jabber.FireBase, ASC.Web.Core"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Firebase",
"name": "firebase",
"order": "12",
"props": {
"firebase_apiKey": "",
@ -257,17 +257,17 @@
"type": "ASC.FederatedLogin.LoginProviders.GoogleLoginProvider, ASC.FederatedLogin"
},
{
"key": "Google",
"key": "google",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Google",
"key": "google",
"type": "ASC.FederatedLogin.LoginProviders.GoogleLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Google",
"name": "google",
"order": "5",
"props": {
"googleClientId": "",
@ -288,17 +288,17 @@
"type": "ASC.FederatedLogin.LoginProviders.LinkedInLoginProvider, ASC.FederatedLogin"
},
{
"key": "LinkedIn",
"key": "linkedin",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "LinkedIn",
"key": "linkedin",
"type": "ASC.FederatedLogin.LoginProviders.LinkedInLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "LinkedIn",
"name": "linkedin",
"order": "8",
"props": {
"linkedInKey": "",
@ -319,17 +319,17 @@
"type": "ASC.FederatedLogin.LoginProviders.MailRuLoginProvider, ASC.FederatedLogin"
},
{
"key": "Mailru",
"key": "mailru",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Mailru",
"key": "mailru",
"type": "ASC.FederatedLogin.LoginProviders.MailRuLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Mailru",
"name": "mailru",
"order": "4",
"props": {
"mailRuClientId": "",
@ -350,17 +350,17 @@
"type": "ASC.FederatedLogin.LoginProviders.OneDriveLoginProvider, ASC.FederatedLogin"
},
{
"key": "SkyDrive",
"key": "skydrive",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "SkyDrive",
"key": "skydrive",
"type": "ASC.FederatedLogin.LoginProviders.OneDriveLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "SkyDrive",
"name": "skydrive",
"order": "4",
"props": {
"skydriveappkey": "",
@ -381,17 +381,17 @@
"type": "ASC.Web.Core.Sms.SmscProvider, ASC.Web.Core"
},
{
"key": "Smsc",
"key": "smsc",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Smsc",
"key": "smsc",
"type": "ASC.Web.Core.Sms.SmscProvider, ASC.Web.Core"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Smsc",
"name": "smsc",
"order": "11",
"props": {
"smsclogin": "",
@ -413,17 +413,17 @@
"type": "ASC.Web.Core.Sms.TwilioProvider, ASC.Web.Core"
},
{
"key": "Twilio",
"key": "twilio",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Twilio",
"key": "twilio",
"type": "ASC.Web.Core.Sms.TwilioProvider, ASC.Web.Core"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Twilio",
"name": "twilio",
"order": "9",
"props": {
"twilioAccountSid": "",
@ -442,17 +442,17 @@
"type": "ASC.FederatedLogin.LoginProviders.YahooLoginProvider, ASC.FederatedLogin"
},
{
"key": "Yahoo",
"key": "yahoo",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Yahoo",
"key": "yahoo",
"type": "ASC.FederatedLogin.LoginProviders.YahooLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Yahoo",
"name": "yahoo",
"order": "14",
"props": {
"yahooClientId": "",
@ -473,17 +473,17 @@
"type": "ASC.FederatedLogin.LoginProviders.VKLoginProvider, ASC.FederatedLogin"
},
{
"key": "Vk",
"key": "vk",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Vk",
"key": "vk",
"type": "ASC.FederatedLogin.LoginProviders.VKLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Vk",
"name": "vk",
"order": "14",
"props": {
"vkClientId": "",
@ -504,17 +504,17 @@
"type": "ASC.FederatedLogin.LoginProviders.WordpressLoginProvider, ASC.FederatedLogin"
},
{
"key": "Wordpress",
"key": "wordpress",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Wordpress",
"key": "wordpress",
"type": "ASC.FederatedLogin.LoginProviders.WordpressLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Wordpress",
"name": "wordpress",
"order": "15",
"props": {
"wpClientId": "",
@ -535,17 +535,17 @@
"type": "ASC.FederatedLogin.LoginProviders.YandexLoginProvider, ASC.FederatedLogin"
},
{
"key": "Yandex",
"key": "yandex",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Yandex",
"key": "yandex",
"type": "ASC.FederatedLogin.LoginProviders.YandexLoginProvider, ASC.FederatedLogin"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Yandex",
"name": "yandex",
"order": "15",
"props": {
"yandexClientId": "",
@ -566,17 +566,17 @@
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
},
{
"key": "S3",
"key": "s3",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "S3",
"key": "s3",
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "S3",
"name": "s3",
"order": "20",
"props": {
"acesskey": "",
@ -604,17 +604,17 @@
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
},
{
"key": "GoogleCloud",
"key": "googlecloud",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "GoogleCloud",
"key": "googlecloud",
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "GoogleCloud",
"name": "googlecloud",
"order": "21",
"props": {
"json": ""
@ -635,17 +635,17 @@
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
},
{
"key": "Rackspace",
"key": "rackspace",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Rackspace",
"key": "rackspace",
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Rackspace",
"name": "rackspace",
"order": "22",
"props": {
"username": "",
@ -669,17 +669,17 @@
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
},
{
"key": "Selectel",
"key": "selectel",
"type": "ASC.Core.Common.Configuration.Consumer, ASC.Core.Common"
},
{
"key": "Selectel",
"key": "selectel",
"type": "ASC.Core.Common.Configuration.DataStoreConsumer, ASC.Core.Common"
}
],
"instanceScope": "perlifetimescope",
"parameters": {
"name": "Selectel",
"name": "selectel",
"order": "23",
"props": {
"authUser": "",

View File

@ -83,7 +83,7 @@ server {
location / {
proxy_pass http://localhost:5001;
location ~* /(manifest.json|sw.js|appIcon.png|bg-error.png) {
location ~* /(manifest.json|sw.js|appIcon.png|bg-error.png|favicon.ico) {
root $public_root;
try_files /$basename /index.html =404;
}

View File

@ -1,7 +1,7 @@
module.exports = {
globDirectory: 'build/deploy/',
globPatterns: [
"**/*.{js,css,woff2}"
"**/*.{js,css,woff2,svg}"
],
globIgnores: ['**/remoteEntry.js'],
swSrc: 'packages/asc-web-common/utils/sw-template.js',

View File

@ -4,6 +4,7 @@
"packages": [
"packages/asc-web-components",
"packages/asc-web-common",
"packages/browserslist-config-asc",
"web/ASC.Web.Login",
"web/ASC.Web.Client",
"web/ASC.Web.Editor",

View File

@ -5,6 +5,7 @@
"workspaces": [
"packages/asc-web-components",
"packages/asc-web-common",
"packages/browserslist-config-asc",
"web/ASC.Web.Login",
"web/ASC.Web.Client",
"web/ASC.Web.Editor",
@ -16,15 +17,15 @@
"products/ASC.Calendar/Client"
],
"scripts": {
"build": "lerna run build --parallel --ignore @appserver/common --ignore @appserver/components",
"build": "lerna run build --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc",
"build:personal": "lerna run build --parallel --scope {@appserver/studio,@appserver/people,@appserver/files,@appserver/editor}",
"bump": "lerna version --no-push --no-git-tag-version",
"clean": "lerna run clean --parallel",
"deploy": "shx rm -rf build/deploy/products && shx rm -rf build/deploy/public && shx rm -rf build/deploy/studio && lerna run deploy --parallel --ignore @appserver/common --ignore @appserver/components && shx cp -r public build/deploy && yarn sw-build",
"deploy": "shx rm -rf build/deploy/products && shx rm -rf build/deploy/public && shx rm -rf build/deploy/studio && lerna run deploy --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc && shx cp -r public build/deploy && yarn sw-build",
"deploy:personal": "shx rm -rf build/deploy/products && shx rm -rf build/deploy/public && shx rm -rf build/deploy/studio && lerna run deploy --parallel --scope {@appserver/studio,@appserver/people,@appserver/files,@appserver/editor} && shx cp -r public build/deploy && yarn sw-build:personal",
"serve": "lerna run serve --parallel --ignore @appserver/common --ignore @appserver/components",
"start": "lerna run start --parallel --ignore @appserver/common --ignore @appserver/components",
"start-prod": "lerna run start-prod --parallel --ignore @appserver/common --ignore @appserver/components",
"serve": "lerna run serve --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc",
"start": "lerna run start --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc",
"start-prod": "lerna run start-prod --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc",
"storybook": "yarn workspace @appserver/components storybook",
"storybook-build": "yarn workspace @appserver/components run storybook-build",
"sw-build": "workbox injectManifest config/workbox-config.js && yarn sw-modify && yarn sw-minimize",
@ -46,10 +47,24 @@
"wipe": "shx rm -rf node_modules yarn.lock web/**/node_modules products/**/node_modules"
},
"devDependencies": {
"browserslist": "^4.17.1",
"lerna": "^4.0.0",
"replace-in-files-cli": "^1.0.0",
"shx": "^0.3.3",
"terser": "^5.8.0",
"workbox-cli": "^6.3.0"
}
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"dependencies": {}
}

View File

@ -485,8 +485,15 @@ export function getProgress() {
}
export function checkFileConflicts(destFolderId, folderIds, fileIds) {
const data = { destFolderId, folderIds, fileIds };
return request({ method: "post", url: "/files/fileops/move", data });
let paramsString =
folderIds.length > 0 ? `&folderIds=${folderIds.join("&folderIds=")}` : "";
paramsString +=
fileIds.length > 0 ? `&fileIds=${fileIds.join("&fileIds=")}` : "";
return request({
method: "get",
url: `/files/fileops/move.json?destFolderId=${destFolderId}${paramsString}`,
});
}
export function copyToFolder(

View File

@ -0,0 +1,7 @@
module.exports = [
'>0.25%',
'not ie 11',
'not op_mini all',
'not dead',
'Firefox ESR',
];

View File

@ -109,7 +109,8 @@ class MediaViewer extends React.Component {
_this.hammer.on("swiperight", _this.prevMedia);
}
} catch (ex) {
console.error("MediaViewer updateHammer", ex);
//console.error("MediaViewer updateHammer", ex);
this.hammer = null;
}
}, 500);
}
@ -122,7 +123,8 @@ class MediaViewer extends React.Component {
onEmptyPlaylistError,
} = this.props;
const { playlistPos } = this.state;
const { playlistPos, fileUrl } = this.state;
const src = playlist[playlistPos]?.src;
if (visible !== prevProps.visible) {
const newPlaylistPos =
@ -136,6 +138,10 @@ class MediaViewer extends React.Component {
});
}
if (src && src !== fileUrl && playlistPos === prevState.playlistPos) {
this.setState({ fileUrl: src });
}
if (
visible &&
visible === prevProps.visible &&
@ -190,28 +196,9 @@ class MediaViewer extends React.Component {
if (ext === ".tiff" || ext === ".tif") {
this.getTiffDataURL(src);
}
var _this = this;
setTimeout(function () {
if (document.getElementsByClassName("react-viewer-canvas").length > 0) {
_this.hammer = Hammer(
document.getElementsByClassName("react-viewer-canvas")[0]
);
var pinch = new Hammer.Pinch();
_this.hammer.add([pinch]);
_this.hammer.on("pinchout", _this.handleZoomOut);
_this.hammer.on("pinchin", _this.handleZoomIn);
_this.hammer.on("pinchend", _this.handleZoomEnd);
_this.hammer.on("doubletap", _this.doubleTap);
} else {
_this.hammer = Hammer(
document.getElementsByClassName("videoViewerOverlay")[0]
);
}
if (_this.hammer) {
_this.hammer.on("swipeleft", _this.nextMedia);
_this.hammer.on("swiperight", _this.prevMedia);
}
}, 500);
this.updateHammer();
document.addEventListener("keydown", this.onKeydown, false);
document.addEventListener("keyup", this.onKeyup, false);
}
@ -227,6 +214,7 @@ class MediaViewer extends React.Component {
}
document.removeEventListener("keydown", this.onKeydown, false);
document.removeEventListener("keyup", this.onKeyup, false);
this.onClose();
}
mapSupplied = {
@ -457,6 +445,7 @@ class MediaViewer extends React.Component {
canDelete,
canDownload,
errorLabel,
previewFile,
} = this.props;
const currentFileId =
@ -552,7 +541,7 @@ class MediaViewer extends React.Component {
<div className="mediaViewerToolbox" ref={this.viewerToolbox}>
{!isImage && (
<span>
{canDelete(currentFileId) && (
{canDelete(currentFileId) && !previewFile && (
<ControlBtn onClick={this.onDelete}>
<div className="deleteBtnContainer">
<StyledMediaDeleteIcon size="scale" />
@ -590,6 +579,7 @@ MediaViewer.propTypes = {
onEmptyPlaylistError: PropTypes.func,
deleteDialogVisible: PropTypes.bool,
errorLabel: PropTypes.string,
previewFile: PropTypes.bool,
};
MediaViewer.defaultProps = {
@ -602,6 +592,7 @@ MediaViewer.defaultProps = {
canDownload: () => {
return true;
},
previewFile: false,
};
export default MediaViewer;

View File

@ -3,7 +3,7 @@ import PropTypes from "prop-types";
import Backdrop from "@appserver/components/backdrop";
import { size } from "@appserver/components/utils/device";
import { Provider } from "@appserver/components/utils/context";
import { isMobile } from "react-device-detect";
import { isMobile, isFirefox, isMobileOnly } from "react-device-detect";
import Article from "./sub-components/article";
import SubArticleHeader from "./sub-components/article-header";
import SubArticleMainButton from "./sub-components/article-main-button";
@ -114,9 +114,14 @@ class PageLayout extends React.Component {
orientationChangeHandler = () => {
const isValueExist = !!this.props.isArticlePinned;
const isEnoughWidth = screen.availWidth > size.smallTablet;
const isPortrait =
isFirefox &&
isMobileOnly &&
screen.orientation.type === "portrait-primary";
if (!isEnoughWidth && isValueExist) {
if ((!isEnoughWidth && isValueExist) || isPortrait) {
this.backdropClick();
return;
}
if (isEnoughWidth && isValueExist) {
this.pinArticle();

View File

@ -109,21 +109,21 @@ export const ConflictResolveType = Object.freeze({
Duplicate: 2,
});
export const providersData = Object.freeze({
Google: {
label: "Google",
google: {
label: "google",
icon: "/static/images/share.google.react.svg",
},
Facebook: {
label: "Facebook",
facebook: {
label: "facebook",
icon: "/static/images/share.facebook.react.svg",
},
Twitter: {
label: "Twitter",
twitter: {
label: "twitter",
icon: "/static/images/share.twitter.react.svg",
iconOptions: { color: "#2AA3EF" },
},
LinkedIn: {
label: "LinkedIn",
linkedin: {
label: "linkedin",
icon: "/static/images/share.linkedin.react.svg",
},
});

View File

@ -25,6 +25,8 @@ export function regDesktop(
userId: user.id,
};
console.log("regDesktop", data);
let extendedData;
if (isEncryption) {

View File

@ -236,13 +236,13 @@ export function toCommunityHostname(hostname) {
export function getProviderTranslation(provider, t) {
switch (provider) {
case "Google":
case "google":
return t("Common:SignInWithGoogle");
case "Facebook":
case "facebook":
return t("Common:SignInWithFacebook");
case "Twitter":
case "twitter":
return t("Common:SignInWithTwitter");
case "LinkedIn":
case "linkedin":
return t("Common:SignInWithLinkedIn");
}
}

View File

@ -45,6 +45,7 @@ const SnackBarWrapper = (props) => {
btnText: t("Load"),
onAction: () => props.onButtonClick(),
opacity: 1,
countDownTime: 5 * 60 * 1000,
};
return <SnackBar {...barConfig} />;
@ -56,8 +57,6 @@ const registerSW = () => {
if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) {
const wb = new Workbox(`/sw.js`);
//TODO: watch https://developers.google.com/web/tools/workbox/guides/advanced-recipes and https://github.com/webmaxru/prog-web-news/blob/5ff94b45c9d317409c21c0fbb7d76e92f064471b/src/app/app-shell/app-shell.component.ts
const showSkipWaitingPrompt = (event) => {
console.log(
`A new service worker has installed, but it can't activate` +
@ -75,11 +74,6 @@ const registerSW = () => {
}
try {
if (localStorage.getItem("sw_need_activation")) {
refresh();
return;
}
const snackbarNode = document.createElement("div");
snackbarNode.id = "snackbar";
document.body.appendChild(snackbarNode);
@ -101,6 +95,13 @@ const registerSW = () => {
}
};
window.addEventListener("beforeunload", async () => {
if (localStorage.getItem("sw_need_activation")) {
localStorage.removeItem("sw_need_activation");
wb.messageSkipWaiting();
}
});
// Add an event listener to detect when the registered
// service worker has installed but is waiting to activate.
wb.addEventListener("waiting", showSkipWaitingPrompt);
@ -108,6 +109,16 @@ const registerSW = () => {
wb.register()
.then((reg) => {
console.log("Successful service worker registration", reg);
if (!window.swUpdateTimer) {
console.log("SW timer checks for updates every hour");
window.swUpdateTimer = setInterval(() => {
console.log("SW update timer check");
reg.update().catch((e) => {
console.error("SW update timer FAILED", e);
});
}, 60 * 60 * 1000);
}
})
.catch((err) => console.error("Service worker registration failed", err));
} else {

View File

@ -1,5 +1,5 @@
importScripts(
"https://storage.googleapis.com/workbox-cdn/releases/6.2.3/workbox-sw.js"
"https://storage.googleapis.com/workbox-cdn/releases/6.3.0/workbox-sw.js"
);
workbox.setConfig({
@ -20,8 +20,15 @@ clientsClaim();
// PRECACHING
const prefix = "appserver";
// Setting custom cache name
setCacheNameDetails({ precache: "wb6-precache", runtime: "wb6-runtime" });
setCacheNameDetails({
prefix: prefix,
precache: "precache",
runtime: "runtime",
suffix: "v1.0.0",
});
// We inject manifest here using "workbox-build" in workbox-inject.js
const precachRoutes = self.__WB_MANIFEST;
@ -33,7 +40,7 @@ cleanupOutdatedCaches();
// STATIC RESOURCES
googleFontsCache({ cachePrefix: "wb6-gfonts" });
googleFontsCache({ cachePrefix: `${prefix}-gfonts` });
// TRANSLATIONS
@ -42,13 +49,13 @@ registerRoute(
// Use cache but update in the background.
new StaleWhileRevalidate({
// Use a custom cache name.
cacheName: "wb6-content-translation",
cacheName: `${prefix}-translation`,
})
);
// CONTENT
imageCache({ cacheName: "wb6-content-images", maxEntries: 60 });
imageCache({ cacheName: `${prefix}-images`, maxEntries: 60 });
// APP SHELL UPDATE FLOW

View File

@ -27,6 +27,7 @@
"punycode": "^2.1.1",
"rc-tree": "^2.1.4",
"react-autosize-textarea": "^7.1.0",
"react-countdown": "2.3.2",
"react-custom-scrollbars": "^4.2.1",
"react-device-detect": "^1.17.0",
"react-dropzone": "^11.2.4",

View File

@ -2,6 +2,7 @@ import React from "react";
import ReactDOM from "react-dom";
import PropType from "prop-types";
import PropTypes from "prop-types";
import Countdown, { zeroPad } from "react-countdown";
import StyledSnackBar from "./styled-snackbar";
import StyledCrossIcon from "./styled-snackbar-action";
import StyledLogoIcon from "./styled-snackbar-logo";
@ -40,6 +41,24 @@ class SnackBar extends React.Component {
this.props.onAction && this.props.onAction(e);
};
// Renderer callback with condition
countDownRenderer = ({ minutes, seconds, completed }) => {
if (completed) return <></>;
const { textColor, fontSize, fontWeight } = this.props;
// Render a countdown
return (
<Text
as="p"
color={textColor}
fontSize={fontSize}
fontWeight={fontWeight}
>
{zeroPad(minutes)}:{zeroPad(seconds)}
</Text>
);
};
render() {
const {
text,
@ -52,6 +71,7 @@ class SnackBar extends React.Component {
textAlign,
htmlContent,
style,
countDownTime,
...rest
} = this.props;
@ -97,6 +117,14 @@ class SnackBar extends React.Component {
<Text color={textColor}>{btnText}</Text>
</button>
)}
{countDownTime > -1 && (
<Countdown
date={Date.now() + countDownTime}
renderer={this.countDownRenderer}
onComplete={this.onActionClick}
/>
)}
</div>
</Box>
</>
@ -106,7 +134,6 @@ class SnackBar extends React.Component {
<StyledCrossIcon size="medium" />
</button>
)}
)
</StyledSnackBar>
);
}
@ -126,6 +153,7 @@ SnackBar.propTypes = {
textAlign: PropType.string,
htmlContent: PropType.string,
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
countDownTime: PropType.number,
};
SnackBar.defaultProps = {
@ -136,6 +164,7 @@ SnackBar.defaultProps = {
fontWeight: "400",
textAlign: "left",
htmlContent: "",
countDownTime: -1,
};
export default SnackBar;

View File

@ -12,8 +12,9 @@ import TableHeaderCell from "./TableHeaderCell";
import { size } from "../utils/device";
import TableGroupMenu from "./TableGroupMenu";
const minColumnSize = 90;
const minColumnSize = 150;
const settingsSize = 24;
const containerMargin = 25;
class TableHeader extends React.Component {
constructor(props) {
@ -131,6 +132,8 @@ class TableHeader extends React.Component {
.filter((x) => x.key !== this.props.columns[columnIndex - 1].key)
.filter((x) => !x.defaultSize);
const defaultSize = this.props.columns[columnIndex - 1]?.defaultSize;
let index = this.props.columns.length;
while (index !== 0) {
index--;
@ -140,7 +143,9 @@ class TableHeader extends React.Component {
if (isFind) {
const someItemById = document.getElementById("column_" + (index + 1));
const columnSize = someItemById.clientWidth - minColumnSize;
const columnSize =
someItemById.clientWidth -
(defaultSize ? defaultSize : minColumnSize);
if (columnSize >= minColumnSize) {
return (gridTemplateColumns[index + 1] = columnSize + "px");
@ -204,17 +209,17 @@ class TableHeader extends React.Component {
sectionWidth,
} = this.props;
const minSize = size.tablet + 24;
let activeColumnIndex = null;
const container = containerRef.current
? containerRef.current
: document.getElementById("table-container");
const minSize = size.tablet;
if (
!container ||
+container.clientWidth <= minSize ||
+container.clientWidth + containerMargin <= minSize ||
sectionWidth <= minSize
)
return;
@ -226,8 +231,7 @@ class TableHeader extends React.Component {
: container.style.gridTemplateColumns.split(" ");
const containerWidth = +container.clientWidth;
const newContainerWidth =
containerWidth - this.getSubstring(checkboxSize) - 80 - settingsSize; // TODO: 80
const newContainerWidth = containerWidth - this.getSubstring(checkboxSize);
const oldWidth = tableContainer
.map((column) => this.getSubstring(column))
@ -241,7 +245,6 @@ class TableHeader extends React.Component {
const isSingleTable = enableColumns.length > 0;
let str = "";
let disableColumnWidth = 0;
if (tableContainer.length > 1) {
const gridTemplateColumns = [];
@ -254,6 +257,7 @@ class TableHeader extends React.Component {
index == 0 ||
index == tableContainer.length - 1 ||
(column ? column.dataset.enable === "true" : item !== "0px");
const defaultSize = column && column.dataset.defaultSize;
const isActiveNow = item === "0px" && enable;
if (isActiveNow && column) activeColumnIndex = index;
@ -264,21 +268,18 @@ class TableHeader extends React.Component {
this.getSubstring(gridTemplateColumns[1]) +
this.getSubstring(item) +
"px";
} else if (
item !== `${settingsSize}px` &&
item !== checkboxSize &&
item !== "80px"
) {
} else if (item !== `${settingsSize}px` && item !== checkboxSize) {
const percent = (this.getSubstring(item) / oldWidth) * 100;
if (index == 1) {
const newItemWidth =
(containerWidth * percent) / 100 + disableColumnWidth + "px";
const newItemWidth = (containerWidth * percent) / 100 + "px";
gridTemplateColumns.push(newItemWidth);
} else {
const newItemWidth =
percent === 0
? `${minColumnSize}px`
? defaultSize
? `${defaultSize}px`
: `${minColumnSize}px`
: (containerWidth * percent) / 100 + "px";
gridTemplateColumns.push(newItemWidth);
@ -294,8 +295,14 @@ class TableHeader extends React.Component {
str = gridTemplateColumns.join(" ");
} else {
const defaultSize = this.props.columns.find((col) => col.defaultSize)
?.defaultSize;
const column =
(newContainerWidth * (isSingleTable ? 60 : 100)) / 100 + "px";
(newContainerWidth * (isSingleTable ? 60 : 100)) / 100 -
(defaultSize || 0) -
containerMargin +
"px";
const percent = 40 / enableColumns.length;
const otherColumns = (newContainerWidth * percent) / 100 + "px";
@ -386,6 +393,7 @@ class TableHeader extends React.Component {
sorted={sorted}
sortBy={sortBy}
resizable={resizable}
defaultSize={column.defaultSize}
onMouseDown={this.onMouseDown}
/>
);

View File

@ -12,6 +12,7 @@ const TableHeaderCell = ({
resizable,
sortBy,
sorted,
defaultSize,
}) => {
const { title, enable, active, minWidth } = column;
@ -35,6 +36,7 @@ const TableHeaderCell = ({
id={`column_${index + 1}`}
data-enable={enable}
data-min-width={minWidth}
data-default-size={defaultSize}
onClick={onClick}
>
<div className="table-container_header-item">
@ -73,6 +75,7 @@ TableHeaderCell.propTypes = {
resizable: PropTypes.bool,
sorted: PropTypes.bool,
sortBy: PropTypes.string,
defaultSize: PropTypes.number,
};
export default TableHeaderCell;

View File

@ -58,7 +58,7 @@ const StyledTreeMenu = styled(Tree)`
`}
& .rc-tree-node-selected .rc-tree-title {
${(props) => !props.isFullFillSelection && "width: 85%;"}
${(props) => !props.isFullFillSelection && "width: calc(100% - 26px);"}
}
&:not(.rc-tree-show-line) .rc-tree-switcher-noop {

View File

@ -121,7 +121,7 @@ const TreeNodeMenu = styled(TreeNode)`
${NoUserSelect}
.rc-tree-node-selected {
max-width: ${(props) => (props.newItems > 999 ? "71%" : "98%")} !important;
max-width: ${(props) => (props.newItems > 999 ? "71%" : "102%")} !important;
}
${(props) =>

View File

@ -0,0 +1,15 @@
# @appserver/browserslist-config
Shared browserslist config for AppServer
## Usage
### package.json
```json
{
"browserslist": [
"extends @appserver/browserslist-config"
]
}
```

View File

@ -0,0 +1,7 @@
module.exports = [
'>0.25%',
'not ie 11',
'not op_mini all',
'not dead',
'Firefox ESR',
];

View File

@ -0,0 +1,13 @@
{
"name": "@appserver/browserslist-config-asc",
"version": "1.0.0",
"description": "Shared browserslist for AppServer libraries and apps",
"main": "browserlist.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"appserver",
"browserslist"
]
}

View File

@ -11,6 +11,9 @@
"start": "webpack-cli serve",
"start-prod": "webpack --mode production && serve dist -p 5014"
},
"browserslist": [
"extends @appserver/browserslist-config-asc"
],
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/plugin-proposal-class-properties": "^7.14.5",

View File

@ -11,14 +11,14 @@
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="shortcut icon" href="favicon.ico" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="manifest" href="manifest.json" />
<link rel="manifest" href="/manifest.json" />
<!-- Tell the browser it's a PWA -->
<meta name="mobile-web-app-capable" content="yes" />
<!-- Tell iOS it's a PWA -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="appIcon.png" />
<link rel="apple-touch-icon" href="/appIcon.png" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.

View File

@ -1,15 +0,0 @@
{
"short_name": "ASC.People",
"name": "ASC.People",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -11,6 +11,9 @@
"start": "webpack-cli serve",
"start-prod": "webpack --mode production && serve dist -p 5017"
},
"browserslist": [
"extends @appserver/browserslist-config-asc"
],
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/plugin-proposal-class-properties": "^7.14.5",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -11,14 +11,14 @@
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="shortcut icon" href="favicon.ico" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="manifest" href="manifest.json" />
<link rel="manifest" href="/manifest.json" />
<!-- Tell the browser it's a PWA -->
<meta name="mobile-web-app-capable" content="yes" />
<!-- Tell iOS it's a PWA -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="appIcon.png" />
<link rel="apple-touch-icon" href="/appIcon.png" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.

View File

@ -1,15 +0,0 @@
{
"short_name": "ASC.Calendar",
"name": "ASC.Calendar",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -11,6 +11,9 @@
"start": "webpack-cli serve",
"start-prod": "webpack --mode production && serve dist -p 5008"
},
"browserslist": [
"extends @appserver/browserslist-config-asc"
],
"dependencies": {
"copy-to-clipboard": "^3.3.1"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -0,0 +1,4 @@
<svg width="95" height="40" viewBox="0 0 95 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.4231 26.1438C17.0561 26.72 16.3487 27.192 15.6413 27.192C14.5934 27.192 14.0958 26.1958 14.0958 24.6755C14.0958 22.9725 14.6454 21.8458 17.1867 21.8458H17.4231V26.1438ZM19.4396 25.7503V19.5393C19.4396 16.3424 18.1561 15.3463 15.8248 15.3463C14.4884 15.3463 13.2835 15.8968 12.681 16.3945L13.0735 18.2033C13.7554 17.5998 14.6454 17.0501 15.6934 17.0501C16.8462 17.0501 17.4231 17.7834 17.4231 19.5136V20.299H17.1338C13.4405 20.299 12 22.0814 12 24.912C12 27.5062 13.2835 28.9215 15.1694 28.9215C16.3223 28.9215 17.0561 28.4238 17.6322 27.6897H17.7636C17.7892 28.0303 17.8685 28.4502 17.947 28.7379H19.676C19.5189 27.7498 19.4402 26.7508 19.4404 25.7503H19.4396ZM24.0247 18.4918C24.4957 17.8363 25.2296 17.1807 26.0941 17.1807C26.88 17.1807 27.3255 17.5213 27.3255 18.5175V28.7379H29.3957V18.3339C29.3957 16.3168 28.4783 15.3463 26.7494 15.3463C25.518 15.3463 24.5222 16.1589 24.1561 16.6566H24.0247V15.5033H21.9809V28.7379H24.0247V18.491V18.4918ZM35.4213 28.9215C36.4956 28.9215 37.2287 28.4238 37.8047 27.6897H37.9361L38.0931 28.7379H39.6129V10H37.5692V15.8448C37.1758 15.5554 36.5212 15.3463 35.8923 15.3463C33.2461 15.3463 31.413 17.7313 31.413 22.6319C31.413 26.72 32.8271 28.9215 35.4213 28.9215ZM37.5692 26.1694C37.2287 26.6935 36.6783 27.192 35.6568 27.192C34.1634 27.192 33.5874 25.3047 33.5874 22.2128C33.5874 19.5136 34.3725 17.0236 36.0237 17.0236C36.7047 17.0236 37.1502 17.2336 37.5692 17.6519V26.1694ZM49.2269 27.8476L48.7558 26.2744C48.2319 26.6414 47.393 27.1656 46.241 27.1656C44.6162 27.1656 43.7782 25.5932 43.7782 22.6055H49.2798V21.4795C49.2798 16.9988 47.8385 15.3471 45.6385 15.3471C42.8352 15.3471 41.6559 18.4389 41.6559 22.6849C41.6559 26.7472 43.3327 28.9223 46.0575 28.9223C47.3674 28.9223 48.3889 28.5032 49.2269 27.8476ZM45.6385 17.0236C46.817 17.0236 47.1839 18.6745 47.1839 20.9281H43.8038C43.9352 18.5696 44.3807 17.0236 45.6385 17.0236ZM56.169 15.5298L54.3616 20.3255L52.6591 15.5306H50.536L53.0252 21.8978L50.2748 28.7379H52.2922L54.2839 23.2867L56.326 28.7379H58.4499L55.6987 21.7143L58.1615 15.5306H56.1698L56.169 15.5298ZM64.3697 28.7379H66.2821C70.4217 28.7379 73.2242 25.017 73.2242 18.6745C73.2242 12.1759 70.2647 10 66.5705 10H64.3697V28.7379ZM66.5705 11.0747C69.5044 11.0747 71.8887 12.9877 71.8887 18.7795C71.8887 24.5185 69.6358 27.6632 66.3086 27.6632H65.6796V11.0747H66.5705ZM76.2374 12.9348C76.6828 12.9348 77.0762 12.5686 77.0762 12.0965C77.0762 11.6517 76.6828 11.2318 76.2374 11.2318C75.7663 11.2318 75.3994 11.6517 75.3994 12.0965C75.3994 12.5686 75.7663 12.9356 76.2374 12.9356V12.9348ZM75.6093 15.5306V28.7379H76.8407V15.5298H75.6093V15.5306ZM81.5299 29C83.2588 29 84.7522 27.7947 84.7522 25.6982C84.7522 22.0028 80.1671 20.9025 80.1671 18.0454C80.1671 16.893 81.0315 16.2639 82.0018 16.2639C82.9183 16.2639 83.5728 16.6045 84.1497 17.2336L84.4902 16.1068C84.0439 15.7398 83.2323 15.2677 81.9489 15.2677C80.5076 15.2677 79.0671 16.211 79.0671 18.2025C79.0671 21.5572 83.5993 22.8411 83.5993 25.8552C83.5993 26.982 82.8133 28.0047 81.5034 28.0047C80.2456 28.0047 79.6167 27.5582 78.9886 27.0085L78.7266 28.0832C79.2241 28.5023 80.0621 29 81.5299 29ZM88.0794 21.8987L92.6637 28.7379H94L89.3364 21.6622L93.6851 15.5298H92.5066L88.0794 21.7408V10H86.848V28.7379H88.0794V21.8978V21.8987Z" fill="black"/>
<path d="M7.88083 29V22.2662L13 8H10.8259L6.83547 19.3913L3.36683 9.96893H1L5.70588 22.1856V29H7.88083Z" fill="#FF0000"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -11,14 +11,14 @@
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link id="favicon" rel="shortcut icon" href="favicon.ico" />
<link id="favicon" rel="shortcut icon" href="/favicon.ico" />
<link rel="manifest" href="manifest.json" />
<link rel="manifest" href="/manifest.json" />
<!-- Tell the browser it's a PWA -->
<meta name="mobile-web-app-capable" content="yes" />
<!-- Tell iOS it's a PWA -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="appIcon.png" />
<link rel="apple-touch-icon" href="/appIcon.png" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.

View File

@ -11,7 +11,7 @@
"EncryptedFileSaving": "Die verschlüsselte Datei wird gespeichert",
"Files": "Dateien",
"Folders": "Ordner",
"LinkCopySuccess": "Der Link wurde in die Zwischenablage kopiert",
"LinkCopySuccess": "Link kopiert",
"Move": "Verschieben",
"MoveToOperation": "Wird verschoben",
"OwnerChange": "Besitzer ändern",

View File

@ -12,7 +12,7 @@
"EncryptedFileSaving": "Saving encrypted file",
"Files": "Files",
"Folders": "Folders",
"LinkCopySuccess": "Link has been copied to the clipboard",
"LinkCopySuccess": "Link copied",
"Move": "Move",
"MoveToOperation": "Moving",
"OwnerChange": "Change owner",

View File

@ -12,7 +12,7 @@
"EncryptedFileSaving": "Сохранение зашифрованного файла",
"Files": "Файлы",
"Folders": "Папки",
"LinkCopySuccess": "Ссылка скопирована в буфер обмена",
"LinkCopySuccess": "Ссылка скопирована",
"Move": "Переместить",
"MoveToOperation": "Перемещение",
"OwnerChange": "Сменить владельца",

View File

@ -1,15 +0,0 @@
{
"short_name": "ASC.Files",
"name": "ASC.Files",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

View File

@ -92,9 +92,10 @@ class FilesContent extends React.Component {
encryptionKeys,
setEncryptionKeys,
isLoaded,
isDesktop,
} = this.props;
//console.log("componentDidUpdate: ", this.props);
if (isAuthenticated && !this.isDesktopInit && isEncryption && isLoaded) {
if (isAuthenticated && !this.isDesktopInit && isDesktop && isLoaded) {
this.isDesktopInit = true;
regDesktop(
user,

View File

@ -5,7 +5,7 @@ import {
ShareAccessRights,
AppServerConfig,
} from "@appserver/common/constants";
import toastr from "studio/toastr";
import toastr from "@appserver/components/toast/toastr";
import { combineUrl } from "@appserver/common/utils";
import { getFileConversationProgress } from "@appserver/common/api/files";

View File

@ -169,12 +169,10 @@ export default function withContent(WrappedContent) {
encryptedFile,
true,
false
).then(() =>
openDocEditor(file.id, file.providerKey, tab, file.webUrl)
);
).then(() => openDocEditor(file.id, file.providerKey, tab));
});
}
return openDocEditor(file.id, file.providerKey, tab, file.webUrl);
return openDocEditor(file.id, file.providerKey, tab);
})
.then(() => this.completeAction(itemId))
.catch((e) => toastr.error(e))
@ -235,8 +233,17 @@ export default function withContent(WrappedContent) {
onFilesClick,
viewAs,
element,
isDesktop,
} = this.props;
const { id, fileExst, updated, createdBy, access, fileStatus } = item;
const {
id,
fileExst,
updated,
createdBy,
access,
fileStatus,
href,
} = item;
const titleWithoutExt = getTitleWithoutExst(item);
@ -261,6 +268,10 @@ export default function withContent(WrappedContent) {
? { noHover: true }
: { onClick: onFilesClick };
if (!isDesktop && !isTrashFolder) {
linkStyles.href = item.href;
}
const newItems = item.new || fileStatus === 2;
const showNew = !!newItems;

Some files were not shown because too many files have changed in this diff Show More