From 4ee4e69e049910609e2b18279e15d42bc473e65e Mon Sep 17 00:00:00 2001 From: brodokk Date: Wed, 17 Nov 2021 00:27:31 +0100 Subject: Fix neosvr config file installation process --- Dockerfile | 2 ++ config.json_base | 42 ++++++++++++++++++++++++++++++++++++++++++ config/Config.json | 42 ------------------------------------------ docker-compose.yml | 1 - entrypoint.sh | 10 ++++++++-- 5 files changed, 52 insertions(+), 45 deletions(-) create mode 100644 config.json_base delete mode 100644 config/Config.json diff --git a/Dockerfile b/Dockerfile index 3925c4d..b5ab440 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,8 @@ ENV LANGUAGE 'en_US:en' RUN ln -s /usr/games/steamcmd /usr/bin/steamcmd +COPY config.json_base /config.json_base + ADD entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/config.json_base b/config.json_base new file mode 100644 index 0000000..3b47166 --- /dev/null +++ b/config.json_base @@ -0,0 +1,42 @@ +{ + "comment": null, + "tickRate": 60.0, + "maxConcurrentAssetTransfers": 4, + "usernameOverride": "Headless docker", + "loginCredential": null, + "loginPassword": null, + "startWorlds": [ + { + "isEnabled": true, + "sessionName": "Testing", + "customSessionId": null, + "description": "Headless with docker", + "maxUsers": 16, + "accessLevel": "Anyone", + "hideFromPublicListing": null, + "tags": [ + "hosted" + ], + "mobileFriendly": false, + "saveAsOwner": "LocalMachine", + "loadWorldPresetName": "GridSpace", + "forcePort": null, + "keepOriginalRoles": false, + "defaultUserRoles": null, + "autoInviteUsernames": null, + "autoInviteMessage": null, + "autoRecover": true, + "idleRestartInterval": -1.0, + "forcedRestartInterval": -1.0, + "saveOnExit": true, + "autosaveInterval": 240.0, + "awayKickMinutes": -1.0, + "autoSleep": true + } + ], + "dataFolder": null, + "cacheFolder": null, + "allowedUrlHosts": null, + "autoSpawnItems": null, + "metamovieRoles": null +} diff --git a/config/Config.json b/config/Config.json deleted file mode 100644 index 3b47166..0000000 --- a/config/Config.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "comment": null, - "tickRate": 60.0, - "maxConcurrentAssetTransfers": 4, - "usernameOverride": "Headless docker", - "loginCredential": null, - "loginPassword": null, - "startWorlds": [ - { - "isEnabled": true, - "sessionName": "Testing", - "customSessionId": null, - "description": "Headless with docker", - "maxUsers": 16, - "accessLevel": "Anyone", - "hideFromPublicListing": null, - "tags": [ - "hosted" - ], - "mobileFriendly": false, - "saveAsOwner": "LocalMachine", - "loadWorldPresetName": "GridSpace", - "forcePort": null, - "keepOriginalRoles": false, - "defaultUserRoles": null, - "autoInviteUsernames": null, - "autoInviteMessage": null, - "autoRecover": true, - "idleRestartInterval": -1.0, - "forcedRestartInterval": -1.0, - "saveOnExit": true, - "autosaveInterval": 240.0, - "awayKickMinutes": -1.0, - "autoSleep": true - } - ], - "dataFolder": null, - "cacheFolder": null, - "allowedUrlHosts": null, - "autoSpawnItems": null, - "metamovieRoles": null -} diff --git a/docker-compose.yml b/docker-compose.yml index 804cee6..35de7e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,5 @@ services: volumes: - ./steam:/steam - ./logs:/logs - - ./config:/steam/740250/Config stdin_open: true tty: true diff --git a/entrypoint.sh b/entrypoint.sh index e4c1b80..2c02ea7 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,10 +22,16 @@ if [ -n "${INSTALL_APPS}" ]; then IFS=$OLD_IFS fi -echo "setting up neos config from env" - +ORIGIN_CONFIG_PATH="config.json_base" CONFIG_PATH='/steam/740250/Config/Config.json' +if [[ -f "$ORIGIN_CONFIG_PATH" ]]; then + echo "Neos config file not found, setting it up..." + mv $ORIGIN_CONFIG_PATH $CONFIG_PATH +fi + +echo "Setting up neos config from env" + cat $CONFIG_PATH | jq --arg u "${NEOSVR_USER}" '.loginCredential = $u' | jq --arg p "${NEOSVR_PWD}" '.loginPassword = $p' | sponge $CONFIG_PATH arguments=$@ -- cgit v1.2.1