From fac44dd9c003051c463ee57d083055468e181539 Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Fri, 6 Sep 2024 16:05:23 +0530 Subject: [PATCH] remove loadbalancer, add db cache, set defaults --- cuhttp/server.go | 176 +++--------------- deps/config/doc_gen.go | 40 ---- deps/config/types.go | 36 ++-- .../default-curio-configuration.md | 46 +---- go.mod | 3 - go.sum | 24 --- .../harmonydb/sql/20240906-http-server.sql | 4 + 7 files changed, 54 insertions(+), 275 deletions(-) create mode 100644 harmony/harmonydb/sql/20240906-http-server.sql diff --git a/cuhttp/server.go b/cuhttp/server.go index 0027fd0f6..eb30f543a 100644 --- a/cuhttp/server.go +++ b/cuhttp/server.go @@ -5,7 +5,6 @@ import ( "crypto/tls" "fmt" "net/http" - "net/url" "time" "github.com/CAFxX/httpcompression" @@ -13,57 +12,22 @@ import ( "github.com/go-chi/chi/v5/middleware" "github.com/gorilla/handlers" logging "github.com/ipfs/go-log/v2" - "github.com/vulcand/oxy/forward" - "github.com/vulcand/oxy/roundrobin" "golang.org/x/crypto/acme/autocert" "golang.org/x/sync/errgroup" "golang.org/x/xerrors" "github.com/filecoin-project/curio/deps" "github.com/filecoin-project/curio/deps/config" + "github.com/filecoin-project/curio/harmony/harmonydb" ) var log = logging.Logger("cu-http") -// Config structure to hold all configurations, including compression levels -type Config struct { - DomainName string - CertCacheDir string - ListenAddr string - HTTPRedirectAddr string - ReadTimeout time.Duration - WriteTimeout time.Duration - IdleTimeout time.Duration - ReadHeaderTimeout time.Duration - EnableCORS bool - Backends []string - LoadBalancer bool - CompressionLevels CompressionConfig -} - -// CompressionConfig holds the compression levels for supported types -type CompressionConfig struct { - GzipLevel int - BrotliLevel int - DeflateLevel int -} - // RouterMap is the map that allows the library user to pass in their own routes type RouterMap map[string]http.HandlerFunc type startTime string -func StartHTTPServer(ctx context.Context, cfg *config.HTTPConfig, deps *deps.Deps) error { - err := NewHTTPServer(ctx, cfg) - if err != nil { - return err - } - if cfg.EnableLoadBalancer { - return NewLoadBalancerServer(ctx, cfg) - } - return nil -} - // Custom middleware to add secure HTTP headers func secureHeaders(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -102,11 +66,13 @@ func compressionMiddleware(config *config.CompressionConfig) (func(http.Handler) return adapter, nil } -func NewHTTPServer(ctx context.Context, config *config.HTTPConfig) error { +func NewHTTPServer(ctx context.Context, deps *deps.Deps, config *config.HTTPConfig) error { + ch := cache{db: deps.DB} + // Set up the autocert manager for Let's Encrypt certManager := autocert.Manager{ - Cache: autocert.DirCache(config.CertCacheDir), // Directory for storing certificates - Prompt: autocert.AcceptTOS, // Automatically accept the Terms of Service + Cache: ch, + Prompt: autocert.AcceptTOS, // Automatically accept the Terms of Service HostPolicy: autocert.HostWhitelist(config.DomainName), } @@ -188,122 +154,34 @@ func NewHTTPServer(ctx context.Context, config *config.HTTPConfig) error { return eg.Wait() } -// NewLoadBalancerServer sets up a load balancer server to distribute traffic to the backends -func NewLoadBalancerServer(ctx context.Context, cfg *config.HTTPConfig) error { - certManager := autocert.Manager{ - Cache: autocert.DirCache(cfg.CertCacheDir), // Directory for storing certificates - Prompt: autocert.AcceptTOS, // Automatically accept the Terms of Service - HostPolicy: autocert.HostWhitelist(cfg.DomainName), - } +type cache struct { + db *harmonydb.DB +} - lb, err := NewLoadBalancer(cfg) +func (c cache) Get(ctx context.Context, key string) ([]byte, error) { + var ret []byte + err := c.db.QueryRow(ctx, `SELECT v FROM autocert_cache WHERE k = $1`, key).Scan(&ret) if err != nil { - return xerrors.Errorf("failed to create load balancer: %w", err) + return nil, xerrors.Errorf("failed to get the value from DB for key %s: %w", key, err) } - - go healthCheck(ctx, lb, time.Duration(cfg.LoadBalanceHealthCheckInterval)) - - // Set up the HTTP load balancer server with proper timeouts - server := &http.Server{ - Addr: cfg.LoadBalancerListenAddr, - Handler: http.HandlerFunc(lb.ServeHTTP), // Attach the load balancer to handle requests - ReadTimeout: cfg.ReadTimeout, - WriteTimeout: cfg.WriteTimeout, - IdleTimeout: cfg.IdleTimeout, - ReadHeaderTimeout: cfg.ReadHeaderTimeout, - TLSConfig: &tls.Config{ - GetCertificate: certManager.GetCertificate, - }, - } - - eg := errgroup.Group{} - eg.Go(func() error { - log.Infof("Starting load balancer server on https://%s", cfg.DomainName) - serr := server.ListenAndServeTLS("", "") - if serr != nil { - return xerrors.Errorf("failed to start listening: %w", serr) - } - return nil - }) - - go func() { - <-ctx.Done() - log.Warn("Shutting down load balancer Server...") - if err := server.Shutdown(context.Background()); err != nil { - log.Errorf("shutting down web server failed: %s", err) - } - log.Warn("LoadBalancer Server graceful shutdown successful") - }() - - return eg.Wait() + return ret, nil } -// NewLoadBalancer creates a load balancer with external backends -func NewLoadBalancer(config *config.HTTPConfig) (*roundrobin.RoundRobin, error) { - fwd, _ := forward.New() - lb, _ := roundrobin.New(fwd) - - // Add the backend servers to the load balancer - for _, backend := range config.LoadBalancerBackends { - burl, err := url.Parse("https://" + backend) - if err != nil { - return nil, xerrors.Errorf("Failed to parse backend URL %s: %w", backend, err) - } - err = lb.UpsertServer(burl) - if err != nil { - return nil, xerrors.Errorf("Failed to add proxy backend: %w", err) - } +func (c cache) Put(ctx context.Context, key string, data []byte) error { + _, err := c.db.Exec(ctx, `INSERT INTO autocert_cache (k, v) VALUES ($1, $2) + ON CONFLICT (k) DO UPDATE SET v = EXCLUDED.v`, key, data) + if err != nil { + return xerrors.Errorf("failed to inset key value pair in DB: %w", err) } - - return lb, nil + return nil } -// Health check function -func healthCheck(ctx context.Context, lb *roundrobin.RoundRobin, interval time.Duration) { - var failedURLs []*url.URL - - ticker := time.NewTicker(interval) - defer ticker.Stop() - - for { - select { - case <-ctx.Done(): - log.Infof("Shutting fown the load balancer health check") - return - case <-ticker.C: - var cf []*url.URL - // Drop failed URLs from current set - for _, u := range lb.Servers() { - // Perform a health check by sending a GET request to /health endpoint - resp, err := http.Get(u.String() + "/health") // Assuming /health is the health check endpoint - if err != nil || resp.StatusCode != http.StatusOK { - // If the server is down or the status is not OK, remove it from the load balancer - log.Infof("Backend %s is down. Removing from load balancer.", u) - _ = lb.RemoveServer(u) - cf = append(cf, u) - continue - } - } - - // Add back good URLs to current set from previous failed URLs - for _, u := range failedURLs { - // Perform a health check by sending a GET request to /health endpoint - resp, err := http.Get(u.String() + "/health") // Assuming /health is the health check endpoint - if err != nil || resp.StatusCode != http.StatusOK { - // If the server is down or the status is not OK, do not add it to the load balancer - log.Infof("Backend %s is down. Not adding to load balancer.", u) - cf = append(cf, u) - continue - } - - // If the server responds with OK, ensure it add it to the load balancer - err = lb.UpsertServer(u) - if err != nil { - log.Errorf("Failed to re-add backend %s: %v", u, err) - } - } - - failedURLs = cf - } +func (c cache) Delete(ctx context.Context, key string) error { + _, err := c.db.Exec(ctx, `DELETE FROM autocert_cache WHERE k = $1`, key) + if err != nil { + return xerrors.Errorf("failed to delete key value pair from DB: %w", err) } + return nil } + +var _ autocert.Cache = cache{} diff --git a/deps/config/doc_gen.go b/deps/config/doc_gen.go index e01293ac1..b50b84266 100644 --- a/deps/config/doc_gen.go +++ b/deps/config/doc_gen.go @@ -771,24 +771,12 @@ also be bounded by resources available on the machine.`, Comment: `DomainName specifies the domain name that the server uses to serve HTTP requests.`, }, - { - Name: "CertCacheDir", - Type: "string", - - Comment: `CertCacheDir path to the cache directory for storing SSL certificates needed for HTTPS.`, - }, { Name: "ListenAddr", Type: "string", Comment: `ListenAddr is the address that the server listens for HTTP requests.`, }, - { - Name: "HTTPRedirectAddr", - Type: "string", - - Comment: `HTTPRedirectAddr is the address to which HTTP requests are redirected. It's usually used when you want to enforce HTTPS.`, - }, { Name: "ReadTimeout", Type: "time.Duration", @@ -825,34 +813,6 @@ also be bounded by resources available on the machine.`, Comment: `CompressionLevels hold the compression level for various compression methods supported by the server`, }, - { - Name: "EnableLoadBalancer", - Type: "bool", - - Comment: `EnableLoadBalancer indicates whether load balancing between backend servers is enabled. It should only -be enabled on one node per domain name.`, - }, - { - Name: "LoadBalancerListenAddr", - Type: "string", - - Comment: `LoadBalancerListenAddr is the listen address for load balancer. This must be different from ListenAddr of the -HTTP server.`, - }, - { - Name: "LoadBalancerBackends", - Type: "[]string", - - Comment: `LoadBalancerBackends holds a list of listen addresses to which HTTP requests can be routed. Current ListenAddr -should also be added to backends if LoadBalancer is enabled`, - }, - { - Name: "LoadBalanceHealthCheckInterval", - Type: "Duration", - - Comment: `LoadBalanceHealthCheckInterval is the duration to check the status of all backend URLs and adjust the -loadbalancer backend based on the results`, - }, }, "PagerDutyConfig": { { diff --git a/deps/config/types.go b/deps/config/types.go index 0436e0494..6dc54ff61 100644 --- a/deps/config/types.go +++ b/deps/config/types.go @@ -70,6 +70,20 @@ func DefaultCurioConfig() *CurioConfig { AlertManagerURL: "http://localhost:9093/api/v2/alerts", }, }, + HTTP: HTTPConfig{ + DomainName: "", + ListenAddr: "0.0.0.0:12310", + ReadTimeout: time.Second * 10, + WriteTimeout: time.Second * 10, + IdleTimeout: time.Minute * 2, + ReadHeaderTimeout: time.Second * 5, + EnableCORS: true, + CompressionLevels: CompressionConfig{ + GzipLevel: 6, + BrotliLevel: 4, + DeflateLevel: 6, + }, + }, } } @@ -555,15 +569,9 @@ type HTTPConfig struct { // DomainName specifies the domain name that the server uses to serve HTTP requests. DomainName string - // CertCacheDir path to the cache directory for storing SSL certificates needed for HTTPS. - CertCacheDir string - // ListenAddr is the address that the server listens for HTTP requests. ListenAddr string - // HTTPRedirectAddr is the address to which HTTP requests are redirected. It's usually used when you want to enforce HTTPS. - HTTPRedirectAddr string - // ReadTimeout is the maximum duration for reading the entire or next request, including body, from the client. ReadTimeout time.Duration @@ -581,22 +589,6 @@ type HTTPConfig struct { // CompressionLevels hold the compression level for various compression methods supported by the server CompressionLevels CompressionConfig - - // EnableLoadBalancer indicates whether load balancing between backend servers is enabled. It should only - // be enabled on one node per domain name. - EnableLoadBalancer bool - - // LoadBalancerListenAddr is the listen address for load balancer. This must be different from ListenAddr of the - // HTTP server. - LoadBalancerListenAddr string - - // LoadBalancerBackends holds a list of listen addresses to which HTTP requests can be routed. Current ListenAddr - // should also be added to backends if LoadBalancer is enabled - LoadBalancerBackends []string - - // LoadBalanceHealthCheckInterval is the duration to check the status of all backend URLs and adjust the - // loadbalancer backend based on the results - LoadBalanceHealthCheckInterval Duration } // CompressionConfig holds the compression levels for supported types diff --git a/documentation/en/configuration/default-curio-configuration.md b/documentation/en/configuration/default-curio-configuration.md index 6bf5ab041..51d0a8530 100644 --- a/documentation/en/configuration/default-curio-configuration.md +++ b/documentation/en/configuration/default-curio-configuration.md @@ -559,72 +559,44 @@ description: The default curio configuration # type: string #DomainName = "" - # CertCacheDir path to the cache directory for storing SSL certificates needed for HTTPS. - # - # type: string - #CertCacheDir = "" - # ListenAddr is the address that the server listens for HTTP requests. # # type: string - #ListenAddr = "" - - # HTTPRedirectAddr is the address to which HTTP requests are redirected. It's usually used when you want to enforce HTTPS. - # - # type: string - #HTTPRedirectAddr = "" + #ListenAddr = "0.0.0.0:12310" # ReadTimeout is the maximum duration for reading the entire or next request, including body, from the client. # # type: time.Duration - #ReadTimeout = "0s" + #ReadTimeout = "10s" # WriteTimeout is the maximum duration before timing out writes of the response to the client. # # type: time.Duration - #WriteTimeout = "0s" + #WriteTimeout = "10s" # IdleTimeout is the maximum duration of an idle session. If set, idle connections are closed after this duration. # # type: time.Duration - #IdleTimeout = "0s" + #IdleTimeout = "2m0s" # ReadHeaderTimeout is amount of time allowed to read request headers # # type: time.Duration - #ReadHeaderTimeout = "0s" + #ReadHeaderTimeout = "5s" # EnableCORS indicates whether Cross-Origin Resource Sharing (CORS) is enabled or not. # # type: bool - #EnableCORS = false - - # EnableLoadBalancer indicates whether load balancing between backend servers is enabled. It should only - # be enabled on one node per domain name. - # - # type: bool - #EnableLoadBalancer = false - - # LoadBalancerListenAddr is the listen address for load balancer. This must be different from ListenAddr of the - # HTTP server. - # - # type: string - #LoadBalancerListenAddr = "" - - # LoadBalanceHealthCheckInterval is the duration to check the status of all backend URLs and adjust the - # loadbalancer backend based on the results - # - # type: Duration - #LoadBalanceHealthCheckInterval = "0s" + #EnableCORS = true [HTTP.CompressionLevels] # type: int - #GzipLevel = 0 + #GzipLevel = 6 # type: int - #BrotliLevel = 0 + #BrotliLevel = 4 # type: int - #DeflateLevel = 0 + #DeflateLevel = 6 ``` diff --git a/go.mod b/go.mod index 2886a3140..fc7f2635b 100644 --- a/go.mod +++ b/go.mod @@ -69,7 +69,6 @@ require ( github.com/snadrus/must v0.0.0-20240605044437-98cedd57f8eb github.com/stretchr/testify v1.9.0 github.com/urfave/cli/v2 v2.25.5 - github.com/vulcand/oxy v1.4.2 github.com/whyrusleeping/cbor-gen v0.1.2 github.com/yugabyte/pgx/v5 v5.5.3-yb-2 go.opencensus.io v0.24.0 @@ -89,7 +88,6 @@ require ( github.com/GeertJohan/go.incremental v1.0.0 // indirect github.com/GeertJohan/go.rice v1.0.3 // indirect github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee // indirect - github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect github.com/Jorropo/jsync v1.0.1 // indirect github.com/Kubuxu/go-broadcast v0.0.0-20240621161059-1a8c90734cd6 // indirect github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa // indirect @@ -286,7 +284,6 @@ require ( github.com/raulk/go-watchdog v1.3.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/segmentio/fasthash v1.0.3 // indirect github.com/shirou/gopsutil v2.18.12+incompatible // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect diff --git a/go.sum b/go.sum index d061d7d4d..d194b0275 100644 --- a/go.sum +++ b/go.sum @@ -56,8 +56,6 @@ github.com/GeertJohan/go.rice v1.0.3 h1:k5viR+xGtIhF61125vCE1cmJ5957RQGXG6dmbaWZ github.com/GeertJohan/go.rice v1.0.3/go.mod h1:XVdrU4pW00M4ikZed5q56tPf1v2KwnIKeIdc9CBYNt4= github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee h1:8doiS7ib3zi6/K172oDhSKU0dJ/miJramo9NITOMyZQ= github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee/go.mod h1:W0GbEAA4uFNYOGG2cJpmFJ04E6SD1NLELPYZB57/7AY= -github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Jorropo/jsync v1.0.1 h1:6HgRolFZnsdfzRUj+ImB9og1JYOxQoReSywkHOGSaUU= github.com/Jorropo/jsync v1.0.1/go.mod h1:jCOZj3vrBCri3bSU3ErUYvevKlnbssrXeCivybS5ABQ= github.com/Kubuxu/go-broadcast v0.0.0-20240621161059-1a8c90734cd6 h1:yh2/1fz3ajTaeKskSWxtSBNScdRZfQ/A5nyd9+64T6M= @@ -81,7 +79,6 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpH github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/akavel/rsrc v0.8.0 h1:zjWn7ukO9Kc5Q62DOJCcxGpXC18RawVtYAGdz2aLlfw= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 h1:T3+cD5fYvuH36h7EZq+TDpm+d8a6FSD4pQsbmuGGQ8o= @@ -187,7 +184,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= github.com/daaku/go.zipexe v1.0.2 h1:Zg55YLYTr7M9wjKn8SY/WcpuuEi+kR2u4E8RhvpyXmk= @@ -339,7 +335,6 @@ github.com/filecoin-project/specs-actors/v8 v8.0.1/go.mod h1:UYIPg65iPWoFw5NEftR github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -421,7 +416,6 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg= github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci7oU= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= @@ -758,7 +752,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kilic/bls12-381 v0.1.1-0.20220929213557-ca162e8a70f4 h1:xWK4TZ4bRL05WQUU/3x6TG1l+IYAqdXpAeSLt/zZJc4= @@ -1007,7 +1000,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nikkolasg/hexjson v0.1.0 h1:Cgi1MSZVQFoJKYeRpBNEcdF3LB+Zo4fYKsDz7h8uJYQ= github.com/nikkolasg/hexjson v0.1.0/go.mod h1:fbGbWFZ0FmJMFbpCMtJpwb0tudVxSSZ+Es2TsCg57cA= github.com/nkovacs/streamquote v1.0.0 h1:PmVIV08Zlx2lZK5fFZlMZ04eHcDTIFJCv/5/0twVUow= @@ -1171,8 +1163,6 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA= github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= -github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/sercand/kuberesolver/v4 v4.0.0 h1:frL7laPDG/lFm5n98ODmWnn+cvPpzlkf3LhzuPhcHP4= github.com/sercand/kuberesolver/v4 v4.0.0/go.mod h1:F4RGyuRmMAjeXHKL+w4P7AwUnPceEAPAhxUgXZjKgvM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= @@ -1285,8 +1275,6 @@ github.com/valyala/gozstd v1.20.1 h1:xPnnnvjmaDDitMFfDxmQ4vpx0+3CdTg2o3lALvXTU/g github.com/valyala/gozstd v1.20.1/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/vulcand/oxy v1.4.2 h1:KibUVdKrwy7eXR3uHS2pYoZ9dCzKVcgDNHD2jkPZmxU= -github.com/vulcand/oxy v1.4.2/go.mod h1:Yq8OBb0XWU/7nPSglwUH5LS2Pcp4yvad8SVayobZbSo= github.com/warpfork/go-testmark v0.12.1 h1:rMgCpJfwy1sJ50x0M0NgyphxYYPMOODIJHhsXyEHU0s= github.com/warpfork/go-testmark v0.12.1/go.mod h1:kHwy7wfvGSPh1rQJYKayD4AbtNaeyZdcGi9tNJTaa5Y= github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= @@ -1443,10 +1431,7 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -1458,7 +1443,6 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1694,13 +1678,11 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1757,12 +1739,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 h1:LLhsEBxRTBLuKlQxFBYUOU8xyFgXv6cOTp2HASDlsDk= golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= @@ -1867,7 +1845,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= @@ -1905,7 +1882,6 @@ howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCU lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= diff --git a/harmony/harmonydb/sql/20240906-http-server.sql b/harmony/harmonydb/sql/20240906-http-server.sql new file mode 100644 index 000000000..4e02fc545 --- /dev/null +++ b/harmony/harmonydb/sql/20240906-http-server.sql @@ -0,0 +1,4 @@ +CREATE TABLE autocert_cache ( + k TEXT NOT NULL PRIMARY KEY, + v BYTEA NOT NULL +); \ No newline at end of file