fix(DVLSForLinux): fix DatabaseName parameter and add multi-instance support#19
Open
Alexandre Martigny (AlexMartigny) wants to merge 5 commits intomainfrom
Open
fix(DVLSForLinux): fix DatabaseName parameter and add multi-instance support#19Alexandre Martigny (AlexMartigny) wants to merge 5 commits intomainfrom
Alexandre Martigny (AlexMartigny) wants to merge 5 commits intomainfrom
Conversation
…LSAPP constant The `-DatabaseName` parameter was accepted and stored in `$DVLSVariables.DatabaseName` but never used when calling `New-DPSInstallConfiguration`. Instead, `$DVLSVariables.DVLSAPP` (hardcoded to 'dvls') was passed, causing all installations to use 'dvls' as the database name regardless of what the user specified. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… multi-instance support New parameters allow installing multiple DVLS instances on the same machine without collisions: - `-DpsPath` (default: /opt/devolutions/dvls) — install directory - `-Port` (default: 5000) — Kestrel listening port - `-ServiceName` (default: dvls) — systemd service name and syslog identifier All previously hardcoded references to '/opt/devolutions/dvls', port 5000, and 'dvls.service' now use these parameters. Bash wrapper updated with matching --dps-path, --port, --service-name options. Backward compatible — all defaults match previous behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rameter - UseEncryptedConnection and TrustServerCertificate were reading from non-existent keys ($DVLSVariables.UseEncryptedConnection instead of $DVLSVariables.DatabaseEncryptedConnection), passing $null to New-DPSInstallConfiguration and causing NullReferenceException in New-DPSAppsettings. - Add -DatabasePort parameter (default: 1433) so users don't need to embed the port in the host string. Host and port are combined as "host,port" when calling New-DPSInstallConfiguration. Interactive mode prompts for port separately. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the user runs the script from the target directory (e.g. /opt/devolutions/dvls2), chmod 550 makes the CWD inaccessible to the current user, causing all subsequent commands (sg, id, getent) to fail with "Permission denied". Fix: Push-Location /tmp before the sudo block, Pop-Location after validation. Also made useradd/groupadd idempotent to suppress "already exists" errors on multi-instance installs.
The sg command cannot activate group membership in the parent PowerShell process — it only activates it for the subprocess it spawns. This means the current user (alexm) never gains effective dvls group access, causing all DPS cmdlet calls to fail with NullReferenceException because they cannot access the 550-permission DVLS directory. Fix: wrap DPS install cmdlets and cert appsettings update in sudo pwsh blocks with Import-Module, matching the existing pattern used for user creation, extraction, and systemd sections.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five fixes to
install-dvls.ps1andinstall-dvls.shenabling multi-instance DVLS installations on Linux. All fixes tested end-to-end — second instance installed successfully at/opt/devolutions/dvls2(port 5001, servicedvls2, DBdvls-linux-2).1. DatabaseName parameter ignored (commit 1)
$DVLSVariables.DVLSAPP(hardcoded'dvls') was passed toNew-DPSInstallConfigurationinstead of$DVLSVariables.DatabaseName, causing all installations to useInitial Catalog=dvlsregardless of user input.2. Multi-instance parameters (commit 2)
-DpsPath/opt/devolutions/dvls-Port5000-ServiceNamedvlsAll previously hardcoded references now use these parameters. Bash wrapper updated with matching
--dps-path,--port,--service-nameoptions. Backward compatible.3. Property name mismatch + DatabasePort (commit 3)
UseEncryptedConnection/TrustServerCertificateread from non-existent keys ($DVLSVariables.UseEncryptedConnectioninstead of$DVLSVariables.DatabaseEncryptedConnection), passing$nulland causingNullReferenceExceptioninNew-DPSAppsettings-DatabasePortparameter (default: 1433) — host and port combined as"host,port"forNew-DPSInstallConfiguration4. CWD permission denied after chmod 550 (commit 4)
After
chmod 550on the target directory, subsequent commands (sg,id,getent) failed with "Permission denied" if the user ran the script from inside that directory. Fix:Push-Location /tmpbefore the permission block,Pop-Locationafter validation. Also madeuseradd/groupaddidempotent for multi-instance installs.5. DPS cmdlets as sudo (commit 5)
sgcannot activate group membership in a parent PowerShell process — it only applies to the subprocess it spawns. This means the current user cannot access the 550 DVLS directory, and all DPS cmdlets (New-DPSInstallConfiguration,New-DPSAppsettings,New-DPSDatabase, etc.) fail withNullReferenceException. Fix: wrapped the entire DPS cmdlet section insudo pwsh -Command { ... }blocks withImport-Module.Test plan
-DatabaseName "dvls-linux-2"— verifiedappsettings.jsoncontains correct catalog-DpsPath /opt/devolutions/dvls2 -Port 5001 -ServiceName dvls2— second instance installs without affecting first🤖 Generated with Claude Code