# Copyright (c) 2020 Avolin, LLC
#
# Knova Tomcat upgrade hotfix


param (
    [string]$ExistingTomcatFolder = "tomcat-8.5.15",
    [string]$NewTomcatFolder = "tomcat-8.5.57"
)

$KNOVA_HOME = $env:KNOVA_HOME
$KNOVA_JAVA_HOME = $env:KNOVA_JAVA_HOME
$ACCESSORIES_PATH = (Join-Path $KNOVA_HOME "Software\Install\accessories")

$backup_suffix = Get-Date -Format "yyyy_MM_dd_HH_mm_ss"
$tomcat_backup_zip = "${ExistingTomcatFolder}_backup_${backup_suffix}.zip"
$TOMCAT_SERVICE_NAME = "KnovaTomcat"

function Check-Env()
{
    Write-Host "Checking Knova deployment"
    
    Write-Host "KNOVA_HOME        : ${KNOVA_HOME}"
    Write-Host "KNOVA_JAVA_HOME   : ${KNOVA_JAVA_HOME}"
    Write-Host "Old Tomcat Folder : ${ExistingTomcatFolder}"
    Write-Host "New Tomcat Folder : ${NewTomcatFolder}"
    Write-Host "Tomcat Backup Folder : ${tomcat_backup_zip}"
}

function Take-Backup()
{
    $ProgressPreference = "SilentlyContinue"

    Write-Host "Getting backup of existing tomcat ${ExistingTomcatFolder}"
    compress-archive -path $ExistingTomcatFolder -destinationpath $tomcat_backup_zip -compressionlevel optimal
}

function Stop-KnovaTomcatService()
{
    Write-Host "Stopping ${TOMCAT_SERVICE_NAME} service"

    Get-Service -Name $TOMCAT_SERVICE_NAME -ErrorAction SilentlyContinue | ForEach-Object {
        if ( $_.Status -eq 'Running') {
            Stop-Service -Name $TOMCAT_SERVICE_NAME
        } else {
            Write-Host "${TOMCAT_SERVICE_NAME} service is not running"
        }
    }
}

function Remove-OldTomcatService()
{
    & sc.exe delete "${TOMCAT_SERVICE_NAME}"
}

function Expand-NewTomcatZip()
{
    if (Test-Path -Path $NewTomcatFolder) {
        throw "${NewTomcatFolder} already there! Remove it first to proceed"
    }
    $NewTomcatZip = "${NewTomcatFolder}.zip"
    Expand-Archive -Path $NewTomcatZip -DestinationPath $ACCESSORIES_PATH
}

