Self‐hosting - ValoSpectra/Spectra-Server GitHub Wiki
Self-Hosting ValoSpectra
This guide will assume you're using Spectra in a local environment. If you're intending on deploying Spectra to a Server, however, the process will be very similar and only differ in some URLs and individual networking setups, which are hard to cover.
Setting up your own instance of Spectra
Prerequisites
Setting up the directory structure
Create a directory in which Spectra will be running. In this directory, create a directory called keys
and a directory called config
.
It should look like this:
.
├── docker-compose.yml
├── config
│ └── config.json
└── keys
Example Docker compose file
Inside the root directory you want to use for Spectra, create a file named docker-compose.yml
with the following contents:
---
services:
server:
image: "ghcr.io/valospectra/server:latest"
ports:
- "5100:5100"
- "5101:5101"
- "5200:5200"
environment:
INSECURE: true
REQUIRE_AUTH_KEY: false
volumes:
- ./keys:/app/keys
frontend:
image: "ghcr.io/valospectra/overlay:latest"
ports:
- "3000:80"
volumes:
- ./config:/usr/share/nginx/html/assets/config/
For possible environment variables for use, see Possible Environment Variables
Configuration file
In order to configure some values for use in the Spectra-Frontend, create a file named config.json
inside the config
directory.
An example of the config here:
{
"serverEndpoint": "http://localhost:5200",
"sponsorImageUrls": ["/assets/misc/logo.webp"],
"sponsorImageRotateSpeed": 5000,
"attackerColorPrimary": "#b82e3c",
"attackerColorSecondary": "#ff4557",
"attackerColorShieldCurrency": "#ff838f",
"defenderColorPrimary": "#25ac79",
"defenderColorSecondary": "#61eab6",
"defenderColorShieldCurrency": "#61eab6"
}
Possible Environment Variables
Server
Environment Variable | Description | Possible Values | Default Value |
---|---|---|---|
INSECURE | This option determines if the Spectra-Server is going to use HTTPS with the provided SSL certificates. | true/false | false |
SERVER_KEY | The path inside the Docker container to use as the SSL key file. | /app/keys/server.key | |
SERVER_CERT | The path inside the Docker container to use as the SSL certificate file. | /app/keys/server.crt | |
REQUIRE_AUTH_KEY | If you're self-hosting your server, you might not want it to require using a Key. In this case, set this to false . |
true/false | true |
AUTH_KEY | If you're self-hosting and want it to require using a Key, set this to your desired key | any string | None |