this repo has no description
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(server): make hythlodaeus work in prod

Signed-off-by: Xe Iaso <me@xeiaso.net>

Xe Iaso f42b9be9 8d00e47b

+17 -3
+1
server/route.go
··· 144 144 145 145 // GetCertificate gets a certificate. 146 146 func (rt *RoutingTable) GetCertificate(sni string) (*tls.Certificate, error) { 147 + slog.Debug("getting cert", "sni", sni) 147 148 hostCerts, ok := rt.certificatesByHost[sni] 148 149 if ok { 149 150 for h, cert := range hostCerts {
+16 -3
server/server.go
··· 94 94 }) 95 95 96 96 eg.Go(func() error { 97 + defer func() { 98 + slog.Error("exiting", "protocol", "https") 99 + }() 100 + 97 101 tc := &tls.Config{ 98 102 GetCertificate: func(hello *tls.ClientHelloInfo) (*tls.Certificate, error) { 99 103 return s.routingTable.Load().(*RoutingTable).GetCertificate(hello.ServerName) ··· 122 126 defer lis.Close() 123 127 124 128 if s.cfg.proxyProto { 129 + slog.Info("using proxy protocol", "protocol", "https") 125 130 lis = &proxyproto.Listener{Listener: lis} 126 131 } 127 132 lis = tls.NewListener(lis, tc) ··· 134 139 }) 135 140 136 141 eg.Go(func() error { 142 + defer func() { 143 + slog.Error("exiting", "protocol", "http") 144 + }() 145 + 137 146 srv := http.Server{ 138 147 Addr: s.cfg.httpBind, 139 148 Handler: s.sink.Middleware(s), ··· 143 152 144 153 healthSrv.SetServingStatus("http", healthv1.HealthCheckResponse_SERVING) 145 154 146 - lis, err := net.Listen("tcp", s.cfg.httpsBind) 155 + lis, err := net.Listen("tcp", s.cfg.httpBind) 147 156 if err != nil { 148 - return fmt.Errorf("error listening on %s: %v", s.cfg.httpsBind, err) 157 + return fmt.Errorf("error listening on %s: %v", s.cfg.httpBind, err) 149 158 } 150 159 defer lis.Close() 151 160 ··· 159 168 } 160 169 return nil 161 170 }) 162 - return eg.Wait() 171 + if err := eg.Wait(); err != nil { 172 + slog.Error("error", "err", err) 173 + } 174 + 175 + return nil 163 176 } 164 177 165 178 // ServeHTTP serves an HTTP request.