twtxt registry server leveraging memory caching and LevelDB or SQLite3
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
creme 656f60046f
Merge remote-tracking branch 'upstream/master'
1 week ago
.github/ISSUE_TEMPLATE removed duplicate template 8 months ago
assets endpoint for version response 5 months ago
etc cli flags for db path/type, assets dir. systemd unit file. makefile. 8 months ago
svc some functions were missing comments. added those in where needed. 1 month ago
testdata added testdata/twtxt.txt for tests to run against 1 month ago
.gitignore ignoring logs directory 8 months ago
.travis.yml including go1.13 in travis conf 2 months ago
LICENSE Initial commit 9 months ago
Makefile leaving db intact on uninstall 1 month ago minor stylistic change in notes 1 month ago
getwtxt.go license notice at top of each file 7 months ago
getwtxt.yml typo 1 month ago
go.mod version bump for getwtxt/registry dep 1 week ago
go.sum version bump for getwtxt/registry dep 1 week ago

getwtxt  Build Status Go Report Card Code Climate Maintainability

twtxt registry written in Go!

twtxt is a decentralized microblogging platform “for hackers” based on text files. The user is “followed” and “mentioned” by referencing the URL to their twtxt.txt file and a nickname. Registries are designed to aggregate several users’ statuses into a single location, facilitating the discovery of new users to follow and allowing the search of statuses for tags and key words.

  [ Installation ]   [ Upgrading ]   [ Configuration ]   [ Using the Registry ]   [ Benchmarks ]   [ Other Documentation ]   [ Notes ]


 GitHub release

  • Easy to set up and maintain
  • Uses an in-memory cache to serve requests
  • Pushes to a database at a configurable interval for persistent storage
    • leveldb (default)
    • sqlite3
  • More database support is in development
  • Run directly facing the internet or behind Caddy / nginx
  • Optional TLS support
  • Optional hostname matching (serve requests for eg. without a reverse proxy)

Public Instances

Would you like your instance listed? Submit a PR or shoot me an email :)


I have only personally tested getwtxt on Linux, specifically:

  • Debian 9, 10/Testing, Sid
  • Ubuntu Server 18.04LTS, 18.10, 19.04

Build dependencies are minimal, and only include:

  • gnu make
  • go >= 1.11
  • git

First, fetch the sources using git and jump into the directory.

$ git clone git://
$ cd getwtxt

Then, check out the latest release tag.

This will be the same tag listed on the badge under the Features section heading.

$ git checkout v0.0.0

Or, if you want to be a git ninja, you can use this to just check out whatever the latest tag is:

$ git checkout $(git describe --tags --abbrev=0)

Optionally, use the go tool to test and benchmark the files in svc.

$ go test -v -bench . -benchmem ./...

Use make to initiate the build and install process.

$ make
$ sudo make install


Upgrading is a fairly simple process. First, we need to commit your local changes to the configuration file.

$ cp /usr/local/getwtxt/getwtxt.yml .
$ git add getwtxt.yml
$ git commit -m 'my local config'

Now, we need to either run make update or git pull --rebase origin master

$ make update

Afterwards, follow the normal instructions for building and installing. If no configuration changes have been made since your last upgrade, you will not need to commit them again. While getwtxt is pre-1.0, any patch-level updates (v0.4.x) will not change configuration values.

Of course, you can also just back up your configuration file, then copy it back into /usr/local/getwtxt/ after installing the new version.


[ Proxying ]   [ Starting getwtxt ]

To configure getwtxt, you'll first need to open /usr/local/getwtxt/getwtxt.yml in your favorite editor and modify any values necessary. There are comments in the file explaining each option.

If you desire, you may additionally modify the template in /usr/local/getwtxt/assets/tmpl/index.html to customize the page users will see when they pull up your registry instance in a web browser. The values in the configuration file under Instance: are used to replace text {{.Like This}} in the template.


Though getwtxt will run perfectly fine facing the internet directly, it does not understand virtual hosts, nor does it use TLS (yet). You'll probably want to proxy it behind Caddy or nginx for this reason.

Caddy is ludicrously easy to set up, and automatically handles TLS certificates. Here's the config:
proxy /

