Skip to content

Commit

Permalink
config
Browse files Browse the repository at this point in the history
Signed-off-by: haotian.qht <[email protected]>
  • Loading branch information
haotian.qht committed Aug 1, 2024
1 parent 78ad87b commit a5f1a9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions entrypoint/code-server-config-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bind-addr: 0.0.0.0:8080
auth: password
password: %s
cert: false
14 changes: 6 additions & 8 deletions entrypoint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (
"os"
"path/filepath"
"strings"

"github.com/rs/zerolog/log"

"os/exec"

"github.com/117503445/goutils"
_ "embed"
"github.com/rs/zerolog/log"
"github.com/mattn/go-isatty"
"github.com/117503445/goutils"
)

func installVscExtensions() {
Expand Down Expand Up @@ -39,6 +38,8 @@ func installVscExtensions() {
goutils.CMD("", fileVsc, "--update-extensions")
}

//go:embed code-server-config-template.yaml
var codeServerConfigTemplate string
func main() {
goutils.InitZeroLog()

Expand All @@ -55,10 +56,7 @@ func main() {
log.Warn().Msg("CODE_SERVER_PASSWORD is not set, use default password")
codeServerPassword = "123456"
}
codeServerConfigTemplate := `bind-addr: 0.0.0.0:8080
auth: password
password: %s
cert: false`

codeServerConfigText := fmt.Sprintf(codeServerConfigTemplate, codeServerPassword)

if err := os.MkdirAll(filepath.Dir(codeServerConfigPath), 0755); err != nil {
Expand Down

0 comments on commit a5f1a9c

Please sign in to comment.