Skip to content

Commit c55d566

Browse files
authored
Update FiveM egg (#218)
* Update egg-five-m.json Updated the egg with: New startup script to use the txAdmin changes, this will use the new TXHOST_TXA_PORT Added Game Name Options: FiveM or RedM Added Game Type : This is used to set gamename inside server.cfg in root location. Also connected to game Name to set correct value in server.cfg * Update README.md Added txAdmin changes and options in the egg * Update README.md fix typo * Add files via upload Changes: Removed deprecated +set serverProfile and +set txAdminPort ConVars. Added export TXHOST_DATA_PATH default to define a default data directory. Added export TXHOST_TXA_PORT {{TXADMIN_PORT}} to replace +set txAdminPort using the new method. Added export TXHOST_GAME_NAME to support RedM also. Startup log is now free of deprecation warnings. * Updated env handling Changed env handling hopefully correct now ? * Update README.md * Changed vars and start command Renamed TXADMIN_PORT to TXHOST_TXA_PORT Renamed GAME_NAME to TXHOST_GAME_NAME
1 parent 8855e52 commit c55d566

2 files changed

Lines changed: 54 additions & 10 deletions

File tree

gta/fivem/README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,22 @@ The `DOWNLOAD_URL` only needs to be used if they turn on ddos protection. The va
3232
txAdmin is now supported and disabled by default. You set `TXADMIN_ENABLED` to `1` to enable it.
3333

3434
The last update to the egg changes the server to use txadmin to run. On first startup it will print a key to use to sign into the txadmin panel.
35-
36-
### Your server will not go online until it's started from txadmin
35+
> [!WARNING]
36+
> ### Your server will not go online until it's started from txadmin
37+
38+
With latest update see [txAdmin Github](https://github.com/citizenfx/txAdmin/blob/master/docs/env-config.md) some things changed.
39+
For now this is added:
40+
- TXHOST_TXA_PORT (Value can be changed by Admin)
41+
- TXHOST_GAME_NAME (Value can be changed by Admin)
42+
- TXHOST_DATA_PATH (hardcoded to /home/container/txData)
43+
> [!NOTE]
44+
> This Egg can also be used for REDM (Same Framework/Artifact builds/TxAdmin).
45+
>
46+
> When using this egg for REDM change value of Game name : to redm.
47+
> [!WARNING]
48+
> Reinstall is needed to write the correct values to files for correct functioning
49+
>
50+
> (if you change Game Name, fivem <-> redm after first install ! )
3751
3852
## Server Ports
3953

gta/fivem/egg-five-m.json

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"version": "PTDL_v2",
55
"update_url": null
66
},
7-
"exported_at": "2023-02-19T12:54:36+01:00",
7+
"exported_at": "2025-10-20T20:14:27+02:00",
88
"name": "FiveM",
99
"author": "parker@parkervcp.com",
10-
"description": "A new FiveM egg for the latest builds due to recent changes in FiveM",
10+
"description": "A new FiveM \/RedM egg for the latest builds due to recent changes in FiveM",
1111
"features": null,
1212
"docker_images": {
1313
"ghcr.io\/ptero-eggs\/yolks:debian": "ghcr.io\/ptero-eggs\/yolks:debian"
1414
},
1515
"file_denylist": [],
16-
"startup": "$(pwd)\/alpine\/opt\/cfx-server\/ld-musl-x86_64.so.1 --library-path \"$(pwd)\/alpine\/usr\/lib\/v8\/:$(pwd)\/alpine\/lib\/:$(pwd)\/alpine\/usr\/lib\/\" -- $(pwd)\/alpine\/opt\/cfx-server\/FXServer +set citizen_dir $(pwd)\/alpine\/opt\/cfx-server\/citizen\/ +set sv_licenseKey {{FIVEM_LICENSE}} +set steam_webApiKey {{STEAM_WEBAPIKEY}} +set sv_maxplayers {{MAX_PLAYERS}} +set serverProfile default +set txAdminPort {{TXADMIN_PORT}} $( [ \"$TXADMIN_ENABLE\" == \"1\" ] || printf %s '+exec server.cfg' )",
16+
"startup": "$(pwd)\/alpine\/opt\/cfx-server\/ld-musl-x86_64.so.1 --library-path \"$(pwd)\/alpine\/usr\/lib\/v8\/:$(pwd)\/alpine\/lib\/:$(pwd)\/alpine\/usr\/lib\/\" -- $(pwd)\/alpine\/opt\/cfx-server\/FXServer +set citizen_dir $(pwd)\/alpine\/opt\/cfx-server\/citizen\/ +set sv_licenseKey {{FIVEM_LICENSE}} +set steam_webApiKey {{STEAM_WEBAPIKEY}} +set sv_maxplayers {{MAX_PLAYERS}} $( [ \"$TXADMIN_ENABLE\" == \"1\" ] || printf %s '+exec server.cfg' )",
1717
"config": {
1818
"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.default.port}}\\\"\",\r\n \"endpoint_add_udp\": \"endpoint_add_udp \\\"0.0.0.0:{{server.build.default.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 }\r\n }\r\n}",
1919
"startup": "{\r\n \"done\": \"succeeded. Welcome!\"\r\n}",
@@ -22,15 +22,15 @@
2222
},
2323
"scripts": {
2424
"installation": {
25-
"script": "#!\/bin\/bash\r\n# FiveM Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update -y\r\napt install -y tar xz-utils file jq\r\n\r\nmkdir -p \/mnt\/server\/resources\r\n\r\ncd \/mnt\/server\r\n\r\necho \"updating citizenfx resource files\"\r\ngit clone https:\/\/github.com\/citizenfx\/cfx-server-data.git \/tmp\r\ncp -Rf \/tmp\/resources\/* resources\/\r\n\r\nRELEASE_PAGE=$(curl -sSL https:\/\/runtime.fivem.net\/artifacts\/fivem\/build_proot_linux\/master\/)\r\nCHANGELOGS_PAGE=$(curl -sSL https:\/\/changelogs-live.fivem.net\/api\/changelog\/versions\/linux\/server)\r\n\r\nif [[ \"${FIVEM_VERSION}\" == \"recommended\" ]] || [[ -z ${FIVEM_VERSION} ]]; then\r\n DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.recommended_download')\r\nelif [[ \"${FIVEM_VERSION}\" == \"latest\" ]]; then\r\n DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download')\r\nelse\r\n VERSION_LINK=$(echo -e \"${RELEASE_PAGE}\" | grep -Eo '\".*\/*.tar.xz\"' | grep -Eo '\".*\/*.tar.xz\"' | sed 's\/\\\"\/\/g' | sed 's\/\\.\\\/\/\/1' | grep -i \"${FIVEM_VERSION}\" | grep -o =.* | tr -d '=')\r\n if [[ \"${VERSION_LINK}\" == \"\" ]]; then\r\n echo -e \"defaulting to recommedned as the version requested was invalid.\"\r\n DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.recommended_download')\r\n else\r\n DOWNLOAD_LINK=$(echo https:\/\/runtime.fivem.net\/artifacts\/fivem\/build_proot_linux\/master\/${VERSION_LINK})\r\n fi\r\nfi\r\n\r\nif [ ! -z \"${DOWNLOAD_URL}\" ]; then\r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_URL}; then\r\n echo -e \"link is valid. setting download link to ${DOWNLOAD_URL}\"\r\n DOWNLOAD_LINK=${DOWNLOAD_URL}\r\n else\r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\nfi\r\n\r\necho -e \"Running curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\"\r\n\r\ncurl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\r\n\r\necho \"Extracting fivem files\"\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"XZ\" ]; then\r\n tar xvf ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n exit 2\r\nfi\r\n\r\nrm -rf ${DOWNLOAD_LINK##*\/} run.sh\r\n\r\nif [ -e server.cfg ]; then\r\n echo \"Skipping downloading default server config file as one already exists\"\r\nelse\r\n echo \"Downloading default fivem config\"\r\n curl https:\/\/raw.githubusercontent.com\/ptero-eggs\/game-eggs\/main\/gta\/fivem\/server.cfg >>server.cfg\r\nfi\r\n\r\nmkdir -p logs\/\r\n\r\necho \"install complete\"",
25+
"script": "#!\/bin\/bash\r\n# FiveM Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update -y\r\napt install -y tar xz-utils file jq\r\n\r\nmkdir -p \/mnt\/server\/resources\r\n\r\ncd \/mnt\/server\r\n\r\necho \"updating citizenfx resource files\"\r\ngit clone https:\/\/github.com\/citizenfx\/cfx-server-data.git \/tmp\r\ncp -Rf \/tmp\/resources\/* resources\/\r\n\r\nRELEASE_PAGE=$(curl -sSL https:\/\/runtime.fivem.net\/artifacts\/fivem\/build_proot_linux\/master\/)\r\nCHANGELOGS_PAGE=$(curl -sSL https:\/\/changelogs-live.fivem.net\/api\/changelog\/versions\/linux\/server)\r\n\r\nif [[ \"${FIVEM_VERSION}\" == \"recommended\" ]] || [[ -z ${FIVEM_VERSION} ]]; then\r\n DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.recommended_download')\r\nelif [[ \"${FIVEM_VERSION}\" == \"latest\" ]]; then\r\n DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.latest_download')\r\nelse\r\n VERSION_LINK=$(echo -e \"${RELEASE_PAGE}\" | grep -Eo '\".*\/*.tar.xz\"' | grep -Eo '\".*\/*.tar.xz\"' | sed 's\/\\\"\/\/g' | sed 's\/\\.\\\/\/\/1' | grep -i \"${FIVEM_VERSION}\" | grep -o =.* | tr -d '=')\r\n if [[ \"${VERSION_LINK}\" == \"\" ]]; then\r\n echo -e \"defaulting to recommedned as the version requested was invalid.\"\r\n DOWNLOAD_LINK=$(echo $CHANGELOGS_PAGE | jq -r '.recommended_download')\r\n else\r\n DOWNLOAD_LINK=$(echo https:\/\/runtime.fivem.net\/artifacts\/fivem\/build_proot_linux\/master\/${VERSION_LINK})\r\n fi\r\nfi\r\n\r\nif [ ! -z \"${DOWNLOAD_URL}\" ]; then\r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_URL}; then\r\n echo -e \"link is valid. setting download link to ${DOWNLOAD_URL}\"\r\n DOWNLOAD_LINK=${DOWNLOAD_URL}\r\n else\r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\nfi\r\n\r\necho -e \"Running curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\"\r\n\r\ncurl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\r\n\r\necho \"Extracting fivem files\"\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"XZ\" ]; then\r\n tar xvf ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n exit 2\r\nfi\r\n\r\nrm -rf ${DOWNLOAD_LINK##*\/} run.sh\r\n\r\nif [ -e server.cfg ]; then\r\n echo \"Skipping downloading default server config file as one already exists\"\r\nelse\r\n echo \"Downloading default fivem config\"\r\n curl https:\/\/raw.githubusercontent.com\/ptero-eggs\/game-eggs\/main\/gta\/fivem\/server.cfg >>server.cfg\r\nfi\r\n\r\n# Map GAME_NAME to GAME_TYPE before writing to server.cfg\r\nif [ \"${TXHOST_GAME_NAME}\" == \"fivem\" ]; then\r\n GAME_TYPE=\"gta5\"\r\nelif [ \"${TXHOST_GAME_NAME}\" == \"redm\" ]; then\r\n GAME_TYPE=\"rdr3\"\r\nelse\r\n echo \"Invalid GAME_NAME specified: ${TXHOST_GAME_NAME}\"\r\n exit 1\r\nfi \r\n\r\nCFG_FILE=\"server.cfg\"\r\n\r\n# Only proceed if server.cfg exists\r\nif [ -f \"$CFG_FILE\" ]; then\r\n # Remove old gamename block: comment and actual line\r\n sed -i '\/^# set gamename\/,+1d' \"$CFG_FILE\"\r\n\r\n # Append clean new block\r\n {\r\n echo \"# set gamename\"\r\n echo \"set gamename \\\"${GAME_TYPE}\\\"\"\r\n } >> \"$CFG_FILE\"\r\nelse\r\n echo \"Warning: $CFG_FILE not found. Skipping gamename insertion.\"\r\nfi\r\n\r\nmkdir -p logs\/\r\n\r\necho \"install complete\"",
2626
"container": "ghcr.io\/ptero-eggs\/installers:debian",
2727
"entrypoint": "bash"
2828
}
2929
},
3030
"variables": [
3131
{
3232
"name": "fivem license",
33-
"description": "Required to start the service. Get your keys at https:\/\/keymaster.fivem.net\/",
33+
"description": "Required to start the service. Get your keys at https:\/\/portal.cfx.re\/",
3434
"env_variable": "FIVEM_LICENSE",
3535
"default_value": "",
3636
"user_viewable": true,
@@ -44,7 +44,7 @@
4444
"env_variable": "MAX_PLAYERS",
4545
"default_value": "48",
4646
"user_viewable": true,
47-
"user_editable": false,
47+
"user_editable": true,
4848
"rules": "required|integer|between:1,48",
4949
"field_type": "text"
5050
},
@@ -91,7 +91,7 @@
9191
{
9292
"name": "txAdmin Port",
9393
"description": "The port for the txAdmin panel",
94-
"env_variable": "TXADMIN_PORT",
94+
"env_variable": "TXHOST_TXA_PORT",
9595
"default_value": "40120",
9696
"user_viewable": true,
9797
"user_editable": false,
@@ -107,6 +107,36 @@
107107
"user_editable": true,
108108
"rules": "required|boolean",
109109
"field_type": "text"
110+
},
111+
{
112+
"name": "Game Name",
113+
"description": "Restricts to only running either FiveM or RedM servers.\r\nThe setup page will only show recipes for the game specified below !\r\nOptions are : fivem or redm",
114+
"env_variable": "TXHOST_GAME_NAME",
115+
"default_value": "fivem",
116+
"user_viewable": true,
117+
"user_editable": true,
118+
"rules": "required|in:fivem,redm",
119+
"field_type": "text"
120+
},
121+
{
122+
"name": "Game type",
123+
"description": "Value to be used : gta5 for FiveM and rdr3 for RedM\r\n! Dont fill in any value it reads the game name variable and set the correct value for it !",
124+
"env_variable": "GAME_TYPE",
125+
"default_value": "",
126+
"user_viewable": false,
127+
"user_editable": false,
128+
"rules": "string|nullable",
129+
"field_type": "text"
130+
},
131+
{
132+
"name": "TXHOST DATA PATH",
133+
"description": "Location for TX Admin",
134+
"env_variable": "TXHOST_DATA_PATH",
135+
"default_value": "\/home\/container\/txData",
136+
"user_viewable": false,
137+
"user_editable": false,
138+
"rules": "required|string",
139+
"field_type": "text"
110140
}
111141
]
112-
}
142+
}

0 commit comments

Comments
 (0)