pub

command module
v0.0.0-...-54d5358 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2024 License: BSD-3-Clause Imports: 32 Imported by: 0

README

pub, a tiny ActivityPub to Mastodon bridge

Go Reference Go Report Card

What is pub?

pub is an ActivityPub host intended for a single actor. To interact with ActivityPub, pub implements the Mastodon[^tm] api for use with various apps.

pub is not intended to host an ActivityPub community, rather it is aimed at enabling someone who owns their own domain, and thus controls their identity, to participate in the fediverse.

[^tm]: Mastodon is a trademark of Mastodon gGmbh. pub is not affiliated with Mastodon gGmbH. pub is not a Mastodon server.

What doesn't it do?

pub doesn't have much of a web interface beyond what ActivityPub requires, you're expected to interact with it via a Mastodon compatible app.

Getting started

Warning: pub is still in development, if it breaks, you can keep the pieces.

Pre-requisites
Installation (MySQL/MariaDB)

Create a database and user for pub:

CREATE DATABASE pub;
CREATE USER 'pub'@'localhost' IDENTIFIED BY 'pub';
GRANT ALL PRIVILEGES ON pub.* TO 'pub'@'localhost';

Install pub:

For Mysql/MariaDB
go install -tags mysql github.com/davecheney/pub@latest
For Sqlite
go install -tags sqlite github.com/davecheney/pub@latest

Create/migrate the database:

pub --dsn 'pub:pub@/pub' auto-migrate
Setup

Create an instance for pub:

pub --dsn 'pub:pub@/pub' create-instance --domain domain.com --title "Something cool" --description "Something witty" --admin-email admin@domain.com

This will create an instance, and an admin account for that instance.

Create your first user

pub --dsn 'pub:pub@/pub' create-account --email you@domain.com --name you --domain domain.com --password sssh

This will create an account for you to act as acct:you@domain.com

Running

Start pub:

pub --log-http --dsn 'pub:pub@/pub' serve 
Getting online

pub doesn't have a web interface, so you'll need to use a Mastodon app to interact with it. You'll need to put pub behind a reverse proxy, and configure the reverse proxy to forward requests to pub. TLS is also required, so you'll need to configure TLS for your reverse proxy, probably using Let's Encrypt.

See the examples directory for sample configurations for nginx.

Acknowledgements

pub would not be possible without these amazing projects:

Contribution policy

pub is currently open to code contributions for bug fixes only. This may change in the future, but at the moment please do not send pull requests with new features.

If you have a feature request, or a bug report, please open an issue. If you're really adventurous, you can contact me via @dfc@cheney.net.

Thank you in advance for your understanding.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
algorithms
package algorithms provides generified map/filter/reduce functions.
package algorithms provides generified map/filter/reduce functions.
crypto
package crypto provides a simple interface to common cryptographic primitives.
package crypto provides a simple interface to common cryptographic primitives.
httpsig
Package httpsig implements the HTTP Signature scheme as defined in draft-cavage-http-signatures-10.
Package httpsig implements the HTTP Signature scheme as defined in draft-cavage-http-signatures-10.
httpx
Package httpx is a convenience wrapper around the http.ServeMux type that allows us to return errors from our handlers.
Package httpx is a convenience wrapper around the http.ServeMux type that allows us to return errors from our handlers.
snowflake
Package snowflake provides a Mastodon compatible Snowflake ID generator.
Package snowflake provides a Mastodon compatible Snowflake ID generator.
to
package to contains functions for converting between types.
package to contains functions for converting between types.
Package mastodon implements a Mastodon API service.
Package mastodon implements a Mastodon API service.
package media is a read through cache for media files.
package media is a read through cache for media files.
package models contains the database models for the m.
package models contains the database models for the m.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL