Skip to content

katorlys-samples/terraform-coder-dotfiles-after-code-server

Repository files navigation

Coder Dotfiles after code-server Module

Terraform Module to install dotfiles after code-server installation in Coderv2.

Pull Requests Issues License

Introduction

This module is copied from Coder code-server Module and Coder Dotfiles Module (Both licensed under Apache License 2.0), and adds the feature of executing the dotfiles install script after code-server installation.

This is a temporary fix for issue https://github.com/coder/coder/issues#10352.

By using this module, you don't need to use the Coder code-server Module and Coder Dotfiles Module anymore, and you'll never see /tmp/code-server/bin/code-server: 12: /tmp/code-server/node: Text file busy if you want to install code-server installation in Coderv2 from your dotfiles now.

Examples

Combine Coder code-server Module and Coder Dotfiles Module together.

module "dotfiles-after-code-server" {
  source         = "katorlys-samples/dotfiles-after-code-server/coder"
  version        = "0.1.0"
  agent_id       = coder_agent.example.id
  folder         = "/home/coder"
}

How?

This modules combines the Coder code-server Module and Coder Dotfiles Module together in one module. Then, it executes the original dotfiles install script right after code-server install script is done. (See run.sh for detailed information)

Why?

I initially intended to fix the issue privately. However, the shell scripts on Windows use \r\n for End of Line instead of \n, and Coder cannot automatically convert them, causing script execution to fail.

Since I deploy the Coder instance using Docker, I can only copy the script to the online editor. Additionally, the Upload template function is broken, preventing me from packaging and uploading the scripts.

All attempts failed, so I had no choice but to publish a module from Git to avoid the End of Line issue.

BACK TO TOP


Copyright © 2024-present Katorly Lab

License