Skip to content

Commit

Permalink
Merge pull request #433 from gaulzhw/master
Browse files Browse the repository at this point in the history
bugfix: dockerfile timezone & exec container
  • Loading branch information
gaulzhw authored Jun 20, 2019
2 parents 380a018 + b0d9d78 commit 489331f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 41 deletions.
3 changes: 3 additions & 0 deletions Dockerfile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ FROM openresty/openresty:1.15.8.1-1-centos

COPY --from=frontend /workspace/dist/ /usr/local/openresty/nginx/html/

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
sed -i '/index index.html index.htm;/a\ try_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf

CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/Qihoo360/wayne
go 1.12

require (
github.com/360yun/sockjs-go v0.0.0-20190620042557-e70edfda8e57
github.com/astaxie/beego v1.11.1
github.com/certifi/gocertifi v0.0.0-20190410005359-59a85de7f35e // indirect
github.com/davecgh/go-spew v1.1.1
Expand All @@ -17,7 +18,6 @@ require (
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gorilla/websocket v1.4.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/igm/sockjs-go v2.0.0+incompatible // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/json-iterator/go v1.1.6 // indirect
Expand All @@ -32,7 +32,6 @@ require (
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/igm/sockjs-go.v2 v2.0.0
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ldap.v2 v2.5.1
k8s.io/api v0.0.0-20190413052509-3cc1b3fb6d0f
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/360yun/sockjs-go v0.0.0-20190618082940-1840ed98ab88 h1:t6V08CdB/3TZf4OdObeN2yS0Haf2cS2EDj9yd4ycAUw=
github.com/360yun/sockjs-go v0.0.0-20190618082940-1840ed98ab88/go.mod h1:PrKs1z9kRAhPXVg4S0zxqfgmbBRu//Q84EitcZXu1UM=
github.com/360yun/sockjs-go v0.0.0-20190620042557-e70edfda8e57 h1:4jUXsuZKNQs88HYOqguLNPgoYpXuVpOG+SMkme/DPRw=
github.com/360yun/sockjs-go v0.0.0-20190620042557-e70edfda8e57/go.mod h1:5GVPECHzBCEeajQeridxM/xj2p9fShBZo7/kX2rl9zA=
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/astaxie/beego v1.11.1 h1:6DESefxW5oMcRLFRKi53/6exzup/IR6N4EzzS1n6CnQ=
github.com/astaxie/beego v1.11.1/go.mod h1:i69hVzgauOPSw5qeyF4GVZhn7Od0yG5bbCGzmhbWxgQ=
Expand Down
16 changes: 0 additions & 16 deletions hack/kubernetes/wayne-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ data:
RAVEN_DSN: 'RAVEN_DSN'
};
default.conf: |-
server {
listen 80;
server_name localhost;
location / {
root /usr/local/openresty/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
---

apiVersion: apps/v1
Expand All @@ -50,8 +39,6 @@ spec:
items:
- key: config.js
path: config.js
- key: default.conf
path: default.conf
containers:
- name: wayne
image: '360cloud/wayne-frontend:latest'
Expand All @@ -66,9 +53,6 @@ spec:
- name: config
mountPath: /usr/local/openresty/nginx/html/config.js
subPath: config.js
- name: config
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
imagePullPolicy: Always

---
Expand Down
17 changes: 0 additions & 17 deletions src/backend/controllers/index.go

This file was deleted.

2 changes: 1 addition & 1 deletion src/backend/controllers/kubernetes/pod/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/Qihoo360/wayne/src/backend/util/hack"
"github.com/Qihoo360/wayne/src/backend/util/logs"
"github.com/astaxie/beego"
"gopkg.in/igm/sockjs-go.v2/sockjs"
"github.com/360yun/sockjs-go/sockjs"
"k8s.io/api/core/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
Expand Down
4 changes: 0 additions & 4 deletions src/backend/routers/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"net/http"
"path"

"github.com/Qihoo360/wayne/src/backend/controllers"
"github.com/Qihoo360/wayne/src/backend/controllers/apikey"
"github.com/Qihoo360/wayne/src/backend/controllers/app"
"github.com/Qihoo360/wayne/src/backend/controllers/appstarred"
Expand Down Expand Up @@ -442,7 +441,4 @@ func init() {
beego.AddNamespace(nsWithOpenAPI)

beego.AddNamespace(nsWithKubernetesProxy)

beego.Router("/*", &controllers.IndexController{})

}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ export class PodTerminalComponent implements OnInit, OnDestroy {
.subscribe(
response => {
const session = response.data.sessionId;
const url = `/ws/pods/exec?${session}`;
const configUrl = (window as any).CONFIG.URL;
const url = `${configUrl}/ws/pods/exec?${session}`;
this.socket = new SockJS(url);
this.socket.onopen = this.onConnectionOpen.bind(this, response.data);
this.socket.onmessage = this.onConnectionMessage.bind(this);
Expand Down

0 comments on commit 489331f

Please sign in to comment.