Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 3f8f618

Browse files
committed
refactor: clean up final code
1 parent b23d853 commit 3f8f618

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

windows-rdp/devolutions-patch.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
* - A lot of the HTML selectors in this file will look nonstandard. This is
1313
* because they are actually custom Angular components.
1414
* - It is strongly advised that you avoid template literals that use the
15-
* placeholder syntax via the dollar sign. The Terraform script looks for
16-
* these characters so that it can inject Coder-specific values, so any
17-
* template literal that uses the character actually needs to double up each
18-
* of them. There are already a few places in this file where it couldn't be
19-
* avoided, but avoiding this as much as possible will save you some headache.
15+
* placeholder syntax via the dollar sign. The Terraform file is treating this
16+
* as a template file, and because it also uses a similar syntax, there's a
17+
* risk that some values will trigger false positives. If a template literal
18+
* must be used, be sure to use a double dollar sign to escape things.
2019
* - All the CSS should be written via custom style tags and the !important
2120
* directive (as much as that is a bad idea most of the time). We do not
2221
* control the Angular app, so we have to modify things from afar to ensure

windows-rdp/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ resource "coder_script" "windows-rdp" {
3535
display_name = "windows-rdp"
3636
icon = "https://svgur.com/i/158F.svg" # TODO: add to Coder icons
3737

38-
script = templatefile("${path.module}/windows-installation.tftpl", {
38+
script = templatefile("${path.module}/powershell-installation-script.tftpl", {
3939
admin_username = var.admin_username
4040
admin_password = var.admin_password
41+
42+
# Wanted to have this be in the powershell template file, but Terraform
43+
# doesn't allow recursive calls to the templatefile function. Have to feed
44+
# results of the JS template replace into the powershell template
4145
patch_file_contents = templatefile("${path.module}/devolutions-patch.js", {
4246
CODER_USERNAME = var.admin_username
4347
CODER_PASSWORD = var.admin_password

0 commit comments

Comments
 (0)