{"id":13550856,"url":"https://github.com/getwtxt/getwtxt","last_synced_at":"2025-04-03T00:35:14.731Z","repository":{"id":57562097,"uuid":"185883024","full_name":"getwtxt/getwtxt","owner":"getwtxt","description":"twtxt registry server","archived":true,"fork":false,"pushed_at":"2021-12-01T05:47:42.000Z","size":672,"stargazers_count":44,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-03T20:36:07.578Z","etag":null,"topics":["microblogging","twtxt"],"latest_commit_sha":null,"homepage":"https://sr.ht/~gbmor/getwtxt","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getwtxt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-09T23:00:01.000Z","updated_at":"2024-10-09T14:47:38.000Z","dependencies_parsed_at":"2022-09-16T13:51:12.301Z","dependency_job_id":null,"html_url":"https://github.com/getwtxt/getwtxt","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getwtxt%2Fgetwtxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getwtxt%2Fgetwtxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getwtxt%2Fgetwtxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getwtxt%2Fgetwtxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getwtxt","download_url":"https://codeload.github.com/getwtxt/getwtxt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246916734,"owners_count":20854511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["microblogging","twtxt"],"created_at":"2024-08-01T12:01:38.574Z","updated_at":"2025-04-03T00:35:09.720Z","avatar_url":"https://github.com/getwtxt.png","language":"Go","funding_links":[],"categories":["Go","others","Blog"],"sub_categories":["Chat and Messaging"],"readme":"## Archived\nI'm well into a ground-up rewrite, so don't use this.\nWhen it goes public, it will be at: [gbmor/getwtxt-ng](https://github.com/gbmor/getwtxt-ng)\n\n# getwtxt\n[![builds.sr.ht status](https://builds.sr.ht/~gbmor/getwtxt.svg)](https://builds.sr.ht/~gbmor/getwtxt?)\n[![Build Status](https://travis-ci.com/getwtxt/getwtxt.svg?branch=master)](https://travis-ci.com/getwtxt/getwtxt)\n[![Go Report Card](https://goreportcard.com/badge/github.com/getwtxt/getwtxt)](https://goreportcard.com/report/github.com/getwtxt/getwtxt)\n[![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/0e48bd9002de0f84b24e/maintainability)](https://codeclimate.com/github/getwtxt/getwtxt/maintainability)\n\ntwtxt registry written in Go!\n\n[twtxt](https://github.com/buckket/twtxt) is a decentralized microblogging platform\nfor hackers based on text files. The user is \"followed\" and \"mentioned\" by referencing\nthe URL to their `twtxt.txt` file and a nickname.\n\nRegistries are designed to aggregate several users' statuses into a single location,\nfacilitating the discovery of new users to follow and allowing the search of statuses\nfor tags and key words.\n\n\u003ctable style=\"width: 100%; text-align: center; margin: 0 auto; border: 0px;\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e[\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e]\u003c/td\u003e\n    \u003ctd\u003e[\u003ca href=\"#upgrading\"\u003eUpgrading\u003c/a\u003e]\u003c/td\u003e\n    \u003ctd\u003e[\u003ca href=\"#configuration\"\u003eConfiguration\u003c/a\u003e]\u003c/td\u003e\n    \u003ctd\u003e[\u003ca href=\"#using-the-registry\"\u003eUsing the Registry\u003c/a\u003e]\u003c/td\u003e\n    \u003ctd\u003e[\u003ca href=\"#benchmarks\"\u003eBenchmarks\u003c/a\u003e]\u003c/td\u003e\n    \u003ctd\u003e[\u003ca href=\"#other-documentation\"\u003eOther Documentation\u003c/a\u003e]\u003c/td\u003e\n    \u003ctd\u003e[\u003ca href=\"#notes\"\u003eNotes\u003c/a\u003e]\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Features\n\n* Easy to set up\n* Uses an in-memory cache to serve requests\n* Pushes to a database at a configurable interval for persistent storage\n  * `leveldb (default)`\n  * `sqlite3`\n* Easily run behind `nginx`, `Caddy` or another HTTP server.\n\n## Public Instances\n\n* [twtxt.tilde.institute](https://twtxt.tilde.institute)\n* [twtxt.envs.net](https://twtxt.envs.net/)\n\nWould you like your instance listed? Send a message to the [mailing list](https://lists.sr.ht/~gbmor/getwtxt)!\n\n## Installation\n\nI have tested getwtxt on the following:\n* `Debian 9, 10`\n* `Ubuntu Server 18.04LTS, 18.10, 19.04`\n* `OpenBSD 6.6`\n\nBuild dependencies are minimal, and only include:\n* `make`\n* `go \u003e= 1.11`\n* `git`\n\nFirst, fetch the sources using `git` and jump into the directory.\n\n```\n$ git clone https://git.sr.ht/~gbmor/getwtxt\n...\n$ cd getwtxt\n```\n\nThen, check out the latest release tag.\n\n```\n$ git checkout $(git describe --tags --abbrev=0)\n```\n\nUse `make` to initiate the build and install process.\n```\n$ make\n...\n$ sudo make install\n```\n\n## Upgrading\n\nUpgrading is nearly a identical process. Pull the changes, check out the\nlatest tag, and rebuild.\n\nsystemd might yell at you about running `systemctl daemon-reload` when you\ngo to restart getwtxt.\n\nWhile getwtxt is pre-`1.0`, any patch-level updates (`v0.4.x`) will not\nchange configuration values. If a minor version increase has happened, for\nexample `v0.4.x -\u003e v0.5.x`, then check if you need to update the config\nfile before restarting getwtxt.\n\n## Configuration\n\n\\[ [Proxying](#proxying) \\] \u0026nbsp; \\[ [Starting getwtxt](#starting-getwtxt) \\]\n\nTo configure getwtxt, you'll first need to open `/usr/local/getwtxt/getwtxt.yml`\nin your favorite editor and modify any values necessary. There are comments in the\nfile explaining each option.\n\nIf you desire, you may additionally modify the template in\n`/usr/local/getwtxt/assets/tmpl/index.html` to customize the page users will see\nwhen they pull up your registry instance in a web browser. The values in the\nconfiguration file under `Instance:` are used to replace text `{{.Like This}}` in\nthe template.\n\n### Proxying\n\nThough getwtxt will run perfectly fine facing the internet directly, it does not\nunderstand virtual hosts, nor does it use TLS. You'll probably want to proxy it\nbehind\n`Caddy` or `nginx` for this reason.\n\n`Caddy` is ludicrously easy to set up, and automatically handles `TLS`\ncertificates. Here's the config:\n\n```caddyfile\ntwtxt.example.com\nproxy / example.com:9001\n```\n\nIf you're using `nginx`, here's a skeleton config to get you started. Don't\nforget to change the 5 instances of `twtxt.example.com` to the (sub)domain\nyou'll be using to access the registry, generate SSL/TLS certificates using\nLetsEncrypt, and change the port in `proxy_pass` to whichever port you\nspecified when modifying the configuration file. Currently, it's set to the\ndefault port `9001`\n\n```nginx\nserver {\n    server_name twtxt.example.com;\n    listen [::]:443 ssl http2;\n    listen 0.0.0.0:443 ssl http2;\n    ssl_certificate /etc/letsencrypt/live/twtxt.example.com/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/twtxt.example.com/privkey.pem;\n    include /etc/letsencrypt/options-ssl-nginx.conf;\n    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;\n    location / {\n        proxy_set_header Host $host;\n        proxy_set_header X-Forwarded-For $remote_addr;\n        proxy_pass http://127.0.0.1:9001;\n    }\n}\nserver {\n    if ($host = twtxt.example.com) {\n        return 301 https://$host$request_uri;\n    }\n    listen 80;\n    server_name twtxt.example.com;\n    return 404;\n}\n```\n\n### Starting getwtxt\n\nOnce you have everything configured to your needs, use `systemctl` to enable it\nto run on system boot, then start the service.\n\n```\n$ sudo systemctl enable getwtxt\n...\n$ sudo systemctl start getwtxt\n```\n\n## Using the Registry\n\nThe following examples will all apply to using `curl` from a `Linux`, `BSD`, or\n`macOS` terminal. All timestamps are in `RFC3339` format, per the twtxt registry\nspecification. Additionally, all queries support the `?page=N` parameter, where\n`N` is a positive integer, that will retrieve page `N` of results in groups of\ntwenty.\n\nThe example API calls can also be found on the landing page of any getwtxt\ninstance, assuming the admin has not customized the landing page.\n\n### Adding a User\nBoth nickname and URL are required\n\n```\n$ curl -X POST 'https://twtxt.example.com/api/plain/users?url=https://mysite.ext/twtxt.txt\u0026nickname=FooJr'\n\n200 OK\n```\n\n### Get All Tweets\n\n```\n$ curl 'https://twtxt.example.com/api/plain/tweets'\n\nfoo_barrington  https://foo.bar.ext/twtxt.txt  2019-03-01T09:31:02.000Z Hey! It's my first status!\n...\n...\n```\n\n### Query Tweets by Keyword\n\n```\n$ curl 'https://twtxt.example.com/api/plain/tweets?q=getwtxt'\n\nfoo_barrington    https://example3.com/twtxt.txt    2019-04-30T06:00:09.000Z    I just installed getwtxt!\n```\n\n### Get All Users\nTimestamp reflects when the user was added to the registry.\n\n```\n$ curl 'https://twtxt.example.com/api/plain/users'\n\nfoo_barrington      https://foo.barrington.ext/twtxt.txt  2017-01-01T09:17:02.000Z\nfoo_barrington_jr   https://example.com/twtxt.txt         2019-03-01T09:31:02.000Z\n...\n...\n```\n\n### Query Users\nCan use either keyword or URL.\n\n```\n$ curl 'https://twtxt.example.com/api/plain/users?url=https://example.com/twtxt.txt'\n\nfoo               https://example.com/twtxt.txt     2019-05-09T08:42:23.000Z\n\n\n$ curl 'https://twtxt.example.com/api/plain/users?q=foo'\n\nfoo               https://example.com/twtxt.txt     2019-05-09T08:42:23.000Z\nfoobar            https://example2.com/twtxt.txt    2019-03-14T19:23:00.000Z\nfoo_barrington    https://example3.com/twtxt.txt    2019-05-01T15:59:39.000Z\n```\n\n### Get all tweets with mentions\nMentions are placed within a status using the format `@\u003cnickname http://url/twtxt.txt\u003e`\n\n```\n$ curl 'https://twtxt.tilde.institute/api/plain/mentions'\n\nfoo               https://example.com/twtxt.txt     2019-02-28T11:06:44.000Z    @\u003cfoo_barrington https://example3.com/twtxt.txt\u003e Hey!! Are you still working on that project?\nbar               https://mxmmplm.com/twtxt.txt     2019-02-27T11:06:44.000Z    @\u003cfoobar https://example2.com/twtxt.txt\u003e How's your day going, bud?\nfoo_barrington    https://example3.com/twtxt.txt    2019-02-26T11:06:44.000Z    @\u003cfoo https://example.com/twtxt.txt\u003e Did you eat my lunch?\n```\n\n### Query tweets by mention URL\n\n```\n$ curl 'https://twtxt.tilde.institute/api/plain/mentions?url=https://foobarrington.co.uk/twtxt.txt'\n\nfoo    https://example.com/twtxt.txt    2019-02-26T11:06:44.000Z    @\u003cfoo_barrington https://foobarrington.co.uk/twtxt.txt\u003e Hey!! Are you still working on that project?e\n```\n\n### Get all Tags\n\n```\n$ curl 'https://twtxt.example.com/api/plain/tags'\n\nfoo    https://example.com/twtxt.txt    2019-03-01T09:33:04.000Z    No, seriously, I need #help\nfoo    https://example.com/twtxt.txt    2019-03-01T09:32:12.000Z    Seriously, I love #programming!\nfoo    https://example.com/twtxt.txt    2019-03-01T09:31:02.000Z    I love #programming!\n```\n\n### Query by Tag\n\n```\n$ curl 'https://twtxt.example.com/api/plain/tags/programming'\n\nfoo    https://example.com/twtxt.txt    2019-03-01T09:31:02.000Z    I love #programming!\n```\n\n### Delete a User\n\n```\n$ curl -X DELETE -H 'X-Auth: password_in_getwtxt.yml' 'https://twtxt.example.com/api/admin/users?url=https://example.com/twtxt.txt'\n\n200 OK\n```\n\n## Benchmarks\n\n* [bombardier](https://github.com/codesenberg/bombardier)\n\n```\n$ bombardier -c 100 -n 200000 http://localhost:9001/api/plain/tweets\n\nBombarding http://localhost:9001/api/plain/tweets with 200000 request(s) using 100 connection(s)\n 200000 / 200000 [=============================================================] 100.00% 19961/s 10s\n\nDone!\n\nStatistics        Avg      Stdev        Max\n  Reqs/sec     20006.58    2408.55   26054.73\n  Latency        5.00ms     3.58ms    62.99ms\n  HTTP codes:\n    1xx - 0, 2xx - 200000, 3xx - 0, 4xx - 0, 5xx - 0\n    others - 0\n  Throughput:    39.27MB/s\n```\n\n## Other Documentation\n\nIn addition to what is provided here, additional information, particularly\nregarding the configuration file, may be found by running getwtxt with the `-m`\nor `--manual` flags. You will likely want to pipe the output to `less` as it is\nquite long.\n\n```\n$ ./getwtxt -m | less\n\n$ ./getwtxt --manual | less\n```\n\nIf you need to remove getwtxt from your system, navigate to the source directory\nyou acquired using `git` during the installation process and run the appropriate\n`make` hook:\n\n```\n$ sudo make uninstall\n```\n\n## Notes\n\ntwtxt Information: [`twtxt.readthedocs.io`](https://twtxt.readthedocs.io)\n\nInterested in twtxt but don't have your own server? [`github.com/LuRsT/twtxt_on_heroku`](https://github.com/LuRsT/twtxt_on_heroku)\n\ntwtxt Client Repo: [`github.com/buckket/twtxt`](https://github.com/buckket/twtxt)\n\nRegistry Specification: [`twtxt.readthedocs.io/en/latest/user/registry.html`](https://twtxt.readthedocs.io/en/latest/user/registry.html)\n\nSpecial thanks to [`github.com/kognise/water.css`](https://github.com/kognise/water.css) for open-sourcing a pleasant, easy-to-use, importable stylesheet\n\n## Contributing\n\nAll contributions are greatly appreciated!\n\n* Mailing list for patches, discussion, etc:\n  * [lists.sr.ht/~gbmor/getwtxt](https://lists.sr.ht/~gbmor/getwtxt)\n* Ticket tracker:\n  * [todo.sr.ht/~gbmor/getwtxt](https://todo.sr.ht/~gbmor/getwtxt)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetwtxt%2Fgetwtxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetwtxt%2Fgetwtxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetwtxt%2Fgetwtxt/lists"}