X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=main.go;h=5e4f25c60d2f26f80d70b48acdfecaf4c633c1b9;hb=3888c28bc312e27a1696cc2988f7903c5135fba1;hp=12a325a93435af81d330f2ff9e844e31da891e13;hpb=168de6871afdd60f2bc1c529170033ef56307d7c;p=gocheese.git diff --git a/main.go b/main.go index 12a325a..5e4f25c 100644 --- a/main.go +++ b/main.go @@ -50,12 +50,13 @@ const ( HTMLBegin = ` + Links for %s ` HTMLEnd = " \n\n" - HTMLElement = " %s
\n" + HTMLElement = " %s\n" InternalFlag = ".internal" GPGSigExt = ".asc" @@ -105,8 +106,9 @@ var ( pypiURL = flag.String("pypi", "https://pypi.org/simple/", "Upstream (PyPI) URL") pypiCertHash = flag.String("pypi-cert-hash", "", "Authenticate upstream by its X.509 certificate's SPKI SHA256 hash") - passwdPath = flag.String("passwd", "", "Path to FIFO for upload authentication") - passwdCheck = flag.Bool("passwd-check", false, "Run password checker") + passwdPath = flag.String("passwd", "", "Path to FIFO for upload authentication") + passwdListPath = flag.String("passwd-list", "", "Path to FIFO for login listing") + passwdCheck = flag.Bool("passwd-check", false, "Run password checker") logTimestamped = flag.Bool("log-timestamped", false, "Prepend timestmap to log messages") fsck = flag.Bool("fsck", false, "Check integrity of all packages (errors are in stderr)") @@ -306,7 +308,11 @@ func main() { if *passwdPath != "" { go func() { for { - fd, err := os.OpenFile(*passwdPath, os.O_RDONLY, os.FileMode(0666)) + fd, err := os.OpenFile( + *passwdPath, + os.O_RDONLY, + os.FileMode(0666), + ) if err != nil { log.Fatalln(err) } @@ -315,6 +321,22 @@ func main() { } }() } + if *passwdListPath != "" { + go func() { + for { + fd, err := os.OpenFile( + *passwdListPath, + os.O_WRONLY|os.O_APPEND, + os.FileMode(0666), + ) + if err != nil { + log.Fatalln(err) + } + passwdLister(fd) + fd.Close() + } + }() + } if (*tlsCert != "" && *tlsKey == "") || (*tlsCert == "" && *tlsKey != "") { log.Fatalln("Both -tls-cert and -tls-key are required")