From 126ab097e9366b36b61bcf74788f180ea131efde Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 8 Nov 2022 10:35:51 +0300 Subject: [PATCH 01/12] Web: Removed the ability to invite users according to access rights. --- .../Home/InfoPanel/Body/views/Members/User.js | 8 +--- .../InfoPanel/Body/views/Members/index.js | 45 ++++++++++++------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js b/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js index 0ff7bc60f2..b6f26529af 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/views/Members/User.js @@ -12,7 +12,7 @@ const User = ({ membersHelper, currentMember, updateRoomMemberRole, - + currCanEditUsers, selectionParentRoom, setSelectionParentRoom, }) => { @@ -22,12 +22,6 @@ const User = ({ const [userIsRemoved, setUserIsRemoved] = useState(false); if (userIsRemoved) return null; - const currCanEditUsers = - currentMember.isOwner || - currentMember.isAdmin || - currentMember?.access === ShareAccessRights.FullAccess || - currentMember?.access === ShareAccessRights.RoomManager; - const fullRoomRoleOptions = membersHelper.getOptionsByRoomType( selectionParentRoom.roomType, currCanEditUsers diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/Members/index.js b/packages/client/src/pages/Home/InfoPanel/Body/views/Members/index.js index 0e1f298914..85b317744d 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/views/Members/index.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/views/Members/index.js @@ -117,26 +117,35 @@ const Members = ({ (member) => member.id === selfId ); + const currCanEditUsers = + currentMember.isOwner || + currentMember.isAdmin || + currentMember?.access === ShareAccessRights.FullAccess || + currentMember?.access === ShareAccessRights.RoomManager; + return ( <> {t("UsersInRoom")} : {members.inRoom.length} - + {currCanEditUsers && ( + + )} {Object.values(members.inRoom).map((user) => ( {t("ExpectPeople")} - + {currCanEditUsers && ( + + )} )} From a0766d931ea6e54c5b4fa30610c41ff99f385d06 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 8 Nov 2022 10:47:06 +0300 Subject: [PATCH 02/12] Web: Fixes styles. --- .../Home/InfoPanel/Body/styles/history.js | 1 - .../Body/views/History/HistoryBlockUser.js | 18 +++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/client/src/pages/Home/InfoPanel/Body/styles/history.js b/packages/client/src/pages/Home/InfoPanel/Body/styles/history.js index 4f158c2b9a..4429639446 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/styles/history.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/styles/history.js @@ -26,7 +26,6 @@ const StyledUserNameLink = styled.span` font-size: 13px; font-weight: 600; display: inline-block; - ${(props) => props.isVisitor && "cursor: default"}; } .link { diff --git a/packages/client/src/pages/Home/InfoPanel/Body/views/History/HistoryBlockUser.js b/packages/client/src/pages/Home/InfoPanel/Body/views/History/HistoryBlockUser.js index fc60ea482b..f1c75a547c 100644 --- a/packages/client/src/pages/Home/InfoPanel/Body/views/History/HistoryBlockUser.js +++ b/packages/client/src/pages/Home/InfoPanel/Body/views/History/HistoryBlockUser.js @@ -3,7 +3,7 @@ import { useHistory } from "react-router-dom"; import Link from "@docspace/components/link"; import { StyledUserNameLink } from "../../styles/history"; - +import Text from "@docspace/components/text"; const HistoryBlockUser = ({ user, withComma, openUser, isVisitor }) => { const username = user.displayName; const history = useHistory(); @@ -12,13 +12,17 @@ const HistoryBlockUser = ({ user, withComma, openUser, isVisitor }) => { openUser(user, history); }; - const onClickProp = isVisitor ? {} : { onClick: onUserClick }; - return ( - - - {username} - + + {isVisitor ? ( + + {username} + + ) : ( + + {username} + + )} {withComma ? "," : ""} {withComma &&
}
From a49f3074be720c4b1b62ecda89622c095031e94a Mon Sep 17 00:00:00 2001 From: Eugene Kozyrev <67453079+EugeneKozyrev@users.noreply.github.com> Date: Tue, 8 Nov 2022 11:26:46 +0300 Subject: [PATCH 03/12] Add enterprise build for Windows (#988) --- .../CustomActions/C#/Utils/CustomAction.cs | 40 +- build/install/win/DocSpace.aip | 869 ++++++++++++------ .../win/MySQL Server Installer Runner.iss | 2 +- build/install/win/build-batch.bat | 21 +- build/install/win/build-download-prereq.ps1 | 44 +- build/install/win/publish-script.bat | 1 + build/install/win/utils.vbs | 126 ++- 7 files changed, 782 insertions(+), 321 deletions(-) diff --git a/build/install/win/CustomActions/C#/Utils/CustomAction.cs b/build/install/win/CustomActions/C#/Utils/CustomAction.cs index 843e2a1210..d96be11098 100644 --- a/build/install/win/CustomActions/C#/Utils/CustomAction.cs +++ b/build/install/win/CustomActions/C#/Utils/CustomAction.cs @@ -41,23 +41,23 @@ namespace Utils { try { - using (var redis = new Redis(session["REDIS_HOST_PROP"], Convert.ToInt32(session["REDIS_PORT_PROP"]))) + using (var redis = new Redis(session["REDIS_HOST"], Convert.ToInt32(session["REDIS_PORT"]))) { - if (!String.IsNullOrEmpty(session["REDIS_PASSWORD_PROP"].Trim())) - redis.Password = session["REDIS_PASSWORD_PROP"]; + if (!String.IsNullOrEmpty(session["REDIS_PWD"].Trim())) + redis.Password = session["REDIS_PWD"]; var pong = redis.Ping("ONLYOFFICE"); session.Log("Redis Status: IsConnected is {0}", !String.IsNullOrEmpty(pong)); - session["RedisServerConnectionError"] = !String.IsNullOrEmpty(pong) ? "" : String.Format("Connection Refused HOST:{0},PORT:{1},PASS:{2}", session["REDIS_HOST_PROP"], session["REDIS_PORT_PROP"], session["REDIS_PASSWORD_PROP"]); + session["RedisServerConnectionError"] = !String.IsNullOrEmpty(pong) ? "" : String.Format("Connection Refused HOST:{0},PORT:{1},PASS:{2}", session["REDIS_HOST"], session["REDIS_PORT"], session["REDIS_PWD"]); } } catch (Exception ex) { session.Log("RedisConnectionException '{0}'", ex.Message); - session["RedisServerConnectionError"] = String.Format("Connection Refused HOST:{0},PORT:{1},PASS:{2}", session["REDIS_HOST_PROP"], session["REDIS_PORT_PROP"], session["REDIS_PASSWORD_PROP"]); + session["RedisServerConnectionError"] = String.Format("Connection Refused HOST:{0},PORT:{1},PASS:{2}", session["REDIS_HOST"], session["REDIS_PORT"], session["REDIS_PWD"]); } return ActionResult.Success; @@ -69,11 +69,11 @@ namespace Utils { ConnectionFactory factory = new ConnectionFactory(); - factory.HostName = session["RABBITMQ_HOSTNAME_PROP"]; - factory.Port = Convert.ToInt32(session["RABBITMQ_PORT_PROP"]); - factory.VirtualHost = session["RABBITMQ_VIRTUALHOST_PROP"]; - factory.UserName = session["RABBITMQ_USERNAME_PROP"]; - factory.Password = session["RABBITMQ_PASSWORD_PROP"]; + factory.HostName = session["AMQP_HOST"]; + factory.Port = Convert.ToInt32(session["AMQP_PORT"]); + factory.VirtualHost = session["AMQP_VHOST"]; + factory.UserName = session["AMQP_USER"]; + factory.Password = session["AMQP_PWD"]; try { @@ -82,11 +82,11 @@ namespace Utils session.Log("RabbitMQ Status: IsConnected is {0}", conn.IsOpen); session["RabbitMQServerConnectionError"] = conn.IsOpen ? "" : String.Format("Connection Refused HOST:{0}, PORT:{1}, VirtualHost:{2}, UserName:{3}, PASS:{4}", - session["RABBITMQ_HOSTNAME_PROP"], - session["RABBITMQ_PORT_PROP"], - session["RABBITMQ_VIRTUALHOST_PROP"], - session["RABBITMQ_USERNAME_PROP"], - session["RABBITMQ_PASSWORD_PROP"] + session["AMQP_HOST"], + session["AMQP_PORT"], + session["AMQP_VHOST"], + session["AMQP_USER"], + session["AMQP_PWD"] ); } } @@ -95,11 +95,11 @@ namespace Utils session.Log("RabbitMQ.Client.Exceptions.BrokerUnreachableException {0}", ex.Message); session["RabbitMQServerConnectionError"] = String.Format("Connection Refused HOST:{0}, PORT:{1}, VirtualHost:{2}, UserName:{3}, PASS:{4}", - session["RABBITMQ_HOSTNAME_PROP"], - session["RABBITMQ_PORT_PROP"], - session["RABBITMQ_VIRTUALHOST_PROP"], - session["RABBITMQ_USERNAME_PROP"], - session["RABBITMQ_PASSWORD_PROP"] + session["AMQP_HOST"], + session["AMQP_PORT"], + session["AMQP_VHOST"], + session["AMQP_USER"], + session["AMQP_PWD"] ); } diff --git a/build/install/win/DocSpace.aip b/build/install/win/DocSpace.aip index bf153527c1..51059b8927 100644 --- a/build/install/win/DocSpace.aip +++ b/build/install/win/DocSpace.aip @@ -1,60 +1,78 @@ - + + + + - + + + + + + + + + - + - + + + + + + + - + + + - + - + - - - + + + + + + + - - - - - - - - - - - + + + + + + @@ -76,21 +94,25 @@ - - + - - - - - - - - + + + + + + + + + + + + + @@ -109,6 +131,8 @@ + + @@ -130,6 +154,7 @@ + @@ -145,6 +170,7 @@ + @@ -162,42 +188,46 @@ + - + - - + + - + - + - + - + - + - + - + + + + - + @@ -208,6 +238,7 @@ + @@ -249,12 +280,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -273,6 +329,7 @@ + @@ -281,12 +338,20 @@ - + + + + + + + + + @@ -299,6 +364,7 @@ + @@ -307,35 +373,42 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - + - - + + + + + @@ -345,9 +418,10 @@ - - + + + @@ -358,35 +432,59 @@ - + + + + + + + + + + - + + + + + + + + + + + + + + + + @@ -398,24 +496,57 @@ + + + + + + + - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + @@ -528,6 +659,24 @@ + + + + + + + + + + + + + + + + + + @@ -567,11 +716,11 @@ - - - - - + + + + + @@ -583,19 +732,20 @@ - - - + + + - - - - - - + + + + + + + @@ -632,11 +782,11 @@ - - + + - + @@ -657,25 +807,25 @@ - - - + + + - + - - + + - - - - + + + + - + @@ -684,42 +834,63 @@ - - - - - - + + + + + + - + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -787,24 +958,35 @@ + + + + + + + + + + + - + @@ -815,28 +997,37 @@ + + + + + + + + + + - + - @@ -845,23 +1036,39 @@ + + + + + + + - - - - + + + + + + + + + - + + + + + @@ -871,6 +1078,7 @@ + @@ -879,98 +1087,109 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -980,68 +1199,101 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - + + + + + + + + + + + + + - + + + + + + + + + + + - - - + + + - - + + + + + + + + + + + - - - - - - + + + + + + + + + @@ -1049,7 +1301,7 @@ - + @@ -1109,6 +1361,8 @@ + + @@ -1116,30 +1370,49 @@ + + + + + + + - + + + + + + + + + + + - + + + @@ -1161,6 +1434,7 @@ + @@ -1182,6 +1456,7 @@ + @@ -1203,25 +1478,26 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -1235,22 +1511,25 @@ - + + - - - + + + + + - - - - - + + + + + @@ -1267,16 +1546,19 @@ + - - - - + + + + + + @@ -1290,6 +1572,8 @@ + + @@ -1297,4 +1581,19 @@ + + + + + + + + + + + + + + + diff --git a/build/install/win/MySQL Server Installer Runner.iss b/build/install/win/MySQL Server Installer Runner.iss index 91a3eabf93..485a587ca1 100644 --- a/build/install/win/MySQL Server Installer Runner.iss +++ b/build/install/win/MySQL Server Installer Runner.iss @@ -13,4 +13,4 @@ OutputBaseFilename="MySQL Installer Runner" OutputDir=/ [Run] -Filename: "{pf}\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe"; Parameters: "community install server;{param:MYSQL_VERSION|5.7.25};X64:*:servertype=Server;passwd={param:PASSWORD_PROP} -silent"; Flags: runhidden \ No newline at end of file +Filename: "{pf}\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe"; Parameters: "community install server;{param:MYSQL_VERSION|5.7.25};X64:*:servertype=Server;passwd={param:DB_PWD} -silent"; Flags: runhidden \ No newline at end of file diff --git a/build/install/win/build-batch.bat b/build/install/win/build-batch.bat index efe031de69..c287d63fd4 100644 --- a/build/install/win/build-batch.bat +++ b/build/install/win/build-batch.bat @@ -1,7 +1,8 @@ REM echo ######## Set variables ######## set "publisher="Ascensio System SIA"" -set "nginx_version=1.21.1" set "nuget="%cd%\thirdparty\SimpleRestServices\src\.nuget\NuGet.exe"" +set "nginx_version=1.21.1" +set "environment=test" REM echo ######## Extracting and preparing files to build ######## %sevenzip% x build\install\win\nginx-%nginx_version%.zip -o"build\install\win\Files" -y @@ -11,7 +12,7 @@ md build\install\win\Files\nginx\temp md build\install\win\Files\nginx\logs md build\install\win\Files\tools md build\install\win\Files\Logs -md build\install\win\Files\service\ +md build\install\win\Files\Data md build\install\win\Files\products\ASC.Files\server\temp md build\install\win\Files\products\ASC.People\server\temp md build\install\win\Files\services\ASC.Data.Backup\service\temp @@ -39,7 +40,13 @@ copy build\install\win\WinSW3.0.0.exe "build\install\win\Files\tools\Login.exe" copy build\install\win\tools\Login.xml "build\install\win\Files\tools\Login.xml" /y copy "build\install\win\nginx.conf" "build\install\win\Files\nginx\conf\nginx.conf" /y rmdir build\install\win\publish /s /q + +::edit environment +%sed% -i "s/\(\W\)PRODUCT.ENVIRONMENT.SUB\(\W\)/\1%environment%\2/g" build\install\win\DocSpace.aip + +::delete nginx configs del /f /q build\install\win\Files\nginx\conf\onlyoffice-login.conf +del /f /q build\install\win\Files\nginx\conf\onlyoffice-story.conf REM echo ######## Build Utils ######## @@ -50,10 +57,6 @@ rmdir build\install\win\CustomActions\C#\Utils\bin /s /q rmdir build\install\win\CustomActions\C#\Utils\obj /s /q REM echo ######## Delete temp files ######## -del /f /q build\install\win\Files\config\sed* -del /f /q build\install\win\Files\nginx\conf\sed* -del /f /q build\install\win\Files\nginx\conf\includes\sed* -del /f /q build\install\win\Files\services\*\service\config\sed* del /f /q build\install\win\*.back.* REM echo ######## Build MySQL Server Installer ######## @@ -61,4 +64,10 @@ iscc /Qp /S"byparam="signtool" sign /a /n "%publisher%" /t http://timestamp.digi REM echo ######## Build DocSpace package ######## %AdvancedInstaller% /edit build\install\win\DocSpace.aip /SetVersion %BUILD_VERSION%.%BUILD_NUMBER% + +IF "%SignBuild%"=="true" ( +:%AdvancedInstaller% /edit build\install\win\DocSpace.aip /SetSig +:%AdvancedInstaller% /edit build\install\win\DocSpace.aip /SetDigitalCertificateFile -file %onlyoffice_codesign_path% -password "%onlyoffice_codesign_password%" +) + %AdvancedInstaller% /rebuild build\install\win\DocSpace.aip diff --git a/build/install/win/build-download-prereq.ps1 b/build/install/win/build-download-prereq.ps1 index e7d48bdf35..c065666e0d 100644 --- a/build/install/win/build-download-prereq.ps1 +++ b/build/install/win/build-download-prereq.ps1 @@ -12,31 +12,45 @@ $AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12,Tls13' function DownloadComponents { param ( $prereq_list, $path ) + + [void](New-Item -ItemType Directory -Force -Path $path) ForEach ( $item in $prereq_list ) { $url = $item.link $output = $path + $item.name - if( $item.download_allways ){ - [system.console]::WriteLine("Downloading $url") - Invoke-WebRequest -Uri $url -OutFile $output - } else { - if(![System.IO.File]::Exists($output)){ + try + { + if( $item.download_allways ){ [system.console]::WriteLine("Downloading $url") Invoke-WebRequest -Uri $url -OutFile $output + } else { + if(![System.IO.File]::Exists($output)){ + [system.console]::WriteLine("Downloading $url") + Invoke-WebRequest -Uri $url -OutFile $output + } } + } catch { + Write-Host "[ERROR] Can not download" $item.name "by link" $url } } } +switch ( $env:DOCUMENT_SERVER_VERSION ) +{ + latest { $DOCUMENT_SERVER_LINK = "https://download.onlyoffice.com/install/documentserver/windows/onlyoffice-documentserver-ee.exe" } + custom { $DOCUMENT_SERVER_LINK = $env:DOCUMENT_SERVER_CUSTOM_LINK.Replace(",", "") } +} + $nginx_version = '1.21.1' +$psql_version = '9.5.4' $path_prereq = "${pwd}\build\install\win\" $prerequisites = @( @{ download_allways = $false; - name = "nginx-${nginx_version}.zip"; + name = "nginx-${nginx_version}.zip"; link = "https://nginx.org/download/nginx-${nginx_version}.zip"; } @@ -45,6 +59,24 @@ $prerequisites = @( name = "WinSW.NET4new.exe"; link = "https://github.com/winsw/winsw/releases/download/v2.11.0/WinSW.NET4.exe"; } + + @{ + download_allways = $true; + name = "onlyoffice-documentserver.latest.exe"; + link = $DOCUMENT_SERVER_LINK + } + + @{ + download_allways = $false; + name = "psqlodbc_x64.msi"; + link = "http://download.onlyoffice.com/install/windows/redist/psqlodbc_x64.msi" + } + + @{ + download_allways = $false; + name = "postgresql-${psql_version}-1-windows-x64.exe"; + link = "https://get.enterprisedb.com/postgresql/postgresql-${psql_version}-1-windows-x64.exe" + } ) $path_nuget_packages = "${pwd}\.nuget\packages\" diff --git a/build/install/win/publish-script.bat b/build/install/win/publish-script.bat index e406797a56..8721ca359d 100644 --- a/build/install/win/publish-script.bat +++ b/build/install/win/publish-script.bat @@ -21,6 +21,7 @@ dotnet publish "%PathToRepository%\products\ASC.Files\server\ASC.Files.csproj" - dotnet publish "%PathToRepository%\products\ASC.People\server\ASC.People.csproj" -c Release --self-contained false -o "%PathToAppFolder%\products\ASC.People\server" rem backend services (dotnet) in directory 'services' +dotnet publish "%PathToRepository%\common\services\ASC.ApiSystem\ASC.ApiSystem.csproj" -c Release --self-contained false -o "%PathToAppFolder%\services\ASC.ApiSystem\service" dotnet publish "%PathToRepository%\common\services\ASC.Data.Backup\ASC.Data.Backup.csproj" -c Release --self-contained false -o "%PathToAppFolder%\services\ASC.Data.Backup\service" dotnet publish "%PathToRepository%\products\ASC.Files\service\ASC.Files.Service.csproj" -c Release --self-contained false -o "%PathToAppFolder%\services\ASC.Files.Service\service" dotnet publish "%PathToRepository%\common\services\ASC.Notify\ASC.Notify.csproj" -c Release --self-contained false -o "%PathToAppFolder%\services\ASC.Notify\service" diff --git a/build/install/win/utils.vbs b/build/install/win/utils.vbs index 7f3954a4e7..72a3e0b430 100644 --- a/build/install/win/utils.vbs +++ b/build/install/win/utils.vbs @@ -1,3 +1,123 @@ +Function RedisSetup + On Error Resume Next + + Dim Shell + + Set Shell = CreateObject("WScript.Shell") + + Shell.Run "redis-cli config set save """"", 0, True + Shell.Run "redis-cli config rewrite", 0, True + + Set Shell = Nothing +End Function + +Function TestPostgreSqlConnection + On Error Resume Next + + Dim ErrorText + Dim Pos, postgreSqlDriver + + postgreSqlDriver = "PostgreSQL Unicode(x64)" + + Session.Property("PostgreSqlConnectionError") = "" + + Set ConnectionObject = CreateObject("ADODB.Connection") + ConnectionObject.Open "Driver={" & postgreSqlDriver & "};" & _ + "Server=" & Session.Property("PS_DB_HOST") & ";" & _ + "Port=" & Session.Property("PS_DB_PORT") & ";" & _ + "Database=" & Session.Property("PS_DB_NAME") & ";" & _ + "Uid=" & Session.Property("PS_DB_USER") & ";" & _ + "Pwd=" & Session.Property("PS_DB_PWD") + + If Err.Number <> 0 Then + ErrorText = Err.Description + Pos = InStrRev( ErrorText, "]" ) + If 0 < Pos Then + ErrorText = Right( ErrorText, Len( ErrorText ) - Pos ) + End If + Session.Property("PostgreSqlConnectionError") = ErrorText + End If + + ConnectionObject.Close + + Set ConnectionObject = Nothing + +End Function + +Function PostgreSqlConfigure + On Error Resume Next + + If (StrComp(Session.Property("POSTGRE_SQL_PATH"),"FALSE") = 0) Then + Wscript.Quit + End If + + Dim ErrorText + Dim Pos, postgreSqlDriver + Dim databaseUserName + Dim databaseUserPwd + Dim databaseName + Dim databasePort + Dim databaseHost + + databaseUserName = Session.Property("PS_DB_USER") + databaseUserPwd = Session.Property("PS_DB_PWD") + databaseName = Session.Property("PS_DB_NAME") + databasePort = Session.Property("PS_DB_PORT") + databaseHost = Session.Property("PS_DB_HOST") + + Call WriteToLog("PostgreSqlConfig: databaseUserName is " & databaseUserName) + Call WriteToLog("PostgreSqlConfig: databaseUserPwd is " & databaseUserPwd) + Call WriteToLog("PostgreSqlConfig: databaseName is " & databaseName) + Call WriteToLog("PostgreSqlConfig: databasePort is " & databasePort) + Call WriteToLog("PostgreSqlConfig: databaseHost is " & databaseHost) + + postgreSqlDriver = "PostgreSQL Unicode(x64)" + + Set ConnectionObject = CreateObject("ADODB.Connection") + ConnectionObject.Open "Driver={" & postgreSqlDriver & "};Server=" & databaseHost & ";Port=" & databasePort & ";Database=" & "postgres" & ";Uid=" & "postgres" & ";Pwd=" & "postgres" + + ConnectionObject.Execute "CREATE DATABASE " & databaseName + ConnectionObject.Execute "create user " & databaseUserName & " with encrypted password '" & databaseUserPwd & "'" + ConnectionObject.Execute "grant all privileges on database " & databaseName & " to " & databaseUserName + + If Err.Number <> 0 Then + ErrorText = Err.Description + Pos = InStrRev( ErrorText, "]" ) + If 0 < Pos Then + Call WriteToLog("PostgreSqlConfig: error is " & ErrorText) + ErrorText = Right( ErrorText, Len( ErrorText ) - Pos ) + Session.Property("PostgreSqlConnectionError") = ErrorText + + End If + End If + + ConnectionObject.Close + + Set ConnectionObject = Nothing + +End Function + +Function RandomString( ByVal strLen ) + Dim str, min, max + + Const LETTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ0123456789" + min = 1 + max = Len(LETTERS) + + Randomize + For i = 1 to strLen + str = str & Mid( LETTERS, Int((max-min+1)*Rnd+min), 1 ) + Next + RandomString = str +End Function + +Function SetDocumentServerJWTSecretProp + On Error Resume Next + + Session.Property("JWT_SECRET") = RandomString( 30 ) + +End Function + Function MySQLConfigure On Error Resume Next @@ -28,8 +148,8 @@ Function MySQLConfigure Session.Property("MYSQLODBCDRIVER") = mysqlDriver Set shell = CreateObject("WScript.Shell") - dbname = Session.Property("DATABASE_PROP") - dbpass = Session.Property("PASSWORD_PROP") + dbname = Session.Property("DB_NAME") + dbpass = Session.Property("DB_PWD") Err.Clear installDir = shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MySQL AB\MySQL Server 8.0\Location") @@ -260,7 +380,7 @@ Function TestSqlConnection Session.Property("MYSQLODBCDRIVER") = mysqlDriver Set ConnectionObject = CreateObject("ADODB.Connection") - ConnectionObject.Open "Driver={" & mysqlDriver & "};Server=" & Session.Property("SERVER_PROP") & ";Port=" & Session.Property("PORT_PROP") & ";Uid=" & Session.Property("USERNAME_PROP") & ";Pwd=" & Session.Property("PASSWORD_PROP") + ConnectionObject.Open "Driver={" & mysqlDriver & "};Server=" & Session.Property("DB_HOST") & ";Port=" & Session.Property("DB_PORT") & ";Uid=" & Session.Property("DB_USER") & ";Pwd=" & Session.Property("DB_PWD") If Err.Number <> 0 Then ErrorText = Err.Description From f676e8feda90fc088cb9f55c98ef13d1272171ee Mon Sep 17 00:00:00 2001 From: TimofeyBoyko Date: Tue, 8 Nov 2022 13:20:09 +0300 Subject: [PATCH 04/12] Web:Client:Section: fix description for rooms at row view --- .../Section/Body/RowsView/FilesRowContent.js | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js b/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js index 63c87390f3..d63910c2a3 100644 --- a/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js +++ b/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js @@ -105,15 +105,7 @@ const FilesRowContent = ({ isRoom, } = item; - let tags = null; - - if (isRoom) { - if (item.tags.length > 0) { - tags = item?.tags.join(" | "); - } else { - tags = t(RoomsTypeTranslations[item.roomType]); - } - } + let tags = t(RoomsTypeTranslations[item.roomType]); return ( <> @@ -139,18 +131,18 @@ const FilesRowContent = ({ {badgesComponent} {!isRoom && !isRooms && quickButtons} - {!isRoom && ( - - {updatedDate && updatedDate} - - )} + + + {updatedDate && updatedDate} + + Date: Tue, 8 Nov 2022 13:24:05 +0300 Subject: [PATCH 05/12] Web:Client:Home: delete useless code for row view --- .../src/pages/Home/Section/Body/RowsView/FilesRowContent.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js b/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js index d63910c2a3..a687f8cc2d 100644 --- a/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js +++ b/packages/client/src/pages/Home/Section/Body/RowsView/FilesRowContent.js @@ -105,8 +105,6 @@ const FilesRowContent = ({ isRoom, } = item; - let tags = t(RoomsTypeTranslations[item.roomType]); - return ( <> {isRooms - ? tags + ? t(RoomsTypeTranslations[item.roomType]) : !fileExst && !contentLength && !providerKey && !isMobileOnly ? `${foldersCount} ${t("Translations:Folders")} | ${filesCount} ${t( "Translations:Files" From 24829b5d9e3fc628d1bdd62bc902c96b495dcf78 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 8 Nov 2022 13:38:33 +0300 Subject: [PATCH 06/12] Audit: fix --- .../Repositories/AuditEventsRepository.cs | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/common/services/ASC.AuditTrail/Repositories/AuditEventsRepository.cs b/common/services/ASC.AuditTrail/Repositories/AuditEventsRepository.cs index be08a086e6..ae19e83764 100644 --- a/common/services/ASC.AuditTrail/Repositories/AuditEventsRepository.cs +++ b/common/services/ASC.AuditTrail/Repositories/AuditEventsRepository.cs @@ -91,7 +91,7 @@ public class AuditEventsRepository var tenant = _tenantManager.GetCurrentTenant().Id; using var auditTrailContext = _dbContextFactory.CreateDbContext(); var query = - (from q in auditTrailContext.AuditEvents + from q in auditTrailContext.AuditEvents from p in auditTrailContext.Users.Where(p => q.UserId == p.Id).DefaultIfEmpty() where q.TenantId == tenant orderby q.Date descending @@ -101,16 +101,7 @@ public class AuditEventsRepository FirstName = p.FirstName, LastName = p.LastName, UserName = p.UserName - }); - - if (startIndex > 0) - { - query = query.Skip(startIndex); - } - if (limit > 0) - { - query = query.Take(limit); - } + }; if (userId.HasValue && userId.Value != Guid.Empty) { @@ -197,6 +188,14 @@ public class AuditEventsRepository } } + if (startIndex > 0) + { + query = query.Skip(startIndex); + } + if (limit > 0) + { + query = query.Take(limit); + } return _mapper.Map, IEnumerable>(query.ToList()); } From 22308acc29e630b64b660870691ccf6a89d1f9d2 Mon Sep 17 00:00:00 2001 From: TimofeyBoyko Date: Tue, 8 Nov 2022 13:39:24 +0300 Subject: [PATCH 07/12] Web:Components:RowContent: fix truncate for tablet side info --- packages/components/row-content/styled-row-content.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/components/row-content/styled-row-content.js b/packages/components/row-content/styled-row-content.js index af62f9682f..092f112fb6 100644 --- a/packages/components/row-content/styled-row-content.js +++ b/packages/components/row-content/styled-row-content.js @@ -40,8 +40,8 @@ const sideInfoTabletStyle = css` ${commonCss}; color: ${(props) => props.color && props.color}; white-space: nowrap; - overflow: ${(props) => props.theme.rowContent.sideInfo.overflow}; - text-overflow: ${(props) => props.theme.rowContent.sideInfo.textOverflow}; + overflow: hidden; + text-overflow: ellipsis; `; const StyledRowContent = styled.div` @@ -88,6 +88,7 @@ const MainContainerWrapper = styled.div` ${mainWrapperTabletStyle} } `; + MainContainerWrapper.defaultProps = { theme: Base }; const MainContainer = styled.div` @@ -160,6 +161,9 @@ const TabletSideInfo = styled.div` : ` @media ${tablet} { ${sideInfoTabletStyle} + .row-content_tablet-side-info { + background: red; + } } `} `; From c3897224f6a48a3c5520fb02314cc5f9831f1962 Mon Sep 17 00:00:00 2001 From: TimofeyBoyko Date: Tue, 8 Nov 2022 13:43:56 +0300 Subject: [PATCH 08/12] Web:Components:RowContent: fix --- packages/components/row-content/styled-row-content.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/components/row-content/styled-row-content.js b/packages/components/row-content/styled-row-content.js index 092f112fb6..ca1b353a0e 100644 --- a/packages/components/row-content/styled-row-content.js +++ b/packages/components/row-content/styled-row-content.js @@ -39,9 +39,7 @@ const sideInfoTabletStyle = css` margin: ${(props) => props.theme.rowContent.sideInfo.margin}; ${commonCss}; color: ${(props) => props.color && props.color}; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + ${truncateCss}; `; const StyledRowContent = styled.div` @@ -161,9 +159,6 @@ const TabletSideInfo = styled.div` : ` @media ${tablet} { ${sideInfoTabletStyle} - .row-content_tablet-side-info { - background: red; - } } `} `; From a9fc7a14ed355075dcf1ddd318feac409dcfb9df Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Tue, 8 Nov 2022 13:57:51 +0300 Subject: [PATCH 09/12] Removed old code --- .../CreateEditRoomDialog/CreateRoomDialog.js | 142 -------------- .../CreateEditRoomDialog/EditRoomDialog.js | 95 --------- .../CreateEditRoomDialog/data/index.js | 61 ------ .../handlers/TagHandler.js | 49 ----- .../sub-components/RoomType.js | 177 ----------------- .../sub-components/RoomTypeDropdown.js | 70 ------- .../sub-components/RoomTypeList.js | 31 --- .../sub-components/SetRoomParams.js | 165 ---------------- .../StorageLocation/ThirpartyComboBox.js | 184 ------------------ .../sub-components/StorageLocation/index.js | 47 ----- .../sub-components/StyledDropdown.js | 57 ------ .../sub-components/StyledParam.js | 66 ------- .../sub-components/TagInput/TagList.js | 54 ----- .../sub-components/TagInput/index.js | 161 --------------- .../Client/src/components/dialogs/index.js | 25 --- .../pages/Home/InfoPanel/Body/SingleItem.js | 0 .../Body/styles/VirtualRoom/history.js | 140 ------------- .../Body/styles/VirtualRoom/members.js | 92 --------- .../Body/views/Details/EmptyScreen.js | 39 ---- .../Body/views/Details/SeveralItems.js | 32 --- .../InfoPanel/Body/views/Details/index.js | 88 --------- .../Body/views/Gallery/GalleryEmptyScreen.js | 26 --- .../Body/views/Gallery/GalleryItem.js | 89 --------- .../Body/views/History/historyBlockContent.js | 87 --------- .../InfoPanel/Body/views/History/index.js | 72 ------- .../Home/InfoPanel/Body/views/Members/User.js | 78 -------- .../InfoPanel/Body/views/Members/UserList.js | 27 --- .../InfoPanel/Body/views/Members/index.js | 56 ------ .../Home/InfoPanel/Body/views/mock_data.js | 123 ------------ .../Section/Body/EmptyContainer.js | 91 --------- 30 files changed, 2424 deletions(-) delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/CreateRoomDialog.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/EditRoomDialog.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/data/index.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/handlers/TagHandler.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/RoomType.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/RoomTypeDropdown.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/RoomTypeList.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/SetRoomParams.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/StorageLocation/ThirpartyComboBox.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/StorageLocation/index.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/StyledDropdown.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/StyledParam.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/TagInput/TagList.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/sub-components/TagInput/index.js delete mode 100644 products/ASC.Files/Client/src/components/dialogs/index.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/SingleItem.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/styles/VirtualRoom/history.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/styles/VirtualRoom/members.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/Details/EmptyScreen.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/Details/SeveralItems.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/Details/index.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/Gallery/GalleryEmptyScreen.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/Gallery/GalleryItem.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/History/historyBlockContent.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/History/index.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/Members/User.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/Members/UserList.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/Members/index.js delete mode 100644 products/ASC.Files/Client/src/pages/Home/InfoPanel/Body/views/mock_data.js delete mode 100644 products/ASC.Files/Client/src/pages/VirtualRooms/Section/Body/EmptyContainer.js diff --git a/products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/CreateRoomDialog.js b/products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/CreateRoomDialog.js deleted file mode 100644 index 990a0bdec6..0000000000 --- a/products/ASC.Files/Client/src/components/dialogs/CreateEditRoomDialog/CreateRoomDialog.js +++ /dev/null @@ -1,142 +0,0 @@ -import React, { useState } from "react"; -import styled from "styled-components"; - -import ModalDialog from "@appserver/components/modal-dialog"; -import Button from "@appserver/components/button"; - -import TagHandler from "./handlers/tagHandler"; - -import SetRoomParams from "./sub-components/SetRoomParams"; -import RoomTypeList from "./sub-components/RoomTypeList"; -import { roomTypes } from "./data"; -import IconButton from "@appserver/components/icon-button"; - -const StyledModalDialog = styled(ModalDialog)` - .header-with-button { - display: flex; - align-items: center; - flex-direction: row; - gap: 12px; - } -`; - -const CreateRoomDialog = ({ - t, - visible, - onClose, - onCreate, - - fetchedTags, - isLoading, - folderFormValidation, -}) => { - const [isScrollLocked, setIsScrollLocked] = useState(false); - - const [roomParams, setRoomParams] = useState({ - title: "", - type: undefined, - tags: [], - isPrivate: false, - storageLocation: undefined, - rememberStorageLocation: false, - thirdpartyFolderName: "", - icon: "", - }); - - const setRoomTags = (newTags) => - setRoomParams({ ...roomParams, tags: newTags }); - - const tagHandler = new TagHandler(roomParams.tags, setRoomTags, fetchedTags); - - const setRoomType = (newRoomType) => { - const [roomByType] = roomTypes.filter((room) => room.type === newRoomType); - tagHandler.refreshDefaultTag(t(roomByType.title)); - setRoomParams((prev) => ({ - ...prev, - type: newRoomType, - })); - }; - - const onCreateRoom = () => { - onCreate(roomParams); - }; - - const isChooseRoomType = roomParams.type === undefined; - const goBack = () => { - setRoomParams({ - title: "", - type: undefined, - tags: [], - isPrivate: false, - storageLocation: undefined, - rememberStorageLocation: false, - thirdpartyFolderName: "", - icon: "", - }); - }; - - return ( - - - {isChooseRoomType ? ( - t("ChooseRoomType") - ) : ( -
- -
{t("CreateRoom")}
-
- )} -
- - - {isChooseRoomType ? ( - - ) : ( - - )} - - - {!isChooseRoomType && ( - -