Skip to content

Commit 713edf0

Browse files
committed
allow login.html
1 parent 06aef6d commit 713edf0

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

deploy/Dockerfile renamed to Dockerfile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
# build stage
2-
FROM quay.io/fedora/fedora:34-x86_64 AS build
3-
WORKDIR /app
4-
RUN sudo dnf install -y git golang
5-
6-
RUN git clone https://github.com/yaacov/oc-gate.git /app \
7-
&& git clone https://github.com/novnc/noVNC /app/web/public/noVNC \
8-
&& go get github.com/yaacov/oc-gate/cmd/oc-gate \
9-
&& CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/ /app/cmd/oc-gate/
2+
FROM golang:1.15 AS build
103

11-
# deploy stage
4+
WORKDIR /app
5+
COPY . .
126

13-
# quay does not have an alpine image,
14-
# an option is to switch to using fedora-minimal
15-
# another option is to use alpine (only from dockerhub)
7+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o /app/ /app/cmd/...
168

179
# FROM quay.io/fedora/fedora-minimal:34-x86_64
1810
FROM alpine

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ novnc:
4343

4444
.PHONY: image
4545
image:
46-
podman build -t yaacov/oc-gate ./deploy
46+
podman build -t yaacov/oc-gate .
4747
podman tag yaacov/oc-gate quay.io/yaacov/oc-gate
4848
# podman push quay.io/yaacov/oc-gate

pkg/proxy/proxy.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ func (s Server) AuthMiddleware(next http.Handler) http.Handler {
121121
// Log request
122122
log.Printf("%s %v: %+v", r.RemoteAddr, r.Method, r.URL)
123123

124+
if r.URL.Path == "/login.html" {
125+
next.ServeHTTP(w, r)
126+
return
127+
}
128+
124129
// Get request token from Authorization header and session cookie
125130
token, _ := s.GetRequestToken(w, r)
126131

0 commit comments

Comments
 (0)