Giter VIP home page Giter VIP logo

darvaza's People

Contributors

amery avatar karasz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

karasz

darvaza's Issues

Fix expand function is tools/gen_mk.sh

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.

Certificate identification

code

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
+                               }
                        }
                }
        }

`revive` still angry with us

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.