From 8a34f7e16ce2f73452bc4db035c649f2ee8e5da1 Mon Sep 17 00:00:00 2001 From: Daan Sprenkels Date: Sun, 1 Sep 2019 18:06:57 +0200 Subject: [PATCH] readme: Updates and typo fixes --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1219817..f335743 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ are the exceptions: - `github.com/gorilla/sessions` for session management. - `go.etcd.io/bbolt` is our database driver. - `github.com/pkg/errors` provides a [`Wrap`] function. +- `github.com/prometheus/client_golang/prometheus/...` has easy Prometheus + functionality. [`Wrap`]: https://godoc.org/github.com/pkg/errors#Wrap @@ -29,18 +31,32 @@ That means that we have to separate every other page with some kind of namespace. Ideas: - `/z/` reserved for flat pages. -- `/p/` reserved for "pastes". -- `/u/` reserved for "users". -- `/f/` reserved for "files". - `/z/static/` reserved for "static files". +## Paste types + +Previous, I was planning to put pastes (not redirects) in a separate bucket +and below a url namespace. Then when one was created, we would immediately +generate a redirect link. + +Turns out it's easier though to just save a unit (we call it a "paste") which +can be of different types. For example: + +- Redirect +- Paste +- File +- Image +- Hypothetical other stuff: + - Dead-drop + - [...]? + ## Shorten keys and collisions -First of all: A sexted is a value of 6 bits. +First of all: A sextet is a value of 6 bits. For generating keys, we will initially generate a random value of 4 sextets, where the first bit is set to `0`. If this collides with an existing key, we -will generate a new one made out of 5 sextexts, and set the prefix bits to +will generate a new one made out of 5 sextets, and set the prefix bits to `0b10`. We will keep doing this until we don't have any collisions anymore. To get proper-looking keys, we format the key to characters using the @@ -72,10 +88,10 @@ header that the client sends. We can still wrap the plain-text page in a single forever, and store a user's data in there, without having to collect personal data in any way. - URL-shortening links will be retained for always, unless the submitter - revokes it, in which case it will be replaced by a `410 Gone` page*. -- The probles of pastes are not solved. This is an unsolved problem*. + revokes it, in which case it will be replaced by a `410 Gone` page[*]. +- The probles of pastes are not solved. This is an unsolved problem[*]. -* In any case, we going to comply with all European laws and reasonable +[*] In any case, we going to comply with all European laws and reasonable requests for deletion. ## Privacy