No description
- Go 97.7%
- Python 1.2%
- Nix 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
This PR was automatically created by the reposyncer script via https://git.foxden.network/FoxDen/maid Reviewed-on: #88 |
||
| .forgejo/workflows | ||
| .vscode | ||
| cmd/space_age_api | ||
| internal | ||
| util | ||
| .editorconfig | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
| register_discord_command.py | ||
| renovate.json | ||
| vendor-hash.txt | ||
| vendor-hash.txt.doc | ||
SpaceAge API
HTTP API used by the SpaceAge GMod servers, clients and website (/v2/...).
Building
go build ./cmd/space_age_api
# or
nix build
Running
space_age_api migrate # apply pending database migrations
space_age_api start # run the HTTP server (default command)
Migrations share Ecto's schema_migrations table, so databases created by the old Elixir API are picked up as-is.
Configuration
All configuration is done via environment variables:
| Variable | Default | Description |
|---|---|---|
SECRET_KEY_BASE |
(required) | HS256 secret for client auth and Discord link JWTs |
PORT |
4000 |
Port to listen on (all interfaces) |
LISTEN_ADDR |
:$PORT |
Full listen address, overrides PORT |
MYSQL_SOCKET |
/var/run/mysqld/mysqld.sock |
MySQL/MariaDB unix socket |
MYSQL_HOST |
host:port to connect via TCP instead of the unix socket |
|
MYSQL_USERNAME |
root |
Database user |
MYSQL_PASSWORD |
Database password | |
MYSQL_DATABASE |
spaceage_api |
Database name |
POOL_SIZE |
10 |
Maximum number of database connections |
DISCORD_PUBLIC_KEY |
SpaceAge application key | Hex encoded Ed25519 key used to verify Discord interactions |
AUTO_MIGRATE |
If set, apply pending migrations on start |
Discord
register_discord_command.py APP_ID BOT_TOKEN registers the /salink slash command.