pelican-eggs / eggs

Service eggs for the pterodactyl panel
MIT License
2.84k stars 2.32k forks source link

[Egg Request]: Necesse #1676

Closed penderes closed 8 months ago

penderes commented 2 years ago

Does this expand an already existing service

No

Link to a game or software

https://steamdb.info/app/1169370/

Links for the download

General Download: https://necessegame.com/server/ Most recent version: https://necessegame.com/wp-content/uploads/2022/05/necesse-server-linux64-0-21-21-8753609.zip or through SteamCMD: https://steamdb.info/app/1169370/

Links for the install docs

https://necessewiki.com/Multiplayer-Linux

penderes commented 2 years ago

I have created a barebone Egg that works through environment variables already.

It spins up a server that you can connect to with the slots, worldname and port working through env-variables that the user can set when creating the server.

It will create a config file in the /cfg/ folder with default settings, but these settings are ignored... I cannot figure out the config parser right now, so this might need later fixing.

But if people are interested, here you go:

{
    "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
    "meta": {
        "version": "PTDL_v1",
        "update_url": null
    },
    "exported_at": "2022-05-25T16:57:08+02:00",
    "name": "Necesse Experimental Egg",
    "author": "enderep12",
    "description": "Necesse Experimental Egg\r\nSteamCMD ID: 1169370\r\nDefault Port: 14159",
    "features": null,
    "images": [
        "ghcr.io\/pterodactyl\/yolks:java_17"
    ],
    "file_denylist": [],
    "startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -Dterminal.jline=false -Dterminal.ansi=true -jar Server.jar -localdir -nogui -port {{SERVER_PORT}} -world {{SAVEGAME}} -slots {{SERVERSLOTS}}",
    "config": {
        "files": "{}",
        "startup": "{\r\n    \"done\": \"Type help for list of commands.\"\r\n}",
        "logs": "{}",
        "stop": "stop"
    },
    "scripts": {
        "installation": {
            "script": "#!\/bin\/bash\r\n# steamcmd Base Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# Image to install with is 'ghcr.io\/parkervcp\/installers:debian'\r\n\r\n##\r\n#\r\n# Variables\r\n# STEAM_USER, STEAM_PASS, STEAM_AUTH - Steam user setup. If a user has 2fa enabled it will most likely fail due to timeout. Leave blank for anon install.\r\n# WINDOWS_INSTALL - if it's a windows server you want to install set to 1\r\n# SRCDS_APPID - steam app id found here - https:\/\/developer.valvesoftware.com\/wiki\/Dedicated_Servers_List\r\n# SRCDS_BETAID - beta branch of a steam app. Leave blank to install normal branch\r\n# SRCDS_BETAPASS - password for a beta branch should one be required during private or closed testing phases.. Leave blank for no password.\r\n# INSTALL_FLAGS - Any additional SteamCMD  flags to pass during install.. Keep in mind that steamcmd auto update process in the docker image might overwrite or ignore these when it performs update on server boot.\r\n# AUTO_UPDATE - Adding this variable to the egg allows disabling or enabling automated updates on boot. Boolean value. 0 to disable and 1 to enable.\r\n#\r\n\r\n\r\n## just in case someone removed the defaults.\r\nif [[ \"${STEAM_USER}\" == \"\" ]] || [[ \"${STEAM_PASS}\" == \"\" ]]; then\r\n    echo -e \"steam user is not set.\\n\"\r\n    echo -e \"Using anonymous user.\\n\"\r\n    STEAM_USER=anonymous\r\n    STEAM_PASS=\"\"\r\n    STEAM_AUTH=\"\"\r\nelse\r\n    echo -e \"user set to ${STEAM_USER}\"\r\nfi\r\n\r\n## download and install steamcmd\r\ncd \/tmp\r\nmkdir -p \/mnt\/server\/steamcmd\r\ncurl -sSL -o steamcmd.tar.gz https:\/\/steamcdn-a.akamaihd.net\/client\/installer\/steamcmd_linux.tar.gz\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\nmkdir -p \/mnt\/server\/steamapps # Fix steamcmd disk write error when this folder is missing\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n## install game using steamcmd\r\n.\/steamcmd.sh +force_install_dir \/mnt\/server +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ \"${WINDOWS_INSTALL}\" == \"1\" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s \"-beta ${SRCDS_BETAID}\" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s \"-betapassword ${SRCDS_BETAPASS}\" ) ${INSTALL_FLAGS} validate +quit ## other flags may be needed depending on install. looking at you cs 1.6\r\n\r\n## set up 32 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\n## set up 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk64\r\ncp -v linux64\/steamclient.so ..\/.steam\/sdk64\/steamclient.so",
            "container": "ghcr.io\/parkervcp\/installers:debian",
            "entrypoint": "bash"
        }
    },
    "variables": [
        {
            "name": "Savegame",
            "description": "Name of your Savegame",
            "env_variable": "SAVEGAME",
            "default_value": "SaveGame1",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|string|max:20"
        },
        {
            "name": "Steam App ID",
            "description": "Steam App ID",
            "env_variable": "SRCDS_APPID",
            "default_value": "1169370",
            "user_viewable": true,
            "user_editable": false,
            "rules": "required|string|max:20"
        },
        {
            "name": "Steam Beta Branch [requires reinstall]",
            "description": "Beta branch to install, such as b41multiplayer. Leave blank to install normal branch",
            "env_variable": "SRCDS_BETAID",
            "default_value": "",
            "user_viewable": true,
            "user_editable": true,
            "rules": "nullable|string|max:64"
        },
        {
            "name": "Steam Auto Update",
            "description": "Enable or disable auto-update on startup. 0 to disable and 1 to enable.",
            "env_variable": "AUTO_UPDATE",
            "default_value": "0",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|string|max:20"
        },
        {
            "name": "Serverslots",
            "description": "How many slots should your server have?",
            "env_variable": "SERVERSLOTS",
            "default_value": "10",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|numeric|max:99"
        }
    ]
}
QuintenQVD0 commented 2 years ago

