Compare commits

..

59 Commits
master ... rust

Author SHA1 Message Date
fca03c292e hotfix 2023-01-19 18:26:58 +01:00
3462040ad9 fix again nodejs version 2023-01-19 18:20:35 +01:00
354f663603 fix nodejs version to current 2023-01-19 18:08:41 +01:00
2a8907b29a Updated nodejs Node.js 12.x 2023-01-19 18:03:58 +01:00
80144d49da Added dependencies for debian 11 2023-01-19 17:55:37 +01:00
d79c62dbd2 debian bullseye based image 2023-01-19 17:46:34 +01:00
4d1bc7c868 updated 2023-01-19 17:09:15 +01:00
2d043b0372 Added unzip to properly works on custom servers 2023-01-19 11:51:52 +01:00
recon
b09850a772
fix(rust): use direct github releases link for umod (#86)
Umod being under attack with Cloudflare causes a failed install for every single server that's running Rust, thus breaking them. Use direct Github release instead, which the old link was a redirect to.
2022-02-03 22:04:12 +02:00
softwarenoob
3b845a7480
fix: force_install_dir error
SteamCMD now complains when trying to login before providing install dir `Please use force_install_dir before logon!`
2021-11-21 20:19:18 +02:00
Alex
ec82494db4
fix(image): more user-friendly Rust RCON log message (#82)
* fix(image): more user-friendly Rust RCON log message
2021-08-27 05:28:12 +03:00
Michael (Parker) Parker
ccce678a51
Merge pull request #76 from Software-Noob/patch-1
Resolve Rust container timezone issues
2021-03-24 22:21:57 -04:00
Alex
698b113646
install tzdata 2021-03-25 03:10:52 +02:00
Michael (Parker) Parker
49e28e6c1a
Merge pull request #63 from Philipp-Kraft/patch-1
Fix steamcmd path
2020-11-10 11:09:29 -05:00
Philipp Kraft
1c59b3d862
Fix steamcmd path 2020-11-06 21:08:37 +01:00
Dane Everitt
ce52bd57c0
Merge pull request #58 from jackalhosting/rust
Configurable RCON IP
2020-04-16 09:20:48 -07:00
Kieran South
41388c0332 Configurable RCON IP for servers on the 'host' network where 'localhost' is not actually the socket to be listening to 2020-04-16 16:34:37 +01:00
Michael (Parker) Parker
d8a6525381
Merge pull request #56 from TrixterTheTux/rust
Fix Rust server crashing after running for couple of hours
2020-02-07 07:47:04 -08:00
Stepan Fedotov
224758d24a Fix Rust server crashing after running for couple of hours 2020-02-07 11:06:58 +02:00
Michael (Parker) Parker
061f20e200
Merge pull request #55 from TrixterTheTux/rust
Improve the rust image's wrapper
2020-02-06 10:52:02 -05:00
Stepan Fedotov
7b6869070a Fix duplicate console output after rcon is connected 2020-01-17 10:08:46 +02:00
Stepan Fedotov
b971077432 Support for graceful shutdown, filter out some spammy lines 2020-01-14 10:57:51 +02:00
Stepan Fedotov
d72405f642 Redirect rust's stdout and stderr to the console 2020-01-13 19:34:39 +02:00
Dane Everitt
bdc6b45f53
Merge pull request #53 from parkervcp/game/rust
Fix rust startup issue with rcon
2019-11-12 13:15:32 -08:00
Michael (Parker) Parker
af2517a865
Merge pull request #36 from iamkubi/console_fix
Fix broken console output and startup detection
2019-11-12 10:48:18 -05:00
Ryan Kubiak
c9e65b2cbf Fix broken console output and startup detection
Sends a status command to RCON once it has connected.
2019-11-11 19:28:57 -08:00
Dane Everitt
6a20d5394c
Merge pull request #49 from parkervcp/game/rust
Update the rust image
2019-09-10 09:27:06 -07:00
Dane Everitt
d3423aeb1b
Merge pull request #47 from MissFox0810/patch-1
Update Entrypoint for linux umod rust
2019-09-08 14:56:58 -07:00
Michael Parker
899a560f49 update wrapper to fix json error 2019-09-08 10:19:22 -04:00
Michael Parker
1865f4da7d fix for first deprecated message
This should fix the one deprecated message
2019-09-08 09:58:25 -04:00
Michael (Parker) Parker
d877ff283c
Merge pull request #29 from MissFox0810/patch-2
Add a callback handler to wrapper
2019-09-07 10:30:58 -04:00
MissFox0810
155bc850b7
Add a callback handler to wrapper
Added a callback handler to the appendfile.
2019-09-07 03:15:39 +01:00
Michael Parker
1e81a38ab4 actually install npm because reasons 2019-09-06 17:02:36 -04:00
Michael Parker
9f7febc121 drop to nodejs 6 again 2019-09-06 16:24:52 -04:00
Michael (Parker) Parker
d7c6028e91
set image maintainer to a label tag 2019-09-06 11:27:09 -04:00
Michael (Parker) Parker
3866e16c9c
updating to newer base images and updating the entrypoint 2019-09-06 11:25:47 -04:00
MissFox0810
5455f6a078
Update Entrypoint for linux umod rust
Umod has split the builds into windows and linux builds now, this url update changes the old windows url to the new linux url as documented on https://umod.org/games/rust
2019-09-06 16:18:50 +01:00
Michael (Parker) Parker
a1c29aa2e2
Merge pull request #36 from MissFox0810/patch-1
Add libgdiplus package
2019-01-04 08:57:24 -05:00
MissFox0810
6e0f62258e
Add libgdiplus package
add libgdiplus to the apt install, to fix issues with certain uMod plugins that require it for image manulption.
2019-01-04 11:13:01 +00:00
Dane Everitt
a5830338b4
Merge pull request #26 from tenten8401/patch-1
It's called uMod now apparently...
2018-09-18 21:58:37 -07:00
Isaac A
80cdbdc8de
Update entrypoint.sh 2018-09-10 17:23:08 -04:00
Isaac A
8a30b35c74
Copied and pasted the previous commit's file 2018-09-10 17:21:53 -04:00
Isaac A
c70ace1cee
Add depreciation notice, new variable, and rename zip file 2018-09-10 17:19:14 -04:00
Isaac A
6f9613743f
It's called uMod now apparently... 2018-09-10 17:04:19 -04:00
Dane Everitt
bde1047915
remove sleep 2018-01-06 15:14:50 -06:00
Dane Everitt
cb1b20e8a5
Merge pull request #8 from tenten8401/rust
Change Oxide logic
2017-11-18 16:30:53 -05:00
Unknown
fbeebd6e7b Change Oxide logic 2017-11-05 21:33:35 -05:00
Dane Everitt
f74368500a
Fix missing iproute2 dependency 2017-10-22 12:26:18 -05:00
Dane Everitt
52e1365df6 Merge pull request #7 from tenten8401/patch-1
Fix Oxide Link
2017-10-20 10:08:57 -04:00
tenten8401
2290c4a68a Fix Oxide Link 2017-10-20 09:14:42 -04:00
Dane Everitt
07dfffcc4e
Cleanup Dockerfile 2017-10-09 23:08:10 -05:00
Dane Everitt
4e55d20297
add support for internal IP
Pterodactyl/Panel#613
2017-10-09 23:04:54 -05:00
Jakob
8b54797eba Merge pull request #3 from tenten8401/rust
Add Rust container
2017-07-13 17:48:40 +02:00
Unknown
1bef2974d4 Silently unzip & download 2017-07-10 10:17:23 -04:00
Unknown
5961d67174 Add unzip to Dockerfile 2017-07-09 22:25:53 -04:00
Unknown
2e9c27f36a A way to do it without variables
Found in the OxideMod example start script. Needs testing, but I'd imagine it works.
2017-07-09 21:59:36 -04:00
Unknown
065be5e299 Detect if OXIDE_FLAG exists, and update OxideMod if it does. 2017-07-09 21:52:30 -04:00
Unknown
41e8bf3185 Install 'ws' in Dockerfile 2017-07-09 21:17:44 -04:00
Unknown
9874226646 Add Rust container 2017-07-06 23:40:39 -04:00
6 changed files with 189 additions and 56 deletions

View File

@ -1,17 +0,0 @@
---
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 Normal file
View File

@ -0,0 +1,21 @@
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"]

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017-2018 Pterodactyl Software
Copyright (c) 2017 Pterodactyl
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,38 +1 @@
[![Logo Image](https://cdn.pterodactyl.io/logos/Banner%20Logo%20Black@2x.png)](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.
```
# Rust

27
entrypoint.sh Normal file
View File

@ -0,0 +1,27 @@
#!/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 Normal file
View File

@ -0,0 +1,139 @@
#!/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();