A social networking server anyone can self-host
Go to file
Natty 9f62c72f29
Switch towards recursive ascent
2024-12-08 00:05:49 +01:00
.cargo Undo an accidental commit of the linker setting 2023-11-03 19:56:29 +01:00
.dev Implemented host-meta and some overdue fixes 2024-03-31 05:10:48 +02:00
.woodpecker Fixed CI workflow 2024-01-03 20:58:28 +01:00
config Implemented AP fetching via RPC 2024-11-15 20:39:13 +01:00
core Expanded accepted JSON-LD content types 2024-04-07 04:31:20 +02:00
doc Added Nova :3 2024-12-03 02:46:44 +01:00
ext_activity_streams Merge branch 'activity-pub' into development 2024-04-17 13:52:14 +02:00
ext_federation Offload some blocking tasks to worker threads 2024-11-25 22:48:27 +01:00
ext_host_meta Implemented WebFinger flow and fixed incoming WebFinger 2024-04-01 01:34:27 +02:00
ext_model Code cleanup 2024-11-12 22:28:55 +01:00
ext_nodeinfo Fixed a type system oopsie in NodeInfo 2024-04-15 04:56:44 +02:00
ext_webfinger Implemented WebFinger flow and fixed incoming WebFinger 2024-04-01 01:34:27 +02:00
fe_calckey Frontend: Fixed prepending items when fresh and full 2024-11-25 19:39:05 +01:00
magnetar_common Fixed config and packet buffer size limits 2024-11-15 22:36:32 +01:00
magnetar_mmm_parser Switch towards recursive ascent 2024-12-08 00:05:49 +01:00
magnetar_runtime Implemented rudimentary RPC 2024-11-12 22:37:18 +01:00
magnetar_sdk Code cleanup 2024-11-12 22:22:32 +01:00
src Offload some blocking tasks to worker threads 2024-11-25 22:48:27 +01:00
.dockerignore Experimental Calckey frontend serving 2023-07-07 21:22:30 +02:00
.gitignore NodeInfo serde, basic config support, modularization 2023-02-26 03:31:39 +01:00
.noai Disable AI IDE features 2024-01-15 01:40:40 +01:00
Cargo.lock Switch towards recursive ascent 2024-12-08 00:05:49 +01:00
Cargo.toml Report proper RPC errors 2024-11-17 03:56:46 +01:00
Dockerfile Fixed config and packet buffer size limits 2024-11-15 22:36:32 +01:00
LICENSE Added an AGPL LICENSE 2023-02-14 02:01:52 +01:00
README.md Added Nova :3 2024-12-03 02:46:44 +01:00

README.md

magnetar

A social networking server anyone can self-host

Nova, the foxgirl mascot of Magnetar, themed purple, orange, and blue

This project is in early development.

Quick start

  1. Create a Postgres database
  2. Create a Redis instance
  3. Configure the required options in config/default.toml
  4. Build Magnetar: cargo build --release --workspace --bins
  5. Build the Magnetar Calckey frontend: cd fe_calckey/frontend && pnpm install && pnpm run build
  6. Run Magnetar: ./target/release/magnetar
  7. Build and run a modified version of Calckey, pointed to the same database and Redis
  8. Start up the Magnetar frontend: ./target/release/magnetar_calckey_fe
  9. Set up a reverse proxy based on .dev/Caddyfile

Read further for additional information.

What's inside

Magnetar builds to two primary binaries:

  • magnetar -- The backend
  • magnetar_calckey_fe -- A web server hosting a self-contained frontend

The fe_calckey/frontend directory contains the Calckey-based web frontend.

Additional dependencies

Magnetar depends on a Postgres database, Redis instance, as well as a modified Calckey backend running in tandem.

Building

Magnetar can be built both as standalone binaries or OCI containers (Podman, Docker, ...).

Native

Building the Magnetar backend requires:

  • latest stable Rust toolchain

Building the included Magnetar/Calckey frontend requires:

  • latest stable Rust toolchain
  • Node.js and npm

Steps

  1. Build both the frontend and the backend binaries:
    cargo build --release --workspace --bins
    
  2. Switch to the frontend directory:
    cd fe_calckey/frontend
    
  3. Install the frontend dependencies:
    pnpm install
    
  4. Build the frontend
    pnpm run build
    

Container build

Magnetar can be built to a single monolithic OCI image using the provided Dockerfile, containing the Magnetar binaries.

podman build -t magnetar .
# or
docker build -t magnetar .

Running

Follow the steps from the "building" chapter.

Native setup

Debug builds can be run using cargo run --package magnetar --bin magnetar and run --package magnetar_calckey_fe --bin magnetar_calckey_fe.

Monolithic container image

Choose between the backend and frontend using the --entrypoint /magnetar/magnetar and --entrypoint /magnetar/magnetar_calckey_fe respectively.

Mount the directory in /magnetar/config to pass in configuration from the host machine. Alternatively, see the config/default.toml file and pass in corresponding environment variables.

Connecting all components

In order to connect all components of magnetar, a router/reverse proxy is necessary. See .dev/Caddyfile for a template configuration.