about summary refs log tree commit diff
path: root/tools/blog_cli/README.md
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-08-19T15·58+0100
committerVincent Ambo <tazjin@google.com>2019-08-19T15·59+0100
commit2a16740445291366540f8ce3fa8589c3f9b7740a (patch)
tree7a002a2fb1c7ead609dd21714614d79ec5be0fbf /tools/blog_cli/README.md
parent28a9c01d3633b8f078f65d46d74ca6fe10b06173 (diff)
feat(tools): Add a horrifying tool to write blog posts into DNS r/41
Diffstat (limited to 'tools/blog_cli/README.md')
-rw-r--r--tools/blog_cli/README.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/blog_cli/README.md b/tools/blog_cli/README.md
new file mode 100644
index 000000000000..7afa0fe9207a
--- /dev/null
+++ b/tools/blog_cli/README.md
@@ -0,0 +1,41 @@
+tazblog CLI
+===========
+
+My blog stores its content in DNS, spread out over three types of `TXT` entries:
+
+* `TXT _posts.blog.tazj.in.`: A sorted list of posts, serialised as a JSON list of
+  strings (e.g. `["1486830338", "1476807384"]`)
+
+* `TXT _chunks.$postID.blog.tazj.in`: JSON chunks containing the blog post text
+
+* `TXT _meta.$postID.blog.tazj.in`: JSON blob with blog post metadata
+
+All JSON blobs are base64-encoded.
+
+This CLI tool helps to update those records.
+
+Each blog post data is a series of JSON-encoded structures which follow one of
+these formats:
+
+```
+struct metadata {
+    chunks: int
+    title: string
+    date: date
+}
+```
+
+Where `chunks` describes the number of chunks following this format:
+
+```
+struct chunk {
+    c: int
+    t: string
+}
+```
+
+Writing a blog post to DNS means taking its text and metadata, chunking it up
+and writing the chunks.
+
+Reading a blog post means retrieving all data, reading the metadata and then
+assembling the chunks in order.