|
15 | 15 | "file_denylist": [], |
16 | 16 | "startup": "/entrypoint.sh", |
17 | 17 | "config": { |
18 | | - "files": "{\r\n \"server.cfg\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"endpoint_add_tcp\": \"endpoint_add_tcp \\\"0.0.0.0:{{server.build.env.TXHOST_FXS_PORT}}\\\"\",\r\n \"endpoint_add_udp\": \"endpoint_add_udp \\\"0.0.0.0:{{server.build.env.TXHOST_FXS_PORT}}\\\"\",\r\n \"sv_hostname\": \"sv_hostname \\\"{{server.build.env.SERVER_HOSTNAME}}\\\"\",\r\n \"set sv_licenseKey\": \"set sv_licenseKey {{server.build.env.FIVEM_LICENSE}}\",\r\n \"set steam_webApiKey\": \"set steam_webApiKey {{server.build.env.STEAM_WEBAPIKEY}}\",\r\n \"sv_maxclients\": \"sv_maxclients {{server.build.env.MAX_PLAYERS}}\",\r\n \"sets sv_projectName\": \"sets sv_projectName \\\"{{server.build.env.SERVER_PNAME}}\\\"\",\r\n \"sets sv_projectDesc\": \"sets sv_projectDesc \\\"{{server.build.env.SERVER_PDESC}}\\\"\"\r\n }\r\n }\r\n}", |
| 18 | + "files": "{\n \"server.cfg\": {\n \"parser\": \"file\",\n \"find\": {\n \"endpoint_add_tcp\": \"endpoint_add_tcp \\\"0.0.0.0:{{server.build.env.TXHOST_FXS_PORT}}\\\"\",\n \"endpoint_add_udp\": \"endpoint_add_udp \\\"0.0.0.0:{{server.build.env.TXHOST_FXS_PORT}}\\\"\",\n \"sv_hostname\": \"sv_hostname \\\"{{server.build.env.SERVER_HOSTNAME}}\\\"\",\n \"set sv_licenseKey\": \"set sv_licenseKey {{server.build.env.FIVEM_LICENSE}}\",\n \"sv_maxclients\": \"sv_maxclients {{server.build.env.MAX_PLAYERS}}\",\n \"sets sv_projectName\": \"sets sv_projectName \\\"{{server.build.env.SERVER_PNAME}}\\\"\",\n \"sets sv_projectDesc\": \"sets sv_projectDesc \\\"{{server.build.env.SERVER_PDESC}}\\\"\"\n }\n }\n}", |
19 | 19 | "startup": "{\r\n \"done\": \"succeeded. Welcome!\"\r\n}", |
20 | 20 | "logs": "{}", |
21 | 21 | "stop": "^SIGTERM" |
22 | 22 | }, |
23 | 23 | "scripts": { |
24 | 24 | "installation": { |
25 | | - "script": "#!/bin/bash\n# FiveM Installation Script - NodeByte Hosting\n# Server Files: /mnt/server\napt update -y\napt install -y tar xz-utils curl git file jq unzip\n\nmkdir -p /mnt/server\ncd /mnt/server\n\nRELEASE_PAGE=$(curl -sSL https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/)\nCHANGELOGS_PAGE=$(curl -sSL https://changelogs-live.fivem.net/api/changelog/versions/linux/server)\n\nif [ ! -d \"./alpine/\" ] && [ ! -d \"./resources/\" ]; then\n echo \"Beginning installation of new FiveM server.\"\n IS_UPDATE=0\nelse\n echo \"Beginning update of existing FiveM FXServer artifact.\"\n IS_UPDATE=1\n if [ -d \"./alpine/\" ]; then\n echo \"Deleting old FXServer artifact...\"\n rm -rf ./alpine/\n echo \"Deleted old FXServer artifact files successfully.\"\n fi\nfi\n\nif [[ \"${FIVEM_VERSION}\" == \"recommended\" ]] || [[ -z \"${FIVEM_VERSION}\" ]]; then\n DOWNLOAD_LINK=$(echo \"$CHANGELOGS_PAGE\" | jq -r '.recommended_download')\nelif [[ \"${FIVEM_VERSION}\" == \"latest\" ]]; then\n DOWNLOAD_LINK=$(echo \"$CHANGELOGS_PAGE\" | jq -r '.latest_download')\nelif [[ \"${FIVEM_VERSION}\" == http* ]]; then\n DOWNLOAD_LINK=\"${FIVEM_VERSION}\"\nelse\n VERSION_PATH=$(echo \"${RELEASE_PAGE}\" | grep -oE \"build_proot_linux/master/[0-9]+-[a-f0-9]+\\/\" | grep \"${FIVEM_VERSION}\" | head -n 1)\n if [ -n \"${VERSION_PATH}\" ]; then\n DOWNLOAD_LINK=\"https://runtime.fivem.net/artifacts/fivem/${VERSION_PATH}fx.tar.xz\"\n elif [[ \"${FIVEM_VERSION}\" == *\"-\"* ]]; then\n DOWNLOAD_LINK=\"https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${FIVEM_VERSION}/fx.tar.xz\"\n else\n echo \"Could not resolve build ${FIVEM_VERSION}. Defaulting to recommended.\"\n DOWNLOAD_LINK=$(echo \"$CHANGELOGS_PAGE\" | jq -r '.recommended_download')\n fi\nfi\n\necho -e \"Downloading artifact from: ${DOWNLOAD_LINK}\"\ncurl -sSL \"${DOWNLOAD_LINK}\" -o fx.tar.xz\n\necho \"Extracting FiveM FXServer artifact files...\"\nFILETYPE=$(file -b --mime-type fx.tar.xz)\n\nif [[ \"$FILETYPE\" == *\"x-xz\"* ]] || [[ \"$FILETYPE\" == *\"octet-stream\"* ]]; then\n tar xvf fx.tar.xz\nelif [[ \"$FILETYPE\" == *\"gzip\"* ]]; then\n tar xzvf fx.tar.xz\nelif [[ \"$FILETYPE\" == *\"zip\"* ]]; then\n unzip fx.tar.xz\nelse\n echo -e \"Downloaded artifact of unknown filetype ($FILETYPE). Exiting.\"\n rm -f fx.tar.xz\n exit 2\nfi\n\nrm -f fx.tar.xz run.sh\n\nif [ \"$IS_UPDATE\" -eq 0 ]; then\n if [ -e server.cfg ]; then\n echo \"Server config file already exists. Skipping download of new one.\"\n else\n echo \"Downloading default FiveM server config...\"\n curl -sSL https://raw.githubusercontent.com/nodebytehosting/recipes/develop/games/rockstar/fivem/server.cfg >> server.cfg\n fi\n if [ \"${GIT_ENABLED}\" == \"1\" ] && [ ! -d \"/mnt/server/resources\" ]; then\n echo \"Preparing to clone resources repo from git.\"\n if [[ ${GIT_REPOURL} != *.git ]]; then GIT_REPOURL=${GIT_REPOURL}.git; fi\n if [ -n \"${GIT_USERNAME}\" ] && [ -n \"${GIT_TOKEN}\" ]; then\n GIT_REPOURL=\"https://${GIT_USERNAME}:${GIT_TOKEN}@$(echo ${GIT_REPOURL} | cut -d/ -f3-)\"\n fi\n if [ -z \"${GIT_BRANCH}\" ]; then\n git clone ${GIT_REPOURL} /mnt/server/resources\n else\n git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOURL} /mnt/server/resources\n fi\n else\n mkdir -p /mnt/server/resources\n echo \"Preparing to clone default FiveM resources.\"\n git clone https://github.com/citizenfx/cfx-server-data.git /tmp/cfx-resources\n cp -Rf /tmp/cfx-resources/resources/* resources/\n rm -rf /tmp/cfx-resources\n fi\n mkdir -p logs/\n echo \"Installation complete.\"\nelse\n echo \"Update complete.\"\nfi", |
| 25 | + "script": "#!/bin/bash\n# FiveM Installation Script - NodeByte Hosting\n# Server Files: /mnt/server\napt update -y\napt install -y tar xz-utils curl git file jq unzip\n\nmkdir -p /mnt/server\ncd /mnt/server\n\nRELEASE_PAGE=$(curl -sSL https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/)\nCHANGELOGS_PAGE=$(curl -sSL https://changelogs-live.fivem.net/api/changelog/versions/linux/server)\n\nif [ ! -d \"./alpine/\" ] && [ ! -d \"./resources/\" ]; then\n echo \"Beginning installation of new FiveM server.\"\n IS_UPDATE=0\nelse\n echo \"Beginning update of existing FiveM FXServer artifact.\"\n IS_UPDATE=1\n if [ -d \"./alpine/\" ]; then\n echo \"Deleting old FXServer artifact...\"\n rm -rf ./alpine/\n echo \"Deleted old FXServer artifact files successfully.\"\n fi\nfi\n\nif [[ \"${GTA_EDITION}\" == \"enhanced\" ]]; then\n if [[ \"${FIVEM_VERSION}\" == http* ]]; then\n DOWNLOAD_LINK=\"${FIVEM_VERSION}\"\n else\n DOWNLOAD_LINK=$(curl -sSL https://docs.fivem.net/docs/server-download/ | grep -oE 'https://cfx-downloads\\.akamaized\\.net/prod/[a-f0-9-]+/cfx-server_linux_x64\\.tar\\.xz' | head -n 1)\n fi\n if [ -z \"${DOWNLOAD_LINK}\" ]; then\n echo \"Could not find the Cfx Server download for GTA V Enhanced. Set the server version to a direct download URL.\"\n exit 1\n fi\nelif [[ \"${FIVEM_VERSION}\" == \"recommended\" ]] || [[ -z \"${FIVEM_VERSION}\" ]]; then\n DOWNLOAD_LINK=$(echo \"$CHANGELOGS_PAGE\" | jq -r '.recommended_download')\nelif [[ \"${FIVEM_VERSION}\" == \"latest\" ]]; then\n DOWNLOAD_LINK=$(echo \"$CHANGELOGS_PAGE\" | jq -r '.latest_download')\nelif [[ \"${FIVEM_VERSION}\" == http* ]]; then\n DOWNLOAD_LINK=\"${FIVEM_VERSION}\"\nelse\n VERSION_PATH=$(echo \"${RELEASE_PAGE}\" | grep -oE \"build_proot_linux/master/[0-9]+-[a-f0-9]+\\/\" | grep \"${FIVEM_VERSION}\" | head -n 1)\n if [ -n \"${VERSION_PATH}\" ]; then\n DOWNLOAD_LINK=\"https://runtime.fivem.net/artifacts/fivem/${VERSION_PATH}fx.tar.xz\"\n elif [[ \"${FIVEM_VERSION}\" == *\"-\"* ]]; then\n DOWNLOAD_LINK=\"https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/${FIVEM_VERSION}/fx.tar.xz\"\n else\n echo \"Could not resolve build ${FIVEM_VERSION}. Defaulting to recommended.\"\n DOWNLOAD_LINK=$(echo \"$CHANGELOGS_PAGE\" | jq -r '.recommended_download')\n fi\nfi\n\necho -e \"Downloading artifact from: ${DOWNLOAD_LINK}\"\ncurl -sSL \"${DOWNLOAD_LINK}\" -o fx.tar.xz\n\necho \"Extracting FiveM FXServer artifact files...\"\nFILETYPE=$(file -b --mime-type fx.tar.xz)\n\nif [[ \"$FILETYPE\" == *\"x-xz\"* ]] || [[ \"$FILETYPE\" == *\"octet-stream\"* ]]; then\n tar xvf fx.tar.xz\nelif [[ \"$FILETYPE\" == *\"gzip\"* ]]; then\n tar xzvf fx.tar.xz\nelif [[ \"$FILETYPE\" == *\"zip\"* ]]; then\n unzip fx.tar.xz\nelse\n echo -e \"Downloaded artifact of unknown filetype ($FILETYPE). Exiting.\"\n rm -f fx.tar.xz\n exit 2\nfi\n\nrm -f fx.tar.xz run.sh\n\nif [ \"$IS_UPDATE\" -eq 0 ]; then\n if [ -e server.cfg ]; then\n echo \"Server config file already exists. Skipping download of new one.\"\n else\n echo \"Downloading default FiveM server config...\"\n curl -sSL https://raw.githubusercontent.com/nodebytehosting/recipes/develop/games/rockstar/fivem/server.cfg >> server.cfg\n fi\n if [ \"${GIT_ENABLED}\" == \"1\" ] && [ ! -d \"/mnt/server/resources\" ]; then\n echo \"Preparing to clone resources repo from git.\"\n if [[ ${GIT_REPOURL} != *.git ]]; then GIT_REPOURL=${GIT_REPOURL}.git; fi\n if [ -n \"${GIT_USERNAME}\" ] && [ -n \"${GIT_TOKEN}\" ]; then\n GIT_REPOURL=\"https://${GIT_USERNAME}:${GIT_TOKEN}@$(echo ${GIT_REPOURL} | cut -d/ -f3-)\"\n fi\n if [ -z \"${GIT_BRANCH}\" ]; then\n git clone ${GIT_REPOURL} /mnt/server/resources\n else\n git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOURL} /mnt/server/resources\n fi\n else\n mkdir -p /mnt/server/resources\n echo \"Preparing to clone default FiveM resources.\"\n git clone https://github.com/citizenfx/cfx-server-data.git /tmp/cfx-resources\n cp -Rf /tmp/cfx-resources/resources/* resources/\n rm -rf /tmp/cfx-resources\n fi\n mkdir -p logs/\n echo \"Installation complete.\"\nelse\n echo \"Update complete.\"\nfi", |
26 | 26 | "container": "ghcr.io/nodebytehosting/installers:debian", |
27 | 27 | "entrypoint": "bash" |
28 | 28 | } |
29 | 29 | }, |
30 | 30 | "variables": [ |
| 31 | + { |
| 32 | + "name": "GTA V Edition", |
| 33 | + "description": "Which version of GTA V this server runs. Players need the matching client: FiveM for Legacy, or FiveM for GTAV Enhanced for Enhanced, and they can't play together. Enhanced is in early access and Legacy assets need converting. Reinstall the server to apply a change.", |
| 34 | + "env_variable": "GTA_EDITION", |
| 35 | + "default_value": "legacy", |
| 36 | + "user_viewable": true, |
| 37 | + "user_editable": true, |
| 38 | + "rules": "required|in:legacy,enhanced", |
| 39 | + "field_type": "text" |
| 40 | + }, |
31 | 41 | { |
32 | 42 | "name": "CFX License Key", |
33 | 43 | "description": "Required to start the service. Get your keys at https://portal.cfx.re/", |
|
39 | 49 | "field_type": "text" |
40 | 50 | }, |
41 | 51 | { |
42 | | - "name": "Steam Web Api Key", |
43 | | - "description": "Use your Steam WebApiKey or set to 'none'. Get your key at https://steamcommunity.com/dev/apikey/.", |
44 | | - "env_variable": "STEAM_WEBAPIKEY", |
45 | | - "default_value": "none", |
| 52 | + "name": "Require Steam Login", |
| 53 | + "description": "Only let players join if their Steam account is linked to their Cfx.re account. Needs server version 38004 or newer.", |
| 54 | + "env_variable": "REQUIRE_STEAM_AUTH", |
| 55 | + "default_value": "0", |
46 | 56 | "user_viewable": true, |
47 | 57 | "user_editable": true, |
48 | | - "rules": "required|string", |
| 58 | + "rules": "required|in:1,0", |
49 | 59 | "field_type": "text" |
50 | 60 | }, |
51 | 61 | { |
|
130 | 140 | }, |
131 | 141 | { |
132 | 142 | "name": "FiveM Game Build", |
133 | | - "description": "Sets the sv_enforceGameBuild convar. This specifies the client GTA build the server should be on.\nRead docs for possible values: https://docs.fivem.net/docs/server-manual/server-commands/#sv_enforcegamebuild-build", |
| 143 | + "description": "Sets sv_enforceGameBuild on Legacy. Enhanced only supports the latest game build, so this is ignored there.", |
134 | 144 | "env_variable": "SV_GAMEBUILD", |
135 | 145 | "default_value": "2944", |
136 | 146 | "user_viewable": true, |
|
0 commit comments