Honk If You Like The Fediverse!

Honk If You Like The Fediverse!

This is a re-post from today’s newsletter. I usually keep away from doing this however the content material right here is def extra “bloggy” than “newslettery”.

You can now obtain these weblog posts in your exercise stream. Just observe @[email protected] and the brand new posts from right here will slide proper into your timeline.

So, you’ve dedicated to abandoning the chicken website, joined a occasion, or three, and at the moment are a citizen of the Fediverse. This is 👍🏽! But, what if you wish to dig into this courageous new universe a bit and see the way it works? Or, maybe you want to have interaction with a particular set of other people with out committing to a specific BBSnode?

Running a full-on Mastodon occasion means coping with PostgreSQL, Redis, Ruby (ugh), and NodeJS. Sure, Docker is an possibility, however that is nonetheless an enormous challenge, and it’s more than likely that you just’re not a Ruby programmer (which makes it troublesome to poke on the code to bend it to your will).

What if I advised you there’s a option to run your personal ActivityPub (et al.) server that:

  • is constructed with Golang (requires libsqlite3)
  • makes use of SQLite for persistence
  • compiles in seconds
  • units up in minutes
  • takes virtually no system assets
  • helps customized emojis
  • permits markdown in posts (together with supply code block syntax highlighting)
  • options location check-ins (like Foursquare again within the outdated days)
  • allows filtering and censorship (for abuse prevention)
  • sports activities a tiny however fairly helpful API
  • lets of us eat your exercise stream as an RSS feed

If that sounds extra to your liking, let me introduce you to Honk by Ted Unangst (@tedu@honk.tedunangst.com), and stroll you thru my Honk (@bob@honk.hrbrmstr.de) setup.

Prepare To Honk

You can both use Mercurial and:

$ hg clone https://humungus.tedunangst.com/r/honk

or grab a tarball and broaden it (do both of these items on the field you may be operating Honk). Then, simply:

$ cd honk
$ make

and in a number of seconds you’ll have a honk server binary prepared to make use of.

Now, you’re additionally going to want a “TLS terminating reverse proxy”. We’ll be utilizing Nginx since it’s nigh ubiquitous and simple to setup. If you’ve by no means arrange an HTTPS Nginx occasion. Nginx drops in nicely virtually in every single place, and this isn’t a terrible certbot/nginx ‘splainer. The remainder of this drop assumes you will have an Nginx occasion able to configure for honking.

I’m internet hosting my precise Honk occasion on an overkill dwelling knowledge science server (you should utilize a Raspberry Pi to run Honk), which is uncovered to certainly one of my internet-facing Nginx reverse proxy servers through Tailscale. Using a setup like this implies you possibly can go super-cheap ($5/mo) on a VPS. You can even 100% simply run Honk on the identical internet-facing field as you do Nginx, simply be sure to observe the precise steering for that setup beneath, and mebbe spring for a barely larger server. FWIW I take advantage of SSD Nodes (full-disclosure: that’s an affiliate hyperlink).

Finally, you’ll want a FQDN configured that factors to your reverse proxy. Mine is honk.hrbrmstr.de which has an A file pointing to my internet-facing VPS. Your ActivityPub deal with shall be @[email protected], so decide one you possibly can dwell with.

Make certain all three of these issues are prepared for the remaining steps.

Configure + Run Honk

This half is fairly simple. Run:

$ ./honk init

on the field you’re operating Honk from. It’s going to ask you for 4 items of knowledge:

  • username: the username you need. Again, this shall be your @[email protected] id, so decide one you possibly can dwell with.
  • password: the password you need; decide a protracted passphrase from a password supervisor generator that you just’ll maintain in mentioned password supervisor. Honk does not assist MFA. Attackers will discover you. You can not cover. Just make it arduous for them.
  • listenaddr: host + port Honk will hear on. If operating Honk on the identical system as Nginx make it one thing like 127.0.0.1:31337 so Honk itself is simply accessible regionally. I used my VPS’ Tailscale IP handle.
  • servername: the FQDN you configured within the earlier part.

If you mess up, simply take away the SQLite databases Honk simply made and begin over.

Feel free to get all fancy with no matter system service runner you want, however I simply run Honk from a customized utility listing with:

$ nohup ./honk &

You miss the nohup and &, or tail -f nohup.out, if you wish to see the log as you configure Nginx within the subsequent part.

Configure Nginx

Remember that this bit assumes you’ve put in Nginx and set it up with a certbot TLS certificates. See above for hyperlinks to assets that will help you try this.

Now you could inform Nginx the place to serve up your honk occasion. Modify your base config to look one thing like this:

server {

  server_name honk.instance.com;

  location / {
    proxy_pass http://127.0.0.1:31337;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme; 
  }

  hear 443 ssl; # managed by Certbot

  ssl_certificate /and so forth/letsencrypt/dwell/honk.instance.com/fullchain.pem; # managed by Certbot
  ssl_certificate_key /and so forth/letsencrypt/dwell/honk.instance.com/privkey.pem; # managed by Certbot
  embody /and so forth/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  ssl_dhparam /and so forth/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {

  if ($host = honk.instance.com) {
    return 301 https://$host$request_uri;
  } # managed by Certbot

  hear 80;

  server_name honk.instance.com;

  return 404; # managed by Certbot

}

Replace the proxy_pass, honk.instance.com, and 127.0.0.1:31337 values along with your particular config.

Restart Nginx and go to honk.instance.com. If you don’t see the Honk essential web page, test the Nginx logs and the Honk logs and provides it a go once more.

Go Honkin’ Crazy

The Honk docs are helpful and fairly enjoyable reads.

  • The user manual needs to be required studying so, on the very least, you possibly can grok the honking terminology.
  • The server manual reveals you some choices you should utilize when beginning Honk, explains tips on how to customise Honk’s (it helps some enjoyable customizations), explains person administration, and a few further care and feeding suggestions. Read this totally.
  • The composition manual is a must-read because it reveals off all of the publish composition options.
  • The filtering and censorship system manual will enable you cope with any abuse.
  • The ActivityPub manual explains what Honk does and doesn’t assist in that protocol.
  • The API manual has all the knowledge you could use your Honk occasion through some programming language or simply curl.

Stuff To Try!

  • Follow of us on different servers! Hit me up at @[email protected] or @[email protected] if you wish to take a look at following out (and get a reply).
  • Customize your website CSS! Make it yours. The manuals present all the knowledge you could do that.
  • Add customized emoji and different parts (once more, the manuals are nice).
  • Write an API wrapper package deal so you should utilize your occasion programmatically (it is a good option to make an ActivityPub bot).
  • Look on the toys/ subdirectory. It has some superb instance packages you possibly can riff from (or simply use):
    • autobonker.go – repeats talked about posts
    • gettoken.go – obtains an authorization token
    • saytheday.go – posts a brand new honk that’s a date primarily based look and say sequence
    • sprayandpray.go – ship an exercise with no error checking and hope it really works
    • youvegothonks.go – polls for brand spanking new messages
  • Import your toots or Twitter archive
  • Start a Honk occasion for one of many communities you’re in. Honk actually can not assist a big neighborhood, however small golf equipment can use Honk vs cope with a full-on Mastodon occasion.
  • Poke across the SQLite databases Honk makes use of.
  • Help another person setup a Honk occasion
  • Customize the Honk codebase and exhibit your additions

Get Familiar With The Protocols

WebFinger (talked about yesterday) is the on-ramp to poking at issues, and I favor enjoying with situations I personal vs annoy of us making an attempt to run “actual” Mastodon servers. Honk allows you to play with out being a foul netizen.

$ webfinger acct:[email protected]

drops the next to the terminal:

{
  "aliases": [
    "https://honk.hrbrmstr.de/u/bob"
  ],
  "hyperlinks": [
    {
      "href": "https://honk.hrbrmstr.de/u/bob",
      "rel": "self",
      "type": "application/activity+json"
    }
  ],
  "topic": "acct:[email protected]"
}

Visit the aliases in a personal browser session (so no cookies/and so forth are used and also you see what the world sees) or simply curl it from the terminal.

Explore hyperlinks:

$ curl --header "Accept: utility/exercise+json" https://honk.hrbrmstr.de/u/bob

drops the next to the terminal (see what occurs w/o that customized Accept header, too):

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "followers": "https://honk.hrbrmstr.de/u/bob/followers",
  "following": "https://honk.hrbrmstr.de/u/bob/following",
  "icon": {
    "mediaType": "picture/png",
    "sort": "Image",
    "url": "https://honk.hrbrmstr.de/a?a=httpspercent3Apercent2Fpercent2Fhonk.hrbrmstr.depercent2Fupercent2Fbob&hex=1"
  },
  "id": "https://honk.hrbrmstr.de/u/bob",
  "inbox": "https://honk.hrbrmstr.de/u/bob/inbox",
  "title": "bob",
  "outbox": "https://honk.hrbrmstr.de/u/bob/outbox",
  "preferredUsername": "bob",
  "publicKey": {
    "id": "https://honk.hrbrmstr.de/u/bob#key",
    "proprietor": "https://honk.hrbrmstr.de/u/bob",
    "publicKeyPem": "CLIPPED B/C TOO BIG FOR SUBSTACK"
  },
  "abstract": "BIO CLIPPED B/C TOO BIG FOR SUBSTACK",
  "tag": [
    {
      "href": "https://honk.hrbrmstr.de/o/rstats",
      "name": "#rstats",
      "type": "Hashtag"
    },
    {
      "href": "https://honk.hrbrmstr.de/o/blm",
      "name": "#blm",
      "type": "Hashtag"
    }
  ],
  "sort": "Person",
  "url": "https://honk.hrbrmstr.de/u/bob"
}

Try all these endpoints and see what they drop (be at liberty to hit my server)

FIN

Honk is an effective way to discover the varied parts of the Fediverse and I encourage of us to make use of it to get extra acquainted/snug with this tech. Drop feedback in the event you run into any points or have q’s (be at liberty to honk/toot q’s as properly). ☮

*** This is a Security Bloggers Network syndicated weblog from rud.is authored by hrbrmstr. Read the unique publish at: https://rud.is/b/2022/11/11/honk-if-you-like-the-fediverse/

https://information.google.com/__i/rss/rd/articles/CBMiRWh0dHBzOi8vc2VjdXJpdHlib3VsZXZhcmQuY29tLzIwMjIvMTEvaG9uay1pZi15b3UtbGlrZS10aGUtZmVkaXZlcnNlL9IBSWh0dHBzOi8vc2VjdXJpdHlib3VsZXZhcmQuY29tLzIwMjIvMTEvaG9uay1pZi15b3UtbGlrZS10aGUtZmVkaXZlcnNlL2FtcC8?oc=5

Related Posts