darvaza-proxy / darvaza Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://darvaza.org/darvaza
License: MIT License
Home Page: https://darvaza.org/darvaza
License: MIT License
As it is, expand
function in tools/gen_mk.sh
expand() {
local prefix="$1" x=
shift
for x; do
echo "$prefix-$x"
done | tr '\n' ' '
}
leaves a trailing space on the result. a very crude fix is
diff --git a/tools/gen_mk.sh b/tools/gen_mk.sh
index a586099..f76ae1f 100755
--- a/tools/gen_mk.sh
+++ b/tools/gen_mk.sh
@@ -15,6 +15,7 @@ expand() {
for cmd in $COMMANDS; do
all="$(expand $cmd $PROJECTS root)"
+ all="${all% }"
depsx=
cat <<EOT
but a much better solution is to fix the expand function itself.
This way of identifying certificates is from 1995. A more sane way is:
--- a/storage/file/filestore.go
+++ b/storage/file/filestore.go
@@ -187,9 +187,19 @@ func (fs FileStore) fileCertFromName(name string) (string, x509.Certificate, err
if err != nil {
continue
}
- if x.Subject.CommonName == name {
- return fl, *x, nil
+ switch len(x.URIs) {
+ case 0:
+ //this is an old certificate
+ if x.Subject.CommonName == name {
+ return fl, *x, nil
+ }
+ default:
+ //normal "modern" certificate
+ err := x.VerifyHostname(name)
+ if err == nil {
+ return fl, *x, nil
+ }
}
}
}
In order to better align with existing libraries like https://pkg.go.dev/golang.org/x/crypto/acme we should change our Store interface to use []byte even if potentially we could need to parse it more than one
I'm a cheat, but I really don't want to keep carrying this change forward :p
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ GOPATH ?= $(shell $(GO) env GOPATH)
GOBIN ?= $(GOPATH)/bin
REVIVE ?= $(GOBIN)/revive
-REVIVE_RUN_ARGS ?= -formatter friendly -set_exit_status
+REVIVE_RUN_ARGS ?= -formatter friendly
REVIVE_INSTALL_URL ?= github.com/mgechev/revive
V = 0
we've done a pretty decent job recently but there is still more to do
▶ tidy: shared
⚠ https://revive.run/r#package-comments should have a package comment
tls/server/server.go:1:1
⚠ https://revive.run/r#exported exported type Proxy should have comment or be unexported
tls/server/server.go:26:6
⚠ https://revive.run/r#exported exported method ProxyConfig.New should have comment or be unexported
tls/server/server.go:71:1
⚠ https://revive.run/r#exported exported method Proxy.Run should have comment or be unexported
tls/server/server.go:91:1
⚠ https://revive.run/r#exported exported method Proxy.Reload should have comment or be unexported
tls/server/server.go:132:1
⚠ https://revive.run/r#exported exported method Proxy.TLSHandler should have comment or be unexported
tls/server/server.go:136:1
⚠ https://revive.run/r#exported exported method Proxy.Cancel should have comment or be unexported
tls/server/server.go:140:1
⚠ 7 problems (0 errors, 7 warnings)
▶ tidy: root
⚠ https://revive.run/r#package-comments should have a package comment
cmd/darvaza/config.go:1:1
⚠ https://revive.run/r#exported exported const CmdName should have comment (or a comment on this block) or be unexported
cmd/darvaza/main.go:10:2
⚠ https://revive.run/r#exported exported type Config should have comment or be unexported
cmd/darvaza/config.go:15:6
⚠ https://revive.run/r#exported exported method Config.SetDefaults should have comment or be unexported
cmd/darvaza/config.go:19:1
⚠ https://revive.run/r#exported exported function NewConfig should have comment or be unexported
cmd/darvaza/config.go:29:1
⚠ https://revive.run/r#exported exported method Config.ReadInFile should have comment or be unexported
cmd/darvaza/config.go:39:1
⚠ https://revive.run/r#exported exported method Config.WriteTo should have comment or be unexported
cmd/darvaza/config.go:43:1
⚠ 7 problems (0 errors, 7 warnings)
We might need the ALPNProtocols filed of the ClientHello so we might as well export it.
Line 79 in 5c150f7
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.