commit 3c50f226bef3e5a414decec7077ad9748c759b27 Author: ad3m3r5 Date: Sat Oct 22 16:05:11 2022 -0400 initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..47bed45 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM ad3m3r5/tiltedevolution-builder:latest as builder + +ARG REPO=https://github.com/tiltedphoques/TiltedEvolution.git +ARG BRANCH=master + +WORKDIR /home/builder + +ENV XMAKE_ROOT=y + +RUN git clone --recursive -b ${BRANCH} ${REPO} ./str +## resolve issues with std::string +RUN if grep -Fxqv "#include " /home/builder/str/Libraries/TiltedConnect/Code/connect/include/Client.hpp ; then sed -i -e '3i#include \' /home/builder/str/Libraries/TiltedConnect/Code/connect/include/Client.hpp ; fi +RUN cd str && xmake config -m release -y && xmake -y && xmake install -o package -y + +FROM alpine:3.16 + +COPY --from=builder /home/builder/str/package/lib/libSTServer.so /home/server/libSTServer.so +COPY --from=builder /home/builder/str/package/bin/crashpad_handler /home/server/crashpad_handler +COPY --from=builder /home/builder/str/package/bin/SkyrimTogetherServer /home/server/SkyrimTogetherServer + +COPY --from=builder /usr/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6 +COPY --from=builder /usr/lib/libgcc_s.so.1 /usr/lib/libgcc_s.so.1 + +WORKDIR /home/server +ENTRYPOINT ["./SkyrimTogetherServer"] + +EXPOSE 10578/udp \ No newline at end of file diff --git a/Dockerfile.builder b/Dockerfile.builder new file mode 100644 index 0000000..4cecfeb --- /dev/null +++ b/Dockerfile.builder @@ -0,0 +1,26 @@ +FROM alpine:3.16 + +WORKDIR /home/builder + +RUN apk add --no-cache \ + cmake \ + unzip \ + git \ + gcc \ + g++ \ + alpine-sdk \ + build-base \ + ca-certificates \ + curl \ + linux-headers \ + bash \ + p7zip \ + perl \ + xz \ + bsd-compat-headers + +RUN git clone --recursive https://github.com/xmake-io/xmake.git ./xmake && \ + cd xmake && \ + make build && \ + make install && \ + rm -rf /home/builder/xmake \ No newline at end of file diff --git a/Dockerfile.pterodactyl b/Dockerfile.pterodactyl new file mode 100644 index 0000000..e902546 --- /dev/null +++ b/Dockerfile.pterodactyl @@ -0,0 +1,15 @@ +FROM ad3m3r5/tiltedevolution-server:latest + +RUN apk add --no-cache ca-certificates tzdata openssl && \ + adduser --disabled-password --home /home/container container && \ + chown -R container:container /home/server + +USER container +ENV USER=container HOME=/home/container + +WORKDIR /home/container + +COPY ./entrypoint.sh /entrypoint.sh + +ENTRYPOINT [] +CMD ["/bin/ash", "/entrypoint.sh"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5675c6b --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# Building + * `docker build -t tiltedevolution-builder:latest -f Dockerfile.builder .` + * `docker build -t tiltedevolution-server:latest -f Dockerfile .` + * `docker build -t tiltedevolution-pterodactyl:latest -f Dockerfile.pterodactyl .` + +# Running +The original wiki information should still be used: +* https://wiki.tiltedphoques.com/tilted-online/guides/server-guide/linux-setup/docker-setup + + +# Pterodactyl + +* Download the `egg-tilted-evolution.json` egg definition + +* Adding the Nest & Egg + * admin > "Nests" > "Create New" + * Name: "Skyrim" + * "Save" + * admin > "Nests" > "Import Egg" + * Egg File: "egg-tilted-evolution.json" + * Associated Nest: "Skyrim" + +* Creating a Server + * admin > "Servers" > "Create New" + * Server Name: "Skyrim Together Reborn" + * Server Owner: *desired user* + * Memory: *desired memory allocation* + * Disk: *desired disk space* + * Nest: "Skyrim" + * Egg: "Tilted Evolution" + * "Create Server" + +* Configuring the Server + * Using the CLI: + * Can be done while the server is running using the built in CLI commands. + * This config will be saved to the `STServer.ini` file upon shutdown. + * Using the `STServer.ini`: + * Can ONLY be done while the server is shutdown + * If done while running, the config will be overwritten with the running config \ No newline at end of file diff --git a/egg-tilted-evolution.json b/egg-tilted-evolution.json new file mode 100644 index 0000000..da8569c --- /dev/null +++ b/egg-tilted-evolution.json @@ -0,0 +1,31 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v2", + "update_url": null + }, + "exported_at": "2022-10-22T15:45:53-04:00", + "name": "Tilted Evolution", + "author": "aaron@aarondemers.com", + "description": null, + "features": null, + "docker_images": { + "ad3m3r5\/tiltedevolution-pterodactyl:latest": "ad3m3r5\/tiltedevolution-pterodactyl:latest" + }, + "file_denylist": [], + "startup": "\/home\/server\/SkyrimTogetherServer", + "config": { + "files": "{}", + "startup": "{\r\n \"done\": \"Server started\"\r\n}", + "logs": "{}", + "stop": "\/quit" + }, + "scripts": { + "installation": { + "script": null, + "container": "alpine:3.16", + "entrypoint": "ash" + } + }, + "variables": [] +} \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..b08d707 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/ash + +cd /home/container + +# Replace Startup Variables +MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +${MODIFIED_STARTUP} \ No newline at end of file