···2name = "allegedly"
3description = "public ledger server tools and services (for the PLC)"
4license = "MIT OR Apache-2.0"
5-version = "0.2.1"
6edition = "2024"
7default-run = "allegedly"
8
···2name = "allegedly"
3description = "public ledger server tools and services (for the PLC)"
4license = "MIT OR Apache-2.0"
5+version = "0.3.0"
6edition = "2024"
7default-run = "allegedly"
8
+11-6
readme.md
···26 sudo allegedly mirror \
27 --upstream "https://plc.directory" \
28 --wrap "http://127.0.0.1:3000" \
029 --acme-domain "plc.wtf" \
0030 --acme-cache-path ./acme-cache \
31- --acme-directory-url "https://acme-staging-v02.api.letsencrypt.org/directory"
0032 ```
3334···6869### new things
7071-- experimental: websocket version of /export
72-- experimental: accept writes by forwarding them upstream
73-- experimental: serve a tlog
74-- experimental: embed a log database directly for fast and efficient mirroring
75-- experimental: support multiple upstreams?
7677- [ ] new command todo: `zip` or `check` or `diff`: compare two plc logs over some time range
78- [ ] new command to consider: `scatter` or something: broadcast plc writes to multiple upstreams
···26 sudo allegedly mirror \
27 --upstream "https://plc.directory" \
28 --wrap "http://127.0.0.1:3000" \
29+ --wrap-pg-cert "/opt/allegedly/postgres-cert.pem" \
30 --acme-domain "plc.wtf" \
31+ --acme-domain "alt.plc.wtf" \
32+ --experimental-acme-domain "experimental.plc.wtf" \
33 --acme-cache-path ./acme-cache \
34+ --acme-directory-url "https://acme-staging-v02.api.letsencrypt.org/directory" \
35+ --acme-ipv6 \
36+ --experimental-write-upstream
37 ```
3839···7374### new things
7576+- [ ] experimental: websocket version of /export
77+- [x] experimental: accept writes by forwarding them upstream
78+- [ ] experimental: serve a tlog
79+- [ ] experimental: embed a log database directly for fast and efficient mirroring
80+- [ ] experimental: support multiple upstreams?
8182- [ ] new command todo: `zip` or `check` or `diff`: compare two plc logs over some time range
83- [ ] new command to consider: `scatter` or something: broadcast plc writes to multiple upstreams
+25-4
src/mirror.rs
···25}
2627#[handler]
28-fn hello(Data(State { upstream, .. }): Data<&State>) -> String {
000000000000000000000029 format!(
30 r#"{}
31···45 - GET /* Proxies to wrapped server; see PLC API docs:
46 https://web.plc.directory/api/redoc
4748- - POST /* Always rejected. This is a mirror.
4950-51- tip: try `GET /{{did}}` to resolve an identity
525354Allegedly is a suite of open-source CLI tools from for working with PLC logs,
···25}
2627#[handler]
28+fn hello(
29+ Data(State {
30+ upstream,
31+ experimental: exp,
32+ ..
33+ }): Data<&State>,
34+ req: &Request,
35+) -> String {
36+ let post_info = match (exp.write_upstream, &exp.acme_domain, req.uri().host()) {
37+ (false, _, _) => " - POST /* Always rejected. This is a mirror.".to_string(),
38+ (_, None, _) => {
39+ " - POST /:did Create a PLC op. Allegedly will forward it upstream.".to_string()
40+ }
41+ (_, Some(d), Some(f)) if f == d => {
42+ " - POST /:did Create a PLC op. Allegedly will forward it upstream.".to_string()
43+ }
44+ (_, Some(d), _) => format!(
45+ r#"\
46+ - POST /* Rejected, but experimental upstream op forwarding is
47+ available at `POST {d}/:did`!"#
48+ ),
49+ };
50+51 format!(
52 r#"{}
53···67 - GET /* Proxies to wrapped server; see PLC API docs:
68 https://web.plc.directory/api/redoc
6970+ tip: try `GET /{{did}}` to resolve an identity
7172+{post_info}
0737475Allegedly is a suite of open-source CLI tools from for working with PLC logs,