1
0
mirror of https://github.com/ONLYOFFICE/CommunityServer.git synced 2025-04-18 13:24:01 +03:00

Update to v12.0.0

This commit is contained in:
JenkinsRobo 2022-05-25 11:06:04 +00:00
parent 18764fac6c
commit d7284c7def
4526 changed files with 295381 additions and 245902 deletions

29
.gitignore vendored Normal file
View File

@ -0,0 +1,29 @@
**/obj/
**/bin/
/packages/
/redistributable/ICal.Net_v2/packages/
*.suo
*.user
web/studio/Logs/
web/studio/Data/
build/*.log
build/deploy
/module/ASC.Api/Logs
.vs/
.vscode/
/web/services/logs
/web/statistics/logs
/web/studio/ASC.Web.Studio/js/third-party/jquery/jquery.core.js
/web/studio/ASC.Web.Studio/js/third-party/jquery/jquery.blockUI.js
/web/studio/ASC.Web.Studio/js/third-party/jquery/jquery.mousewheel.js
/web/studio/ASC.Web.Studio/js/uploader/jquery.fileupload.js
/module/ASC.Socket.IO/node_modules
/module/ASC.Socket.IO/package-lock.json
/module/ASC.Socket.IO/typings
/module/ASC.Thumbnails/node_modules
/module/ASC.SsoAuth/node_modules
/module/ASC.UrlShortener/node_modules
/module/ASC.UrlShortener/Logs
/module/ASC.WebDav/node_modules
/module/ASC.WebDav/logs
/module/Logs

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4,11 +4,7 @@ Community Server uses code from the following 3rd party projects:
nuget packages
====================================================================================================
AjaxMin - JavaScript and CSS minification Library for use in .NET applications that want to provide minification or parsing functionality. (http://www.apache.org/licenses/LICENSE-2.0)
License: Apache License 2.0
License File: AjaxMin.license
AjaxPro.2 - .NET Library that provides AJAX related methods to simplify the communication between server and client. (https://github.com/michaelschwarz/Ajax.NET-Professional/blob/master/LICENS)
AjaxPro.2 - .NET Library that provides AJAX related methods to simplify the communication between server and client. (https://github.com/michaelschwarz/Ajax.NET-Professional/blob/master/LICENSE)
License: MIT License
License File: AjaxPro.2.license
@ -108,10 +104,6 @@ DotNetOpenAuth.Ultimate - A single assembly that adds OpenID 1.1/2.0, OAuth 1.0(
License: MS-PL
License File: DotNetOpenAuth.Ultimate.license
DotNetZip - A fork of the DotNetZip project without signing with a solution that compiles cleanly. This project aims to follow semver to avoid versioning conflicts. DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files. (https://raw.githubusercontent.com/haf/DotNetZip.Semverd/master/LICENSE)
License: Ms-PL , BSD-style (3 clause), Apache 2 license ???
License File: DotNetZip.license
Dropbox.Api - Portable class library for accessing the Dropbox v2 API (https://github.com/dropbox/dropbox-sdk-dotnet/blob/master/LICENSE)
License: MIT License
License File: Dropbox.Api.license
@ -132,6 +124,10 @@ Flurl.Signed - A fluent, portable URL builder. To make HTTP calls off the fluent
License: MIT License
License File: Flurl.Signed.license
FolkerKinzel.VCards -.NET library to read, write and convert VCF files that match the vCard standards 2.1, 3.0 and 4.0. (https://github.com/FolkerKinzel/VCards/blob/master/LICENSE)
License: MIT License
License File: FolkerKinzel.VCards.license
FredCK.FCKeditorV2 - FCKeditor is a text editor to be used inside web pages. In 2009 it was renamed CKEditor. (http://ckeditor.com/what-is-ckeditor) (https://download.cksource.com/FCKeditor/FCKeditor/2.6.3/)
License: GPL 2 (or later) or LGPL 2.1 (or later) or MPL 1.1 (or later)
License File: FredCK.FCKeditorV2.license
@ -340,6 +336,10 @@ Microsoft.IdentityModel.Tokens - Includes types that provide support for Securit
License: MIT License
License File: Microsoft.IdentityModel.Tokens.license
Microsoft.IdentityModel.Tokens.Jwt - Includes types that provide support for creating, serializing and validating JSON Web Tokens. (https://licenses.nuget.org/MIT)
License: MIT License
License File: Microsoft.IdentityModel.Tokens.Jwt.license
Microsoft.Net.Http - This package includes HttpClient for sending requests over HTTP, as well as HttpRequestMessage and HttpResponseMessage for processing HTTP messages. (https://dotnet.microsoft.com/en/dotnet_library_license.htm)
License: MICROSOFT .NET LIBRARY LICENSE
License File: Microsoft.Net.Http.license
@ -424,6 +424,10 @@ Novell.Directory.LDAP - LDAP client library (https://github.com/dsbenghe/Novell.
License: MIT License
License File: Novell.Directory.LDAP.license
NUglify - NUglify provides minify and compression methods for CSS, JavaScript and HTML files. (https://github.com/trullock/NUglify/blob/master/license.txt)
License: BSD-2-Clause License
License File: NUglify.license
NUnit - NUnit features a fluent assert syntax, parameterized, generic and theory tests and is user-extensible. (https://github.com/nunit/nunit/blob/master/LICENSE.txt)
License: MIT License
License File: NUnit.license
@ -776,6 +780,10 @@ npm packages
License: MIT License
License File: @authenio-samlify-node-xmllint.license
axios - Promise based HTTP client for the browser and node.js (https://github.com/axios/axios/blob/master/LICENSE)
License: MIT License
License File: axios.license
body-parser - Node.js body parsing middleware. (https://github.com/expressjs/body-parser/blob/master/LICENSE)
License: MIT License
License File: body-parser.license
@ -828,10 +836,18 @@ filenamify-url - Convert a URL to a valid filename (https://github.com/sindresor
License: MIT License
License File: filenamify-url.license
form-data - A library to create readable "multipart/form-data" streams. Can be used to submit forms and file uploads to other web applications.The API of this library is inspired by the XMLHttpRequest-2 FormData Interface. (https://github.com/form-data/form-data/blob/master/License)
License: MIT License
License File: form-data.license
formidable - A Node.js module for parsing form data, especially file uploads. (https://github.com/node-formidable/formidable/blob/master/LICENSE)
License: MIT License
License File: formidable.license
get-byte - A Universal way of getting a Byte at a Given Index from a variety of in-memory data formats, including Uint8Array, Buffer, DataView, and Array Buffer (https://github.com/DanielJDufour/get-byte/blob/main/LICENSE)
License: CC0-1.0 License
License File: get-byte.license
graceful-fs - graceful-fs functions as a drop-in replacement for the fs module, making various improvements. (https://github.com/isaacs/node-graceful-fs)
License: ISC License
License File: graceful-fs.license
@ -848,6 +864,14 @@ gulp-just-replace - The gulp-replace is fine. But it's painful to install it o
License: MIT License
License File: gulp-just-replace.license
help - substack way of --help. v3 of help requires at least Node.js v4. To use help with an older version, please use help@2.x. (https://github.com/evanlucas/help/blob/master/LICENSE)
License: MIT License
License File: help.license
ipaddr - an IPv6 and IPv4 address manipulation library. (https://github.com/whitequark/ipaddr.js/blob/master/LICENSE)
License: MIT License
License File: ipaddr.license
lodash - The modern build of lodash exported as Node.js/io.js modules. (https://github.com/lodash/lodash/blob/master/LICENSE)
License: MIT License
License File: lodash.license
@ -928,6 +952,10 @@ tmp - A simple temporary file and directory creator for node.js. (https://githu
License: MIT License
License File: tmp.license
to-byte-array - Convert a string or buffer into a plain array of bytes. (https://github.com/finwo/to-byte-array/blob/master/LICENSE.md)
License: MIT License
License File: to-byte-array.license
ua-parser-js - A JavaScript-based User-Agent string parser. Can be used either in browser (client-side) or in node.js (server-side) environment. Also available as jQuery/Zepto plugin, Bower/Meteor package, & RequireJS/AMD module.  (https://github.com/faisalman/ua-parser-js/blob/master/license.md)
License: MIT License
License File: ua-parser-js.license
@ -936,6 +964,10 @@ url - This module has utilities for URL resolution and parsing meant to have fea
License: MIT License
License File: url.license
webdav-server - WebDav server. (https://github.com/OpenMarshal/npm-WebDAV-Server/blob/master/LICENSE)
License: Unlicense License
License File: webdav-server.license
winston - A logger for just about everything. (https://github.com/winstonjs/winston/blob/master/LICENSE)
License: MIT License
License File: winston.license
@ -1132,11 +1164,15 @@ jstree.min.js - jsTree is jquery plugin, that provides interactive trees (https:
License: MIT License
License File: jstree.license
linkify.min.js - Linkify is a zero-dependency JavaScript plugin for finding links in plain-text and converting them to HTML <a> tags (https://github.com/Soapbox/linkifyjs/blob/master/LICENSE)
linkify.min.js - Linkify is a JavaScript plugin for finding links in plain-text and converting them to HTML <a> tags. (https://github.com/Soapbox/linkifyjs/blob/master/LICENSE)
License: MIT License
License File: linkify.license
linkify-string.min.js - Linkify is a zero-dependency JavaScript plugin for finding links in plain-text and converting them to HTML <a> tags (https://github.com/Soapbox/linkifyjs/blob/master/LICENSE)
linkify-html.min.js - Linkify is a JavaScript plugin for finding links in plain-text and converting them to HTML <a> tags. (https://github.com/Soapbox/linkifyjs/blob/master/LICENSE)
License: MIT License
License File: linkify-html.license
linkify-string.min.js - Linkify is a JavaScript plugin for finding links in plain-text and converting them to HTML <a> tags. (https://github.com/Soapbox/linkifyjs/blob/master/LICENSE)
License: MIT License
License File: linkify-string.license

View File

@ -17,7 +17,7 @@
</p>
<p align="center">
<a href="http://www.apache.org/licenses/LICENSE-2.0"><img alt="http://www.apache.org/licenses/LICENSE-2.0" src="https://img.shields.io/badge/License-Apache%20v2.0-green.svg?style=flat"></a>
<a href="https://github.com/ONLYOFFICE/portals/releases"><img alt="https://github.com/ONLYOFFICE/portals/releases" src="https://img.shields.io/badge/release-11.0.0-blue.svg"></a>
<a href="https://github.com/ONLYOFFICE/portals/releases"><img alt="https://github.com/ONLYOFFICE/portals/releases" src="https://img.shields.io/badge/release-11.5.0-blue.svg"></a>
</p>
## Overview

View File

@ -1,3 +1,3 @@
set Constants=DEBUGINFO
"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" msbuild\build.proj /fl1 /flp1:LogFile=Build.log;Verbosity=Normal /m -tv:Current -v:m
"%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" msbuild\build.proj /fl1 /flp1:LogFile=Build.log;Verbosity=Normal /m -tv:Current -v:m
pause

View File

@ -1,7 +1,7 @@
set Cultures=fr,de,es,ru,lv,pt-BR,pt,it,tr,el,zh-CN,pl,cs,uk,vi,fi,az-Latn-AZ,ko,ja,sl,sk,nl,bg
set BuildTargets=ReBuild
"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" msbuild\build.proj /fl1 /flp1:LogFile=Build.log;Verbosity=Normal /m -v:m
set BuildTargets=Build
if %errorlevel% == 0 "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" msbuild\deploy.proj /fl1 /flp1:LogFile=Deploy.log;Verbosity=Normal /m -v:m
set YarnBuild=false
"%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" msbuild\build.proj /fl1 /flp1:LogFile=Build.log;Verbosity=Normal /m -v:m
set BuildTargets=PrepareResourceNames;ResolveAssemblyReferences;CopyFilesToOutputDirectory
set ProjectReferenceBuildTargets=PrepareResourceNames;ResolveAssemblyReferences;CopyFilesToOutputDirectory
if %errorlevel% == 0 "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" msbuild\deploy.proj /fl1 /flp1:LogFile=Deploy.log;Verbosity=Normal /m -v:m
pause

View File

@ -21,6 +21,7 @@ if "%~1" == "--install-all" (
sc create OnlyOfficeStorageMigrate%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.Data.Storage.Migration.Launcher,ASC.Data.Storage.Migration\" --log StorageMigrate"
sc create OnlyOfficeStorageEncryption%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.Data.Storage.Encryption.Launcher,ASC.Data.Storage.Encryption\" --log StorageEncryption"
sc create OnlyofficeFeed%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.Feed.Aggregator.FeedAggregatorLauncher, ASC.Feed.Aggregator\" --log Feed"
sc create OnlyOfficeAutoCleanUp%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.Files.AutoCleanUp.Launcher, ASC.Files.AutoCleanUp\" --log AutoCleanUp"
sc create OnlyofficeBackup%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.Data.Backup.Service.BackupServiceLauncher, ASC.Data.Backup\" --log Backup"
sc create OnlyOfficeSocketIO%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.Socket.IO.Svc.Launcher, ASC.Socket.IO.Svc\" --log SocketIO"
sc create OnlyOfficeTelegram%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.TelegramService.Launcher, ASC.TelegramService\" --log Telegram"
@ -28,6 +29,7 @@ if "%~1" == "--install-all" (
sc create OnlyOfficeThumb%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.Thumbnails.Svc.Launcher,ASC.Thumbnails.Svc\" --log Thumb"
sc create OnlyOfficeSsoAuth%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.SsoAuth.Svc.Launcher,ASC.SsoAuth.Svc\" --log SsoAuth"
sc create OnlyOfficeUrlShortener%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.UrlShortener.Svc.Launcher,ASC.UrlShortener.Svc\" --log UrlShortener"
sc create OnlyOfficeWebDav%version% start= delayed-auto binPath= "\"%basepath%\TeamLabSvc.exe\" --service \"ASC.WebDav.Svc.Launcher,ASC.WebDav.Svc\" --log WebDav"
sc create OnlyOfficeMailAggregator%version% start= delayed-auto binPath= "\"%grandparent%\MailAggregator\ASC.Mail.Aggregator.CollectionService.exe\""
sc create OnlyOfficeMailWatchdog%version% start= delayed-auto binPath= "\"%grandparent%\MailWatchdog\ASC.Mail.Watchdog.Service.exe\""
sc create OnlyOfficeMailCleaner%version% start= delayed-auto binPath= "\"%grandparent%\MailCleaner\ASC.Mail.StorageCleaner.exe\""
@ -38,6 +40,7 @@ if "%~1" == "--install-all" (
sc failure OnlyofficeRadicale%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeStorageMigrate%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeStorageEncryption%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyofficeAutoCleanUp%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyofficeFeed%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyofficeBackup%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeSocketIO%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
@ -46,6 +49,7 @@ if "%~1" == "--install-all" (
sc failure OnlyOfficeThumb%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeSsoAuth%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeUrlShortener%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeWebDav%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeMailAggregator%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeMailWatchdog%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
sc failure OnlyOfficeMailCleaner%version% reset= 60 actions= restart/60000/restart/60000/restart/60000
@ -71,6 +75,8 @@ if "%~1" == "--uninstall-all" (
sc delete OnlyOfficeStorageMigrate%version%
net stop OnlyOfficeStorageEncryption%version%
sc delete OnlyOfficeStorageEncryption%version%
net stop OnlyofficeAutoCleanUp%version%
sc delete OnlyofficeAutoCleanUp%version%
net stop OnlyofficeFeed%version%
sc delete OnlyofficeFeed%version%
net stop OnlyofficeBackup%version%
@ -85,6 +91,8 @@ if "%~1" == "--uninstall-all" (
sc delete OnlyOfficeSsoAuth%version%
net stop OnlyOfficeUrlShortener%version%
sc delete OnlyOfficeUrlShortener%version%
net stop OnlyOfficeWebDav%version%
sc delete OnlyOfficeWebDav%version%
net stop OnlyofficeThumbnailBuilder%version%
sc delete OnlyofficeThumbnailBuilder%version%
net stop OnlyOfficeMailAggregator%version%

View File

@ -7,124 +7,115 @@
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
<section name="storage" type="ASC.Data.Storage.Configuration.StorageConfigurationSection, ASC.Data.Storage" />
<section name="backup" type="ASC.Data.Backup.Service.BackupConfigurationSection, ASC.Data.Backup" />
<section name="autoreply" type="ASC.Mail.Autoreply.AutoreplyServiceConfiguration, ASC.Mail.Autoreply" />
<section name="feed" type="ASC.Feed.Aggregator.Config.FeedConfigurationSection, ASC.Feed.Aggregator" />
<section name="healthCheck" type="ASC.HealthCheck.Settings.HealthCheckCfgSectionHandler, ASC.HealthCheck" />
<section name="socketio" type="ASC.Socket.IO.Svc.SocketIOCfgSectionHandler, ASC.Socket.IO.Svc" />
<section name="thumb" type="ASC.Thumbnails.Svc.ConfigHandler, ASC.Thumbnails.Svc" />
<section name="ssoauth" type="ASC.SsoAuth.Svc.ConfigHandler, ASC.SsoAuth.Svc" />
<section name="urlshortener" type="ASC.UrlShortener.Svc.ConfigHandler, ASC.UrlShortener.Svc" />
<section name="webdav" type="ASC.WebDav.Svc.ConfigHandler, ASC.WebDav.Svc" />
<section name="radicale" type="ASC.Radicale.RadicaleCfgSectionHandler, ASC.Radicale" />
<section name="apiClient" type="ASC.Api.Client.ApiClientConfiguration, ASC.Api.Client" />
<section name="autofac" type="ASC.Common.DependencyInjection.AutofacConfigurationSection, ASC.Common" />
<section name="consumers" type="ASC.Core.Common.Configuration.ConsumerConfigurationSection, ASC.Core.Common" />
<section name="thumbnailBuilder" type="ASC.Files.ThumbnailBuilder.ConfigSection, ASC.Files.ThumbnailBuilder" />
<section name="autoCleanUp" type="ASC.Files.AutoCleanUp.ConfigSection, ASC.Files.AutoCleanUp" />
<section name="redisCacheClient" type="StackExchange.Redis.Extensions.LegacyConfiguration.RedisCachingSectionHandler, StackExchange.Redis.Extensions.LegacyConfiguration" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
<assemblyIdentity name="Autofac" culture="neutral" publicKeyToken="17863af14b0044da" />
<bindingRedirect oldVersion="0.0.0.0-6.2.0.0" newVersion="6.2.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.6.1" newVersion="1.8.5.0" />
<assemblyIdentity name="BouncyCastle.Crypto" culture="neutral" publicKeyToken="0e99375e54769942" />
<bindingRedirect oldVersion="0.0.0.0-1.8.10.0" newVersion="1.8.10.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Api.Gax" culture="neutral" publicKeyToken="3ec5ea7f18953e47" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Api.Gax.Rest" culture="neutral" publicKeyToken="3ec5ea7f18953e47" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Apis" culture="neutral" publicKeyToken="4b01fa6e34db77ab" />
<bindingRedirect oldVersion="0.0.0.0-1.45.0.0" newVersion="1.45.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.54.0.0" newVersion="1.54.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Auth" culture="neutral" publicKeyToken="4b01fa6e34db77ab" />
<bindingRedirect oldVersion="0.0.0.0-1.45.0.0" newVersion="1.45.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.54.0.0" newVersion="1.54.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Core" culture="neutral" publicKeyToken="4b01fa6e34db77ab" />
<bindingRedirect oldVersion="0.0.0.0-1.45.0.0" newVersion="1.45.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.54.0.0" newVersion="1.54.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Api.Gax" culture="neutral" publicKeyToken="3ec5ea7f18953e47" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Api.Gax.Rest" culture="neutral" publicKeyToken="3ec5ea7f18953e47" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Apis.Storage.v1" culture="neutral" publicKeyToken="4b01fa6e34db77ab" />
<bindingRedirect oldVersion="0.0.0.0-1.45.0.1911" newVersion="1.45.0.1911" />
<bindingRedirect oldVersion="0.0.0.0-1.54.0.2234" newVersion="1.54.0.2234" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" culture="neutral" publicKeyToken="a7d26565bac4d604" />
<bindingRedirect oldVersion="0.0.0.0-3.11.4.0" newVersion="3.11.4.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" culture="neutral" publicKeyToken="669e0ddf0bb1aa2a" />
<bindingRedirect oldVersion="0.0.0.0-2.0.8.0" newVersion="2.0.8.0" />
<bindingRedirect oldVersion="0.0.0.0-2.0.9.0" newVersion="2.0.9.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="RestSharp" culture="neutral" publicKeyToken="598062e77f915f75" />
<bindingRedirect oldVersion="0.0.0.0-106.12.0.0" newVersion="106.12.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.12.2.0" newVersion="6.12.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" culture="neutral" publicKeyToken="adb9793829ddae60" />
<bindingRedirect oldVersion="0.0.0.0-2.1.1.0" newVersion="2.1.1.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" culture="neutral" publicKeyToken="0e99375e54769942" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="StackExchange.Redis.Extensions.Core" culture="neutral" publicKeyToken="d7d863643bcd13ef" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-1.2.5.0" newVersion="1.2.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31BF3856AD364E35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.12.2.0" newVersion="6.12.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="StackExchange.Redis.Extensions.Core" culture="neutral" publicKeyToken="d7d863643bcd13ef" />
<bindingRedirect oldVersion="0.0.0.0-7.2.1.0" newVersion="7.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
@ -140,6 +131,7 @@
<appSettings>
<add key="core.base-domain" value="localhost" />
<add key="core.machinekey" value="Vskoproizvolny Salt par Chivreski" />
<add key="core.payment-region" value="test" />
<add key="files.docservice.secret" value="" />
<add key="files.docservice.secret.header" value="" />
<add key="files.docservice.timeout" value="50000" />
@ -152,6 +144,8 @@
<add key="web.help-center" value="https://helpcenter.onlyoffice.com/{ru|de|fr|es|lv|it}" />
<add key="web.hub.internal" value="http://localhost:9899/" />
<add key="web.controlpanel.url" value="" />
<add key="ping.url" value="http://localhost" />
<add key="ping.interval" value="10000" />
<add key="license.file.path" value="" />
<add key="resources.from-db" value="true" />
<add key="mail.certificate-permit" value="true" />
@ -167,22 +161,23 @@
<add type="ASC.Notify.NotifyServiceLauncher, ASC.Notify" />
<add type="ASC.Feed.Aggregator.FeedAggregatorLauncher, ASC.Feed.Aggregator" />
<add type="ASC.Data.Backup.Service.BackupServiceLauncher, ASC.Data.Backup" />
<!-- <add type="ASC.Mail.Autoreply.AutoreplyServiceController, ASC.Mail.Autoreply"/> -->
<add type="ASC.Data.Storage.Migration.Launcher, ASC.Data.Storage.Migration" />
<add type="ASC.ElasticSearch.Launcher, ASC.ElasticSearch" />
<add type="ASC.Thumbnails.Svc.Launcher, ASC.Thumbnails.Svc" />
<add type="ASC.SsoAuth.Svc.Launcher, ASC.SsoAuth.Svc" />
<add type="ASC.UrlShortener.Svc.Launcher, ASC.UrlShortener.Svc" />
<add type="ASC.WebDav.Svc.Launcher, ASC.WebDav.Svc" />
<add type="ASC.TelegramService.Launcher, ASC.TelegramService" />
<add type="ASC.Data.Storage.Encryption.Launcher, ASC.Data.Storage.Encryption" />
<add type="ASC.Files.ThumbnailBuilder.Launcher, ASC.Files.ThumbnailBuilder" />
<add type="ASC.Files.AutoCleanUp.Launcher, ASC.Files.AutoCleanUp" />
</services>
</teamlab>
<apiClient root="/api/2.0/" scheme="Http" />
<notify connectionStringName="default">
<process maxThreads="2" bufferSize="10" maxAttempts="10" attemptsInterval="0:5:0" />
<senders>
<sender name="email.sender" type="ASC.Core.Notify.Senders.SmtpSender, ASC.Core.Common" host="" port="" userName="" password="" enableSsl="" useCoreSettings="true" />
<sender name="email.sender" type="ASC.Core.Notify.Senders.SmtpSender, ASC.Core.Common" host="" port="" userName="" password="" enableSsl="" />
<sender name="messanger.sender" type="ASC.Core.Notify.Senders.JabberSender, ASC.Core.Common" />
<sender name="telegram.sender" type="ASC.Core.Notify.Senders.TelegramSender, ASC.Core.Common" />
</senders>
@ -190,7 +185,7 @@
<scheduler name="WhatsNew" register="ASC.Web.Studio.Core.Notify.NotifyConfiguration.RegisterSendMethods, ASC.Web.Studio" />
<scheduler name="Calendar" register="ASC.Api.Calendar.Notification.CalendarNotifyClient.RegisterSendMethod, ASC.Api.Calendar" />
<scheduler name="Projects" register="ASC.Web.Projects.Configuration.ProductEntryPoint.RegisterSendMethods, ASC.Web.Projects" />
<scheduler name="Birthdays" register="ASC.Web.Community.Birthdays.BirthdaysModule.RegisterSendMethod, ASC.Web.Community" />
<scheduler name="Birthdays" register="ASC.Web.People.BirthdaysModule.RegisterSendMethod, ASC.Web.People" />
<scheduler name="CRM" register="ASC.Web.CRM.Configuration.ProductEntryPoint.RegisterSendMethods, ASC.Web.CRM" />
</schedulers>
</notify>
@ -199,11 +194,12 @@
<scheduler />
</backup>
<feed aggregatePeriod="0:3:0" />
<autoreply mailFolder="..\..\Logs\" />
<autoCleanUp period="0:5:0" />
<socketio path="..\ASC.Socket.IO" port="9899">
<redis host="" port="" />
</socketio>
<urlshortener path="..\ASC.UrlShortener" port="9999" />
<webdav path="..\ASC.WebDav" port="9889" />
<thumb path="..\ASC.Thumbnails" port="9800" />
<ssoauth path="..\ASC.SsoAuth" port="9834" />
<radicale path="">
@ -407,18 +403,15 @@
</appender>
</log4net>
<nlog>
<extensions>
<add assembly="ASC.Common" />
</extensions>
<variable name="logDirectory" value="..\..\Logs\" />
<variable name="svcName" value="" />
<conversionPattern value="" />
<targets async="true">
<default-target-parameters type="SelfCleaning" encoding="utf-8" archiveNumbering="DateAndSequence" archiveEvery="Day" archiveAboveSize="52428800" archiveDateFormat="MM-dd" keepFileOpen="true" enableArchiveFileCompression="true" layout="${date:universalTime=true:format=yyyy-MM-dd HH\:mm\:ss,fff} ${level:uppercase=true} [${threadid}] ${logger} - ${message} ${exception:format=ToString}" />
<default-target-parameters type="File" encoding="utf-8" maxArchiveDays="30" archiveNumbering="DateAndSequence" archiveEvery="Day" archiveAboveSize="52428800" archiveDateFormat="MM-dd" keepFileOpen="true" enableArchiveFileCompression="true" layout="${date:universalTime=true:format=yyyy-MM-dd HH\:mm\:ss,fff} ${level:uppercase=true} [${threadid}] ${logger} - ${message} ${exception:format=ToString}" />
<target name="Console" type="Console" layout="${date:universalTime=true:format=yyyy-MM-dd HH\:mm\:ss,fff} ${level:uppercase=true} [${threadid}] ${logger} - ${message}" />
<target name="web" type="SelfCleaning" fileName="${logDirectory}svc${var:svcName}.log" />
<target name="indexer" type="SelfCleaning" fileName="${logDirectory}svcIndexer.data.log" />
<target name="sql" type="SelfCleaning" fileName="${logDirectory}svc${var:svcName}.sql.log" layout="${date:universalTime=true:format=yyyy-MM-dd HH\:mm\:ss,fff}|${threadid}|${event-properties:item=sqlThread}|${event-properties:item=duration}|${message}|${event-properties:item=sql}|${event-properties:item=sqlParams}" />
<target name="web" type="File" fileName="${logDirectory}svc${var:svcName}.log" />
<target name="indexer" type="File" fileName="${logDirectory}svcIndexer.data.log" />
<target name="sql" type="File" fileName="${logDirectory}svc${var:svcName}.sql.log" layout="${date:universalTime=true:format=yyyy-MM-dd HH\:mm\:ss,fff}|${threadid}|${event-properties:item=sqlThread}|${event-properties:item=duration}|${message}|${event-properties:item=sql}|${event-properties:item=sqlParams}" />
</targets>
<rules>
<logger name="ASC.SQL" minlevel="Warn" writeTo="" final="true" />
@ -428,7 +421,7 @@
</nlog>
<consumers configSource="web.consumers.config" />
<autofac configSource="web.autofac.config" />
<redisCacheClient ssl="false" connectTimeout="5000" database="0" password="">
<redisCacheClient ssl="false" connectTimeout="5000" syncTimeout="60000" database="0" password="">
<hosts>
<add host="127.0.0.1" cachePort="6379" />
</hosts>

View File

@ -3,7 +3,7 @@
ROOT_DIR="/var/www/onlyoffice/Data/certs";
NGINX_CONF_DIR="/etc/nginx/sites-enabled";
NGINX_ROOT_DIR="/etc/nginx";
APP_SERVICES_ROOT_DIR="/var/www/onlyoffice/Services"
APP_CONFIG_DIR="/etc/onlyoffice/communityserver"
SSL_OCSP_CERTIFICATE_PATH="${ROOT_DIR}/stapling.trusted.crt";
SSL_CERTIFICATE_PATH="${ROOT_DIR}/onlyoffice.crt";
SSL_KEY_PATH="${ROOT_DIR}/onlyoffice.key";
@ -54,7 +54,7 @@ else
sed '/resolver_timeout/d' -i default-onlyoffice-ssl.conf;
fi
sed '/mail\.default-api-scheme/s/\(value\s*=\s*\"\).*\"/\1https\"/' -i ${APP_SERVICES_ROOT_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config;
sed 's_\(\"DefaultApiSchema":\).*,_\1 "https",_' -i ${APP_CONFIG_DIR}/mail.production.json
mv -f default-onlyoffice-ssl.conf ${NGINX_CONF_DIR}/onlyoffice

View File

@ -1,13 +1,14 @@
#!/bin/bash
APP_SERVICES_ROOT_DIR="/var/www/onlyoffice/Services"
APP_CONFIG_DIR="/etc/onlyoffice/communityserver"
NGINX_ROOT_DIR="/etc/nginx";
NGINX_CONF_DIR="/etc/nginx/sites-enabled";
cp $NGINX_ROOT_DIR/includes/onlyoffice-communityserver-common.conf.template default-onlyoffice.conf;
sed 's/{{APP_NIGNX_KEEPLIVE}}/64/g' -i default-onlyoffice.conf;
sed '/mail\.default-api-scheme/s/\(value\s*=\s*\"\).*\"/\1http\"/' -i ${APP_SERVICES_ROOT_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config;
sed 's_\(\"DefaultApiSchema":\).*,_\1 "http",_' -i ${APP_CONFIG_DIR}/mail.production.json
mv -f default-onlyoffice.conf ${NGINX_CONF_DIR}/onlyoffice

View File

@ -44,11 +44,25 @@ location /sh {
location /caldav/ {
proxy_pass http://localhost:5232/;
proxy_set_header X-Script-Name /caldav;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Script-Name /caldav;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
location /carddav/ {
proxy_pass http://localhost:5232/;
proxy_set_header X-Script-Name /carddav;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
location /webdav/ {
proxy_pass http://localhost:9889/;
proxy_set_header X-Script-Name /webdav;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
location /sso/ {
proxy_pass http://localhost:9834/;

View File

@ -5,7 +5,7 @@ Wants=nginx.service mysqld.service redis-server.service
[Service]
PermissionsStartOnly=true
ExecStartPre=/bin/bash -c 'test -e /var/run/onlyoffice || install -m 755 -o onlyoffice -g {{NGINX_USER}} -d /var/run/onlyoffice; rm -f /var/run/onlyoffice/onlyofficeApiSystem.socket /var/www/onlyoffice/ApiSystem/mono_crash* /var/www/onlyoffice/ApiSystem/core.*;'
ExecStartPre=/bin/bash -c 'test -e /var/run/onlyoffice || install -m 755 -o onlyoffice -g nginx -d /var/run/onlyoffice; rm -f /var/run/onlyoffice/onlyofficeApiSystem.socket /var/www/onlyoffice/ApiSystem/mono_crash* /var/www/onlyoffice/ApiSystem/core.*;'
ExecStart=/usr/bin/hyperfastcgi4 /config=/etc/hyperfastcgi/onlyofficeApiSystem /logfile=/var/log/onlyoffice/onlyofficeApiSystem.log /loglevels=Error
Environment=LD_LIBRARY_PATH=/usr/lib MONO_PATH=/var/www/onlyoffice/ApiSystem/bin/ MONO_IOMAP=all MONO_ASPNET_WEBCONFIG_CACHESIZE=2000 MONO_THREADS_PER_CPU=2000 MONO_GC_PARAMS=nursery-size=128m,soft-heap-limit=512m,bridge-implementation=tarjan MONO_LOG_LEVEL=error MONO_THREADS_SUSPEND=preemptive

View File

@ -8,3 +8,4 @@ Files/god/* etc/god/
Files/Tools/* var/www/{{package_sysname}}/Tools/
Files/licenses/* usr/share/doc/{{package_sysname}}-communityserver/licenses/
Files/ApiSystem/* var/www/{{package_sysname}}/ApiSystem/
Files/mail-config/* etc/{{package_sysname}}/communityserver/

View File

@ -0,0 +1,20 @@
[Unit]
Description=ONLYOFFICE AutoCleanUp Service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/onlyofficeAutoCleanUp'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/TeamLabSvc -l:/tmp/onlyofficeAutoCleanUp /var/www/onlyoffice/Services/TeamLabSvc/TeamLabSvc.exe --service \"ASC.Files.AutoCleanUp.Launcher,ASC.Files.AutoCleanUp\" --log AutoCleanUp
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/TeamLabSvc/
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target

View File

@ -1,21 +1,19 @@
[Unit]
Description=ONLYOFFICE MailAggregator Service
After=network.target syslog.target mysqld.service redis-server.service
Wants=mysqld.service redis-server.service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/onlyofficeMailAggregator'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/MailAggregator -l:/tmp/onlyofficeMailAggregator /var/www/onlyoffice/Services/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/MailAggregator/
Type=notify
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
WorkingDirectory=/var/www/onlyoffice/Services/MailAggregator
ExecStart=/usr/share/dotnet/dotnet /var/www/onlyoffice/Services/MailAggregator/ASC.Mail.Aggregator.Service.dll --urls=http://0.0.0.0:5025 --pathToConf=/etc/onlyoffice/communityserver --pathToNlogConf=/etc/onlyoffice/communityserver --'$STORAGE_ROOT'=/var/www/onlyoffice/Data --log:dir=/var/log/onlyoffice/mail --log:name=mail-aggregator --ENVIRONMENT=production
Environment=OPENSSL_CONF=/etc/onlyoffice/communityserver/openssl.cnf
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -1,21 +1,18 @@
[Unit]
Description=ONLYOFFICE MailCleaner Service
After=network.target syslog.target mysqld.service redis-server.service
Wants=mysqld.service redis-server.service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/MailCleaner'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/MailCleaner -l:/tmp/MailCleaner /var/www/onlyoffice/Services/MailCleaner/ASC.Mail.StorageCleaner.exe
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/MailCleaner/
Type=notify
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
WorkingDirectory=/var/www/onlyoffice/Services/MailCleaner/
ExecStart=/usr/share/dotnet/dotnet /var/www/onlyoffice/Services/MailCleaner/ASC.Mail.StorageCleaner.Service.dll --urls=http://0.0.0.0:5032 --pathToConf=/etc/onlyoffice/communityserver --pathToNlogConf=/etc/onlyoffice/communityserver --'$STORAGE_ROOT'=/var/www/onlyoffice/Data --log:dir=/var/log/onlyoffice/mail --log:name=mail-storagecleaner --ENVIRONMENT=production
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -0,0 +1,20 @@
[Unit]
Description=ONLYOFFICE MailImap Service
After=network.target syslog.target mysqld.service redis-server.service
Wants=mysqld.service redis-server.service
[Service]
Type=notify
User=onlyoffice
Group=onlyoffice
WorkingDirectory=/var/www/onlyoffice/Services/MailImap/
ExecStart=/usr/share/dotnet/dotnet /var/www/onlyoffice/Services/MailImap/ASC.Mail.ImapSync.dll --urls=http://0.0.0.0:5026 --pathToConf=/etc/onlyoffice/communityserver --pathToNlogConf=/etc/onlyoffice/communityserver --'$STORAGE_ROOT'=/var/www/onlyoffice/Data --log:dir=/var/log/onlyoffice/mail --log:name=mail-imapsync --ENVIRONMENT=production
Environment=OPENSSL_CONF=/etc/onlyoffice/communityserver/openssl.cnf
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target

View File

@ -1,20 +1,18 @@
[Unit]
Description=ONLYOFFICE MailWatchdog Service
After=network.target syslog.target mysqld.service redis-server.service
Wants=mysqld.service redis-server.service
Description=ONLYOFFICE MailImap Service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/onlyofficeMailWatchdog'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/MailWatchdog -l:/tmp/onlyofficeMailWatchdog /var/www/onlyoffice/Services/MailWatchdog/ASC.Mail.Watchdog.Service.exe
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/MailWatchdog/
Type=notify
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
WorkingDirectory=/var/www/onlyoffice/Services/MailWatchdog/
ExecStart=/usr/share/dotnet/dotnet /var/www/onlyoffice/Services/MailWatchdog/ASC.Mail.Watchdog.Service.dll --urls=http://0.0.0.0:5031 --pathToConf=/etc/onlyoffice/communityserver --pathToNlogConf=/etc/onlyoffice/communityserver --'$STORAGE_ROOT'=/var/www/onlyoffice/Data --log:dir=/var/log/onlyoffice/mail --log:name=mail-watchdog --ENVIRONMENT=production
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -0,0 +1,20 @@
[Unit]
Description=ONLYOFFICE WebDav Service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/onlyofficeWebDav'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/TeamLabSvc -l:/tmp/onlyofficeWebDav /var/www/onlyoffice/Services/TeamLabSvc/TeamLabSvc.exe --service \"ASC.WebDav.Svc.Launcher,ASC.WebDav.Svc\" --log WebDav
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/TeamLabSvc/
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target

View File

@ -34,7 +34,7 @@ DB_PWD=""
DB_NAME=""
apply_connection_string(){
binDirs=("WebStudio" "ApiSystem" "Services/TeamLabSvc" "Services/MailAggregator" "Services/MailCleaner" "Services/MailWatchdog")
binDirs=("WebStudio" "ApiSystem" "Services/TeamLabSvc")
if [ "$DB_HOST" != "localhost" ] || [ "$DB_NAME" != "{{package_sysname}}" ] || [ "$DB_USER" != "root" ] || [ "$DB_PWD" != "" ]; then
if [ -d /var/www/{{package_sysname}}/ ]; then
@ -50,10 +50,11 @@ apply_connection_string(){
sed "s!\"database\":.*!\"database\":\"${DB_NAME}\"!" -i ${APP_SERVICES_DIR}/ASC.UrlShortener/config/config.json
fi
sed -i "s/Server=.*/Server=$DB_HOST;Port=3306;Database=$DB_NAME;User ID=$DB_USER;Password=$DB_PWD;Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none;AllowPublicKeyRetrieval=True;ConnectionReset=false\",/g" /etc/onlyoffice/communityserver/appsettings.production.json
}
apply_core_machinekey(){
binDirs=("WebStudio" "ApiSystem" "Services/TeamLabSvc" "Services/MailAggregator" "Services/MailCleaner" "Services/MailWatchdog")
binDirs=("WebStudio" "ApiSystem" "Services/TeamLabSvc")
if [ -d /var/www/{{package_sysname}}/ ]; then
for i in "${!binDirs[@]}";
@ -66,6 +67,7 @@ apply_core_machinekey(){
if [ ! -z $CORE_MACHINEKEY ]; then
sed "s!\"core\.machinekey\":.*!\"core\.machinekey\":\"${CORE_MACHINEKEY}\",!" -i ${APP_SERVICES_DIR}/ASC.UrlShortener/config/config.json
sed "s!\"machinekey\":.*!\"machinekey\":\"${CORE_MACHINEKEY}\",!" -i /etc/onlyoffice/communityserver/appsettings.production.json
fi
}
@ -418,6 +420,34 @@ EOF
fi
# end
# setup mail services
db_get {{package_sysname}}-communityserver/imapsync-start-date || true
MAIL_IMAPSYNC_START_DATE="${RET:-$(date +"%Y-%m-%dT%H:%M:%S")}";
[ -z "$RET" ] && db_set {{package_sysname}}-communityserver/imapsync-start-date ${MAIL_IMAPSYNC_START_DATE} || true
sed 's_\(\"ImapSyncStartDate":\).*,_\1 "'${MAIL_IMAPSYNC_START_DATE}'",_' -i /etc/{{package_sysname}}/communityserver/mail.production.json
sed "/mail\.imap-sync-start-date/s/value=\"\S*\"/value=\"${MAIL_IMAPSYNC_START_DATE}\"/g" -i ${APP_ROOT_DIR}/web.appsettings.config
sed "s!\"value\":.*!\"value\":\ \"${APP_DATA_DIR}\"!" -i /etc/{{package_sysname}}/communityserver/storage.production.json
sed "s!\"folder\":.*,!\"folder\":\ \"${APP_SERVICES_DIR}\",!" -i /etc/{{package_sysname}}/communityserver/appsettings.production.json
if [ ! -f /etc/{{package_sysname}}/communityserver/openssl.cnf ] ; then
cp /etc/ssl/openssl.cnf \
/etc/{{package_sysname}}/communityserver/openssl.cnf;
sed '/new_oids$/a openssl_conf = default_conf' -i /etc/{{package_sysname}}/communityserver/openssl.cnf
cat >> /etc/{{package_sysname}}/communityserver/openssl.cnf <<EOF
[default_conf]
ssl_conf = ssl_sect
[ssl_sect]
system_default = system_default_sect
[system_default_sect]
MinProtocol = TLSv1.2
CipherString = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
Ciphersuites = TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_SHA256
EOF
fi
# setup xmppserver
if dpkg -l | grep -q "{{package_sysname}}-xmppserver"; then
sed '/web\.talk/s/value=\"\S*\"/value=\"true\"/g' -i ${APP_ROOT_DIR}/web.appsettings.config

View File

@ -15,6 +15,8 @@ override_dh_systemd_enable:
dh_systemd_enable --name={{package_sysname}}Telegram
dh_systemd_enable --name={{package_sysname}}Thumb
dh_systemd_enable --name={{package_sysname}}UrlShortener
dh_systemd_enable --name={{package_sysname}}AutoCleanUp
dh_systemd_enable --name={{package_sysname}}WebDav
dh_systemd_enable --name={{package_sysname}}Radicale
dh_systemd_enable --name={{package_sysname}}Index
dh_systemd_enable --name={{package_sysname}}Notify
@ -24,6 +26,7 @@ override_dh_systemd_enable:
dh_systemd_enable --name={{package_sysname}}MailAggregator
dh_systemd_enable --name={{package_sysname}}MailWatchdog
dh_systemd_enable --name={{package_sysname}}MailCleaner
dh_systemd_enable --name={{package_sysname}}MailImap
dh_systemd_enable --name={{package_sysname}}ThumbnailBuilder
dh_systemd_enable --name={{package_sysname}}SsoAuth
dh_systemd_enable --name=god
@ -36,6 +39,8 @@ override_dh_installinit:
dh_installinit --name={{package_sysname}}Telegram
dh_installinit --name={{package_sysname}}Thumb
dh_installinit --name={{package_sysname}}UrlShortener
dh_installinit --name={{package_sysname}}AutoCleanUp
dh_installinit --name={{package_sysname}}WebDav
dh_installinit --name={{package_sysname}}Radicale
dh_installinit --name={{package_sysname}}Index
dh_installinit --name={{package_sysname}}Notify
@ -45,6 +50,7 @@ override_dh_installinit:
dh_installinit --name={{package_sysname}}MailAggregator
dh_installinit --name={{package_sysname}}MailWatchdog
dh_installinit --name={{package_sysname}}MailCleaner
dh_installinit --name={{package_sysname}}MailImap
dh_installinit --name={{package_sysname}}ThumbnailBuilder
dh_installinit --name={{package_sysname}}SsoAuth
dh_installinit --name=god
@ -57,6 +63,8 @@ override_dh_systemd_start:
dh_systemd_start --name={{package_sysname}}Telegram
dh_systemd_start --name={{package_sysname}}Thumb
dh_systemd_start --name={{package_sysname}}UrlShortener
dh_systemd_start --name={{package_sysname}}AutoCleanUp
dh_systemd_start --name={{package_sysname}}WebDav
dh_systemd_start --name={{package_sysname}}Radicale
dh_systemd_start --name={{package_sysname}}Index
dh_systemd_start --name={{package_sysname}}Notify
@ -66,6 +74,7 @@ override_dh_systemd_start:
dh_systemd_start --name={{package_sysname}}MailAggregator
dh_systemd_start --name={{package_sysname}}MailWatchdog
dh_systemd_start --name={{package_sysname}}MailCleaner
dh_systemd_start --name={{package_sysname}}MailImap
dh_systemd_start --name={{package_sysname}}ThumbnailBuilder
dh_systemd_start --name={{package_sysname}}SsoAuth
dh_systemd_start --name=god

View File

@ -36,4 +36,9 @@ Description: Document Server JWT Secret:
Template: {{package_sysname}}-communityserver/ds-jwt-secret-header
Type: string
Default: AuthorizationJwt
Description: Document Server Secret Header:
Description: Document Server Secret Header:
Template: {{package_sysname}}-communityserver/imapsync-start-date
Type: string
Default:
Description: ImapSync service launch date:

View File

@ -3,7 +3,7 @@
ROOT_DIR="/var/www/onlyoffice/Data/certs";
NGINX_CONF_DIR="{{NGINX_CONF_DIR}}";
NGINX_ROOT_DIR="/etc/nginx";
APP_SERVICES_ROOT_DIR="/var/www/onlyoffice/Services"
APP_CONFIG_DIR="/etc/onlyoffice/communityserver"
SSL_OCSP_CERTIFICATE_PATH="${ROOT_DIR}/stapling.trusted.crt";
SSL_CERTIFICATE_PATH="${ROOT_DIR}/onlyoffice.crt";
SSL_KEY_PATH="${ROOT_DIR}/onlyoffice.key";
@ -54,7 +54,7 @@ else
sed '/resolver_timeout/d' -i default-onlyoffice-ssl.conf;
fi
sed '/mail\.default-api-scheme/s/\(value\s*=\s*\"\).*\"/\1https\"/' -i ${APP_SERVICES_ROOT_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config;
sed 's_\(\"DefaultApiSchema":\).*,_\1 "https",_' -i ${APP_CONFIG_DIR}/mail.production.json
mv -f default-onlyoffice-ssl.conf ${NGINX_CONF_DIR}/onlyoffice.conf

View File

@ -1,13 +1,14 @@
#!/bin/bash
APP_SERVICES_ROOT_DIR="/var/www/onlyoffice/Services"
APP_CONFIG_DIR="/etc/onlyoffice/communityserver"
NGINX_ROOT_DIR="/etc/nginx";
NGINX_CONF_DIR="{{NGINX_CONF_DIR}}";
cp $NGINX_ROOT_DIR/includes/onlyoffice-communityserver-common.conf.template default-onlyoffice.conf;
sed 's/{{APP_NIGNX_KEEPLIVE}}/64/g' -i default-onlyoffice.conf;
sed '/mail\.default-api-scheme/s/\(value\s*=\s*\"\).*\"/\1http\"/' -i ${APP_SERVICES_ROOT_DIR}/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe.config;
sed 's_\(\"DefaultApiSchema":\).*,_\1 "http",_' -i ${APP_CONFIG_DIR}/mail.production.json
mv -f default-onlyoffice.conf ${NGINX_CONF_DIR}/onlyoffice.conf

View File

@ -44,11 +44,25 @@ location /sh {
location /caldav/ {
proxy_pass http://localhost:5232/;
proxy_set_header X-Script-Name /caldav;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Script-Name /caldav;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
location /carddav/ {
proxy_pass http://localhost:5232/;
proxy_set_header X-Script-Name /carddav;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
location /webdav/ {
proxy_pass http://localhost:9889/;
proxy_set_header X-Script-Name /webdav;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-REWRITER-URL $X_REWRITER_URL;
}
location /sso/ {
proxy_pass http://localhost:9834/;

View File

@ -0,0 +1,20 @@
[Unit]
Description=ONLYOFFICE AutoCleanUp Service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/onlyofficeAutoCleanUp'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/TeamLabSvc -l:/tmp/onlyofficeAutoCleanUp /var/www/onlyoffice/Services/TeamLabSvc/TeamLabSvc.exe --service \"ASC.Files.AutoCleanUp.Launcher,ASC.Files.AutoCleanUp\" --log AutoCleanUp
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/TeamLabSvc/
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target

View File

@ -1,21 +1,18 @@
[Unit]
Description=ONLYOFFICE MailAggregator Service
After=network.target syslog.target mysqld.service redis-server.service
Wants=mysqld.service redis-server.service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/onlyofficeMailAggregator'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/MailAggregator -l:/tmp/onlyofficeMailAggregator /var/www/onlyoffice/Services/MailAggregator/ASC.Mail.Aggregator.CollectionService.exe
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/MailAggregator/
Type=notify
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
WorkingDirectory=/var/www/onlyoffice/Services/MailAggregator
ExecStart=/usr/share/dotnet/dotnet /var/www/onlyoffice/Services/MailAggregator/ASC.Mail.Aggregator.Service.dll --urls=http://0.0.0.0:5025 --pathToConf=/etc/onlyoffice/communityserver --pathToNlogConf=/etc/onlyoffice/communityserver --'$STORAGE_ROOT'=/var/www/onlyoffice/Data --log:dir=/var/log/onlyoffice/mail --log:name=mail-aggregator --ENVIRONMENT=production
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -1,21 +1,18 @@
[Unit]
Description=ONLYOFFICE MailCleaner Service
After=network.target syslog.target mysqld.service redis-server.service
Wants=mysqld.service redis-server.service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/MailCleaner'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/MailCleaner -l:/tmp/MailCleaner /var/www/onlyoffice/Services/MailCleaner/ASC.Mail.StorageCleaner.exe
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/MailCleaner/
Type=notify
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
WorkingDirectory=/var/www/onlyoffice/Services/MailCleaner/
ExecStart=/usr/share/dotnet/dotnet /var/www/onlyoffice/Services/MailCleaner/ASC.Mail.StorageCleaner.Service.dll --urls=http://0.0.0.0:5032 --pathToConf=/etc/onlyoffice/communityserver --pathToNlogConf=/etc/onlyoffice/communityserver --'$STORAGE_ROOT'=/var/www/onlyoffice/Data --log:dir=/var/log/onlyoffice/mail --log:name=mail-storagecleaner --ENVIRONMENT=production
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -0,0 +1,19 @@
[Unit]
Description=ONLYOFFICE MailImap Service
After=network.target syslog.target mysqld.service redis-server.service
Wants=mysqld.service redis-server.service
[Service]
Type=notify
User=onlyoffice
Group=onlyoffice
WorkingDirectory=/var/www/onlyoffice/Services/MailImap/
ExecStart=/usr/share/dotnet/dotnet /var/www/onlyoffice/Services/MailImap/ASC.Mail.ImapSync.dll --urls=http://0.0.0.0:5026 --pathToConf=/etc/onlyoffice/communityserver --pathToNlogConf=/etc/onlyoffice/communityserver --'$STORAGE_ROOT'=/var/www/onlyoffice/Data --log:dir=/var/log/onlyoffice/mail --log:name=mail-imapsync --ENVIRONMENT=production
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target

View File

@ -1,20 +1,18 @@
[Unit]
Description=ONLYOFFICE MailWatchdog Service
After=network.target syslog.target mysqld.service redis-server.service
Wants=mysqld.service redis-server.service
Description=ONLYOFFICE MailImap Service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/onlyofficeMailWatchdog'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/MailWatchdog -l:/tmp/onlyofficeMailWatchdog /var/www/onlyoffice/Services/MailWatchdog/ASC.Mail.Watchdog.Service.exe
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/MailWatchdog/
Type=notify
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
WorkingDirectory=/var/www/onlyoffice/Services/MailWatchdog/
ExecStart=/usr/share/dotnet/dotnet /var/www/onlyoffice/Services/MailWatchdog/ASC.Mail.Watchdog.Service.dll --urls=http://0.0.0.0:5031 --pathToConf=/etc/onlyoffice/communityserver --pathToNlogConf=/etc/onlyoffice/communityserver --'$STORAGE_ROOT'=/var/www/onlyoffice/Data --log:dir=/var/log/onlyoffice/mail --log:name=mail-watchdog --ENVIRONMENT=production
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -0,0 +1,20 @@
[Unit]
Description=ONLYOFFICE WebDav Service
After=network.target syslog.target mysqld.service
Wants=mysqld.service
[Service]
Type=forking
ExecStartPre=/bin/bash -c 'rm -f /tmp/onlyofficeWebDav'
ExecStart=/usr/bin/mono-service -d:/var/www/onlyoffice/Services/TeamLabSvc -l:/tmp/onlyofficeWebDav /var/www/onlyoffice/Services/TeamLabSvc/TeamLabSvc.exe --service \"ASC.WebDav.Svc.Launcher,ASC.WebDav.Svc\" --log WebDav
Environment=MONO_IOMAP=all MONO_PATH=/var/www/onlyoffice/Services/TeamLabSvc/
User=onlyoffice
Group=onlyoffice
# Give up if ping don't get an answer
TimeoutSec=600
Restart=no
PrivateTmp=false
[Install]
WantedBy=multi-user.target

View File

@ -54,6 +54,10 @@ cp ../../Files/nginx/includes/* "$RPM_BUILD_ROOT/etc/nginx/includes/"
mkdir -p "$RPM_BUILD_ROOT/etc/hyperfastcgi/"
cp -r ../../Files/hyperfastcgi/* "$RPM_BUILD_ROOT/etc/hyperfastcgi/"
#install mail config
mkdir -p "$RPM_BUILD_ROOT/etc/%{package_sysname}/communityserver/"
cp -r ../../Files/mail-config/* "$RPM_BUILD_ROOT/etc/%{package_sysname}/communityserver/"
# rename
find "$RPM_BUILD_ROOT/usr/bin/" \
"$RPM_BUILD_ROOT/etc/hyperfastcgi/" \
@ -62,6 +66,7 @@ find "$RPM_BUILD_ROOT/usr/bin/" \
"$RPM_BUILD_ROOT%{nginx_conf_d}/" \
"$RPM_BUILD_ROOT/etc/nginx/includes/" \
"$RPM_BUILD_ROOT/var/www/%{package_sysname}/Tools/" \
"$RPM_BUILD_ROOT/etc/%{package_sysname}/communityserver/" \
-depth -type f \
-exec sed -i 's/onlyoffice/%{package_sysname}/g' {} \; \
-exec sed -i 's/ONLYOFFICE/%{package_sysname}/g' {} \; \
@ -85,7 +90,7 @@ for FILE in `find "$RPM_BUILD_ROOT/var/www/%{package_sysname}/"`; do
echo "%%attr(-, %{package_sysname}, %{package_sysname}) %%config(noreplace) \"$RELFILE\"" >>onlyoffice.list
;;
*/WebStudio/[Ww]eb*.config | */ApiSystem/[Ww]eb*.config | */TeamLabSvc.exe.config | */ASC.Mail.StorageCleaner.exe.config | */ASC.Mail.Aggregator.CollectionService.exe.config | */ASC.Mail.Watchdog.Service.exe.config | */ASC.Mail.EmlDownloader.exe.config )
*/WebStudio/[Ww]eb*.config | */ApiSystem/[Ww]eb*.config | */TeamLabSvc.exe.config | */ASC.Mail.EmlDownloader.exe.config )
echo "%%attr(-, %{package_sysname}, %{package_sysname}) %%config \"$RELFILE\"" >>onlyoffice.list
;;
@ -108,6 +113,7 @@ rm -rf "$RPM_BUILD_ROOT"
%attr(-, root, root) /etc/nginx/includes/%{package_sysname}-communityserver-*
%attr(-, root, root) /etc/hyperfastcgi/*
%attr(-, root, root) /etc/god/
%attr(-, %{package_sysname}, %{package_sysname}) %config /etc/%{package_sysname}/communityserver/*
%pre
getent group %{package_sysname} >/dev/null || groupadd -r %{package_sysname}
@ -157,6 +163,8 @@ python3 -m pip install --upgrade $DIR/Tools/radicale/plugins/app_auth_plugin/.
python3 -m pip install --upgrade $DIR/Tools/radicale/plugins/app_store_plugin/.
python3 -m pip install --upgrade $DIR/Tools/radicale/plugins/app_rights_plugin/.
systemctl restart %{package_sysname}Radicale
%triggerin -- %{package_sysname}-xmppserver
DIR=/var/www/%{package_sysname}
@ -243,6 +251,17 @@ APP_DATA_DIR="${DIR}/Data"
mkdir -p "$APP_DATA_DIR"
#Mail configs changes
if [ -f $DIR/WebStudio/web.appsettings.config.rpmsave ]; then
MAIL_IMAPSYNC_START_DATE="$(sed -n '/"mail.imap-sync-start-date"/s_.*value\s*=\s*"\([^"]*\)".*_\1_p' ${DIR}/WebStudio/web.appsettings.config.rpmsave)";
fi
MAIL_IMAPSYNC_START_DATE="${MAIL_IMAPSYNC_START_DATE:-$(date '+%Y-%m-%dT%H:%M:%''S')}";
sed 's_\(\"ImapSyncStartDate":\).*,_\1 "'${MAIL_IMAPSYNC_START_DATE}'",_' -i /etc/%{package_sysname}/communityserver/mail.production.json
sed "/mail\.imap-sync-start-date/s/value=\"\S*\"/value=\"${MAIL_IMAPSYNC_START_DATE}\"/g" -i ${DIR}/WebStudio/web.appsettings.config
sed "s!\"value\":.*!\"value\":\ \"${APP_DATA_DIR}\"!" -i /etc/%{package_sysname}/communityserver/storage.production.json
sed "s!\"folder\":.*,!\"folder\":\ \"${SERVICES_DIR}\",!" -i /etc/%{package_sysname}/communityserver/appsettings.production.json
if [ "$(ls -alhd ${APP_DATA_DIR} | awk '{ print $3 }')" != "%{package_sysname}" ]; then
chown %{package_sysname}:%{package_sysname} ${APP_DATA_DIR}
fi
@ -279,14 +298,16 @@ if [ $1 -ge 2 ]; then
CORE_MACHINEKEY="$(sed -n '/"core.machinekey"/s!.*value\s*=\s*"\([^"]*\)".*!\1!p' ${DIR}/WebStudio/web.appsettings.config.rpmsave)";
fi
binDirs=("WebStudio" "ApiSystem" "Services/TeamLabSvc" "Services/MailAggregator" "Services/MailCleaner" "Services/MailWatchdog")
binDirs=("WebStudio" "ApiSystem" "Services/TeamLabSvc")
for i in "${!binDirs[@]}";
do
find "$DIR/${binDirs[$i]}" -type f -name "*.[cC]onfig" -exec sed -i "s/connectionString=.*/connectionString=\"$CONN_STR\" providerName=\"MySql.Data.MySqlClient\"\/>/" {} \;
sed -i "s/Server=.*/$CONN_STR\",/g" /etc/%{package_sysname}/communityserver/appsettings.production.json
if [ ! -z "$CORE_MACHINEKEY" ]; then
find "$DIR/${binDirs[$i]}" -type f -name "*.[cC]onfig" -exec sed -i "/core.machinekey/s!value=\".*\"!value=\"${CORE_MACHINEKEY}\"!g" {} \;
sed "s!\"machinekey\":.*!\"machinekey\":\"${CORE_MACHINEKEY}\",!" -i /etc/%{package_sysname}/communityserver/appsettings.production.json
fi
done
@ -399,7 +420,7 @@ fi
if systemctl is-active elasticsearch | grep -q "active"; then
#Checking that the elastic is not currently being updated
if [[ $(find /usr/share/elasticsearch/lib/ -name "elasticsearch-[0-99].[0-99].*" | wc -l) -eq 1 ]]; then
if [[ $(find /usr/share/elasticsearch/lib/ -name "elasticsearch-[0-9]*.jar" | wc -l) -eq 1 ]]; then
systemctl restart elasticsearch.service
fi
fi

View File

@ -3,9 +3,9 @@
%global package_header_tag_url http://onlyoffice.com/
%global package_header_tag_vendor Ascensio System SIA
%global package_header_tag_packager Ascensio System SIA <support@onlyoffice.com>
%global package_header_tag_requires mono-complete >= 6.8.0, nginx >= 1.9.5, mysql-server >= 5.7.0, wget, mono-webserver-hyperfastcgi, nodejs >= 12.0.0, redis >= 3.0.0, elasticsearch = 7.9.0-1, python3 >= 3.6, ffmpeg, jq
%global package_header_tag_requires mono-complete >= 6.8.0, nginx >= 1.9.5, mysql-server >= 5.7.0, wget, mono-webserver-hyperfastcgi, nodejs >= 12.0.0, redis >= 3.0.0, elasticsearch = 7.10.0-1, python3 >= 3.6, ffmpeg, jq
%global package_section_description "Community Server is a free open-source collaborative system developed to manage documents, projects, customer relationship and emails, all in one place."
%global package_services god monoserve monoserveApiSystem onlyofficeSocketIO onlyofficeThumb onlyofficeTelegram onlyofficeBackup onlyofficeFeed onlyofficeIndex onlyofficeNotify onlyofficeMailAggregator onlyofficeMailWatchdog onlyofficeMailCleaner onlyofficeStorageMigrate onlyofficeStorageEncryption onlyofficeUrlShortener onlyofficeRadicale onlyofficeThumbnailBuilder onlyofficeSsoAuth
%global package_services god monoserve monoserveApiSystem onlyofficeSocketIO onlyofficeThumb onlyofficeTelegram onlyofficeBackup onlyofficeFeed onlyofficeIndex onlyofficeNotify onlyofficeMailAggregator onlyofficeMailWatchdog onlyofficeMailCleaner onlyofficeMailImap onlyofficeStorageMigrate onlyofficeStorageEncryption onlyofficeUrlShortener onlyofficeWebDav onlyofficeAutoCleanUp onlyofficeRadicale onlyofficeThumbnailBuilder onlyofficeSsoAuth
%global package_sysname onlyoffice

View File

@ -12,6 +12,7 @@
<BuildTargets Condition=" '$(BuildTargets)' == 'ReBuild' ">Restore;ReBuild</BuildTargets>
<ReplaceResources Condition="$(ReplaceResources)==''">0</ReplaceResources>
<DeploySites Condition="'$(DeploySites)' == ''">0</DeploySites>
<YarnBuild Condition="'$(YarnBuild)' == ''">true</YarnBuild>
</PropertyGroup>
<Target Name="BuildTask">
@ -24,7 +25,6 @@
</Target>
<Target Name="ReplaceResources">
<CallTarget Targets="BuildTask" />
<ReplaceResources BaseFolder="$(ASCDir)" ResourceFile="$(ASCDir)build\sql\custom.resources.json" />
</Target>
@ -34,6 +34,7 @@
<Output ItemName="AlToolPath" TaskParameter="Include"/>
</CreateItem>
<CallTarget Targets="BuildTask" Condition=" '$(ReplaceResources)' == '1' OR '$(GenerateBundle)' == '1' OR '$(GenerateHelpCenterHtml)' == '1'"/>
<CallTarget Targets="ReplaceResources" Condition=" '$(ReplaceResources)' == '1' "/>
<MSBuild
@ -43,14 +44,20 @@
Properties="Configuration=$(Configuration);DeployTo=$(DeployTo);AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants)"
RebaseOutputs="true"
StopOnFirstFailure="true"/>
<Exec Command="yarn install --frozen-lockfile" WorkingDirectory="$(ASCDir)module\ASC.Socket.IO\" ContinueOnError="true"/>
<Exec Command="yarn install --frozen-lockfile" WorkingDirectory="$(ASCDir)module\ASC.Thumbnails\" ContinueOnError="true"/>
<Exec Command="yarn install --frozen-lockfile" WorkingDirectory="$(ASCDir)module\ASC.SsoAuth\" ContinueOnError="true"/>
<Exec Command="yarn install --frozen-lockfile" WorkingDirectory="$(ASCDir)module\ASC.UrlShortener\" ContinueOnError="true"/>
</Target>
<ItemGroup>
<NodeProject Include="$(ASCDir)module\ASC.Socket.IO\" />
<NodeProject Include="$(ASCDir)module\ASC.Thumbnails\" />
<NodeProject Include="$(ASCDir)module\ASC.UrlShortener\" />
<NodeProject Include="$(ASCDir)module\ASC.SsoAuth\" />
<NodeProject Include="$(ASCDir)module\ASC.WebDav\" />
</ItemGroup>
<Target Name="YarnInstall" AfterTargets="Build" Condition="$(YarnBuild) == 'true' " >
<Exec Command="yarn install --frozen-lockfile" WorkingDirectory="%(NodeProject.Identity)" ContinueOnError="true"/>
</Target>
<Target Name="SetAssemblyInfo">
<Message Text="%(ProjectToBuild.Filename)"/>
<AssemblyInfo CodeLanguage="CS"

View File

@ -12,7 +12,7 @@
<UsingTask AssemblyFile="$(RootDir)web\core\ASC.Web.Core.BuildTask\bin\$(Configuration)\ASC.Web.Core.BuildTask.dll" TaskName="ASC.Web.Core.BuildTask.GenerateBundle" />
<UsingTask AssemblyFile="$(RootDir)web\core\ASC.Web.Core.BuildTask\bin\$(Configuration)\ASC.Web.Core.BuildTask.dll" TaskName="ASC.Web.Core.BuildTask.GenerateHelpCenterHtml" />
<PropertyGroup>
<BuildTargets Condition=" '$(BuildTargets)' == 'Build' ">Restore;Build</BuildTargets>
<BuildTargets Condition=" '$(BuildTargets)' == 'Build' ">Build</BuildTargets>
<Configuration Condition="$(Configuration)==''">Debug</Configuration>
<RootDir Condition="$(RootDir)==''">..\..\</RootDir>
<BinDir>$(RootDir)web\studio\ASC.Web.Studio\bin\</BinDir>
@ -25,6 +25,8 @@
<GenerateBundle Condition="$(GenerateBundle)==''">0</GenerateBundle>
<GenerateHelpCenterHtml Condition="$(GenerateHelpCenterHtml)==''">0</GenerateHelpCenterHtml>
<Uploads Condition="'$(Uploads)' == ''">1</Uploads>
<MailTask Condition="'$(MailTask)' == ''">1</MailTask>
<ServicesTask Condition="'$(ServicesTask)' == ''">1</ServicesTask>
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">$(RootDir).nuget\NuGet.exe</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono $(RootDir).nuget\NuGet.exe</NuGetCommand>
</PropertyGroup>
@ -35,69 +37,121 @@
<ItemGroup>
<MailServiceToDeploy Include="MailAggregator">
<ProjPath>module\ASC.Mail\Services\ASC.Mail.Aggregator.CollectionService\ASC.Mail.Aggregator.CollectionService.csproj</ProjPath>
<ServicePath>$(OutDir)Services\MailAggregator\</ServicePath>
</MailServiceToDeploy>
<MailServiceToDeploy Include="MailAggregator">
<ProjPath>module\ASC.Mail\Services\ASC.Mail.EmlDownloader\ASC.Mail.EmlDownloader.csproj</ProjPath>
<ServicePath>$(OutDir)Services\MailAggregator\</ServicePath>
</MailServiceToDeploy>
<MailServiceToDeploy Include="MailWatchdog">
<ProjPath>module\ASC.Mail\Services\ASC.Mail.Watchdog.Service\ASC.Mail.Watchdog.Service.csproj</ProjPath>
<ServicePath>$(OutDir)Services\MailWatchdog\</ServicePath>
</MailServiceToDeploy>
<MailServiceToDeploy Include="MailCleaner">
<ProjPath>module\ASC.Mail\Services\ASC.Mail.StorageCleaner\ASC.Mail.StorageCleaner.Service.csproj</ProjPath>
<ServicePath>$(OutDir)Services\MailCleaner\</ServicePath>
</MailServiceToDeploy>
</ItemGroup>
<ItemGroup>
<ServiceToDeploy Include="SocketIO">
<Launcher>ASC.Socket.IO.Svc.Launcher, ASC.Socket.IO.Svc</Launcher>
<ProjPath>module\ASC.Socket.IO.Svc\ASC.Socket.IO.Svc.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\SocketIO\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
<ClientPath>module\ASC.Socket.IO\</ClientPath>
<ClientOutPath>$(OutDir)Services\ASC.Socket.IO</ClientOutPath>
</ServiceToDeploy>
<ServiceToDeploy Include="Telegram">
<Launcher>ASC.TelegramService.Launcher, ASC.TelegramService</Launcher>
<ProjPath>module\ASC.TelegramService\ASC.TelegramService.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Telegram\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="Thumbnails">
<Launcher>ASC.Thumbnails.Svc.Launcher, ASC.Thumbnails.Svc</Launcher>
<ProjPath>module\ASC.Thumbnails.Svc\ASC.Thumbnails.Svc.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Thumbnails\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
<ClientPath>module\ASC.Thumbnails\</ClientPath>
<ClientOutPath>$(OutDir)Services\ASC.Thumbnails</ClientOutPath>
</ServiceToDeploy>
<ServiceToDeploy Include="SsoAuth">
<Launcher>ASC.SsoAuth.Svc.Launcher, ASC.SsoAuth.Svc</Launcher>
<ProjPath>module\ASC.SsoAuth.Svc\ASC.SsoAuth.Svc.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\SsoAuth\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
<ClientPath>module\ASC.SsoAuth\</ClientPath>
<ClientOutPath>$(OutDir)Services\ASC.SsoAuth</ClientOutPath>
</ServiceToDeploy>
<ServiceToDeploy Include="UrlShortener">
<Launcher>ASC.UrlShortener.Svc.Launcher, ASC.UrlShortener.Svc</Launcher>
<ProjPath>module\ASC.UrlShortener.Svc\ASC.UrlShortener.Svc.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\UrlShortener\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
<ClientPath>module\ASC.UrlShortener\</ClientPath>
<ClientOutPath>$(OutDir)Services\ASC.UrlShortener</ClientOutPath>
</ServiceToDeploy>
<ServiceToDeploy Include="WebDav">
<Launcher>ASC.WebDav.Svc.Launcher, ASC.WebDav.Svc</Launcher>
<ProjPath>module\ASC.WebDav.Svc\ASC.WebDav.Svc.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\WebDav\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
<ClientPath>module\ASC.WebDav\</ClientPath>
<ClientOutPath>$(OutDir)Services\ASC.WebDav</ClientOutPath>
</ServiceToDeploy>
<ServiceToDeploy Include="Radicale">
<Launcher>ASC.Radicale.Launcher, ASC.Radicale</Launcher>
<ProjPath>module\ASC.Radicale\ASC.Radicale.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Radicale\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="Notify">
<Launcher>ASC.Notify.NotifyServiceLauncher, ASC.Notify</Launcher>
<ProjPath>module\ASC.Notify\ASC.Notify\ASC.Notify.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Notify\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="Index">
<Launcher>ASC.ElasticSearch.Launcher, ASC.ElasticSearch</Launcher>
<ProjPath>module\ASC.ElasticSearch\ASC.ElasticSearch.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Index\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="Feed">
<Launcher>ASC.Feed.Aggregator.FeedAggregatorLauncher, ASC.Feed.Aggregator</Launcher>
<ProjPath>module\ASC.Feed.Aggregator\ASC.Feed.Aggregator.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Feed\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="Backup">
<Launcher>ASC.Data.Backup.Service.BackupServiceLauncher, ASC.Data.Backup</Launcher>
<ProjPath>common\ASC.Data.Backup\ASC.Data.Backup.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Backup\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="Migrate">
<Launcher>ASC.Data.Storage.Migration.Launcher, ASC.Data.Storage.Migration</Launcher>
<ProjPath>common\ASC.Data.Storage.Migration\ASC.Data.Storage.Migration.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Migrate\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="Encryption">
<Launcher>ASC.Data.Storage.Encryption.Launcher, ASC.Data.Storage.Encryption</Launcher>
<ProjPath>common\ASC.Data.Storage.Encryption\ASC.Data.Storage.Encryption.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\Encryption\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="ThumbnailBuilder">
<Launcher>ASC.Files.ThumbnailBuilder.Launcher, ASC.Files.ThumbnailBuilder</Launcher>
<ProjPath>module\ASC.Files.ThumbnailBuilder\ASC.Files.ThumbnailBuilder.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\ThumbnailBuilder\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
<ServiceToDeploy Include="AutoCleanUp">
<Launcher>ASC.Files.AutoCleanUp.Launcher, ASC.Files.AutoCleanUp</Launcher>
<ProjPath>module\ASC.Files.AutoCleanUp\ASC.Files.AutoCleanUp.csproj</ProjPath>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\AutoCleanUp\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</ServiceToDeploy>
</ItemGroup>
<ItemGroup>
@ -115,19 +169,29 @@
<CommunityDeleteList Include="LdapSettings\LdapSettings.ascx" />
<CommunityDeleteList Include="StorageSettings\StorageSettings.ascx" />
</ItemGroup>
<ItemGroup>
<StepsToRunInParallel Include="$(MSBuildThisFileFullPath)" Condition="'$(ServicesTask)' == '1'">
<Properties>TargetToInvoke=DeployService</Properties>
</StepsToRunInParallel>
<StepsToRunInParallel Include="$(MSBuildThisFileFullPath)" Condition="'$(MailTask)' == '1'">
<Properties>TargetToInvoke=DeployMail</Properties>
</StepsToRunInParallel>
<StepsToRunInParallel Include="$(MSBuildThisFileFullPath)">
<Properties>TargetToInvoke=DeployWeb</Properties>
</StepsToRunInParallel>
<StepsToRunInParallel Include="$(MSBuildThisFileFullPath)" Condition="'$(Uploads)' == '1'">
<Properties>TargetToInvoke=DeployUpload</Properties>
</StepsToRunInParallel>
</ItemGroup>
<Target Name="InvokeInParallelWithinThisProject">
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="$(TargetToInvoke)" StopOnFirstFailure="true" />
</Target>
<Target Name="Deploy">
<Message Text="Deploy parameters:" />
<Message Text=" SplitServices = $(SplitServices)" />
<RemoveDir Directories="$(OutDir)" ContinueOnError="true" Condition="'$(LeaveOutDir)' != '0'" />
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="DeployService" Properties="OutDir=$(OutDir);DeployTo=$(DeployTo);ServiceName=%(ServiceToDeploy.Identity);ProjPath=%(ServiceToDeploy.ProjPath);ServiceLauncher=%(ServiceToDeploy.Launcher);Disable_CopyWebApplication=true" />
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="DeployMail" Properties="OutDir=$(OutDir);DeployTo=$(DeployTo);ServiceName=%(MailServiceToDeploy.Identity);ProjPath=%(MailServiceToDeploy.ProjPath);Disable_CopyWebApplication=true" />
<CopyDirectory SourceFolder="$(RootDir)web\studio\ASC.Web.Studio\" DestinationFolder="$(OutDir)WebStudio" ExcludeRegex="\\Products\\Projects\\Test\\|\\Products\\People\\Tests\\|\\Data\\|\\obj\\|\\bin\\.*\.xml$|\\bin\\.*\.pdb$|\.sln$|\.cs$|\.csproj$|\.suo$|\.user$|\.mdb$|\.userprefs$|\.pfx$|\\static\\helpcenter\\.+" />
<RemoveDuplicatesAssemblies SourceFolder="$(OutDir)WebStudio" />
<CallTarget Targets="CssMinify" Condition=" '$(CssMinify)' == '1' " />
<CallTarget Targets="LessCompile" Condition=" '$(LessCompile)' == '1' " />
<CallTarget Targets="GenerateBundle" Condition=" '$(GenerateBundle)' == '1' " />
<CallTarget Targets="GenerateHelpCenterHtml" Condition=" '$(GenerateHelpCenterHtml)' == '1' " />
<CopyDirectory Condition=" '$(Uploads)' == '1' AND Exists('$(RootDir)web\studio\ASC.Web.Upload\') " SourceFolder="$(RootDir)web\studio\ASC.Web.Upload\" DestinationFolder="$(OutDir)Uploads" ExcludeRegex="\\Data\\|\\obj\\|\\bin\\.*\.xml$|\\bin\\.*\.pdb$|\.sln$|\.cs$|\.csproj$|\.suo$|\.user$|\.mdb$|\.userprefs$" />
<MSBuild Projects="$(RootDir)module\ASC.TeamLabSvc\ASC.TeamLabSvc\ASC.TeamLabSvc.csproj" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
<MSBuild BuildInParallel="true" Projects="@(StepsToRunInParallel)" Targets="InvokeInParallelWithinThisProject" />
<CallTarget Targets="ChangeConfigs" Condition=" Exists( '$(RootDir)build\config\private\' ) " />
<CreateItem Include="$(OutDir)WebStudio\web.appsettings.config;$(OutDir)WebStudio\web.connections.config;$(OutDir)WebStudio\web.storage.config;$(OutDir)WebStudio\web.autofac.config;$(OutDir)WebStudio\web.consumers.config">
<Output ItemName="WebConfigurationFiles" TaskParameter="Include" />
@ -148,46 +212,53 @@
</ItemGroup>
<Delete Files="@(EncryptionDeleteList)" Condition="'$(DeployTo)'=='RU' Or '$(DeployTo)'=='R7-OFFICE.RU' Or '$(DeployTo)'=='R7-OFFICE.SERVER' Or '$(DeployTo)'=='R7-OFFICE.UNIX.SERVER'" />
</Target>
<Target Name="DeployWeb">
<Message Text="Deploying web" />
<CopyDirectory SourceFolder="$(RootDir)web\studio\ASC.Web.Studio\" DestinationFolder="$(OutDir)WebStudio" ExcludeRegex="\\Products\\Projects\\Test\\|\\Products\\People\\Tests\\|\\Data\\|\\obj\\|\\bin\\.*\.xml$|\\bin\\.*\.pdb$|\.sln$|\.cs$|\.csproj$|\.resx$|\.suo$|\.user$|\.mdb$|\.userprefs$|\.pfx$|\\static\\helpcenter\\.+" />
<RemoveDuplicatesAssemblies SourceFolder="$(OutDir)WebStudio" />
<CallTarget Targets="CssMinify" Condition=" '$(CssMinify)' == '1' " />
<CallTarget Targets="LessCompile" Condition=" '$(LessCompile)' == '1' " />
<CallTarget Targets="GenerateBundle" Condition=" '$(GenerateBundle)' == '1' " />
<CallTarget Targets="GenerateHelpCenterHtml" Condition=" '$(GenerateHelpCenterHtml)' == '1' " />
</Target>
<Target Name="DeployUpload">
<Message Text="Deploying upload" />
<CopyDirectory Condition=" '$(Uploads)' == '1' AND Exists('$(RootDir)web\studio\ASC.Web.Upload\') " SourceFolder="$(RootDir)web\studio\ASC.Web.Upload\" DestinationFolder="$(OutDir)Uploads" ExcludeRegex="\\Data\\|\\obj\\|\\bin\\.*\.xml$|\\bin\\.*\.pdb$|\.sln$|\.cs$|\.csproj$|\.suo$|\.user$|\.mdb$|\.userprefs$" />
</Target>
<Target Name="DeployService">
<Message Text="Deploying service $(ServiceName)" />
<PropertyGroup>
<ServicePath Condition=" '$(SplitServices)' == '1' ">$(OutDir)Services\$(ServiceName)\</ServicePath>
<ServicePath Condition=" '$(SplitServices)' != '1' ">$(OutDir)Services\TeamLabSvc\</ServicePath>
</PropertyGroup>
<Message Text="Deploying service path $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)$(ServicePath)'))" />
<MSBuild BuildInParallel="true" Projects="$(RootDir)$(ProjPath)" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);OutDir=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)$(ServicePath)'));AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
<Message Text="Deploying service %(ServiceToDeploy.Identity)" />
<Message Text="Deploying service path $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))" />
<MSBuild BuildInParallel="true" Projects="$(RootDir)%(ServiceToDeploy.ProjPath)" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);OutDir=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'));AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
<ItemGroup>
<ServiceFiles Include="$(RootDir)\web\studio\ASC.Web.Studio\web.autofac.config;$(RootDir)\web\studio\ASC.Web.Studio\web.consumers.config; $(RootDir)build\config\TeamLabSvc.exe.config;$(RootDir)module\ASC.TeamLabSvc\ASC.TeamLabSvc\bin\$(Configuration)\TeamLabSvc.exe" />
<ServiceFiles Include="$(RootDir)\web\studio\ASC.Web.Studio\web.autofac.config;$(RootDir)\web\studio\ASC.Web.Studio\web.consumers.config;$(RootDir)build\config\TeamLabSvc.exe.config;$(RootDir)module\ASC.TeamLabSvc\ASC.TeamLabSvc\bin\$(Configuration)\TeamLabSvc.exe" ServicePath="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))" />
</ItemGroup>
<Copy SourceFiles="%(ServiceFiles.Identity)" DestinationFolder="$(ServicePath)" />
<MSBuild Condition=" $(ServiceName) == 'Index' OR $(ServiceName) == 'Backup' OR $(ServiceName) == 'Notify'" BuildInParallel="true" Projects="%(WebToDeploy.Identity)" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);OutDir=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)$(ServicePath)'));AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
<MSBuild Condition="$(ServiceName) == 'Backup' OR $(ServiceName) == 'Notify'" BuildInParallel="true" Projects="$(RootDir)module\ASC.Api\ASC.Api.Calendar\ASC.Api.Calendar.csproj" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);OutDir=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)$(ServicePath)'));AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
<CopyDirectory Condition=" $(ServiceName) == 'SocketIO' AND Exists('$(RootDir)module\ASC.Socket.IO\') " SourceFolder="$(RootDir)module\ASC.Socket.IO\" DestinationFolder="$(OutDir)Services\ASC.Socket.IO" ExcludeRegex="\\typings\\|\.njsproj$|typings\.json$" />
<CopyDirectory Condition=" $(ServiceName) == 'Thumbnails' AND Exists('$(RootDir)module\ASC.Thumbnails\') " SourceFolder="$(RootDir)module\ASC.Thumbnails\" DestinationFolder="$(OutDir)Services\ASC.Thumbnails" ExcludeRegex="\\typings\\|\.njsproj$|typings\.json$" />
<CopyDirectory Condition=" $(ServiceName) == 'SsoAuth' AND Exists('$(RootDir)module\ASC.SsoAuth\') " SourceFolder="$(RootDir)module\ASC.SsoAuth\" DestinationFolder="$(OutDir)Services\ASC.SsoAuth" ExcludeRegex="\\typings\\|\.njsproj$|typings\.json$" />
<CopyDirectory Condition=" $(ServiceName) == 'UrlShortener' AND Exists('$(RootDir)module\ASC.UrlShortener\') " SourceFolder="$(RootDir)module\ASC.UrlShortener\" DestinationFolder="$(OutDir)Services\ASC.UrlShortener" ExcludeRegex="\\typings\\|\.njsproj$|typings\.json$" />
<Copy SourceFiles="%(ServiceFiles.Identity)" DestinationFolder="%(ServicePath)" />
<MSBuild BuildInParallel="true" Condition=" %(ServiceToDeploy.Identity) == 'Index' OR %(ServiceToDeploy.Identity) == 'Backup' OR %(ServiceToDeploy.Identity) == 'Notify'" Projects="@(WebToDeploy)" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);OutDir=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'));AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true;" StopOnFirstFailure="true" />
<MSBuild Condition="%(ServiceToDeploy.Identity) == 'Backup' OR %(ServiceToDeploy.Identity) == 'Notify'" Projects="$(RootDir)module\ASC.Api\ASC.Api.Calendar\ASC.Api.Calendar.csproj" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);OutDir=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'));AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
<CopyDirectory Condition=" %(ServiceToDeploy.ClientPath) != '' AND Exists('$(RootDir)%(ServiceToDeploy.ClientPath)') " SourceFolder="$(RootDir)%(ServiceToDeploy.ClientPath)" DestinationFolder="%(ServiceToDeploy.ClientOutPath)" ExcludeRegex="\\typings\\|\.njsproj$|typings\.json$" />
<Exec Command="yarn install --frozen-lockfile" WorkingDirectory="%(ServiceToDeploy.ClientOutPath)" Condition=" %(ServiceToDeploy.ClientPath) != '' AND Exists('$(RootDir)%(ServiceToDeploy.ClientPath)') " />
<RegexReplace Expression=".+\." Input="$(DeployTo)">
<Output PropertyName="Substitution" TaskParameter="Output" />
</RegexReplace>
<CreateItem Include="$(Substitution)" Condition=" $(Substitution) != $(DeployTo) ">
<CreateItem Include="$(Substitution)" Condition=" $(Substitution) != $(DeployTo) " AdditionalMetadata="ServicePath=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))">
<Output ItemName="ConfigSubstitutionRoot" TaskParameter="Include" />
</CreateItem>
<RegexReplace Expression="^[^.]*\." Input="$(DeployTo)">
<Output PropertyName="SubstitutionNext" TaskParameter="Output" />
</RegexReplace>
<CreateItem Include="$(SubstitutionNext)" Condition="$(Substitution) != $(SubstitutionNext) ">
<CreateItem Include="$(SubstitutionNext)" Condition="$(Substitution) != $(SubstitutionNext) " AdditionalMetadata="ServicePath=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))">
<Output ItemName="ConfigSubstitutionRoot" TaskParameter="Include" />
</CreateItem>
<CreateItem Include="$(DeployTo)">
<CreateItem Include="$(DeployTo)" AdditionalMetadata="ServicePath=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))">
<Output ItemName="ConfigSubstitutionRoot" TaskParameter="Include" />
</CreateItem>
<XmlMassUpdate Condition="'%(ConfigSubstitutionRoot.Identity)' != '' AND Exists('..\config\private\TeamLabSvc.exe.Config.Substitutions.xml')" ContentFile="$(ServicePath)\TeamLabSvc.exe.config" SubstitutionsFile="..\config\private\TeamLabSvc.exe.Config.Substitutions.xml" ContentRoot="/" SubstitutionsRoot="/configuration/substitutions/%(ConfigSubstitutionRoot.Identity)" NamespaceDefinitions="un=http://schemas.microsoft.com/practices/2010/unity" />
<XmlMassUpdate Condition="'%(ConfigSubstitutionRoot.Identity)' != '' AND Exists('..\config\private\Web.Consumers.Config.Substitutions.xml')" ContentFile="$(ServicePath)\web.consumers.config" SubstitutionsFile="..\config\private\Web.Consumers.Config.Substitutions.xml" ContentRoot="/" SubstitutionsRoot="/configuration/substitutions/%(ConfigSubstitutionRoot.Identity)" NamespaceDefinitions="un=http://schemas.microsoft.com/practices/2010/unity" />
<XmlMassUpdate Condition="'%(ConfigSubstitutionRoot.Identity)' != '' AND Exists('..\config\private\Web.Autofac.Config.Substitutions.xml')" ContentFile="$(ServicePath)\web.autofac.config" SubstitutionsFile="..\config\private\Web.Autofac.Config.Substitutions.xml" ContentRoot="/" SubstitutionsRoot="/configuration/substitutions/%(ConfigSubstitutionRoot.Identity)" NamespaceDefinitions="un=http://schemas.microsoft.com/practices/2010/unity" />
<XmlUpdate Condition="'$(SplitServices)' == '1'" XmlFileName="$(ServicePath)\TeamLabSvc.exe.config" XPath="/configuration/teamlab/services/add[not(@type='$(ServiceLauncher)')]" Delete="true" />
<XmlUpdate Condition="'$(SplitServices)' == '1'" XmlFileName="$(ServicePath)\TeamLabSvc.exe.config" XPath="/configuration/log4net/appender[@name='File']/file/conversionPattern/@value" Value="%folder{LogDirectory}svc$(ServiceName)" />
<XmlUpdate Condition="'$(SplitServices)' == '1'" XmlFileName="$(ServicePath)\TeamLabSvc.exe.config" XPath="/configuration/log4net/appender[@name='Sql']/file/conversionPattern/@value" Value="%folder{LogDirectory}svc$(ServiceName).SQL.log" />
<XmlUpdate Condition="'$(ServiceLauncher)' != '' AND '$(SplitServices)' == '1'" XmlFileName="$(ServicePath)\TeamLabSvc.exe.config" XPath="/configuration/nlog/variable[@name='svcName']/@value" Value="$(ServiceName)" />
<XmlMassUpdate Condition="'$(ServicesTask)'=='1' AND '%(ConfigSubstitutionRoot.Identity)' != '' AND Exists('..\config\private\TeamLabSvc.exe.Config.Substitutions.xml')" ContentFile="%(ServicePath)\TeamLabSvc.exe.config" SubstitutionsFile="..\config\private\TeamLabSvc.exe.Config.Substitutions.xml" ContentRoot="/" SubstitutionsRoot="/configuration/substitutions/%(ConfigSubstitutionRoot.Identity)" NamespaceDefinitions="un=http://schemas.microsoft.com/practices/2010/unity" />
<XmlMassUpdate Condition="'%(ConfigSubstitutionRoot.Identity)' != '' AND Exists('..\config\private\Web.Consumers.Config.Substitutions.xml')" ContentFile="%(ServicePath)\web.consumers.config" SubstitutionsFile="..\config\private\Web.Consumers.Config.Substitutions.xml" ContentRoot="/" SubstitutionsRoot="/configuration/substitutions/%(ConfigSubstitutionRoot.Identity)" NamespaceDefinitions="un=http://schemas.microsoft.com/practices/2010/unity" />
<XmlMassUpdate Condition="'%(ConfigSubstitutionRoot.Identity)' != '' AND Exists('..\config\private\Web.Autofac.Config.Substitutions.xml')" ContentFile="%(ServicePath)\web.autofac.config" SubstitutionsFile="..\config\private\Web.Autofac.Config.Substitutions.xml" ContentRoot="/" SubstitutionsRoot="/configuration/substitutions/%(ConfigSubstitutionRoot.Identity)" NamespaceDefinitions="un=http://schemas.microsoft.com/practices/2010/unity" />
<XmlUpdate Condition="'$(ServicesTask)'=='1' AND '$(SplitServices)' == '1'" XmlFileName="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\TeamLabSvc.exe.config" XPath="/configuration/teamlab/services/add[not(@type='%(ServiceToDeploy.Launcher)')]" Delete="true" />
<XmlUpdate Condition="'$(ServicesTask)'=='1' AND '$(SplitServices)' == '1'" XmlFileName="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\TeamLabSvc.exe.config" XPath="/configuration/log4net/appender[@name='File']/file/conversionPattern/@value" Value="%folder{LogDirectory}svc%(ServiceToDeploy.Identity)" />
<XmlUpdate Condition="'$(ServicesTask)'=='1' AND '$(SplitServices)' == '1'" XmlFileName="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\TeamLabSvc.exe.config" XPath="/configuration/log4net/appender[@name='Sql']/file/conversionPattern/@value" Value="%folder{LogDirectory}svc%(ServiceToDeploy.Identity).SQL.log" />
<XmlUpdate Condition="'%(ServiceToDeploy.Launcher)' != '' AND '$(SplitServices)' == '1'" XmlFileName="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\TeamLabSvc.exe.config" XPath="/configuration/nlog/variable[@name='svcName']/@value" Value="%(ServiceToDeploy.Identity)" />
<XmlRead Condition="Exists('..\config\private\Radicale.Config.Substitutions.xml')" Namespace="http://nant.sf.net/release/0.85/nant.xsd" Prefix="n" XPath="/n:configuration/n:substitutions/n:$(DeployTo)/n:property[@name='radicale_portal_url']/@value" XmlFileName="..\config\private\Radicale.Config.Substitutions.xml">
<Output TaskParameter="Value" PropertyName="RadicalePortalUrl" />
</XmlRead>
@ -200,28 +271,24 @@
<XmlRead Condition="Exists('..\config\private\Radicale.Config.Substitutions.xml')" Namespace="http://nant.sf.net/release/0.85/nant.xsd" Prefix="n" XPath="/n:configuration/n:substitutions/n:$(DeployTo)/n:property[@name='radicale_log_file']/@value" XmlFileName="..\config\private\Radicale.Config.Substitutions.xml">
<Output TaskParameter="Value" PropertyName="RadicaleLogFile" />
</XmlRead>
<FileUpdate Condition=" $(ServiceName) == 'Radicale'" Files="$(ServicePath)\radicale.config" Encoding="ASCII" Regex="portal_url =.+" ReplacementText="portal_url = $(RadicalePortalUrl)" />
<FileUpdate Condition=" $(ServiceName) == 'Radicale'" Files="$(ServicePath)\radicale.config" Encoding="ASCII" Regex="filesystem_folder =.+" ReplacementText="filesystem_folder = $(RadicaleFilesystemFolder)" />
<FileUpdate Condition=" $(ServiceName) == 'Radicale'" Files="$(ServicePath)\radicale.log.config" Encoding="ASCII" Regex="args = .+" ReplacementText="args = ($(RadicaleLogFile),'midnight', 1, 7)" />
<FileUpdate Condition=" $(ServiceName) == 'Radicale'" Files="$(ServicePath)\radicale.config" Encoding="ASCII" Regex="machine_key =.+" ReplacementText="machine_key = $(RadicaleMachineKey)" />
<XmlRead Condition="Exists('..\config\private\Radicale.Config.Substitutions.xml')" Namespace="http://nant.sf.net/release/0.85/nant.xsd" Prefix="n" XPath="/n:configuration/n:substitutions/n:$(DeployTo)/n:property[@name='radicale_rights_admin']/@value" XmlFileName="..\config\private\Radicale.Config.Substitutions.xml">
<Output TaskParameter="Value" PropertyName="RadicaleRightsAdmin" />
</XmlRead>
<FileUpdate Condition=" %(ServiceToDeploy.Identity) == 'Radicale'" Files="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\radicale.config" Encoding="ASCII" Regex="portal_url =.+" ReplacementText="portal_url = $(RadicalePortalUrl)" />
<FileUpdate Condition=" %(ServiceToDeploy.Identity) == 'Radicale'" Files="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\radicale.config" Encoding="ASCII" Regex="filesystem_folder =.+" ReplacementText="filesystem_folder = $(RadicaleFilesystemFolder)" />
<FileUpdate Condition=" %(ServiceToDeploy.Identity) == 'Radicale'" Files="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\radicale.log.config" Encoding="ASCII" Regex="args = .+" ReplacementText="args = ($(RadicaleLogFile),'midnight', 1, 7)" />
<FileUpdate Condition=" %(ServiceToDeploy.Identity) == 'Radicale'" Files="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\radicale.config" Encoding="ASCII" Regex="machine_key =.+" ReplacementText="machine_key = $(RadicaleMachineKey)" />
<FileUpdate Condition=" %(ServiceToDeploy.Identity) == 'Radicale'" Files="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(ServiceToDeploy.ServicePath)'))\radicale.rights" Encoding="ASCII" Regex="user: admin@radicale" ReplacementText="user: $(RadicaleRightsAdmin)" />
</Target>
<Target Name="DeployMail">
<Message Text="Deploying service $(ServiceName)" />
<PropertyGroup>
<ServicePath>$(OutDir)Services\$(ServiceName)\</ServicePath>
</PropertyGroup>
<Message Text="Deploying service path $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)$(ServicePath)'))" />
<MSBuild BuildInParallel="true" Projects="$(RootDir)$(ProjPath)" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);OutDir=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)$(ServicePath)'));AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
</Target>
<Target Name="BuildTask">
<MSBuild BuildInParallel="true" Projects="$(RootDir)web\core\ASC.Web.Core.sln" Targets="Restore;ReBuild" Properties="Configuration=$(Configuration);AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
<Message Text="Deploying service %(MailServiceToDeploy.Identity)" />
<Message Text="Deploying service path $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(MailServiceToDeploy.ServicePath)'))" />
<MSBuild BuildInParallel="true" Projects="$(RootDir)%(MailServiceToDeploy.ProjPath)" Targets="$(BuildTargets)" Properties="Configuration=$(Configuration);OutDir=$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)%(MailServiceToDeploy.ServicePath)'));AlToolPath=%(AlToolPath.FullPath);Constants=$(Constants);Disable_CopyWebApplication=true" StopOnFirstFailure="true" />
</Target>
<Target Name="GenerateBundle">
<CallTarget Targets="BuildTask" />
<GenerateBundle WebStudioFolder="$(OutDir)\WebStudio\" />
</Target>
<Target Name="GenerateHelpCenterHtml">
<CallTarget Targets="BuildTask" Condition=" '$(GenerateBundle)' == '0' " />
<GenerateHelpCenterHtml WebStudioFolder="$(OutDir)\WebStudio\" />
</Target>
<Target Name="LessCompile">
@ -300,37 +367,37 @@
<ConfigFiles Include="$(OutDir)WebStudio\web.storage.config">
<SubstitutionsFile>..\config\private\Web.Storage.Config.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailAggregator\ASC.Mail.Aggregator.CollectionService.exe.config">
<ConfigFiles Include="$(OutDir)Services\MailAggregator\ASC.Mail.Aggregator.CollectionService.exe.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Agg.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailAggregator\ASC.Mail.EmlDownloader.exe.config">
<ConfigFiles Include="$(OutDir)Services\MailAggregator\ASC.Mail.EmlDownloader.exe.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Agg.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailAggregator\mail.agg.log4net.config">
<ConfigFiles Include="$(OutDir)Services\MailAggregator\mail.agg.log4net.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Agg.Log4net.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailAggregator\mail.agg.nlog.config">
<ConfigFiles Include="$(OutDir)Services\MailAggregator\mail.agg.nlog.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Agg.NLog.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailWatchdog\ASC.Mail.Watchdog.Service.exe.config">
<ConfigFiles Include="$(OutDir)Services\MailWatchdog\ASC.Mail.Watchdog.Service.exe.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Dog.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailWatchdog\mail.dog.nlog.config">
<ConfigFiles Include="$(OutDir)Services\MailWatchdog\mail.dog.nlog.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Dog.NLog.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailWatchdog\mail.dog.log4net.config">
<ConfigFiles Include="$(OutDir)Services\MailWatchdog\mail.dog.log4net.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Dog.Log4net.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailWatchdog\mail.dog.nlog.config">
<ConfigFiles Include="$(OutDir)Services\MailWatchdog\mail.dog.nlog.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Dog.NLog.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailCleaner\ASC.Mail.StorageCleaner.exe.config">
<ConfigFiles Include="$(OutDir)Services\MailCleaner\ASC.Mail.StorageCleaner.exe.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Cln.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailCleaner\mail.cln.log4net.config">
<ConfigFiles Include="$(OutDir)Services\MailCleaner\mail.cln.log4net.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Cln.Log4net.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Include="$(OutDir)Services\MailCleaner\mail.cln.nlog.config">
<ConfigFiles Include="$(OutDir)Services\MailCleaner\mail.cln.nlog.config" Condition="'$(MailTask)' == '1'">
<SubstitutionsFile>..\config\private\Mail.Cln.NLog.Substitutions.xml</SubstitutionsFile>
</ConfigFiles>
<ConfigFiles Remove="@(ConfigFiles)" Condition="!Exists('%(ConfigFiles.SubstitutionsFile)')" />

