Add new config definitions

This commit is contained in:
zkldi
2021-07-21 05:04:05 +01:00
parent ef8160deba
commit 591e8acd2c
+54 -23
View File
@@ -19,18 +19,22 @@ the main benefits for us are as follows:
```js
{
MONGO_CONNECTION_URL: "127.0.0.1:27017",
MONGO_DATABASE_NAME: "somedb",
MONGO_CONNECTION_URL: "localhost:27017",
MONGO_DATABASE_NAME: "tachidb",
LOG_LEVEL: "info",
CAPTCHA_SECRET_KEY: "google_given_secret_key",
SESSION_SECRET: "some_secret_key",
CAPTCHA_SECRET_KEY: "secret_key",
SESSION_SECRET: "other_secret_key",
FLO_API_URL: "https://flo.example.com",
EAG_API_URL: "https://eag.example.com",
ARC_API_URL: "https://arc.example.com",
ARC_AUTH_TOKEN: "another_secret_key",
CDN_ROOT: "./local-cdn",
ARC_AUTH_TOKEN: "unused",
CDN_FILE_ROOT: "../tachi-cdn",
PORT: 8080,
TYPE: "ktchi"
CLIENT_INDEX_HTML_PATH: "./index.html",
ENABLE_SERVER_HTTPS: true,
TYPE: "omni",
RUN_OWN_CDN: true,
CLIENT_DEV_SERVER: null
}
```
@@ -105,7 +109,7 @@ with the Kamaitachi version of Tachi.
We use an ARC session token in order to pull scores from `ARC`. The session token is stored here.
### CDN_ROOT
### CDN_FILE_ROOT
- Type: File Path
@@ -113,27 +117,16 @@ We use an ARC session token in order to pull scores from `ARC`. The session toke
and profile pictures. This is a folder somewhere on the
system (presumably using nginx serve-static).
### CDN_URL
- Type: URL or null (Optional).
This parameter dictates where the CDN server is. Requests that hit the CDN
will be redirected here. If null, or not present, `tachi-server` will use
filesystem calls for the files (and return them) instead of redirects.
!!! note
Nginx Serve-Static is relatively easy to set up, and provides
massive performance increases for this kind of stufff.
I highly recommend against leaving this null, as you can cause
large performance deficits.
### PORT
- Type: Port (1-65536)
What port to run the server on.
!!! note
Ports below 1024 are subject to strange UNIX rules - typically we run on 8080 and use
an nginx reverse proxy.
### TYPE
- Type: "btchi" | "ktchi" | "omni"
@@ -149,3 +142,41 @@ names.
"omni" will run the server without any route restrictions.
This is used for testing.
### CLIENT_INDEX_HTML_PATH
- Type: File Path
The location of `index.html` to serve when any non-server route is hit.
Since we use a react app for client navigation, the server does not concern itself
with routing the user around, so this is just the react-app index.html to send.
### ENABLE_SERVER_HTTPS
- Type: Boolean
Whether to use HTTPS. If this is set to true, the files `cert/key.pem` and `cert/cert.pem` will be
used as the privateKey and the certificate, respectively.
!!! note
In production, we use an Nginx reverse proxy which handles this.
A warning will be emitted if you are using HTTPS mode, as it's not generally meant to be used
at this level.
### RUN_OWN_CDN
- Type: Boolean
Whether to host the CDN using the same express process and and an `express.static()` call.
This is generally used for testing, or for simple local setups.
This uses `CDN_FILE_ROOT` to determine where the CDN's content should be.
### CLIENT_DEV_SERVER
- Type: String | NULL (Optional)
If present, and a string, this points to the webpack dev server for a react app. Having this
option set results in CORS being enabled for *that* specific URL. This is useful for local
development, but should not be used in production.