]> Sergey Matveev's repositories - tofuproxy.git/blobdiff - fifos/start.go
WARC
[tofuproxy.git] / fifos / start.go
index a005c640036e5503054ef7e9aa52738f5736be81..528b2a9c7ad38548141c53457bca400a8bcb6232 100644 (file)
@@ -1,9 +1,27 @@
+/*
+tofuproxy -- flexible HTTP/WARC proxy with TLS certificates management
+Copyright (C) 2021 Sergey Matveev <stargrave@stargrave.org>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 3 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
 package fifos
 
 import (
        "path/filepath"
 
        "go.stargrave.org/tofuproxy/caches"
+       "go.stargrave.org/tofuproxy/warc"
 )
 
 func Start(fifos string) {
@@ -18,12 +36,14 @@ func Start(fifos string) {
        go logger(LogTLS, filepath.Join(fifos, "log-tls"))
        go logger(LogTLSAuth, filepath.Join(fifos, "log-tls-auth"))
        go logger(LogVarious, filepath.Join(fifos, "log-various"))
+       go logger(LogWARC, filepath.Join(fifos, "log-warc"))
 
        go listAccepted(filepath.Join(fifos, "list-accepted"))
        go listHTTPAuth(filepath.Join(fifos, "list-http-auth"))
        go listRejected(filepath.Join(fifos, "list-rejected"))
        go listSpies(filepath.Join(fifos, "list-spies"))
        go listTLSAuth(filepath.Join(fifos, "list-tls-auth"))
+       go listWARCs(filepath.Join(fifos, "list-warcs"))
 
        go del(
                &caches.AcceptedM, func(host string) { delete(caches.Accepted, host) },
@@ -55,4 +75,10 @@ func Start(fifos string) {
                },
                filepath.Join(fifos, "del-spies"),
        )
+
+       go addWARC(filepath.Join(fifos, "add-warcs"))
+       go del(
+               &warc.WARCsM, func(warcPath string) { delete(warc.WARCs, warcPath) },
+               filepath.Join(fifos, "del-warcs"),
+       )
 }