Update template

This commit is contained in:
ChenKaiLiuG
2025-11-17 00:53:51 +08:00
parent 61e5e9f360
commit 3a75c55ee7
4 changed files with 7 additions and 30 deletions

View File

@@ -39,8 +39,8 @@ coder templates create -d ./template --name vscode
## 步驟 4使用 VSCode + Copilot ## 步驟 4使用 VSCode + Copilot
1. Workspace 啟動後 → 點擊 "code-server" 1. Workspace 啟動後 → 在 Dashboard 中應看到 "code" 應用
2. 進入 VSCode 2. 點擊 "code" 進入 VSCode
3. 左側 Extensions → 搜尋 "GitHub Copilot" 3. 左側 Extensions → 搜尋 "GitHub Copilot"
4. 安裝並授權 4. 安裝並授權
5. 開始寫代碼Copilot 自動完成! 5. 開始寫代碼Copilot 自動完成!

View File

@@ -124,6 +124,9 @@ module "code-server" {
agent_id = coder_agent.main.id agent_id = coder_agent.main.id
order = 1 order = 1
# 定義 subdomain讓 Coder 可以在 Dashboard 顯示 code-server 按鈕
subdomain = "code"
# code-server 會自動使用: # code-server 會自動使用:
# - 認證:繼承 Coder 的 OIDC (GitHub) 認證 # - 認證:繼承 Coder 的 OIDC (GitHub) 認證
# - 自動存檔code-server 內建 auto-save # - 自動存檔code-server 內建 auto-save

View File

@@ -86,8 +86,8 @@ coder templates create \
4. **進入 VSCode** 4. **進入 VSCode**
``` ```
Workspace 啟動後 → 點擊 "code-server" Workspace 啟動後 → 在 Dashboard 中應看到 "code" 應用
→ 進入網頁版 VSCode 點擊進入網頁版 VSCode
``` ```
--- ---

View File

@@ -1,26 +0,0 @@
# 此文件定義 template 的可配置變數
# 使用者在建立 Workspace 時可以填入這些參數
variable "github_token" {
description = "GitHub Personal Access Token for GitHub Copilot authentication (optional, will auto-use OIDC if not provided)"
type = string
sensitive = true
default = ""
# 使用者提示
validation {
condition = length(var.github_token) == 0 || startswith(var.github_token, "ghp_")
error_message = "GitHub token should start with 'ghp_' or be empty."
}
}
# 未來可擴展的變數(示例,目前不需要):
# variable "extensions" {
# description = "VSCode extensions to auto-install"
# type = list(string)
# default = [
# "github.copilot",
# "ms-vscode.cpptools",
# "ms-python.python"
# ]
# }