Skip to content

Commit

Permalink
Merge pull request #485 from ONLYOFFICE/release/v1.1.0
Browse files Browse the repository at this point in the history
Release/v1.1.0
  • Loading branch information
AlexeySafronov authored Dec 27, 2021
2 parents 366db9d + dc3c7b5 commit 14783ee
Show file tree
Hide file tree
Showing 2,183 changed files with 36,042 additions and 8,522 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ Logs/
.eslintcache
build/deploy/
/public/debuginfo.md
TestsResults/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = products/ASC.Files/Server/DocStore
url = https://github.com/ONLYOFFICE/document-templates
branch = main/community-server
[submodule "common/Tests/Frontend.Translations.Tests/dictionaries"]
path = common/Tests/Frontend.Translations.Tests/dictionaries
url = https://github.com/ONLYOFFICE/dictionaries
11 changes: 11 additions & 0 deletions build/install/OneClickInstall/install-Debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ while [ "$1" != "" ]; do
fi
;;

-skiphc | --skiphardwarecheck )
if [ "$2" != "" ]; then
SKIP_HARDWARE_CHECK=$2
shift
fi
;;

-? | -h | --help )
echo " Usage $0 [PARAMETER] [[PARAMETER], ...]"
echo " Parameters:"
Expand All @@ -60,6 +67,10 @@ if [ -z "${LOCAL_SCRIPTS}" ]; then
LOCAL_SCRIPTS="false";
fi

if [ -z "${SKIP_HARDWARE_CHECK}" ]; then
SKIP_HARDWARE_CHECK="false";
fi

if [ $(dpkg-query -W -f='${Status}' curl 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
apt-get update;
apt-get install -yq curl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ if [ "$(ls -A "$PRODUCT_DIR/services/kafka" 2> /dev/null)" == "" ]; then
adduser --quiet --home ${PRODUCT_DIR}/services/kafka --system kafka
fi
cd ${PRODUCT_DIR}/services/kafka
curl https://downloads.apache.org/kafka/2.7.1/kafka_2.13-2.7.1.tgz -O
curl https://downloads.apache.org/kafka/2.7.2/kafka_2.13-2.7.2.tgz -O
tar xzf kafka_*.tgz --strip 1 && rm -rf kafka_*.tgz
chown -R kafka ${PRODUCT_DIR}/services/kafka
cd -
Expand Down
31 changes: 31 additions & 0 deletions build/install/OneClickInstall/install-Debian/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,37 @@ command_exists () {
type "$1" &> /dev/null;
}

check_hardware () {
DISK_REQUIREMENTS=40960;
MEMORY_REQUIREMENTS=5500;
CORE_REQUIREMENTS=2;

AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');

if [ ${AVAILABLE_DISK_SPACE} -lt ${DISK_REQUIREMENTS} ]; then
echo "Minimal requirements are not met: need at least $DISK_REQUIREMENTS MB of free HDD space"
exit 1;
fi

TOTAL_MEMORY=$(free -m | grep -oP '\d+' | head -n 1);

if [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ]; then
echo "Minimal requirements are not met: need at least $MEMORY_REQUIREMENTS MB of RAM"
exit 1;
fi

CPU_CORES_NUMBER=$(cat /proc/cpuinfo | grep processor | wc -l);

if [ ${CPU_CORES_NUMBER} -lt ${CORE_REQUIREMENTS} ]; then
echo "The system does not meet the minimal hardware requirements. CPU with at least $CORE_REQUIREMENTS cores is required"
exit 1;
fi
}

if [ "$SKIP_HARDWARE_CHECK" != "true" ]; then
check_hardware
fi

ARCH="$(dpkg --print-architecture)"
if [ "$ARCH" != "amd64" ]; then
echo "ONLYOFFICE ${product^^} doesn't support architecture '$ARCH'"
Expand Down
13 changes: 13 additions & 0 deletions build/install/OneClickInstall/install-RedHat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ while [ "$1" != "" ]; do
fi
;;

-skiphc | --skiphardwarecheck )
if [ "$2" != "" ]; then
SKIP_HARDWARE_CHECK=$2
shift
fi
;;

-? | -h | --help )
echo " Usage $0 [PARAMETER] [[PARAMETER], ...]"
echo " Parameters:"
Expand All @@ -69,6 +76,10 @@ if [ -z "${LOCAL_SCRIPTS}" ]; then
LOCAL_SCRIPTS="false";
fi

if [ -z "${SKIP_HARDWARE_CHECK}" ]; then
SKIP_HARDWARE_CHECK="false";
fi

cat > /etc/yum.repos.d/onlyoffice.repo <<END
[onlyoffice]
name=onlyoffice repo
Expand All @@ -91,11 +102,13 @@ END
DOWNLOAD_URL_PREFIX="https://raw.githubusercontent.com/ONLYOFFICE/${product}/${GIT_BRANCH}/build/install/OneClickInstall/install-RedHat"