This is a more "done" version of the egg it is made together with @penderes

{
    "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
    "meta": {
        "version": "PTDL_v1",
        "update_url": null
    },
    "exported_at": "2022-05-25T17:19:19+02:00",
    "name": "Necesse Egg",
    "author": "josdekurk@gmail.com",
    "description": "Necesse is a top-down sandbox action-adventure game in a procedurally generated world. Progress your character's gear and settlement through fighting, mining, exploring, crafting, trading and more!",
    "features": [
        "steam_disk_space"
    ],
    "images": [
        "ghcr.io\/pterodactyl\/yolks:java_11"
    ],
    "file_denylist": [],
    "startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -Dterminal.jline=false -Dterminal.ansi=true -jar Server.jar -slots {{GAME_MAX_SLOTS}}  -localdir -world {{SAVE_GAME_NAME}} -nogui -port {{SERVER_PORT}}",
    "config": {
        "files": "{}",
        "startup": "{\r\n    \"done\": \"Type help for list of commands\"\r\n}",
        "logs": "{}",
        "stop": "stop"
    },
    "scripts": {
        "installation": {
            "script": "#!\/bin\/bash\r\n\r\n\r\n## just in case someone removed the defaults.\r\nif [[ \"${STEAM_USER}\" == \"\" ]] || [[ \"${STEAM_PASS}\" == \"\" ]]; then\r\n    echo -e \"steam user is not set.\\n\"\r\n    echo -e \"Using anonymous user.\\n\"\r\n    STEAM_USER=anonymous\r\n    STEAM_PASS=\"\"\r\n    STEAM_AUTH=\"\"\r\nelse\r\n    echo -e \"user set to ${STEAM_USER}\"\r\nfi\r\n\r\n## download and install steamcmd\r\ncd \/tmp\r\nmkdir -p \/mnt\/server\/steamcmd\r\ncurl -sSL -o steamcmd.tar.gz https:\/\/steamcdn-a.akamaihd.net\/client\/installer\/steamcmd_linux.tar.gz\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\nmkdir -p \/mnt\/server\/steamapps # Fix steamcmd disk write error when this folder is missing\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n## install game using steamcmd\r\n.\/steamcmd.sh +force_install_dir \/mnt\/server +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s \"-beta ${SRCDS_BETAID}\" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s \"-betapassword ${SRCDS_BETAPASS}\" ) ${INSTALL_FLAGS} validate +quit \r\n\r\n## set up 32 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk32\r\ncp -v linux32\/steamclient.so ..\/.steam\/sdk32\/steamclient.so\r\n\r\n## set up 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk64\r\ncp -v linux64\/steamclient.so ..\/.steam\/sdk64\/steamclient.so\r\n\r\ncd \/mnt\/server\r\nrm StartServer-nogui.sh\r\necho \"done\"",
            "container": "ghcr.io\/parkervcp\/installers:debian",
            "entrypoint": "bash"
        }
    },
    "variables": [
        {
            "name": "SAVEGAMENAME",
            "description": "Name of your Savegame",
            "env_variable": "SAVE_GAME_NAME",
            "default_value": "SaveGame1",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|string|max:32"
        },
        {
            "name": "Steam App ID",
            "description": "Steam App ID",
            "env_variable": "SRCDS_APPID",
            "default_value": "1169370",
            "user_viewable": true,
            "user_editable": false,
            "rules": "required|regex:\/^(1169370)$\/"
        },
        {
            "name": "Steam Beta Branch [requires reinstall]",
            "description": "Beta branch to install, such as b41multiplayer. Leave blank to install normal branch",
            "env_variable": "SRCDS_BETAID",
            "default_value": "",
            "user_viewable": true,
            "user_editable": true,
            "rules": "nullable|string"
        },
        {
            "name": "Steam Auto Update",
            "description": "Enable or disable auto-update on startup. 0 to disable and 1 to enable.",
            "env_variable": "AUTO_UPDATE",
            "default_value": "0",
            "user_viewable": true,
            "user_editable": true,
            "rules": "boolean"
        },
        {
            "name": "Max server slots",
            "description": "The max amount of players that can join the server",
            "env_variable": "GAME_MAX_SLOTS",
            "default_value": "100",
            "user_viewable": true,
            "user_editable": true,
            "rules": "required|integer|max:250"
        },
        {
            "name": "The game password",
            "description": "The password set for the game",
            "env_variable": "GAME_PW",
            "default_value": "YouCantguessthis123",
            "user_viewable": true,
            "user_editable": true,
            "rules": "nullable|string"
        }
    ]
}