2 tofuproxy -- flexible HTTP/HTTPS proxy, TLS terminator, X.509 TOFU
3 manager, WARC/geminispace browser
4 Copyright (C) 2021-2022 Sergey Matveev <stargrave@stargrave.org>
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, version 3 of the License.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 "go.stargrave.org/tofuproxy/caches"
25 "go.stargrave.org/tofuproxy/warc"
28 func Start(fifos string) {
29 go logger(LogCert, filepath.Join(fifos, "log-cert"))
30 go logger(LogDANE, filepath.Join(fifos, "log-dane"))
31 go logger(LogErr, filepath.Join(fifos, "log-err"))
32 go logger(LogHTTPAuth, filepath.Join(fifos, "log-http-auth"))
33 go logger(LogNonOK, filepath.Join(fifos, "log-non-ok"))
34 go logger(LogOK, filepath.Join(fifos, "log-ok"))
35 go logger(LogRedir, filepath.Join(fifos, "log-redir"))
36 go logger(LogReq, filepath.Join(fifos, "log-req"))
37 go logger(LogTLS, filepath.Join(fifos, "log-tls"))
38 go logger(LogTLSAuth, filepath.Join(fifos, "log-tls-auth"))
39 go logger(LogVarious, filepath.Join(fifos, "log-various"))
40 go logger(LogWARC, filepath.Join(fifos, "log-warc"))
42 go listAccepted(filepath.Join(fifos, "list-accepted"))
43 go listHTTPAuth(filepath.Join(fifos, "list-http-auth"))
44 go listRejected(filepath.Join(fifos, "list-rejected"))
45 go listSpies(filepath.Join(fifos, "list-spies"))
46 go listTLSAuth(filepath.Join(fifos, "list-tls-auth"))
47 go listWARCs(filepath.Join(fifos, "list-warcs"))
50 &caches.AcceptedM, func(host string) { delete(caches.Accepted, host) },
51 filepath.Join(fifos, "del-accepted"),
54 &caches.HTTPAuthCacheM, func(host string) { delete(caches.HTTPAuthCache, host) },
55 filepath.Join(fifos, "del-http-auth"),
58 &caches.RejectedM, func(host string) { delete(caches.Rejected, host) },
59 filepath.Join(fifos, "del-rejected"),
62 go addSpy(filepath.Join(fifos, "add-spies"))
64 &caches.SpiesM, func(host string) {
65 for i, spy := range caches.Spies {
67 caches.Spies[i] = caches.Spies[len(caches.Spies)-1]
68 caches.Spies = caches.Spies[:len(caches.Spies)-1]
73 filepath.Join(fifos, "del-spies"),
76 go addWARC(filepath.Join(fifos, "add-warcs"))
78 &warc.WARCsM, func(warcPath string) {
79 delete(warc.WARCs, warcPath)
80 delete(warc.WARCsOffsets, warcPath)
82 filepath.Join(fifos, "del-warcs"),
85 go addTLSAuth(filepath.Join(fifos, "add-tls-auth"))
87 &caches.TLSAuthCacheM, func(host string) { delete(caches.TLSAuthCache, host) },
88 filepath.Join(fifos, "del-tls-auth"),