mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: connect terminal service to backend
feat: put terminal service into container refactor: separate main into terminal and websocket feat: create zsh using commander in home feat: pass backendUrl to container feat: pass token to ws server to cmd-hook feat: gen terminal access token for frontend feat: success to connect through traefik fix: handle invalid jwt feat: connect to session container via traefik
This commit is contained in:
1 parent
0b08a9a5d9
commit
5e81db2759
20 files changed
+281
-209
No files matched your search
@@ -48,7 +48,11 @@ func main() {
|
||||
|
||||
payload.Params = params
|
||||
|
||||
apiEndpoint := os.Getenv("API_ENDPOINT")
|
||||
backendUrl := os.Getenv("BACKEND_URL")
|
||||
if backendUrl == "" {
|
||||
fmt.Fprintf(os.Stderr, "BACKEND_URL is not set\n")
|
||||
os.Exit(1)
|
||||
}
|
||||
token := os.Getenv("TOKEN")
|
||||
|
||||
jsonData, err := json.MarshalIndent(payload, "", " ")
|
||||
@@ -58,7 +62,7 @@ func main() {
|
||||
}
|
||||
|
||||
fmt.Println(string(jsonData))
|
||||
req, err := http.NewRequest("POST", fmt.Sprintf("%s/api/v1/commands", apiEndpoint), bytes.NewBuffer(jsonData))
|
||||
req, err := http.NewRequest("POST", fmt.Sprintf("%s/api/v1/commands", backendUrl), bytes.NewBuffer(jsonData))
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error creating request: %v\n", err)
|
||||
os.Exit(1)
|
||||
|
||||
Reference in new issue
Block a user