mirror of
https://github.com/pterodactyl/documentation.git
synced 2025-12-10 21:05:59 -06:00
130 lines
33 KiB
HTML
130 lines
33 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-US">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>Creating a Custom Egg | Pterodactyl</title>
|
|
<meta name="generator" content="VuePress 1.5.4">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32">
|
|
<link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16">
|
|
<link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#0e4688">
|
|
<link rel="manifest" href="/favicons/manifest.json">
|
|
<link rel="shortcut icon" href="/favicons/favicon.ico">
|
|
<meta name="description" content="The open-source server management solution.">
|
|
<meta name="msapplication-config" content="/favicons/browserconfig.xml">
|
|
<meta name="theme-color" content="#0e4688">
|
|
<link rel="preload" href="/assets/css/0.styles.6fa99e09.css" as="style"><link rel="preload" href="/assets/js/app.dad5e5c2.js" as="script"><link rel="preload" href="/assets/js/4.e413141f.js" as="script"><link rel="preload" href="/assets/js/1.ee4ff4e2.js" as="script"><link rel="preload" href="/assets/js/12.7214ee65.js" as="script"><link rel="prefetch" href="/assets/js/10.041c438a.js"><link rel="prefetch" href="/assets/js/11.efec8f80.js"><link rel="prefetch" href="/assets/js/13.7b958e39.js"><link rel="prefetch" href="/assets/js/14.3700aaa2.js"><link rel="prefetch" href="/assets/js/15.b364ee34.js"><link rel="prefetch" href="/assets/js/16.90c5b55f.js"><link rel="prefetch" href="/assets/js/17.f2ef94ea.js"><link rel="prefetch" href="/assets/js/18.2e49d336.js"><link rel="prefetch" href="/assets/js/19.1ecd8da7.js"><link rel="prefetch" href="/assets/js/2.f895a645.js"><link rel="prefetch" href="/assets/js/20.a5a6314d.js"><link rel="prefetch" href="/assets/js/21.f227dfac.js"><link rel="prefetch" href="/assets/js/22.b4c8d3ed.js"><link rel="prefetch" href="/assets/js/23.e3008a60.js"><link rel="prefetch" href="/assets/js/24.433197bc.js"><link rel="prefetch" href="/assets/js/25.f87fba53.js"><link rel="prefetch" href="/assets/js/26.e0451f04.js"><link rel="prefetch" href="/assets/js/27.778d7f34.js"><link rel="prefetch" href="/assets/js/28.653b63a6.js"><link rel="prefetch" href="/assets/js/29.895e3725.js"><link rel="prefetch" href="/assets/js/30.c937ce7b.js"><link rel="prefetch" href="/assets/js/31.f4330266.js"><link rel="prefetch" href="/assets/js/32.48b67091.js"><link rel="prefetch" href="/assets/js/33.e448d8d5.js"><link rel="prefetch" href="/assets/js/34.ae2669e4.js"><link rel="prefetch" href="/assets/js/35.39f949b8.js"><link rel="prefetch" href="/assets/js/36.69a2fac8.js"><link rel="prefetch" href="/assets/js/37.9c2aa570.js"><link rel="prefetch" href="/assets/js/38.0abc478b.js"><link rel="prefetch" href="/assets/js/39.8245fa95.js"><link rel="prefetch" href="/assets/js/40.ceb16170.js"><link rel="prefetch" href="/assets/js/41.975deabc.js"><link rel="prefetch" href="/assets/js/42.dc536ccb.js"><link rel="prefetch" href="/assets/js/43.3cad252f.js"><link rel="prefetch" href="/assets/js/44.aba1c9a7.js"><link rel="prefetch" href="/assets/js/45.43535f37.js"><link rel="prefetch" href="/assets/js/46.177ea9d9.js"><link rel="prefetch" href="/assets/js/47.f6f5e305.js"><link rel="prefetch" href="/assets/js/48.014f3e64.js"><link rel="prefetch" href="/assets/js/49.22a383a0.js"><link rel="prefetch" href="/assets/js/5.1bddf890.js"><link rel="prefetch" href="/assets/js/50.43c0500a.js"><link rel="prefetch" href="/assets/js/51.b86f952d.js"><link rel="prefetch" href="/assets/js/52.9a78fb3a.js"><link rel="prefetch" href="/assets/js/53.c01cdedb.js"><link rel="prefetch" href="/assets/js/54.cccda0e8.js"><link rel="prefetch" href="/assets/js/55.0ceb7c03.js"><link rel="prefetch" href="/assets/js/56.ee8fe752.js"><link rel="prefetch" href="/assets/js/57.8c7ba6b6.js"><link rel="prefetch" href="/assets/js/58.8850932d.js"><link rel="prefetch" href="/assets/js/59.49745b4f.js"><link rel="prefetch" href="/assets/js/6.d7837586.js"><link rel="prefetch" href="/assets/js/60.31b3f182.js"><link rel="prefetch" href="/assets/js/61.711176f1.js"><link rel="prefetch" href="/assets/js/62.cbeb1945.js"><link rel="prefetch" href="/assets/js/63.af841a3c.js"><link rel="prefetch" href="/assets/js/64.8ed7439b.js"><link rel="prefetch" href="/assets/js/65.ff6f8142.js"><link rel="prefetch" href="/assets/js/66.c98a36dd.js"><link rel="prefetch" href="/assets/js/67.1dc632b6.js"><link rel="prefetch" href="/assets/js/68.f8c52b5e.js"><link rel="prefetch" href="/assets/js/69.33280bba.js"><link rel="prefetch" href="/assets/js/7.ad189dcf.js"><link rel="prefetch" href="/assets/js/70.ba33f507.js"><link rel="prefetch" href="/assets/js/71.e87b1de3.js"><link rel="prefetch" href="/assets/js/72.0cf75ac7.js"><link rel="prefetch" href="/assets/js/73.4b2ce5ac.js"><link rel="prefetch" href="/assets/js/74.3bf176a0.js"><link rel="prefetch" href="/assets/js/8.f208d3ff.js"><link rel="prefetch" href="/assets/js/9.56fc48a0.js">
|
|
<link rel="stylesheet" href="/assets/css/0.styles.6fa99e09.css">
|
|
</head>
|
|
<body>
|
|
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="nav"><div class="sidebar-button block md:hidden flex-no-shrink"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <div class="logo-container"><a href="/" class="home-link router-link-active"><img src="/pterodactyl-flat.png" class="logo"> <span class="site-name hidden md:inline can-hide">Pterodactyl</span></a></div> <div class="w-full"><div class="flex"><div class="search-box"><input aria-label="Search" placeholder="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links flex-no-shrink hidden md:flex"><div class="nav-item"><a href="/project/introduction.html" class="nav-link">Documentation
|
|
</a></div><div class="nav-item"><a href="/community/about.html" class="nav-link">Community Guides
|
|
</a></div><div class="nav-item"><a href="https://pterodactyl.io/discord" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
Get Help
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://dashflo.net/docs/api/pterodactyl/v1/" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
API
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <div class="nav-item"><a href="https://github.com/pterodactyl/panel" target="_blank" rel="noopener noreferrer" class="nav-link">
|
|
Contribute
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></nav></div></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links flex-no-shrink block md:hidden"><div class="nav-item"><a href="/project/introduction.html" class="nav-link">Documentation
|
|
</a></div><div class="nav-item"><a href="/community/about.html" class="nav-link">Community Guides
|
|
</a></div><div class="nav-item"><a href="https://pterodactyl.io/discord" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
Get Help
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="https://dashflo.net/docs/api/pterodactyl/v1/" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
|
API
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <div class="nav-item"><a href="https://github.com/pterodactyl/panel" target="_blank" rel="noopener noreferrer" class="nav-link">
|
|
Contribute
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></nav> <ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading"><span>Community Guides</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/about.html" class="sidebar-link">Community Guides and Tutorials</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Panel Installation</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/installation-guides/panel/centos7.html" class="sidebar-link">CentOS 7</a></li><li><a href="/community/installation-guides/panel/centos8.html" class="sidebar-link">CentOS 8</a></li><li><a href="/community/installation-guides/panel/debian9.html" class="sidebar-link">Debian 9</a></li><li><a href="/community/installation-guides/panel/debian10.html" class="sidebar-link">Debian 10</a></li><li><a href="/community/installation-guides/panel/ubuntu1804.html" class="sidebar-link">Ubuntu 18.04</a></li><li><a href="/community/installation-guides/panel/ubuntu2004.html" class="sidebar-link">Ubuntu 20.04</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Wings Installation</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/installation-guides/wings/centos7.html" class="sidebar-link">CentOS 7</a></li><li><a href="/community/installation-guides/wings/centos8.html" class="sidebar-link">CentOS 8</a></li><li><a href="/community/installation-guides/wings/debian9.html" class="sidebar-link">Debian 9</a></li><li><a href="/community/installation-guides/wings/debian10.html" class="sidebar-link">Debian 10</a></li><li><a href="/community/installation-guides/wings/ubuntu1804.html" class="sidebar-link">Ubuntu 18.04</a></li><li><a href="/community/installation-guides/wings/ubuntu2004.html" class="sidebar-link">Ubuntu 20.04</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading open"><span>Creating Eggs</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/config/eggs/creating_a_custom_egg.html" class="active sidebar-link">Creating a Custom Egg</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#create-new-option" class="sidebar-link">Create New Option</a></li><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#configure-process-management" class="sidebar-link">Configure Process Management</a></li><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#copy-settings-from" class="sidebar-link">Copy Settings From</a></li><li class="sidebar-sub-header"><a href="/community/config/eggs/creating_a_custom_egg.html#egg-variables" class="sidebar-link">Egg Variables</a></li></ul></li><li><a href="/community/config/eggs/creating_a_custom_image.html" class="sidebar-link">Creating a Custom Docker Image</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Game Configuration</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/games/minecraft.html" class="sidebar-link">Minecraft</a></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>Tutorials</span> <!----> <!----></p> <ul class="sidebar-group-items"><li><a href="/community/config/nodes/add_node.html" class="sidebar-link">Creating a New Node</a></li><li><a href="/community/tutorials/custom_theme_setup.html" class="sidebar-link">Creating a theme for Pterodactyl</a></li><li><a href="/community/tutorials/artisan.html" class="sidebar-link">Artisan CLI</a></li></ul></div></li></ul> </div> <div class="page"> <div class="content content__default"><h1 id="creating-a-custom-egg"><a href="#creating-a-custom-egg" class="header-anchor">#</a> Creating a Custom Egg</h1> <div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>You should not edit existing services or options that ship with the Panel. Each upgrade we push can make minor
|
|
changes to these, and you'll lose any changes you've made.</p></div> <p></p><div class="table-of-contents"><ul><li><a href="#create-new-option">Create New Option</a></li><li><a href="#configure-process-management">Configure Process Management</a><ul><li><a href="#stop-command">Stop Command</a></li><li><a href="#log-storage">Log Storage</a></li><li><a href="#configuration-files">Configuration Files</a></li><li><a href="#start-configuration">Start Configuration</a></li></ul></li><li><a href="#copy-settings-from">Copy Settings From</a></li><li><a href="#egg-variables">Egg Variables</a></li></ul></div><p></p> <p>The first thing you'll need to do is create a new service. In this case, the name and description speak for themselves
|
|
in this case. The <code>Folder Name</code> <em>must be a unique name</em> not being used by any other service, and should only
|
|
contain letters, numbers, underscores, and dashes. This is the name of the folder where the daemon will be storing
|
|
the service options on the daemon.</p> <p>The default start command is also required, however it can be changed per-option.</p> <h2 id="create-new-option"><a href="#create-new-option" class="header-anchor">#</a> Create New Option</h2> <p>After creating the service, in the bottom right of the page you should see a button titled <code>New Egg</code>, press it.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Select.5a2867ee.png" alt=""></p> <p>You will be taken to a new service option page which is where most of the configuration happens. The first thing
|
|
you need to do is select your service that you created previously from the <code>Associated Nest</code> dropdown.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Process_Management.516b5b6f.png" alt=""></p> <p>After that, enter an Option Name to describe it, in this case I am using <code>Widget</code>. You will also need to provide a
|
|
<em>valid</em> docker image, as well as a start command to be assigned to servers under this service option (remember, this
|
|
can be tweaked per-server if needed).</p> <p><em>Docker images must be specifically designed to work with Pterodactyl Panel.</em> You should read more about that in
|
|
our <a href="/community/config/eggs/creating_a_custom_image.html">Creating a Docker Image</a> guide.</p> <h2 id="configure-process-management"><a href="#configure-process-management" class="header-anchor">#</a> Configure Process Management</h2> <p>This is perhaps the most important step in this service option configuration, as this tells the Daemon how to run everything.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Process_Management.516b5b6f.png" alt=""></p> <p>The first field you'll encounter is <code>Copy Settings From</code>. The default selection is <code>None</code>. That is expected, and okay.
|
|
This dropdown is discussed at the end of this article.</p> <h3 id="stop-command"><a href="#stop-command" class="header-anchor">#</a> Stop Command</h3> <p>Next, you'll encounter <code>Stop Command</code> and, as the name implies, this should be the command used to safely stop the
|
|
option. For some games, this is <code>stop</code> or <code>end</code>. Certain programs and games don't have a specified stop command, so
|
|
you can enter <code>^C</code> to have the daemon execute a <code>SIGINT</code> to end the process.</p> <h3 id="log-storage"><a href="#log-storage" class="header-anchor">#</a> Log Storage</h3> <p>Logs are competely handeled by the daemon now and use the docker logs to output the complete output from the server.
|
|
This can be set like below.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span><span class="token punctuation">}</span>
|
|
</code></pre></div><h3 id="configuration-files"><a href="#configuration-files" class="header-anchor">#</a> Configuration Files</h3> <p>The next block is one of the most complex blocks, the <code>Configuration Files</code> descriptor. The Daemon will process this
|
|
block prior to booting the server to ensure all of the required settings are defined and set correctly.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
<span class="token property">"server.properties"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"parser"</span><span class="token operator">:</span> <span class="token string">"properties"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"find"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"server-ip"</span><span class="token operator">:</span> <span class="token string">"0.0.0.0"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"enable-query"</span><span class="token operator">:</span> <span class="token string">"true"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"server-port"</span><span class="token operator">:</span> <span class="token string">"{{server.build.default.port}}"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"query.port"</span><span class="token operator">:</span> <span class="token string">"{{server.build.default.port}}"</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre></div><p>In this example, we are telling the Daemon to read <code>server.properties</code> in <code>/home/container</code>. Within this block, we
|
|
define a <code>parser</code>, in this case <code>properties</code> but the following are <a href="https://github.com/Pterodactyl/Daemon/blob/develop/src/helpers/fileparser.js" target="_blank" rel="noopener noreferrer">valid parsers<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>:</p> <ul><li><code>file</code> — This parser goes based on matching the beginning of lines, and not a specific property like the other four.
|
|
Avoid using this parser if possible.</li> <li><code>yaml</code> (supports <code>*</code> notation)</li> <li><code>properties</code></li> <li><code>ini</code></li> <li><code>json</code> (supports <code>*</code> notation)</li> <li><code>xml</code></li></ul> <p>Once you have defined a parser, we then define a <code>find</code> block which tells the Daemon what specific elements to find
|
|
and replace. In this example, we have provided four separate items within the <code>server.properties</code> file that we want to
|
|
find and replace to the assigned values. You can use either an exact value, or define a specific server setting from
|
|
the <code>server.json</code> file. In this case, we're assigning the default server port to be used as the <code>server-port</code> and
|
|
<code>query.port</code>. <strong>These placeholders are case sensitive, and should have no spaces in them.</strong></p> <p>You can have multiple files listed here, the Daemon will process them in parallel before starting the server. When
|
|
using <code>yaml</code> or <code>json</code> you can use more advanced searching for elements.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
<span class="token property">"config.yml"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"parser"</span><span class="token operator">:</span> <span class="token string">"yaml"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"find"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"listeners[0].query_enabled"</span><span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
|
<span class="token property">"listeners[0].query_port"</span><span class="token operator">:</span> <span class="token string">"{{server.build.default.port}}"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"listeners[0].host"</span><span class="token operator">:</span> <span class="token string">"0.0.0.0:{{server.build.default.port}}"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"servers.*.address"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
|
<span class="token property">"127.0.0.1"</span><span class="token operator">:</span> <span class="token string">"{{config.docker.interface}}"</span><span class="token punctuation">,</span>
|
|
<span class="token property">"localhost"</span><span class="token operator">:</span> <span class="token string">"{{config.docker.interface}}"</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre></div><p>In this example, we are parsing <code>config.yml</code> using the <code>yaml</code> parser. The first three find items are simply assigning
|
|
ports and IPs for the first listener block. The last one, <code>servers.*.address</code> uses wildcard matching to match any items
|
|
within the <code>servers</code> block, and then finding each <code>address</code> block for those items.</p> <div><p>An advanced feature of this file configuration is the ability to define multiple find and replace statements for a
|
|
single matching line. In this case, we are looking for either <code>127.0.0.1</code> or <code>localhost</code> and replacing them with the
|
|
docker interface defined in the configuration file using <code>{{config.docker.interface}}</code>.</p></div><h3 id="start-configuration"><a href="#start-configuration" class="header-anchor">#</a> Start Configuration</h3> <p>The last block to configure is the <code>Start Configuration</code> for servers running using this service option.</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
<span class="token property">"done"</span><span class="token operator">:</span> <span class="token string">")! For help, type "</span><span class="token punctuation">,</span>
|
|
<span class="token property">"userInteraction"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
|
|
<span class="token string">"Go to eula.txt for more info."</span>
|
|
<span class="token punctuation">]</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre></div><p>In the example block above, we define <code>done</code> as the entire line, or part of a line that indicates a server is done
|
|
starting, and is ready for players to join. When the Daemon sees this output, it will mark the server as <code>ON</code> rather
|
|
than <code>STARTING</code>. We can also define <code>userInteraction</code> as an array of lines that should indicate that the server
|
|
<em>did not crash</em>, but rather stopped because the user needs to perform some action.</p> <p>In this case, we define it as the line asking users to agree to the EULA. You are not required to have
|
|
<code>userInteraction</code> lines, however if you are going to leave it empty, it should still be defined with an empty array,
|
|
as shown below:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
|
|
<span class="token property">"done"</span><span class="token operator">:</span> <span class="token string">")! For help, type "</span><span class="token punctuation">,</span>
|
|
<span class="token property">"userInteraction"</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
|
<span class="token punctuation">}</span>
|
|
</code></pre></div><p>That concludes basic service option configuration.</p> <h2 id="copy-settings-from"><a href="#copy-settings-from" class="header-anchor">#</a> Copy Settings From</h2> <p>As mentioned above, there is a unique <code>Copy Settings From</code> dropdown when adding a new option. This gives you the
|
|
ability to, as the name suggests, copy settings defined above from a different option.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Copy_Settings_From.e3102cdd.png" alt=""></p> <p>In the panel, we use this to copy settings that remain the same between similar service options, such as many of the
|
|
Minecraft options.</p> <p>For example, lets look at the <code>Sponge (SpongeVanilla)</code> service option.</p> <p>As you can see, it as been told to copy settings from <code>Vanilla Minecraft</code>. This means that any of the fields that are
|
|
left blank will inherit from the assigned parent. We then define a specific <code>userInteraction</code> line that is different in
|
|
Sponge compared to Vanilla, but tell it that everything else should remain the same.</p> <p><em>Please note that <code>Copy Settings From</code> does not support nested copies, you can only copy from a single parent,
|
|
and that parent <strong>must not be copying from another option.</strong></em></p> <h2 id="egg-variables"><a href="#egg-variables" class="header-anchor">#</a> Egg Variables</h2> <p>One of the great parts of the Egg Variables is the ability to define specific variables that users and/or admins can
|
|
control to tweak different settings without letting users modify the startup command. To create new variables, or edit
|
|
existing ones, visit the new service option you created, and click the <code>Variables</code> tab at the top of the page. Lets take
|
|
a look at an example variable that we can create.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Variables.3962b264.png" alt=""></p> <div><p>The name and description are rather self-explanitory, so I'll skip down to the <code>Environment Variable</code> box. This should
|
|
be an Alpha-Numeric name with underscores, and should be uppercase. This will be the name of the environment variable
|
|
which can be accessed in the startup command as <code>{{WOOZLE_WOO}}</code>, within file modifications as <code>{{env.WOOZLE_WOO}}</code>, or
|
|
just <code>${WOOZLE_WOO}</code> in any shell scripts (it is passed through in the environment). We also define a default value for
|
|
this environment variable in this example, but it is not required to do so.</p></div><p>The next section is <code>Permissions</code>, which is a dropdown with two options: <code>Users Can View</code> and <code>Users Can Edit</code>.</p> <ul><li><code>Users Can View</code> — allows a user to view the field on the front-end, as well as the assigned value of that variable.
|
|
They will be able to see it replaced in their startup command.</li> <li><code>Users Can Edit</code> — allows a user to edit the value of the variable, for example the name of their <code>server.jar</code> file
|
|
if running Minecraft.</li></ul> <p>You should use caution here, even if you assign neither of the permissions it does not mean that the value will be
|
|
hidden. Crafty users will still be able to get the environment on their server. In most cases this is simply hiding
|
|
it from the user, and then used within the Dockerfile to perform actions, thus it is not important for the user to see.</p> <p>Finally, you will need to define some input rules to validate the value against. In this example, we use
|
|
<code>required|string|between:1,10</code>, which means the field is <code>required</code>, must be a <code>string</code>, and must be between <code>1</code> and
|
|
<code>10</code> characters in length. You can find <a href="https://laravel.com/docs/5.6/validation#available-validation-rules" target="_blank" rel="noopener noreferrer">all of the available validation rules<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>
|
|
on the Laravel website. You can also use ReGEX based validation by using the <code>regex:</code> rule flag. For example,
|
|
<a href="https://regex101.com/r/k4oEOn/1" target="_blank" rel="noopener noreferrer"><code>required|regex:/^([\w\d._-]+)(\.jar)$/</code><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> will require the field, and will match the
|
|
regex as any letters or numbers (<code>\w\d</code>) including underscore (<code>_</code>), periods (<code>.</code>), and dashes (<code>-</code>) ending in <code>.jar</code>.</p> <p>They will then be visible when managing the startup for a server in both the Admin CP and on the Front-End.</p> <p><img src="/assets/img/Pterodactyl_Create_New_Egg_Startup.b6e22637.png" alt=""></p></div> <div class="page-edit"><div class="edit-link"><a href="https://github.com/pterodactyl/documentation/edit/master/community/config/eggs/creating_a_custom_egg.md" target="_blank" rel="noopener noreferrer">Help us improve this page.</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <!----></div> <div class="page-nav"><p class="inner"></p> <div class="prev"><span>
|
|
←
|
|
<a href="/community/installation-guides/wings/ubuntu2004.html">Ubuntu 20.04</a></span></div> <div class="next"><span><a href="/community/config/eggs/creating_a_custom_image.html">Creating a Custom Docker Image</a>→
|
|
</span></div></div> </div></div><div class="global-ui"></div></div>
|
|
<script src="/assets/js/app.dad5e5c2.js" defer></script><script src="/assets/js/4.e413141f.js" defer></script><script src="/assets/js/1.ee4ff4e2.js" defer></script><script src="/assets/js/12.7214ee65.js" defer></script>
|
|
</body>
|
|
</html>
|