Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Drop debug print | Rasmus Dahlberg | 2023-03-23 | 1 | -1/+0 |
| | |||||
* | Automate handling of notice file | Rasmus Dahlberg | 2023-03-23 | 3 | -28/+54 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's a hacky tool to migrate our ongoing v0.0.1 measurement once it's done. I.e., just split-up the NOTICE prints we have in collect.stdout, putting them in per-log notice files that happens automatically now. ``` // Package main provides a hacky tool that extracts NOTICE: <log desc> prints // from a file collect.stdout, putting them in the logs data directories as // notice.txt. Only meant to migrate away from v0.0.1 that did not store // per-log notice files automatically, which makes things less error-prone. package main import ( "bytes" "encoding/json" "fmt" logger "log" "os" "strings" "gitlab.torproject.org/rgdd/ct/pkg/metadata" ) func main() { directory := "../data" logDirectory := fmt.Sprintf("%s/logs", directory) noticeFile := "../collect.stdout" b, err := os.ReadFile(fmt.Sprintf("%s/metadata.json", directory)) if err != nil { logger.Fatal(err) } var md metadata.Metadata if err := json.Unmarshal(b, &md); err != nil { logger.Fatal(err) } if b, err = os.ReadFile(noticeFile); err != nil { logger.Fatal(err) } lines := bytes.Split(b, []byte("\n")) for _, log := range logs(md) { id, _ := log.Key.ID() desc := *log.Description var notes []byte var numNotes int for _, line := range lines[:len(lines)-1] { if strings.Contains(string(line), fmt.Sprintf("NOTICE: %s", desc)) { notes = append(notes, line...) notes = append(notes, []byte("\n")...) numNotes += 1 } } if len(notes) == 0 { logger.Printf("%s: no notices", desc) continue } logger.Printf("%s: %d notices", desc, numNotes) if err := os.WriteFile(fmt.Sprintf("%s/%x/notice.txt", logDirectory, id[:]), notes, 0644); err != nil { logger.Fatal(err) } } } func logs(md metadata.Metadata) (logs []metadata.Log) { for _, operators := range md.Operators { for _, log := range operators.Logs { if log.Description == nil { logger.Printf("WARNING: skipping log without description") continue } if log.State == nil { continue // skip logs with unknown states } if log.State.Name == metadata.LogStatePending { continue // pending logs do not count towards CT-compliance } if log.State.Name == metadata.LogStateRetired { continue // retired logs are not necessarily reachable } if log.State.Name == metadata.LogStateRejected { continue // rejected logs do not count towards CT-compliance } logs = append(logs, log) } } return } ``` | ||||
* | Drop sanitize of SANs | Rasmus Dahlberg | 2023-03-23 | 3 | -179/+18 |
| | | | | Less complex, we will just pass lines to Go's HTTP GET as is. | ||||
* | Change default to /tmp | Rasmus Dahlberg | 2023-03-20 | 1 | -2/+2 |
| | |||||
* | Add drafty assemble command | Rasmus Dahlberg | 2023-03-20 | 3 | -6/+316 |
| | |||||
* | Fork code snippets to sanitize DNS names (ascii) | Rasmus Dahlberg | 2023-03-20 | 1 | -0/+85 |
| | |||||
* | Smaller default params | Rasmus Dahlberg | 2023-03-18 | 1 | -4/+4 |
| | |||||
* | Add notes from starting experiment | Rasmus Dahlberg | 2023-03-18 | 1 | -0/+43 |
| | |||||
* | Manually add version+logID to STH structv0.0.1 | Rasmus Dahlberg | 2023-03-18 | 1 | -4/+2 |
| | | | | Will probably make the data set manifest simpler. | ||||
* | Light refactoring | Rasmus Dahlberg | 2023-03-18 | 1 | -5/+5 |
| | |||||
* | Tweak default parameters | Rasmus Dahlberg | 2023-03-18 | 1 | -4/+4 |
| | | | | Will put exactly how we run on our machine in README | ||||
* | Print stats on shutdown | Rasmus Dahlberg | 2023-03-18 | 2 | -11/+16 |
| | |||||
* | Fix few debug prints | Rasmus Dahlberg | 2023-03-18 | 2 | -4/+3 |
| | |||||
* | Add one more max workers | Rasmus Dahlberg | 2023-03-18 | 1 | -0/+3 |
| | |||||
* | Tune number of workers | Rasmus Dahlberg | 2023-03-18 | 4 | -5/+31 |
| | |||||
* | remove temp file | Rasmus Dahlberg | 2023-03-18 | 1 | -146/+0 |
| | |||||
* | check that sans don't contain new lines | Rasmus Dahlberg | 2023-03-18 | 2 | -2/+153 |
| | |||||
* | rename default dir | Rasmus Dahlberg | 2023-03-18 | 2 | -3/+3 |
| | |||||
* | Move helpers to separate file | Rasmus Dahlberg | 2023-03-18 | 2 | -38/+47 |
| | |||||
* | Print metrics based on flag duration to stderr | Rasmus Dahlberg | 2023-03-18 | 4 | -10/+20 |
| | |||||
* | update http header | Rasmus Dahlberg | 2023-03-18 | 1 | -2/+2 |
| | |||||
* | add credit | Rasmus Dahlberg | 2023-03-18 | 1 | -0/+3 |
| | |||||
* | renaming files and moving around | Rasmus Dahlberg | 2023-03-18 | 5 | -33/+42 |
| | |||||
* | more light refactoring | Rasmus Dahlberg | 2023-03-18 | 4 | -67/+56 |
| | |||||
* | light refactoring | Rasmus Dahlberg | 2023-03-18 | 1 | -104/+104 |
| | |||||
* | more wip collect, metrics | Rasmus Dahlberg | 2023-03-18 | 2 | -16/+106 |
| | |||||
* | more wip collect | Rasmus Dahlberg | 2023-03-17 | 3 | -50/+68 |
| | |||||
* | Make a few constants into flags | Rasmus Dahlberg | 2023-03-17 | 2 | -26/+23 |
| | |||||
* | Add uint64 to ctflag | Rasmus Dahlberg | 2023-03-17 | 1 | -0/+6 |
| | |||||
* | more wip collect | Rasmus Dahlberg | 2023-03-17 | 2 | -3/+18 |
| | |||||
* | more wip collect | Rasmus Dahlberg | 2023-03-17 | 2 | -19/+49 |
| | |||||
* | Remove dead code | Rasmus Dahlberg | 2023-03-17 | 1 | -9/+0 |
| | |||||
* | Fork some snippets to get SANs parsing | Rasmus Dahlberg | 2023-03-17 | 1 | -0/+487 |
| | |||||
* | wip collect | Rasmus Dahlberg | 2023-03-17 | 4 | -2/+412 |
| | |||||
* | Add heap chunk and helpers | Rasmus Dahlberg | 2023-03-17 | 1 | -0/+86 |
| | |||||
* | Add utils | Rasmus Dahlberg | 2023-03-17 | 1 | -0/+56 |
| | |||||
* | Add .gitignore | Rasmus Dahlberg | 2023-03-17 | 1 | -0/+1 |
| | |||||
* | Add drafty snapshot command | Rasmus Dahlberg | 2023-03-17 | 4 | -3/+155 |
| | |||||
* | Add drafty command skeleton | Rasmus Dahlberg | 2023-03-17 | 3 | -0/+111 |
| | |||||
* | Copy internal ctflag package | Rasmus Dahlberg | 2023-03-17 | 1 | -0/+84 |
| | |||||
* | Add authors and licence | Rasmus Dahlberg | 2023-03-17 | 2 | -0/+47 |
| | | | | Add source URL once this has a more permanent home | ||||
* | Fork merkle package | Rasmus Dahlberg | 2023-03-17 | 2 | -0/+386 |
| | | | | | To get ranged inclusion proofs that operate on leaf hashes rather than the leaf data. Should probably be fixed upstream at some point. | ||||
* | Add go module | Rasmus Dahlberg | 2023-03-17 | 1 | -0/+3 |
| | |||||
* | Add drafty sketch of ct-sans data collection | Rasmus Dahlberg | 2023-03-17 | 1 | -0/+123 |