if [ "$LOCAL_SCRIPTS" = "true" ]; then
source install-RedHat/tools.sh
source install-RedHat/bootstrap.sh
source install-RedHat/check-ports.sh
source install-RedHat/install-preq.sh
source install-RedHat/install-app.sh
else
source <(curl ${DOWNLOAD_URL_PREFIX}/tools.sh)
source <(curl ${DOWNLOAD_URL_PREFIX}/bootstrap.sh)
source <(curl ${DOWNLOAD_URL_PREFIX}/check-ports.sh)
source <(curl ${DOWNLOAD_URL_PREFIX}/install-preq.sh)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if [ "$(ls -A "$PRODUCT_DIR/services/kafka" 2> /dev/null)" == "" ]; then
mkdir -p ${PRODUCT_DIR}/services/
getent passwd kafka >/dev/null || useradd -m -d ${PRODUCT_DIR}/services/kafka -s /sbin/nologin -p kafka kafka
cd ${PRODUCT_DIR}/services/kafka
curl https://downloads.apache.org/kafka/2.7.1/kafka_2.13-2.7.1.tgz -O
curl https://downloads.apache.org/kafka/2.7.2/kafka_2.13-2.7.2.tgz -O
tar xzf kafka_*.tgz --strip 1 && rm -rf kafka_*.tgz
chown -R kafka ${PRODUCT_DIR}/services/kafka
cd -
Expand Down
34 changes: 34 additions & 0 deletions build/install/OneClickInstall/install-RedHat/tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

set -e

check_hardware () {
DISK_REQUIREMENTS=40960;
MEMORY_REQUIREMENTS=5500;
CORE_REQUIREMENTS=2;

AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');

if [ ${AVAILABLE_DISK_SPACE} -lt ${DISK_REQUIREMENTS} ]; then
echo "Minimal requirements are not met: need at least $DISK_REQUIREMENTS MB of free HDD space"
exit 1;
fi

TOTAL_MEMORY=$(free -m | grep -oP '\d+' | head -n 1);

if [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ]; then
echo "Minimal requirements are not met: need at least $MEMORY_REQUIREMENTS MB of RAM"
exit 1;
fi

CPU_CORES_NUMBER=$(cat /proc/cpuinfo | grep processor | wc -l);

if [ ${CPU_CORES_NUMBER} -lt ${CORE_REQUIREMENTS} ]; then
echo "The system does not meet the minimal hardware requirements. CPU with at least $CORE_REQUIREMENTS cores is required"
exit 1;
fi
}

if [ "$SKIP_HARDWARE_CHECK" != "true" ]; then
check_hardware
fi
71 changes: 71 additions & 0 deletions build/run.e2e.test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@echo off

PUSHD %~dp0
call runasadmin.bat "%~dpnx0"

if %errorlevel% == 0 (
PUSHD %~dp0..


echo "mode="


REM call yarn wipe
call yarn install

REM call yarn build
call yarn build:test

REM call yarn wipe
call yarn deploy


REM copy nginx configurations to deploy folder
xcopy config\nginx\onlyoffice.conf build\deploy\nginx\ /E /R /Y
powershell -Command "(gc build\deploy\nginx\onlyoffice.conf) -replace '#', '' | Out-File -encoding ASCII build\deploy\nginx\onlyoffice.conf"

xcopy config\nginx\sites-enabled\* build\deploy\nginx\sites-enabled\ /E /R /Y

REM fix paths
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-calendar.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Calendar\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-calendar.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-crm.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.CRM\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-crm.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-editor.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Files\editor' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-editor.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-files.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Files\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-files.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-login.conf) -replace 'ROOTPATH', '%~dp0deploy\studio\login' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-login.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-mail.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Mail\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-mail.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-people.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.People\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-people.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-projects.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Projects\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-projects.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-studio.conf) -replace 'ROOTPATH', '%~dp0deploy\studio\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-studio.conf"

REM restart nginx
echo service nginx stop
call sc stop nginx > nul

REM sleep 5 seconds
call ping 127.0.0.1 -n 6 > nul

echo service nginx start
call sc start nginx > nul

REM sleep 5 seconds
call ping 127.0.0.1 -n 6 > nul


choice /t 10 /d Y /m "Do you want to start tests in sequential mode?"
if errorlevel 2 call yarn e2e.test
if errorlevel 1 call yarn e2e.test:sequential


if NOT %errorlevel% == 0 (
echo Couldn't restarte Onlyoffice%%~nf service
)

)

echo.

POPD

if "%1"=="nopause" goto start
pause
:start
71 changes: 71 additions & 0 deletions build/run.e2e.translations.tests.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@echo off

PUSHD %~dp0
call runasadmin.bat "%~dpnx0"

