]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - cmd/tofuproxy/main.go
Certificate and key can be in single file
[tofuproxy.git] / cmd / tofuproxy / main.go
index 96dbd321a209503e527b839e2acb97cbc3d61bcd..3cb96364316e411d33951a9e33949161739a4348 100644 (file)
@@ -1,5 +1,6 @@
 /*
-tofuproxy -- HTTP proxy with TLS certificates management
+tofuproxy -- flexible HTTP/HTTPS proxy, TLS terminator, X.509 TOFU
+             manager, WARC/geminispace browser
 Copyright (C) 2021 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
@@ -26,17 +27,20 @@ import (
        "go.cypherpunks.ru/ucspi"
        "go.stargrave.org/tofuproxy"
        "go.stargrave.org/tofuproxy/fifos"
+       "go.stargrave.org/tofuproxy/rounds"
+       ttls "go.stargrave.org/tofuproxy/tls"
 )
 
 func main() {
        crtPath := flag.String("cert", "cert.pem", "Path to server X.509 certificate")
-       prvPath := flag.String("key", "prv.pem", "Path to server PKCS#8 private key")
+       prvPath := flag.String("key", "cert.pem", "Path to server PKCS#8 private key")
        bind := flag.String("bind", "[::1]:8080", "Bind address")
        certs := flag.String("certs", "./certs", "Directory with pinned certificates")
        ccerts := flag.String("ccerts", "./ccerts", "Directory with client certificates")
        dnsSrv := flag.String("dns", "[::1]:53", "DNS server")
        fifosDir := flag.String("fifos", "fifos", "Directory with FIFOs")
        notai := flag.Bool("notai", false, "Do not prepend TAI64N to logs")
+       warcOnly := flag.Bool("warc-only", false, "Server only WARC URIs")
        flag.Parse()
        log.SetFlags(log.Lshortfile)
 
@@ -52,11 +56,12 @@ func main() {
 
        fifos.NoTAI = *notai
        fifos.Start(*fifosDir)
-       tofuproxy.Certs = *certs
-       tofuproxy.CCerts = *ccerts
-       tofuproxy.DNSSrv = *dnsSrv
+       ttls.Certs = *certs
+       ttls.CCerts = *ccerts
+       ttls.DNSSrv = *dnsSrv
        tofuproxy.CACert = caCert
        tofuproxy.CAPrv = caPrv
+       rounds.WARCOnly = *warcOnly
 
        ln, err := net.Listen("tcp", *bind)
        if err != nil {