File tree Expand file tree Collapse file tree 3 files changed +37
-17
lines changed Expand file tree Collapse file tree 3 files changed +37
-17
lines changed Original file line number Diff line number Diff line change 7
7
"containerEnv" : {
8
8
"DEVELOPMENT" : " True"
9
9
},
10
- "settings" : {
11
- "terminal.integrated.shell.linux" : " /bin/bash" ,
12
- "go.useGoProxyToCheckForToolUpdates" : false ,
13
- "go.useLanguageServer" : true ,
14
- "go.gopath" : " /go" ,
15
- "go.goroot" : " /usr/local/go" ,
16
- "go.toolsGopath" : " /go/bin" ,
17
- "go.lintTool" :" golangci-lint" ,
18
- "go.lintFlags" : [
19
- " --fast"
20
- ]
21
- },
22
- "extensions" : [
23
- " golang.Go"
24
- ]
10
+ "customizations" : {
11
+ "vscode" : {
12
+ "settings" : {
13
+ "terminal.integrated.shell.linux" : " /bin/bash" ,
14
+ "go.useGoProxyToCheckForToolUpdates" : false ,
15
+ "go.useLanguageServer" : true ,
16
+ "go.gopath" : " /go" ,
17
+ "go.goroot" : " /usr/local/go" ,
18
+ "go.toolsGopath" : " /go/bin" ,
19
+ "go.lintTool" :" golangci-lint" ,
20
+ "go.lintFlags" : [
21
+ " --fast"
22
+ ]
23
+ },
24
+ "extensions" : [" golang.Go" ]
25
+ }
26
+ }
25
27
}
Original file line number Diff line number Diff line change @@ -57,7 +57,13 @@ func httpSupervisorProxy(w http.ResponseWriter, r *http.Request) {
57
57
log .Printf ("Proxy request: %s" , r .URL .Path )
58
58
59
59
// Base Supervisor URL
60
- u , err := url .Parse ("http://supervisor/" )
60
+ supervisorHost := "supervisor"
61
+
62
+ if development && os .Getenv ("SUPERVISOR_HOST" ) != "" {
63
+ supervisorHost = os .Getenv ("SUPERVISOR_HOST" )
64
+ }
65
+
66
+ u , err := url .Parse ("http://" + supervisorHost + "/" )
61
67
if err != nil {
62
68
// Handle error in parsing URL
63
69
w .Write ([]byte (err .Error ()))
@@ -100,6 +106,14 @@ func httpSupervisorProxy(w http.ResponseWriter, r *http.Request) {
100
106
// Add authorization header
101
107
r .Header .Add ("Authorization" , "Bearer " + os .Getenv ("SUPERVISOR_TOKEN" ))
102
108
109
+ if cleanPath == "/logs" {
110
+ // for logs download add text/plain headers
111
+ r .Header .Add ("Accept" , "text/plain" )
112
+ } else if cleanPath == "/logs/follow" {
113
+ // Set FlushInterval to enable streaming
114
+ proxy .FlushInterval = - 1
115
+ }
116
+
103
117
// Forward the request
104
118
proxy .ServeHTTP (w , r )
105
119
}
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ var development bool
17
17
func main () {
18
18
development = (os .Getenv ("DEVELOPMENT" ) == "True" )
19
19
20
- if development {
20
+ if development && os .Getenv ("FRONTEND_PATH" ) != "" {
21
+ wwwRoot = os .Getenv ("FRONTEND_PATH" ) + "/landing-page/dist/"
22
+ } else if development {
21
23
wwwRoot = "./rootfs/usr/share/www/"
22
24
} else {
23
25
wwwRoot = "/usr/share/www/"
@@ -27,6 +29,8 @@ func main() {
27
29
http .HandleFunc ("/api/" , httpUnauthorized )
28
30
http .HandleFunc ("/auth/token" , httpBad )
29
31
http .HandleFunc ("/observer/logs" , httpLogs )
32
+ http .HandleFunc ("/supervisor/supervisor/logs" , httpSupervisorProxy )
33
+ http .HandleFunc ("/supervisor/supervisor/logs/follow" , httpSupervisorProxy )
30
34
http .HandleFunc ("/supervisor/resolution/" , httpSupervisorProxy )
31
35
http .HandleFunc ("/supervisor/network/" , httpSupervisorProxy )
32
36
You can’t perform that action at this time.
0 commit comments