merge from develop
This commit is contained in:
commit
8816e535c1
14
ASC.Web.sln
14
ASC.Web.sln
@ -79,7 +79,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Data.Encryption", "comm
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Projects", "products\ASC.Projects\Server\ASC.Projects.csproj", "{D1A33923-5680-4B86-A7DA-41E78350D997}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASC.CRM", "products\ASC.CRM\Server\ASC.CRM.csproj", "{277F4A2C-07CC-4BC5-B4F3-9695BB2DFFB9}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.CRM", "products\ASC.CRM\Server\ASC.CRM.csproj", "{277F4A2C-07CC-4BC5-B4F3-9695BB2DFFB9}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Mail", "products\ASC.Mail\Server\ASC.Mail.csproj", "{137CA67B-D0F5-4746-B8BC-1888D2859B90}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Calendar", "products\ASC.Calendar\Server\ASC.Calendar.csproj", "{F39933F8-7598-492F-9DD3-E25780D68288}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -227,6 +231,14 @@ Global
|
||||
{277F4A2C-07CC-4BC5-B4F3-9695BB2DFFB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{277F4A2C-07CC-4BC5-B4F3-9695BB2DFFB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{277F4A2C-07CC-4BC5-B4F3-9695BB2DFFB9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{137CA67B-D0F5-4746-B8BC-1888D2859B90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{137CA67B-D0F5-4746-B8BC-1888D2859B90}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{137CA67B-D0F5-4746-B8BC-1888D2859B90}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{137CA67B-D0F5-4746-B8BC-1888D2859B90}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F39933F8-7598-492F-9DD3-E25780D68288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F39933F8-7598-492F-9DD3-E25780D68288}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F39933F8-7598-492F-9DD3-E25780D68288}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F39933F8-7598-492F-9DD3-E25780D68288}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
55
build/install/common/build-backend.sh
Normal file
55
build/install/common/build-backend.sh
Normal file
@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC_PATH="/AppServer"
|
||||
ARGS=""
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
case $1 in
|
||||
|
||||
-sp | --srcpath )
|
||||
if [ "$2" != "" ]; then
|
||||
SRC_PATH=$2
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
|
||||
-ar | --arguments )
|
||||
if [ "$2" != "" ]; then
|
||||
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 " -ar, --arguments additional arguments publish the .NET runtime with your application"
|
||||
echo " -?, -h, --help this help"
|
||||
echo " Examples"
|
||||
echo " bash build-backend.sh -sp /app/AppServer"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "Unknown parameter $1" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
echo "== BACK-END-BUILD =="
|
||||
|
||||
cd ${SRC_PATH}
|
||||
dotnet restore ASC.Web.sln --configfile .nuget/NuGet.Config ${ARGS}
|
||||
dotnet build ASC.Web.sln ${ARGS}
|
||||
|
||||
echo "== Build ASC.Thumbnails =="
|
||||
yarn install --cwd common/ASC.Thumbnails --frozen-lockfile
|
||||
|
||||
echo "== Build ASC.UrlShortener =="
|
||||
yarn install --cwd common/ASC.UrlShortener --frozen-lockfile
|
||||
|
||||
echo "== Build ASC.Socket.IO =="
|
||||
yarn install --cwd common/ASC.Socket.IO --frozen-lockfile
|
37
build/install/common/build-frontend.sh
Normal file
37
build/install/common/build-frontend.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC_PATH="/AppServer"
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
case $1 in
|
||||
|
||||
-sp | --srcpath )
|
||||
if [ "$2" != "" ]; then
|
||||
SRC_PATH=$2
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
|
||||
-? | -h | --help )
|
||||
echo " Usage: bash build-backend.sh [PARAMETER] [[PARAMETER], ...]"
|
||||
echo " Parameters:"
|
||||
echo " -sp, --srcpath path to AppServer root directory"
|
||||
echo " -?, -h, --help this help"
|
||||
echo " Examples"
|
||||
echo " bash build-backend.sh -sp /app/AppServer"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "Unknown parameter $1" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
echo "== FRONT-END-BUILD =="
|
||||
|
||||
cd ${SRC_PATH}
|
||||
yarn install
|
||||
yarn build
|
108
build/install/common/publish-backend.sh
Normal file
108
build/install/common/publish-backend.sh
Normal file
@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC_PATH="/AppServer"
|
||||
BUILD_PATH="/publish"
|
||||
SELF_CONTAINED="false"
|
||||
ARGS=""
|
||||
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
case $1 in
|
||||
|
||||
-sp | --srcpath )
|
||||
if [ "$2" != "" ]; then
|
||||
SRC_PATH=$2
|
||||
BUILD_PATH=${SRC_PATH}/publish
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-bp | --buildpath )
|
||||
if [ "$2" != "" ]; then
|
||||
BUILD_PATH=$2
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-sc | --self-contained )
|
||||
if [ "$2" != "" ]; then
|
||||
SELF_CONTAINED=$2
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-ar | --arguments )
|
||||
if [ "$2" != "" ]; then
|
||||
ARGS=$2
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-? | -h | --help )
|
||||
echo " Usage: bash publish-backend.sh [PARAMETER] [[PARAMETER], ...]"
|
||||
echo " Parameters:"
|
||||
echo " -sp, --srcpath path to AppServer root directory (by default=/AppServer)"
|
||||
echo " -bp, --buildpath path where generated output is placed (by default=/publish)"
|
||||
echo " -sc, --self-contained publish the .NET runtime with your application (by default=false)"
|
||||
echo " -ar, --arguments additional arguments publish the .NET runtime with your application"
|
||||
echo " -?, -h, --help this help"
|
||||
echo " Examples"
|
||||
echo " bash publish-backend.sh -sp /app/AppServer"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
* )
|
||||
echo "Unknown parameter $1" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Array of names server in directory products
|
||||
servers_products_name_backend=(ASC.CRM)
|
||||
servers_products_name_backend+=(ASC.Files)
|
||||
servers_products_name_backend+=(ASC.People)
|
||||
servers_products_name_backend+=(ASC.Projects)
|
||||
servers_products_name_backend+=(ASC.Calendar)
|
||||
servers_products_name_backend+=(ASC.Mail)
|
||||
|
||||
# Publish server backend products
|
||||
for i in ${!servers_products_name_backend[@]}; do
|
||||
echo "== Publish ${servers_products_name_backend[$i]}.csproj project =="
|
||||
SERVICE_DIR="$(dirname "$(find ${SRC_PATH} -type f -name "${servers_products_name_backend[$i]}".csproj)")"
|
||||
cd ${SERVICE_DIR}
|
||||
dotnet publish -c Release --self-contained ${SELF_CONTAINED} ${ARGS} -o ${BUILD_PATH}/products/${servers_products_name_backend[$i]}/server/
|
||||
done
|
||||
|
||||
# Array of names backend services
|
||||
services_name_backend=(ASC.ApiSystem)
|
||||
services_name_backend+=(ASC.Data.Backup)
|
||||
services_name_backend+=(ASC.Data.Storage.Encryption)
|
||||
services_name_backend+=(ASC.Files.Service)
|
||||
services_name_backend+=(ASC.Data.Storage.Migration)
|
||||
services_name_backend+=(ASC.Notify)
|
||||
services_name_backend+=(ASC.Socket.IO.Svc)
|
||||
services_name_backend+=(ASC.Studio.Notify)
|
||||
services_name_backend+=(ASC.TelegramService)
|
||||
services_name_backend+=(ASC.Thumbnails.Svc)
|
||||
services_name_backend+=(ASC.UrlShortener.Svc)
|
||||
services_name_backend+=(ASC.Web.Api)
|
||||
services_name_backend+=(ASC.Web.Studio)
|
||||
|
||||
# Publish backend services
|
||||
for i in ${!services_name_backend[@]}; do
|
||||
echo "== Publish ${services_name_backend[$i]}.csproj project =="
|
||||
SERVICE_DIR="$(dirname "$(find ${SRC_PATH} -type f -name "${services_name_backend[$i]}".csproj)")"
|
||||
cd ${SERVICE_DIR}
|
||||
dotnet publish -c Release --self-contained ${SELF_CONTAINED} ${ARGS} -o ${BUILD_PATH}/services/${services_name_backend[$i]}/service/
|
||||
done
|
||||
|
||||
# Array of names backend services in directory common (Nodejs)
|
||||
services_name_frontend=(ASC.Thumbnails)
|
||||
services_name_frontend+=(ASC.UrlShortener)
|
||||
services_name_frontend+=(ASC.Socket.IO)
|
||||
|
||||
# Publish backend services (Nodejs)
|
||||
for i in ${!services_name_frontend[@]}; do
|
||||
echo "== Publish ${services_name_frontend[$i]} project =="
|
||||
SERVICE_DIR="$(find ${SRC_PATH} -type d -name ${services_name_frontend[$i]})"
|
||||
cd ${SERVICE_DIR}
|
||||
mkdir -p ${BUILD_PATH}/services/${services_name_frontend[$i]}/service/ && cp -arfv ./* ${BUILD_PATH}/services/${services_name_frontend[$i]}/service/
|
||||
done
|
@ -2,11 +2,12 @@
|
||||
PRODUCT=onlyoffice
|
||||
REPO=${PRODUCT}
|
||||
STATUS=""
|
||||
SRV_VERSION=0.0.0
|
||||
SRV_VERSION=latest
|
||||
MYSQL_VERSION=8.0.18
|
||||
ELK_VERSION=7.8.1
|
||||
SERVICE_PORT=5050
|
||||
CONTAINER_PREFIX=${PRODUCT}-
|
||||
DOCKERFILE=Dockerfile-app
|
||||
|
||||
# zookeeper #
|
||||
ZOO_PORT=2181
|
||||
@ -34,7 +35,6 @@
|
||||
DOCUMENT_SERVER_JWT_SECRET=your_jwt_secret
|
||||
DOCUMENT_SERVER_JWT_HEADER=AuthorizationJwt
|
||||
DOCUMENT_SERVER_URL_PUBLIC=/ds-vpath/
|
||||
DOCUMENT_SERVER_URL_CONVERTER=/ds-vpath/ConvertService.ashx
|
||||
DOCUMENT_SERVER_HOST=${CONTAINER_PREFIX}document-server
|
||||
DOCUMENT_SERVER_URL_INTERNAL=http://${DOCUMENT_SERVER_HOST}/
|
||||
|
||||
@ -45,31 +45,46 @@
|
||||
MYSQL_HOST=${CONTAINER_PREFIX}mysql-server
|
||||
|
||||
# service host #
|
||||
API_HOST=${CONTAINER_PREFIX}api
|
||||
API_SYSTEM_HOST=${CONTAINER_PREFIX}api_system
|
||||
URLSHORTENER_HOST=${CONTAINER_PREFIX}urlshortener
|
||||
STUDIO_NOTIFY_HOST=${CONTAINER_PREFIX}studio.notify
|
||||
NOTIFY_HOST=${CONTAINER_PREFIX}notify
|
||||
PEOPLE_SERVER_HOST=${CONTAINER_PREFIX}people.server
|
||||
FILES_HOST=${CONTAINER_PREFIX}files
|
||||
FILES_SERVICES_HOST=${CONTAINER_PREFIX}files_services
|
||||
STUDIO_HOST=${CONTAINER_PREFIX}studio
|
||||
API_SYSTEM_HOST=${CONTAINER_PREFIX}api-system
|
||||
BACKUP_HOST=${CONTAINER_PREFIX}backup
|
||||
THUMBNAILS_HOST=${CONTAINER_PREFIX}thumbnails
|
||||
CALENDAR_HOST=${CONTAINER_PREFIX}calendar
|
||||
CRM_HOST=${CONTAINER_PREFIX}crm
|
||||
STORAGE_ENCRYPTION_HOST=${CONTAINER_PREFIX}storage-encryption
|
||||
FILES_HOST=${CONTAINER_PREFIX}files
|
||||
FILES_SERVICES_HOST=${CONTAINER_PREFIX}files-services
|
||||
MAIL_HOST=${CONTAINER_PREFIX}mail
|
||||
STORAGE_MIGRATION_HOST=${CONTAINER_PREFIX}storage-migration
|
||||
NOTIFY_HOST=${CONTAINER_PREFIX}notify
|
||||
PEOPLE_SERVER_HOST=${CONTAINER_PREFIX}people-server
|
||||
PROJECTS_SERVER_HOST=${CONTAINER_PREFIX}projects-server
|
||||
SOCKET_HOST=${CONTAINER_PREFIX}socket
|
||||
STUDIO_NOTIFY_HOST=${CONTAINER_PREFIX}studio-notify
|
||||
TELEGRAM_SERVICE_HOST=${CONTAINER_PREFIX}telegram-service
|
||||
THUMBNAILS_HOST=${CONTAINER_PREFIX}thumbnails
|
||||
URLSHORTENER_HOST=${CONTAINER_PREFIX}urlshortener
|
||||
API_HOST=${CONTAINER_PREFIX}api
|
||||
STUDIO_HOST=${CONTAINER_PREFIX}studio
|
||||
PROXY_HOST=${CONTAINER_PREFIX}proxy
|
||||
|
||||
# proxy upstream environment #
|
||||
SERVICE_API=${API_HOST}:${SERVICE_PORT}
|
||||
SERVICE_API_SYSTEM=${API_SYSTEM_HOST}:${SERVICE_PORT}
|
||||
SERVICE_URLSHORTENER=${URLSHORTENER_HOST}:${SERVICE_PORT}
|
||||
SERVICE_STUDIO_NOTIFY=${STUDIO_NOTIFY_HOST}:${SERVICE_PORT}
|
||||
SERVICE_PEOPLE_SERVER=${PEOPLE_SERVER_HOST}:${SERVICE_PORT}
|
||||
SERVICE_BACKUP=${BACKUP_HOST}:${SERVICE_PORT}
|
||||
SERVICE_CRM=${CRM_HOST}:${SERVICE_PORT}
|
||||
SERVICE_CALENDAR=${CALENDAR_HOST}:${SERVICE_PORT}
|
||||
SERVICE_STORAGE_ENCRYPTION=${STORAGE_ENCRYPTION_HOST}:${SERVICE_PORT}
|
||||
SERVICE_FILES=${FILES_HOST}:${SERVICE_PORT}
|
||||
SERVICE_FILES_SERVICES=${FILES_SERVICES_HOST}:${SERVICE_PORT}
|
||||
SERVICE_MAIL=${MAIL_HOST}:${SERVICE_PORT}
|
||||
SERVICE_STORAGE_MIGRATION=${STORAGE_MIGRATION_HOST}:${SERVICE_PORT}
|
||||
SERVICE_NOTIFY=${NOTIFY_HOST}:${SERVICE_PORT}
|
||||
SERVICE_PEOPLE_SERVER=${PEOPLE_SERVER_HOST}:${SERVICE_PORT}
|
||||
SERVICE_PROJECTS_SERVER=${PROJECTS_SERVER_HOST}:${SERVICE_PORT}
|
||||
SERVICE_SOCKET=${SOCKET_HOST}:9899
|
||||
SERVICE_STUDIO_NOTIFY=${STUDIO_NOTIFY_HOST}:${SERVICE_PORT}
|
||||
SERVICE_TELEGRAM_SERVICE=${TELEGRAM_SERVICE_HOST}:${SERVICE_PORT}
|
||||
SERVICE_THUMBNAILS=${THUMBNAILS_HOST}:9800
|
||||
SERVICE_URLSHORTENER=${URLSHORTENER_HOST}:9999
|
||||
SERVICE_API=${API_HOST}:${SERVICE_PORT}
|
||||
SERVICE_STUDIO=${STUDIO_HOST}:${SERVICE_PORT}
|
||||
SERVICE_BACKUP=${BACKUP_HOST}:${SERVICE_PORT}
|
||||
SERVICE_THUMBNAILS=${THUMBNAILS_HOST}:${SERVICE_PORT}
|
||||
SERVICE_SH=${URLSHORTENER_HOST}:9999
|
||||
|
||||
|
||||
NETWORK_NAME=${PRODUCT}
|
||||
|
@ -1,13 +1,17 @@
|
||||
### STAGE 1: Develop ######
|
||||
FROM ubuntu:18.04 AS develop
|
||||
### STAGE 1: Base image ######
|
||||
ARG SRC_PATH=/app/onlyoffice/src
|
||||
ARG BUILD_PATH=/var/www
|
||||
ARG REPO_TAG=5.0.202-focal-amd64
|
||||
ARG REPO=mcr.microsoft.com/dotnet/sdk
|
||||
|
||||
FROM $REPO:$REPO_TAG AS base
|
||||
ARG RELEASE_DATE="2016-06-21"
|
||||
ARG VERSION="8.9.0.190"
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GIT_BRANCH="master"
|
||||
ARG GIT_BRANCH=master
|
||||
ARG SRC_PATH
|
||||
ARG BUILD_PATH
|
||||
|
||||
LABEL onlyoffice.appserver.release-date="${RELEASE_DATE}" \
|
||||
onlyoffice.appserver.version="${VERSION}" \
|
||||
maintainer="Ascensio System SIA <support@onlyoffice.com>"
|
||||
|
||||
ENV LANG=en_US.UTF-8 \
|
||||
@ -23,344 +27,278 @@ RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
adduser -uid 104 --quiet --home /var/www/onlyoffice --system --gid 107 onlyoffice && \
|
||||
locale-gen en_US.UTF-8 && \
|
||||
apt-get -y update && \
|
||||
apt-get install -yq software-properties-common wget curl && \
|
||||
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && \
|
||||
apt-get install -y nodejs && \
|
||||
curl -sS 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 && \
|
||||
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
|
||||
dpkg -i packages-microsoft-prod.deb && \
|
||||
apt-get -y update && \
|
||||
cd ~ && \
|
||||
echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
|
||||
apt-get install -yq git \
|
||||
yarn \
|
||||
dotnet-sdk-3.1
|
||||
apt-get install -yq git apt-utils npm nodejs && \
|
||||
npm install --global yarn
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
git clone --depth 1 -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/AppServer.git /app/onlyoffice/src/
|
||||
echo ${GIT_BRANCH} && \
|
||||
git clone --depth 1 -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/AppServer.git ${SRC_PATH}
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
cd /app/onlyoffice/src/ && \
|
||||
yarn install --cwd web/ASC.Web.Components --frozen-lockfile > build/ASC.Web.Components.log && \
|
||||
yarn pack --cwd web/ASC.Web.Components
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
cd /app/onlyoffice/src/ && \
|
||||
component=$(ls web/ASC.Web.Components/asc-web-components-v1.*.tgz) && \
|
||||
yarn remove asc-web-components --cwd web/ASC.Web.Common --peer && \
|
||||
yarn add file:../../$component --cwd web/ASC.Web.Common --cache-folder ../../yarn --peer && \
|
||||
yarn install --cwd web/ASC.Web.Common --frozen-lockfile > build/ASC.Web.Common.log && \
|
||||
yarn pack --cwd web/ASC.Web.Common
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
cd /app/onlyoffice/src/ && \
|
||||
npm run build:storybook --prefix web/ASC.Web.Components && \
|
||||
mkdir -p /var/www/story/ && \
|
||||
cp -Rf web/ASC.Web.Components/storybook-static/* /var/www/story/
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
cd /app/onlyoffice/src/ && \
|
||||
component=$(ls web/ASC.Web.Components/asc-web-components-v1.*.tgz) && \
|
||||
common=$(ls web/ASC.Web.Common/asc-web-common-v1.*.tgz) && \
|
||||
yarn remove asc-web-components asc-web-common --cwd web/ASC.Web.Client && \
|
||||
yarn add ../../$component --cwd web/ASC.Web.Client --cache-folder ../../yarn && \
|
||||
yarn add ../../$common --cwd web/ASC.Web.Client --cache-folder ../../yarn && \
|
||||
yarn install --cwd web/ASC.Web.Client --frozen-lockfile || (cd web/ASC.Web.Client && npm i && cd ../../) && \
|
||||
npm run build --prefix web/ASC.Web.Client && \
|
||||
rm -rf /var/www/studio/client/* && \
|
||||
mkdir -p /var/www/studio/client && \
|
||||
cp -rf web/ASC.Web.Client/build/* /var/www/studio/client
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
cd /app/onlyoffice/src/ && \
|
||||
component=$(ls web/ASC.Web.Components/asc-web-components-v1.*.tgz) && \
|
||||
common=$(ls web/ASC.Web.Common/asc-web-common-v1.*.tgz) && \
|
||||
yarn remove asc-web-components asc-web-common --cwd products/ASC.Files/Client && \
|
||||
yarn add ../../../$component --cwd products/ASC.Files/Client --cache-folder ../../../yarn && \
|
||||
yarn add ../../../$common --cwd products/ASC.Files/Client --cache-folder ../../../yarn && \
|
||||
yarn install --cwd products/ASC.Files/Client --frozen-lockfile || (cd products/ASC.Files/Client && npm i && cd ../../../) && \
|
||||
npm run build --prefix products/ASC.Files/Client && \
|
||||
mkdir -p /var/www/products/ASC.Files/client && \
|
||||
cp -Rf products/ASC.Files/Client/build/* /var/www/products/ASC.Files/client && \
|
||||
mkdir -p /var/www/products/ASC.Files/client/products/files
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
cd /app/onlyoffice/src/ && \
|
||||
component=$(ls web/ASC.Web.Components/asc-web-components-v1.*.tgz) && \
|
||||
common=$(ls web/ASC.Web.Common/asc-web-common-v1.*.tgz) && \
|
||||
yarn remove asc-web-components asc-web-common --cwd products/ASC.People/Client && \
|
||||
yarn add ../../../$component --cwd products/ASC.People/Client --cache-folder ../../../yarn && \
|
||||
yarn add ../../../$common --cwd products/ASC.People/Client --cache-folder ../../../yarn && \
|
||||
yarn install --cwd products/ASC.People/Client --frozen-lockfile || (cd products/ASC.People/Client && npm i && cd ../../../) && \
|
||||
npm run build --prefix products/ASC.People/Client && \
|
||||
mkdir -p /var/www/products/ASC.People/client && \
|
||||
cp -Rf products/ASC.People/Client/build/* /var/www/products/ASC.People/client && \
|
||||
mkdir -p /var/www/products/ASC.People/client/products/people
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
cd /app/onlyoffice/src/ && \
|
||||
#rm -f /etc/nginx/conf.d/* && \
|
||||
mkdir -p /etc/nginx/conf.d/ && \
|
||||
mkdir -p /var/www/public/ && cp -f public/* /var/www/public/ && \
|
||||
cd ${SRC_PATH} && \
|
||||
mkdir -p /var/www/public/ && cp -rf public/* /var/www/public/ && \
|
||||
mkdir -p /app/onlyoffice/config/ && cp -rf config/* /app/onlyoffice/config/ && \
|
||||
cp -f config/nginx/onlyoffice*.conf /etc/nginx/conf.d/ && \
|
||||
mkdir -p /etc/nginx/conf.d && cp -f config/nginx/onlyoffice*.conf /etc/nginx/conf.d/ && \
|
||||
mkdir -p /etc/nginx/includes/ && cp -f config/nginx/includes/onlyoffice*.conf /etc/nginx/includes/ && \
|
||||
sed -e 's/#//' -i /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
dotnet restore ASC.Web.sln --configfile .nuget/NuGet.Config && \
|
||||
dotnet build -r linux-x64 ASC.Web.sln && \
|
||||
cd products/ASC.People/Server && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/products/ASC.People/server && \
|
||||
cd ../../../ && \
|
||||
cd products/ASC.Files/Server && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/products/ASC.Files/server && \
|
||||
cp -avrf DocStore /var/www/products/ASC.Files/server/ && \
|
||||
cd ../../../ && \
|
||||
cd products/ASC.Files/Service && \
|
||||
dotnet add ASC.Files.Service.csproj reference ../../ASC.People/Server/ASC.People.csproj ../Server/ASC.Files.csproj && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/products/ASC.Files/service && \
|
||||
cd ../../../ && \
|
||||
cd web/ASC.Web.Api && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/studio/api && \
|
||||
cd ../../ && \
|
||||
cd web/ASC.Web.Studio && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/studio/server && \
|
||||
cd ../../ && \
|
||||
cd common/services/ASC.Data.Backup && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/services/backup && \
|
||||
cd ../../../ && \
|
||||
cd common/services/ASC.Notify && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/services/notify && \
|
||||
cd ../../../ && \
|
||||
cd common/services/ASC.ApiSystem && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/services/apisystem && \
|
||||
cd ../../../ && \
|
||||
cd common/services/ASC.Thumbnails.Svc && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /services/thumb/service && \
|
||||
cd ../../../ && \
|
||||
yarn install --cwd common/ASC.Thumbnails --frozen-lockfile && \
|
||||
mkdir -p /var/www/services/thumb/client && cp -Rf common/ASC.Thumbnails/* /var/www/services/thumb/client && \
|
||||
|
||||
cd common/services/ASC.UrlShortener.Svc && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /services/urlshortener/service && \
|
||||
cd ../../../ && \
|
||||
yarn install --cwd common/ASC.UrlShortener --frozen-lockfile && \
|
||||
mkdir -p /var/www/services/urlshortener/client && cp -Rf common/ASC.UrlShortener/* /var/www/services/urlshortener/client && \
|
||||
|
||||
cd common/services/ASC.Socket.IO.Svc && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /services/socket/service && \
|
||||
cd ../../../ && \
|
||||
yarn install --cwd common/ASC.Socket.IO --frozen-lockfile && \
|
||||
mkdir -p /var/www/services/socket/client && cp -Rf common/ASC.Socket.IO/* /var/www/services/socket/client && \
|
||||
|
||||
cd common/services/ASC.Studio.Notify && \
|
||||
dotnet add ASC.Studio.Notify.csproj reference ../../../products/ASC.People/Server/ASC.People.csproj ../../../products/ASC.Files/Server/ASC.Files.csproj && \
|
||||
dotnet -d publish --no-build --self-contained -r linux-x64 -o /var/www/services/studio.notify
|
||||
cd ${SRC_PATH}/build/install/common/ && \
|
||||
bash build-frontend.sh -sp ${SRC_PATH} && \
|
||||
bash build-backend.sh -sp ${SRC_PATH} -ar "--disable-parallel" && \
|
||||
bash publish-backend.sh -sp ${SRC_PATH} -bp ${BUILD_PATH} -ar "--disable-parallel"
|
||||
|
||||
COPY config/mysql/conf.d/mysql.cnf /etc/mysql/conf.d/mysql.cnf
|
||||
COPY config/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
RUN sed -i 's/Server=.*;Port=/Server=127.0.0.1;Port=/' /app/onlyoffice/config/appsettings.test.json
|
||||
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
|
||||
### STAGE 2: Build ###
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0.4-focal-amd64 as builder
|
||||
ARG BUILD_PATH
|
||||
ENV BUILD_PATH=${BUILD_PATH}
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 as builder
|
||||
|
||||
COPY --from=develop /app/onlyoffice/config/ /app/onlyoffice/config/
|
||||
COPY --from=base /app/onlyoffice/config/*.json /app/onlyoffice/config/
|
||||
COPY --from=base /app/onlyoffice/config/*.config /app/onlyoffice/config/
|
||||
|
||||
# add defualt user and group for no-root run
|
||||
RUN mkdir -p /var/log/onlyoffice && \
|
||||
mkdir -p /app/onlyoffice/data && \
|
||||
mkdir -p /var/www/services/backup && \
|
||||
addgroup --system --gid 107 onlyoffice && \
|
||||
adduser -uid 104 --quiet --home /var/www/onlyoffice --system --gid 107 onlyoffice && \
|
||||
chown onlyoffice:onlyoffice /app/onlyoffice -R && \
|
||||
chown onlyoffice:onlyoffice /var/log -R && \
|
||||
chown onlyoffice:onlyoffice /var/www -R
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
chown onlyoffice:onlyoffice /var/www -R
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
apt-get -y update && \
|
||||
apt-get -y upgrade && \
|
||||
apt-get install -yq nano &&\
|
||||
apt-get install -yq jq &&\
|
||||
apt-get install -yq nodejs &&\
|
||||
apt-get install -yq nano && \
|
||||
apt-get install -yq jq && \
|
||||
apt-get install -yq nodejs && \
|
||||
apt-get install -yq libgdiplus
|
||||
|
||||
#USER onlyoffice
|
||||
#USER onlyoffice
|
||||
EXPOSE 5050
|
||||
|
||||
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||
|
||||
### STAGE 3: Run ###
|
||||
|
||||
## NGINX ##
|
||||
FROM nginx:stable-alpine AS web
|
||||
## Nginx image ##
|
||||
FROM nginx AS web
|
||||
ARG SRC_PATH
|
||||
ARG BUILD_PATH
|
||||
|
||||
# Remove default nginx website
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
apt-get -y update && \
|
||||
apt-get -y upgrade && \
|
||||
apt-get install -yq vim && \
|
||||
# Remove default nginx website
|
||||
rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# copy static services files and config values
|
||||
COPY --from=base /etc/nginx/conf.d /etc/nginx/conf.d
|
||||
COPY --from=base /etc/nginx/includes /etc/nginx/includes
|
||||
COPY --from=base /var/www/public /var/www/public
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.CRM/Client/dist ${BUILD_PATH}/products/ASC.CRM/client
|
||||
COPY --from=base ${SRC_PATH}/web/ASC.Web.Editor/dist ${BUILD_PATH}/products/ASC.Files/editor
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.Files/Client/dist ${BUILD_PATH}/products/ASC.Files/client
|
||||
COPY --from=base ${SRC_PATH}/web/ASC.Web.Login/dist ${BUILD_PATH}/studio/login
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.People/Client/dist ${BUILD_PATH}/products/ASC.People/client
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.Projects/Client/dist ${BUILD_PATH}/products/ASC.Projects/client
|
||||
COPY --from=base ${SRC_PATH}/web/ASC.Web.Client/dist ${BUILD_PATH}/studio/client
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.Calendar/Client/dist ${BUILD_PATH}/products/ASC.Calendar/client
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.Mail/Client/dist ${BUILD_PATH}/products/ASC.Mail/client
|
||||
|
||||
# copy artefacts and config values for nginx
|
||||
COPY --from=develop /etc/nginx/conf.d /etc/nginx/conf.d
|
||||
COPY --from=develop /etc/nginx/includes /etc/nginx/includes
|
||||
COPY --from=develop /var/www/story /var/www/story
|
||||
COPY --from=develop /var/www/products/ASC.Files/client /var/www/products/ASC.Files/client
|
||||
COPY --from=develop /var/www/products/ASC.People/client /var/www/products/ASC.People/client
|
||||
COPY --from=develop /var/www/public /var/www/public
|
||||
COPY --from=develop /var/www/studio/client /var/www/studio/client
|
||||
COPY /config/nginx/templates/upstream.conf.template /etc/nginx/templates/upstream.conf.template
|
||||
|
||||
# add defualt user and group for no-root run
|
||||
RUN chown nginx:nginx /etc/nginx/* -R &&\
|
||||
chown nginx:nginx /docker-entrypoint.d/* &&\
|
||||
RUN chown nginx:nginx /etc/nginx/* -R && \
|
||||
chown nginx:nginx /docker-entrypoint.d/* && \
|
||||
# changes for upstream configure
|
||||
sed -i 's/localhost:5000/$service_api/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5010/$service_api_system/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5004/$service_people_server/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5007/$service_files/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5003/$service_studio/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5012/$service_backup/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:9999/$service_sh/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5021/$service_crm/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5007/$service_files/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5004/$service_people_server/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5020/$service_projects_server/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5000/$service_api/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5003/$service_studio/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5023/$service_calendar/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5022/$service_mail/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:9999/$service_urlshortener/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/172.*/$document_server;/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
# configute the image nginx whith less privileged https://hub.docker.com/_/nginx
|
||||
sed -i 's/pid.*nginx.pid;/pid \/tmp\/nginx.pid;/' /etc/nginx/nginx.conf && \
|
||||
sed -i 's/http.*{/http {\n client_body_temp_path \/tmp\/client_temp;\n proxy_temp_path \/tmp\/proxy_temp_path;\n fastcgi_temp_path \/tmp\/fastcgi_temp;\n uwsgi_temp_path \/tmp\/uwsgi_temp;\n scgi_temp_path \/tmp\/scgi_temp;/' /etc/nginx/nginx.conf
|
||||
|
||||
|
||||
## backup ##
|
||||
FROM builder AS backup
|
||||
|
||||
WORKDIR /var/www/services/backup/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/services/backup/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
|
||||
CMD ["ASC.Data.Backup.dll", "backup", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## api ##
|
||||
FROM builder AS api
|
||||
|
||||
WORKDIR /var/www/studio/api/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/studio/api .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
|
||||
CMD ["ASC.Web.Api.dll", "api"]
|
||||
|
||||
## api_system ##
|
||||
## ASC.ApiSystem ##
|
||||
FROM builder AS api_system
|
||||
|
||||
WORKDIR /var/www/services/apisystem/
|
||||
WORKDIR ${BUILD_PATH}/services/apisystem/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/services/apisystem/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.ApiSystem/service .
|
||||
|
||||
CMD ["ASC.ApiSystem.dll", "api_system"]
|
||||
CMD ["ASC.ApiSystem.dll", "ASC.ApiSystem"]
|
||||
|
||||
## urlshortener ##
|
||||
FROM builder AS urlshortener
|
||||
|
||||
WORKDIR /services/urlshortener/service/
|
||||
## ASC.Data.Backup ##
|
||||
FROM builder AS backup
|
||||
WORKDIR ${BUILD_PATH}/services/backup/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /services/urlshortener/service/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/services/urlshortener/client /services/urlshortener/client
|
||||
CMD ["ASC.UrlShortener.Svc.dll", "urlshortener"]
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Data.Backup/service .
|
||||
|
||||
CMD ["ASC.Data.Backup.dll", "ASC.Data.Backup", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## studio.notify ##
|
||||
FROM builder AS studio.notify
|
||||
|
||||
WORKDIR /var/www/services/studio.notify/
|
||||
## ASC.Calendar ##
|
||||
FROM builder AS calendar
|
||||
WORKDIR ${BUILD_PATH}/products/ASC.Calendar/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop /var/www/services/studio.notify/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/products/ASC.Calendar/server/ .
|
||||
|
||||
CMD ["ASC.Studio.Notify.dll", "studio.notify", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
CMD ["ASC.Calendar.dll", "ASC.Calendar"]
|
||||
|
||||
|
||||
## notify ##
|
||||
FROM builder AS notify
|
||||
|
||||
WORKDIR /var/www/services/notify/
|
||||
## ASC.CRM ##
|
||||
FROM builder AS crm
|
||||
WORKDIR ${BUILD_PATH}/products/ASC.CRM/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop /var/www/services/notify/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/products/ASC.CRM/server/ .
|
||||
|
||||
CMD ["ASC.Notify.dll", "notify", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
CMD ["ASC.CRM.dll", "ASC.CRM"]
|
||||
|
||||
## people.server ##
|
||||
FROM builder AS people.server
|
||||
|
||||
WORKDIR /var/www/products/ASC.People/server/
|
||||
## ASC.Data.Storage.Encryption ##
|
||||
FROM builder AS data_storage_encryption
|
||||
WORKDIR ${BUILD_PATH}/services/storage.encryption/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Data.Storage.Encryption/service/ .
|
||||
|
||||
CMD ["ASC.People.dll", "people.server"]
|
||||
CMD ["ASC.Data.Storage.Encryption.dll", "ASC.Data.Storage.Encryption"]
|
||||
|
||||
## files ##
|
||||
## ASC.Files ##
|
||||
FROM builder AS files
|
||||
|
||||
WORKDIR /var/www/products/ASC.Files/server/
|
||||
WORKDIR ${BUILD_PATH}/products/ASC.Files/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/products/ASC.Files/server/ .
|
||||
|
||||
CMD ["ASC.Files.dll", "files"]
|
||||
CMD ["ASC.Files.dll", "ASC.Files"]
|
||||
|
||||
## files_services ##
|
||||
## ASC.Files.Service ##
|
||||
FROM builder AS files_services
|
||||
|
||||
WORKDIR /var/www/products/ASC.Files/service/
|
||||
WORKDIR ${BUILD_PATH}/products/ASC.Files/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/service/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People*.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Files.Service/service/ .
|
||||
|
||||
CMD ["ASC.Files.Service.dll", "files_services", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
CMD ["ASC.Files.Service.dll", "ASC.Files.Service", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## studio ##
|
||||
FROM builder AS studio
|
||||
|
||||
WORKDIR /var/www/studio/server/
|
||||
## ASC.Mail ##
|
||||
FROM builder AS mail
|
||||
WORKDIR ${BUILD_PATH}/products/ASC.Mail/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/studio/server/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/products/ASC.Mail/server/ .
|
||||
|
||||
CMD ["ASC.Web.Studio.dll", "studio"]
|
||||
CMD ["ASC.Mail.dll", "ASC.Mail"]
|
||||
|
||||
## thumbnails ##
|
||||
FROM builder AS thumbnails
|
||||
|
||||
WORKDIR /services/thumbnails/service
|
||||
## ASC.Data.Storage.Migration ##
|
||||
FROM builder AS data_storage_migration
|
||||
WORKDIR ${BUILD_PATH}/services/storage.migration/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /services/thumb/service/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/services/thumb/client /services/thumbnails/client
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Data.Storage.Migration/service/ .
|
||||
|
||||
CMD ["ASC.Thumbnails.Svc.dll", "thumbnails"]
|
||||
CMD ["ASC.Data.Storage.Migration.dll", "ASC.Data.Storage.Migration"]
|
||||
|
||||
## socket ##
|
||||
## ASC.Notify ##
|
||||
FROM builder AS notify
|
||||
WORKDIR ${BUILD_PATH}/services/notify/service
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Notify/service/ .
|
||||
|
||||
CMD ["ASC.Notify.dll", "ASC.Notify", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## ASC.People ##
|
||||
FROM builder AS people_server
|
||||
WORKDIR ${BUILD_PATH}/products/ASC.People/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/products/ASC.People/server/ .
|
||||
|
||||
CMD ["ASC.People.dll", "ASC.People"]
|
||||
|
||||
## ASC.Projects ##
|
||||
FROM builder AS projects_server
|
||||
WORKDIR ${BUILD_PATH}/products/ASC.Projects/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/products/ASC.Projects/server/ .
|
||||
|
||||
CMD ["ASC.Projects.dll", "ASC.Projects"]
|
||||
|
||||
## ASC.Socket.IO.Svc ##
|
||||
FROM builder AS socket
|
||||
|
||||
WORKDIR /services/socket/service
|
||||
WORKDIR ${BUILD_PATH}/services/socket/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /services/socket/service/ .
|
||||
COPY --from=develop --chown=onlyoffice:onlyoffice /var/www/services/socket/client /services/ASC.Socket.IO
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Socket.IO.Svc/service/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Socket.IO/service/ ${BUILD_PATH}/www/ASC.Socket.IO/
|
||||
|
||||
CMD ["ASC.Socket.IO.Svc.dll", "socket"]
|
||||
CMD ["ASC.Socket.IO.Svc.dll", "ASC.Socket.IO.Svc"]
|
||||
|
||||
## ASC.Studio.Notify ##
|
||||
FROM builder AS studio_notify
|
||||
WORKDIR ${BUILD_PATH}/services/studio.notify/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Studio.Notify/service/ .
|
||||
|
||||
CMD ["ASC.Studio.Notify.dll", "ASC.Studio.Notify", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## ASC.TelegramService ##
|
||||
FROM builder AS telegram_service
|
||||
WORKDIR ${BUILD_PATH}/services/telegram/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.TelegramService/service/ .
|
||||
|
||||
CMD ["ASC.TelegramService.dll", "ASC.TelegramService"]
|
||||
|
||||
## ASC.Thumbnails.Svc ##
|
||||
FROM builder AS thumbnails
|
||||
WORKDIR ${BUILD_PATH}/services/thumb/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Thumbnails.Svc/service/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Thumbnails/service/ /var/www/services/thumb/client
|
||||
|
||||
CMD ["ASC.Thumbnails.Svc.dll", "ASC.Thumbnails.Svc"]
|
||||
|
||||
## ASC.UrlShortener.Svc ##
|
||||
FROM builder AS urlshortener
|
||||
WORKDIR ${BUILD_PATH}/services/urlshortener/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.UrlShortener.Svc/service/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.UrlShortener/service/ /var/www/services/urlshortener/client
|
||||
|
||||
CMD ["ASC.UrlShortener.Svc.dll", "ASC.UrlShortener.Svc"]
|
||||
|
||||
## ASC.Web.Api ##
|
||||
FROM builder AS api
|
||||
WORKDIR ${BUILD_PATH}/studio/api/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Web.Api/service/ .
|
||||
|
||||
CMD ["ASC.Web.Api.dll", "ASC.Web.Api"]
|
||||
|
||||
## ASC.Web.Studio ##
|
||||
FROM builder AS studio
|
||||
WORKDIR ${BUILD_PATH}/studio/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${BUILD_PATH}/services/ASC.Web.Studio/service/ .
|
||||
|
||||
CMD ["ASC.Web.Studio.dll", "ASC.Web.Studio"]
|
||||
|
355
build/install/docker/Dockerfile-app-dll
Normal file
355
build/install/docker/Dockerfile-app-dll
Normal file
@ -0,0 +1,355 @@
|
||||
### STAGE 1: Base image ######
|
||||
ARG SRC_PATH=/app/onlyoffice/src
|
||||
ARG BUILD_PATH=/var/www
|
||||
ARG REPO_TAG=5.0.202-focal-amd64
|
||||
ARG REPO=mcr.microsoft.com/dotnet/sdk
|
||||
|
||||
FROM $REPO:$REPO_TAG AS base
|
||||
ARG RELEASE_DATE=2021-04-11
|
||||
ARG VERSION=8.9.0.190
|
||||
ARG GIT_BRANCH=master
|
||||
ARG SRC_PATH
|
||||
ARG BUILD_PATH
|
||||
|
||||
LABEL onlyoffice.appserver.release-date="${RELEASE_DATE}" \
|
||||
onlyoffice.appserver.version="${VERSION}" \
|
||||
maintainer="Ascensio System SIA <support@onlyoffice.com>"
|
||||
|
||||
ENV LANG=en_US.UTF-8 \
|
||||
LANGUAGE=en_US:en \
|
||||
LC_ALL=en_US.UTF-8
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
apt-get -y update && \
|
||||
apt-get -y upgrade && \
|
||||
apt-get -y dist-upgrade && \
|
||||
apt-get install -yq sudo locales && \
|
||||
addgroup --system --gid 107 onlyoffice && \
|
||||
adduser -uid 104 --quiet --home /var/www/onlyoffice --system --gid 107 onlyoffice && \
|
||||
locale-gen en_US.UTF-8 && \
|
||||
apt-get -y update && \
|
||||
apt-get install -yq git apt-utils npm nodejs && \
|
||||
npm install --global yarn
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
echo ${GIT_BRANCH} && \
|
||||
git clone --depth 1 -b ${GIT_BRANCH} https://github.com/ONLYOFFICE/AppServer.git ${SRC_PATH}
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
cd ${SRC_PATH} && \
|
||||
mkdir -p /var/www/public/ && cp -rf public/* /var/www/public/ && \
|
||||
mkdir -p /app/onlyoffice/config/ && cp -rf config/* /app/onlyoffice/config/ && \
|
||||
mkdir -p /etc/nginx/conf.d && cp -f config/nginx/onlyoffice*.conf /etc/nginx/conf.d/ && \
|
||||
mkdir -p /etc/nginx/includes/ && cp -f config/nginx/includes/onlyoffice*.conf /etc/nginx/includes/ && \
|
||||
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-backend.sh -sp ${SRC_PATH} -ar "--disable-parallel" && \
|
||||
bash publish-backend.sh -sp ${SRC_PATH} -bp ${BUILD_PATH} -ar "--disable-parallel"
|
||||
|
||||
COPY config/mysql/conf.d/mysql.cnf /etc/mysql/conf.d/mysql.cnf
|
||||
COPY config/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
RUN sed -i 's/Server=.*;Port=/Server=127.0.0.1;Port=/' /app/onlyoffice/config/appsettings.test.json
|
||||
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
|
||||
### STAGE 2: Build ###
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0.4-focal-amd64 as builder
|
||||
|
||||
COPY --from=base /app/onlyoffice/config/ /app/onlyoffice/config/
|
||||
|
||||
# add defualt user and group for no-root run
|
||||
RUN mkdir -p /var/log/onlyoffice && \
|
||||
mkdir -p /app/onlyoffice/data && \
|
||||
addgroup --system --gid 107 onlyoffice && \
|
||||
adduser -uid 104 --quiet --home /var/www/onlyoffice --system --gid 107 onlyoffice && \
|
||||
chown onlyoffice:onlyoffice /app/onlyoffice -R && \
|
||||
chown onlyoffice:onlyoffice /var/log -R && \
|
||||
chown onlyoffice:onlyoffice /var/www -R
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
apt-get -y update && \
|
||||
apt-get -y upgrade && \
|
||||
apt-get install -yq nano &&\
|
||||
apt-get install -yq jq &&\
|
||||
apt-get install -yq nodejs &&\
|
||||
apt-get install -yq libgdiplus
|
||||
|
||||
#USER onlyoffice
|
||||
EXPOSE 5050
|
||||
|
||||
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||
|
||||
### STAGE 3: Run ###
|
||||
|
||||
## NGINX ##
|
||||
#FROM nginx:stable-alpine AS web
|
||||
FROM nginx AS web
|
||||
ARG SRC_PATH="/app/onlyoffice/src"
|
||||
|
||||
RUN echo "nameserver 8.8.8.8" | tee /etc/resolv.conf > /dev/null && \
|
||||
apt-get -y update && \
|
||||
apt-get -y upgrade && \
|
||||
apt-get install -yq vim && \
|
||||
# Remove default nginx website
|
||||
rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# copy static services files and config values
|
||||
COPY --from=base /etc/nginx/conf.d /etc/nginx/conf.d
|
||||
COPY --from=base /etc/nginx/includes /etc/nginx/includes
|
||||
COPY --from=base /var/www/public /var/www/public
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.CRM/Client/dist /var/www/products/ASC.CRM/client
|
||||
COPY --from=base ${SRC_PATH}/web/ASC.Web.Editor/dist /var/www/products/ASC.Files/editor
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.Files/Client/dist /var/www/products/ASC.Files/client
|
||||
COPY --from=base ${SRC_PATH}/web/ASC.Web.Login/dist /var/www/studio/login
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.People/Client/dist /var/www/products/ASC.People/client
|
||||
COPY --from=base ${SRC_PATH}/products/ASC.Projects/Client/dist /var/www/products/ASC.Projects/client
|
||||
COPY --from=base ${SRC_PATH}/web/ASC.Web.Client/dist /var/www/studio/client
|
||||
|
||||
COPY /config/nginx/templates/upstream.conf.template /etc/nginx/templates/upstream.conf.template
|
||||
|
||||
# add defualt user and group for no-root run
|
||||
RUN chown nginx:nginx /etc/nginx/* -R &&\
|
||||
chown nginx:nginx /docker-entrypoint.d/* &&\
|
||||
# changes for upstream configure
|
||||
sed -i 's/localhost:5010/$service_api_system/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5012/$service_backup/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5021/$service_crm/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5007/$service_files/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5004/$service_people_server/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5020/$service_projects_server/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5000/$service_api/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:5003/$service_studio/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/localhost:9999/$service_urlshortener/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
sed -i 's/172.*/$document_server;/' /etc/nginx/conf.d/onlyoffice.conf && \
|
||||
# configute the image nginx whith less privileged https://hub.docker.com/_/nginx
|
||||
sed -i 's/pid.*nginx.pid;/pid \/tmp\/nginx.pid;/' /etc/nginx/nginx.conf && \
|
||||
sed -i 's/http.*{/http {\n client_body_temp_path \/tmp\/client_temp;\n proxy_temp_path \/tmp\/proxy_temp_path;\n fastcgi_temp_path \/tmp\/fastcgi_temp;\n uwsgi_temp_path \/tmp\/uwsgi_temp;\n scgi_temp_path \/tmp\/scgi_temp;/' /etc/nginx/nginx.conf
|
||||
|
||||
## ASC.ApiSystem ##
|
||||
FROM builder AS api_system
|
||||
|
||||
WORKDIR /var/www/services/apisystem/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/apisystem/ .
|
||||
|
||||
CMD ["ASC.ApiSystem.dll", "ASC.ApiSystem"]
|
||||
|
||||
## ASC.Data.Backup ##
|
||||
FROM builder AS backup
|
||||
|
||||
WORKDIR /var/www/services/backup/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/backup/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.Data.Backup.dll", "ASC.Data.Backup", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## ASC.CRM ##
|
||||
FROM builder AS crm
|
||||
|
||||
WORKDIR /var/www/products/ASC.CRM/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.CRM.dll", "ASC.CRM"]
|
||||
|
||||
## ASC.Data.Storage.Encryption ##
|
||||
FROM builder AS data_storage_encryption
|
||||
|
||||
WORKDIR /var/www/services/storage.encryption/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/storage.encryption/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.Data.Storage.Encryption.dll", "ASC.Data.Storage.Encryption"]
|
||||
|
||||
## ASC.Files ##
|
||||
FROM builder AS files
|
||||
|
||||
WORKDIR /var/www/products/ASC.Files/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice ${SRC_PATH}/ASC.Files/Server/DocStore .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.Files.dll", "ASC.Files"]
|
||||
|
||||
## ASC.Files.Service ##
|
||||
FROM builder AS files_services
|
||||
|
||||
WORKDIR /var/www/products/ASC.Files/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/service/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People*.dll /var/www/products/ASC.People/Server/
|
||||
|
||||
CMD ["ASC.Files.Service.dll", "ASC.Files.Service", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## ASC.Data.Storage.Migration ##
|
||||
FROM builder AS data_storage_migration
|
||||
|
||||
WORKDIR /var/www/services/storage.migration/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/storage.migration/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ /var/www/products/ASC.Files/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ /var/www/products/ASC.People/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ /var/www/products/ASC.CRM/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ /var/www/products/ASC.Projects/Server/
|
||||
|
||||
|
||||
CMD ["ASC.Data.Storage.Migration.dll", "ASC.Data.Storage.Migration"]
|
||||
|
||||
## ASC.Notify ##
|
||||
FROM builder AS notify
|
||||
|
||||
WORKDIR /var/www/services/notify/service
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base /var/www/services/notify/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/Server/
|
||||
|
||||
CMD ["ASC.Notify.dll", "ASC.Notify", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## ASC.People ##
|
||||
FROM builder AS people_server
|
||||
|
||||
WORKDIR /var/www/products/ASC.People/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.People.dll", "ASC.People"]
|
||||
|
||||
## ASC.Projects ##
|
||||
FROM builder AS projects_server
|
||||
|
||||
WORKDIR /var/www/products/ASC.Projects/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.Projects.dll", "ASC.Projects"]
|
||||
|
||||
## ASC.Socket.IO.Svc ##
|
||||
FROM builder AS socket
|
||||
|
||||
WORKDIR /var/www/services/socket/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/socket/service/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/socket/client /var/www/ASC.Socket.IO
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.Socket.IO.Svc.dll", "ASC.Socket.IO.Svc"]
|
||||
|
||||
## ASC.Studio.Notify ##
|
||||
FROM builder AS studio_notify
|
||||
|
||||
WORKDIR /var/www/services/studio.notify/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base /var/www/services/studio.notify/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/Server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/Server/
|
||||
|
||||
CMD ["ASC.Studio.Notify.dll", "ASC.Studio.Notify", "core:products:folder=/var/www/products/", "core:products:subfolder=server"]
|
||||
|
||||
## ASC.TelegramService ##
|
||||
FROM builder AS telegram_service
|
||||
|
||||
WORKDIR /var/www/services/telegram/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/telegram/service/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.TelegramService.dll", "ASC.TelegramService"]
|
||||
|
||||
## ASC.Thumbnails.Svc ##
|
||||
FROM builder AS thumbnails
|
||||
|
||||
WORKDIR /var/www/services/thumb/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/thumb/service/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/thumb/client /var/www/services/thumb/client
|
||||
|
||||
CMD ["ASC.Thumbnails.Svc.dll", "ASC.Thumbnails.Svc"]
|
||||
|
||||
## ASC.UrlShortener.Svc ##
|
||||
FROM builder AS urlshortener
|
||||
|
||||
WORKDIR /var/www/services/urlshortener/service/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/urlshortener/service/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/services/urlshortener/client /var/www/services/urlshortener/client
|
||||
|
||||
CMD ["ASC.UrlShortener.Svc.dll", "ASC.UrlShortener.Svc"]
|
||||
|
||||
## ASC.Web.Api ##
|
||||
FROM builder AS api
|
||||
|
||||
WORKDIR /var/www/studio/api/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/studio/api .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.Web.Api.dll", "ASC.Web.Api"]
|
||||
|
||||
## ASC.Web.Studio ##
|
||||
FROM builder AS studio
|
||||
|
||||
WORKDIR /var/www/studio/server/
|
||||
|
||||
COPY --chown=onlyoffice:onlyoffice docker-entrypoint.sh .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/studio/server/ .
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Files/server/ASC.Files*.dll /var/www/products/ASC.Files/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.People/server/ASC.People.dll /var/www/products/ASC.People/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.CRM/server/ASC.CRM*.dll /var/www/products/ASC.CRM/server/
|
||||
COPY --from=base --chown=onlyoffice:onlyoffice /var/www/products/ASC.Projects/server/ASC.Projects*.dll /var/www/products/ASC.Projects/server/
|
||||
|
||||
CMD ["ASC.Web.Studio.dll", "ASC.Web.Studio"]
|
@ -25,6 +25,13 @@ x-service:
|
||||
volumes:
|
||||
#- /app/onlyoffice/CommunityServer/data:/app/onlyoffice/data
|
||||
- app_data:/app/onlyoffice/data
|
||||
- files_data:/var/www/products/ASC.Files/server/
|
||||
- people_data:/var/www/products/ASC.People/server/
|
||||
- crm_data:/var/www/products/ASC.CRM/server/
|
||||
- project_data:/var/www/products/ASC.Projects/server/
|
||||
- calendar_data:/var/www/products/ASC.Calendar/server/
|
||||
- mail_data:/var/www/products/ASC.Mail/server/
|
||||
|
||||
|
||||
services:
|
||||
onlyoffice-elasticsearch:
|
||||
@ -81,69 +88,105 @@ services:
|
||||
volumes:
|
||||
- kafka_data:/var/lib/kafka/data
|
||||
|
||||
onlyoffice-api:
|
||||
onlyoffice-api-system:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-api:${SRV_VERSION}"
|
||||
container_name: ${API_HOST}
|
||||
|
||||
onlyoffice-api_system:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-api_system:${SRV_VERSION}"
|
||||
image: "${REPO}/${STATUS}appserver-api-system:${SRV_VERSION}"
|
||||
container_name: ${API_SYSTEM_HOST}
|
||||
|
||||
|
||||
onlyoffice-backup:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-backup:${SRV_VERSION}"
|
||||
container_name: ${BACKUP_HOST}
|
||||
|
||||
onlyoffice-calendar:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-calendar:${SRV_VERSION}"
|
||||
container_name: ${CALENDAR_HOST}
|
||||
|
||||
onlyoffice-crm:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-crm:${SRV_VERSION}"
|
||||
container_name: ${CRM_HOST}
|
||||
|
||||
onlyoffice-storage-encryption:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-storage-encryption:${SRV_VERSION}"
|
||||
container_name: ${STORAGE_ENCRYPTION_HOST}
|
||||
|
||||
onlyoffice-files:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-files:${SRV_VERSION}"
|
||||
container_name: ${FILES_HOST}
|
||||
|
||||
onlyoffice-files-services:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-files-services:${SRV_VERSION}"
|
||||
container_name: ${FILES_SERVICES_HOST}
|
||||
|
||||
onlyoffice-mail:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-mail:${SRV_VERSION}"
|
||||
container_name: ${MAIL_HOST}
|
||||
|
||||
onlyoffice-storage-migration:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-storage-migration:${SRV_VERSION}"
|
||||
container_name: ${STORAGE_MIGRATION_HOST}
|
||||
|
||||
onlyoffice-people-server:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-people-server:${SRV_VERSION}"
|
||||
container_name: ${PEOPLE_SERVER_HOST}
|
||||
|
||||
onlyoffice-projects-server:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-projects-server:${SRV_VERSION}"
|
||||
container_name: ${PROJECTS_SERVER_HOST}
|
||||
|
||||
onlyoffice-socket:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-socket:${SRV_VERSION}"
|
||||
container_name: ${SOCKET_HOST}
|
||||
expose:
|
||||
- ${SERVICE_PORT}
|
||||
- "9999"
|
||||
|
||||
onlyoffice-studio-notify:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-studio-notify:${SRV_VERSION}"
|
||||
container_name: ${STUDIO_NOTIFY_HOST}
|
||||
|
||||
onlyoffice-telegram-service:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-telegram-service:${SRV_VERSION}"
|
||||
container_name: ${TELEGRAM_SERVICE_HOST}
|
||||
|
||||
onlyoffice-thumbnails:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-thumbnails:${SRV_VERSION}"
|
||||
container_name: ${THUMBNAILS_HOST}
|
||||
expose:
|
||||
- ${SERVICE_PORT}
|
||||
- "9800"
|
||||
|
||||
onlyoffice-urlshortener:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-urlshortener:${SRV_VERSION}"
|
||||
container_name: ${URLSHORTENER_HOST}
|
||||
expose:
|
||||
- "9999"
|
||||
- ${SERVICE_PORT}
|
||||
- ${SERVICE_PORT}
|
||||
- "9999"
|
||||
|
||||
onlyoffice-studio.notify:
|
||||
onlyoffice-api:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-studio.notify:${SRV_VERSION}"
|
||||
container_name: ${STUDIO_NOTIFY_HOST}
|
||||
|
||||
onlyoffice-notify:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-notify:${SRV_VERSION}"
|
||||
container_name: ${NOTIFY_HOST}
|
||||
image: "${REPO}/${STATUS}appserver-api:${SRV_VERSION}"
|
||||
container_name: ${API_HOST}
|
||||
|
||||
onlyoffice-people.server:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-people.server:${SRV_VERSION}"
|
||||
container_name: ${PEOPLE_SERVER_HOST}
|
||||
|
||||
onlyoffice-files:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-files:${SRV_VERSION}"
|
||||
container_name: ${FILES_HOST}
|
||||
|
||||
onlyoffice-files_services:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-files_services:${SRV_VERSION}"
|
||||
container_name: ${FILES_SERVICES_HOST}
|
||||
|
||||
onlyoffice-studio:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-studio:${SRV_VERSION}"
|
||||
container_name: ${STUDIO_HOST}
|
||||
|
||||
onlyoffice-backup:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-backup:${SRV_VERSION}"
|
||||
container_name: ${BACKUP_HOST}
|
||||
|
||||
onlyoffice-thumbnails:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-thumbnails:${SRV_VERSION}"
|
||||
container_name: ${THUMBNAILS_HOST}
|
||||
|
||||
onlyoffice-socket:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-socket:${SRV_VERSION}"
|
||||
container_name: ${SOCKET_HOST}
|
||||
|
||||
onlyoffice-proxy:
|
||||
image: "${REPO}/${STATUS}appserver-proxy:${SRV_VERSION}"
|
||||
container_name: ${PROXY_HOST}
|
||||
@ -151,32 +194,48 @@ services:
|
||||
expose:
|
||||
- "8081"
|
||||
- "8099"
|
||||
- "8092"
|
||||
ports:
|
||||
- 8092:8092
|
||||
depends_on:
|
||||
- onlyoffice-api
|
||||
- onlyoffice-api_system
|
||||
- onlyoffice-urlshortener
|
||||
- onlyoffice-studio.notify
|
||||
- onlyoffice-notify
|
||||
- onlyoffice-people.server
|
||||
- onlyoffice-files
|
||||
- onlyoffice-files_services
|
||||
- onlyoffice-studio
|
||||
- onlyoffice-api-system
|
||||
- onlyoffice-backup
|
||||
- onlyoffice-calendar
|
||||
- onlyoffice-crm
|
||||
- onlyoffice-storage-encryption
|
||||
- onlyoffice-files
|
||||
- onlyoffice-files-services
|
||||
- onlyoffice-mail
|
||||
- onlyoffice-storage-migration
|
||||
- onlyoffice-people-server
|
||||
- onlyoffice-projects-server
|
||||
- onlyoffice-socket
|
||||
- onlyoffice-studio-notify
|
||||
- onlyoffice-telegram-service
|
||||
- onlyoffice-thumbnails
|
||||
- onlyoffice-urlshortener
|
||||
- onlyoffice-api
|
||||
- onlyoffice-studio
|
||||
environment:
|
||||
- SERVICE_API=${SERVICE_API}
|
||||
- SERVICE_API_SYSTEM=${SERVICE_API_SYSTEM}
|
||||
- SERVICE_URLSHORTENER=${SERVICE_URLSHORTENER}
|
||||
- SERVICE_STUDIO_NOTIFY=${SERVICE_STUDIO_NOTIFY}
|
||||
- SERVICE_PEOPLE_SERVER=${SERVICE_PEOPLE_SERVER}
|
||||
- SERVICE_BACKUP=${SERVICE_BACKUP}
|
||||
- SERVICE_CALENDAR=${SERVICE_CALENDAR}
|
||||
- SERVICE_CRM=${SERVICE_CRM}
|
||||
- SERVICE_STORAGE_ENCRYPTION=${SERVICE_STORAGE_ENCRYPTION}
|
||||
- SERVICE_FILES=${SERVICE_FILES}
|
||||
- SERVICE_FILES_SERVICES=${SERVICE_FILES_SERVICES}
|
||||
- SERVICE_STUDIO=${SERVICE_STUDIO}
|
||||
- SERVICE_BACKUP=${SERVICE_BACKUP}
|
||||
- SERVICE_MAIL=${SERVICE_MAIL}
|
||||
- SERVICE_STORAGE_MIGRATION=${SERVICE_STORAGE_MIGRATION}
|
||||
- SERVICE_NOTIFY=${SERVICE_NOTIFY}
|
||||
- SERVICE_PEOPLE_SERVER=${SERVICE_PEOPLE_SERVER}
|
||||
- SERVICE_PROJECTS_SERVER=${SERVICE_PROJECTS_SERVER}
|
||||
- SERVICE_SOCKET=${SERVICE_SOCKET}
|
||||
- SERVICE_STUDIO_NOTIFY=${SERVICE_STUDIO_NOTIFY}
|
||||
- SERVICE_TELEGRAM_SERVICE=${SERVICE_TELEGRAM_SERVICE}
|
||||
- SERVICE_THUMBNAILS=${SERVICE_THUMBNAILS}
|
||||
- SERVICE_SH=${SERVICE_SH}
|
||||
- SERVICE_URLSHORTENER=${SERVICE_URLSHORTENER}
|
||||
- SERVICE_API=${SERVICE_API}
|
||||
- SERVICE_STUDIO=${SERVICE_STUDIO}
|
||||
- DOCUMENT_SERVER=${DOCUMENT_SERVER_HOST}
|
||||
- SERVICE_PORT=${SERVICE_PORT}
|
||||
volumes:
|
||||
@ -189,8 +248,14 @@ networks:
|
||||
|
||||
volumes:
|
||||
kafka_data:
|
||||
es_data:
|
||||
zoo_data:
|
||||
zoo_log:
|
||||
proxy_log:
|
||||
app_data:
|
||||
es_data:
|
||||
files_data:
|
||||
people_data:
|
||||
crm_data:
|
||||
project_data:
|
||||
calendar_data:
|
||||
mail_data:
|
||||
|
@ -1,93 +1,142 @@
|
||||
version: "3.6"
|
||||
|
||||
services:
|
||||
onlyoffice-api:
|
||||
onlyoffice-api-system:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: api
|
||||
image: "${REPO}/${STATUS}appserver-api:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-api_system:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: api_system
|
||||
image: "${REPO}/${STATUS}appserver-api_system:${SRV_VERSION}"
|
||||
image: "${REPO}/${STATUS}appserver-api-system:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-urlshortener:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: urlshortener
|
||||
image: "${REPO}/${STATUS}appserver-urlshortener:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-studio.notify:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: studio.notify
|
||||
image: "${REPO}/${STATUS}appserver-studio.notify:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-notify:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: notify
|
||||
image: "${REPO}/${STATUS}appserver-notify:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-people.server:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: people.server
|
||||
image: "${REPO}/${STATUS}appserver-people.server:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-files:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: files
|
||||
image: "${REPO}/${STATUS}appserver-files:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-files_services:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: files_services
|
||||
image: "${REPO}/${STATUS}appserver-files_services:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-studio:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: studio
|
||||
image: "${REPO}/${STATUS}appserver-studio:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-backup:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: backup
|
||||
image: "${REPO}/${STATUS}appserver-backup:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-thumbnails:
|
||||
onlyoffice-calendar:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: thumbnails
|
||||
image: "${REPO}/${STATUS}appserver-thumbnails:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-proxy:
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: calendar
|
||||
image: "${REPO}/${STATUS}appserver-calendar:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-crm:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
target: web
|
||||
image: "${REPO}/${STATUS}appserver-proxy:${SRV_VERSION}"
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: crm
|
||||
image: "${REPO}/${STATUS}appserver-crm:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-storage-encryption:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: data_storage_encryption
|
||||
image: "${REPO}/${STATUS}appserver-storage-encryption:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-files:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: files
|
||||
image: "${REPO}/${STATUS}appserver-files:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-files-services:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: files_services
|
||||
image: "${REPO}/${STATUS}appserver-files-services:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-mail:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: mail
|
||||
image: "${REPO}/${STATUS}appserver-mail:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-storage-migration:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: data_storage_migration
|
||||
image: "${REPO}/${STATUS}appserver-storage-migration:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-notify:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: notify
|
||||
image: "${REPO}/${STATUS}appserver-notify:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-people-server:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: people_server
|
||||
image: "${REPO}/${STATUS}appserver-people-server:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-projects-server:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: projects_server
|
||||
image: "${REPO}/${STATUS}appserver-projects-server:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-socket:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile-app
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: socket
|
||||
image: "${REPO}/${STATUS}appserver-socket:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-studio-notify:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: studio_notify
|
||||
image: "${REPO}/${STATUS}appserver-studio-notify:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-telegram-service:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: telegram_service
|
||||
image: "${REPO}/${STATUS}appserver-telegram-service:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-thumbnails:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: thumbnails
|
||||
image: "${REPO}/${STATUS}appserver-thumbnails:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-urlshortener:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: urlshortener
|
||||
image: "${REPO}/${STATUS}appserver-urlshortener:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-api:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: api
|
||||
image: "${REPO}/${STATUS}appserver-api:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-studio:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: studio
|
||||
image: "${REPO}/${STATUS}appserver-studio:${SRV_VERSION}"
|
||||
|
||||
onlyoffice-proxy:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: "${DOCKERFILE}"
|
||||
target: web
|
||||
image: "${REPO}/${STATUS}appserver-proxy:${SRV_VERSION}"
|
||||
|
@ -1,38 +1,28 @@
|
||||
resolver 127.0.0.11 valid=30s;
|
||||
|
||||
map $DOCUMENT_SERVER $document_server {
|
||||
volatile;
|
||||
$DOCUMENT_SERVER $DOCUMENT_SERVER;
|
||||
}
|
||||
|
||||
map $SERVICE_API $service_api {
|
||||
volatile;
|
||||
$SERVICE_API $SERVICE_API;
|
||||
}
|
||||
|
||||
map $SERVICE_API_SYSTEM $service_api_system {
|
||||
volatile;
|
||||
$SERVICE_API_SYSTEM $SERVICE_API_SYSTEM;
|
||||
}
|
||||
|
||||
map $SERVICE_URLSHORTENER $service_urlshortener {
|
||||
map $SERVICE_BACKUP $service_backup {
|
||||
volatile;
|
||||
$SERVICE_URLSHORTENER $SERVICE_URLSHORTENER;
|
||||
$SERVICE_BACKUP $SERVICE_BACKUP;
|
||||
}
|
||||
|
||||
map $SERVICE_THUMBNAILS $service_thumbnails {
|
||||
map $SERVICE_CALENDAR $service_calendar {
|
||||
volatile;
|
||||
$SERVICE_THUMBNAILS $SERVICE_THUMBNAILS;
|
||||
$SERVICE_CALENDAR $SERVICE_CALENDAR;
|
||||
}
|
||||
|
||||
map $SERVICE_STUDIO_NOTIFY $service_studio_notify {
|
||||
map $SERVICE_CRM $service_crm {
|
||||
volatile;
|
||||
$SERVICE_STUDIO_NOTIFY $SERVICE_STUDIO_NOTIFY;
|
||||
$SERVICE_CRM $SERVICE_CRM;
|
||||
}
|
||||
|
||||
map $SERVICE_PEOPLE_SERVER $service_people_server {
|
||||
map $SERVICE_STORAGE_ENCRYPTION $service_storage_encryption {
|
||||
volatile;
|
||||
$SERVICE_PEOPLE_SERVER $SERVICE_PEOPLE_SERVER;
|
||||
$SERVICE_STORAGE_ENCRYPTION $SERVICE_STORAGE_ENCRYPTION;
|
||||
}
|
||||
|
||||
map $SERVICE_FILES $service_files {
|
||||
@ -45,17 +35,67 @@ map $SERVICE_FILES_SERVICES $service_files_services {
|
||||
$SERVICE_FILES_SERVICES $SERVICE_FILES_SERVICES;
|
||||
}
|
||||
|
||||
map $SERVICE_MAIL $service_mail {
|
||||
volatile;
|
||||
$SERVICE_MAIL $SERVICE_MAIL;
|
||||
}
|
||||
|
||||
map $SERVICE_STORAGE_MIGRATION $service_storage_migration {
|
||||
volatile;
|
||||
$SERVICE_STORAGE_MIGRATION $SERVICE_STORAGE_MIGRATION;
|
||||
}
|
||||
|
||||
map $SERVICE_NOTIFY $service_notify {
|
||||
volatile;
|
||||
$SERVICE_NOTIFY $SERVICE_NOTIFY;
|
||||
}
|
||||
|
||||
map $SERVICE_PEOPLE_SERVER $service_people_server {
|
||||
volatile;
|
||||
$SERVICE_PEOPLE_SERVER $SERVICE_PEOPLE_SERVER;
|
||||
}
|
||||
|
||||
map $SERVICE_PROJECTS_SERVER $service_projects_server {
|
||||
volatile;
|
||||
$SERVICE_PROJECTS_SERVER $SERVICE_PROJECTS_SERVER;
|
||||
}
|
||||
|
||||
map $SERVICE_SOCKET $service_socket {
|
||||
volatile;
|
||||
$SERVICE_SOCKET $SERVICE_SOCKET;
|
||||
}
|
||||
|
||||
map $SERVICE_STUDIO_NOTIFY $service_studio_notify {
|
||||
volatile;
|
||||
$SERVICE_STUDIO_NOTIFY $SERVICE_STUDIO_NOTIFY;
|
||||
}
|
||||
|
||||
map $SERVICE_TELEGRAM_SERVICE $service_telegram_service {
|
||||
volatile;
|
||||
$SERVICE_TELEGRAM_SERVICE $SERVICE_TELEGRAM_SERVICE;
|
||||
}
|
||||
|
||||
map $SERVICE_THUMBNAILS $service_thumbnails {
|
||||
volatile;
|
||||
$SERVICE_THUMBNAILS $SERVICE_THUMBNAILS;
|
||||
}
|
||||
|
||||
map $SERVICE_URLSHORTENER $service_urlshortener {
|
||||
volatile;
|
||||
$SERVICE_URLSHORTENER $SERVICE_URLSHORTENER;
|
||||
}
|
||||
|
||||
map $SERVICE_API $service_api {
|
||||
volatile;
|
||||
$SERVICE_API $SERVICE_API;
|
||||
}
|
||||
|
||||
map $SERVICE_STUDIO $service_studio {
|
||||
volatile;
|
||||
$SERVICE_STUDIO $SERVICE_STUDIO;
|
||||
}
|
||||
|
||||
map $SERVICE_BACKUP $service_backup {
|
||||
map $DOCUMENT_SERVER $document_server {
|
||||
volatile;
|
||||
$SERVICE_BACKUP $SERVICE_BACKUP;
|
||||
}
|
||||
|
||||
map $SERVICE_SH $service_sh {
|
||||
volatile;
|
||||
$SERVICE_SH $SERVICE_SH;
|
||||
$DOCUMENT_SERVER $DOCUMENT_SERVER;
|
||||
}
|
||||
|
112
build/install/docker/config/onlyoffice.upgradev110.sql
Normal file
112
build/install/docker/config/onlyoffice.upgradev110.sql
Normal file
@ -0,0 +1,112 @@
|
||||
DELIMITER DLM00
|
||||
|
||||
DROP PROCEDURE IF EXISTS upgrade110 DLM00
|
||||
|
||||
CREATE PROCEDURE upgrade110()
|
||||
BEGIN
|
||||
|
||||
IF (SELECT DATA_TYPE FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'crm_invoice_item' AND COLUMN_NAME = 'quantity') <> 'decimal' THEN
|
||||
ALTER TABLE `crm_invoice_item` CHANGE COLUMN `quantity` `quantity` DECIMAL(10,2) NOT NULL DEFAULT '0.00' AFTER `price`;
|
||||
END IF;
|
||||
|
||||
IF (SELECT DATA_TYPE FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'crm_invoice_item' AND COLUMN_NAME = 'stock_quantity') <> 'decimal' THEN
|
||||
ALTER TABLE `crm_invoice_item` CHANGE COLUMN `stock_quantity` `stock_quantity` DECIMAL(10,2) NOT NULL DEFAULT '0.00' AFTER `quantity`;
|
||||
END IF;
|
||||
|
||||
IF (SELECT DATA_TYPE FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'crm_invoice_line' AND COLUMN_NAME = 'quantity') <> 'decimal' THEN
|
||||
ALTER TABLE `crm_invoice_line` CHANGE COLUMN `quantity` `quantity` DECIMAL(10,2) NOT NULL DEFAULT '0.00' AFTER `description`;
|
||||
END IF;
|
||||
|
||||
IF (SELECT DATA_TYPE FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'crm_invoice_line' AND COLUMN_NAME = 'discount') <> 'decimal' THEN
|
||||
ALTER TABLE `crm_invoice_line` CHANGE COLUMN `discount` `discount` DECIMAL(10,2) NOT NULL DEFAULT '0.00' AFTER `price`;
|
||||
END IF;
|
||||
|
||||
IF EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'crm_invoice_item' AND COLUMN_NAME = 'quantity') THEN
|
||||
ALTER TABLE `crm_invoice_item` DROP COLUMN `quantity`;
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'notify_queue' AND COLUMN_NAME = 'auto_submitted') THEN
|
||||
ALTER TABLE `notify_queue` ADD COLUMN `auto_submitted` VARCHAR(64) NULL DEFAULT NULL AFTER `attachments`;
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'core_usersecurity' AND COLUMN_NAME = 'LastModified') THEN
|
||||
ALTER TABLE `core_usersecurity` ADD COLUMN `LastModified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP() AFTER `pwdhashsha512`;
|
||||
END IF;
|
||||
|
||||
UPDATE `tenants_quota` SET `features` = 'domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom' WHERE `tenant` = -1 and `name` NOT LIKE '%saas%';
|
||||
UPDATE `tenants_quota` SET `features` = 'docs,domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom' WHERE tenant = -1000;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `telegram_users` (
|
||||
`portal_user_id` VARCHAR(38) NOT NULL,
|
||||
`tenant_id` INT(11) NOT NULL,
|
||||
`telegram_user_id` INT(11) NOT NULL,
|
||||
PRIMARY KEY (`tenant_id`, `portal_user_id`),
|
||||
INDEX `tgId` (`telegram_user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/crm/default', 'Products/CRM/Default')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'CRMPatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/crm/deals', 'Products/CRM/Deals')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'CRMPatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/crm/tasks', 'Products/CRM/Tasks')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'CRMPatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/crm', 'Products/CRM')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'CRMPatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/projects/messages', 'Products/Projects/Messages')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'PatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/projects/tasks', 'Products/Projects/Tasks')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'PatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/projects/projects', 'Products/Projects/Projects')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'PatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/projects/milestones', 'Products/Projects/Milestones')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'PatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/projects', 'Products/Projects')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'PatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/files', 'Products/Files')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'FilesPatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/files', 'Products/Files')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'WebstudioNotifyPatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/projects', 'Products/Projects')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'WebstudioNotifyPatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/community', 'Products/Community')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'WebstudioNotifyPatternResource.resx');
|
||||
|
||||
UPDATE `res_data`
|
||||
SET `textValue` = REPLACE(`textValue`, 'products/crm', 'Products/CRM')
|
||||
WHERE `fileid` = (SELECT `id` FROM `res_files` WHERE `resName` = 'WebstudioNotifyPatternResource.resx');
|
||||
|
||||
UPDATE `core_settings`
|
||||
SET `value`=0xF547048A4865171587D9CEBC8A496C601D96031F2C1C3E9160353942EE765DACD316F4B5F42892436FC4A21B9A6DF8FFD3BC4036B47E3A5A1B4C881B26609869FEBB6848BD88C02EEAC6A4CCB3E8F404290812F0E6E124A552BE81A58C64BB8BD3C9A8C0EDE1F9421281DE0C7AF82733A4BCE515E85694C4DDA78E22652BA2891FCE9578F97285A81E12FEDF5D6558611E3AA3E03EADDCAA98287C64A5510757A881B00C3345E6FC1E22B607CA2D753C63F1ED94C92366DBA0E4C2E6DB16F44A8AB091007AA7505D17E41530643C1FFAE822F8F99FD2E30C0DEF82DF65C43324507F3E5C68E4C5E22BE8A40C24423485
|
||||
WHERE `tenant`=-1 AND `id`='CompanyWhiteLabelSettings';
|
||||
|
||||
END DLM00
|
||||
|
||||
CALL upgrade110() DLM00
|
||||
|
||||
DELIMITER ;
|
19
build/install/docker/config/onlyoffice.upgradev111.sql
Normal file
19
build/install/docker/config/onlyoffice.upgradev111.sql
Normal file
@ -0,0 +1,19 @@
|
||||
DELIMITER DLM00
|
||||
|
||||
DROP PROCEDURE IF EXISTS upgrade111 DLM00
|
||||
|
||||
CREATE PROCEDURE upgrade111()
|
||||
BEGIN
|
||||
|
||||
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'files_file' AND COLUMN_NAME = 'thumb') THEN
|
||||
ALTER TABLE `files_file` ADD COLUMN `thumb` INT(1) NOT NULL DEFAULT '0' AFTER `forcesave`;
|
||||
END IF;
|
||||
|
||||
ALTER TABLE `files_thirdparty_account` CHANGE COLUMN `password` `password` VARCHAR(512) NOT NULL AFTER `user_name`;
|
||||
|
||||
|
||||
END DLM00
|
||||
|
||||
CALL upgrade111() DLM00
|
||||
|
||||
DELIMITER ;
|
39
build/install/docker/config/onlyoffice.upgradev115.sql
Normal file
39
build/install/docker/config/onlyoffice.upgradev115.sql
Normal file
@ -0,0 +1,39 @@
|
||||
DELIMITER DLM00
|
||||
|
||||
DROP PROCEDURE IF EXISTS upgrade115 DLM00
|
||||
|
||||
CREATE PROCEDURE upgrade115()
|
||||
BEGIN
|
||||
|
||||
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.docx');
|
||||
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.odt');
|
||||
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.pdf');
|
||||
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.rtf');
|
||||
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.txt');
|
||||
|
||||
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'calendar_events' AND COLUMN_NAME = 'time_zone') THEN
|
||||
ALTER TABLE `calendar_events` ADD COLUMN `time_zone` VARCHAR(255) NULL DEFAULT NULL AFTER `status`;
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'backup_backup' AND COLUMN_NAME = 'hash') THEN
|
||||
ALTER TABLE `backup_backup` ADD COLUMN `hash` char(64) NOT NULL AFTER `storage_params`;
|
||||
END IF;
|
||||
|
||||
IF EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tenants_tariff' AND COLUMN_NAME = 'tariff_key') THEN
|
||||
ALTER TABLE `tenants_tariff` DROP COLUMN `tariff_key`;
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tenants_tariff' AND COLUMN_NAME = 'quantity') THEN
|
||||
ALTER TABLE `tenants_tariff` ADD COLUMN `quantity` int(10) NOT NULL DEFAULT 1 AFTER `stamp`;
|
||||
END IF;
|
||||
|
||||
INSERT IGNORE INTO `crm_currency_info` (`resource_key`, `abbreviation`, `symbol`, `culture_name`, `is_convertable`, `is_basic`) values ('Currency_MongolianTugrik', 'MNT', '₮', 'MN', 0, 0);
|
||||
|
||||
UPDATE `tenants_quota` SET `features` = 'docs,domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom,restore,contentsearch' WHERE tenant = -1000;
|
||||
UPDATE `tenants_quota` SET `features` = 'domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom,restore,contentsearch' WHERE `tenant` = -1 and `name` NOT LIKE '%saas%';
|
||||
|
||||
END DLM00
|
||||
|
||||
CALL upgrade115() DLM00
|
||||
|
||||
DELIMITER ;
|
@ -26,6 +26,9 @@ services:
|
||||
- ./config/onlyoffice.sql:/docker-entrypoint-initdb.d/02_onlyoffice.sql
|
||||
- ./config/onlyoffice.data.sql:/docker-entrypoint-initdb.d/03_onlyoffice.data.sql
|
||||
- ./config/onlyoffice.resources.sql:/docker-entrypoint-initdb.d/04_onlyoffice.resources.sql
|
||||
- ./config/onlyoffice.upgradev110.sql:/docker-entrypoint-initdb.d/05_onlyoffice.upgradev110.sql
|
||||
- ./config/onlyoffice.upgradev111.sql:/docker-entrypoint-initdb.d/06_onlyoffice.upgradev111.sql
|
||||
- ./config/onlyoffice.upgradev115.sql:/docker-entrypoint-initdb.d/07_onlyoffice.upgradev115.sql
|
||||
networks:
|
||||
- ${NETWORK_NAME}
|
||||
tmpfs: /var/log/mysql/
|
||||
|
@ -70,6 +70,7 @@ sed -i "s!\"header\".*!\"header\": \"${DOCUMENT_SERVER_JWT_HEADER}\"!" ${PATH_TO
|
||||
|
||||
grep -q "${ELK_VALUE}" ${PATH_TO_CONF}/appsettings.${APP_DOTNET_ENV}.json || sed -i "s!\"files\".*!${ELK_VALUE}\n\"files\": {!" ${PATH_TO_CONF}/appsettings.${APP_DOTNET_ENV}.json
|
||||
|
||||
sed -i "s!\"subfolder\".*!\"subfolder\": \"server\",!g" ${PATH_TO_CONF}/appsettings.services.json
|
||||
sed -i "s!\"BootstrapServers\".*!\"BootstrapServers\": \"${KAFKA_HOST}\"!g" ${PATH_TO_CONF}/kafka.${APP_DOTNET_ENV}.json
|
||||
|
||||
dotnet ${DOTNET_RUN} --urls=${URLS} --ENVIRONMENT=${APP_DOTNET_ENV} --'$STORAGE_ROOT'=${APP_STORAGE_ROOT} --pathToConf=${PATH_TO_CONF} --log:dir=${LOG_DIR} --log:name=${DOTNET_LOG_NAME} ${PARAMETERS}
|
||||
|
53
build/install/docker/notify.yml
Normal file
53
build/install/docker/notify.yml
Normal file
@ -0,0 +1,53 @@
|
||||
version: "3.6"
|
||||
x-service:
|
||||
&x-service-base
|
||||
container_name: base
|
||||
restart: always
|
||||
expose:
|
||||
- ${SERVICE_PORT}
|
||||
environment:
|
||||
MYSQL_HOST: ${MYSQL_HOST}
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||
MYSQL_USER: ${MYSQL_USER}
|
||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
||||
APP_DOTNET_ENV: ${APP_DOTNET_ENV}
|
||||
APP_CORE_BASE_DOMAIN: ${APP_CORE_BASE_DOMAIN}
|
||||
APP_CORE_MACHINEKEY: ${APP_CORE_MACHINEKEY}
|
||||
DOCUMENT_SERVER_JWT_SECRET: ${DOCUMENT_SERVER_JWT_SECRET}
|
||||
DOCUMENT_SERVER_JWT_HEADER: ${DOCUMENT_SERVER_JWT_HEADER}
|
||||
DOCUMENT_SERVER_URL_PUBLIC: ${DOCUMENT_SERVER_URL_PUBLIC}
|
||||
DOCUMENT_SERVER_URL_INTERNAL: ${DOCUMENT_SERVER_URL_INTERNAL}
|
||||
DOCUMENT_SERVER_URL_CONVERTER: ${DOCUMENT_SERVER_URL_CONVERTER}
|
||||
KAFKA_HOST: ${KAFKA_HOST}
|
||||
ELK_HOST: ${ELK_HOST}
|
||||
PROXY_HOST: ${PROXY_HOST}
|
||||
volumes:
|
||||
#- /app/onlyoffice/CommunityServer/data:/app/onlyoffice/data
|
||||
- app_data:/app/onlyoffice/data
|
||||
- files_data:/var/www/products/ASC.Files/server/
|
||||
- people_data:/var/www/products/ASC.People/server/
|
||||
- crm_data:/var/www/products/ASC.CRM/server/
|
||||
- project_data:/var/www/products/ASC.Projects/server/
|
||||
- calendar_data:/var/www/products/ASC.Calendar/server/
|
||||
- mail_data:/var/www/products/ASC.Mail/server/
|
||||
|
||||
services:
|
||||
onlyoffice-notify:
|
||||
<<: *x-service-base
|
||||
image: "${REPO}/${STATUS}appserver-notify:${SRV_VERSION}"
|
||||
container_name: ${NOTIFY_HOST}
|
||||
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: ${NETWORK_NAME}
|
||||
|
||||
volumes:
|
||||
app_data:
|
||||
files_data:
|
||||
people_data:
|
||||
crm_data:
|
||||
project_data:
|
||||
calendar_data:
|
||||
mail_data:
|
@ -1,18 +0,0 @@
|
||||
PUSHD %~dp0
|
||||
call start\stop.bat
|
||||
|
||||
PUSHD %~dp0..
|
||||
|
||||
echo "Build FRONT-END"
|
||||
call yarn wipe
|
||||
call yarn install
|
||||
|
||||
echo "ASC.UrlShortener"
|
||||
call yarn install --cwd common/ASC.UrlShortener > build\ASC.UrlShortener.log
|
||||
|
||||
echo "ASC.Web.sln"
|
||||
call dotnet build ASC.Web.sln /fl1 /flp1:LogFile=build/ASC.Web.log;Verbosity=Normal
|
||||
|
||||
start /b call build\start\start.bat
|
||||
|
||||
pause
|
@ -1,6 +0,0 @@
|
||||
PUSHD %~dp0..
|
||||
|
||||
del /f /q yarn.lock
|
||||
|
||||
start /b call build\rebuild.frontend.bat
|
||||
|
2
build/run/CalendarClient.bat
Normal file
2
build/run/CalendarClient.bat
Normal file
@ -0,0 +1,2 @@
|
||||
echo "RUN ASC.Web.Calendar"
|
||||
call set BROWSER=none&&npm start --prefix ../../products/ASC.Calendar/Client
|
2
build/run/CalendarServer.bat
Normal file
2
build/run/CalendarServer.bat
Normal file
@ -0,0 +1,2 @@
|
||||
echo "RUN ASC.Calendar"
|
||||
call dotnet run --project ..\..\products\ASC.Calendar\Server\ASC.Calendar.csproj --no-build --$STORAGE_ROOT=..\..\..\Data --log__dir=..\..\..\Logs --log__name=calendar
|
2
build/run/MailClient.bat
Normal file
2
build/run/MailClient.bat
Normal file
@ -0,0 +1,2 @@
|
||||
echo "RUN ASC.Web.Mail"
|
||||
call set BROWSER=none&&npm start --prefix ../../products/ASC.Mail/Client
|
2
build/run/MailServer.bat
Normal file
2
build/run/MailServer.bat
Normal file
@ -0,0 +1,2 @@
|
||||
echo "RUN ASC.Mail"
|
||||
call dotnet run --project ..\..\products\ASC.Mail\Server\ASC.Mail.csproj --no-build --$STORAGE_ROOT=..\..\..\Data --log__dir=..\..\..\Logs --log__name=mail
|
@ -42,12 +42,14 @@ namespace ASC.Api.Core
|
||||
private static int MaxCount = 1000;
|
||||
public IHttpContextAccessor HttpContextAccessor { get; set; }
|
||||
public Tenant tenant;
|
||||
public Tenant Tenant { get { return tenant ??= TenantManager.GetCurrentTenant(HttpContextAccessor.HttpContext); } }
|
||||
public Tenant Tenant { get { return tenant ??= TenantManager.GetCurrentTenant(HttpContextAccessor?.HttpContext); } }
|
||||
|
||||
public ApiContext(IHttpContextAccessor httpContextAccessor, SecurityContext securityContext, TenantManager tenantManager)
|
||||
{
|
||||
if (httpContextAccessor == null || httpContextAccessor.HttpContext == null) return;
|
||||
SecurityContext = securityContext;
|
||||
TenantManager = tenantManager;
|
||||
HttpContextAccessor = httpContextAccessor;
|
||||
if (httpContextAccessor.HttpContext == null) return;
|
||||
|
||||
Count = MaxCount;
|
||||
var query = HttpContextAccessor.HttpContext.Request.Query;
|
||||
@ -85,9 +87,6 @@ namespace ASC.Api.Core
|
||||
{
|
||||
UpdatedSince = Convert.ToDateTime(updatedSince);
|
||||
}
|
||||
|
||||
SecurityContext = securityContext;
|
||||
TenantManager = tenantManager;
|
||||
}
|
||||
|
||||
public string[] Fields { get; set; }
|
||||
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:65458/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ASC.Api.Core": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:65459/"
|
||||
}
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@
|
||||
<AssemblyTitle>ASC.Common</AssemblyTitle>
|
||||
<Company>Ascensio System SIA</Company>
|
||||
<Product>ASC.Common</Product>
|
||||
<AssemblyVersion>0.1.3</AssemblyVersion>
|
||||
<Copyright>(c) Ascensio System SIA. All rights reserved</Copyright>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<WarningsAsErrors></WarningsAsErrors>
|
||||
@ -40,11 +41,11 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="JWT" Version="6.1.4" />
|
||||
<PackageReference Include="log4net" Version="2.0.11" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0" />
|
||||
|
@ -4,6 +4,8 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac;
|
||||
using Autofac.Configuration;
|
||||
|
||||
@ -82,13 +84,13 @@ namespace ASC.Common.DependencyInjection
|
||||
|
||||
if (!Path.IsPathRooted(folder))
|
||||
{
|
||||
if (currentDir.EndsWith(Path.Combine(Path.GetFileName(folder), Assembly.GetEntryAssembly().GetName().Name, subfolder)))
|
||||
if (currentDir.EndsWith(CrossPlatform.PathCombine(Path.GetFileName(folder), Assembly.GetEntryAssembly().GetName().Name, subfolder)))
|
||||
{
|
||||
productsDir = Path.GetFullPath(Path.Combine("..", ".."));
|
||||
productsDir = Path.GetFullPath(CrossPlatform.PathCombine("..", ".."));
|
||||
}
|
||||
else
|
||||
{
|
||||
productsDir = Path.GetFullPath(Path.Combine(currentDir, folder));
|
||||
productsDir = Path.GetFullPath(CrossPlatform.PathCombine(currentDir, folder));
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -129,8 +131,8 @@ namespace ASC.Common.DependencyInjection
|
||||
|
||||
string GetFullPath(string n)
|
||||
{
|
||||
var productPath = Path.Combine(productsDir, n, subfolder);
|
||||
return GetPath(Path.Combine(productPath, "bin"), n, SearchOption.AllDirectories) ?? GetPath(productPath, n, SearchOption.TopDirectoryOnly);
|
||||
var productPath = CrossPlatform.PathCombine(productsDir, n, subfolder);
|
||||
return GetPath(CrossPlatform.PathCombine(productPath, "bin"), n, SearchOption.AllDirectories) ?? GetPath(productPath, n, SearchOption.TopDirectoryOnly);
|
||||
}
|
||||
|
||||
static string GetPath(string dirPath, string dll, SearchOption searchOption)
|
||||
@ -155,7 +157,7 @@ namespace ASC.Common.DependencyInjection
|
||||
|
||||
public Assembly Resolving(AssemblyLoadContext context, AssemblyName assemblyName)
|
||||
{
|
||||
var path = Path.Combine(Path.GetDirectoryName(ResolvePath), $"{assemblyName.Name}.dll");
|
||||
var path = CrossPlatform.PathCombine(Path.GetDirectoryName(ResolvePath), $"{assemblyName.Name}.dll");
|
||||
|
||||
if (!File.Exists(path)) return null;
|
||||
|
||||
|
@ -384,7 +384,7 @@ namespace ASC.Common.Logging
|
||||
Configuration = configuration;
|
||||
ConfigurationExtension = configurationExtension;
|
||||
|
||||
LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(Path.Combine(Configuration["pathToConf"], "nlog.config"));
|
||||
LogManager.Configuration = new NLog.Config.XmlLoggingConfiguration(CrossPlatform.PathCombine(Configuration["pathToConf"], "nlog.config"));
|
||||
LogManager.ThrowConfigExceptions = false;
|
||||
|
||||
var settings = ConfigurationExtension.GetSetting<NLogSettings>("log");
|
||||
|
@ -29,6 +29,8 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using NLog;
|
||||
using NLog.Common;
|
||||
using NLog.Targets;
|
||||
@ -87,7 +89,7 @@ namespace ASC.Common.Logging
|
||||
return;
|
||||
|
||||
if (!Path.IsPathRooted(dirPath))
|
||||
dirPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, dirPath);
|
||||
dirPath = CrossPlatform.PathCombine(AppDomain.CurrentDomain.BaseDirectory, dirPath);
|
||||
|
||||
var directory = new DirectoryInfo(dirPath);
|
||||
|
||||
|
53
common/ASC.Common/Utils/CrossPlatformUtils.cs
Normal file
53
common/ASC.Common/Utils/CrossPlatformUtils.cs
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
*
|
||||
* (c) Copyright Ascensio System Limited 2010-2018
|
||||
*
|
||||
* This program is freeware. You can redistribute it and/or modify it under the terms of the GNU
|
||||
* General Public License (GPL) version 3 as published by the Free Software Foundation (https://www.gnu.org/copyleft/gpl.html).
|
||||
* In accordance with Section 7(a) of the GNU GPL 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 more details, see GNU GPL at https://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
* You can contact Ascensio System SIA by email at sales@onlyoffice.com
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions of ONLYOFFICE must display
|
||||
* Appropriate Legal Notices, as required under Section 5 of the GNU GPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7 § 3(b) of the GNU GPL you must retain the original ONLYOFFICE logo which contains
|
||||
* relevant author attributions when distributing the software. If the display of the logo in its graphic
|
||||
* form is not reasonably feasible for technical reasons, you must include the words "Powered by ONLYOFFICE"
|
||||
* in every copy of the program you distribute.
|
||||
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
*/
|
||||
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace ASC.Common.Utils
|
||||
{
|
||||
public static class CrossPlatform
|
||||
{
|
||||
public static string PathCombine(string basePath, params string[] additional)
|
||||
{
|
||||
var splits = additional.Select(s => s.Split(pathSplitCharacters)).ToArray();
|
||||
var totalLength = splits.Sum(arr => arr.Length);
|
||||
var segments = new string[totalLength + 1];
|
||||
segments[0] = basePath;
|
||||
var i = 0;
|
||||
foreach (var split in splits)
|
||||
{
|
||||
foreach (var value in split)
|
||||
{
|
||||
i++;
|
||||
segments[i] = value;
|
||||
}
|
||||
}
|
||||
return Path.Combine(segments);
|
||||
}
|
||||
|
||||
static char[] pathSplitCharacters = new char[] { '/', '\\' };
|
||||
}
|
||||
}
|
@ -57,11 +57,11 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MailKit" Version="2.5.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.5" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.2" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0-alpha.2" />
|
||||
<PackageReference Include="System.Text.Json" Version="5.0.1" />
|
||||
<PackageReference Include="System.Text.Json" Version="5.0.2" />
|
||||
<PackageReference Include="Telegram.Bot" Version="15.7.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -576,12 +576,11 @@ namespace ASC.Core.Data
|
||||
|
||||
using var tr = UserDbContext.Database.BeginTransaction();
|
||||
|
||||
UserDbContext.AddOrUpdate(r => r.UserGroups, FromUserGroupRefToUserGroup(r));
|
||||
|
||||
var user = GetUserQuery(tenant).FirstOrDefault(a => a.Tenant == tenant && a.Id == r.UserId);
|
||||
if (user != null)
|
||||
{
|
||||
user.LastModified = r.LastModified;
|
||||
UserDbContext.AddOrUpdate(r => r.UserGroups, FromUserGroupRefToUserGroup(r));
|
||||
}
|
||||
|
||||
UserDbContext.SaveChanges();
|
||||
|
@ -54,7 +54,8 @@ namespace ASC.Security.Cryptography
|
||||
|
||||
private readonly ILog log;
|
||||
private static readonly DateTime _from = new DateTime(2010, 01, 01, 0, 0, 0, DateTimeKind.Utc);
|
||||
internal readonly TimeSpan ValidInterval;
|
||||
internal readonly TimeSpan ValidEmailKeyInterval;
|
||||
internal readonly TimeSpan ValidAuthKeyInterval;
|
||||
|
||||
private MachinePseudoKeys MachinePseudoKeys { get; }
|
||||
private TenantManager TenantManager { get; }
|
||||
@ -67,8 +68,13 @@ namespace ASC.Security.Cryptography
|
||||
{
|
||||
validInterval = TimeSpan.FromDays(7);
|
||||
}
|
||||
if (!TimeSpan.TryParse(configuration["auth:validinterval"], out var authValidInterval))
|
||||
{
|
||||
validInterval = TimeSpan.FromDays(7);
|
||||
}
|
||||
|
||||
ValidInterval = validInterval;
|
||||
ValidEmailKeyInterval = validInterval;
|
||||
ValidAuthKeyInterval = authValidInterval;
|
||||
log = options.CurrentValue;
|
||||
}
|
||||
|
||||
@ -232,26 +238,31 @@ namespace ASC.Security.Cryptography
|
||||
switch (type)
|
||||
{
|
||||
case ConfirmType.EmpInvite:
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + (int)emplType, key, Provider.ValidInterval);
|
||||
break;
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + (int)emplType, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
|
||||
case ConfirmType.LinkInvite:
|
||||
checkKeyResult = Provider.ValidateEmailKey(type.ToString() + (int)emplType, key, Provider.ValidInterval);
|
||||
break;
|
||||
checkKeyResult = Provider.ValidateEmailKey(type.ToString() + (int)emplType, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
|
||||
case ConfirmType.PortalOwnerChange:
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + uiD.HasValue, key, Provider.ValidInterval);
|
||||
break;
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + uiD.HasValue, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
|
||||
case ConfirmType.EmailChange:
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + AuthContext.CurrentAccount.ID, key, Provider.ValidInterval);
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + AuthContext.CurrentAccount.ID, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
case ConfirmType.PasswordChange:
|
||||
|
||||
var hash = Authentication.GetUserPasswordStamp(UserManager.GetUserByEmail(email).ID).ToString("s");
|
||||
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + hash, key, Provider.ValidInterval);
|
||||
break;
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + hash, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
|
||||
case ConfirmType.Activation:
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + uiD, key, Provider.ValidInterval);
|
||||
break;
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + uiD, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
|
||||
case ConfirmType.ProfileRemove:
|
||||
// validate UiD
|
||||
if (p == 1)
|
||||
@ -261,13 +272,22 @@ namespace ASC.Security.Cryptography
|
||||
return ValidationResult.Invalid;
|
||||
}
|
||||
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + uiD, key, Provider.ValidInterval);
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type + uiD, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
|
||||
case ConfirmType.Wizard:
|
||||
checkKeyResult = Provider.ValidateEmailKey("" + type, key, Provider.ValidInterval);
|
||||
break;
|
||||
checkKeyResult = Provider.ValidateEmailKey("" + type, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
|
||||
case ConfirmType.PhoneActivation:
|
||||
case ConfirmType.PhoneAuth:
|
||||
case ConfirmType.TfaActivation:
|
||||
case ConfirmType.TfaAuth:
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type, key, Provider.ValidAuthKeyInterval);
|
||||
break;
|
||||
|
||||
default:
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type, key, Provider.ValidInterval);
|
||||
checkKeyResult = Provider.ValidateEmailKey(email + type, key, Provider.ValidEmailKeyInterval);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core.Encryption;
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
@ -292,12 +293,12 @@ namespace ASC.Data.Encryption
|
||||
{
|
||||
var dir = string.IsNullOrEmpty(TempDir) ? Path.GetDirectoryName(filePath) : TempDir;
|
||||
var name = Path.GetFileNameWithoutExtension(filePath);
|
||||
var result = Path.Combine(dir, string.Format("{0}_{1}{2}", Storage, name, ext));
|
||||
var result = CrossPlatform.PathCombine(dir, string.Format("{0}_{1}{2}", Storage, name, ext));
|
||||
var index = 1;
|
||||
|
||||
while (File.Exists(result))
|
||||
{
|
||||
result = Path.Combine(dir, string.Format("{0}_{1}({2}){3}", Storage, name, index++, ext));
|
||||
result = CrossPlatform.PathCombine(dir, string.Format("{0}_{1}({2}){3}", Storage, name, index++, ext));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:64832/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ASC.Data.Reassigns": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:64833/"
|
||||
}
|
||||
}
|
||||
}
|
@ -32,6 +32,7 @@ using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
using ASC.Data.Storage.Configuration;
|
||||
using ASC.Security.Cryptography;
|
||||
@ -305,7 +306,7 @@ namespace ASC.Data.Storage
|
||||
var filePaths = ListFilesRelative(domain, path, pattern, recursive);
|
||||
return Array.ConvertAll(
|
||||
filePaths,
|
||||
x => GetUri(domain, Path.Combine(PathUtils.Normalize(path), x)));
|
||||
x => GetUri(domain, CrossPlatform.PathCombine(PathUtils.Normalize(path), x)));
|
||||
}
|
||||
|
||||
public bool IsFile(string path)
|
||||
|
@ -30,6 +30,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Data.Storage;
|
||||
|
||||
using Microsoft.Extensions.Options;
|
||||
@ -177,7 +178,7 @@ namespace ASC.Core.ChunkedUploader
|
||||
|
||||
private string GetPathWithId(string id)
|
||||
{
|
||||
return Path.Combine(StoragePath, id + ".session");
|
||||
return CrossPlatform.PathCombine(StoragePath, id + ".session");
|
||||
}
|
||||
}
|
||||
}
|
@ -30,6 +30,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Common.Web;
|
||||
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
@ -103,12 +104,12 @@ namespace ASC.Data.Storage.DiscStorage
|
||||
{
|
||||
var pathInfo = GetRouteValue("pathInfo").Replace('/', Path.DirectorySeparatorChar);
|
||||
|
||||
var path = Path.Combine(physPath, pathInfo);
|
||||
var path = CrossPlatform.PathCombine(physPath, pathInfo);
|
||||
|
||||
var tenant = GetRouteValue("0");
|
||||
if (string.IsNullOrEmpty(tenant))
|
||||
{
|
||||
tenant = Path.Combine(GetRouteValue("t1"), GetRouteValue("t2"), GetRouteValue("t3"));
|
||||
tenant = CrossPlatform.PathCombine(GetRouteValue("t1"), GetRouteValue("t2"), GetRouteValue("t3"));
|
||||
}
|
||||
|
||||
path = path.Replace("{0}", tenant);
|
||||
|
@ -31,6 +31,7 @@ using System.Linq;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
using ASC.Core.Encryption;
|
||||
using ASC.Data.Storage.Configuration;
|
||||
@ -647,7 +648,7 @@ namespace ASC.Data.Storage.DiscStorage
|
||||
// Copy each file into it's new directory.
|
||||
foreach (var fi in source.GetFiles())
|
||||
{
|
||||
var fp = Path.Combine(target.ToString(), fi.Name);
|
||||
var fp = CrossPlatform.PathCombine(target.ToString(), fi.Name);
|
||||
fi.CopyTo(fp, true);
|
||||
var size = Crypt.GetFileSize(fp);
|
||||
QuotaUsedAdd(newdomain, size);
|
||||
@ -698,7 +699,7 @@ namespace ASC.Data.Storage.DiscStorage
|
||||
{
|
||||
var pathMap = GetPath(domain);
|
||||
//Build Dir
|
||||
var target = Path.Combine(pathMap.PhysicalPath, PathUtils.Normalize(path));
|
||||
var target = CrossPlatform.PathCombine(pathMap.PhysicalPath, PathUtils.Normalize(path));
|
||||
ValidatePath(target);
|
||||
return target;
|
||||
}
|
||||
|
@ -25,8 +25,10 @@
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using System.IO;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
namespace ASC.Data.Storage.DiscStorage
|
||||
{
|
||||
internal class MappedPath
|
||||
@ -44,7 +46,7 @@ namespace ASC.Data.Storage.DiscStorage
|
||||
tenant = tenant.Trim('/');
|
||||
|
||||
ppath = PathUtils.ResolvePhysicalPath(ppath, storageConfig);
|
||||
PhysicalPath = ppath.IndexOf('{') == -1 && appendTenant ? Path.Combine(ppath, tenant) : string.Format(ppath, tenant);
|
||||
PhysicalPath = ppath.IndexOf('{') == -1 && appendTenant ? CrossPlatform.PathCombine(ppath, tenant) : string.Format(ppath, tenant);
|
||||
}
|
||||
|
||||
public MappedPath AppendDomain(string domain)
|
||||
@ -52,7 +54,7 @@ namespace ASC.Data.Storage.DiscStorage
|
||||
domain = domain.Replace('.', '_'); //Domain prep. Remove dots
|
||||
return new MappedPath(PathUtils)
|
||||
{
|
||||
PhysicalPath = Path.Combine(PhysicalPath, PathUtils.Normalize(domain, true)),
|
||||
PhysicalPath = CrossPlatform.PathCombine(PhysicalPath, PathUtils.Normalize(domain, true)),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
@ -113,7 +114,7 @@ namespace ASC.Data.Storage
|
||||
|
||||
if (!Path.IsPathRooted(physPath))
|
||||
{
|
||||
physPath = Path.GetFullPath(Path.Combine(HostEnvironment.ContentRootPath, physPath.Trim(Path.DirectorySeparatorChar)));
|
||||
physPath = Path.GetFullPath(CrossPlatform.PathCombine(HostEnvironment.ContentRootPath, physPath.Trim(Path.DirectorySeparatorChar)));
|
||||
}
|
||||
return physPath;
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:63105/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ASC.Data.Storage": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:63106/"
|
||||
}
|
||||
}
|
||||
}
|
@ -35,6 +35,7 @@ using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Threading.Progress;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
using ASC.Core.Common.Settings;
|
||||
using ASC.Core.Tenants;
|
||||
@ -269,7 +270,7 @@ namespace ASC.Data.Storage
|
||||
foreach (var file in directoryFiles)
|
||||
{
|
||||
var filePath = file.Substring(mappedPath.TrimEnd('/').Length);
|
||||
tasks.Add(StaticUploader.UploadFileAsync(Path.Combine(relativePath, filePath), file, (res) => StepDone()));
|
||||
tasks.Add(StaticUploader.UploadFileAsync(CrossPlatform.PathCombine(relativePath, filePath), file, (res) => StepDone()));
|
||||
}
|
||||
|
||||
await Task.WhenAll(tasks);
|
||||
@ -280,7 +281,7 @@ namespace ASC.Data.Storage
|
||||
foreach (var file in directoryFiles)
|
||||
{
|
||||
var filePath = file.Substring(mappedPath.TrimEnd('/').Length);
|
||||
StaticUploader.UploadFileAsync(Path.Combine(relativePath, filePath), file, (res) => StepDone()).Wait();
|
||||
StaticUploader.UploadFileAsync(CrossPlatform.PathCombine(relativePath, filePath), file, (res) => StepDone()).Wait();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
using ASC.Security.Cryptography;
|
||||
|
||||
@ -75,7 +76,7 @@ namespace ASC.Data.Storage.DiscStorage
|
||||
}
|
||||
|
||||
var storage = storageFactory.GetStorage(tenantManager.GetCurrentTenant().TenantId.ToString(CultureInfo.InvariantCulture), _module);
|
||||
var path = Path.Combine(_path, GetRouteValue("pathInfo").Replace('/', Path.DirectorySeparatorChar));
|
||||
var path = CrossPlatform.PathCombine(_path, GetRouteValue("pathInfo").Replace('/', Path.DirectorySeparatorChar));
|
||||
var header = context.Request.Query[Constants.QUERY_HEADER].FirstOrDefault() ?? "";
|
||||
|
||||
var auth = context.Request.Query[Constants.QUERY_AUTH].FirstOrDefault() ?? "";
|
||||
|
@ -33,6 +33,7 @@ using System.Net;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
using ASC.Core.Common.Settings;
|
||||
using ASC.Data.Storage.Configuration;
|
||||
@ -219,7 +220,7 @@ namespace ASC.Data.Storage
|
||||
if (Uri.IsWellFormedUriString(path, UriKind.Relative) && HttpContextAccessor?.HttpContext != null)
|
||||
{
|
||||
//Local
|
||||
Existing[path] = File.Exists(Path.Combine(HostEnvironment.ContentRootPath, path));
|
||||
Existing[path] = File.Exists(CrossPlatform.PathCombine(HostEnvironment.ContentRootPath, path));
|
||||
}
|
||||
if (Uri.IsWellFormedUriString(path, UriKind.Absolute))
|
||||
{
|
||||
|
@ -28,6 +28,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
@ -160,5 +161,18 @@ namespace ASC.FederatedLogin.LoginProviders
|
||||
}
|
||||
|
||||
public abstract LoginProfile GetLoginProfile(string accessToken);
|
||||
}
|
||||
|
||||
public class BaseLoginProviderExtension
|
||||
{
|
||||
public static void Register(DIHelper services)
|
||||
{
|
||||
services.TryAdd<BoxLoginProvider>();
|
||||
services.TryAdd<DropboxLoginProvider>();
|
||||
services.TryAdd<OneDriveLoginProvider>();
|
||||
services.TryAdd<DocuSignLoginProvider>();
|
||||
services.TryAdd<GoogleLoginProvider>();
|
||||
services.TryAdd<WordpressLoginProvider>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:58519/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ASC.FederatedLogin": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:58520/"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:56421/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ASC.Notify.Textile": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:56422/"
|
||||
}
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.8.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.9" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.9" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -37,7 +37,7 @@ namespace ASC.Resource.Manager
|
||||
{
|
||||
if(args[i] == "--pathToConf" || args[i] == "--ConnectionStrings:default:connectionString")
|
||||
{
|
||||
i = i + 2;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
copy.Add(args[i]);
|
||||
@ -219,12 +219,17 @@ namespace ASC.Resource.Manager
|
||||
|
||||
regex = new Regex(@"\<AssemblyName\>(\S*)\<\/AssemblyName\>", RegexOptions.IgnoreCase);
|
||||
matches = regex.Matches(File.ReadAllText(asmbl));
|
||||
string assName = "";
|
||||
if (!matches.Any() || matches[0].Groups.Count < 2)
|
||||
{
|
||||
return;
|
||||
assName = Path.GetFileNameWithoutExtension(asmbl);
|
||||
}
|
||||
else
|
||||
{
|
||||
assName = matches[0].Groups[1].Value;
|
||||
}
|
||||
|
||||
key = CheckExist(fileName, $"{nsp}.{name},{matches[0].Groups[1].Value}", exportPath);
|
||||
key = CheckExist(fileName, $"{nsp}.{name},{assName}", exportPath);
|
||||
var additional = string.Join(",", keys.Where(r => r.Length > 1 && r.Contains("*")).ToArray());
|
||||
|
||||
if (!string.IsNullOrEmpty(additional))
|
||||
@ -298,6 +303,7 @@ namespace ASC.Resource.Manager
|
||||
var bag = new ConcurrentBag<string>();
|
||||
|
||||
var csFiles = Directory.GetFiles(Path.GetFullPath(path), "*.cs", SearchOption.AllDirectories).Except(Directory.GetFiles(Path.GetFullPath(path), "*Resource.Designer.cs", SearchOption.AllDirectories));
|
||||
csFiles = csFiles.Concat(Directory.GetFiles(Path.GetFullPath(path), "*.cshtml", SearchOption.AllDirectories)).ToArray();
|
||||
csFiles = csFiles.Concat(Directory.GetFiles(Path.GetFullPath(path), "*.aspx", SearchOption.AllDirectories)).ToArray();
|
||||
csFiles = csFiles.Concat(Directory.GetFiles(Path.GetFullPath(path), "*.Master", SearchOption.AllDirectories)).ToArray();
|
||||
csFiles = csFiles.Concat(Directory.GetFiles(Path.GetFullPath(path), "*.ascx", SearchOption.AllDirectories)).ToArray();
|
||||
|
1344
common/ASC.Socket.IO/yarn.lock
Normal file
1344
common/ASC.Socket.IO/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@ -19,6 +19,8 @@
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
<Compile Remove="Properties\**" />
|
||||
<EmbeddedResource Remove="Properties\**" />
|
||||
<None Remove="Properties\**" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -13,8 +13,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Properties\**" />
|
||||
<Compile Remove="VoxImplant\**" />
|
||||
<EmbeddedResource Remove="Properties\**" />
|
||||
<EmbeddedResource Remove="VoxImplant\**" />
|
||||
<None Remove="Properties\**" />
|
||||
<None Remove="VoxImplant\**" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -31,10 +34,6 @@
|
||||
<ProjectReference Include="..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="protos\CachedVoipItem.proto" />
|
||||
</ItemGroup>
|
||||
|
@ -14,6 +14,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.7" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -24,8 +24,13 @@
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
@ -37,18 +42,40 @@ namespace ASC.ApiSystem
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args)
|
||||
{
|
||||
return Host.CreateDefaultBuilder(args)
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
var builder = webBuilder.UseStartup<Startup>();
|
||||
|
||||
builder.ConfigureKestrel((hostingContext, serverOptions) =>
|
||||
{
|
||||
var kestrelConfig = hostingContext.Configuration.GetSection("Kestrel");
|
||||
|
||||
if (!kestrelConfig.Exists()) return;
|
||||
|
||||
var unixSocket = kestrelConfig.GetValue<string>("ListenUnixSocket");
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(unixSocket))
|
||||
{
|
||||
unixSocket = String.Format(unixSocket, hostingContext.HostingEnvironment.ApplicationName.Replace("ASC.", "").Replace(".", ""));
|
||||
|
||||
serverOptions.ListenUnixSocket(unixSocket);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.ConfigureAppConfiguration((hostingContext, config) =>
|
||||
{
|
||||
@ -56,7 +83,7 @@ namespace ASC.ApiSystem
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostingContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostingContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
|
||||
config.SetBasePath(path);
|
||||
@ -74,6 +101,5 @@ namespace ASC.ApiSystem
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +1,29 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5010",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "apisystem",
|
||||
"log__dir": "../../../Logs"
|
||||
}
|
||||
},
|
||||
"ASC.ApiSystem": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"applicationUrl": "http://localhost:5010",
|
||||
"launchUrl": "http://localhost:5010/portal/test",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "apisystem",
|
||||
"log__dir": "../../../Logs"
|
||||
"log__dir": "../../../Logs",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_URLS": "http://localhost:5010"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"launchUrl": "http://localhost:5010/portal/test",
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "apisystem",
|
||||
"log__dir": "../../../Logs",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_URLS": "http://localhost:5010"
|
||||
},
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:59977/",
|
||||
"sslPort": 44344
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ASC.AuditTrail": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000"
|
||||
}
|
||||
}
|
||||
}
|
@ -23,6 +23,8 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -34,7 +34,8 @@ using System.Threading;
|
||||
using System.Xml.Linq;
|
||||
|
||||
using ASC.Common;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
namespace ASC.Data.Backup
|
||||
{
|
||||
[Scope]
|
||||
@ -103,7 +104,7 @@ namespace ASC.Data.Backup
|
||||
{
|
||||
var map = new ExeConfigurationFileMap
|
||||
{
|
||||
ExeConfigFilename = string.Compare(Path.GetExtension(config), ".config", true) == 0 ? config : Path.Combine(config, "Web.config")
|
||||
ExeConfigFilename = string.Compare(Path.GetExtension(config), ".config", true) == 0 ? config : CrossPlatform.PathCombine(config, "Web.config")
|
||||
};
|
||||
return ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ using System.Xml.XPath;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Data.Backup.EF.Context;
|
||||
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@ -37,7 +38,7 @@ namespace ASC.Data.Backup
|
||||
var file = connectionString.ElementInformation.Source;
|
||||
if ("web.connections.config".Equals(Path.GetFileName(file), StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
file = Path.Combine(Path.GetDirectoryName(file), "Web.config");
|
||||
file = CrossPlatform.PathCombine(Path.GetDirectoryName(file), "Web.config");
|
||||
}
|
||||
var xconfig = XDocument.Load(file);
|
||||
var provider = xconfig.XPathSelectElement("/configuration/system.data/DbProviderFactories/add[@invariant='" + connectionString.ProviderName + "']");
|
||||
|
@ -32,6 +32,7 @@ using System.Xml.Linq;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Data.Storage;
|
||||
|
||||
using Microsoft.Extensions.Options;
|
||||
@ -148,7 +149,7 @@ namespace ASC.Data.Backup
|
||||
|
||||
private string GetBackupPath(FileBackupInfo backupInfo)
|
||||
{
|
||||
return Path.Combine(backupInfo.Module, Path.Combine(backupInfo.Domain, backupInfo.Path.Replace('/', '\\')));
|
||||
return CrossPlatform.PathCombine(backupInfo.Module, CrossPlatform.PathCombine(backupInfo.Domain, backupInfo.Path.Replace('/', '\\')));
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,6 +28,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Readers;
|
||||
using SharpCompress.Writers;
|
||||
@ -65,7 +67,7 @@ namespace ASC.Data.Backup
|
||||
|
||||
public ZipReadOperator(string targetFile)
|
||||
{
|
||||
tmpdir = Path.Combine(Path.GetDirectoryName(targetFile), Path.GetFileNameWithoutExtension(targetFile).Replace('>', '_').Replace(':', '_').Replace('?', '_'));
|
||||
tmpdir = CrossPlatform.PathCombine(Path.GetDirectoryName(targetFile), Path.GetFileNameWithoutExtension(targetFile).Replace('>', '_').Replace(':', '_').Replace('?', '_'));
|
||||
Entries = new List<string>();
|
||||
|
||||
using var stream = File.OpenRead(targetFile);
|
||||
@ -82,7 +84,7 @@ namespace ASC.Data.Backup
|
||||
fullPath = streamReader.ReadToEnd().TrimEnd(char.MinValue);
|
||||
}
|
||||
|
||||
fullPath = Path.Combine(tmpdir, fullPath);
|
||||
fullPath = CrossPlatform.PathCombine(tmpdir, fullPath);
|
||||
|
||||
if (!Directory.Exists(Path.GetDirectoryName(fullPath)))
|
||||
{
|
||||
@ -111,7 +113,7 @@ namespace ASC.Data.Backup
|
||||
|
||||
public Stream GetEntry(string key)
|
||||
{
|
||||
var filePath = Path.Combine(tmpdir, key);
|
||||
var filePath = CrossPlatform.PathCombine(tmpdir, key);
|
||||
return File.Exists(filePath) ? File.Open(filePath, FileMode.Open, FileAccess.ReadWrite, FileShare.Read) : null;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -11,14 +15,41 @@ using Microsoft.Extensions.Hosting;
|
||||
namespace ASC.Data.Backup
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
await Host.CreateDefaultBuilder(args)
|
||||
{
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
var builder = webBuilder.UseStartup<Startup>();
|
||||
|
||||
builder.ConfigureKestrel((hostingContext, serverOptions) =>
|
||||
{
|
||||
var kestrelConfig = hostingContext.Configuration.GetSection("Kestrel");
|
||||
|
||||
if (!kestrelConfig.Exists()) return;
|
||||
|
||||
var unixSocket = kestrelConfig.GetValue<string>("ListenUnixSocket");
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(unixSocket))
|
||||
{
|
||||
unixSocket = String.Format(unixSocket, hostingContext.HostingEnvironment.ApplicationName.Replace("ASC.", "").Replace(".", ""));
|
||||
|
||||
serverOptions.ListenUnixSocket(unixSocket);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
@ -26,7 +57,7 @@ namespace ASC.Data.Backup
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
@ -44,10 +75,7 @@ namespace ASC.Data.Backup
|
||||
{"pathToConf", path }
|
||||
}
|
||||
);
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build()
|
||||
.RunAsync();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,31 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5012/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "backup",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
}
|
||||
},
|
||||
"ASC.Data.Backup": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"launchUrl": "http://localhost:5012/api/2.0/backup/backuptmp",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "backup",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_URLS": "http://localhost:5012"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"launchUrl": "http://localhost:5012/api/2.0/backup/backuptmp",
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "backup",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_URLS": "http://localhost:5012"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5012/"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
namespace ASC.Data.Backup.Service
|
||||
{
|
||||
public class BackupSettings
|
||||
@ -52,7 +54,7 @@ namespace ASC.Data.Backup.Service
|
||||
}
|
||||
if (Elements.Count == 0)
|
||||
{
|
||||
return Path.Combine("..", "..", "WebStudio");
|
||||
return CrossPlatform.PathCombine("..", "..", "WebStudio");
|
||||
}
|
||||
if (Elements.Count == 1)
|
||||
{
|
||||
|
@ -34,6 +34,7 @@ using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Threading.Progress;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
using ASC.Core.Tenants;
|
||||
using ASC.Data.Backup.Contracts;
|
||||
@ -378,7 +379,7 @@ namespace ASC.Data.Backup.Service
|
||||
var dateTime = coreBaseSettings.Standalone ? DateTime.Now : DateTime.UtcNow;
|
||||
var backupName = string.Format("{0}_{1:yyyy-MM-dd_HH-mm-ss}.{2}", tenantManager.GetTenant(TenantId).TenantAlias, dateTime, ArchiveFormat);
|
||||
|
||||
var tempFile = Path.Combine(TempFolder, backupName);
|
||||
var tempFile = CrossPlatform.PathCombine(TempFolder, backupName);
|
||||
var storagePath = tempFile;
|
||||
try
|
||||
{
|
||||
|
@ -28,7 +28,8 @@ using System;
|
||||
using System.IO;
|
||||
|
||||
using ASC.Common;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
namespace ASC.Data.Backup.Storage
|
||||
{
|
||||
[Scope]
|
||||
@ -40,7 +41,7 @@ namespace ASC.Data.Backup.Storage
|
||||
{
|
||||
throw new FileNotFoundException("Directory not found.");
|
||||
}
|
||||
var storagePath = Path.Combine(storageBasePath, Path.GetFileName(localPath));
|
||||
var storagePath = CrossPlatform.PathCombine(storageBasePath, Path.GetFileName(localPath));
|
||||
if (localPath != storagePath)
|
||||
{
|
||||
File.Copy(localPath, storagePath, true);
|
||||
|
@ -36,6 +36,7 @@ using System.Xml.Linq;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
using ASC.Core.Common.EF;
|
||||
using ASC.Data.Backup.EF.Context;
|
||||
@ -152,9 +153,9 @@ namespace ASC.Data.Backup.Tasks
|
||||
excluded.Add("res_");
|
||||
|
||||
var dir = Path.GetDirectoryName(BackupFilePath);
|
||||
var subDir = Path.Combine(dir, Path.GetFileNameWithoutExtension(BackupFilePath));
|
||||
var schemeDir = Path.Combine(subDir, KeyHelper.GetDatabaseSchema());
|
||||
var dataDir = Path.Combine(subDir, KeyHelper.GetDatabaseData());
|
||||
var subDir = CrossPlatform.PathCombine(dir, Path.GetFileNameWithoutExtension(BackupFilePath));
|
||||
var schemeDir = CrossPlatform.PathCombine(subDir, KeyHelper.GetDatabaseSchema());
|
||||
var dataDir = CrossPlatform.PathCombine(subDir, KeyHelper.GetDatabaseData());
|
||||
|
||||
if (!Directory.Exists(schemeDir))
|
||||
{
|
||||
@ -227,7 +228,7 @@ namespace ASC.Data.Backup.Tasks
|
||||
.FirstOrDefault());
|
||||
creates.Append(";");
|
||||
|
||||
var path = Path.Combine(dir, t);
|
||||
var path = CrossPlatform.PathCombine(dir, t);
|
||||
using (var stream = File.OpenWrite(path))
|
||||
{
|
||||
var bytes = Encoding.UTF8.GetBytes(creates.ToString());
|
||||
@ -326,7 +327,7 @@ namespace ASC.Data.Backup.Tasks
|
||||
}
|
||||
}
|
||||
|
||||
var path = Path.Combine(dir, t);
|
||||
var path = CrossPlatform.PathCombine(dir, t);
|
||||
|
||||
var offset = 0;
|
||||
|
||||
@ -443,11 +444,11 @@ namespace ASC.Data.Backup.Tasks
|
||||
Logger.Debug("begin backup storage");
|
||||
|
||||
var dir = Path.GetDirectoryName(BackupFilePath);
|
||||
var subDir = Path.Combine(dir, Path.GetFileNameWithoutExtension(BackupFilePath));
|
||||
var subDir = CrossPlatform.PathCombine(dir, Path.GetFileNameWithoutExtension(BackupFilePath));
|
||||
|
||||
for (var i = 0; i < files.Count; i += TasksLimit)
|
||||
{
|
||||
var storageDir = Path.Combine(subDir, KeyHelper.GetStorage());
|
||||
var storageDir = CrossPlatform.PathCombine(subDir, KeyHelper.GetStorage());
|
||||
|
||||
if (!Directory.Exists(storageDir))
|
||||
{
|
||||
@ -470,7 +471,7 @@ namespace ASC.Data.Backup.Tasks
|
||||
|
||||
var restoreInfoXml = new XElement("storage_restore", files.Select(file => (object)file.ToXElement()).ToArray());
|
||||
|
||||
var tmpPath = Path.Combine(subDir, KeyHelper.GetStorageRestoreInfoZipKey());
|
||||
var tmpPath = CrossPlatform.PathCombine(subDir, KeyHelper.GetStorageRestoreInfoZipKey());
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(tmpPath));
|
||||
|
||||
using (var tmpFile = File.OpenWrite(tmpPath))
|
||||
@ -490,7 +491,7 @@ namespace ASC.Data.Backup.Tasks
|
||||
private async Task DoDumpFile(BackupFileInfo file, string dir)
|
||||
{
|
||||
var storage = StorageFactory.GetStorage(ConfigPath, file.Tenant.ToString(), file.Module);
|
||||
var filePath = Path.Combine(dir, file.GetZipKey());
|
||||
var filePath = CrossPlatform.PathCombine(dir, file.GetZipKey());
|
||||
var dirName = Path.GetDirectoryName(filePath);
|
||||
|
||||
Logger.DebugFormat("backup file {0}", filePath);
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
using System.IO;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Data.Backup.Tasks.Modules;
|
||||
|
||||
namespace ASC.Data.Backup.Tasks
|
||||
@ -66,7 +67,7 @@ namespace ASC.Data.Backup.Tasks
|
||||
|
||||
public static string GetZipKey(this BackupFileInfo file)
|
||||
{
|
||||
return Path.Combine(file.Module, file.Domain, file.Path);
|
||||
return CrossPlatform.PathCombine(file.Module, file.Domain, file.Path);
|
||||
}
|
||||
|
||||
public static string GetStorage()
|
||||
|
@ -34,6 +34,7 @@ using System.Xml.Linq;
|
||||
using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core;
|
||||
using ASC.Core.Billing;
|
||||
using ASC.Core.Tenants;
|
||||
@ -286,7 +287,7 @@ namespace ASC.Data.Backup.Tasks
|
||||
var key = file.GetZipKey();
|
||||
if (Dump)
|
||||
{
|
||||
key = Path.Combine(KeyHelper.GetStorage(), key);
|
||||
key = CrossPlatform.PathCombine(KeyHelper.GetStorage(), key);
|
||||
}
|
||||
using var stream = dataReader.GetEntry(key);
|
||||
try
|
||||
|
@ -31,6 +31,7 @@ using System.Linq;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core.Tenants;
|
||||
using ASC.Data.Backup.Extensions;
|
||||
using ASC.Data.Backup.Tasks.Modules;
|
||||
@ -246,7 +247,7 @@ namespace ASC.Data.Backup.Tasks
|
||||
if (!Directory.Exists(BackupDirectory ?? DefaultDirectoryName))
|
||||
Directory.CreateDirectory(BackupDirectory ?? DefaultDirectoryName);
|
||||
|
||||
return Path.Combine(BackupDirectory ?? DefaultDirectoryName, tenantAlias + DateTime.UtcNow.ToString("(yyyy-MM-dd HH-mm-ss)") + ".backup");
|
||||
return CrossPlatform.PathCombine(BackupDirectory ?? DefaultDirectoryName, tenantAlias + DateTime.UtcNow.ToString("(yyyy-MM-dd HH-mm-ss)") + ".backup");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,8 @@
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
namespace ASC.Data.Backup.Utils
|
||||
{
|
||||
internal static class PathHelper
|
||||
@ -40,7 +42,7 @@ namespace ASC.Data.Backup.Utils
|
||||
{
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.Combine(basePath, path);
|
||||
path = CrossPlatform.PathCombine(basePath, path);
|
||||
}
|
||||
return Path.GetFullPath(path);
|
||||
}
|
||||
@ -49,7 +51,7 @@ namespace ASC.Data.Backup.Utils
|
||||
{
|
||||
if (!Path.HasExtension(path))
|
||||
{
|
||||
path = Path.Combine(path, "Web.config");
|
||||
path = CrossPlatform.PathCombine(path, "Web.config");
|
||||
}
|
||||
return ToRootedPath(path);
|
||||
}
|
||||
@ -59,7 +61,7 @@ namespace ASC.Data.Backup.Utils
|
||||
string tempPath;
|
||||
do
|
||||
{
|
||||
tempPath = Path.Combine(tempDir, Path.GetRandomFileName());
|
||||
tempPath = CrossPlatform.PathCombine(tempDir, Path.GetRandomFileName());
|
||||
} while (File.Exists(tempPath));
|
||||
return tempPath;
|
||||
}
|
||||
|
@ -22,6 +22,8 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -22,10 +22,14 @@
|
||||
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -36,13 +40,40 @@ namespace ASC.Data.Storage.Encryption
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
await Host.CreateDefaultBuilder(args)
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
var builder = webBuilder.UseStartup<Startup>();
|
||||
|
||||
builder.ConfigureKestrel((hostingContext, serverOptions) =>
|
||||
{
|
||||
var kestrelConfig = hostingContext.Configuration.GetSection("Kestrel");
|
||||
|
||||
if (!kestrelConfig.Exists()) return;
|
||||
|
||||
var unixSocket = kestrelConfig.GetValue<string>("ListenUnixSocket");
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(unixSocket))
|
||||
{
|
||||
unixSocket = String.Format(unixSocket, hostingContext.HostingEnvironment.ApplicationName.Replace("ASC.", "").Replace(".", ""));
|
||||
|
||||
serverOptions.ListenUnixSocket(unixSocket);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
@ -50,7 +81,7 @@ namespace ASC.Data.Storage.Encryption
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
@ -67,10 +98,6 @@ namespace ASC.Data.Storage.Encryption
|
||||
.AddJsonFile("kafka.json")
|
||||
.AddJsonFile($"kafka.{env}.json", true)
|
||||
.AddEnvironmentVariables();
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build()
|
||||
.RunAsync();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,29 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5019/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "Encryption",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
}
|
||||
},
|
||||
"ASC.Data.Storage.Encryption": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "Encryption",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5019",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "Encryption",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5019",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5019/"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
@ -4,6 +4,11 @@
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ASC.Common\ASC.Common.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
|
@ -6,7 +6,8 @@ using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
@ -18,9 +19,17 @@ namespace ASC.Data.Storage.Migration
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
await Host.CreateDefaultBuilder(args)
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
@ -28,7 +37,7 @@ namespace ASC.Data.Storage.Migration
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
@ -63,10 +72,6 @@ namespace ASC.Data.Storage.Migration
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration);
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build()
|
||||
.RunAsync();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +1,29 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5018/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "storage.migration",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
}
|
||||
},
|
||||
"ASC.Data.Storage.Migration": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "storage.migration",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5018",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "storage.migration",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5018",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5018/"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -18,6 +18,11 @@
|
||||
<DebugType>none</DebugType>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Properties\**" />
|
||||
<EmbeddedResource Remove="Properties\**" />
|
||||
<None Remove="Properties\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="protos\SearchItem.proto" />
|
||||
</ItemGroup>
|
||||
@ -37,9 +42,6 @@
|
||||
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
|
||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Protobuf Include="protos\SearchItem.proto" />
|
||||
</ItemGroup>
|
||||
|
@ -13,6 +13,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -6,6 +6,7 @@ using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core.Notify.Senders;
|
||||
using ASC.Notify.Config;
|
||||
|
||||
@ -20,9 +21,17 @@ namespace ASC.Notify
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = Host.CreateDefaultBuilder(args)
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
@ -30,7 +39,7 @@ namespace ASC.Notify
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
@ -72,18 +81,6 @@ namespace ASC.Notify
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration);
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build();
|
||||
|
||||
using (host)
|
||||
{
|
||||
// Start the host
|
||||
await host.StartAsync();
|
||||
|
||||
// Wait for the host to shutdown
|
||||
await host.WaitForShutdownAsync();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,29 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5005/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "notify",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
}
|
||||
},
|
||||
"ASC.Notify": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "notify",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5005",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "notify",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5005",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5005/"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
<PackageReference Include="WebSocketSharp" Version="1.0.3-rc11" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -32,7 +32,8 @@ using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
@ -45,9 +46,17 @@ namespace ASC.Socket.IO.Svc
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var host = Host.CreateDefaultBuilder(args)
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
@ -55,7 +64,7 @@ namespace ASC.Socket.IO.Svc
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
@ -89,18 +98,7 @@ namespace ASC.Socket.IO.Svc
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build();
|
||||
|
||||
using (host)
|
||||
{
|
||||
// Start the host
|
||||
await host.StartAsync();
|
||||
|
||||
// Wait for the host to shutdown
|
||||
await host.WaitForShutdownAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,35 +1,29 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5017/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "socket",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
}
|
||||
},
|
||||
"ASC.Socket.IO.Svc": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "socket",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5001",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "socket",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5001",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
@ -87,7 +87,7 @@ namespace ASC.Socket.IO.Svc
|
||||
UseShellExecute = false,
|
||||
FileName = "node",
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
Arguments = string.Format("\"{0}\"", Path.GetFullPath(Path.Combine(HostEnvironment.ContentRootPath, settings.Path, "app.js"))),
|
||||
Arguments = string.Format("\"{0}\"", Path.GetFullPath(CrossPlatform.PathCombine(HostEnvironment.ContentRootPath, settings.Path, "app.js"))),
|
||||
WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory
|
||||
};
|
||||
StartInfo.EnvironmentVariables.Add("core.machinekey", Configuration["core:machinekey"]);
|
||||
@ -105,7 +105,7 @@ namespace ASC.Socket.IO.Svc
|
||||
}
|
||||
|
||||
LogDir = Logger.LogDirectory;
|
||||
StartInfo.EnvironmentVariables.Add("logPath", Path.Combine(LogDir, "web.socketio.log"));
|
||||
StartInfo.EnvironmentVariables.Add("logPath", CrossPlatform.PathCombine(LogDir, "web.socketio.log"));
|
||||
StartNode();
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -10,6 +10,11 @@
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\web\ASC.Web.Core\ASC.Web.Core.csproj" />
|
||||
<ProjectReference Include="..\..\ASC.Data.Encryption\ASC.Data.Encryption.csproj" />
|
||||
|
@ -6,6 +6,7 @@ using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Core.Notify;
|
||||
using ASC.Notify;
|
||||
using ASC.Web.Studio.Core.Notify;
|
||||
@ -21,9 +22,17 @@ namespace ASC.Studio.Notify
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = Host.CreateDefaultBuilder(args)
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
@ -31,7 +40,7 @@ namespace ASC.Studio.Notify
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
@ -66,18 +75,6 @@ namespace ASC.Studio.Notify
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration);
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build();
|
||||
|
||||
using (host)
|
||||
{
|
||||
// Start the host
|
||||
await host.StartAsync();
|
||||
|
||||
// Wait for the host to shutdown
|
||||
await host.WaitForShutdownAsync();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,33 +1,27 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5006/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "studio.notify",
|
||||
"log__dir": "../../../Logs"
|
||||
}
|
||||
},
|
||||
"ASC.Studio.Notify": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "studio.notify",
|
||||
"log__dir": "../../../Logs"
|
||||
"log__dir": "../../../Logs",
|
||||
"ASPNETCORE_URLS": "http://localhost:5006",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "studio.notify",
|
||||
"log__dir": "../../../Logs",
|
||||
"ASPNETCORE_URLS": "http://localhost:5006",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5006/"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
@ -13,6 +13,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="Telegram.Bot" Version="15.7.1" />
|
||||
</ItemGroup>
|
||||
|
@ -22,10 +22,14 @@
|
||||
* Pursuant to Section 7 § 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -36,13 +40,40 @@ namespace ASC.TelegramService
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
await Host.CreateDefaultBuilder(args)
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
var builder = webBuilder.UseStartup<Startup>();
|
||||
|
||||
builder.ConfigureKestrel((hostingContext, serverOptions) =>
|
||||
{
|
||||
var kestrelConfig = hostingContext.Configuration.GetSection("Kestrel");
|
||||
|
||||
if (!kestrelConfig.Exists()) return;
|
||||
|
||||
var unixSocket = kestrelConfig.GetValue<string>("ListenUnixSocket");
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(unixSocket))
|
||||
{
|
||||
unixSocket = String.Format(unixSocket, hostingContext.HostingEnvironment.ApplicationName.Replace("ASC.", "").Replace(".", ""));
|
||||
|
||||
serverOptions.ListenUnixSocket(unixSocket);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
@ -50,7 +81,7 @@ namespace ASC.TelegramService
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
@ -67,10 +98,6 @@ namespace ASC.TelegramService
|
||||
.AddJsonFile("kafka.json")
|
||||
.AddJsonFile($"kafka.{env}.json", true)
|
||||
.AddEnvironmentVariables();
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build()
|
||||
.RunAsync();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,29 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:51702/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "telegram",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
}
|
||||
},
|
||||
"ASC.TelegramService": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "telegram",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:51702",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "telegram",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:51702",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:51702/"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -21,5 +21,10 @@
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -26,13 +26,15 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
@ -44,18 +46,26 @@ using Microsoft.Extensions.Hosting;
|
||||
namespace ASC.Thumbnails.Svc
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var host = Host.CreateDefaultBuilder(args)
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
{
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
var buided = config.Build();
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
@ -88,18 +98,6 @@ namespace ASC.Thumbnails.Svc
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build();
|
||||
|
||||
using (host)
|
||||
{
|
||||
// Start the host
|
||||
await host.StartAsync();
|
||||
|
||||
// Wait for the host to shutdown
|
||||
await host.WaitForShutdownAsync();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,29 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5016/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "thumbnails",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
}
|
||||
},
|
||||
"ASC.Thumbnails.Svc": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "thumbnails",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5016",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "thumbnails",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5016",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5016/"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
@ -67,7 +67,7 @@ namespace ASC.Thumbnails.Svc
|
||||
UseShellExecute = false,
|
||||
FileName = "node",
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
Arguments = string.Format("\"{0}\"", Path.GetFullPath(Path.Combine(HostEnvironment.ContentRootPath, settings.Path, "index.js"))),
|
||||
Arguments = string.Format("\"{0}\"", Path.GetFullPath(CrossPlatform.PathCombine(HostEnvironment.ContentRootPath, settings.Path, "index.js"))),
|
||||
WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory
|
||||
};
|
||||
|
||||
@ -77,7 +77,7 @@ namespace ASC.Thumbnails.Svc
|
||||
savePath += "/";
|
||||
}
|
||||
StartInfo.EnvironmentVariables.Add("port", settings.Port);
|
||||
StartInfo.EnvironmentVariables.Add("logPath", Path.Combine(Logger.LogDirectory, "web.thumbnails.log"));
|
||||
StartInfo.EnvironmentVariables.Add("logPath", CrossPlatform.PathCombine(Logger.LogDirectory, "web.thumbnails.log"));
|
||||
StartInfo.EnvironmentVariables.Add("savePath", Path.GetFullPath(savePath));
|
||||
|
||||
StartNode(cancellationToken);
|
||||
|
@ -13,6 +13,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -31,7 +31,8 @@ using System.Threading.Tasks;
|
||||
using ASC.Common;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
@ -43,59 +44,60 @@ using Microsoft.Extensions.Hosting;
|
||||
namespace ASC.UrlShortener.Svc
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
var host = Host.CreateDefaultBuilder(args)
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
var buided = config.Build();
|
||||
var path = buided["pathToConf"];
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(Path.Combine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
config.SetBasePath(path);
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
config
|
||||
.AddJsonFile("appsettings.json")
|
||||
.AddJsonFile($"appsettings.{env}.json", true)
|
||||
.AddJsonFile($"urlshortener.{env}.json", true)
|
||||
.AddJsonFile("storage.json")
|
||||
.AddJsonFile("kafka.json")
|
||||
.AddJsonFile($"kafka.{env}.json", true)
|
||||
.AddEnvironmentVariables()
|
||||
.AddCommandLine(args)
|
||||
.AddInMemoryCollection(new Dictionary<string, string>
|
||||
{
|
||||
{"pathToConf", path }
|
||||
}
|
||||
);
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
var diHelper = new DIHelper(services);
|
||||
LogNLogExtension.ConfigureLog(diHelper, "ASC.UrlShortener.Svc");
|
||||
services.AddHostedService<UrlShortenerServiceLauncher>();
|
||||
diHelper.TryAdd<UrlShortenerServiceLauncher>();
|
||||
})
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
})
|
||||
.UseConsoleLifetime()
|
||||
.Build();
|
||||
|
||||
using (host)
|
||||
{
|
||||
// Start the host
|
||||
await host.StartAsync();
|
||||
|
||||
// Wait for the host to shutdown
|
||||
await host.WaitForShutdownAsync();
|
||||
}
|
||||
}
|
||||
{
|
||||
public async static Task Main(string[] args)
|
||||
{
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.UseSystemd()
|
||||
.UseWindowsService()
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
||||
.ConfigureAppConfiguration((hostContext, config) =>
|
||||
{
|
||||
var buided = config.Build();
|
||||
var path = buided["pathToConf"];
|
||||
|
||||
if (!Path.IsPathRooted(path))
|
||||
{
|
||||
path = Path.GetFullPath(CrossPlatform.PathCombine(hostContext.HostingEnvironment.ContentRootPath, path));
|
||||
}
|
||||
|
||||
config.SetBasePath(path);
|
||||
|
||||
var env = hostContext.Configuration.GetValue("ENVIRONMENT", "Production");
|
||||
|
||||
config.AddJsonFile("appsettings.json")
|
||||
.AddJsonFile($"appsettings.{env}.json", true)
|
||||
.AddJsonFile($"urlshortener.{env}.json", true)
|
||||
.AddJsonFile("storage.json")
|
||||
.AddJsonFile("kafka.json")
|
||||
.AddJsonFile($"kafka.{env}.json", true)
|
||||
.AddEnvironmentVariables()
|
||||
.AddCommandLine(args)
|
||||
.AddInMemoryCollection(new Dictionary<string, string>
|
||||
{
|
||||
{"pathToConf", path }
|
||||
}
|
||||
);
|
||||
})
|
||||
.ConfigureServices((hostContext, services) =>
|
||||
{
|
||||
services.AddMemoryCache();
|
||||
|
||||
var diHelper = new DIHelper(services);
|
||||
|
||||
LogNLogExtension.ConfigureLog(diHelper, "ASC.UrlShortener.Svc");
|
||||
services.AddHostedService<UrlShortenerServiceLauncher>();
|
||||
diHelper.TryAdd<UrlShortenerServiceLauncher>();
|
||||
})
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,35 +1,29 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:5015/",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "urlshortener",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
}
|
||||
},
|
||||
"ASC.UrlShortener.Svc": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "urlshortener",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products"
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5017",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../../Data",
|
||||
"log__name": "urlshortener",
|
||||
"log__dir": "../../../Logs",
|
||||
"core__products__folder": "../../../products",
|
||||
"ASPNETCORE_URLS": "http://localhost:5017",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5015/"
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user