From e406347bce623eed80be2645b484d1a06a0a9335 Mon Sep 17 00:00:00 2001 From: FlorianGareis Date: Thu, 29 Feb 2024 00:33:21 +0000 Subject: [PATCH 1/2] Add `app_name` parameter to code-server --- code-server/main.tf | 7 +++++++ code-server/run.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code-server/main.tf b/code-server/main.tf index b45d4fe4..fbf26bbc 100644 --- a/code-server/main.tf +++ b/code-server/main.tf @@ -26,6 +26,12 @@ variable "port" { default = 13337 } +variable "app_name" { + type = string + description = "The app name for the code-server application." + default = "code-server" +} + variable "display_name" { type = string description = "The display name for the code-server application." @@ -84,6 +90,7 @@ resource "coder_script" "code-server" { script = templatefile("${path.module}/run.sh", { VERSION : var.install_version, EXTENSIONS : join(",", var.extensions), + APP_NAME : var.app_name, PORT : var.port, LOG_PATH : var.log_path, INSTALL_PREFIX : var.install_prefix, diff --git a/code-server/run.sh b/code-server/run.sh index 1212beb5..89d74b98 100755 --- a/code-server/run.sh +++ b/code-server/run.sh @@ -47,4 +47,4 @@ fi echo "👷 Running code-server in the background..." echo "Check logs at ${LOG_PATH}!" -$CODE_SERVER --auth none --port ${PORT} > ${LOG_PATH} 2>&1 & +$CODE_SERVER --auth none --port ${PORT} --app-name ${APP_NAME} > ${LOG_PATH} 2>&1 & From cc6db7edad2761a0c86f66c7e0791b3d7f38589c Mon Sep 17 00:00:00 2001 From: FlorianGareis Date: Tue, 5 Mar 2024 21:53:30 +0000 Subject: [PATCH 2/2] Add quotes and use `display_name` --- code-server/main.tf | 8 +------- code-server/run.sh | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/code-server/main.tf b/code-server/main.tf index fbf26bbc..97a40f82 100644 --- a/code-server/main.tf +++ b/code-server/main.tf @@ -26,12 +26,6 @@ variable "port" { default = 13337 } -variable "app_name" { - type = string - description = "The app name for the code-server application." - default = "code-server" -} - variable "display_name" { type = string description = "The display name for the code-server application." @@ -90,7 +84,7 @@ resource "coder_script" "code-server" { script = templatefile("${path.module}/run.sh", { VERSION : var.install_version, EXTENSIONS : join(",", var.extensions), - APP_NAME : var.app_name, + APP_NAME : var.display_name, PORT : var.port, LOG_PATH : var.log_path, INSTALL_PREFIX : var.install_prefix, diff --git a/code-server/run.sh b/code-server/run.sh index 89d74b98..f6229f33 100755 --- a/code-server/run.sh +++ b/code-server/run.sh @@ -47,4 +47,4 @@ fi echo "👷 Running code-server in the background..." echo "Check logs at ${LOG_PATH}!" -$CODE_SERVER --auth none --port ${PORT} --app-name ${APP_NAME} > ${LOG_PATH} 2>&1 & +$CODE_SERVER --auth none --port ${PORT} --app-name "${APP_NAME}" > ${LOG_PATH} 2>&1 &