if %errorlevel% == 0 (
PUSHD %~dp0..


echo "mode="


REM call yarn wipe
call yarn install

REM call yarn build
call yarn build:test.translation

REM call yarn wipe
call yarn deploy


REM copy nginx configurations to deploy folder
xcopy config\nginx\onlyoffice.conf build\deploy\nginx\ /E /R /Y
powershell -Command "(gc build\deploy\nginx\onlyoffice.conf) -replace '#', '' | Out-File -encoding ASCII build\deploy\nginx\onlyoffice.conf"

xcopy config\nginx\sites-enabled\* build\deploy\nginx\sites-enabled\ /E /R /Y

REM fix paths
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-calendar.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Calendar\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-calendar.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-crm.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.CRM\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-crm.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-editor.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Files\editor' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-editor.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-files.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Files\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-files.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-login.conf) -replace 'ROOTPATH', '%~dp0deploy\studio\login' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-login.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-mail.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Mail\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-mail.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-people.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.People\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-people.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-projects.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Projects\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-projects.conf"
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-studio.conf) -replace 'ROOTPATH', '%~dp0deploy\studio\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-studio.conf"

REM restart nginx
echo service nginx stop
call sc stop nginx > nul

REM sleep 5 seconds
call ping 127.0.0.1 -n 6 > nul

echo service nginx start
call sc start nginx > nul

REM sleep 5 seconds
call ping 127.0.0.1 -n 6 > nul

call yarn e2e.test:translation

exit



if NOT %errorlevel% == 0 (
echo Couldn't restarte Onlyoffice%%~nf service
)

)

echo.

POPD

if "%1"=="nopause" goto start
pause
:start
2 changes: 2 additions & 0 deletions build/run.translations.spellcheck.test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PUSHD %~dp0..
dotnet test common\Tests\Frontend.Translations.Tests\Frontend.Translations.Tests.csproj --filter Name~SpellCheckTest -l:html -r TestsResults
2 changes: 2 additions & 0 deletions build/run.translations.tests.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PUSHD %~dp0..
dotnet test common\Tests\Frontend.Translations.Tests\Frontend.Translations.Tests.csproj --filter "TestCategory=FastRunning" -l:html -r TestsResults
11 changes: 8 additions & 3 deletions common/ASC.Common/Web/MimeMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ static MimeMapping()
AddMimeMapping(".doc", "application/msword");
AddMimeMapping(".docm", "application/vnd.ms-word.document.macroEnabled.12");
AddMimeMapping(".doct", "application/doct");
AddMimeMapping(".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
AddMimeMapping(".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
AddMimeMapping(".docxf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
AddMimeMapping(".docxf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf");
AddMimeMapping(".dot", "application/msword");
AddMimeMapping(".dotm", "application/vnd.ms-word.template.macroEnabled.12");
AddMimeMapping(".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template");
Expand Down Expand Up @@ -429,7 +431,9 @@ static MimeMapping()
AddMimeMapping(".oda", "application/oda");
AddMimeMapping(".odp", "application/vnd.oasis.opendocument.presentation");
AddMimeMapping(".ods", "application/vnd.oasis.opendocument.spreadsheet");
AddMimeMapping(".odt", "application/vnd.oasis.opendocument.text");
AddMimeMapping(".odt", "application/vnd.oasis.opendocument.text");
AddMimeMapping(".oform", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
AddMimeMapping(".oform", "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform");
AddMimeMapping(".oga", "audio/ogg");
AddMimeMapping(".ogg", "video/ogg");
AddMimeMapping(".ogg", "audio/ogg");
Expand Down Expand Up @@ -710,7 +714,8 @@ static MimeMapping()
AddMimeMapping(".wml", "text/vnd.wap.wml");
AddMimeMapping(".wmlc", "application/vnd.wap.wmlc");
AddMimeMapping(".wmls", "text/vnd.wap.wmlscript");
AddMimeMapping(".wmlsc", "application/vnd.wap.wmlscriptc");
AddMimeMapping(".wmlsc", "application/vnd.wap.wmlscriptc");
AddMimeMapping(".woff2", "application/font-woff2");
AddMimeMapping(".word", "application/msword");
AddMimeMapping(".wp", "application/wordperfect");
AddMimeMapping(".wp5", "application/wordperfect");
Expand Down
11 changes: 10 additions & 1 deletion common/ASC.Core.Common/Billing/License/License.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,16 @@ public class License

public string Signature { get; set; }

public bool? DiscEncryption { get; set; }
public bool? DiscEncryption { get; set; }

[JsonPropertyName("users_count")]
public int DSUsersCount { get; set; }

[JsonPropertyName("users_expire")]
public int DSUsersExpire { get; set; }

[JsonPropertyName("connections")]
public int DSConnections { get; set; }

public static License Parse(string licenseString)
{
Expand Down
6 changes: 5 additions & 1 deletion common/ASC.Core.Common/Caching/CachedTenantService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@ public IEnumerable<Tenant> GetTenants(string login, string passwordHash)
public IEnumerable<Tenant> GetTenants(DateTime from, bool active = true)
{
return Service.GetTenants(from, active);
}
}
public IEnumerable<Tenant> GetTenants(List<int> ids)
{
return Service.GetTenants(ids);
}

public Tenant GetTenant(int id)
{
Expand Down
Loading

0 comments on commit 14783ee

Please sign in to comment.