Skip to content

Commit

Permalink
Merge pull request #996 from Permify/next
Browse files Browse the repository at this point in the history
build: optimize Dockerfile and missing flags added
  • Loading branch information
tolgaOzen authored Jan 4, 2024
2 parents 0b2af5f + 674b650 commit 1b2fe30
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM golang:1.21-alpine3.18@sha256:d8b99943fb0587b79658af03d4d4e8b57769b21dcf08a
WORKDIR /go/src/app
RUN apk update && apk add --no-cache git
COPY . .
RUN CGO_ENABLED=0 go build -v ./cmd/permify/
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=0 go build -v ./cmd/permify/

# Step 2: Final
FROM cgr.dev/chainguard/static:latest@sha256:a2f525dac2f9ec900283ead64eb88a6037b2989630615ee8de8a2dc7bfcf152b
Expand Down
2 changes: 1 addition & 1 deletion docs/apidocs.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"info": {
"title": "Permify API",
"description": "Permify is an open source authorization service for creating fine-grained and scalable authorization systems.",
"version": "v0.6.7",
"version": "v0.6.8",
"contact": {
"name": "API Support",
"url": "https://github.com/Permify/permify/issues",
Expand Down
2 changes: 1 addition & 1 deletion internal/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var Identifier = xid.New().String()
*/
const (
// Version is the last release of the Permify (e.g. v0.1.0)
Version = "v0.6.7"
Version = "v0.6.8"

// Banner is the view for terminal.
Banner = `
Expand Down
17 changes: 13 additions & 4 deletions pkg/cmd/flags/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ func RegisterServeFlags(cmd *cobra.Command) {
panic(err)
}

flags.Bool("http-tls-enabled", conf.Server.HTTP.TLSConfig.Enabled, "switch option for HTTP tls server")
if err = viper.BindPFlag("server.http.tls.enabled", flags.Lookup("http-tls-enabled")); err != nil {
panic(err)
}
if err = viper.BindEnv("server.http.tls.enabled", "PERMIFY_HTTP_TLS_ENABLED"); err != nil {
panic(err)
}

flags.String("http-tls-key-path", conf.Server.HTTP.TLSConfig.KeyPath, "HTTP tls key path")
if err = viper.BindPFlag("server.http.tls.key", flags.Lookup("http-tls-key-path")); err != nil {
panic(err)
Expand Down Expand Up @@ -196,21 +204,22 @@ func RegisterServeFlags(cmd *cobra.Command) {
panic(err)
}

flags.String("tracer-exporter", conf.Tracer.Exporter, "export uri for tracing data")
flags.String("tracer-exporter", conf.Tracer.Exporter, "can be; jaeger, signoz, zipkin or otlp. (integrated tracing tools)")
if err = viper.BindPFlag("tracer.exporter", flags.Lookup("tracer-exporter")); err != nil {
panic(err)
}
if err = viper.BindEnv("tracer.exporter", "PERMIFY_TRACER_EXPORTER"); err != nil {
panic(err)
}

flags.String("tracer-endpoint", conf.Tracer.Endpoint, "can be; jaeger, signoz, zipkin or otlp. (integrated tracing tools)")
flags.String("tracer-endpoint", conf.Tracer.Endpoint, "export uri for tracing data")
if err = viper.BindPFlag("tracer.endpoint", flags.Lookup("tracer-endpoint")); err != nil {
panic(err)
}
if err = viper.BindEnv("tracer.endpoint", "PERMIFY_TRACER_ENDPOINT"); err != nil {
panic(err)
}

flags.Bool("tracer-insecure", conf.Tracer.Insecure, "use https or http for tracer data, only used for otlp exporter or signoz")
if err = viper.BindPFlag("tracer.insecure", flags.Lookup("tracer-insecure")); err != nil {
panic(err)
Expand All @@ -236,15 +245,15 @@ func RegisterServeFlags(cmd *cobra.Command) {
panic(err)
}

flags.String("meter-exporter", conf.Meter.Exporter, "export uri for metric data")
flags.String("meter-exporter", conf.Meter.Exporter, "can be; otlp. (integrated metric tools)")
if err = viper.BindPFlag("meter.exporter", flags.Lookup("meter-exporter")); err != nil {
panic(err)
}
if err = viper.BindEnv("meter.exporter", "PERMIFY_METER_EXPORTER"); err != nil {
panic(err)
}

flags.String("meter-endpoint", conf.Meter.Endpoint, "can be; otlp. (integrated metric tools)")
flags.String("meter-endpoint", conf.Meter.Endpoint, "export uri for metric data")
if err = viper.BindPFlag("meter.endpoint", flags.Lookup("meter-endpoint")); err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/pb/base/v1/openapi.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/base/v1/openapi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Permify API";
description: "Permify is an open source authorization service for creating fine-grained and scalable authorization systems.";
version: "v0.6.7";
version: "v0.6.8";
contact: {
name: "API Support";
url: "https://github.com/Permify/permify/issues";
Expand Down

0 comments on commit 1b2fe30

Please sign in to comment.