wip: commit current progress for devolutions patch
This commit is contained in:
@@ -35,8 +35,8 @@ const SCREEN_POLL_INTERVAL_MS = 500;
|
||||
* values from the Coder workspace.
|
||||
*
|
||||
* All properties should be defined as placeholder templates in the form
|
||||
* {{ VALUE_NAME }}. The Coder module, when spun up, should then run some logic
|
||||
* to replace the template slots with actual values. These values should never
|
||||
* VALUE_NAME. The Coder module, when spun up, should then run some logic to
|
||||
* replace the template slots with actual values. These values should never
|
||||
* change from within JavaScript itself.
|
||||
*
|
||||
* @satisfies {FormFieldEntries}
|
||||
@@ -48,7 +48,7 @@ const formFieldEntries = {
|
||||
querySelector: "web-client-username-control input",
|
||||
|
||||
/** @readonly */
|
||||
value: "{{ CODER_USERNAME }}",
|
||||
value: "CODER_USERNAME",
|
||||
},
|
||||
|
||||
/** @readonly */
|
||||
@@ -57,7 +57,7 @@ const formFieldEntries = {
|
||||
querySelector: "web-client-password-control input",
|
||||
|
||||
/** @readonly */
|
||||
value: "{{ CODER_PASSWORD }}",
|
||||
value: "CODER_PASSWORD",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -89,9 +89,25 @@ resource "coder_script" "windows-rdp" {
|
||||
Start-Service 'DevolutionsGateway'
|
||||
}
|
||||
|
||||
function Patch-Devolutions-HTML {
|
||||
$root = "C:\Program Files\Devolutions\Gateway\webapp\client"
|
||||
$devolutionsHtml = "$root\index.html"
|
||||
$patch = '<script defer id="coder-patch" src="coder.js"></script>'
|
||||
$isPatched = Select-String -Path "$devolutionsHtml" -Pattern "$patch"
|
||||
if ($isPatched -e $null) {
|
||||
"templatefile("${path.module}/devolutions-patch.js", {
|
||||
CODER_USERNAME : var.admin_username,
|
||||
CODER_PASSWORD : var.admin_password,
|
||||
}" | Set-Content "$root\coder.js"
|
||||
|
||||
(Get-Content $devolutionsHtml).Replace('</app-root>', "</app-root>$patch") | Set-Content $devolutionsHtml
|
||||
}
|
||||
}
|
||||
|
||||
Set-AdminPassword -adminPassword "${var.admin_password}"
|
||||
Configure-RDP
|
||||
Install-DevolutionsGateway
|
||||
Patch-Devolutions-HTML
|
||||
|
||||
EOF
|
||||
|
||||
|
||||
Reference in New Issue
Block a user