function Install-NewTomcatService()
{
    $JvmDll=(Join-Path $KNOVA_JAVA_HOME "jre\bin\server\jvm.dll")
    $TOMCAT_VERSION = "8.5.57"
    $SERVER=(Join-Path $KNOVA_HOME "Software\Platform\Server")
    $TOMCAT_HOME = (Join-Path $ACCESSORIES_PATH $NewTomcatFolder)
    $TOMCAT_SERVICE_DISPLAYNAME="Knova Tomcat ${TOMCAT_VERSION}"
    $TOMCAT_SERVICE_DESCRIPTION="Knova Tomcat Server - http://tomcat.apache.org/"
    $LIBPATH=".;./KS/bin;${TOMCAT_HOME}\bin\bootstrap.jar;/KS/config"
    $SERVICE_STARTUP_MODE="manual"

    $TOMCAT_SERVICE_EXE = (Join-Path ${TOMCAT_HOME} "bin\${TOMCAT_SERVICE_NAME}.exe")

    $jvmoptions = @(
        "-Dcatalina.home=${TOMCAT_HOME}#",
        "-Dcatalina.base=${TOMCAT_HOME}#",
        "-Djava.endorsed.dirs=${TOMCAT_HOME}\endorsed#",
        "-Djava.io.tmpdir=${TOMCAT_HOME}\temp#",
        "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#",
        "-Djava.util.logging.config.file=${TOMCAT_HOME}\conf\logging.properties#",
        "-DKNOVA_CONFIGFILE=${KNOVA_HOME}\Software\Platform\Config\nsadmin.xml#",
        "-Djava.library.path='${LIBPATH}'#",
        "-Dhazelcast.client.config=${KNOVA_HOME}\Software\Platform\Config\hazelcast-client.xml#",
        "-Djava.security.auth.login.config=kanisa_jaas.config#",
        "-DKS_HOME=./KS#",
        "-XX:+MustCallLoadClassInternal#",
        "-Dlog4j.configuration.dir=..\Config\SystemLogging#",
        "-Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE=true#",
        "-DKM_WIDGET_CONFIGFOLDER=${KNOVA_HOME}\Software\Platform\Config\WidgetConfig#"
    )

    Write-Host "Configuring tomcat service"
    & $TOMCAT_SERVICE_EXE "//IS//${TOMCAT_SERVICE_NAME}" `
        --Description "${TOMCAT_SERVICE_DESCRIPTION}" `
        --DisplayName "${TOMCAT_SERVICE_DISPLAYNAME}" `
        --Install "${TOMCAT_HOME}\bin\${TOMCAT_SERVICE_NAME}.exe" `
        --LogPath "${TOMCAT_HOME}\logs" `
        --StdOutput auto `
        --StdError auto `
        --Classpath "${TOMCAT_HOME}\bin\bootstrap.jar;${TOMCAT_HOME}\bin\tomcat-juli.jar" `
        --Jvm "${jvmdll}" `
        --StartMode jvm `
        --StopMode jvm `
        --StartPath "${server}" `
        --StopPath "${server}" `
        --StartClass org.apache.catalina.startup.Bootstrap `
        --StopClass org.apache.catalina.startup.Bootstrap `
        --StartParams start `
        --StopParams stop  `
        --JvmOptions ($jvmoptions -join "") `
        --JvmOptions9 "--add-opens=java.base/java.lang=ALL-UNNAMED#--add-opens=java.base/java.io=ALL-UNNAMED#--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED" `
        --Startup "${SERVICE_STARTUP_MODE}" `
        --JvmMs 1024 `
        --JvmMx 1024 `
        --JvmSs 256
}

function Perform-PostInstall()
{
    Write-Host "Performing post install"

    $oldCatalinaFolder = (Join-Path ${ExistingTomcatFolder} "conf\Catalina")
    $newConfFolder = (Join-Path ${NewTomcatFolder} "conf")
    Copy-Item -Recurse -Force $oldCatalinaFolder $newConfFolder

    $oldWebAppsFolder = (Join-Path ${ExistingTomcatFolder} "webapps")
    $newWebAppsFolder = (Join-Path ${NewTomcatFolder} "webapps")
    Copy-Item -Recurse -Force "${oldWebAppsFolder}\*.war" $newWebAppsFolder

    $oldCatalinaProperties = (Join-Path ${ExistingTomcatFolder} "conf\catalina.properties")
    $commonloaderOption = (Get-Content $oldCatalinaProperties ) | Where-Object { $_.StartsWith("common.loader") }

    $newCatalinaProperties = (Join-Path ${NewTomcatFolder} "conf\catalina.properties")
    
    (Get-Content $newCatalinaProperties) -replace "^\b*common\.loader.*$", $commonloaderOption |
        Set-Content $newCatalinaProperties
}

try {
    Check-Env

    Push-Location $ACCESSORIES_PATH
    Stop-KnovaTomcatService
    Take-Backup
    Expand-NewTomcatZip
    Remove-OldTomcatService
    Install-NewTomcatService
    Perform-PostInstall
} catch {
    Write-Error "Error while upgrading tomcat: $_"
} finally {
    Pop-Location
}

# SIG # Begin signature block
# MIIblgYJKoZIhvcNAQcCoIIbhzCCG4MCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU+Xt3JX0wxVqU0ddrXK0lZ2kW
# mj6gghaOMIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UE
# BhMCVVMxEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAY
# BgNVBAoTEUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290
# IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3
# MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMw
# EQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjEx
# MC8GA1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBH
# MjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3
# gElY6SKDE6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuer
# GVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOo
# BJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SS
# YmlRJQVhGkSBjCypQ5Yj36w6gZoOKcU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