Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d2a742d68 | ||
|
|
5aef63b7f6 | ||
|
|
e15a911636 | ||
|
|
a25a9588d2 | ||
|
|
85b8f2e58f | ||
|
|
9a7610cd3d | ||
|
|
47f1c87452 | ||
|
|
175fa9372b | ||
|
|
c4375a68c4 | ||
|
|
d079417018 | ||
|
|
3cdb63f16a | ||
|
|
fc5f6b327a | ||
|
|
c8207d06ee | ||
|
|
f493215bc1 | ||
|
|
5285ad483c | ||
|
|
e34921a403 | ||
|
|
c3d35bd607 | ||
|
|
aeac09ca25 | ||
|
|
6ef01e33d1 | ||
|
|
a16a2bed48 |
17
.github/ISSUE_TEMPLATE/bugs.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/bugs.md
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
name: "\U0001F41B Bug Report"
|
||||||
|
about: Report an issue for an image
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Please fill out the information bellow and remove from the line up
|
||||||
|
If you just submit a bug with no info I will close out your bug.
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Panel Version: (version number)
|
||||||
|
Daemon Version: (version number)
|
||||||
|
Service: (minecraft/factorio/etc)
|
||||||
|
Docker Image:
|
||||||
|
Modified: (yes/no) (did you add or change things, this includes startup configs/install scripts/variables)
|
||||||
|
|
||||||
|
Errors that you are experiencing:
|
||||||
21
Dockerfile
21
Dockerfile
|
|
@ -1,21 +0,0 @@
|
||||||
FROM debian:bullseye-slim
|
|
||||||
|
|
||||||
LABEL author="Makaren0" maintainer="Makaffe@hotmail.com"
|
|
||||||
|
|
||||||
RUN apt update \
|
|
||||||
&& apt upgrade -y \
|
|
||||||
&& dpkg --add-architecture i386; apt update -y; apt install -y curl wget file tar bzip2 gzip unzip bsdmainutils python3 util-linux ca-certificates binutils bc jq tmux netcat lib32gcc-s1 lib32stdc++6 lib32z1\
|
|
||||||
&& apt install -y nodejs npm \
|
|
||||||
&& mkdir /node_modules \
|
|
||||||
&& npm install --prefix / ws \
|
|
||||||
&& useradd -d /home/container -m container
|
|
||||||
|
|
||||||
USER container
|
|
||||||
ENV USER=container HOME=/home/container
|
|
||||||
|
|
||||||
WORKDIR /home/container
|
|
||||||
|
|
||||||
COPY ./entrypoint.sh /entrypoint.sh
|
|
||||||
COPY ./wrapper.js /wrapper.js
|
|
||||||
|
|
||||||
CMD ["/bin/bash", "/entrypoint.sh"]
|
|
||||||
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2017 Pterodactyl
|
Copyright (c) 2017-2018 Pterodactyl Software
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
39
README.md
39
README.md
|
|
@ -1 +1,38 @@
|
||||||
# Rust
|
[](https://pterodactyl.io)
|
||||||
|
|
||||||
|
This repository contains generic [Docker](https://docker.com) images that are used by Pterodactyl Panel to run games. With the release of `v0.6.0` of our panel, we have moved to making the install process be a completely seperate part of the process, making it much easier to maintain a smaller set of Dockerfiles.
|
||||||
|
|
||||||
|
Our goal here is to maintain images that can run a wide variety of games in individual branches. For example, the [`java` branch](https://github.com/Pterodactyl/Containers/tree/java) is a standardized Docker container running on Alpine Linux that should support most all Minecraft based games, as well as java based games. We install all of the required dependencies that we ae aware of, but if you notice one missing, we welcome you to either raise an issue in here, or submit a PR to add it.
|
||||||
|
|
||||||
|
The `entrypoint.sh` files **should not do any application installing**, and exist solely to parse startup commands passed to the container, and then run them, with a pause at the beginning to allow the Daemon time to boot and attach to the container.
|
||||||
|
|
||||||
|
## Current Images
|
||||||
|
Every branch, except master, is a different image. For a current list of images, check the branch list [here](https://github.com/Pterodactyl/Containers/branches/active).
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
We welcome any contributions you might have. Please follow our formatting for Dockerfiles, which involves minimizing the number of layers, as well as the size of the container. If possible, please stick to Alpine Linux based images, however we do make use of `ubuntu:16.04` in the [`source` branch](https://github.com/Pterodactyl/Containers/tree/source) due to Source Engine limitations, and reducing the conflicts that might arise.
|
||||||
|
|
||||||
|
## License
|
||||||
|
```
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2017-2018 Pterodactyl Software
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
cd /home/container
|
|
||||||
|
|
||||||
# Make internal Docker IP address available to processes.
|
|
||||||
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
|
|
||||||
|
|
||||||
# Update Rust Server
|
|
||||||
./steamcmd/steamcmd.sh +force_install_dir /home/container +login anonymous +app_update 258550 +quit
|
|
||||||
|
|
||||||
# Replace Startup Variables
|
|
||||||
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
|
|
||||||
echo ":/home/container$ ${MODIFIED_STARTUP}"
|
|
||||||
|
|
||||||
# OxideMod has been replaced with uMod
|
|
||||||
if [ -f OXIDE_FLAG ] || [ "${OXIDE}" = 1 ] || [ "${UMOD}" = 1 ]; then
|
|
||||||
echo "Updating uMod..."
|
|
||||||
curl -sSL "https://github.com/OxideMod/Oxide.Rust/releases/latest/download/Oxide.Rust-linux.zip" > umod.zip
|
|
||||||
unzip -o -q umod.zip
|
|
||||||
rm umod.zip
|
|
||||||
echo "Done updating uMod!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Fix for Rust not starting
|
|
||||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)
|
|
||||||
|
|
||||||
# Run the Server
|
|
||||||
node /wrapper.js "${MODIFIED_STARTUP}"
|
|
||||||
139
wrapper.js
139
wrapper.js
|
|
@ -1,139 +0,0 @@
|
||||||
#!/usr/bin/env node
|
|
||||||
|
|
||||||
var startupCmd = "";
|
|
||||||
const fs = require("fs");
|
|
||||||
fs.writeFile("latest.log", "", (err) => {
|
|
||||||
if (err) console.log("Callback error in appendFile:" + err);
|
|
||||||
});
|
|
||||||
|
|
||||||
var args = process.argv.splice(process.execArgv.length + 2);
|
|
||||||
for (var i = 0; i < args.length; i++) {
|
|
||||||
if (i === args.length - 1) {
|
|
||||||
startupCmd += args[i];
|
|
||||||
} else {
|
|
||||||
startupCmd += args[i] + " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (startupCmd.length < 1) {
|
|
||||||
console.log("Error: Please specify a startup command.");
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
const seenPercentage = {};
|
|
||||||
function filter(data) {
|
|
||||||
const str = data.toString();
|
|
||||||
if (str.startsWith("Loading Prefab Bundle ")) { // Rust seems to spam the same percentage, so filter out any duplicates.
|
|
||||||
const percentage = str.substr("Loading Prefab Bundle ".length);
|
|
||||||
if (seenPercentage[percentage]) return;
|
|
||||||
|
|
||||||
seenPercentage[percentage] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
var exec = require("child_process").exec;
|
|
||||||
console.log("Starting Rust...");
|
|
||||||
|
|
||||||
var exited = false;
|
|
||||||
const gameProcess = exec(startupCmd);
|
|
||||||
gameProcess.stdout.on('data', filter);
|
|
||||||
gameProcess.stderr.on('data', filter);
|
|
||||||
gameProcess.on('exit', function (code, signal) {
|
|
||||||
exited = true;
|
|
||||||
|
|
||||||
if (code) {
|
|
||||||
console.log("Main game process exited with code " + code);
|
|
||||||
// process.exit(code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function initialListener(data) {
|
|
||||||
const command = data.toString().trim();
|
|
||||||
if (command === 'quit') {
|
|
||||||
gameProcess.kill('SIGTERM');
|
|
||||||
} else {
|
|
||||||
console.log('Unable to run "' + command + '" due to RCON not being connected yet.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
process.stdin.resume();
|
|
||||||
process.stdin.setEncoding("utf8");
|
|
||||||
process.stdin.on('data', initialListener);
|
|
||||||
|
|
||||||
process.on('exit', function(code) {
|
|
||||||
if (exited) return;
|
|
||||||
|
|
||||||
console.log("Received request to stop the process, stopping the game...");
|
|
||||||
gameProcess.kill('SIGTERM');
|
|
||||||
});
|
|
||||||
|
|
||||||
var waiting = true;
|
|
||||||
var poll = function( ) {
|
|
||||||
function createPacket(command) {
|
|
||||||
var packet = {
|
|
||||||
Identifier: -1,
|
|
||||||
Message: command,
|
|
||||||
Name: "WebRcon"
|
|
||||||
};
|
|
||||||
return JSON.stringify(packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
var serverHostname = process.env.RCON_IP ? process.env.RCON_IP : "localhost";
|
|
||||||
var serverPort = process.env.RCON_PORT;
|
|
||||||
var serverPassword = process.env.RCON_PASS;
|
|
||||||
var WebSocket = require("ws");
|
|
||||||
var ws = new WebSocket("ws://" + serverHostname + ":" + serverPort + "/" + serverPassword);
|
|
||||||
|
|
||||||
ws.on("open", function open() {
|
|
||||||
console.log("Connected to RCON. Please wait until the server status switches to \"Running\".");
|
|
||||||
waiting = false;
|
|
||||||
|
|
||||||
// Hack to fix broken console output
|
|
||||||
ws.send(createPacket('status'));
|
|
||||||
|
|
||||||
process.stdin.removeListener('data', initialListener);
|
|
||||||
gameProcess.stdout.removeListener('data', filter);
|
|
||||||
gameProcess.stderr.removeListener('data', filter);
|
|
||||||
process.stdin.on('data', function (text) {
|
|
||||||
ws.send(createPacket(text));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
ws.on("message", function(data, flags) {
|
|
||||||
try {
|
|
||||||
var json = JSON.parse(data);
|
|
||||||
if (json !== undefined) {
|
|
||||||
if (json.Message !== undefined && json.Message.length > 0) {
|
|
||||||
console.log(json.Message);
|
|
||||||
const fs = require("fs");
|
|
||||||
fs.appendFile("latest.log", "\n" + json.Message, (err) => {
|
|
||||||
if (err) console.log("Callback error in appendFile:"+err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.log("Error: Invalid JSON received");
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
if (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ws.on("error", function(err) {
|
|
||||||
waiting = true;
|
|
||||||
console.log("Waiting for RCON to come up...");
|
|
||||||
setTimeout(poll, 5000);
|
|
||||||
});
|
|
||||||
|
|
||||||
ws.on("close", function() {
|
|
||||||
if (!waiting) {
|
|
||||||
console.log("Connection to server closed.");
|
|
||||||
|
|
||||||
exited = true;
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
poll();
|
|
||||||
Loading…
Reference in New Issue
Block a user