migrate to coreos

This commit is contained in:
Matthew Tran
2025-04-19 02:24:10 -07:00
parent 12039fb862
commit 8bd3def755
42 changed files with 752 additions and 579 deletions
-1
View File
@@ -1 +0,0 @@
worlds/
+9 -9
View File
@@ -3,21 +3,21 @@ FROM ubuntu:24.04
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y wget unzip python3 iproute2 dotnet-runtime-8.0
RUN groupadd -g 2002 me && useradd -u 2002 -g 2002 -m me
USER me
WORKDIR /home/me
WORKDIR /root
# from https://github.com/tModLoader/tModLoader/releases (currently v2025.02.3.2)
RUN wget https://github.com/tModLoader/tModLoader/releases/download/v2025.02.3.2/tModLoader.zip
# from https://github.com/tModLoader/tModLoader/releases (currently v2025.03.3.1)
RUN wget https://github.com/tModLoader/tModLoader/releases/download/v2025.03.3.1/tModLoader.zip
RUN unzip tModLoader.zip -d server && rm tModLoader.zip
RUN chmod +x server/start-tModLoaderServer.sh
RUN mkdir server/tModLoader-Logs && touch server/tModLoader-Logs/server.log
RUN echo "" > server/LaunchUtils/InstallDotNet.sh
COPY --chown=me:me entry.py ./
COPY --chown=me:me config.default ./config.txt
COPY --chown=me:me password.default ./password.txt
COPY --chown=me:me config.tx[t] password.tx[t] ./
COPY config.txt ./
COPY entry.py ./
COPY password.txt ./
CMD ["/usr/bin/python3", "/root/entry.py"]
# To add mods, install them on the client and copy over the .tmod files to mods/
# Then modify/create mods/enabled.json and add the desired mods to enable
+4 -7
View File
@@ -1,15 +1,12 @@
# world file
world=/home/me/worlds/master.wld
# default options if no world
autocreate=3
worldname=poopy
difficulty=2
# server options
motd=poopy
worldpath=/home/me/worlds
worldpath=/data/worlds
secure=1
# tmodloader options
modpath=/home/me/mods
modpath=/data/mods
# generated options
+3 -3
View File
@@ -27,13 +27,13 @@ class Runner:
logging.info(f"attempted connection from {addr}, starting server...")
# start server
with open("/home/me/password.txt", "r") as f:
with open("/root/password.txt", "r") as f:
password = f.read()
self.server = subprocess.Popen([
"/bin/bash",
"/home/me/server/start-tModLoaderServer.sh",
"/root/server/start-tModLoaderServer.sh",
"-nosteam",
"-config", "/home/me/config.txt",
"-config", "/root/config.txt",
"-pass", f"{password}",
], stdin=subprocess.PIPE, start_new_session=True)
while not self.started():
-1
View File
@@ -1 +0,0 @@
password