From 3238c2d3a45539804c1ae5f14176a2b0948f043a Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Wed, 20 Nov 2024 11:46:48 +0100 Subject: [PATCH 1/8] Add KB article link --- powershell/Repair-Alteryx.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/powershell/Repair-Alteryx.ps1 b/powershell/Repair-Alteryx.ps1 index 643f338..a6d60f1 100644 --- a/powershell/Repair-Alteryx.ps1 +++ b/powershell/Repair-Alteryx.ps1 @@ -11,6 +11,9 @@ function Repair-Alteryx { Author: Florian Carrier Creation date: 2022-04-22 Last modified: 2022-04-27 + + .LINK + https://knowledge.alteryx.com/index/s/article/How-To-and-When-to-run-a-manual-reindex #> [CmdletBinding ( SupportsShouldProcess = $true From bb7d58e45e0761c0027785deee4f3bc246aa1307 Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Wed, 20 Nov 2024 11:47:13 +0100 Subject: [PATCH 2/8] Update default version --- conf/default.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/default.ini b/conf/default.ini index 1a90c19..4cef005 100644 --- a/conf/default.ini +++ b/conf/default.ini @@ -39,7 +39,7 @@ ServerAdminAPI = server.key # Installation language Language = English # Version -Version = 2024.1.1.136 +Version = 2024.2.1.14 # Service name ServiceName = AlteryxService # InstallAware log From 5b43b41062fb0530991cc7dd8363df2c259fbf73 Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Wed, 20 Nov 2024 13:04:48 +0100 Subject: [PATCH 3/8] Update PS version requirement --- Deploy-Alteryx.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Deploy-Alteryx.ps1 b/Deploy-Alteryx.ps1 index 415985f..f0dcb3f 100644 --- a/Deploy-Alteryx.ps1 +++ b/Deploy-Alteryx.ps1 @@ -1,4 +1,4 @@ -#Requires -Version 5.0 +#Requires -Version 5.1 #Requires -RunAsAdministrator <# From f472279caf4b34aaa444fbc6ac6978cddedf0330 Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Wed, 9 Oct 2024 14:54:05 +0200 Subject: [PATCH 4/8] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 08a42cd..57f7b3b 100644 --- a/README.md +++ b/README.md @@ -69,13 +69,13 @@ Download the latest stable version from the [`alteryx-deploy`](https://github.com/Akaizoku/alteryx-deploy) GitHub repository. ```powershell -curl --remote-name --remote-header-name "https://github.com/Akaizoku/alteryx-deploy/releases/download/1.1.2/alteryx-deploy.1.1.2.zip" +curl --remote-name --remote-header-name "https://github.com/Akaizoku/alteryx-deploy/releases/download/2.0.0/alteryx-deploy-v2.0.0.zip" ``` Alternatively, if you do not wish to install the PowerShell modules required as dependencies, you can download the portable version. ```powershell -curl --remote-name --remote-header-name "https://github.com/Akaizoku/alteryx-deploy/releases/download/1.1.2/alteryx-deploy.1.1.2.portable.zip" +curl --remote-name --remote-header-name "https://github.com/Akaizoku/alteryx-deploy/releases/download/2.0.0/alteryx-deploy-v2.0.0-portable.zip" ``` ### Configuration @@ -518,7 +518,7 @@ Below are the steps to ping the Alteryx application. ### Open -Open the user interface of the Alteryx applciation. +Open the user interface of the Alteryx application. Below are the steps to open the Alteryx application. @@ -562,7 +562,7 @@ Below is an example of a successful installation log: This module depends on the usage of functions provided by two PowerShell modules: 1. PowerShell Tool Kit ([PSTK]) module (version 1.2.6); -2. Alteryx PowerShell ([PSAYX]) module (version 1.1.0). +2. Alteryx PowerShell ([PSAYX]) module (version 1.1.1). ## Compatibility From b015162f37442538293a8c8f410362f13e527915 Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Wed, 20 Nov 2024 15:27:03 +0100 Subject: [PATCH 5/8] Remove invalid parameters --- powershell/Invoke-SetupScript.ps1 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/powershell/Invoke-SetupScript.ps1 b/powershell/Invoke-SetupScript.ps1 index c8024a2..240c567 100644 --- a/powershell/Invoke-SetupScript.ps1 +++ b/powershell/Invoke-SetupScript.ps1 @@ -10,7 +10,7 @@ function Invoke-SetupScript { File name: Invoke-SetupScript.ps1 Author: Florian Carrier Creation date: 2022-05-03 - Last modified: 2024-10-08 + Last modified: 2024-11-20 #> [CmdletBinding ( SupportsShouldProcess = $true @@ -130,10 +130,9 @@ function Invoke-SetupScript { $ConfigureLicenseAPI = $true if (Test-Path -Path $LicenseAPIPath) { try { - $RefreshAPIToken = ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseAPIPath)) -AsPlainText + $RefreshAPIToken = ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseAPIPath)) if ($RefreshAPIToken -notin ($null, "")) { Write-Log -Type "WARN" -Message "License Portal API refresh token has already been configured" - Write-Log -Type "DEBUG" -Message $RefreshAPIToken $ConfigureLicenseAPI = Confirm-Prompt -Prompt "Do you want to reconfigure the License Portal API refresh token?" } } @@ -143,9 +142,9 @@ function Invoke-SetupScript { } } if ($ConfigureLicenseAPI) { + # Input in plain text to trim and prevent issues $LicenseAPIToken = (Read-Host -Prompt $LicenseAPIPrompt).Trim() $EncryptedLicenseAPIToken = ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String $LicenseAPIToken.ToString() -AsPlainText -Force) - # Write-Log -Type "DEBUG" -Message $EncryptedLicenseAPIToken Write-Log -Type "DEBUG" -Message $LicenseAPIPath Set-Content -Path $LicenseAPIPath -Value $EncryptedLicenseAPIToken -NoNewline -Force if (Test-Path -Path $LicenseAPIPath) { @@ -238,14 +237,14 @@ function Invoke-SetupScript { $LicenseFilePath = Join-Path -Path "$PSScriptRoot/.." -ChildPath "$($Properties.ResDirectory)/$($Properties.LicenseFile)" $ConfigureLicenseFile = $true if (Test-Path -Path $LicenseFilePath) { - $LicenseKeys = ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseFilePath)) -AsPlainText + $LicenseKeys = ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseFilePath)) if ($LicenseKeys -notin ($null, "")) { Write-Log -Type "WARN" -Message "License keys have already been configured" - Write-Log -Type "DEBUG" -Message $LicenseKeys $ConfigureLicenseFile = Confirm-Prompt -Prompt "Do you want to overwrite the existing license keys?" } } if ($ConfigureLicenseFile) { + # Input in plain text to trim and prevent issues $LicenseKeys = (Read-Host -Prompt "Enter Alteryx license key(s)").Trim() try { $EncryptedLicenseKeys = ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String $LicenseKeys -AsPlainText -Force) From d0ae4da04e06ebec6788ec698aa2b354c53b07e2 Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Wed, 20 Nov 2024 15:27:35 +0100 Subject: [PATCH 6/8] Fix token decryption --- powershell/Invoke-DownloadAlteryx.ps1 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/powershell/Invoke-DownloadAlteryx.ps1 b/powershell/Invoke-DownloadAlteryx.ps1 index dd8a6fa..763b9b0 100644 --- a/powershell/Invoke-DownloadAlteryx.ps1 +++ b/powershell/Invoke-DownloadAlteryx.ps1 @@ -10,7 +10,7 @@ function Invoke-DownloadAlteryx { File name: Invoke-DownloadAlteryx.ps1 Author: Florian Carrier Creation date: 2024-09-04 - Last modified: 2024-10-08 + Last modified: 2024-11-20 #> [CmdletBinding ( SupportsShouldProcess = $true @@ -55,7 +55,7 @@ function Invoke-DownloadAlteryx { $RegistryKey = "HKLM:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\SRC\Alteryx" # License API refresh token $LicenseAPIPath = Join-Path -Path $Properties.ResDirectory -ChildPath $Properties.LicenseAPIFile - $RefreshToken = (ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseAPIPath)) -AsPlainText) -replace "`r|`n", "" + $RefreshToken = ([System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR((ConvertTo-SecureString -String (Get-Content -Path $LicenseAPIPath))))) -replace "`r|`n", "" # Placeholder $Skip = $false } @@ -68,7 +68,7 @@ function Invoke-DownloadAlteryx { if ($null -eq $RefreshToken) { Write-Log -Type "ERROR" -Message "The Alteryx license portal API refresh token has not been configured" if (-Not $Unattended) { - $RefreshToken = Read-Host -Prompt "Enter your Alteryx license portal API refresh token" + $RefreshToken = (Read-Host -Prompt "Enter your Alteryx license portal API refresh token").Trim() } else { Write-Log -Type "ERROR" -Message "Download process cannot proceed" $DownloadProcess = Update-ProcessObject -ProcessObject $DownloadProcess -Status "Failed" -ErrorCount 1 -ExitCode 1 @@ -144,7 +144,7 @@ function Invoke-DownloadAlteryx { "Server" = $ProductID # "PredictiveTools" = "Predictive Tools" # Included within Server "IntelligenceSuite" = "Alteryx Intelligence Suite" - # "DataPackages" = "Data Packages" # + # "DataPackages" = "Data Packages" # ! Not yet supported } foreach ($Product in $Products.GetEnumerator()) { if ($InstallationProperties.$($Product.Key) -eq $true) { @@ -156,8 +156,12 @@ function Invoke-DownloadAlteryx { # Check upgrade step if (Compare-Version -Version $TargetVersion -Operator "eq" -Reference $MajorVersion) { # If minor or patch upgrade, download patch - $Release = Get-AlteryxLatestRelease -AccountID $Properties.LicenseAccountID -Token $AccessToken -ProductID $ProductID -Version $TargetVersion -Patch - $FormattedVersion = "patch version" + $PatchRelease = Get-AlteryxLatestRelease -AccountID $Properties.LicenseAccountID -Token $AccessToken -ProductID $ProductID -Version $TargetVersion -Patch + if ($null -ne $PatchRelease) { + # Overwrite default release + $Release = $PatchRelease + $FormattedVersion = "patch version" + } } } else { # Fetch latest release for add-ons From e100283bd5c5223c20778074913838550c188859 Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Wed, 20 Nov 2024 15:50:09 +0100 Subject: [PATCH 7/8] Fix license key decryption --- powershell/Invoke-ActivateAlteryx.ps1 | 5 +++-- powershell/Invoke-DeactivateAlteryx.ps1 | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/powershell/Invoke-ActivateAlteryx.ps1 b/powershell/Invoke-ActivateAlteryx.ps1 index 66bf3fa..a7726e0 100644 --- a/powershell/Invoke-ActivateAlteryx.ps1 +++ b/powershell/Invoke-ActivateAlteryx.ps1 @@ -16,7 +16,7 @@ function Invoke-ActivateAlteryx { File name: Invoke-ActivateAlteryx.ps1 Author: Florian Carrier Creation date: 2021-07-05 - Last modified: 2024-10-08 + Last modified: 2024-11-20 .LINK https://www.powershellgallery.com/packages/PSAYX @@ -79,7 +79,8 @@ function Invoke-ActivateAlteryx { $ActivateProcess = Update-ProcessObject -ProcessObject $ActivateProcess -Status "Failed" -ErrorCount 1 -ExitCode 1 return $ActivateProcess } - $Properties.LicenseKey = (ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseFilePath)) -AsPlainText) -split '[ ,]+' + # Fetch and decrypt license keys + $Properties.LicenseKey = ([System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR((ConvertTo-SecureString -String (Get-Content -Path $LicenseFilePath))))) -split '[ ,]+' } Write-Log -Type "DEBUG" -Message $Properties.LicenseKey # Count keys diff --git a/powershell/Invoke-DeactivateAlteryx.ps1 b/powershell/Invoke-DeactivateAlteryx.ps1 index 79fc2ea..4690a27 100644 --- a/powershell/Invoke-DeactivateAlteryx.ps1 +++ b/powershell/Invoke-DeactivateAlteryx.ps1 @@ -16,7 +16,7 @@ function Invoke-DeactivateAlteryx { File name: Invoke-DeactivateAlteryx.ps1 Author: Florian Carrier Creation date: 2021-11-20 - Last modified: 2024-10-08 + Last modified: 2024-11-20 .LINK https://www.powershellgallery.com/packages/PSAYX @@ -106,7 +106,8 @@ function Invoke-DeactivateAlteryx { $DeactivateProcess = Update-ProcessObject -ProcessObject $DeactivateProcess -Status "Failed" -ErrorCount 1 -ExitCode 1 return $DeactivateProcess } else { - $Properties.LicenseKey = (ConvertFrom-SecureString -SecureString (ConvertTo-SecureString -String (Get-Content -Path $LicenseFilePath)) -AsPlainText) -split '[ ,]+' + # Fetch and decrypt license keys + $Properties.LicenseKey = ([System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR((ConvertTo-SecureString -String (Get-Content -Path $LicenseFilePath))))) -split '[ ,]+' } } Write-Log -Type "DEBUG" -Message $Properties.LicenseKey From cec3a432b0b6d34f27c19a74c88f52eb1110948c Mon Sep 17 00:00:00 2001 From: Florian Carrier Date: Wed, 20 Nov 2024 16:00:08 +0100 Subject: [PATCH 8/8] Update documentation --- CHANGELOG.md | 12 ++++++++++++ README.md | 8 +++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0ccad7..6f81bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to the [`alteryx-deploy`](https://github.com/Akaizoku/altery The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.1](https://github.com/Akaizoku/alteryx-deploy/releases/2.0.1) - 2024-10-20 + +Fix key encryption and decryption issues. + +### Fixed + +- Fixed an issue with license API token and keys encryption during setup [[#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)] +- Fixed an issue with license API token and keys decryption during download [[#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)] +- Fixed an issue when license keys decryption during activation [[#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)] +- Fixed an issue when license keys decryption during deactivation [[#36](https://github.com/Akaizoku/alteryx-deploy/issues/36)] +- Fixed an issue when attempting to redownload an existing major version without any patch available + ## [2.0.0](https://github.com/Akaizoku/alteryx-deploy/releases/2.0.0) - 2024-10-08 Complete revamp to provide support for new installers (2022.3+), license portal API, as well as guardrails and usefull error handling. diff --git a/README.md b/README.md index 57f7b3b..69936ed 100644 --- a/README.md +++ b/README.md @@ -69,13 +69,13 @@ Download the latest stable version from the [`alteryx-deploy`](https://github.com/Akaizoku/alteryx-deploy) GitHub repository. ```powershell -curl --remote-name --remote-header-name "https://github.com/Akaizoku/alteryx-deploy/releases/download/2.0.0/alteryx-deploy-v2.0.0.zip" +curl --remote-name --remote-header-name "https://github.com/Akaizoku/alteryx-deploy/releases/download/2.0.1/alteryx-deploy-v2.0.1.zip" ``` Alternatively, if you do not wish to install the PowerShell modules required as dependencies, you can download the portable version. ```powershell -curl --remote-name --remote-header-name "https://github.com/Akaizoku/alteryx-deploy/releases/download/2.0.0/alteryx-deploy-v2.0.0-portable.zip" +curl --remote-name --remote-header-name "https://github.com/Akaizoku/alteryx-deploy/releases/download/2.0.1/alteryx-deploy-v2.0.1-portable.zip" ``` ### Configuration @@ -576,7 +576,8 @@ Only the first version supported is listed. Later releases should also be compat | [1.1.0] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | | [1.1.1] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | | [1.1.2] | [2021.3] | 5.0 | 1.2.5 | 1.0.1 | -| [2.0.0] | [2024.1] | 5.0 | 1.2.6 | 1.1.1 | +| [2.0.0] | [2024.1] | 5.1 | 1.2.6 | 1.1.1 | +| [2.0.1] | [2024.2] | 5.1 | 1.2.6 | 1.1.1 | ## Known issues @@ -611,4 +612,5 @@ If this occurs, simply run the command [`Stop-Transcript`](https://learn.microso [2.0.0]:https://github.com/Akaizoku/alteryx-deploy/releases/2.0.0 [2021.3]:https://help.alteryx.com/release-notes/server/server-20213-release-notes [2024.1]:https://help.alteryx.com/release-notes/en/release-notes/server-release-notes/server-2024-1-release-notes.html +[2024.2]:https://help.alteryx.com/release-notes/en/release-notes/server-release-notes/server-2024-2-release-notes.html [whitelist.alteryx.com]:(whitelist.alteryx.com)