View File

@ -18,10 +18,14 @@ BEGIN
commit;
END IF;
replace into tenants_quota (tenant, name, max_file_size, max_total_size, active_users, features) values (-1, 'default', 102400, 10995116277760, 10000, 'domain,audit,controlpanel,healthcheck,ldap,sso,whitelabel,branding,ssbranding,update,support,portals:10000,discencryption,privacyroom,restore');
replace into tenants_quota (tenant, name, max_file_size, max_total_size, active_users, features) values (-1, 'default', 102400, 10995116277760, 10000, 'update');
IF NOT EXISTS(SELECT * FROM core_settings WHERE tenant = -1 AND id = 'CustomMode') THEN
replace into core_settings(tenant, id, value) values (-1, 'SmtpSettings', 0xF052E090A1A3750DADCD4E9961DA04AA51EF0197E2C0623CF12C5838BFA40A9B48BAEFCBE371587731D7E3DC9E7C6009742F9E415D56DB0F0AE08E32F8904B2C441CC657C64543EAEE262044A28B4335DCB0F0C4E9401D891FA06369F984CA2D475C86C237917961C5827769831585230A66AC7787E6FB56FD3E37389267A46A);
END IF;
insert ignore into core_settings(tenant, id, value) values (-1, 'FullTextSearchSettings', 0x0878CF0599B517CAA2D3DAED9D064C3EDCEEAF431F35A6F642DCADA04817E3513227BBB1DE6E2BABEB9E1077B2CF318C489814545E877501F633FBBE94022CFCDD025B5395973AF510943408BB56962EE35DA35F2F8374CF5FD12695359449D7CEFBC2C7BD112AE58752179AA2A59E5E17801E580CCC60FAEC8EBDD3D612C4886666D96D6CF060605E64C90A1FAA80C0);
insert ignore into core_settings(tenant, id, value) values (-1, 'CompanyWhiteLabelSettings', 0xF547048A4865171587D9CEBC8A496C601D96031F2C1C3E9160353942EE765DACD316F4B5F42892436FC4A21B9A6DF8FFD3BC4036B47E3A5A1B4C881B26609869FEBB6848BD88C02EEAC6A4CCB3E8F404290812F0E6E124A552BE81A58C64BB8BD3C9A8C0EDE1F9421281DE0C7AF82733A4BCE515E85694C4DDA78E22652BA2891FCE9578F97285A81E12FEDF5D6558611E3AA3E03EADDCAA98287C64A5510757A881B00C3345E6FC1E22B607CA2D753C63F1ED94C92366DBA0E4C2E6DB16F44A8AB091007AA7505D17E41530643C1FFAE822F8F99FD2E30C0DEF82DF65C43324507F3E5C68E4C5E22BE8A40C24423485);
insert ignore into core_settings(tenant, id, value) values (-1, 'CompanyWhiteLabelSettings', 0xF547048A4865171587D9CEBC8A496C601D96031F2C1C3E9160353942EE765DACD316F4B5F42892436FC4A21B9A6DF8FFB511FD7F2A41135A1ACECB919F9FF3691847BCA535553925BAFB396012A2DA500065FA6442611833F0D7D8A969640FFD1D53B6ECCB3544FB029695943A88542597525CE31E346F289A9B077E9564A9570A81E48AB1654D43B1D8BDC901D588D86BC6FDDD6AFFC611440E6E5AAEB644DEBC4D9D131A4456610F5118ABD672BFAF383830347D52FD714729C9050876A2BF63C430C6DF4FCCAE1F61EC14D5DA5522104AC4D1EB0E47D12083C3540B424A1373FF6345EBD2CC0F0D048F7F987DD45B);
start transaction;
insert ignore into core_subscription(source, action, recipient, object, tenant) values('asc.web.studio','send_whats_new','c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e','',-1);
@ -132,17 +136,18 @@ BEGIN
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|1e04460243b54d7982f3fd6208a11960', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|6743007c6f954d208c88a8601ce5e76d', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|e67be73df9ae4ce18fec1880cb518cb4', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|ea942538e68e49079394035336ee0ba8', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|ea942538e68e49079394035336ee0ba8', 1);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|32d24cb57ece46069c9419216ba42086', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|bf88953e3c434850a3fbb1e43ad53a3e', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|2a9230378b2d487b9a225ac0918acf3f', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|f4d98afdd336433287783c6945c81ea0', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|28b10049dd204f54b986873bc14ccfc7', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|3cfd481b46f24a4ab55cb8c0c9def02c', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|6a598c7491ae437da5f4ad339bd11bb2', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|28b10049dd204f54b986873bc14ccfc7', 1);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|3cfd481b46f24a4ab55cb8c0c9def02c', 1);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|6a598c7491ae437da5f4ad339bd11bb2', 1);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|742cf945cbbc4a5782d61600a12cf8ca', 1);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|853b6eb973ee438d9b098ffeedf36234', 1);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, "c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e", "77777777-32ae-425f-99b5-83176061d1ae", "ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|46cfa73af32046cf8d5bcd82e1d67f26", 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, "c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e", "77777777-32ae-425f-99b5-83176061d1ae", 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|46cfa73af32046cf8d5bcd82e1d67f26', 0);
insert ignore into core_acl (tenant, subject, action, object, acetype) values (-1, 'c5cc67d1-c3e8-43c0-a3ad-3928ae3e5b5e', '77777777-32ae-425f-99b5-83176061d1ae', 'ASC.Web.Core.WebItemSecurity+WebItemSecurityObject|37620ae5c40b45ce855a39dd7d76a1fa', 0);
insert ignore into tenants_forbiden (address) values ('controlpanel');
insert ignore into tenants_forbiden (address) values ('localhost');
@ -153,7 +158,7 @@ BEGIN
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_ArgentinianPeso', 'ARS', '$a', 'AR', 1, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_ArmenianDram', 'AMD', 'dram', 'AM', 0, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_AustralianDollar', 'AUD', 'A$', 'AU', 1, 1);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_AzerbaijaniManat', 'AZN', 'm', 'AZ', 0, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_AzerbaijaniManat', 'AZN', '', 'AZ', 0, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_BangladeshiTaka', 'BDT', 'Tk', 'BD', 1, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_BelarusianRuble', 'BYR', 'Br', 'BY', 0, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_BrazilianReal', 'BRL', 'R$', 'BR', 1, 0);
@ -169,6 +174,7 @@ BEGIN
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_CzechKoruna', 'CZK', 'Kc', 'CZ', 1, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_DanishKrone', 'DKK', 'kr', 'DK', 1, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_DominicanPeso', 'DOP', 'RD$', 'DO', 1, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_EthiopianBirr', 'ETB', 'Br', 'ET', 0, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_Euro', 'EUR', '', 'EU', 1, 1);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_GeorgianLari', 'GEL', 'ლარი', 'GE', 0, 0);
insert ignore into crm_currency_info (resource_key, abbreviation, symbol, culture_name, is_convertable, is_basic) values ('Currency_HongKongDollar', 'HKD', 'HK$', 'HK', 1, 0);
@ -225,21 +231,45 @@ BEGIN
truncate table files_converts;
start transaction;
insert into files_converts (input, output) values ('.csv', '.ods');
insert into files_converts (input, output) values ('.csv', '.ots');
insert into files_converts (input, output) values ('.csv', '.pdf');
insert into files_converts (input, output) values ('.csv', '.xlsm');
insert into files_converts (input, output) values ('.csv', '.xlsx');
insert into files_converts (input, output) values ('.csv', '.xltm');
insert into files_converts (input, output) values ('.csv', '.xltx');
insert into files_converts (input, output) values ('.doc', '.docm');
insert into files_converts (input, output) values ('.doc', '.docx');
insert into files_converts (input, output) values ('.doc', '.dotm');
insert into files_converts (input, output) values ('.doc', '.dotx');
insert into files_converts (input, output) values ('.doc', '.epub');
insert into files_converts (input, output) values ('.doc', '.fb2');
insert into files_converts (input, output) values ('.doc', '.html');
insert into files_converts (input, output) values ('.doc', '.odt');
insert into files_converts (input, output) values ('.doc', '.ott');
insert into files_converts (input, output) values ('.doc', '.pdf');
insert into files_converts (input, output) values ('.doc', '.rtf');
insert into files_converts (input, output) values ('.doc', '.txt');
insert into files_converts (input, output) values ('.docm', '.docx');
insert into files_converts (input, output) values ('.docm', '.dotm');
insert into files_converts (input, output) values ('.docm', '.dotx');
insert into files_converts (input, output) values ('.docm', '.epub');
insert into files_converts (input, output) values ('.docm', '.fb2');
insert into files_converts (input, output) values ('.docm', '.html');
insert into files_converts (input, output) values ('.docm', '.odt');
insert into files_converts (input, output) values ('.docm', '.ott');
insert into files_converts (input, output) values ('.docm', '.pdf');
insert into files_converts (input, output) values ('.docm', '.rtf');
insert into files_converts (input, output) values ('.docm', '.txt');
insert into files_converts (input, output) values ('.doct', '.docx');
insert into files_converts (input, output) values ('.docx', '.docm');
insert into files_converts (input, output) values ('.docx', '.docxf');
insert into files_converts (input, output) values ('.docx', '.dotm');
insert into files_converts (input, output) values ('.docx', '.dotx');
insert into files_converts (input, output) values ('.docx', '.epub');
insert into files_converts (input, output) values ('.docx', '.fb2');
insert into files_converts (input, output) values ('.docx', '.html');
insert into files_converts (input, output) values ('.docx', '.odt');
insert into files_converts (input, output) values ('.docx', '.ott');
insert into files_converts (input, output) values ('.docx', '.pdf');
insert into files_converts (input, output) values ('.docx', '.rtf');
insert into files_converts (input, output) values ('.docx', '.txt');
@ -254,133 +284,299 @@ BEGIN
insert into files_converts (input, output) values ('.docxf', '.pdf');
insert into files_converts (input, output) values ('.docxf', '.rtf');
insert into files_converts (input, output) values ('.docxf', '.txt');
insert into files_converts (input, output) values ('.dot', '.docm');
insert into files_converts (input, output) values ('.dot', '.docx');
insert into files_converts (input, output) values ('.dot', '.dotm');
insert into files_converts (input, output) values ('.dot', '.dotx');
insert into files_converts (input, output) values ('.dot', '.epub');
insert into files_converts (input, output) values ('.dot', '.fb2');
insert into files_converts (input, output) values ('.dot', '.html');
insert into files_converts (input, output) values ('.dot', '.odt');
insert into files_converts (input, output) values ('.dot', '.ott');
insert into files_converts (input, output) values ('.dot', '.pdf');
insert into files_converts (input, output) values ('.dot', '.rtf');
insert into files_converts (input, output) values ('.dot', '.txt');
insert into files_converts (input, output) values ('.dotm', '.docm');
insert into files_converts (input, output) values ('.dotm', '.docx');
insert into files_converts (input, output) values ('.dotm', '.dotx');
insert into files_converts (input, output) values ('.dotm', '.epub');
insert into files_converts (input, output) values ('.dotm', '.fb2');
insert into files_converts (input, output) values ('.dotm', '.html');
insert into files_converts (input, output) values ('.dotm', '.odt');
insert into files_converts (input, output) values ('.dotm', '.ott');
insert into files_converts (input, output) values ('.dotm', '.pdf');
insert into files_converts (input, output) values ('.dotm', '.rtf');
insert into files_converts (input, output) values ('.dotm', '.txt');
insert into files_converts (input, output) values ('.dotx', '.docm');
insert into files_converts (input, output) values ('.dotx', '.docx');
insert into files_converts (input, output) values ('.dotx', '.dotm');
insert into files_converts (input, output) values ('.dotx', '.epub');
insert into files_converts (input, output) values ('.dotx', '.fb2');
insert into files_converts (input, output) values ('.dotx', '.html');
insert into files_converts (input, output) values ('.dotx', '.odt');
insert into files_converts (input, output) values ('.dotx', '.ott');
insert into files_converts (input, output) values ('.dotx', '.pdf');
insert into files_converts (input, output) values ('.dotx', '.rtf');
insert into files_converts (input, output) values ('.dotx', '.txt');
insert into files_converts (input, output) values ('.epub', '.docm');
insert into files_converts (input, output) values ('.epub', '.docx');
insert into files_converts (input, output) values ('.epub', '.dotm');
insert into files_converts (input, output) values ('.epub', '.dotx');
insert into files_converts (input, output) values ('.epub', '.fb2');
insert into files_converts (input, output) values ('.epub', '.html');
insert into files_converts (input, output) values ('.epub', '.odt');
insert into files_converts (input, output) values ('.epub', '.ott');
insert into files_converts (input, output) values ('.epub', '.pdf');
insert into files_converts (input, output) values ('.epub', '.rtf');
insert into files_converts (input, output) values ('.epub', '.txt');
insert into files_converts (input, output) values ('.fb2', '.docm');
insert into files_converts (input, output) values ('.fb2', '.docx');
insert into files_converts (input, output) values ('.fb2', '.dotm');
insert into files_converts (input, output) values ('.fb2', '.dotx');
insert into files_converts (input, output) values ('.fb2', '.epub');
insert into files_converts (input, output) values ('.fb2', '.html');
insert into files_converts (input, output) values ('.fb2', '.odt');
insert into files_converts (input, output) values ('.fb2', '.ott');
insert into files_converts (input, output) values ('.fb2', '.pdf');
insert into files_converts (input, output) values ('.fb2', '.rtf');
insert into files_converts (input, output) values ('.fb2', '.txt');
insert into files_converts (input, output) values ('.fodp', '.odp');
insert into files_converts (input, output) values ('.fodp', '.otp');
insert into files_converts (input, output) values ('.fodp', '.pdf');
insert into files_converts (input, output) values ('.fodp', '.potm');
insert into files_converts (input, output) values ('.fodp', '.potx');
insert into files_converts (input, output) values ('.fodp', '.pptm');
insert into files_converts (input, output) values ('.fodp', '.pptx');
insert into files_converts (input, output) values ('.fods', '.csv');
insert into files_converts (input, output) values ('.fods', '.ods');
insert into files_converts (input, output) values ('.fods', '.ots');
insert into files_converts (input, output) values ('.fods', '.pdf');
insert into files_converts (input, output) values ('.fods', '.xlsm');
insert into files_converts (input, output) values ('.fods', '.xlsx');
insert into files_converts (input, output) values ('.fods', '.xltm');
insert into files_converts (input, output) values ('.fods', '.xltx');
insert into files_converts (input, output) values ('.fodt', '.docm');
insert into files_converts (input, output) values ('.fodt', '.docx');
insert into files_converts (input, output) values ('.fodt', '.dotm');
insert into files_converts (input, output) values ('.fodt', '.dotx');
insert into files_converts (input, output) values ('.fodt', '.epub');
insert into files_converts (input, output) values ('.fodt', '.fb2');
insert into files_converts (input, output) values ('.fodt', '.html');
insert into files_converts (input, output) values ('.fodt', '.odt');
insert into files_converts (input, output) values ('.fodt', '.ott');
insert into files_converts (input, output) values ('.fodt', '.pdf');
insert into files_converts (input, output) values ('.fodt', '.rtf');
insert into files_converts (input, output) values ('.fodt', '.txt');
insert into files_converts (input, output) values ('.html', '.docm');
insert into files_converts (input, output) values ('.html', '.docx');
insert into files_converts (input, output) values ('.html', '.dotm');
insert into files_converts (input, output) values ('.html', '.dotx');
insert into files_converts (input, output) values ('.html', '.epub');
insert into files_converts (input, output) values ('.html', '.fb2');
insert into files_converts (input, output) values ('.html', '.odt');
insert into files_converts (input, output) values ('.html', '.ott');
insert into files_converts (input, output) values ('.html', '.pdf');
insert into files_converts (input, output) values ('.html', '.rtf');
insert into files_converts (input, output) values ('.html', '.txt');
insert into files_converts (input, output) values ('.mht', '.docm');
insert into files_converts (input, output) values ('.mht', '.docx');
insert into files_converts (input, output) values ('.mht', '.dotm');
insert into files_converts (input, output) values ('.mht', '.dotx');
insert into files_converts (input, output) values ('.mht', '.epub');
insert into files_converts (input, output) values ('.mht', '.fb2');
insert into files_converts (input, output) values ('.mht', '.odt');
insert into files_converts (input, output) values ('.mht', '.ott');
insert into files_converts (input, output) values ('.mht', '.pdf');
insert into files_converts (input, output) values ('.mht', '.rtf');
insert into files_converts (input, output) values ('.mht', '.txt');
insert into files_converts (input, output) values ('.odp', '.otp');
insert into files_converts (input, output) values ('.odp', '.pdf');
insert into files_converts (input, output) values ('.odp', '.potm');
insert into files_converts (input, output) values ('.odp', '.potx');
insert into files_converts (input, output) values ('.odp', '.pptm');
insert into files_converts (input, output) values ('.odp', '.pptx');
insert into files_converts (input, output) values ('.otp', '.odp');
insert into files_converts (input, output) values ('.otp', '.pdf');
insert into files_converts (input, output) values ('.otp', '.potm');
insert into files_converts (input, output) values ('.otp', '.potx');
insert into files_converts (input, output) values ('.otp', '.pptm');
insert into files_converts (input, output) values ('.otp', '.pptx');
insert into files_converts (input, output) values ('.ods', '.csv');
insert into files_converts (input, output) values ('.ods', '.ots');
insert into files_converts (input, output) values ('.ods', '.pdf');
insert into files_converts (input, output) values ('.ods', '.xlsm');
insert into files_converts (input, output) values ('.ods', '.xlsx');
insert into files_converts (input, output) values ('.ods', '.xltm');
insert into files_converts (input, output) values ('.ods', '.xltx');
insert into files_converts (input, output) values ('.ots', '.csv');
insert into files_converts (input, output) values ('.ots', '.ods');
insert into files_converts (input, output) values ('.ots', '.pdf');
insert into files_converts (input, output) values ('.ots', '.xlsm');
insert into files_converts (input, output) values ('.ots', '.xlsx');
insert into files_converts (input, output) values ('.ots', '.xltm');
insert into files_converts (input, output) values ('.ots', '.xltx');
insert into files_converts (input, output) values ('.odt', '.docm');
insert into files_converts (input, output) values ('.odt', '.docx');
insert into files_converts (input, output) values ('.odt', '.dotm');
insert into files_converts (input, output) values ('.odt', '.dotx');
insert into files_converts (input, output) values ('.odt', '.epub');
insert into files_converts (input, output) values ('.odt', '.fb2');
insert into files_converts (input, output) values ('.odt', '.html');
insert into files_converts (input, output) values ('.odt', '.ott');
insert into files_converts (input, output) values ('.odt', '.pdf');
insert into files_converts (input, output) values ('.odt', '.rtf');
insert into files_converts (input, output) values ('.odt', '.txt');
insert into files_converts (input, output) values ('.ott', '.docm');
insert into files_converts (input, output) values ('.ott', '.docx');
insert into files_converts (input, output) values ('.ott', '.dotm');
insert into files_converts (input, output) values ('.ott', '.dotx');
insert into files_converts (input, output) values ('.ott', '.epub');
insert into files_converts (input, output) values ('.ott', '.fb2');
insert into files_converts (input, output) values ('.ott', '.html');
insert into files_converts (input, output) values ('.ott', '.odt');
insert into files_converts (input, output) values ('.ott', '.pdf');
insert into files_converts (input, output) values ('.ott', '.rtf');
insert into files_converts (input, output) values ('.ott', '.txt');
insert into files_converts (input, output) values ('.oxps', '.pdf');
insert into files_converts (input, output) values ('.pot', '.odp');
insert into files_converts (input, output) values ('.pot', '.otp');
insert into files_converts (input, output) values ('.pot', '.pdf');
insert into files_converts (input, output) values ('.pot', '.pptm');
insert into files_converts (input, output) values ('.pot', '.pptx');
insert into files_converts (input, output) values ('.pot', '.potm');
insert into files_converts (input, output) values ('.pot', '.potx');
insert into files_converts (input, output) values ('.potm', '.odp');
insert into files_converts (input, output) values ('.potm', '.otp');
insert into files_converts (input, output) values ('.potm', '.pdf');
insert into files_converts (input, output) values ('.potm', '.potx');
insert into files_converts (input, output) values ('.potm', '.pptm');
insert into files_converts (input, output) values ('.potm', '.pptx');
insert into files_converts (input, output) values ('.potx', '.odp');
insert into files_converts (input, output) values ('.potx', '.otp');
insert into files_converts (input, output) values ('.potx', '.pdf');
insert into files_converts (input, output) values ('.potx', '.potm');
insert into files_converts (input, output) values ('.potx', '.pptm');
insert into files_converts (input, output) values ('.potx', '.pptx');
insert into files_converts (input, output) values ('.pps', '.odp');
insert into files_converts (input, output) values ('.pps', '.otp');
insert into files_converts (input, output) values ('.pps', '.pdf');
insert into files_converts (input, output) values ('.pps', '.potm');
insert into files_converts (input, output) values ('.pps', '.potx');
insert into files_converts (input, output) values ('.pps', '.pptm');
insert into files_converts (input, output) values ('.pps', '.pptx');
insert into files_converts (input, output) values ('.ppsm', '.odp');
insert into files_converts (input, output) values ('.ppsm', '.otp');
insert into files_converts (input, output) values ('.ppsm', '.pdf');
insert into files_converts (input, output) values ('.ppsm', '.potm');
insert into files_converts (input, output) values ('.ppsm', '.potx');
insert into files_converts (input, output) values ('.ppsm', '.pptm');
insert into files_converts (input, output) values ('.ppsm', '.pptx');
insert into files_converts (input, output) values ('.ppsx', '.odp');
insert into files_converts (input, output) values ('.ppsx', '.otp');
insert into files_converts (input, output) values ('.ppsx', '.pdf');
insert into files_converts (input, output) values ('.ppsx', '.potm');
insert into files_converts (input, output) values ('.ppsx', '.potx');
insert into files_converts (input, output) values ('.ppsx', '.pptm');
insert into files_converts (input, output) values ('.ppsx', '.pptx');
insert into files_converts (input, output) values ('.ppt', '.odp');
insert into files_converts (input, output) values ('.ppt', '.otp');
insert into files_converts (input, output) values ('.ppt', '.pdf');
insert into files_converts (input, output) values ('.ppt', '.potm');
insert into files_converts (input, output) values ('.ppt', '.potx');
insert into files_converts (input, output) values ('.ppt', '.pptm');
insert into files_converts (input, output) values ('.ppt', '.pptx');
insert into files_converts (input, output) values ('.pptm', '.odp');
insert into files_converts (input, output) values ('.pptm', '.otp');
insert into files_converts (input, output) values ('.pptm', '.pdf');
insert into files_converts (input, output) values ('.pptm', '.potm');
insert into files_converts (input, output) values ('.pptm', '.potx');
insert into files_converts (input, output) values ('.pptm', '.pptx');
insert into files_converts (input, output) values ('.pptt', '.pptx');
insert into files_converts (input, output) values ('.pptx', '.odp');
insert into files_converts (input, output) values ('.pptx', '.otp');
insert into files_converts (input, output) values ('.pptx', '.pdf');
insert into files_converts (input, output) values ('.pptx', '.potm');
insert into files_converts (input, output) values ('.pptx', '.potx');
insert into files_converts (input, output) values ('.pptx', '.pptm');
insert into files_converts (input, output) values ('.rtf', '.docm');
insert into files_converts (input, output) values ('.rtf', '.docx');
insert into files_converts (input, output) values ('.rtf', '.dotm');
insert into files_converts (input, output) values ('.rtf', '.dotx');
insert into files_converts (input, output) values ('.rtf', '.epub');
insert into files_converts (input, output) values ('.rtf', '.fb2');
insert into files_converts (input, output) values ('.rtf', '.html');
insert into files_converts (input, output) values ('.rtf', '.odt');
insert into files_converts (input, output) values ('.rtf', '.ott');
insert into files_converts (input, output) values ('.rtf', '.pdf');
insert into files_converts (input, output) values ('.rtf', '.txt');
insert into files_converts (input, output) values ('.txt', '.docm');
insert into files_converts (input, output) values ('.txt', '.docx');
insert into files_converts (input, output) values ('.txt', '.dotm');
insert into files_converts (input, output) values ('.txt', '.dotx');
insert into files_converts (input, output) values ('.txt', '.epub');
insert into files_converts (input, output) values ('.txt', '.fb2');
insert into files_converts (input, output) values ('.txt', '.html');
insert into files_converts (input, output) values ('.txt', '.odt');
insert into files_converts (input, output) values ('.txt', '.ott');
insert into files_converts (input, output) values ('.txt', '.pdf');
insert into files_converts (input, output) values ('.txt', '.rtf');
insert into files_converts (input, output) values ('.xls', '.csv');
insert into files_converts (input, output) values ('.xls', '.ods');
insert into files_converts (input, output) values ('.xls', '.ots');
insert into files_converts (input, output) values ('.xls', '.pdf');
insert into files_converts (input, output) values ('.xls', '.xlsm');
insert into files_converts (input, output) values ('.xls', '.xlsx');
insert into files_converts (input, output) values ('.xls', '.xltm');
insert into files_converts (input, output) values ('.xls', '.xltx');
insert into files_converts (input, output) values ('.xlsm', '.csv');
insert into files_converts (input, output) values ('.xlsm', '.ods');
insert into files_converts (input, output) values ('.xlsm', '.ots');
insert into files_converts (input, output) values ('.xlsm', '.pdf');
insert into files_converts (input, output) values ('.xlsm', '.xlsx');
insert into files_converts (input, output) values ('.xlsm', '.xltm');
insert into files_converts (input, output) values ('.xlsm', '.xltx');
insert into files_converts (input, output) values ('.xlst', '.xlsx');
insert into files_converts (input, output) values ('.xlsx', '.csv');
insert into files_converts (input, output) values ('.xlsx', '.ods');
insert into files_converts (input, output) values ('.xlsx', '.ots');
insert into files_converts (input, output) values ('.xlsx', '.pdf');
insert into files_converts (input, output) values ('.xlsx', '.xlsm');
insert into files_converts (input, output) values ('.xlsx', '.xltm');
insert into files_converts (input, output) values ('.xlsx', '.xltx');
insert into files_converts (input, output) values ('.xlt', '.csv');
insert into files_converts (input, output) values ('.xlt', '.ods');
insert into files_converts (input, output) values ('.xlt', '.ots');
insert into files_converts (input, output) values ('.xlt', '.pdf');
insert into files_converts (input, output) values ('.xlt', '.xlsm');
insert into files_converts (input, output) values ('.xlt', '.xlsx');
insert into files_converts (input, output) values ('.xlt', '.xltm');
insert into files_converts (input, output) values ('.xlt', '.xltx');
insert into files_converts (input, output) values ('.xltm', '.csv');
insert into files_converts (input, output) values ('.xltm', '.ods');
insert into files_converts (input, output) values ('.xltm', '.ots');
insert into files_converts (input, output) values ('.xltm', '.pdf');
insert into files_converts (input, output) values ('.xltm', '.xlsm');
insert into files_converts (input, output) values ('.xltm', '.xlsx');
insert into files_converts (input, output) values ('.xltm', '.xltx');
insert into files_converts (input, output) values ('.xltx', '.csv');
insert into files_converts (input, output) values ('.xltx', '.ods');
insert into files_converts (input, output) values ('.xltx', '.ots');
insert into files_converts (input, output) values ('.xltx', '.pdf');
insert into files_converts (input, output) values ('.xltx', '.xlsm');
insert into files_converts (input, output) values ('.xltx', '.xlsx');
insert into files_converts (input, output) values ('.xltx', '.xltm');
insert into files_converts (input, output) values ('.xml', '.docm');
insert into files_converts (input, output) values ('.xml', '.docx');
insert into files_converts (input, output) values ('.xml', '.dotm');
insert into files_converts (input, output) values ('.xml', '.dotx');
insert into files_converts (input, output) values ('.xml', '.epub');
insert into files_converts (input, output) values ('.xml', '.fb2');
insert into files_converts (input, output) values ('.xml', '.html');
insert into files_converts (input, output) values ('.xml', '.odt');
insert into files_converts (input, output) values ('.xml', '.ott');
insert into files_converts (input, output) values ('.xml', '.pdf');
insert into files_converts (input, output) values ('.xml', '.rtf');
insert into files_converts (input, output) values ('.xml', '.txt');
insert into files_converts (input, output) values ('.xps', '.pdf');
commit;

