aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-01-23 08:41:09 -0600
committerMarc Coquand <marc@mccd.space>2024-01-23 08:41:09 -0600
commit0903b6106ed721e22af71090f1c3b0cc947e9079 (patch)
tree5be5933a5e60c2f54be7fe17791bb6e7adb80dea /README.md
parentf09148124b6d3a01e43e93233e47af0b8ecf0d56 (diff)
downloadwormhole-0903b6106ed721e22af71090f1c3b0cc947e9079.tar.gz
wormhole-0903b6106ed721e22af71090f1c3b0cc947e9079.tar.bz2
wormhole-0903b6106ed721e22af71090f1c3b0cc947e9079.zip
Rename READMEHEADmain
Diffstat (limited to 'README.md')
-rw-r--r--README.md99
1 files changed, 99 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..94e75eb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,99 @@
+# Wormhole
+
+Enables you to send messages from mastodon into a wormhole to have it go through time and space and appear in a new galaxy!
+
+In this new galaxy, you can see what other people have shared and subscribe to it's RSS feed to receive updates. What a great way to share links with friends!
+
+Note: Not quite production ready yet. I have hard coded some values specifically to galaxy.mccd.space and also there is no persistent storage available yet!
+
+## Motivation
+
+I am part of a group of researchers / decentralization enthusiasts, and we want to have a way to share links that we found interesting. Along with that, we'd also like to be able to discuss and comment on those. Initially I built a boring link sharing server where you logged in and shared things. Instead, more interesting would be to send everything into a wormhole, where the shared links pop up on the other side. From there, people can follow content updates by either going into the website or subscribing to an RSS feed.
+
+I built it in OCaml because it is by far the most underrated programming language on the planet and the web framework Dream is a BEAST in terms of productivity. Hyper fast compilation speed + great performance + productive + safe + lots of industry use.
+
+## Prerequisites
+
+You'll need [nix](https://nixos.org/) to run it locally. It sets everything up to make it dead easy
+to run locally.
+
+If you use direnv, then set direnv allow to enable it to start automagically when you cd to the directory.
+
+You'll need to have the experimental flags nix-command and flakes set for it to work.
+
+Alternatively, you can execute each command with the flag
+
+```
+--extra-experimental-features "nix-command flakes"
+```
+
+And it will work to.
+
+## Running locally
+
+```
+nix build . # Will take a long time the first time, after that it will go very fast.
+ENV=DEV DISABLE_AUTH=true nix develop -c dune exec --watch --root . wormhole
+```
+
+Dev flag adds some mock data.
+
+## Allow list
+
+There is a allow list in bin/main.ml that you will need to update to allow specific actors to make posts. This is a safety precaution as there is no federation yet.
+
+## Build
+
+```
+opam install . --deps-only
+opam exec -- dune build
+```
+
+## Hosting
+
+You can make use of the dockerfile to host your wormhole, personally I host it on a 4gb VPC on Hetzner for 8$ a month using Dokku.
+
+### Hosting with dokku
+
+Follow the install instructions from [dokku](https://dokku.com/), attach your dokku instance to a domain, then create a new app:
+
+```
+root@server$ dokku apps:create my-wormhole
+```
+
+Now, clone this repo and add a new remote, then push it to create the app
+
+```
+you@comp$ git remote add dokku dokku@your-dokku-domain.com
+you@comp$ git push dokku master
+```
+
+This will set up the instance. I had little success with this on a 2gb VPC, so do avoid that.
+
+Once up, let's setup SSL for it to work:
+
+```
+root@server$ dokku plugin:install https://github.com/dokku/dokku-letsencrypt
+root@server$ dokku letsencrypt:set my-wormhole email your@email.tld
+root@server$ dokku letsencrypt:enable my-wormhole
+```
+
+Now it should be possible to find your wormhole in Mastodon! Look for @wormhole@my-wormhole.your-dokku-domain.com.
+
+## Development
+
+Good documentation:
+
+- [Yojson](https://github.com/janestreet/ppx_yojson_conv)
+
+### Testing
+
+You can install `hurl` do to integration tests. For example:
+
+```
+hurl http/inbox.hurl
+```
+
+## Contributing
+
+Send patches to marc@mccd.space. Never sent email patches before? Check out [this tutorial](https://git-send-email.io/). Let us move to a more decentralized ecosystem for open source development!