Skip to content

Latest commit

 

History

History
113 lines (78 loc) · 2.95 KB

File metadata and controls

113 lines (78 loc) · 2.95 KB

Getting the source

$ git clone https://github.com/go-ap/fedbox
$ cd fedbox

Compiling

$ make all

Compiling for a specific storage backend:

$ make STORAGE=sqlite all

Compiling for the production environment:

$ make ENV=prod all

Editing the configuration

$ cp .env.dist .env
$ $EDITOR .env

Bootstrapping

This step ensures that the storage method we're using gets initialized.

$ ./bin/fedbox storage bootstrap

For a more advanced example, the bootstrap.sh script has a more elaborate use case to automate bootstrapping a project together with adding an Actor and an OAuth2 client.

Automatic bootstrapping at startup time

FedBOX also supports loading magic files for the root actor's password and private key.

If you place a {root-actor-iri}.pw and {root-actor-iri}.key at the root of your storage path FedBOX loads them and uses them at startup time.

This only works for filesystem based storage backends.

The pw file is a file containing the password in plain text. The key file needs to be a PEM encoded private key.

These files get removed after a fist successful start.

The logs will contain output similar to:

TRC Found private key typ=RSA valid=true
TRC Found valid password file pw=pa****rd

Authorization

FedBOX is strictly an ActivityPub server, so despite the fact that it advertises OAuth2 authorization endpoints for its actors, it does not provide them.

In order to make use of that functionality and be able to go through an authorization flow, you need to have running the authorization microservice alongside it.

It should be able to run using the same configuration .env file as FedBOX.

This adds the additional requirement that the requests done to the OAuth2 authorization endpoints are proxied to the correct service.

Here's an example for caddy:

# actors oauth endpoints
handle /actors/*/oauth/* {
	reverse_proxy http://authorize-service:1234 {
		transport http
	}
}
# root service oauth endpoints
handle /oauth/* {
	reverse_proxy http://authorize-service:1234 {
		transport http
	}
}

WebFinger actor discovery

Similarly to how OAuth2 is handled by a different service that uses the same storage backend as FedBOX, for providing web-finger we have a different microservice for .well-known end-points.

It can also be run with the same configuration .env file as FedBOX.

Similarly to above, it needs additional request proxying setup:

handle /.well-known/* {
	reverse_proxy http://well-known-service:4555 {
		transport http
	}
}

Containers

See the containers document for details about how to build podman/docker images or use the existing ones.