Giter Club home page Giter Club logo

cubiti's Introduction

cubiti

cubiti is a toy Fediverse server written in Node.js
It speaks to Mastodon and other federated network services supporting ActivityPub

As a front-end, it provides a partial implementation of the Mastodon API so you can connect with Mastodon client apps such as Pinafore, MetaText, Mammoth and more.

cubiti serves two APIs, Mastodon in the front and ActivityPub in the back.

Developing cubiti was an exercise in learning about Fediverse APIs and protocols. As a service, it is insecure, buggy and incomplete. However, it supports enough to follow, post, like, reblog and view conversations including image media, blurhash and content warnings.

Note, the admin command interface is more mature than the Mastodon API support.

Tech stack

  • sqlite3 (persistent storage)
  • redis (pubsub for realtime timeline updates)
  • Node.js (everything else)

Initial setup

docker-compose build
docker-compose up

Create a user account via the admin command interface

docker-compose run --rm cubiti-server

At the prompt, type:

user add cubiti mypassword

It will respond by showing part of the created database record:

{
	userid: 1,
	username: 'cubiti',
	pubkey: '-----BEGIN PUBLIC KEY-----\n' +
	...
}

Browse to https://localhost/ (and accept the security warning about the self-signed certificate mismatch). Click the invitation to login via pinafore.social

You should see an empty timeline. Some interaction is possible, but you are talking to yourself. As the @cubiti users does not follow anyone, posted messages will be dropped.

Setup a real server

  • Buy a domain, configure DNS, create a valid key pair
  • Copy the cert over nginx-alpine-ssl/nginx-selfsigned.crt and the key over nginx-alpine-ssl/nginx-selfsigned.key
  • Edit data/config.json and set domain to your real domain

Run the server

docker-compose down
docker-compose build
docker-compose up

Test that your @cubiti account is discoverable with Webfinger

Browse to https://domain, follow the link to Pinafore, add domain and login. You should now see an empty timeline.

Well done! You're on the fediverse

Next

The search Mastodon API is not yet implemented, so you have nobody to follow and no posts to view yet.

Either, use another fediverse account to start interacting with cubiti@domain, or use the admin interface

To get a prompt, run:

docker-compose run --rm cubiti-server

Most command require a userid, that's the user the admin is executing the command for. If you only have the single user we created above, use 1

At the prompt, you can follow a user with:

action follow 1 https://mastodon.me.uk/users/tobyjaffey

To send a message to all of your followers:

action sendnote 1 "Hello world"

To unfollow:

action unfollow 1 https://mastodon.me.uk/users/tobyjaffey

To like a post:

action like 1 https://foo.social/users/bar/statuses/109548408290883351 https://foo.social/users/bar

To unlike a post

action unlike 1 https://foo.social/users/bar/statuses/109548408290883351 https://foo.social/users/bar

Next next

Now that you have some followers and some data, you can do the same actions (and more) through the Mastodon API (via Pinafore). Some things work, some do not.

Contact

@[email protected]

https://mastodon.me.uk/users/tobyjaffey

cubiti's People

Contributors

ringtailsoftware avatar

Stargazers

Scarlet Tobar avatar Ricardo avatar Derek avatar Jeff Sikes avatar Andy Davies avatar Shaun Harrison avatar Wes Souza avatar S.Y. Lee avatar Dick Hardt avatar Hans Gerwitz avatar Paul Bausch avatar Stefan Bohacek avatar Ben Brown avatar Lukas Germerott avatar Andy Piper avatar Tony Edwards avatar Clifford Adams avatar Kin Lane avatar

Watchers

 avatar  avatar

Forkers

tuxracer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.