Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.11-alpine AS build-env
RUN apk --no-cache add git
ADD authserver /go/src/app
RUN cd /go/src/app && go get -v
RUN cd /go/src/app && go build -o goapp

# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /go/src/app /app/
ENTRYPOINT ./goapp
5 changes: 3 additions & 2 deletions authserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"strings"
"time"
"os"

cmAuth "github.com/chartmuseum/auth"
"github.com/gin-gonic/gin"
Expand All @@ -13,7 +14,7 @@ var (
tokenGenerator *cmAuth.TokenGenerator
tokenExpiry = time.Minute * 5
requiredGrantType = "client_credentials"
masterAccessKey = "MASTERKEY"
masterAccessKey = os.Getenv("AUTH_SERVER_MASTER_KEY")
)

func oauthTokenHandler(c *gin.Context) {
Expand Down Expand Up @@ -55,7 +56,7 @@ func oauthTokenHandler(c *gin.Context) {
func main() {
var err error
tokenGenerator, err = cmAuth.NewTokenGenerator(&cmAuth.TokenGeneratorOptions{
PrivateKeyPath: "../config/server.key",
PrivateKeyPath: "./config/server.key",
})
if err != nil {
panic(err)
Expand Down
Binary file removed charts/org1/repo1/mychart-0.1.0.tgz
Binary file not shown.
Binary file removed charts/org2/repo2/otherchart-0.1.0.tgz
Binary file not shown.
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
ports:
- "5001:5001"
command: "go run main.go"
environment:
- "AUTH_SERVER_MASTER_KEY=mypassword"
working_dir: "/go/src/github.com/chartmuseum/auth-server-example/authserver"
volumes:
- "./authserver:/go/src/github.com/chartmuseum/auth-server-example/authserver:ro"
Expand All @@ -26,5 +28,4 @@ services:
- "AUTH_SERVICE=localhost:5001"
- "AUTH_CERT_PATH=/config/server.pem"
volumes:
- "./config:/config:ro"
- "./charts:/charts:rw"
- "./config:/config:ro"