XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

chore: remove networking config options when running under docker (#3032)

This should make it hopefully ever so slightly less confusing. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3032 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

f3a6f602
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

5 个文件 +15 -3
Modified README.md +1 -0
@@ -14,6 +14,7 @@ SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [confi
14 14
15 15 - `skipTutorial` affects only newly created accounts, so you may wish to change it before logging in for the first time.
16 16 - `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
17 - `bindAddress`, `httpPort`, `httpsPort` are related to how SpaceNinjaServer is reached on the network. Under Docker, these options are unchangable; modify your `docker-compose.yml`, instead.
17 18 - `ircExecutable` can be provided with a relative path to an EXE which will be ran as a child process of SpaceNinjaServer.
18 19 - `ircAddress`, `hubAddress`, and `nrsAddress` can be provided if these secondary servers are on a different machine.
19 20 - `worldState.eidolonOverride` can be set to `day` or `night` to lock the time to day/fass and night/vome on Plains of Eidolon/Cambion Drift.
Modified docker-compose.yml +2 -1
@@ -7,12 +7,13 @@ services:
7 7 - ./docker-data/static-data:/app/static/data
8 8 - ./docker-data/logs:/app/logs
9 9 ports:
10 # The lefthand value determines the port you actually connect to. Within the container, SpaceNinjaServer will always use 80 and 443 (righthand values).
10 11 - 80:80
11 12 - 443:443
12 13
13 14 # Normally, the image is fetched from Docker Hub, but you can use the local Dockerfile by removing "image" above and adding this:
14 15 #build: .
15 # Works best when using `docker-compose up --force-recreate --build`.
16 # Works best when using `docker compose up --force-recreate --build`.
16 17
17 18 depends_on:
18 19 - mongodb
Modified docker-entrypoint.sh +2 -2
@@ -2,7 +2,7 @@
2 2 set -e
3 3
4 4 if [ ! -f conf/config.json ]; then
5 jq --arg value "mongodb://mongodb:27017/openWF" '.mongodbUrl = $value' /app/config-vanilla.json > /app/conf/config.json
5 jq --arg value "mongodb://mongodb:27017/openWF" '.mongodbUrl = $value | del(.bindAddress) | del(.httpPort) | del(.httpsPort)' /app/config-vanilla.json > /app/conf/config.json
6 6 fi
7 7
8 exec npm run raw -- --configPath conf/config.json
8 exec npm run raw -- --configPath conf/config.json --docker
Modified src/helpers/commandLineArguments.ts +5 -0
@@ -2,6 +2,7 @@ interface IArguments {
2 2 configPath?: string;
3 3 dev?: boolean;
4 4 secret?: string;
5 docker?: boolean;
5 6 }
6 7
7 8 export const args: IArguments = {};
@@ -19,5 +20,9 @@ for (let i = 2; i < process.argv.length; ) {
19 20 case "--secret":
20 21 args.secret = process.argv[i++];
21 22 break;
23
24 case "--docker":
25 args.docker = true;
26 break;
22 27 }
23 28 }
Modified src/services/configService.ts +5 -0
@@ -160,6 +160,11 @@ export const configRemovedOptionsKeys = [
160 160 "relicRewardItemCountMultiplier",
161 161 "nightwaveStandingMultiplier"
162 162 ];
163 if (args.docker) {
164 configRemovedOptionsKeys.push("bindAddress");
165 configRemovedOptionsKeys.push("httpPort");
166 configRemovedOptionsKeys.push("httpsPort");
167 }
163 168
164 169 export const configPath = path.join(repoDir, args.configPath ?? "config.json");
165 170