initial commit
This commit is contained in:
commit
050097ebd5
|
@ -0,0 +1,6 @@
|
|||
.drone.yml
|
||||
.git
|
||||
.gitea
|
||||
.gitignore
|
||||
LICENSE.md
|
||||
README.md
|
|
@ -0,0 +1,61 @@
|
|||
name: Build Container Image
|
||||
run-name: ${{ gitea.actor }} pushed to ${{ gitea.repository }}:${{ gitea.ref_name }}
|
||||
on: [push, workflow_call]
|
||||
jobs:
|
||||
build_amd64:
|
||||
if: gitea.repository_owner == 'NephNET' && !contains(github.event.head_commit.message, '#noci')
|
||||
runs-on: nephnet-amd64
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Docker Build
|
||||
run: docker build --pull -t code.nephatrine.net/nephnet/starbound-scmd:${{ gitea.ref_name }} ${{ gitea.workspace }}
|
||||
- name: Docker Login
|
||||
uses: actions/docker-login@v2
|
||||
with:
|
||||
registry: code.nephatrine.net
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.PACKAGER_TOKEN }}
|
||||
- name: Docker Push
|
||||
run: docker push code.nephatrine.net/nephnet/starbound-scmd:${{ gitea.ref_name }}
|
||||
- name: Notify Discord
|
||||
uses: actions/discord-status@v1
|
||||
if: always()
|
||||
with:
|
||||
title: "Container Build (X86_64)"
|
||||
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
|
||||
publish_amd64:
|
||||
if: gitea.ref_name == 'master'
|
||||
needs: [build_amd64]
|
||||
runs-on: nephnet-amd64
|
||||
steps:
|
||||
- name: Check Base Image
|
||||
if: github.event_name != 'push'
|
||||
uses: actions/docker-base-image-check@v1.2.1
|
||||
id: checkbase
|
||||
with:
|
||||
base-image: cm2network/steamcmd:root
|
||||
image: nephatrine/starbound-scmd:latest
|
||||
- name: Docker Login
|
||||
uses: actions/docker-login@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASS }}
|
||||
- name: Docker Push
|
||||
run: |
|
||||
docker tag code.nephatrine.net/nephnet/starbound-scmd:master nephatrine/starbound-scmd:latest
|
||||
docker push nephatrine/starbound-scmd:latest
|
||||
- name: Docker Describe
|
||||
uses: actions/dockerhub-update-description@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USER }}
|
||||
password: ${{ secrets.DOCKER_PASS }}
|
||||
repository: nephatrine/starbound-scmd
|
||||
- name: Notify Discord
|
||||
if: github.event_name == 'push' || steps.checkbase.outputs.needs-updating == 'true'
|
||||
uses: actions/discord-status@v1
|
||||
with:
|
||||
title: "DockerHub: drone-ci"
|
||||
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/starbound-scmd/general).\nPull `nephatrine/starbound-scmd:latest` for the newest image."
|
||||
nodetail: true
|
||||
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
|
|
@ -0,0 +1,3 @@
|
|||
sign-build.sh
|
||||
test-build.sh
|
||||
fix-perms.sh
|
|
@ -0,0 +1,18 @@
|
|||
FROM cm2network/steamcmd:root
|
||||
LABEL maintainer="nephatrine@gmail.com"
|
||||
|
||||
ENV STEAMAPPID=211820 STEAMAPP=starbound
|
||||
ENV STEAMAPPDIR=/opt/${STEAMAPP}-dedicated
|
||||
|
||||
COPY override /
|
||||
|
||||
RUN echo "====== COMPILE REGISTRY ======" \
|
||||
&& mkdir -p ${STEAMAPPDIR} \
|
||||
&& chown ${USER}:${USER} ${STEAMAPPDIR} \
|
||||
&& chmod -R 755 /usr/local/bin
|
||||
|
||||
USER ${USER}
|
||||
WORKDIR ${HOMEDIR}
|
||||
CMD ["/usr/local/bin/starbound.sh"]
|
||||
|
||||
EXPOSE 21025/tcp 21026/udp 21027/udp
|
|
@ -0,0 +1,13 @@
|
|||
Copyright © 2023 Daniel Wolf <<nephatrine@gmail.com>>
|
||||
|
||||
**Permission to use, copy, modify, and distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.**
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@ -0,0 +1,50 @@
|
|||
[Git](https://code.nephatrine.net/NephNET/docker-starbound-scmd/src/branch/master) |
|
||||
[Docker](https://hub.docker.com/r/nephatrine/starbound-scmd/) |
|
||||
[unRAID](https://code.nephatrine.net/nephatrine/unraid-containers)
|
||||
|
||||
# Starbound Server
|
||||
|
||||
This docker image contains a Starbound server to self-host your own game.
|
||||
|
||||
You can spin up a quick temporary test container like this:
|
||||
|
||||
~~~
|
||||
docker run --rm -p 21025:21025 -it nephatrine/starbound-scmd:latest /bin/bash
|
||||
~~~
|
||||
|
||||
The installation uses **SteamCMD** and so will need your Steam credentials and
|
||||
SteamGuard 2FA. Due to this, it cannot be automated. On startup, if not
|
||||
installed yet the startup script will sleep in a loop waiting for the
|
||||
installation. You can perform the installation by going into the container
|
||||
console and running `starbound-install.sh`. This will install/update Starbound
|
||||
and interactively have you log in. Any mods listed in the `workshop.txt` file
|
||||
in the game directory will be installed at this time as well.
|
||||
|
||||
Alternatively, you can manually copy of the Linux game files and create a
|
||||
`.ready` file in the game directory.
|
||||
|
||||
## Persistent Mounts
|
||||
|
||||
You can provide a persistent mountpoint using the ``-v /host/path:/container/path``
|
||||
syntax. These mountpoints are intended to house important configuration files,
|
||||
logs, and application state (e.g. databases) so they are not lost on image
|
||||
update.
|
||||
|
||||
- ``/opt/starbound-dedicated``: Steam Game Data.
|
||||
|
||||
You can perform some basic configuration of the container using the files and
|
||||
directories listed below.
|
||||
|
||||
- ``/opt/starbound-dedicated/storage/starbound_server.config``: Server Configuration [*]
|
||||
- ``/opt/starbound-dedicated/workshop.txt``: List Of Steam Workshop IDs
|
||||
|
||||
**[*] Changes to some configuration files may require service restart to take
|
||||
immediate effect.**
|
||||
|
||||
## Network Services
|
||||
|
||||
This container runs network services that are intended to be exposed outside
|
||||
the container. You can map these to host ports using the ``-p HOST:CONTAINER``
|
||||
or ``-p HOST:CONTAINER/PROTOCOL`` syntax.
|
||||
|
||||
- ``21025/tcp``: Game Server.
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ -e ${STEAMAPPDIR}/workshop.txt ]]; then
|
||||
while read wid; do
|
||||
/usr/local/bin/starbound-workshop.sh $wid
|
||||
done <${STEAMAPPDIR}/workshop.txt
|
||||
fi
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
/bin/echo "Please provide your steam login name as the first argument."
|
||||
exit
|
||||
fi
|
||||
|
||||
/usr/bin/touch ${STEAMAPPDIR}/.updating
|
||||
|
||||
PID=$(pidof ${STEAMAPPDIR}/linux/starbound_server)
|
||||
if [ -n "$PID" ]; then
|
||||
kill "$PID"
|
||||
fi
|
||||
|
||||
${STEAMCMDDIR}/steamcmd.sh +force_install_dir ${STEAMAPPDIR} +login "$1" +app_update ${STEAMAPPID} validate +quit
|
||||
|
||||
if [[ -e ${STEAMAPPDIR}/workshop.txt ]]; then
|
||||
while read wid; do
|
||||
/usr/local/bin/starbound-workshop.sh $wid
|
||||
done <${STEAMAPPDIR}/workshop.txt
|
||||
fi
|
||||
|
||||
/usr/bin/touch ${STEAMAPPDIR}/.ready
|
||||
/bin/rm -f ${STEAMAPPDIR}/.updating
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
/bin/echo "Please provide the workshop ID as the first argument."
|
||||
exit
|
||||
fi
|
||||
|
||||
echo ${STEAMCMDDIR}/steamcmd.sh +force_install_dir ${STEAMAPPDIR} +login anonymous +workshop_download_item ${STEAMAPPID} $1 +quit
|
||||
${STEAMCMDDIR}/steamcmd.sh +force_install_dir ${STEAMAPPDIR} +login anonymous +workshop_download_item ${STEAMAPPID} $1 +quit
|
||||
/bin/ln -fs ${STEAMAPPDIR}/steamapps/workshop/content/211820/$1/contents.pak ${STEAMAPPDIR}/mods/$1.pak
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
touch /tmp/STARBOUND2
|
||||
|
||||
while [[ ! -f ${STEAMAPPDIR}/.ready ]]; do
|
||||
/bin/echo "Please run the starbound-install.sh script to install the game."
|
||||
/bin/sleep 60
|
||||
done
|
||||
|
||||
if [[ -f ${STEAMAPPDIR}/linux/starbound_server ]]; then
|
||||
cd ${STEAMAPPDIR}/linux
|
||||
./starbound_server
|
||||
fi
|
||||
|
||||
while [[ -f ${STEAMAPPDIR}/.updating ]]; do
|
||||
/bin/sleep 10
|
||||
done
|
Reference in New Issue