|James Mills a8dd58fd0b||7 months ago|
|.chglog||9 months ago|
|.dockerfiles||9 months ago|
|client||8 months ago|
|cmd||7 months ago|
|contrib||2 years ago|
|data||9 months ago|
|docs||7 months ago|
|internal||7 months ago|
|tests||10 months ago|
|tools||7 months ago|
|types||7 months ago|
|.dockerignore||1 year ago|
|.drone.yml||9 months ago|
|.gitignore||8 months ago|
|.goreleaser.yml||10 months ago|
|AUTHORS||7 months ago|
|CHANGELOG.md||7 months ago|
|CODE_OF_CONDUCT.md||2 years ago|
|CONTRIBUTING.md||9 months ago|
|Dockerfile||8 months ago|
|Dockerfile.dev||10 months ago|
|LICENSE||10 months ago|
|Makefile||8 months ago|
|README.md||8 months ago|
|README_ZH.md||10 months ago|
|doc.go||1 year ago|
|docker-compose.yml||1 year ago|
|docker-stack.yml||9 months ago|
|go.mod||8 months ago|
|go.sum||8 months ago|
|preflight.sh||9 months ago|
|version.go||1 year ago|
📕 yarn is a Self-Hosted, Twitter™-like Decentralised micro-Blogging platform. No ads, no tracking, your content, your data!
yarndis the Yarn.social pod backend server
yarncis the command-line client to
yarndAPI and command-line Twtxt client
See Yarn.social for more deatils
As a first point, please try to use one of the pre-built binaries that are available on the Releases page.
We provide Homebrew formulae for macOS users for both the
command-line client (
yarn) as well as the server (
brew tap yarnsocial/yarn https://git.mills.io/yarnsocial/homebrew-yarn.git brew install yarn
Run the server:
Run the command-line client:
Building from source
This is an option if you are familiar with Go development.
- Clone this repository (this is important)
git clone https://git.mills.io/yarnsocial/yarn.git
- Install required dependencies (this is important)
Note that in order to get the media upload functions to work, you need to
install ffmpeg and its associated
-dev packages. Consult your distribution's package
repository for availability and names.
- Build the binaries
- Login to your Yarn.social pod:
$ ./yarn login INFO Using config file: /Users/prologic/.twt.yaml Username:
- Viewing your timeline
$ ./yarn timeline INFO Using config file: /Users/prologic/.twt.yaml > prologic (50 minutes ago) Hey @rosaelefanten 👋 Nice to see you have a Twtxt feed! Saw your [Tweet](https://twitter.com/koehr_in/status/1326914925348982784?s=20) (_or at least I assume it was yours?_). Never heard of `aria2c` till now! 🤣 TIL > dilbert (2 hours ago) Angry Techn Writers ‣ https://dilbert.com/strip/2020-11-14
- Making a Twt (post):
$ ./yarn post INFO Using config file: /Users/prologic/.twt.yaml Testing `yarn` the command-line client INFO posting twt... INFO post successful
For additional help on using the
yarnc command-line client:
$ yarnc help This is the command-line client for Yarn.social pods running yarnd. This tool allows a user to interact with a pod to view their timeline, following feeds, make posts and managing their account. Usage: yarnc [command] Available Commands: completion generate the autocompletion script for the specified shell help Help about any command login Login and euthenticate to a Yarn.social pod post Post a new twt to a Yarn.social pod stats Parses and performs statistical analytis on a Twtxt feed given a URL or local file timeline Display your timeline Flags: -c, --config string set a custom config file (default "/Users/prologic/.yarnc.yml") -d, --debug Enable debug logging -h, --help help for yarnc -t, --token string yarnd API token to use to authenticate to endpoints (default "$YARNC_TOKEN") -u, --uri string yarnd API endpoint URI to connect to (default "http://localhost:8000/api/v1/") Use "yarnc [command] --help" for more information about a command.
Deploy with Docker Compose
Run the compose configuration:
docker-compose up -d
Then visit: http://localhost:8000/
NOTE: Registrations are disabled by default so hence the
-R flag above.
Then visit: http://localhost:8000/
You can configure other options by specifying them on the command-line or via environment variables.
To view the available options simply run:
$ ./yarnd --help
Valid environment value names are the long-option version of a flag in all uppercase with dashes repalced by an underscore
Configuring your Pod
At a bare minimum you should set the following options:
-s bitcask:///path/to/data/twtxt.db(we will likely simplify/default this)
-n <name>to give your pod a unique name.
-u <url>the base url (public facing) of how your pod will be reahced on the web.
-Rto enable open registrations.
-Oto enable open profiles.
Most other configuration values should be done via environment variables.
It is recommended you pick an account you want to use to "administer" the pod with and set the following environment values:
In order to configure email settings for password recovery and the
/abuse endpoints, you should set appropriate
It is highly recommended you also set the following values to secure your Pod:
These values should be generated with a secure random number generator and
be of length
64 characters long. You can use the following shell snippet
to generate secrets for your pod for the above values:
$ cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1
There is a shell script in
./tools/gen-secrets.sh you can use to conveniently generate the required secrets for a production pod. The output is designed to by copy/pasted into a
docker-compose.yml file with the right indentation.
DO NOT publish or share these values. BE SURE to only set them as env vars.
NOTE: The Dockerfile specifies that the container run as
uid=1000. Be sure that any volume(s) you
mount into your container and use as the data storage (
path and database storage path (
-s/--store) is correctly configured
to have the correct user/group ownership. e.g:
chorn -R 1000:1000 /data
You can deploy
yarnd to a Docker Swarm
cluster by utilising the provided
yarn.yaml Docker Stack. This also depends on
and uses the Traefik ingress load balancer so you must
also have that configured and running in your cluster appropriately.
docker stack deploy -c yarn.yml
Interested in contributing to this project? You are welcome! Here are some ways you can contribute:
- File an Issue -- For a bug, or interesting idea you have for a new feature or just general questions.
- Submit a Pull-Request or two! We welcome all PR(s) that improve the project!
Thank you to all those that have contributed to this project, battle-tested it, used it in their own projects or products, fixed bugs, improved performance and even fix tiny typos in documentation! Thank you and keep contributing!
You can find an AUTHORS file where we keep a list of contributors to the project. If you contribute a PR please consider adding your name there.
- Yarn.social -- Yarn.social landing page
- Yarns -- The Yarn.social search engine hosted at search.twtxt.net
- App -- Our Flutter iOS and Android Mobile App
- Feeds -- RSS/Atom/Twitter to Twtxt aggregator service hosted at feeds.twtxt.net
yarn is licensed under the terms of the MIT License