If you're using nginx, here's a skeleton config to get you started. Don't forget to change the 5 instances of to the (sub)domain you'll be using to access the registry, generate SSL/TLS certificates using letsencrypt, and change the port in proxy_pass to whichever port you specified when modifying the configuration file. Currently, it's set to the default port 9001

server {
    listen [::]:443 ssl http2;
    listen ssl http2;
    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
server {
    if ($host = {
        return 301 https://$host$request_uri;
    listen 80;
    return 404;

Starting getwtxt

Once you have everything configured to your needs, use systemctl to enable it to run on system boot, then start the service.

$ sudo systemctl enable getwtxt
$ sudo systemctl start getwtxt

Using the Registry

The following examples will all apply to using curl from a Linux, BSD, or macOS terminal. All timestamps are in RFC3339 format, per the twtxt registry specification. Additionally, all queries support the ?page=N parameter, where N is a positive integer, that will retrieve page N of results in groups of twenty.

The example API calls can also be found on the landing page of any getwtxt instance, assuming the admin has not customized the landing page.

Adding a User

Both nickname and URL are required

$ curl -X POST ''

200 OK

Get All Tweets

$ curl ''

foo_barrington  2019-03-01T09:31:02.000Z Hey! It's my first status!

Query Tweets by Keyword

$ curl ''

foo_barrington    2019-04-30T06:00:09.000Z    I just installed getwtxt!

Get All Users

Timestamp reflects when the user was added to the registry.

$ curl ''

foo_barrington      https://foo.barrington.ext/twtxt.txt  2017-01-01T09:17:02.000Z
foo_barrington_jr         2019-03-01T09:31:02.000Z

Query Users

Can use either keyword or URL.

$ curl ''

foo          2019-05-09T08:42:23.000Z

$ curl ''

foo          2019-05-09T08:42:23.000Z
foobar      2019-03-14T19:23:00.000Z
foo_barrington    2019-05-01T15:59:39.000Z

Get all tweets with mentions

Mentions are placed within a status using the format @<nickname http://url/twtxt.txt>

$ curl ''

foo          2019-02-28T11:06:44.000Z    @<foo_barrington> Hey!! Are you still working on that project?
bar          2019-02-27T11:06:44.000Z    @<foobar> How's your day going, bud?
foo_barrington    2019-02-26T11:06:44.000Z    @<foo> Did you eat my lunch?

Query tweets by mention URL

$ curl ''

foo    2019-02-26T11:06:44.000Z    @<foo_barrington> Hey!! Are you still working on that project?e

Get all Tags

$ curl ''

foo    2019-03-01T09:33:04.000Z    No, seriously, I need #help
foo    2019-03-01T09:32:12.000Z    Seriously, I love #programming!
foo    2019-03-01T09:31:02.000Z    I love #programming!

Query by Tag

$ curl ''

foo    2019-03-01T09:31:02.000Z    I love #programming!


$ bombardier -c 100 -n 200000 http://localhost:9001/api/plain/tweets

Bombarding http://localhost:9001/api/plain/tweets with 200000 request(s) using 100 connection(s)
 200000 / 200000 [=============================================================] 100.00% 19961/s 10s


Statistics        Avg      Stdev        Max
  Reqs/sec     20006.58    2408.55   26054.73
  Latency        5.00ms     3.58ms    62.99ms
  HTTP codes:
    1xx - 0, 2xx - 200000, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:    39.27MB/s

Other Documentation

In addition to what is provided here, additional information, particularly regarding the configuration file, may be found by running getwtxt with the -m or --manual flags. You will likely want to pipe the output to less as it is quite long.

$ ./getwtxt -m | less

$ ./getwtxt --manual | less

If you need to remove getwtxt from your system, navigate to the source directory you acquired using git during the installation process and run the appropriate make hook:

$ sudo make uninstall


twtxt Information:

Interested in twtxt but don't have your own server?

twtxt Client Repo:

Registry Specification:

Special thanks to for open-sourcing a pleasant, easy-to-use, importable stylesheet


All contributions are greatly appreciated! Please open an issue, submit a pull request, anything.

If you're interested in contributing, take a look at the github project page for getwtxt, linked below, where I've listed various items I'm working on or plan to work on in the very near future. It'll give you some inspiration for pull requests to submit. If you have an idea for a new feature or come across a bug, submitting a new issue will be greatly appreciated as well.