View File

@ -227,6 +227,7 @@ CREATE TABLE IF NOT EXISTS `calendar_events` (
`uid` varchar(255) DEFAULT NULL,
`status` smallint(6) NOT NULL DEFAULT '0',
`time_zone` varchar(255) NULL DEFAULT NULL,
`has_attachments` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `calendar_id` (`tenant`,`calendar_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -367,6 +368,13 @@ CREATE TABLE IF NOT EXISTS `core_user` (
KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `core_userdav` (
`tenant_id` int(11) NOT NULL,
`user_id` varchar(255) NOT NULL,
PRIMARY KEY (`user_id`),
KEY `tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `core_usergroup` (
`tenant` int(11) NOT NULL,
`userid` varchar(38) NOT NULL,
@ -390,7 +398,6 @@ CREATE TABLE IF NOT EXISTS `core_usersecurity` (
`tenant` int(11) NOT NULL,
`userid` varchar(38) NOT NULL,
`pwdhash` varchar(512) DEFAULT NULL,
`pwdhashsha512` varchar(512) DEFAULT NULL,
`LastModified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`userid`),
KEY `pwdhash` (`pwdhash`(255)),
@ -1016,6 +1023,13 @@ CREATE TABLE IF NOT EXISTS `files_link` (
KEY `linked_for` (`tenant_id`, `source_id`, `linked_id`, `linked_for`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `files_properties` (
`tenant_id` int(10) NOT NULL,
`entry_id` varchar(32) NOT NULL,
`data` MEDIUMTEXT NOT NULL,
PRIMARY KEY (`tenant_id`, `entry_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `files_security` (
`tenant_id` int(10) NOT NULL,
`entry_id` varchar(50) NOT NULL,
@ -1064,7 +1078,8 @@ CREATE TABLE IF NOT EXISTS `files_thirdparty_account` (
`create_on` datetime NOT NULL,
`url` text,
`tenant_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
INDEX `tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `files_thirdparty_app` (
@ -1362,6 +1377,7 @@ CREATE TABLE IF NOT EXISTS `login_events` (
`page` varchar(300) DEFAULT NULL,
`action` int(11) DEFAULT NULL,
`description` varchar(500) DEFAULT NULL,
`active` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `date` (`date`),
KEY `tenant_id` (`tenant_id`,`user_id`)
@ -1547,6 +1563,7 @@ CREATE TABLE IF NOT EXISTS `mail_mail` (
`mime_in_reply_to` varchar(255) DEFAULT NULL,
`chain_id` varchar(255) DEFAULT NULL,
`chain_date` datetime NOT NULL DEFAULT '1975-01-01 00:00:00',
`read_request_status` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `chain_index_folders` (`chain_id`,`id_mailbox`,`folder`),
KEY `uidl` (`uidl`,`id_mailbox`),
@ -1555,7 +1572,7 @@ CREATE TABLE IF NOT EXISTS `mail_mail` (
KEY `list_conversations` (`tenant`, `id_user`, `folder`, `chain_date`),
KEY `list_messages` (`tenant`, `id_user`, `folder`, `date_sent`),
KEY `time_modified` (`time_modified`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
CREATE TABLE IF NOT EXISTS `mail_mailbox` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
@ -2269,7 +2286,6 @@ CREATE TABLE IF NOT EXISTS `tenants_quota` (
`active_users` int(10) NOT NULL DEFAULT '0',
`features` text,
`price` decimal(10,2) NOT NULL DEFAULT '0.00',
`price2` decimal(10,2) NOT NULL DEFAULT '0.00',
`avangate_id` varchar(128) DEFAULT NULL,
`visible` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`tenant`)
@ -2323,7 +2339,8 @@ CREATE TABLE IF NOT EXISTS `tenants_tenants` (
UNIQUE KEY `alias` (`alias`),
KEY `last_modified` (`last_modified`),
KEY `mappeddomain` (`mappeddomain`),
KEY `version` (`version`)
KEY `version` (`version`),
KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tenants_version` (

View File

@ -34,7 +34,6 @@ BEGIN
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,

View File

@ -29,7 +29,6 @@ BEGIN
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

View File

@ -0,0 +1,275 @@
DELIMITER DLM00
DROP PROCEDURE IF EXISTS upgrade120 DLM00
CREATE PROCEDURE upgrade120()
BEGIN
IF EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tenants_quota' AND COLUMN_NAME = 'price2') THEN
ALTER TABLE `tenants_quota` DROP COLUMN `price2`;
END IF;
IF EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'core_usersecurity' AND COLUMN_NAME = 'pwdhashsha512') THEN
ALTER TABLE `core_usersecurity` DROP COLUMN `pwdhashsha512`;
END IF;
CREATE TABLE IF NOT EXISTS `core_userdav` (
`tenant_id` int(11) NOT NULL,
`user_id` varchar(255) NOT NULL,
PRIMARY KEY (`user_id`),
KEY `tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
IF NOT EXISTS(SELECT * FROM information_schema.`STATISTICS` WHERE `TABLE_SCHEMA` = DATABASE() AND `TABLE_NAME` = 'tenants_tenants' AND `INDEX_NAME` = 'status') THEN
ALTER TABLE `tenants_tenants` ADD INDEX `status` (`status`);
END IF;
IF NOT EXISTS(SELECT * FROM information_schema.`STATISTICS` WHERE `TABLE_SCHEMA` = DATABASE() AND `TABLE_NAME` = 'files_thirdparty_account' AND `INDEX_NAME` = 'tenant_id') THEN
ALTER TABLE `files_thirdparty_account` ADD INDEX `tenant_id` (`tenant_id`);
END IF;
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.docx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.odt');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.pdf');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.rtf');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.txt');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.doc', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docm', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docx', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docxf', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dot', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotm', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotx', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodt', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.html', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.mht', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odt', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ott', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.rtf', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.txt', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.epub');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.doc', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docm', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docx', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docxf', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dot', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotm', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotx', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.epub', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodt', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.html', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.mht', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odt', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ott', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.rtf', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.txt', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.fb2');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.doc', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docm', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docx', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docxf', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dot', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotm', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotx', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.epub', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodt', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odt', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ott', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.rtf', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.txt', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.html');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.doc', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docm', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docx', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docxf', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dot', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotm', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.epub', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodt', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.html', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.mht', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odt', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ott', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.rtf', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.txt', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.dotx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.doc', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docm', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docx', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docxf', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dot', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotm', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotx', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.epub', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodt', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.html', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.mht', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odt', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.rtf', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.txt', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.ott');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodp', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odp', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.otp', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pot', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.potm', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pps', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppsm', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppsx', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppt', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pptm', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pptx', '.potx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodp', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odp', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pot', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.potm', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.potx', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pps', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppsm', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppsx', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppt', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pptm', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pptx', '.otp');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.csv', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fods', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ods', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ots', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xls', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlsm', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlsx', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlt', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xltm', '.xltx');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.csv', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fods', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ods', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xls', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlsm', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlsx', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlt', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xltm', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xltx', '.ots');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.oxps', '.pdf');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.doc', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docx', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dot', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotm', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotx', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.epub', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodt', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.html', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.mht', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odt', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ott', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.rtf', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.txt', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.docm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.doc', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docm', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.docx', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dot', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.dotx', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.epub', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fb2', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodt', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.html', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.mht', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odt', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ott', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.rtf', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.txt', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xml', '.dotm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.csv', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fods', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ods', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ots', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xls', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlsx', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlt', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xltm', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xltx', '.xlsm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.csv', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fods', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ods', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ots', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xls', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlsm', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlsx', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xlt', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.xltx', '.xltm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodp', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odp', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.otp', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pot', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.potm', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.potx', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pps', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppsm', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppsx', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppt', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pptx', '.pptm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.fodp', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.odp', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.otp', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pot', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.potx', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pps', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppsm', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppsx', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.ppt', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pptm', '.potm');
INSERT IGNORE INTO `files_converts` (`input`, `output`) VALUES ('.pptx', '.potm');
CREATE TABLE IF NOT EXISTS `files_properties` (
`tenant_id` int(10) NOT NULL,
`entry_id` varchar(32) NOT NULL,
`data` MEDIUMTEXT NOT NULL,
PRIMARY KEY (`tenant_id`, `entry_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO `crm_currency_info` (`resource_key`, `abbreviation`, `symbol`, `culture_name`, `is_convertable`, `is_basic`) values ('Currency_EthiopianBirr', 'ETB', 'Br', 'ET', 0, 0);
UPDATE `crm_currency_info` SET `symbol`='' WHERE `abbreviation`='AZN';
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'login_events' AND COLUMN_NAME = 'active') THEN
ALTER TABLE `login_events` ADD COLUMN `active` INT(10) NOT NULL DEFAULT '0' AFTER `description`;
END IF;
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'calendar_events' AND COLUMN_NAME = 'has_attachments') THEN
ALTER TABLE `calendar_events` ADD COLUMN `has_attachments` TINYINT(1) NOT NULL DEFAULT '0' AFTER `time_zone`;
END IF;
ALTER TABLE `mail_mail` ROW_FORMAT=DYNAMIC;
IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'mail_mail' AND COLUMN_NAME = 'read_request_status') THEN
ALTER TABLE `mail_mail` ADD COLUMN `read_request_status` TINYINT(1) NOT NULL DEFAULT '0' AFTER `chain_date`;
END IF;
UPDATE `core_settings`
SET `value`=0xF547048A4865171587D9CEBC8A496C601D96031F2C1C3E9160353942EE765DACD316F4B5F42892436FC4A21B9A6DF8FFB511FD7F2A41135A1ACECB919F9FF3691847BCA535553925BAFB396012A2DA500065FA6442611833F0D7D8A969640FFD1D53B6ECCB3544FB029695943A88542597525CE31E346F289A9B077E9564A9570A81E48AB1654D43B1D8BDC901D588D86BC6FDDD6AFFC611440E6E5AAEB644DEBC4D9D131A4456610F5118ABD672BFAF383830347D52FD714729C9050876A2BF63C430C6DF4FCCAE1F61EC14D5DA5522104AC4D1EB0E47D12083C3540B424A1373FF6345EBD2CC0F0D048F7F987DD45B
WHERE `tenant`=-1 AND `id`='CompanyWhiteLabelSettings';
END DLM00
CALL upgrade120() DLM00
DELIMITER ;

View File

@ -29,11 +29,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Security">
<HintPath>..\..\packages\Mono.Security.3.2.3.0\lib\net45\Mono.Security.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Base\Data\LdapObjectExtension.cs" />
<Compile Include="Base\Data\LdapLogin.cs" />
@ -91,13 +86,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac">
<Version>5.1.2</Version>
<Version>6.2.0</Version>
</PackageReference>
<PackageReference Include="Mono.Security">
<Version>3.2.3</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="Novell.Directory.LDAP">
<Version>2.3.8.1</Version>

View File

@ -109,7 +109,7 @@ namespace ASC.ActiveDirectory.ComplexOperations
CoreContext.TenantManager.SetCurrentTenant(CurrentTenant);
SecurityContext.AuthenticateMe(Core.Configuration.Constants.CoreSystem);
SecurityContext.CurrentAccount = Core.Configuration.Constants.CoreSystem;
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(_culture);
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(_culture);

View File

@ -178,7 +178,7 @@ namespace ASC.ActiveDirectory.ComplexOperations
Logger.DebugFormat("CoreContext.UserManager.SaveUserInfo({0})", existingLDAPUser.GetUserInfoString());
CoreContext.UserManager.SaveUserInfo(existingLDAPUser);
CoreContext.UserManager.SaveUserInfo(existingLDAPUser, syncCardDav: true);
break;
case LdapOperationType.SaveTest:
case LdapOperationType.SyncTest:
@ -852,7 +852,7 @@ namespace ASC.ActiveDirectory.ComplexOperations
Logger.DebugFormat("CoreContext.UserManager.SaveUserInfo({0})", removedUser.GetUserInfoString());
CoreContext.UserManager.SaveUserInfo(removedUser);
CoreContext.UserManager.SaveUserInfo(removedUser, syncCardDav: true);
break;
case LdapOperationType.SaveTest:
case LdapOperationType.SyncTest:

View File

@ -126,7 +126,7 @@ namespace ASC.ActiveDirectory
_log.DebugFormat("CoreContext.UserManager.SaveUserInfo({0})", ldapUserInfo.GetUserInfoString());
portalUserInfo = CoreContext.UserManager.SaveUserInfo(ldapUserInfo);
portalUserInfo = CoreContext.UserManager.SaveUserInfo(ldapUserInfo, syncCardDav: true);
var passwordHash = LdapUtils.GeneratePassword();
@ -175,7 +175,7 @@ namespace ASC.ActiveDirectory
_log.DebugFormat("CoreContext.UserManager.SaveUserInfo({0})", otherUser.GetUserInfoString());
CoreContext.UserManager.SaveUserInfo(otherUser);
CoreContext.UserManager.SaveUserInfo(otherUser, syncCardDav: true);
return true;
}
@ -525,7 +525,7 @@ namespace ASC.ActiveDirectory
{
_log.DebugFormat("CoreContext.UserManager.SaveUserInfo({0})", userToUpdate.GetUserInfoString());
portlaUserInfo = CoreContext.UserManager.SaveUserInfo(userToUpdate);
portlaUserInfo = CoreContext.UserManager.SaveUserInfo(userToUpdate, syncCardDav: true);
}
return true;
@ -600,7 +600,7 @@ namespace ASC.ActiveDirectory
try
{
CoreContext.TenantManager.SetCurrentTenant(tenant);
SecurityContext.AuthenticateMe(Core.Configuration.Constants.CoreSystem);
SecurityContext.CurrentAccount = Core.Configuration.Constants.CoreSystem;
var uInfo = SyncLDAPUser(ldapUserInfo.Item1);
@ -613,7 +613,7 @@ namespace ASC.ActiveDirectory
_log.DebugFormat("TryGetAndSyncLdapUserInfo(login: \"{0}\") disabling user {1} due to not being included in any ldap group", login, uInfo);
uInfo.Status = EmployeeStatus.Terminated;
uInfo.Sid = null;
CoreContext.UserManager.SaveUserInfo(uInfo);
CoreContext.UserManager.SaveUserInfo(uInfo, syncCardDav: true);
CookiesManager.ResetUserCookie(uInfo.ID);
}
}
@ -655,7 +655,7 @@ namespace ASC.ActiveDirectory
{
try
{
SecurityContext.AuthenticateMe(Core.Configuration.Constants.CoreSystem);
SecurityContext.CurrentAccount = Core.Configuration.Constants.CoreSystem;
userInfo = SyncLDAPUser(ldapUserInfo.Item1);
@ -675,7 +675,7 @@ namespace ASC.ActiveDirectory
{
userInfo.Sid = null;
userInfo.Status = EmployeeStatus.Terminated;
CoreContext.UserManager.SaveUserInfo(userInfo);
CoreContext.UserManager.SaveUserInfo(userInfo, syncCardDav: true);
throw new Exception("The user did not pass the configuration check by ldap group settings");
}

View File

@ -104,7 +104,6 @@
<Compile Include="DependencyInjection\TypeManipulation.cs" />
<Compile Include="Geolocation\IPGeolocationInfo.cs" />
<Compile Include="Geolocation\GeolocationHelper.cs" />
<Compile Include="Logging\SelfCleaningTarget.cs" />
<Compile Include="Logging\Log.cs" />
<Compile Include="Logging\SelfCleaningAppender.cs" />
<Compile Include="Logging\SpecialFolderPathConverter.cs" />
@ -166,6 +165,16 @@
<Compile Include="Notify\Sinks\DispatchSink.cs" />
<Compile Include="Notify\Sinks\ISink.cs" />
<Compile Include="Notify\Sinks\Sink.cs" />
<Compile Include="Radicale\CalDavCalendar.cs" />
<Compile Include="Radicale\CardDavAddressbook.cs" />
<Compile Include="Radicale\CardDavItem.cs" />
<Compile Include="Radicale\Core\DbRadicale.cs" />
<Compile Include="Radicale\Core\RadicaleClient.cs" />
<Compile Include="Radicale\Core\RadicaleException.cs" />
<Compile Include="Radicale\DavRequest.cs" />
<Compile Include="Radicale\DavResponse.cs" />
<Compile Include="Radicale\IRadicaleEntity.cs" />
<Compile Include="Radicale\RadicaleEntity.cs" />
<Compile Include="Security\AscRandom.cs" />
<Compile Include="Security\Authentication\SystemAccount.cs" />
<Compile Include="Security\Authorizing\AzObjectIdHelper.cs" />
@ -213,6 +222,7 @@
<Compile Include="Utils\RandomString.cs" />
<Compile Include="Utils\TimeZoneConverter\TimeZoneConverter.cs" />
<Compile Include="Utils\Signature.cs" />
<Compile Include="Utils\StringUtils.cs" />
<Compile Include="Utils\VelocityFormatter.cs" />
<Compile Include="Utils\HtmlUtil.cs" />
<Compile Include="Utils\Wildcard.cs" />
@ -241,34 +251,40 @@
<Version>2.2.9</Version>
</PackageReference>
<PackageReference Include="Autofac">
<Version>5.1.2</Version>
<Version>6.2.0</Version>
</PackageReference>
<PackageReference Include="HtmlAgilityPack">
<Version>1.6.0.1</Version>
</PackageReference>
<PackageReference Include="log4net">
<Version>2.0.8</Version>
<Version>2.0.9</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation">
<Version>3.1.4</Version>
</PackageReference>
<PackageReference Include="MySql.Data">
<Version>8.0.25</Version>
<Version>8.0.29</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="NLog">
<Version>4.7.0</Version>
<Version>4.7.11</Version>
</PackageReference>
<PackageReference Include="NVelocity">
<Version>1.2.0</Version>
</PackageReference>
<PackageReference Include="StackExchange.Redis">
<Version>2.0.519</Version>
<Version>2.2.88</Version>
</PackageReference>
<PackageReference Include="StackExchange.Redis.Extensions.Core">
<Version>7.2.1</Version>
</PackageReference>
<PackageReference Include="StackExchange.Redis.Extensions.LegacyConfiguration">
<Version>4.0.5</Version>
<Version>5.4.0</Version>
</PackageReference>
<PackageReference Include="StackExchange.Redis.Extensions.Newtonsoft">
<Version>7.2.1</Version>
</PackageReference>
<PackageReference Include="System.Buffers">
<Version>4.5.1</Version>
@ -276,15 +292,14 @@
<PackageReference Include="System.Memory">
<Version>4.5.4</Version>
</PackageReference>
<PackageReference Include="Ubiety.Dns.Core">
<Version>2.4.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Caching" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -171,7 +171,7 @@ namespace ASC.Common.Caching
if (onchange != null)
{
onchange.ToArray().ForEach(r => r(obj, action));
onchange.ToList().ForEach(r => r(obj, action));
}
}

View File

@ -16,86 +16,94 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using ASC.Common.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using StackExchange.Redis;
using StackExchange.Redis.Extensions.Core;
using StackExchange.Redis.Extensions.Core.Extensions;
using StackExchange.Redis.Extensions.Core.Abstractions;
using StackExchange.Redis.Extensions.Core.Implementations;
using StackExchange.Redis.Extensions.LegacyConfiguration;
using StackExchange.Redis.Extensions.Newtonsoft;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Common.Caching
{
public class RedisCache : ICache, ICacheNotify
{
private readonly string CacheId = Guid.NewGuid().ToString();
private readonly StackExchangeRedisCacheClient redis;
private readonly ConcurrentDictionary<Type, ConcurrentBag<Action<object, CacheNotifyAction>>> actions = new ConcurrentDictionary<Type, ConcurrentBag<Action<object, CacheNotifyAction>>>();
private readonly IRedisDatabase _redis;
public RedisCache()
{
var configuration = ConfigurationManagerExtension.GetSection("redisCacheClient") as RedisCachingSectionHandler;
if (configuration == null)
throw new ConfigurationErrorsException("Unable to locate <redisCacheClient> section into your configuration file. Take a look https://github.com/imperugo/StackExchange.Redis.Extensions");
var stringBuilder = new StringBuilder();
using (var stream = new StringWriter(stringBuilder))
{
var opts = RedisCachingSectionHandler.GetConfig().ConfigurationOptions;
opts.SyncTimeout = 60000;
var connectionMultiplexer = (IConnectionMultiplexer)ConnectionMultiplexer.Connect(opts, stream);
redis = new StackExchangeRedisCacheClient(connectionMultiplexer, new Serializer());
LogManager.GetLogger("ASC").Debug(stringBuilder.ToString());
}
}
var redisConfiguration = RedisCachingSectionHandler.GetConfig();
var connectionPoolManager = new RedisCacheConnectionPoolManager(redisConfiguration);
_redis = new RedisCacheClient(connectionPoolManager, new NewtonsoftSerializer(), redisConfiguration).GetDbFromConfiguration();
}
public T Get<T>(string key) where T : class
{
return redis.Get<T>(key);
return Task.Run(() => _redis.GetAsync<T>(key))
.GetAwaiter()
.GetResult();
}
public void Insert(string key, object value, TimeSpan sligingExpiration)
{
redis.Replace(key, value, sligingExpiration);
Task.Run(() => _redis.ReplaceAsync(key, value, sligingExpiration))
.GetAwaiter()
.GetResult();
}
public void Insert(string key, object value, DateTime absolutExpiration)
{
redis.Replace(key, value, absolutExpiration == DateTime.MaxValue ? DateTimeOffset.MaxValue : new DateTimeOffset(absolutExpiration));
Task.Run(() => _redis.ReplaceAsync(key, value, absolutExpiration == DateTime.MaxValue ? DateTimeOffset.MaxValue : new DateTimeOffset(absolutExpiration)))
.GetAwaiter()
.GetResult();
}
public void Remove(string key)
{
redis.Remove(key);
Task.Run(() => _redis.RemoveAsync(key))
.GetAwaiter()
.GetResult();
}
public void Remove(Regex pattern)
{
var glob = pattern.ToString().Replace(".*", "*").Replace(".", "?");
var keys = redis.SearchKeys(glob);
var keys = Task.Run(() => _redis.SearchKeysAsync(glob))
.GetAwaiter()
.GetResult();
if (keys.Any())
{
redis.RemoveAll(keys);
Task.Run(() => _redis.RemoveAllAsync(keys))
.GetAwaiter()
.GetResult();
}
}
public IDictionary<string, T> HashGetAll<T>(string key)
{
var dic = redis.Database.HashGetAll(key);
var dic = _redis.Database.HashGetAll(key);
return dic
.Select(e =>
{
@ -122,7 +130,8 @@ namespace ASC.Common.Caching
public T HashGet<T>(string key, string field)
{
var value = (string)redis.Database.HashGet(key, field);
var value = (string)(_redis.Database.HashGet(key, field));
try
{
return value != null ? JsonConvert.DeserializeObject<T>(value) : default(T);
@ -130,6 +139,7 @@ namespace ASC.Common.Caching
catch (Exception ex)
{
LogManager.GetLogger("ASC").Error(string.Format("RedisCache HashGet key: {0}, field: {1}", key, field), ex);
return default(T);
}
}
@ -138,149 +148,54 @@ namespace ASC.Common.Caching
{
if (value != null)
{
redis.Database.HashSet(key, field, JsonConvert.SerializeObject(value));
_redis.Database.HashSet(key, field, JsonConvert.SerializeObject(value));
}
else
{
redis.Database.HashDelete(key, field);
_redis.Database.HashDelete(key, field);
}
}
public void Publish<T>(T obj, CacheNotifyAction action)
public void Publish<T>(T obj, CacheNotifyAction cacheNotifyAction)
{
redis.Publish("asc:channel:" + typeof(T).FullName, new RedisCachePubSubItem<T>() { CacheId = CacheId, Object = obj, Action = action });
var channelName = $"asc:channel:{cacheNotifyAction}:{typeof(T).FullName}".ToLowerInvariant();
ConcurrentBag<Action<object, CacheNotifyAction>> onchange;
actions.TryGetValue(typeof(T), out onchange);
if (onchange != null)
{
onchange.ToArray().ForEach(r => r(obj, action));
}
Task.Run(() => _redis.PublishAsync(channelName, new RedisCachePubSubItem<T>() { Object = obj, Action = cacheNotifyAction }))
.GetAwaiter()
.GetResult();
}
public void Subscribe<T>(Action<T, CacheNotifyAction> onchange)
{
redis.Subscribe<RedisCachePubSubItem<T>>("asc:channel:" + typeof(T).FullName, (i) =>
foreach (var cacheNotifyAction in Enum.GetNames(typeof(CacheNotifyAction)))
{
if (i.CacheId != CacheId)
var channelName = $"asc:channel:{cacheNotifyAction}:{typeof(T).FullName}".ToLowerInvariant();
Task.Run(() => _redis.SubscribeAsync<RedisCachePubSubItem<T>>(channelName, (i) =>
{
onchange(i.Object, i.Action);
}
});
if (onchange != null)
{
Action<object, CacheNotifyAction> action = (o, a) => onchange((T)o, a);
actions.AddOrUpdate(typeof(T),
new ConcurrentBag<Action<object, CacheNotifyAction>> { action },
(type, bag) =>
{
bag.Add(action);
return bag;
});
}
else
{
ConcurrentBag<Action<object, CacheNotifyAction>> removed;
actions.TryRemove(typeof(T), out removed);
return Task.FromResult(true);
})).GetAwaiter()
.GetResult();
}
}
public void PushMailAction<T>(string QueueName, T value) where T : class
{
if (value != null)
{
Task.Run(() => _redis.ListAddToLeftAsync<T>(QueueName, value))
.GetAwaiter()
.GetResult();
}
}
[Serializable]
class RedisCachePubSubItem<T>
{
public string CacheId { get; set; }
public T Object { get; set; }
public CacheNotifyAction Action { get; set; }
}
class Serializer : ISerializer
{
private readonly Encoding enc = Encoding.UTF8;
public byte[] Serialize(object item)
{
try
{
var s = JsonConvert.SerializeObject(item);
return enc.GetBytes(s);
}
catch (Exception e)
{
LogManager.GetLogger("ASC").Error("Redis Serialize", e);
throw;
}
}
public object Deserialize(byte[] obj)
{
try
{
var resolver = new ContractResolver();
var settings = new JsonSerializerSettings { ContractResolver = resolver };
var s = enc.GetString(obj);
return JsonConvert.DeserializeObject(s, typeof(object), settings);
}
catch (Exception e)
{
LogManager.GetLogger("ASC").Error("Redis Deserialize", e);
throw;
}
}
public T Deserialize<T>(byte[] obj)
{
try
{
var resolver = new ContractResolver();
var settings = new JsonSerializerSettings { ContractResolver = resolver };
var s = enc.GetString(obj);
return JsonConvert.DeserializeObject<T>(s, settings);
}
catch (Exception e)
{
LogManager.GetLogger("ASC").Error("Redis Deserialize<T>", e);
throw;
}
}
public async Task<byte[]> SerializeAsync(object item)
{
return await Task.Factory.StartNew(() => Serialize(item));
}
public Task<object> DeserializeAsync(byte[] obj)
{
return Task.Factory.StartNew(() => Deserialize(obj));
}
public Task<T> DeserializeAsync<T>(byte[] obj)
{
return Task.Factory.StartNew(() => Deserialize<T>(obj));
}
class ContractResolver : DefaultContractResolver
{
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
{
var prop = base.CreateProperty(member, memberSerialization);
if (!prop.Writable)
{
var property = member as PropertyInfo;
if (property != null)
{
var hasPrivateSetter = property.GetSetMethod(true) != null;
prop.Writable = hasPrivateSetter;
}
}
return prop;
}
}
}
}
}

View File

@ -27,6 +27,7 @@ using ASC.Common.Data.Sql;
using ASC.Common.Logging;
using ASC.Common.Web;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Common.Data
{

View File

@ -24,6 +24,8 @@ using ASC.Common.Data.Sql;
using ASC.Common.Data.Sql.Expressions;
using ASC.Common.Logging;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Geolocation
{
public class GeolocationHelper

View File

@ -46,42 +46,27 @@ namespace ASC.Common.Logging
void Debug(object message);
void Debug(object message, Exception exception);
void DebugFormat(string format, params object[] args);
void DebugFormat(string format, object arg0);
void DebugFormat(string format, object arg0, object arg1);
void DebugFormat(string format, object arg0, object arg1, object arg2);
void DebugFormat(IFormatProvider provider, string format, params object[] args);
void Info(object message);
void Info(string message, Exception exception);
void InfoFormat(string format, params object[] args);
void InfoFormat(string format, object arg0);
void InfoFormat(string format, object arg0, object arg1);
void InfoFormat(string format, object arg0, object arg1, object arg2);
void InfoFormat(IFormatProvider provider, string format, params object[] args);
void Warn(object message);
void Warn(object message, Exception exception);
void WarnFormat(string format, params object[] args);
void WarnFormat(string format, object arg0);
void WarnFormat(string format, object arg0, object arg1);
void WarnFormat(string format, object arg0, object arg1, object arg2);
void WarnFormat(IFormatProvider provider, string format, params object[] args);
void Error(object message);
void Error(object message, Exception exception);
void ErrorFormat(string format, params object[] args);
void ErrorFormat(string format, object arg0);
void ErrorFormat(string format, object arg0, object arg1);
void ErrorFormat(string format, object arg0, object arg1, object arg2);
void ErrorFormat(IFormatProvider provider, string format, params object[] args);
void Fatal(object message);
void Fatal(string message, Exception exception);
void FatalFormat(string format, params object[] args);
void FatalFormat(string format, object arg0);
void FatalFormat(string format, object arg0, object arg1);
void FatalFormat(string format, object arg0, object arg1, object arg2);
void FatalFormat(IFormatProvider provider, string format, params object[] args);
string LogDirectory { get; }
@ -108,7 +93,7 @@ namespace ASC.Common.Logging
public bool IsTraceEnabled { get; private set; }
public Log(string name)
public Log(string name, Func<string> getAlias)
{
loger = log4net.LogManager.GetLogger(name);
@ -145,21 +130,6 @@ namespace ASC.Common.Logging
if (IsDebugEnabled) loger.DebugFormat(format, args);
}
public void DebugFormat(string format, object arg0)
{
if (IsDebugEnabled) loger.DebugFormat(format, arg0);
}
public void DebugFormat(string format, object arg0, object arg1)
{
if (IsDebugEnabled) loger.DebugFormat(format, arg0, arg1);
}
public void DebugFormat(string format, object arg0, object arg1, object arg2)
{
if (IsDebugEnabled) loger.DebugFormat(format, arg0, arg1, arg2);
}
public void DebugFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsDebugEnabled) loger.DebugFormat(provider, format, args);
@ -193,21 +163,6 @@ namespace ASC.Common.Logging
if (IsInfoEnabled) loger.InfoFormat(format, args);
}
public void InfoFormat(string format, object arg0)
{
if (IsInfoEnabled) loger.InfoFormat(format, arg0);
}
public void InfoFormat(string format, object arg0, object arg1)
{
if (IsInfoEnabled) loger.InfoFormat(format, arg0, arg1);
}
public void InfoFormat(string format, object arg0, object arg1, object arg2)
{
if (IsInfoEnabled) loger.InfoFormat(format, arg0, arg1, arg2);
}
public void InfoFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsInfoEnabled) loger.InfoFormat(provider, format, args);
@ -229,21 +184,6 @@ namespace ASC.Common.Logging
if (IsWarnEnabled) loger.WarnFormat(format, args);
}
public void WarnFormat(string format, object arg0)
{
if (IsWarnEnabled) loger.WarnFormat(format, arg0);
}
public void WarnFormat(string format, object arg0, object arg1)
{
if (IsWarnEnabled) loger.WarnFormat(format, arg0, arg1);
}
public void WarnFormat(string format, object arg0, object arg1, object arg2)
{
if (IsWarnEnabled) loger.WarnFormat(format, arg0, arg1, arg2);
}
public void WarnFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsWarnEnabled) loger.WarnFormat(provider, format, args);
@ -265,21 +205,6 @@ namespace ASC.Common.Logging
if (IsErrorEnabled) loger.ErrorFormat(format, args);
}
public void ErrorFormat(string format, object arg0)
{
if (IsErrorEnabled) loger.ErrorFormat(format, arg0);
}
public void ErrorFormat(string format, object arg0, object arg1)
{
if (IsErrorEnabled) loger.ErrorFormat(format, arg0, arg1);
}
public void ErrorFormat(string format, object arg0, object arg1, object arg2)
{
if (IsErrorEnabled) loger.ErrorFormat(format, arg0, arg1, arg2);
}
public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsErrorEnabled) loger.ErrorFormat(provider, format, args);
@ -301,21 +226,6 @@ namespace ASC.Common.Logging
if (IsFatalEnabled) loger.FatalFormat(format, args);
}
public void FatalFormat(string format, object arg0)
{
if (IsFatalEnabled) loger.FatalFormat(format, arg0);
}
public void FatalFormat(string format, object arg0, object arg1)
{
if (IsFatalEnabled) loger.FatalFormat(format, arg0, arg1);
}
public void FatalFormat(string format, object arg0, object arg1, object arg2)
{
if (IsFatalEnabled) loger.FatalFormat(format, arg0, arg1, arg2);
}
public void FatalFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsFatalEnabled) loger.FatalFormat(provider, format, args);
@ -328,23 +238,20 @@ namespace ASC.Common.Logging
return log4net.GlobalContext.Properties["LogDirectory"].ToString();
}
}
}
public class LogNLog : ILog
{
private readonly NLog.ILogger loger;
private readonly string name;
private Func<string> getAlias;
public bool IsDebugEnabled { get; private set; }
public bool IsInfoEnabled { get; private set; }
public bool IsWarnEnabled { get; private set; }
public bool IsErrorEnabled { get; private set; }
public bool IsFatalEnabled { get; private set; }
public bool IsTraceEnabled { get; private set; }
static LogNLog()
@ -355,18 +262,16 @@ namespace ASC.Common.Logging
{
if (args[i] == "--log" && !string.IsNullOrEmpty(args[i + 1]))
{
NLog.LogManager.Configuration.Variables["svcName"] = args[i + 1].Trim().Trim('"');
LogManager.Configuration.Variables["svcName"] = args[i + 1].Trim().Trim('"');
}
}
NLog.Targets.Target.Register<SelfCleaningTarget>("SelfCleaning");
}
public LogNLog(string name)
public LogNLog(string name, Func<string> getAlias)
{
this.name = name;
loger = NLog.LogManager.GetLogger(name);
loger = LogManager.GetLogger(name);
this.getAlias = getAlias;
IsDebugEnabled = loger.IsDebugEnabled;
IsInfoEnabled = loger.IsInfoEnabled;
@ -378,207 +283,161 @@ namespace ASC.Common.Logging
public void Trace(object message)
{
if (IsTraceEnabled) loger.Log(LogLevel.Trace, message);
Log(LogLevel.Trace, message);
}
public void TraceFormat(string message, object arg0)
{
if (IsTraceEnabled) loger.Log(LogLevel.Trace, string.Format(message, arg0));
Log(LogLevel.Trace, string.Format(message, arg0));
}
public void Debug(object message)
{
if (IsDebugEnabled) loger.Debug(message);
Log(LogLevel.Debug, message);
}
public void Debug(object message, Exception exception)
{
if (IsDebugEnabled) loger.Debug(exception, "{0}", message);
Log(LogLevel.Debug, message, exception);
}
public void DebugFormat(string format, params object[] args)
{
if (IsDebugEnabled) loger.Debug(format, args);
}
public void DebugFormat(string format, object arg0)
{
if (IsDebugEnabled) loger.Debug(format, arg0);
}
public void DebugFormat(string format, object arg0, object arg1)
{
if (IsDebugEnabled) loger.Debug(format, arg0, arg1);
}
public void DebugFormat(string format, object arg0, object arg1, object arg2)
{
if (IsDebugEnabled) loger.Debug(format, arg0, arg1, arg2);
Log(LogLevel.Debug, string.Format(format, args));
}
public void DebugFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsDebugEnabled) loger.Debug(provider, format, args);
Log(LogLevel.Debug, string.Format(format, args), provider);
}
public void DebugWithProps(string message, params KeyValuePair<string, object>[] props)
{
if (!IsDebugEnabled) return;
var theEvent = new LogEventInfo { Message = message, LoggerName = name, Level = LogLevel.Debug };
foreach (var p in props)
{
theEvent.Properties[p.Key] = p.Value;
}
loger.Log(theEvent);
Log(LogLevel.Debug, message, props);
}
public void Info(object message)
{
if (IsInfoEnabled) loger.Info(message);
Log(LogLevel.Info, message);
}
public void Info(string message, Exception exception)
{
if (IsInfoEnabled) loger.Info(exception, message);
Log(LogLevel.Info, message,exception);
}
public void InfoFormat(string format, params object[] args)
{
if (IsInfoEnabled) loger.Info(format, args);
}
public void InfoFormat(string format, object arg0)
{
if (IsInfoEnabled) loger.Info(format, arg0);
}
public void InfoFormat(string format, object arg0, object arg1)
{
if (IsInfoEnabled) loger.Info(format, arg0, arg1);
}
public void InfoFormat(string format, object arg0, object arg1, object arg2)
{
if (IsInfoEnabled) loger.Info(format, arg0, arg1, arg2);
Log(LogLevel.Info, string.Format(format, args));
}
public void InfoFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsInfoEnabled) loger.Info(provider, format, args);
Log(LogLevel.Info, string.Format(format, args), provider);
}
public void Warn(object message)
{
if (IsWarnEnabled) loger.Warn(message);
Log(LogLevel.Warn, message);
}
public void Warn(object message, Exception exception)
{
if (IsWarnEnabled) loger.Warn(exception, "{0}", message);
Log(LogLevel.Warn, message, exception);
}
public void WarnFormat(string format, params object[] args)
{
if (IsWarnEnabled) loger.Warn(format, args);
}
public void WarnFormat(string format, object arg0)
{
if (IsWarnEnabled) loger.Warn(format, arg0);
}
public void WarnFormat(string format, object arg0, object arg1)
{
if (IsWarnEnabled) loger.Warn(format, arg0, arg1);
}
public void WarnFormat(string format, object arg0, object arg1, object arg2)
{
if (IsWarnEnabled) loger.Warn(format, arg0, arg1, arg2);
Log(LogLevel.Warn, string.Format(format, args));
}
public void WarnFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsWarnEnabled) loger.Warn(provider, format, args);
Log(LogLevel.Warn, string.Format(format, args), provider);
}
public void Error(object message)
{
if (IsErrorEnabled) loger.Error(message);
Log(LogLevel.Error, message);
}
public void Error(object message, Exception exception)
{
if (IsErrorEnabled) loger.Error(exception, "{0}", message);
Log(LogLevel.Error, message, exception);
}
public void ErrorFormat(string format, params object[] args)
{
if (IsErrorEnabled) loger.Error(format, args);
}
public void ErrorFormat(string format, object arg0)
{
if (IsErrorEnabled) loger.Error(format, arg0);
}
public void ErrorFormat(string format, object arg0, object arg1)
{
if (IsErrorEnabled) loger.Error(format, arg0, arg1);
}
public void ErrorFormat(string format, object arg0, object arg1, object arg2)
{
if (IsErrorEnabled) loger.Error(format, arg0, arg1, arg2);
Log(LogLevel.Error, string.Format(format,args));
}
public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsErrorEnabled) loger.Error(provider, format, args);
Log(LogLevel.Error, string.Format(format, args), provider);
}
public void Fatal(object message)
{
if (IsFatalEnabled) loger.Fatal(message);
Log(LogLevel.Fatal, message);
}
public void Fatal(string message, Exception exception)
{
if (IsFatalEnabled) loger.Fatal(exception, message);
Log(LogLevel.Fatal, message,exception);
}
public void FatalFormat(string format, params object[] args)
{
if (IsFatalEnabled) loger.Fatal(format, args);
}
public void FatalFormat(string format, object arg0)
{
if (IsFatalEnabled) loger.Fatal(format, arg0);
}
public void FatalFormat(string format, object arg0, object arg1)
{
if (IsFatalEnabled) loger.Fatal(format, arg0, arg1);
}
public void FatalFormat(string format, object arg0, object arg1, object arg2)
{
if (IsFatalEnabled) loger.Fatal(format, arg0, arg1, arg2);
Log(LogLevel.Fatal, string.Format(format,args));
}
public void FatalFormat(IFormatProvider provider, string format, params object[] args)
{
if (IsFatalEnabled) loger.Fatal(provider, format, args);
Log(LogLevel.Fatal, string.Format(format, args), provider);
}
private void Log(LogLevel level, object message)
{
var theEvent = new LogEventInfo { Message = message.ToString(), LoggerName = name, Level = level };
Log(theEvent);
}
private void Log(LogLevel level, object message, params KeyValuePair<string, object>[] props)
{
var theEvent = new LogEventInfo { Message = message.ToString(), LoggerName = name, Level = level };
foreach (var p in props)
{
theEvent.Properties[p.Key] = p.Value;
}
Log(theEvent);
}
private void Log(LogLevel level, object message, Exception exception)
{
var theEvent = new LogEventInfo { Message = message.ToString(), LoggerName = name, Level = level, Exception = exception };
Log(theEvent);
}
private void Log(LogLevel level, object message, IFormatProvider provider)
{
var theEvent = new LogEventInfo { Message = message.ToString(), LoggerName = name, Level = level, FormatProvider = provider };
Log(theEvent);
}
private void Log(LogEventInfo theEvent)
{
var alias = getAlias == null ? null : getAlias();
if (alias != null)
{
theEvent.Properties["alias"] = alias + " - ";
}
loger.Log(theEvent);
}
public string LogDirectory { get { return NLog.LogManager.Configuration.Variables["logDirectory"].Text; } }
}
public class NullLog : ILog
@ -642,18 +501,6 @@ namespace ASC.Common.Logging
{
}
public void InfoFormat(string format, object arg0)
{
}
public void InfoFormat(string format, object arg0, object arg1)
{
}
public void InfoFormat(string format, object arg0, object arg1, object arg2)
{
}
public void InfoFormat(IFormatProvider provider, string format, params object[] args)
{
}
@ -670,18 +517,6 @@ namespace ASC.Common.Logging
{
}
public void WarnFormat(string format, object arg0)
{
}
public void WarnFormat(string format, object arg0, object arg1)
{
}
public void WarnFormat(string format, object arg0, object arg1, object arg2)
{
}
public void WarnFormat(IFormatProvider provider, string format, params object[] args)
{
}
@ -698,18 +533,6 @@ namespace ASC.Common.Logging
{
}
public void ErrorFormat(string format, object arg0)
{
}
public void ErrorFormat(string format, object arg0, object arg1)
{
}
public void ErrorFormat(string format, object arg0, object arg1, object arg2)
{
}
public void ErrorFormat(IFormatProvider provider, string format, params object[] args)
{
}
@ -726,32 +549,21 @@ namespace ASC.Common.Logging
{
}
public void FatalFormat(string format, object arg0)
{
}
public void FatalFormat(string format, object arg0, object arg1)
{
}
public void FatalFormat(string format, object arg0, object arg1, object arg2)
{
}
public void FatalFormat(IFormatProvider provider, string format, params object[] args)
{
}
public string LogDirectory { get { return ""; } }
}
public class LogManager
public class BaseLogManager
{
internal static IContainer Builder { get; set; }
internal static ConcurrentDictionary<string, ILog> Logs;
static LogManager()
static BaseLogManager()
{
var container = AutofacConfigLoader.Load("core");
if (container != null)
@ -762,14 +574,13 @@ namespace ASC.Common.Logging
Logs = new ConcurrentDictionary<string, ILog>();
}
public static ILog GetLogger(string name)
public static ILog GetLogger(string name, Func<string> getAlias = null)
{
ILog result;
if (!Logs.TryGetValue(name, out result))
{
result = Logs.AddOrUpdate(name, Builder != null ? Builder.Resolve<ILog>(new TypedParameter(typeof(string), name)) : new NullLog(), (k, v) => v);
result = Logs.AddOrUpdate(name, Builder != null ? Builder.Resolve<ILog>(new TypedParameter(typeof(string), name), new TypedParameter(typeof(Func<string>), getAlias)) : new NullLog(), (k, v) => v);
}
return result;
}
}

View File

@ -1,141 +0,0 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NLog;
using NLog.Common;
using NLog.Targets;
namespace ASC.Common.Logging
{
[Target("SelfCleaning")]
public class SelfCleaningTarget : FileTarget
{
private static DateTime _lastCleanDate;
private static int? _cleanPeriod;
private static int GetCleanPeriod()
{
if (_cleanPeriod != null)
return _cleanPeriod.Value;
var value = 30;
const string key = "cleanPeriod";
if (NLog.LogManager.Configuration.Variables.Keys.Contains(key))
{
var variable = NLog.LogManager.Configuration.Variables[key];
if (variable != null && !string.IsNullOrEmpty(variable.Text))
{
int.TryParse(variable.Text, out value);
}
}
_cleanPeriod = value;
return value;
}
private void Clean()
{
var filePath = string.Empty;
var dirPath = string.Empty;
try
{
if (FileName == null)
return;
filePath = ((NLog.Layouts.SimpleLayout)FileName).Text;
if (string.IsNullOrEmpty(filePath))
return;
dirPath = Path.GetDirectoryName(filePath);
if (string.IsNullOrEmpty(dirPath))
return;
if (!Path.IsPathRooted(dirPath))
dirPath = Path.Combine(Environment.CurrentDirectory, dirPath);
var directory = new DirectoryInfo(dirPath);
if (!directory.Exists)
return;
var files = directory.GetFiles();
var cleanPeriod = GetCleanPeriod();
foreach (var file in files.Where(file => (DateTime.UtcNow.Date - file.CreationTimeUtc.Date).Days > cleanPeriod))
{
file.Delete();
}
}
catch (Exception err)
{
base.Write(new LogEventInfo
{
Exception = err,
Level = LogLevel.Error,
Message = String.Format("file: {0}, dir: {1}, mess: {2}", filePath, dirPath, err.Message),
LoggerName = "SelfCleaningTarget"
});
}
}
protected override void Write(IList<AsyncLogEventInfo> logEvents)
{
if (DateTime.UtcNow.Date > _lastCleanDate.Date)
{
_lastCleanDate = DateTime.UtcNow.Date;
Clean();
}
var buffer = new List<AsyncLogEventInfo>();
foreach (var logEvent in logEvents)
{
buffer.Add(logEvent);
if (buffer.Count < 10) continue;
base.Write(buffer);
buffer.Clear();
}
base.Write(buffer);
}
protected override void Write(LogEventInfo logEvent)
{
if (DateTime.UtcNow.Date > _lastCleanDate.Date)
{
_lastCleanDate = DateTime.UtcNow.Date;
Clean();
}
base.Write(logEvent);
}
}
}

View File

@ -19,12 +19,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
using ASC.Common.Logging;
using ASC.Notify.Channels;
using ASC.Notify.Engine;
using ASC.Notify.Model;
using ASC.Notify.Sinks;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Notify
{
public sealed class Context : INotifyRegistry

View File

@ -21,6 +21,8 @@ using System.Configuration;
using ASC.Common.Logging;
using ASC.Notify.Messages;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Notify.Engine
{
public class DispatchEngine

View File

@ -28,6 +28,8 @@ using ASC.Notify.Messages;
using ASC.Notify.Patterns;
using ASC.Notify.Recipients;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Notify.Engine
{
public class NotifyEngine : INotifyEngine

View File

@ -19,12 +19,13 @@ using System;
using System.Collections;
using System.Collections.Generic;
using ASC.Common.Logging;
using ASC.Notify.Messages;
using ASC.Notify.Model;
using ASC.Notify.Patterns;
using ASC.Notify.Recipients;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Notify.Engine
{
public class NotifyRequest

View File

@ -15,15 +15,12 @@
*/
#region usings
using System;
using System.Linq;
using ASC.Common.Logging;
using ASC.Notify.Recipients;
#endregion
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Notify.Model
{

View File

@ -0,0 +1,96 @@
using System;
using System.Threading.Tasks;
using System.Web;
namespace ASC.Common.Radicale
{
public class CalDavCalendar : RadicaleEntity
{
public bool IsShared { set; get; } = false;
public readonly string strUpdateTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" +
"<propertyupdate xmlns=\"DAV:\" xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:CR=\"urn:ietf:params:xml:ns:carddav\" xmlns:I=\"http://apple.com/ns/ical/\" xmlns:INF=\"http://inf-it.com/ns/ab/\">" +
"<set><prop>" +
"<C:supported-calendar-component-set><C:comp name=\"VEVENT\" /><C:comp name=\"VJOURNAL\" /><C:comp name=\"VTODO\" />" +
"</C:supported-calendar-component-set><displayname>{0}</displayname><I:calendar-color>{1}</I:calendar-color>" +
"<C:calendar-description>{2}</C:calendar-description></prop></set><remove><prop>" +
"<INF:calendar-color /><CR:calendar-description /></prop></remove></propertyupdate>";
public readonly string strCreateTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" +
"<mkcol xmlns=\"DAV:\" xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:CR=\"urn:ietf:params:xml:ns:carddav\" xmlns:I=\"http://apple.com/ns/ical/\" xmlns:INF=\"http://inf-it.com/ns/ab/\">" +
"<set><prop>" +
"<resourcetype><collection /><C:calendar /></resourcetype>" +
"<C:supported-calendar-component-set><C:comp name=\"VEVENT\" /><C:comp name=\"VJOURNAL\" /><C:comp name=\"VTODO\" />" +
"</C:supported-calendar-component-set><displayname>{0}</displayname>" +
"<I:calendar-color>{1}</I:calendar-color>" +
"<C:calendar-description>{2}</C:calendar-description></prop></set></mkcol>";
public CalDavCalendar(string uid, bool isShared)
{
Uid = uid;
IsShared = isShared;
}
public async Task<DavResponse> CreateAsync(string name, string description, string backgroundColor, Uri uri, string userName, string authorization)
{
var requestUrl = uri.Scheme + "://" + uri.Host + "/caldav/" + HttpUtility.UrlEncode(userName) + "/" + Uid + (IsShared ? "-readonly" : "");
var davRequest = new DavRequest()
{
Url = requestUrl,
Authorization = authorization,
Data = GetData(strCreateTemplate, name, description, backgroundColor)
};
try
{
return await RadicaleClient.CreateAsync(davRequest).ConfigureAwait(false);
}
catch (Exception ex)
{
throw new RadicaleException(ex.Message);
}
}
public async Task<DavResponse> Update(string name, string description, string backgroundColor, Uri uri, string userName, string authorization)
{
var requestUrl = GetRadicaleUrl(uri.ToString(), userName, IsShared, isRedirectUrl: true, entityId: Uid);
var davRequest = new DavRequest()
{
Url = requestUrl,
Authorization = authorization,
Data = GetData(strUpdateTemplate, name, description, backgroundColor)
};
return await RadicaleClient.UpdateAsync(davRequest).ConfigureAwait(false);
}
public async Task<DavResponse> GetCollection(string url, string authorization)
{
var davRequest = new DavRequest()
{
Url = url,
Authorization = authorization
};
return await RadicaleClient.GetAsync(davRequest).ConfigureAwait(false);
}
public async Task<DavResponse> UpdateItem(string url, string authorization, string data, string headerUrl = "")
{
var davRequest = new DavRequest()
{
Url = url,
Authorization = authorization,
Header = headerUrl,
Data = data
};
return await RadicaleClient.UpdateItemAsync(davRequest).ConfigureAwait(false);
}
}
}

View File

@ -0,0 +1,175 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using ASC.Common.Logging;
using ASC.Common.Radicale.Core;
namespace ASC.Common.Radicale
{
public class CardDavAddressbook : RadicaleEntity
{
private static readonly ILog Logger = BaseLogManager.GetLogger("ASC.Radicale");
public readonly string strTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" +
"<mkcol xmlns=\"DAV:\" xmlns:C=\"urn: ietf:params:xml: ns: caldav\" xmlns:CR=\"urn: ietf:params:xml: ns: carddav\" xmlns:I=\"http://apple.com/ns/ical/\" xmlns:INF=\"http://inf-it.com/ns/ab/\">" + "" +
"<set><prop>" +
"<resourcetype><collection /><CR:addressbook /></resourcetype>" +
"<displayname>{0}</displayname>" +
"<INF:addressbook-color>{1}</INF:addressbook-color>" +
"<CR:addressbook-description>{2}</CR:addressbook-description>" +
"</prop></set></mkcol>";
public async Task<DavResponse> Create(string name, string description, string backgroundColor, string uri, string authorization, bool isReadonly = true)
{
var rewriterUri = uri.StartsWith("http") ? uri : "";
var davRequest = new DavRequest()
{
Url = uri,
Authorization = authorization,
Header = rewriterUri,
Data = GetData(strTemplate, name, description, backgroundColor)
};
return await RadicaleClient.CreateAsync(davRequest).ConfigureAwait(false);
}
public async Task<DavResponse> Update(string name, string description, string backgroundColor, string uri, string userName, string authorization, bool isReadonly = true)
{
var addbookId = isReadonly ? readonlyAddBookName : defaultAddBookName;
var header = uri.StartsWith("http") ? uri : "";
var requestUrl = defaultRadicaleUrl + "/" + HttpUtility.UrlEncode(userName) + "/" + addbookId;
var davRequest = new DavRequest()
{
Url = requestUrl,
Authorization = authorization,
Data = GetData(strTemplate, name, description, backgroundColor),
Header = header
};
return await RadicaleClient.UpdateAsync(davRequest).ConfigureAwait(false);
}
public async Task<DavResponse> GetCollection(string url, string authorization, string myUri)
{
var path = (new Uri(url).AbsolutePath.StartsWith("/carddav")) ? (new Uri(url).AbsolutePath.Remove(0, 8)) : new Uri(url).AbsolutePath;
var defaultUrlconn = defaultRadicaleUrl + path;
var davRequest = new DavRequest()
{
Url = defaultUrlconn,
Authorization = authorization,
Header = myUri
};
return await RadicaleClient.GetAsync(davRequest).ConfigureAwait(false);
}
public async Task<DavResponse> UpdateItem(string url, string authorization, string data, string headerUrl = "")
{
var path = (new Uri(url).AbsolutePath.StartsWith("/carddav")) ? (new Uri(url).AbsolutePath.Remove(0, 8)) : new Uri(url).AbsolutePath;
var requrl = defaultRadicaleUrl + path;
var davRequest = new DavRequest()
{
Url = requrl,
Authorization = authorization,
Header = headerUrl,
Data = data
};
return await RadicaleClient.UpdateItemAsync(davRequest).ConfigureAwait(false);
}
public string GetUserSerialization(CardDavItem user)
{
var sex = (user.Sex.HasValue) ? user.Sex.Value ? "M" : "W" : string.Empty;
var builder = new StringBuilder();
builder.AppendLine("BEGIN:VCARD");
builder.AppendLine("UID:" + user.ID.ToString());
builder.AppendLine("N:" + user.LastName + ";" + user.FirstName);
builder.AppendLine("FN:" + user.FirstName + " " + user.LastName);
builder.AppendLine("EMAIL:" + user.Email);
builder.AppendLine("TEL:" + user.MobilePhone);
builder.AppendLine($"BDAY:{user.BirthDate:s}");
builder.AppendLine("TITLE:" + user.Title);
builder.AppendLine("URL:" + "");
builder.AppendLine("GENDER:" + sex);
builder.AppendLine($"REV:{DateTime.Now:s}");
builder.AppendLine("TZ:" + DateTimeOffset.Now.Offset);
builder.AppendLine("ORG:");
builder.AppendLine("END:VCARD");
return builder.ToString();
}
public void Delete(string uri, Guid userID, string email, int tenantId = 0)
{
var authorization = GetSystemAuthorization();
var deleteUrlBook = GetRadicaleUrl(uri, email.ToLower(), true, true);
var davRequest = new DavRequest()
{
Url = deleteUrlBook,
Authorization = authorization
};
try
{
RadicaleClient.RemoveAsync(davRequest).ConfigureAwait(false);
var dbConn = new DbRadicale();
dbConn.RemoveCardDavUser(tenantId, userID.ToString());
}
catch (Exception ex)
{
Logger.Error("ERROR: " + ex.Message);
}
}
public void UpdateItemForAllAddBooks(List<string> emailList, string uri, CardDavItem user, int tenantId = 0, string changedEmail = null)
{
var authorization = GetSystemAuthorization();
if (changedEmail != null)
{
var deleteUrlBook = GetRadicaleUrl(uri, changedEmail.ToLower(), true, true);
var davRequest = new DavRequest()
{
Url = deleteUrlBook,
Authorization = authorization
};
RadicaleClient.RemoveAsync(davRequest).ConfigureAwait(false);
try
{
var dbConn = new DbRadicale();
dbConn.RemoveCardDavUser(tenantId, user.ID.ToString());
}
catch (Exception ex)
{
Logger.Error("ERROR: " + ex.Message);
}
}
foreach (string email in emailList)
{
try
{
var currentEmail = email.ToLower();
var userData = GetUserSerialization(user);
var requestUrl = GetRadicaleUrl(uri, currentEmail, true, true, itemID: user.ID.ToString());
UpdateItem(requestUrl, authorization, userData, uri).ConfigureAwait(false);
}
catch (Exception ex)
{
Logger.Error("ERROR: " + ex.Message);
}
}
}
}
}

View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ASC.Common.Radicale
{
public class CardDavItem
{
public Guid ID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string UserName { get; set; }
public DateTime? BirthDate { get; set; }
public bool? Sex { get; set; }
public string Title { get; set; }
public string Email { get; set; }
public List<string> Contacts { get; set; }
public string MobilePhone { get; set; }
public override string ToString()
{
return String.Format("{0} {1}", FirstName, LastName).Trim();
}
public override int GetHashCode()
{
return ID.GetHashCode();
}
public CardDavItem(Guid iD, string firstName, string lastName, string userName, DateTime? birthDate, bool? sex, string title, string email, List<string> contacts, string mobilePhone)
{
ID = iD;
FirstName = firstName;
LastName = lastName;
UserName = userName;
BirthDate = birthDate;
Sex = sex;
Title = title;
Email = email;
Contacts = contacts;
MobilePhone = mobilePhone;
}
}
}

View File

@ -0,0 +1,39 @@

using System;
using ASC.Common.Data;
using ASC.Common.Data.Sql;
namespace ASC.Common.Radicale.Core
{
public class DbRadicale
{
private IDbManager db = DbManager.FromHttpContext("default");
public void SaveCardDavUser(int tenant, string id)
{
var i = new SqlInsert("core_userdav").ReplaceExists(true)
.InColumnValue("tenant_id", tenant)
.InColumnValue("user_id", id);
db.ExecuteNonQuery(i);
}
public void RemoveCardDavUser(int tenant, string id)
{
var i = new SqlDelete("core_userdav").Where("user_id", id).Where("tenant_id", tenant);
db.ExecuteNonQuery(i);
}
public Boolean IsExistCardDavUser(int tenant, string id)
{
var q = new SqlQuery("core_userdav")
.Select("1")
.Where("user_id", id)
.Where("tenant_id", tenant)
.SetMaxResults(1);
return db.ExecuteScalar<bool>(q);
}
}
}

View File

@ -0,0 +1,120 @@
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using ASC.Common.Logging;
namespace ASC.Common.Radicale
{
public static class RadicaleClient
{
private static readonly ILog Logger = BaseLogManager.GetLogger("ASC.Radicale");
public async static Task<DavResponse> CreateAsync(DavRequest davRequest)
{
davRequest.Method = "MKCOL";
var response = await RequestAsync(davRequest).ConfigureAwait(false);
return GetDavResponse(response);
}
public async static Task<DavResponse> GetAsync(DavRequest davRequest)
{
davRequest.Method = "GET";
var response = await RequestAsync(davRequest).ConfigureAwait(false);
var davResponse = new DavResponse()
{
StatusCode = (int)response.StatusCode
};
if (response.StatusCode == System.Net.HttpStatusCode.OK)
{
davResponse.Completed = true;
davResponse.Data = await response.Content.ReadAsStringAsync();
}
else
{
davResponse.Completed = false;
davResponse.Error = response.ReasonPhrase;
}
return davResponse;
}
public async static Task<DavResponse> UpdateItemAsync(DavRequest davRequest)
{
davRequest.Method = "PUT";
var response = await RequestAsync(davRequest).ConfigureAwait(false);
return GetDavResponse(response);
}
public async static Task<DavResponse> UpdateAsync(DavRequest davRequest)
{
davRequest.Method = "PROPPATCH";
var response = await RequestAsync(davRequest).ConfigureAwait(false);
return GetDavResponse(response);
}
public async static Task RemoveAsync(DavRequest davRequest)
{
davRequest.Method = "DELETE";
await RequestAsync(davRequest).ConfigureAwait(false);
}
private async static Task<HttpResponseMessage> RequestAsync(DavRequest davRequest)
{
try
{
using (var hc = new HttpClient())
{
hc.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes(davRequest.Authorization)));
if (!String.IsNullOrEmpty(davRequest.Header)) hc.DefaultRequestHeaders.Add("X_REWRITER_URL", davRequest.Header);
var method = new HttpMethod(davRequest.Method);
var request = new HttpRequestMessage(method, davRequest.Url);
if (davRequest.Data != null)
{
request.Content = new StringContent(davRequest.Data);
}
return await hc.SendAsync(request).ConfigureAwait(false);
}
}
catch (AggregateException ex)
{
throw new RadicaleException(ex.Message);
}
catch (Exception ex)
{
Logger.Error(ex.Message);
throw new RadicaleException(ex.Message);
}
}
private static DavResponse GetDavResponse(HttpResponseMessage response)
{
if (response.IsSuccessStatusCode)
{
return new DavResponse()
{
Completed = true,
Data = response.IsSuccessStatusCode ? response.RequestMessage.RequestUri.ToString() : response.ReasonPhrase,
};
}
else
{
return new DavResponse()
{
Completed = false,
StatusCode = (int)response.StatusCode,
Error = response.ReasonPhrase
};
}
}
}
}

View File

@ -0,0 +1,15 @@
using System;
namespace ASC.Common.Radicale
{
[Serializable]
public class RadicaleException : Exception
{
public RadicaleException(string message)
: base(message)
{
}
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace ASC.Common.Radicale
{
public class DavRequest
{
public string Url { get; set; }
public string Authorization { get; set; }
public string Method { get; set; }
public string Data { get; set; }
public string Header { get; set; }
}
}

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace ASC.Common.Radicale
{
[DataContract]
public class DavResponse
{
[DataMember]
public bool Completed { get; set; }
[DataMember]
public int StatusCode { get; set; }
[DataMember]
public string Data { get; set; }
[DataMember]
public string Error { get; set; }
public override string ToString()
{
return StatusCode.ToString() + " " + Error;
}
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ASC.Common.Radicale
{
interface IRadicaleEntity
{
string Create(DavRequest davrequest);
void Update(DavRequest davRequest);
void Remove(DavRequest davRequest);
void UpdateItem(DavRequest davRequest);
DavResponse GetCollection(DavRequest davRequest);
}
}

View File

@ -0,0 +1,60 @@
using System;
using System.Configuration;
using System.Text.RegularExpressions;
using System.Web;
using ASC.Security.Cryptography;
namespace ASC.Common.Radicale
{
public abstract class RadicaleEntity
{
public string Uid { get; set; }
public static readonly string defaultRadicaleUrl = (ConfigurationManagerExtension.AppSettings["radicale.path"] != null) ? ConfigurationManagerExtension.AppSettings["radicale.path"] : "http://localhost:5232";
public readonly string defaultAddBookName = "11111111-1111-1111-1111-111111111111";
public readonly string readonlyAddBookName = "11111111-1111-1111-1111-111111111111-readonly";
public string GetRadicaleUrl(string url, string email, bool isReadonly = false, bool isCardDav = false, bool isRedirectUrl = false, string entityId = "", string itemID = "")
{
string requestUrl;
var currentUserName = url.StartsWith("http") ? email.ToLower() + "@" + new Uri(url).Host : email.ToLower() + "@" + url;
var protocolType = (!isCardDav) ? "/caldav/" : "/carddav/";
var serverUrl = isRedirectUrl ? new Uri(url).Scheme + "://" + new Uri(url).Host + protocolType :
defaultRadicaleUrl;
if (isCardDav)
{
var addbookId = isReadonly ? readonlyAddBookName : defaultAddBookName;
requestUrl = (itemID != "") ? defaultRadicaleUrl + "/" + HttpUtility.UrlEncode(currentUserName) + "/" + addbookId + "/" + itemID + ".vcf" :
(isRedirectUrl) ? serverUrl + HttpUtility.UrlEncode(currentUserName) + "/" + addbookId :
defaultRadicaleUrl + "/" + HttpUtility.UrlEncode(currentUserName) + "/" + addbookId;
}
else
{
requestUrl = (itemID != "") ? serverUrl + HttpUtility.UrlEncode(currentUserName) + "/" + entityId + (isReadonly ? "-readonly" : "") +
"/" + HttpUtility.UrlEncode(itemID) + ".ics" :
serverUrl + HttpUtility.UrlEncode(currentUserName) + "/" + entityId + (isReadonly ? "-readonly" : "");
}
return requestUrl;
}
public string GetSystemAuthorization()
{
return ConfigurationManagerExtension.AppSettings["radicale.admin.data"] + ":" + InstanceCrypto.Encrypt(ConfigurationManagerExtension.AppSettings["radicale.admin.data"]);
}
protected string GetData(string sample, string name, string description, string backgroundColor)
{
string[] numbers = Regex.Split(backgroundColor, @"\D+");
var color = numbers.Length > 4 ? HexFromRGB(int.Parse(numbers[1]), int.Parse(numbers[2]), int.Parse(numbers[3])) : "#000000";
return string.Format(sample, name, color, description);
}
private string HexFromRGB(int r, int g, int b)
{
return string.Format("#{0:X2}{1:X2}{2:X2}", r, g, b);
}
}
}

View File

@ -22,6 +22,7 @@ using System.Threading;
using ASC.Common.Logging;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Common.Threading.Workers
{

View File

@ -155,6 +155,11 @@ namespace System.Web
|| !string.IsNullOrEmpty(request.UserAgent) && request.UserAgent.Contains("SailfishOS"));
}
public static bool MobileApp(this HttpRequest request)
{
return !string.IsNullOrEmpty(request.UserAgent) && (request.UserAgent.Contains("iOS") || request.UserAgent.Contains("Android"));
}
private static Uri ParseRewriterUrl(string s)
{

View File

@ -0,0 +1,44 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.Linq;
using System.Text;
using System.Xml;
namespace ASC.Common.Utils
{
public static class StringUtils
{
/// <summary>
/// Removes control characters and other non-UTF-8 characters
/// </summary>
/// <param name="inString">The string to process</param>
/// <return>A string with no control characters or entities above 0x00FD</return>
public static string NormalizeStringForMySql(string inString)
{
if (string.IsNullOrEmpty(inString))
return inString;
var newString = new StringBuilder(inString.Length);
foreach (var ch in inString.Where(XmlConvert.IsXmlChar))
newString.Append(ch);
return newString.ToString();
}
}
}

View File

@ -26,6 +26,8 @@ using System.Xml.XPath;
using ASC.Common.Logging;
using LogManager = ASC.Common.Logging.BaseLogManager;
namespace ASC.Common.Utils
{
public class TimeZoneConverter

View File

@ -20,11 +20,11 @@ using System.Globalization;
using System.Security.Principal;
using System.Threading;
using System.Web;
using System.Web.SessionState;
namespace ASC.Common.Web
{
public abstract class AbstractHttpAsyncHandler : IHttpAsyncHandler, IReadOnlySessionState
public abstract class AbstractHttpAsyncHandler : IHttpAsyncHandler
{
private Action<HttpContext> processRequest;
private IPrincipal principal;

View File

@ -435,6 +435,7 @@ namespace ASC.Common.Web
AddMimeMapping(".otp", "application/vnd.oasis.opendocument.presentation-template");
AddMimeMapping(".ots", "application/vnd.oasis.opendocument.spreadsheet-template");
AddMimeMapping(".ott", "application/vnd.oasis.opendocument.text-template");
AddMimeMapping(".oxps", "application/oxps");
AddMimeMapping(".p", "text/x-pascal");
AddMimeMapping(".p10", "application/pkcs10");
AddMimeMapping(".p10", "application/x-pkcs10");

View File

@ -38,7 +38,6 @@
<ItemGroup>
<Compile Include="BaseCommonLinkUtility.cs" />
<Compile Include="Billing\BillingClient.cs" />
<Compile Include="Billing\CouponManager.cs" />
<Compile Include="Billing\License\License.cs" />
<Compile Include="Billing\License\LicenseException.cs" />
<Compile Include="Billing\License\LicenseReader.cs" />
@ -69,6 +68,7 @@
<Compile Include="Context\Impl\UserManager.cs" />
<Compile Include="Contracts\BackupServiceClient.cs" />
<Compile Include="Contracts\BackupServiceModel.cs" />
<Compile Include="Contracts\HealthCheck\HealthCheckSvc.cs" />
<Compile Include="Contracts\HealthCheck\Enums\HealthStatus.cs" />
<Compile Include="Contracts\HealthCheck\HealthCheckResponse.cs" />
<Compile Include="Contracts\HealthCheck\HealthCheckResult.cs" />
@ -81,10 +81,14 @@
<Compile Include="Core\PartnerStatus.cs" />
<Compile Include="Core\PartnerType.cs" />
<Compile Include="Core\DBResourceManager.cs" />
<Compile Include="Data\DbLoginEventsManager.cs" />
<Compile Include="Data\DbSettingsManager.cs" />
<Compile Include="Encryption\EncryprtionStatus.cs" />
<Compile Include="Encryption\EncryptionSettings.cs" />
<Compile Include="Encryption\ICrypt.cs" />
<Compile Include="Audit\BaseEvent.cs" />
<Compile Include="Logging\LogManager.cs" />
<Compile Include="Messaging\MessageAction.cs" />
<Compile Include="MultiRegionHostedSolution.cs" />
<Compile Include="Core\EmployeeType.cs" />
<Compile Include="Core\EmployeeActivationStatus.cs" />
@ -114,6 +118,8 @@
<Compile Include="Context\WorkContext.cs" />
<Compile Include="Configuration\Constants.cs" />
<Compile Include="Notify\DirectSubscriptionProvider.cs" />
<Compile Include="Notify\MentionProvider.cs" />
<Compile Include="Notify\Signalr\MailNotificationState.cs" />
<Compile Include="Notify\Telegram\Dao\CachedTelegramDao.cs" />
<Compile Include="Notify\Telegram\Dao\TelegramDao.cs" />
<Compile Include="Notify\Telegram\Dao\TelegramUser.cs" />
@ -135,7 +141,6 @@
<Compile Include="Notify\Push\PushNotification.cs" />
<Compile Include="Notify\Push\PushServiceClient.cs" />
<Compile Include="Notify\RecipientProviderImpl.cs" />
<Compile Include="Notify\ReplyToTagProvider.cs" />
<Compile Include="Notify\Senders\NotifyServiceSender.cs" />
<Compile Include="Notify\Senders\SmtpSender.cs" />
<Compile Include="Notify\Senders\INotifySender.cs" />
@ -198,22 +203,22 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac">
<Version>5.1.2</Version>
<Version>6.2.0</Version>
</PackageReference>
<PackageReference Include="AWSSDK.CloudFront">
<Version>3.5.6.3</Version>
<Version>3.7.3.20</Version>
</PackageReference>
<PackageReference Include="AWSSDK.S3">
<Version>3.5.7.6</Version>
<Version>3.7.1.29</Version>
</PackageReference>
<PackageReference Include="AWSSDK.SimpleEmail">
<Version>3.5.0.59</Version>
<Version>3.7.0.57</Version>
</PackageReference>
<PackageReference Include="MailKit">
<Version>2.11.1</Version>
<Version>2.15.0</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.X509Certificates">
<Version>4.3.2</Version>
@ -226,6 +231,5 @@
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -0,0 +1,70 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
namespace ASC.AuditTrail
{
public class BaseEvent
{
public int Id { get; set; }
public int TenantId { get; set; }
public Guid UserId { get; set; }
public bool Mobile { get; set; }
public IList<string> Description { get; set; }
[Event("IpCol")]
public string IP { get; set; }
[Event("BrowserCol")]
public string Browser { get; set; }
[Event("PlatformCol")]
public string Platform { get; set; }
[Event("DateCol")]
public DateTime Date { get; set; }
[Event("UserCol")]
public string UserName { get; set; }
[Event("PageCol")]
public string Page { get; set; }
[Event("ActionCol")]
public string ActionText { get; set; }
}
[AttributeUsage(AttributeTargets.Property)]
public class EventAttribute : Attribute
{
public string Resource { get; private set; }
public int Order { get; private set; }
public EventAttribute(string resource, int order = 0)
{
Resource = resource;
Order = order;
}
}
}

View File

@ -100,10 +100,12 @@ namespace ASC.Core.Common
if (!string.IsNullOrEmpty(tenant.MappedDomain))
{
var mapped = tenant.MappedDomain.ToLowerInvariant();
if (!mapped.Contains(Uri.SchemeDelimiter))
{
mapped = Uri.UriSchemeHttp + Uri.SchemeDelimiter + mapped;
mapped = result.Scheme + Uri.SchemeDelimiter + mapped;
}
result = new UriBuilder(mapped);
}
}

View File

@ -83,9 +83,9 @@ namespace ASC.Core.Billing
return payments;
}
public IDictionary<string, Tuple<Uri, Uri>> GetPaymentUrls(string portalId, string[] products, string affiliateId = null, string campaign = null, string currency = null, string language = null, string customerId = null, string quantity = null)
public IDictionary<string, Uri> GetPaymentUrls(string portalId, string[] products, string affiliateId = null, string campaign = null, string currency = null, string language = null, string customerId = null, string quantity = null)
{
var urls = new Dictionary<string, Tuple<Uri, Uri>>();
var urls = new Dictionary<string, Uri>();
var additionalParameters = new List<Tuple<string, string>>() { Tuple.Create("PaymentSystemId", AvangatePaymentSystemId.ToString()) };
if (!string.IsNullOrEmpty(affiliateId))
@ -123,40 +123,59 @@ namespace ASC.Core.Billing
var result = Request("GetPaymentUrl", portalId, parameters);
var paymentUrls = JsonConvert.DeserializeObject<Dictionary<string, string>>(result);
var upgradeUrls = new Dictionary<string, string>();
if (!string.IsNullOrEmpty(portalId)
//TODO: remove
&& false)
{
try
{
//max 100 products
result = Request("GetPaymentUpgradeUrl", portalId, parameters);
upgradeUrls = JsonConvert.DeserializeObject<Dictionary<string, string>>(result);
}
catch (BillingNotFoundException)
{
}
}
foreach (var p in products)
{
string url;
var paymentUrl = (Uri)null;
var upgradeUrl = (Uri)null;
if (paymentUrls.TryGetValue(p, out url) && !string.IsNullOrEmpty(url = ToUrl(url)))
{
paymentUrl = new Uri(url);
}
if (upgradeUrls.TryGetValue(p, out url) && !string.IsNullOrEmpty(url = ToUrl(url)))
{
upgradeUrl = new Uri(url);
}
urls[p] = Tuple.Create(paymentUrl, upgradeUrl);
urls[p] = paymentUrl;
}
return urls;
}
public string GetPaymentUrl(string portalId, string[] products, string affiliateId = null, string campaign = null, string currency = null, string language = null, string customerId = null, string quantity = null)
{
var additionalParameters = new List<Tuple<string, string>>() { Tuple.Create("PaymentSystemId", AvangatePaymentSystemId.ToString()) };
if (!string.IsNullOrEmpty(affiliateId))
{
additionalParameters.Add(Tuple.Create("AffiliateId", affiliateId));
}
if (!string.IsNullOrEmpty(campaign))
{
additionalParameters.Add(Tuple.Create("campaign", campaign));
}
if (!string.IsNullOrEmpty(currency))
{
additionalParameters.Add(Tuple.Create("Currency", currency));
}
if (!string.IsNullOrEmpty(language))
{
additionalParameters.Add(Tuple.Create("Language", language));
}
if (!string.IsNullOrEmpty(customerId))
{
additionalParameters.Add(Tuple.Create("CustomerID", customerId));
}
if (!string.IsNullOrEmpty(quantity))
{
additionalParameters.Add(Tuple.Create("Quantity", quantity));
}
var parameters = products
.Distinct()
.Select(p => Tuple.Create("ProductId", p))
.Concat(additionalParameters)
.ToArray();
var result = Request("GetSinglePaymentUrl", portalId, parameters);
var paymentUrl = JsonConvert.DeserializeObject<string>(result);
return paymentUrl;
}
public IDictionary<string, Dictionary<string, decimal>> GetProductPriceInfo(params string[] productIds)
{
if (productIds == null)

View File

@ -1,321 +0,0 @@
/*
*
* (c) Copyright Ascensio System Limited 2010-2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using ASC.Common.Logging;
using Newtonsoft.Json;
namespace ASC.Core.Common.Billing
{
public class CouponManager
{
private static IEnumerable<AvangateProduct> Products { get; set; }
private static IEnumerable<string> Groups { get; set; }
private static readonly int Percent;
private static readonly int Schedule;
private static readonly string VendorCode;
private static readonly byte[] Secret;
private static readonly Uri BaseAddress;
private static readonly string ApiVersion;
private static readonly SemaphoreSlim SemaphoreSlim = new SemaphoreSlim(1, 1);
private static readonly ILog Log;
static CouponManager()
{
SemaphoreSlim = new SemaphoreSlim(1, 1);
Log = LogManager.GetLogger("ASC");
try
{
var cfg = (AvangateCfgSectionHandler)ConfigurationManagerExtension.GetSection("avangate");
Secret = Encoding.UTF8.GetBytes(cfg.Secret);
VendorCode = cfg.Vendor;
Percent = cfg.Percent;
Schedule = cfg.Schedule;
BaseAddress = new Uri(cfg.BaseAddress);
ApiVersion = "/rest/" + cfg.ApiVersion.TrimStart('/');
Groups = (cfg.Groups ?? "").Split(',', '|', ' ');
}
catch (Exception e)
{
Secret = Encoding.UTF8.GetBytes("");
VendorCode = "";
Percent = AvangateCfgSectionHandler.DefaultPercent;
Schedule = AvangateCfgSectionHandler.DefaultShedule;
BaseAddress = new Uri(AvangateCfgSectionHandler.DefaultAdress);
ApiVersion = AvangateCfgSectionHandler.DefaultApiVersion;
Groups = new List<string>();
Log.Fatal(e);
}
}
public static string CreateCoupon()
{
return CreatePromotionAsync().Result;
}
private static async Task<string> CreatePromotionAsync()
{
try
{
using (var httpClient = PrepaireClient())
using (var content = new StringContent(await Promotion.GeneratePromotion(Percent, Schedule), Encoding.Default, "application/json"))
using (var response = await httpClient.PostAsync(string.Format("{0}/promotions/", ApiVersion), content))
{
if (!response.IsSuccessStatusCode)
throw new HttpException((int)response.StatusCode, response.ReasonPhrase);
var result = await response.Content.ReadAsStringAsync();
await Task.Delay(1000 - DateTime.UtcNow.Millisecond); // otherwise authorize exception
var createdPromotion = JsonConvert.DeserializeObject<Promotion>(result);
return createdPromotion.Coupon.Code;
}
}
catch (Exception ex)
{
Log.Error(ex.Message, ex);
throw;
}
}
internal static async Task<IEnumerable<AvangateProduct>> GetProducts()
{
if (Products != null) return Products;
await SemaphoreSlim.WaitAsync();
if (Products != null)
{
SemaphoreSlim.Release();
return Products;
}
try
{
using (var httpClient = PrepaireClient())
using (var response = await httpClient.GetAsync(string.Format("{0}/products/?Limit=1000&Enabled=true", ApiVersion)))
{
if (!response.IsSuccessStatusCode)
throw new HttpException((int)response.StatusCode, response.ReasonPhrase);
var result = await response.Content.ReadAsStringAsync();
Log.Debug(result);
var products = JsonConvert.DeserializeObject<List<AvangateProduct>>(result);
products = products.Where(r => r.ProductGroup != null && Groups.Contains(r.ProductGroup.Code)).ToList();
return Products = products;
}
}
catch (Exception ex)
{
Log.Error(ex.Message, ex);
throw;
}
finally
{
SemaphoreSlim.Release();
}
}
private static HttpClient PrepaireClient()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
const string applicationJson = "application/json";
var httpClient = new HttpClient { BaseAddress = BaseAddress, Timeout = TimeSpan.FromMinutes(3) };
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", applicationJson);
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", applicationJson);
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("X-Avangate-Authentication", CreateAuthHeader());
return httpClient;
}
private static string CreateAuthHeader()
{
using (var hmac = new HMACMD5(Secret))
{
var date = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss");
var hash = VendorCode.Length + VendorCode + date.Length + date;
var data = hmac.ComputeHash(Encoding.UTF8.GetBytes(hash));
var sBuilder = new StringBuilder();
foreach (var t in data)
{
sBuilder.Append(t.ToString("x2"));
}
var stringBuilder = new StringBuilder();
stringBuilder.AppendFormat("code='{0}' ", VendorCode);
stringBuilder.AppendFormat("date='{0}' ", date);
stringBuilder.AppendFormat("hash='{0}'", sBuilder);
return stringBuilder.ToString();
}
}
}
class Promotion
{
public string Code { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public string StartDate { get; set; }
public string EndDate { get; set; }
public bool Enabled { get; set; }
public int MaximumOrdersNumber { get; set; }
public bool InstantDiscount { get; set; }
public string ChannelType { get; set; }
public string ApplyRecurring { get; set; }
public Coupon Coupon { get; set; }
public Discount Discount { get; set; }
public IEnumerable<CouponProduct> Products { get; set; }
public int PublishToAffiliatesNetwork { get; set; }
public int AutoApply { get; set; }
public static async Task<string> GeneratePromotion(int percent, int schedule)
{
try
{
var tenant = CoreContext.TenantManager.GetCurrentTenant();
var startDate = DateTime.UtcNow.Date;
var endDate = startDate.AddDays(schedule);
var code = tenant.TenantAlias;
var promotion = new Promotion
{
Type = "REGULAR",
Enabled = true,
MaximumOrdersNumber = 1,
InstantDiscount = false,
ChannelType = "ECOMMERCE",
ApplyRecurring = "NONE",
PublishToAffiliatesNetwork = 0,
AutoApply = 0,
StartDate = startDate.ToString("yyyy-MM-dd"),
EndDate = endDate.ToString("yyyy-MM-dd"),
Name = string.Format("{0} {1}% off", code, percent),
Coupon = new Coupon { Type = "SINGLE", Code = code },
Discount = new Discount { Type = "PERCENT", Value = percent },
Products = (await CouponManager.GetProducts()).Select(r => new CouponProduct { Code = r.ProductCode })
};
return JsonConvert.SerializeObject(promotion);
}
catch (Exception ex)
{
LogManager.GetLogger("ASC").Error(ex.Message, ex);
throw;
}
}
}
class Coupon
{
public string Type { get; set; }
public string Code { get; set; }
}
class Discount
{
public string Type { get; set; }
public int Value { get; set; }
}
class AvangateProduct
{
public string ProductCode { get; set; }
public string ProductName { get; set; }
public AvangateProductGroup ProductGroup { get; set; }
}
class AvangateProductGroup
{
public string Name { get; set; }
public string Code { get; set; }
}
class CouponProduct
{
public string Code { get; set; }
}
class AvangateCfgSectionHandler : ConfigurationSection
{
public const string DefaultAdress = "https://api.avangate.com/";
public const string DefaultApiVersion = "4.0";
public const int DefaultPercent = 5;
public const int DefaultShedule = 10;
[ConfigurationProperty("secret")]
public string Secret
{
get { return (string)this["secret"]; }
}
[ConfigurationProperty("vendor")]
public string Vendor
{
get { return (string)this["vendor"]; }
set { this["vendor"] = value; }
}
[ConfigurationProperty("percent", DefaultValue = DefaultPercent)]
public int Percent
{
get { return Convert.ToInt32(this["percent"]); }
set { this["percent"] = value; }
}
[ConfigurationProperty("schedule", DefaultValue = DefaultShedule)]
public int Schedule
{
get { return Convert.ToInt32(this["schedule"]); }
set { this["schedule"] = value; }
}
[ConfigurationProperty("groups")]
public string Groups
{
get { return (string)this["groups"]; }
}
[ConfigurationProperty("address", DefaultValue = DefaultAdress)]
public string BaseAddress
{
get { return (string)this["address"]; }
set { this["address"] = value; }
}
[ConfigurationProperty("apiVersion", DefaultValue = DefaultApiVersion)]
public string ApiVersion
{
get { return (string)this["apiVersion"]; }
set { this["apiVersion"] = value; }
}
}
}

View File

@ -34,6 +34,8 @@ namespace ASC.Core.Billing
Uri GetShoppingUri(int? tenant, int quotaId, string affiliateId, string currency = null, string language = null, string customerId = null, string quantity = null);
Uri GetShoppingUri(string[] productIds, string affiliateId = null, string currency = null, string language = null, string customerId = null, string quantity = null);
IDictionary<string, Dictionary<string, decimal>> GetProductPriceInfo(params string[] productIds);
string GetButton(int tariffId, string partnerId);

View File

@ -31,42 +31,18 @@ namespace ASC.Core.Billing
public string OriginalLicense { get; set; }
[DataMember(Name = "affiliate_id")]
public string AffiliateId { get; set; }
[DataMember(Name = "whitelabel")]
public bool WhiteLabel { get; set; }
[DataMember(Name = "customization")]
public bool Customization { get; set; }
[DataMember(Name = "branding")]
public bool Branding { get; set; }
[DataMember(Name = "ssbranding")]
public bool SSBranding { get; set; }
[DataMember(Name = "end_date")]
public DateTime DueDate { get; set; }
[DataMember(Name = "portal_count")]
public int PortalCount { get; set; }
[DataMember(Name = "trial")]
public bool Trial { get; set; }
[DataMember(Name = "user_quota")]
public int ActiveUsers { get; set; }
[DataMember(Name = "customer_id")]
public string CustomerId { get; set; }
[DataMember(Name = "signature")]
public string Signature { get; set; }
[DataMember(Name = "discencryption")]
public bool? DiscEncryption { get; set; }
[DataMember(Name = "users_count")]
public int DSUsersCount { get; set; }
@ -76,6 +52,9 @@ namespace ASC.Core.Billing
[DataMember(Name = "connections")]
public int DSConnections { get; set; }
[DataMember(Name = "signature")]
public string Signature { get; set; }
public static License Parse(string licenseString)
{

View File

@ -18,7 +18,6 @@
using System;
using System.Configuration;
using System.IO;
using System.Linq;
using ASC.Common.Logging;
using ASC.Core.Tenants;
@ -33,7 +32,6 @@ namespace ASC.Core.Billing
private static readonly string LicensePathTemp;
public const string CustomerIdKey = "CustomerId";
public const int MaxUserCount = 10000;
static LicenseReader()
@ -159,29 +157,6 @@ namespace ASC.Core.Billing
throw new BillingNotConfiguredException("License not correct", license.OriginalLicense);
}
if (license.DueDate.Date < VersionReleaseDate)
{
throw new LicenseExpiredException("License expired", license.OriginalLicense);
}
if (license.ActiveUsers.Equals(default(int)) || license.ActiveUsers < 1)
license.ActiveUsers = MaxUserCount;
if (license.ActiveUsers < CoreContext.UserManager.GetUsers(EmployeeStatus.Default, EmployeeType.User).Length)
{
throw new LicenseQuotaException("License quota", license.OriginalLicense);
}
if (license.PortalCount <= 0)
{
license.PortalCount = CoreContext.TenantManager.GetTenantQuota(Tenant.DEFAULT_TENANT).CountPortals;
}
var activePortals = CoreContext.TenantManager.GetTenants().Count();
if (activePortals > 1 && license.PortalCount < activePortals)
{
throw new LicensePortalException("License portal count", license.OriginalLicense);
}
return license.DueDate.Date;
}
@ -195,40 +170,16 @@ namespace ASC.Core.Billing
var quota = new TenantQuota(-1000)
{
ActiveUsers = license.ActiveUsers,
ActiveUsers = Constants.MaxEveryoneCount,
MaxFileSize = defaultQuota.MaxFileSize,
MaxTotalSize = defaultQuota.MaxTotalSize,
Name = "license",
DocsEdition = true,
HasDomain = true,
Audit = true,
ControlPanel = true,
HealthCheck = true,
Ldap = true,
Sso = true,
Customization = license.Customization,
WhiteLabel = license.WhiteLabel || license.Customization,
Branding = license.Branding,
SSBranding = license.SSBranding,
Update = true,
Support = true,
Trial = license.Trial,
CountPortals = license.PortalCount,
DiscEncryption = true,
PrivacyRoom = true,
Restore = true,
ContentSearch = true
};
if (defaultQuota.Name != "overdue" && !defaultQuota.Trial)
{
quota.WhiteLabel |= defaultQuota.WhiteLabel;
quota.Branding |= defaultQuota.Branding;
quota.SSBranding |= defaultQuota.SSBranding;
quota.CountPortals = Math.Max(defaultQuota.CountPortals, quota.CountPortals);
}
CoreContext.TenantManager.SaveTenantQuota(quota);
var tariff = new Tariff
@ -238,13 +189,6 @@ namespace ASC.Core.Billing
};
CoreContext.PaymentManager.SetTariff(-1, tariff);
if (!string.IsNullOrEmpty(license.AffiliateId))
{
var tenant = CoreContext.TenantManager.GetCurrentTenant();
tenant.AffiliateId = license.AffiliateId;
CoreContext.TenantManager.SaveTenant(tenant);
}
}
private static void LogError(Exception error)
@ -265,63 +209,5 @@ namespace ASC.Core.Billing
}
}
}
private static readonly DateTime _date = DateTime.MinValue;
public static DateTime VersionReleaseDate
{
get
{
// release sign is not longer requered
return _date;
/*
if (_date != DateTime.MinValue) return _date;
_date = DateTime.MaxValue;
try
{
var versionDate = ConfigurationManagerExtension.AppSettings["version.release-date"];
var sign = ConfigurationManagerExtension.AppSettings["version.release-date.sign"];
if (!sign.StartsWith("ASC "))
{
throw new Exception("sign without ASC");
}
var splitted = sign.Substring(4).Split(':');
var pkey = splitted[0];
if (pkey != versionDate)
{
throw new Exception("sign with different date");
}
var date = splitted[1];
var orighash = splitted[2];
var skey = MachinePseudoKeys.GetMachineConstant();
using (var hasher = new HMACSHA1(skey))
{
var data = string.Join("\n", date, pkey);
var hash = hasher.ComputeHash(Encoding.UTF8.GetBytes(data));
if (HttpServerUtility.UrlTokenEncode(hash) != orighash && Convert.ToBase64String(hash) != orighash)
{
throw new Exception("incorrect hash");
}
}
var year = Int32.Parse(versionDate.Substring(0, 4));
var month = Int32.Parse(versionDate.Substring(4, 2));
var day = Int32.Parse(versionDate.Substring(6, 2));
_date = new DateTime(year, month, day);
}
catch (Exception ex)
{
LogManager.GetLogger("ASC").Error("VersionReleaseDate", ex);
}
return _date;*/
}
}
}
}

View File

@ -40,6 +40,8 @@ namespace ASC.Core.Billing
public Decimal Price { get; set; }
public int Qty { get; set; }
public string PaymentCurrency { get; set; }
public string PaymentMethod { get; set; }

View File

@ -143,6 +143,28 @@ namespace ASC.Core.Billing
}
catch (BillingNotFoundException)
{
var q = quotaService.GetTenantQuota(tariff.QuotaId);
if (q != null
&& !q.Trial
&& !q.Free
&& !q.NonProfit
&& !q.Open
&& !q.Custom)
{
var asynctariff = Tariff.CreateDefault();
asynctariff.DueDate = DateTime.Today.AddDays(-1);
asynctariff.Prolongable = false;
asynctariff.Autorenewal = false;
asynctariff.State = TariffState.NotPaid;
if (SaveBillingInfo(tenantId, asynctariff))
{
asynctariff = CalculateTariff(tenantId, asynctariff);
ClearCache(tenantId);
cache.Insert(key, asynctariff, DateTime.UtcNow.Add(GetCacheExpiration()));
}
}
}
catch (Exception error)
{
@ -246,10 +268,10 @@ namespace ASC.Core.Billing
? GetBillingUrlCacheKey(tenant.Value)
: String.Format("notenant{0}", !string.IsNullOrEmpty(affiliateId) ? "_" + affiliateId : "");
key += quota.Visible ? "" : "0";
var urls = cache.Get<Dictionary<string, Tuple<Uri, Uri>>>(key) as IDictionary<string, Tuple<Uri, Uri>>;
var urls = cache.Get<Dictionary<string, Uri>>(key) as IDictionary<string, Uri>;
if (urls == null)
{
urls = new Dictionary<string, Tuple<Uri, Uri>>();
urls = new Dictionary<string, Uri>();
if (BillingClient.Configured)
{
try
@ -282,36 +304,66 @@ namespace ASC.Core.Billing
ResetCacheExpiration();
Tuple<Uri, Uri> tuple;
if (!string.IsNullOrEmpty(quota.AvangateId) && urls.TryGetValue(quota.AvangateId, out tuple))
Uri url;
if (!string.IsNullOrEmpty(quota.AvangateId) && urls.TryGetValue(quota.AvangateId, out url))
{
var result = tuple.Item2;
if (url == null) return null;
if (result == null)
{
result = tuple.Item1;
}
else
{
var tariff = tenant.HasValue ? GetTariff(tenant.Value) : null;
if (tariff == null || tariff.QuotaId == quotaId || tariff.State >= TariffState.Delay)
{
result = tuple.Item1;
}
}
if (result == null) return null;
result = new Uri(result.ToString()
url = new Uri(url.ToString()
.Replace("__Currency__", HttpUtility.UrlEncode(currency ?? ""))
.Replace("__Language__", HttpUtility.UrlEncode((language ?? "").ToLower()))
.Replace("__CustomerID__", HttpUtility.UrlEncode(customerId ?? ""))
.Replace("__Quantity__", HttpUtility.UrlEncode(quantity ?? "")));
return result;
return url;
}
return null;
}
public Uri GetShoppingUri(string[] productIds, string affiliateId = null, string currency = null, string language = null, string customerId = null, string quantity = null)
{
var key = "shopingurl" + string.Join("_", productIds) + (!string.IsNullOrEmpty(affiliateId) ? "_" + affiliateId : "");
var url = cache.Get<string>(key);
if (url == null)
{
url = string.Empty;
if (BillingClient.Configured)
{
try
{
var client = GetBillingClient();
url =
client.GetPaymentUrl(
null,
productIds,
affiliateId,
null,
!string.IsNullOrEmpty(currency) ? "__Currency__" : null,
!string.IsNullOrEmpty(language) ? "__Language__" : null,
!string.IsNullOrEmpty(customerId) ? "__CustomerID__" : null,
!string.IsNullOrEmpty(quantity) ? "__Quantity__" : null
);
}
catch (Exception error)
{
log.Error(error);
}
}
cache.Insert(key, url, DateTime.UtcNow.Add(TimeSpan.FromMinutes(10)));
}
ResetCacheExpiration();
if (string.IsNullOrEmpty(url)) return null;
var result = new Uri(url.ToString()
.Replace("__Currency__", HttpUtility.UrlEncode(currency ?? ""))
.Replace("__Language__", HttpUtility.UrlEncode((language ?? "").ToLower()))
.Replace("__CustomerID__", HttpUtility.UrlEncode(customerId ?? ""))
.Replace("__Quantity__", HttpUtility.UrlEncode(quantity ?? "")));
return result;
}
public IDictionary<string, Dictionary<string, decimal>> GetProductPriceInfo(params string[] productIds)
{
if (productIds == null)
@ -496,7 +548,6 @@ namespace ASC.Core.Billing
defaultQuota.Name = "overdue";
defaultQuota.Features = q.Features;
defaultQuota.Support = false;
quotaService.SaveTenantQuota(defaultQuota);
}

View File

@ -28,10 +28,8 @@ namespace ASC.Core.Caching
private readonly ICache cache;
private readonly ICacheNotify cacheNotify;
public TimeSpan CacheExpiration { get; set; }
public CachedAzService(IAzService service)
{
if (service == null) throw new ArgumentNullException("service");
@ -41,7 +39,7 @@ namespace ASC.Core.Caching
CacheExpiration = TimeSpan.FromMinutes(10);
cacheNotify = AscCache.Notify;
cacheNotify.Subscribe<AzRecord>((r, a) => UpdateCache(r.Tenant, r, a == CacheNotifyAction.Remove));
cacheNotify.Subscribe<AzRecordCache>((r, a) => UpdateCache(r.Tenant, r, a == CacheNotifyAction.Remove));
}
@ -60,14 +58,14 @@ namespace ASC.Core.Caching
public AzRecord SaveAce(int tenant, AzRecord r)
{
r = service.SaveAce(tenant, r);
cacheNotify.Publish(r, CacheNotifyAction.InsertOrUpdate);
cacheNotify.Publish((AzRecordCache)r, CacheNotifyAction.InsertOrUpdate);
return r;
}
public void RemoveAce(int tenant, AzRecord r)
{
service.RemoveAce(tenant, r);
cacheNotify.Publish(r, CacheNotifyAction.Remove);
cacheNotify.Publish((AzRecordCache)r, CacheNotifyAction.Remove);
}

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