diff --git a/.github/workflows/games.yml b/.github/workflows/games.yml index 3fded8b..2421878 100644 --- a/.github/workflows/games.yml +++ b/.github/workflows/games.yml @@ -22,6 +22,7 @@ jobs: fail-fast: false matrix: game: + - aloft #- foundry - interstellarrift - quakeliveqlx diff --git a/games/aloft/Dockerfile b/games/aloft/Dockerfile new file mode 100644 index 0000000..c0f6c7e --- /dev/null +++ b/games/aloft/Dockerfile @@ -0,0 +1,130 @@ +FROM ubuntu:24.04 + +LABEL org.opencontainers.image.authors="Torsten Widmann - gOOvER - info@goover.de" +LABEL org.opencontainers.image.source="https://github.com/gOOvER/own-pterodactyl-images" +LABEL org.opencontainers.image.description="Docker image for Pelican, Jexactyl & Pterodactyl" +LABEL org.opencontainers.image.licenses=AGPL-3.0-or-later + + +## install required packages +ARG DEBIAN_FRONTEND=noninteractive +RUN dpkg --add-architecture i386 +RUN apt update +RUN apt -y upgrade +RUN apt install -y --no-install-recommends \ + apt-transport-https \ + binutils \ + ca-certificates \ + cabextract \ + curl \ + ffmpeg \ + g++ \ + gcc \ + gcc-11-base \ + gdb \ + git \ + gnupg2 \ + gnutls-bin \ + icu-devtools \ + iproute2 \ + locales \ + net-tools \ + netcat-openbsd \ + numactl \ + procps \ + python3 \ + rapidjson-dev \ + software-properties-common \ + sqlite3 \ + tar \ + telnet \ + tini \ + tzdata \ + unzip \ + wget \ + winbind \ + xauth \ + xvfb \ + xz-utils \ + zip \ + libatomic1 \ + libc++-dev \ + libc6 \ + libduktape207 \ + libevent-dev \ + libfluidsynth3 \ + libfontconfig \ + libgcc1 \ + libicu72 \ + liblua5.4-0 \ + liblzo2-2 \ + libmariadbclient-dev-compat \ + libncurses6:i386 \ + libntlm0 \ + libprotobuf32 \ + libsdl1.2debian \ + libsdl2-2.0-0 \ + libsdl2-2.0-0:i386 \ + libsqlite3-dev \ + libstdc++6 \ + libunwind8 \ + libz-dev \ + libzip4 + +RUN rm -rf /var/lib/apt/lists/* + +# Install wine and with recommends +RUN mkdir -pm755 /etc/apt/keyrings +RUN wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key +RUN wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources +RUN apt update +RUN apt install --install-recommends winehq-staging winbind cabextract -y + +# Install Powershell +RUN wget -q https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb +RUN dpkg -i packages-microsoft-prod.deb +RUN rm packages-microsoft-prod.deb +RUN apt update +RUN apt install -y powershell + +# Set up Winetricks +RUN wget -q -O /usr/sbin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks +RUN chmod +x /usr/sbin/winetricks + +## install rcon +RUN cd /tmp/ \ + && curl -sSL https://github.com/gorcon/rcon-cli/releases/download/v0.10.3/rcon-0.10.3-amd64_linux.tar.gz > rcon.tar.gz \ + && tar xvf rcon.tar.gz \ + && mv rcon-0.10.3-amd64_linux/rcon /usr/local/bin/ + +# Setup ENVs +ENV HOME=/home/container +ENV WINEPREFIX=/home/container/.wine +ENV WINEDLLOVERRIDES="mscoree,mshtml=" +ENV DISPLAY=:0 +ENV DISPLAY_WIDTH=1024 +ENV DISPLAY_HEIGHT=768 +ENV DISPLAY_DEPTH=16 + +# Set the locale +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ + locale-gen +ENV LANG=en_US.UTF-8 +ENV LANGUAGE=en_US:en +ENV LC_ALL=en_US.UTF-8 + +RUN bash -c 'echo "vm.max_map_count = 16777216" > /etc/sysctl.d/20-max_map_count.conf' + +## Setup user and working directory +RUN useradd -m -d /home/container -s /bin/bash container +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +# Sets the default stop signal as wings can (currently) only send a kill or generic stop +STOPSIGNAL SIGINT + +COPY --chown=container:container ../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/games/aloft/entrypoint.sh b/games/aloft/entrypoint.sh new file mode 100644 index 0000000..628206b --- /dev/null +++ b/games/aloft/entrypoint.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +clear +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' + + +# Wait for the container to fully initialize +sleep 1 + +# Default the TZ environment variable to UTC. +TZ=${TZ:-UTC} +export TZ + +# Information output +echo -e "${BLUE}---------------------------------------------------------------------${NC}" +echo -e "${YELLOW}Wine Image from gOOvER${NC}" +echo -e "${RED}THIS IMAGE IS LICENSED UNDER AGPLv3${NC}" +echo -e "${BLUE}---------------------------------------------------------------------${NC}" +echo -e "${YELLOW}echo -e "${YELLOW}Linux Distribution: ${RED} $(. /etc/os-release ; echo $PRETTY_NAME)${NC}" $(cat /etc/debian_version)${NC}" +echo -e "${YELLOW}Current timezone: $(cat /etc/timezone)${NC}" +echo -e "${YELLOW}Wine Version:${NC} ${RED} $(wine --version)${NC}" +echo -e "${BLUE}---------------------------------------------------------------------${NC}" + +# Set environment variable that holds the Internal Docker IP +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Switch to the container's working directory +cd /home/container || exit 1 + +## just in case someone removed the defaults. +if [ "${STEAM_USER}" == "" ]; then + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + echo -e "${YELLOW}Steam user is not set.\n ${NC}" + echo -e "${YELLOW}Using anonymous user.\n ${NC}" + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + STEAM_USER=anonymous + STEAM_PASS="" + STEAM_AUTH="" +else + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + echo -e "${YELLOW}user set to ${STEAM_USER} ${NC}" + echo -e "${BLUE}---------------------------------------------------------------------${NC}" +fi + +## if auto_update is not set or to 1 update +if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then + if [ -f /home/container/DepotDownloader ]; then + ./DepotDownloader -dir /home/container -username ${STEAM_USER} -password ${STEAM_PASS} -remember-password $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '-os windows' ) -app ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" ) + mkdir -p /home/container/.steam/sdk64 + ./DepotDownloader -dir /home/container/.steam/sdk64 -os windows -app 1007 + chmod +x $HOME/* + + else + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) $( [[ "${STEAM_SDK}" == "1" ]] && printf %s '+app_update 1007' ) +app_update ${STEAM_APPID} $( [[ -z ${STEAM_BETAID} ]] || printf %s "-beta ${STEAM_BETAID}" ) $( [[ -z ${STEAM_BETAPASS} ]] || printf %s "-betapassword ${STEAM_BETAPASS}" ) ${INSTALL_FLAGS} $( [[ "${VALIDATE}" == "1" ]] && printf %s 'validate' ) +quit + fi +else + echo -e "${BLUE}---------------------------------------------------------------${NC}" + echo -e "${YELLOW}Not updating game server as auto update was set to 0. Starting Server${NC}" + echo -e "${BLUE}---------------------------------------------------------------${NC}" +fi + +if [[ $XVFB == 1 ]]; then + Xvfb :0 -screen 0 ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT}x${DISPLAY_DEPTH} & +fi + +# Install necessary to run packages +echo -e "${BLUE}---------------------------------------------------------------------${NC}" +echo -e "${RED}First launch will throw some errors. Ignore them${NC}" +echo -e "${BLUE}---------------------------------------------------------------------${NC}" +mkdir -p $WINEPREFIX + +# Check if wine-gecko required and install it if so +if [[ $WINETRICKS_RUN =~ gecko ]]; then + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + echo -e "${YELLOW}Installing Wine Gecko${NC}" + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + WINETRICKS_RUN=${WINETRICKS_RUN/gecko} + + if [ ! -f "$WINEPREFIX/gecko_x86.msi" ]; then + wget -q -O $WINEPREFIX/gecko_x86.msi http://dl.winehq.org/wine/wine-gecko/2.47.4/wine_gecko-2.47.4-x86.msi + fi + + if [ ! -f "$WINEPREFIX/gecko_x86_64.msi" ]; then + wget -q -O $WINEPREFIX/gecko_x86_64.msi http://dl.winehq.org/wine/wine-gecko/2.47.4/wine_gecko-2.47.4-x86_64.msi + fi + + wine msiexec /i $WINEPREFIX/gecko_x86.msi /qn /quiet /norestart /log $WINEPREFIX/gecko_x86_install.log + wine msiexec /i $WINEPREFIX/gecko_x86_64.msi /qn /quiet /norestart /log $WINEPREFIX/gecko_x86_64_install.log +fi + +# Check if wine-mono required and install it if so +if [[ $WINETRICKS_RUN =~ mono ]]; then + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + echo -e "${YELLOW}Installing Wine Mono${NC}" + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + WINETRICKS_RUN=${WINETRICKS_RUN/mono} + + if [ ! -f "$WINEPREFIX/mono.msi" ]; then + wget -q -O $WINEPREFIX/mono.msi https://dl.winehq.org/wine/wine-mono/9.4.0/wine-mono-9.4.0-x86.msi + fi + + wine msiexec /i $WINEPREFIX/mono.msi /qn /quiet /norestart /log $WINEPREFIX/mono_install.log +fi + +# List and install other packages +for trick in $WINETRICKS_RUN; do + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + echo -e "${YELLOW}Installing: ${NC} ${GREEN} $trick ${NC}" + echo -e "${BLUE}---------------------------------------------------------------------${NC}" + winetricks -q $trick +done + +# Replace Startup Variables +MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP}