Skip to content

Commit

Permalink
Merge pull request #19 from pygzfei/optimize-certificate-acquisition-…
Browse files Browse the repository at this point in the history
…methods

Optimize certificate acquisition methods
  • Loading branch information
pygzfei committed Oct 17, 2023
2 parents bac5d92 + 5822574 commit e214d56
Show file tree
Hide file tree
Showing 13 changed files with 137 additions and 81 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ A High Performance Gateway with Certificate Issuance and Flexible Proxy
- Ensures certificates remain valid and up to date
- Dynamic service pointing, no need to restart


### Features
- [ ] Limiter (concurrent control)
- [ ] Load Balancing
Expand Down
2 changes: 1 addition & 1 deletion conf/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Issuer:
# Redis
# Cron
Type: "Cron"
Cron: "0 1 * * *"
Cron: "40 23 * * *" # UTC Time

DevServer:
Enabled: true
Expand Down
2 changes: 2 additions & 0 deletions gateway/internal/handler/reverse-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func ReverseProxyOrRedirect(w http.ResponseWriter, r *http.Request) {
func AcceptChallenge(c *config.Config) http.HandlerFunc {

return func(w http.ResponseWriter, r *http.Request) {
r.Header.Set("X-Forwarded-Host", r.Host)

target, err := url.Parse(fmt.Sprintf("%s:10086", c.Gateway.IssuerService))

if err != nil {
Expand Down
25 changes: 10 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ module github.com/pygzfei/issuer-gateway
go 1.21

require (
github.com/dgraph-io/ristretto v0.1.1
github.com/go-acme/lego/v4 v4.14.2
github.com/go-co-op/gocron v1.35.0
github.com/go-jose/go-jose/v3 v3.0.0
github.com/go-playground/assert/v2 v2.2.0
github.com/go-playground/validator/v10 v10.15.4
github.com/go-playground/validator/v10 v10.15.5
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/redis/go-redis/v9 v9.2.0
github.com/robfig/cron/v3 v3.0.1
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/yitter/idgenerator-go v1.3.3
github.com/zeromicro/go-zero v1.5.5
github.com/zeromicro/go-zero v1.5.6
github.com/zeromicro/x v0.0.0-20230424055333-01c7fb9548d4
google.golang.org/grpc v1.58.2
google.golang.org/grpc v1.58.3
google.golang.org/protobuf v1.31.0
gopkg.in/tylerb/graceful.v1 v1.2.15
gorm.io/driver/mysql v1.5.1
Expand All @@ -29,18 +30,14 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/go-co-op/gocron v1.35.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-resty/resty/v2 v2.9.1 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect
Expand All @@ -56,14 +53,12 @@ require (
github.com/miekg/dns v1.1.55 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/openzipkin/zipkin-go v0.4.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
Expand All @@ -81,17 +76,17 @@ require (
go.opentelemetry.io/otel/sdk v1.14.0 // indirect
go.opentelemetry.io/otel/trace v1.14.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/automaxprocs v1.5.3 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.10.0 // indirect
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down

0 comments on commit e214d56

Please sign in to comment.