Merge branch 'hotfix/v1.1.2' of https://github.com/ONLYOFFICE/DocSpace into hotfix/v1.1.2
This commit is contained in:
commit
3a2438dff3
@ -29,9 +29,9 @@ if ($args[0] -eq "--force") {
|
||||
|
||||
Write-Host "FORCE BUILD BASE IMAGES: $Force" -ForegroundColor Blue
|
||||
|
||||
$existsnetwork = (docker network ls | ForEach-Object { $_.Split()[1] }) -contains onlyoffice
|
||||
$ExistsNetwork= docker network ls --format '{{.Name}}' | findstr "onlyoffice"
|
||||
|
||||
if (-not $existsnetwork) {
|
||||
if (-not $ExistsNetwork) {
|
||||
docker network create --driver bridge onlyoffice
|
||||
}
|
||||
|
||||
|
@ -38,10 +38,10 @@ echo "Run MySQL"
|
||||
|
||||
arch_name="$(uname -m)"
|
||||
|
||||
existsnetwork=$(docker network ls | awk '{print $2;}' | { grep -x ${NETWORK_NAME} || true; });
|
||||
existsnetwork=$(docker network ls | awk '{print $2;}' | { grep -x onlyoffice || true; });
|
||||
|
||||
if [[ -z ${existsnetwork} ]]; then
|
||||
docker network create --driver bridge ${NETWORK_NAME}
|
||||
docker network create --driver bridge onlyoffice
|
||||
fi
|
||||
|
||||
if [ "${arch_name}" = "x86_64" ]; then
|
||||
|
@ -19,7 +19,7 @@ LOG_DIR = os.environ["LOG_DIR"] if environ.get("LOG_DIR") else "/var/log/" + PRO
|
||||
ROUTER_HOST = os.environ["ROUTER_HOST"] if environ.get("ROUTER_HOST") else "localhost"
|
||||
SOCKET_HOST = os.environ["SOCKET_HOST"] if environ.get("SOCKET_HOST") else "onlyoffice-socket"
|
||||
|
||||
MYSQL_CONTAINER_NAME = os.environ["MYSQL_CONTAINER_NAME"] if environ.get("MYSQL_CONTAINER_NAME") else "onlyoffice-mysql"
|
||||
MYSQL_CONTAINER_NAME = os.environ["MYSQL_CONTAINER_NAME"] if environ.get("MYSQL_CONTAINER_NAME") else "onlyoffice-mysql-server"
|
||||
MYSQL_HOST = os.environ["MYSQL_HOST"] if environ.get("MYSQL_HOST") else None
|
||||
MYSQL_PORT = os.environ["MYSQL_PORT"] if environ.get("MYSQL_PORT") else "3306"
|
||||
MYSQL_DATABASE = os.environ["MYSQL_DATABASE"] if environ.get("MYSQL_DATABASE") else "onlyoffice"
|
||||
|
@ -281,6 +281,7 @@ services:
|
||||
container_name: ${MIGRATION_RUNNER_HOST}
|
||||
restart: "no"
|
||||
environment:
|
||||
MYSQL_CONTAINER_NAME: ${MYSQL_CONTAINER_NAME}
|
||||
MYSQL_HOST: ${MYSQL_HOST}
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||
MYSQL_USER: ${MYSQL_USER}
|
||||
|
@ -400,6 +400,89 @@ Function TestSqlConnection
|
||||
Set ConnectionObject = Nothing
|
||||
End Function
|
||||
|
||||
Function OpenRestySetup
|
||||
On Error Resume Next
|
||||
|
||||
Dim objShell, sourcePath, destinationPath, openRestyServicePath, openRestyFolder, objFSO, objFolder
|
||||
|
||||
Set objShell = CreateObject("WScript.Shell")
|
||||
|
||||
destinationPath = Session.Property("APPDIR")
|
||||
openRestyServicePath = Session.Property("APPDIR") & "tools\OpenResty.exe"
|
||||
openRestyFolder = ""
|
||||
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
||||
For Each objFolder In objFSO.GetFolder(destinationPath).SubFolders
|
||||
If Left(objFolder.Name, 9) = "openresty" Then
|
||||
openRestyFolder = objFolder.Name
|
||||
End If
|
||||
Next
|
||||
Set objFSO = Nothing
|
||||
|
||||
sourcePath = Session.Property("APPDIR") & openRestyFolder
|
||||
|
||||
' Run XCopy to copy files and folders
|
||||
objShell.Run "xcopy """ & sourcePath & """ """ & destinationPath & """ /E /I /Y", 0, True
|
||||
|
||||
objShell.CurrentDirectory = destinationPath
|
||||
|
||||
' Run the RMDIR command to delete the folder
|
||||
objShell.Run "cmd /c RMDIR /S /Q """ & openRestyFolder & """", 0, True
|
||||
|
||||
objShell.Run """" & openRestyServicePath & """ install", 0, True
|
||||
|
||||
Set objShell = Nothing
|
||||
|
||||
End Function
|
||||
|
||||
Function MoveNginxConfigs
|
||||
On Error Resume Next
|
||||
|
||||
Dim objFSO, sourceFolder, targetFolder, nginxFolder
|
||||
|
||||
' Define source and target paths
|
||||
Set objFSO = CreateObject("Scripting.FileSystemObject")
|
||||
sourceFolder = Session.Property("APPDIR") & "nginx\conf"
|
||||
targetFolder = "C:\OpenResty\conf"
|
||||
nginxFolder = Session.Property("APPDIR") & "nginx"
|
||||
|
||||
' Check if source folder exists
|
||||
If objFSO.FolderExists(sourceFolder) Then
|
||||
' Check if target folder exists, if not, create it
|
||||
If Not objFSO.FolderExists(targetFolder) Then
|
||||
objFSO.CreateFolder(targetFolder)
|
||||
End If
|
||||
|
||||
' Copy files and folders from source to target
|
||||
CopyFolderContents objFSO.GetFolder(sourceFolder), targetFolder, objFSO
|
||||
|
||||
' Delete source folder
|
||||
objFSO.DeleteFolder nginxFolder, True ' "True" parameter for recursive deletion
|
||||
|
||||
WScript.Echo "Files and folders moved, and source folder deleted."
|
||||
Else
|
||||
WScript.Echo "Source folder does not exist."
|
||||
End If
|
||||
|
||||
Set objFSO = Nothing
|
||||
End Function
|
||||
|
||||
Sub CopyFolderContents(sourceFolder, targetFolder, objFSO)
|
||||
Dim subFolder, objFile
|
||||
|
||||
' Copy files
|
||||
For Each objFile In sourceFolder.Files
|
||||
objFSO.CopyFile objFile.Path, targetFolder & "\" & objFile.Name, True
|
||||
Next
|
||||
|
||||
' Recursively copy subfolders
|
||||
For Each subFolder In sourceFolder.SubFolders
|
||||
Dim newTargetFolder
|
||||
newTargetFolder = targetFolder & "\" & subFolder.Name
|
||||
objFSO.CreateFolder newTargetFolder
|
||||
CopyFolderContents subFolder, newTargetFolder, objFSO
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Function EnterpriseConfigure
|
||||
On Error Resume Next
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user