)
var (
+ pkgPyPI = regexp.MustCompile(`^.*<a href="([^"]+)"[^>]*>(.+)</a><br/>.*$`)
+ Version string = "UNKNOWN"
+
root = flag.String("root", "./packages", "Path to packages directory")
bind = flag.String("bind", "[::]:8080", "Address to bind to")
tlsCert = flag.String("tls-cert", "", "Path to TLS X.509 certificate")
maxClients = flag.Int("maxclients", 128, "Maximal amount of simultaneous clients")
version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
-
- pkgPyPI = regexp.MustCompile(`^.*<a href="([^"]+)"[^>]*>(.+)</a><br/>.*$`)
- Version string = "UNKNOWN"
-
- passwords map[string]Auther = make(map[string]Auther)
)
-type Auther interface {
- Auth(password string) bool
-}
-
func mkdirForPkg(w http.ResponseWriter, r *http.Request, dir string) bool {
path := filepath.Join(*root, dir)
if _, err := os.Stat(path); os.IsNotExist(err) {
"strings"
)
+var passwords map[string]Auther = make(map[string]Auther)
+
+type Auther interface {
+ Auth(password string) bool
+}
+
func strToAuther(verifier string) (string, Auther, error) {
st := strings.SplitN(verifier, "$", 3)
if len(st) != 3 || st[0] != "" {