mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-17 11:57:12 +03:00
commit
4d599e5060
@ -17,8 +17,8 @@ package checks
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
var lookbackDays int = 90
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
package checks
|
||||
|
||||
import "github.com/dlorenc/scorecard/checker"
|
||||
import "github.com/ossf/scorecard/checker"
|
||||
|
||||
var AllChecks = []checker.NamedCheck{}
|
||||
|
||||
|
@ -17,8 +17,8 @@ package checks
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -19,7 +19,7 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -15,8 +15,8 @@
|
||||
package checks
|
||||
|
||||
import (
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -17,8 +17,8 @@ package checks
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -18,7 +18,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
//go:generate ../gen_github.sh
|
||||
|
@ -17,8 +17,8 @@ package checks
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -15,8 +15,8 @@
|
||||
package checks
|
||||
|
||||
import (
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -17,8 +17,8 @@ package checks
|
||||
import (
|
||||
"path"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -17,8 +17,8 @@ package checks
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
var releaseLookBack int = 5
|
||||
|
@ -15,8 +15,8 @@
|
||||
package checks
|
||||
|
||||
import (
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
)
|
||||
|
||||
var tagLookBack int = 5
|
||||
|
@ -23,9 +23,9 @@ import (
|
||||
|
||||
goflag "flag"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/dlorenc/scorecard/checks"
|
||||
"github.com/dlorenc/scorecard/pkg"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
"github.com/ossf/scorecard/checks"
|
||||
"github.com/ossf/scorecard/pkg"
|
||||
"github.com/spf13/cobra"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
16
cmd/serve.go
16
cmd/serve.go
@ -18,10 +18,11 @@ import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/dlorenc/scorecard/checks"
|
||||
"github.com/dlorenc/scorecard/pkg"
|
||||
"github.com/ossf/scorecard/checks"
|
||||
"github.com/ossf/scorecard/pkg"
|
||||
"github.com/spf13/cobra"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
@ -48,6 +49,9 @@ var serveCmd = &cobra.Command{
|
||||
http.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) {
|
||||
repoParam := r.URL.Query().Get("repo")
|
||||
s := strings.SplitN(repoParam, "/", 3)
|
||||
if len(s) != 3 {
|
||||
rw.WriteHeader(http.StatusBadRequest)
|
||||
}
|
||||
sugar.Info(repoParam)
|
||||
repo := pkg.RepoURL{
|
||||
Host: s[0],
|
||||
@ -67,8 +71,12 @@ var serveCmd = &cobra.Command{
|
||||
sugar.Warn(err)
|
||||
}
|
||||
})
|
||||
fmt.Println("Listening on localhost:8080")
|
||||
http.ListenAndServe("localhost:8080", nil)
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
port = "8080"
|
||||
}
|
||||
fmt.Printf("Listening on localhost:%s\n", port)
|
||||
http.ListenAndServe(fmt.Sprintf("0.0.0.0:%s", port), nil)
|
||||
},
|
||||
}
|
||||
|
||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
||||
module github.com/dlorenc/scorecard
|
||||
module github.com/ossf/scorecard
|
||||
|
||||
go 1.15
|
||||
|
||||
|
2
main.go
2
main.go
@ -14,7 +14,7 @@
|
||||
|
||||
package main
|
||||
|
||||
import "github.com/dlorenc/scorecard/cmd"
|
||||
import "github.com/ossf/scorecard/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
|
@ -23,9 +23,9 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/dlorenc/scorecard/checker"
|
||||
"github.com/dlorenc/scorecard/roundtripper"
|
||||
"github.com/google/go-github/v32/github"
|
||||
"github.com/ossf/scorecard/checker"
|
||||
"github.com/ossf/scorecard/roundtripper"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user