equinox

module
v0.0.0-...-4bafeee Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: AGPL-3.0

README

⚠️ Warning:

Strafe Equinox (Backend) and all other projects related to this such as web.strafe.chat, Nebula (FileSystem), Stargate, etc. are still under heavy development. We reccommend that you not try to use it for personal use until development has progressed more and bugs are less likely to happen.

Equinox

Equinox is the code name for our main backend service made using Golang and Fiber.

⚠️ Equinox is currently being rewritten from the previous AI slop.

Database migrations

Schema changes live in migrations/*.cql and are applied, in file order, by the migrate command. It records what it ran in a schema_migrations table so it is safe to run repeatedly. A keyspace that already has tables but no schema_migrations (one migrated by hand with cqlsh) is refused: some files are destructive (019 drops and recreates device_keys), so replaying them would wipe data. Adopt such a keyspace once with -adopt, which records every current file as applied without executing anything.

go run ./cmd/migrate -dry-run          # list pending migrations
go run ./cmd/migrate                   # apply them to SCYLLA_KEYSPACE from .env
go run ./cmd/migrate -adopt            # hand-migrated keyspace: record files as applied, once
go run ./cmd/migrate -create-keyspace  # also create the keyspace on a fresh cluster
ENV_FILE=.env.other go run ./cmd/migrate

The Docker deployment in deploy/ runs the same command before starting the API.

Directories

Path Synopsis
cmd
api command
migrate command
Command migrate applies the CQL files in ./migrations to a ScyllaDB keyspace, in file name order, and records what it applied in a schema_migrations table so re-running it only executes new files.
Command migrate applies the CQL files in ./migrations to a ScyllaDB keyspace, in file name order, and records what it applied in a schema_migrations table so re-running it only executes new files.
pushgateway command
stargate command
internal
app
captcha
Package captcha verifies a client-supplied challenge answer at registration, so an instance that is open to the public isn't trivially farmed for accounts.
Package captcha verifies a client-supplied challenge answer at registration, so an instance that is open to the public isn't trivially farmed for accounts.
db
federation
Package federation lets independent StrafeChat instances talk to each other.
Package federation lets independent StrafeChat instances talk to each other.
id
mail
Package mail sends the few transactional emails the API has: the verification link a new account gets and the password-reset link anyone can ask for.
Package mail sends the few transactional emails the API has: the verification link a new account gets and the password-reset link anyone can ask for.
modules/applications
Package applications is the developer platform: OAuth2 client applications, the bot account each may own, and the tokens both use.
Package applications is the developer platform: OAuth2 client applications, the bot account each may own, and the tokens both use.
modules/instance
Package instance owns the things that belong to a StrafeChat instance as a whole rather than to any space: who administers it, and the invite codes that admit new accounts when registration is closed.
Package instance owns the things that belong to a StrafeChat instance as a whole rather than to any space: who administers it, and the invite codes that admit new accounts when registration is closed.
modules/oauth
Package oauth is the OAuth2 authorization server: the authorize (consent) and token endpoints of the authorization-code grant, plus refresh and revocation, and the `bot` scope that installs an application's bot into a space.
Package oauth is the OAuth2 authorization server: the authorize (consent) and token endpoints of the authorization-code grant, plus refresh and revocation, and the `bot` scope that installs an application's bot into a space.
modules/permissions
Package permissions defines space/room permission bitmasks (Discord-style OR combine).
Package permissions defines space/room permission bitmasks (Discord-style OR combine).
modules/push
Package push delivers notifications to signed-in devices while the app is closed: new messages, mentions, incoming calls, and "read elsewhere" so a phone can clear what it showed.
Package push delivers notifications to signed-in devices while the app is closed: new messages, mentions, incoming calls, and "read elsewhere" so a phone can clear what it showed.
modules/push/pushdir
Package pushdir implements push.Directory over the real repositories.
Package pushdir implements push.Directory over the real repositories.
modules/rooms
Package rooms implements polymorphic rooms: PMs, Space rooms, threads.
Package rooms implements polymorphic rooms: PMs, Space rooms, threads.
modules/threads
Package threads is Discord's thread model adapted to Strafe: a thread is a room of type rooms.TypeThread inside a space text channel, started from a message (then it shares the message's id) or on its own, public or private, with an explicit member list, an archive state that times out on its own, and a lock.
Package threads is Discord's thread model adapted to Strafe: a thread is a room of type rooms.TypeThread inside a space text channel, started from a message (then it shares the message's id) or on its own, public or private, with an explicit member list, an archive state that times out on its own, and a lock.
modules/unfurl
Package unfurl fetches link-preview metadata (Open Graph / Twitter card / <meta>) for a URL so the client can render a preview card.
Package unfurl fetches link-preview metadata (Open Graph / Twitter card / <meta>) for a URL so the client can render a preview card.
modules/voice
Package voice runs voice and video calls on top of LiveKit: it hands out room-scoped tokens, keeps the per-room voice states (who is connected, muted, deafened, sharing video) that clients render, enforces the space's voice permissions and moderator actions, and rings people for PM / group PM calls.
Package voice runs voice and video calls on top of LiveKit: it hands out room-scoped tokens, keeps the per-room voice states (who is connected, muted, deafened, sharing video) that clients render, enforces the space's voice permissions and moderator actions, and rings people for PM / group PM calls.
pushgateway
Package pushgateway is the Apple/Google relay for Strafe's push notifications: a small stateless HTTP service that speaks standard Web Push (RFC 8030 + RFC 8291 bodies + RFC 8292 VAPID) on one side and FCM HTTP v1 / APNs on the other.
Package pushgateway is the Apple/Google relay for Strafe's push notifications: a small stateless HTTP service that speaks standard Web Push (RFC 8030 + RFC 8291 bodies + RFC 8292 VAPID) on one side and FCM HTTP v1 / APNs on the other.
safego
Package safego runs background goroutines that cannot take the process down with them.
Package safego runs background goroutines that cannot take the process down with them.
safehttp
Package safehttp is the outbound-request guard for every place the server fetches a URL that someone else chose - a link a user pasted (unfurl), a push endpoint a device registered (push).
Package safehttp is the outbound-request guard for every place the server fetches a URL that someone else chose - a link a user pasted (unfurl), a push endpoint a device registered (push).
stargate
Package stargate provides the WebSocket gateway for real-time messaging.
Package stargate provides the WebSocket gateway for real-time messaging.
weborigin
Package weborigin knows which request origins belong to Strafe's own clients.
Package weborigin knows which request origins belong to Strafe's own clients.

Jump to

Keyboard shortcuts

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