Installing Stardust

Stardust is simple to setup, even for someone with zero IT knowledge.

Before you get started, make sure that you have the following already set up:

  • Node.js 18 or later installed, plus node-gyp and pnpm. Download Node.js from Nodesource and node-gyp and pnpm by running the following:
# or however else you install make and gcc
sudo apt install build-essential gcc
npm i -g pnpm node-gyp
  • Docker setup. If you're using a Unix-based system, you can follow the instructions here.
  • A PostgreSQL database. You can use Docker to spin one up by running
docker run --name stardust-postgres -p 5432:5432 -e POSTGRES_PASSWORD=replaceme -d postgres

Setup

Create a new docker network

docker network create stardust

Block all container-to-container traffic (you need jq)

export DOCKER_NETWORK_SUBNET=$(docker network inspect stardust | jq -r 'map(to_entries) | map ([.[6].value.Config[0].Subnet ]) | .[] | @tsv')
iptables -I FORWARD -s $DOCKER_NETWORK_SUBNET -d $DOCKER_NETWORK_SUBNET -j DROP

Clone the Stardust repository and install the dependencies.

git clone https://github.com/spaceness/stardust && cd stardust
pnpm install

Make a new file in .config/config.json and first, fill it with the following:

{
  "$schema": "config-schema.json",
}

and then the respective fields.

General

PropTypeDefault
databaseUrl
string
-
metadataUrl
string
-
docker
DockerConfig
-
auth
AuthConfig
-
session
SessionConfig
-

Session (SessionConfig)

PropTypeDefault
keepaliveDuration
number
1440

Docker (DockerConfig)

PropTypeDefault
type
"http" | "socket"
"socket"
socket
string
"/var/run/docker.sock"
host
string
-
port
number
-
network
string
-

Auth (AuthConfig)

PropTypeDefault
secret
string
-
turnstile
TurnstileConfig
-
credentials
{ signups?: boolean | undefined; }
-
oauth
{ providers: { [key: string]: { clientId: string; clientSecret: string; issuer?: string | undefined; }; }; }
-

TurnstileConfig

PropTypeDefault
secret
string
-
siteKey
string
-
hosts
string[]
-

Setup the database

pnpm db:push
CONFIG=$(cat .config/config.json) tsx src/lib/drizzle/seed.ts

You can also pull the docker containers at the same time by adding --pull.

Build Stardust

pnpm build

Start Stardust

pnpm start

It is recommended to use a tool like pm2 or systemd to keep Stardust running in the background. Install with pnpm i -g pm2, and then run pm2 start "pnpm start" --name stardust. Stardust will now be running on port 3000.

Last updated on

On this page

Edit on GitHub