2 tofuproxy -- flexible HTTP/HTTPS proxy, TLS terminator, X.509 TOFU
3 manager, WARC/geminispace browser
4 Copyright (C) 2021-2023 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 listRestricted(filepath.Join(fifos, "list-restricted"))
46 go listSpies(filepath.Join(fifos, "list-spies"))
47 go listTLSAuth(filepath.Join(fifos, "list-tls-auth"))
48 go listWARCs(filepath.Join(fifos, "list-warcs"))
51 &caches.AcceptedM, func(host string) { delete(caches.Accepted, host) },
52 filepath.Join(fifos, "del-accepted"),
55 &caches.HTTPAuthCacheM, func(host string) { delete(caches.HTTPAuthCache, host) },
56 filepath.Join(fifos, "del-http-auth"),
59 &caches.RejectedM, func(host string) { delete(caches.Rejected, host) },
60 filepath.Join(fifos, "del-rejected"),
63 go addRestricted(filepath.Join(fifos, "add-restricted"))
65 go addSpy(filepath.Join(fifos, "add-spies"))
67 &caches.SpiesM, func(host string) {
68 for i, spy := range caches.Spies {
70 caches.Spies[i] = caches.Spies[len(caches.Spies)-1]
71 caches.Spies = caches.Spies[:len(caches.Spies)-1]
76 filepath.Join(fifos, "del-spies"),
79 go addWARC(filepath.Join(fifos, "add-warcs"))
81 &warc.WARCsM, func(warcPath string) {
82 delete(warc.WARCs, warcPath)
83 delete(warc.WARCsOffsets, warcPath)
85 filepath.Join(fifos, "del-warcs"),
88 go addTLSAuth(filepath.Join(fifos, "add-tls-auth"))
90 &caches.TLSAuthCacheM, func(host string) { delete(caches.TLSAuthCache, host) },
91 filepath.Join(fifos, "del-tls-auth"),