-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16 ability to change steam userid (#18)
* #16 - Added PUID and PGID environment variables * Disabled auto labeler for now * Fixed timezone issue and updated readme * Readme changes and version fix * Removed Labeler
- Loading branch information
Showing
15 changed files
with
118 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
target/ | ||
tmp/ | ||
docs/ | ||
.github/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: odin | ||
version: "0.1.0" | ||
version: "stub" | ||
author: mbround18 | ||
about: Installs and Runs Valheim | ||
args: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/sh | ||
|
||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
echo " | ||
########################################################################### | ||
Valheim Server - $(date) | ||
Initializing your container... | ||
########################################################################### | ||
" | ||
|
||
log () { | ||
echo "[Valheim][root]: $1" | ||
} | ||
|
||
|
||
# shellcheck disable=SC2039 | ||
if [ "${EUID}" -ne 0 ] | ||
then log "Please run as root" | ||
exit | ||
fi | ||
|
||
log "Switching UID and GID" | ||
# shellcheck disable=SC2086 | ||
usermod -u ${PUID} steam | ||
# shellcheck disable=SC2086 | ||
groupmod -g ${PGID} steam | ||
|
||
|
||
log "Setting up file systems" | ||
STEAM_UID=${PUID:=1000} | ||
STEAM_GID=${PGID:=1000} | ||
mkdir -p /home/steam/valheim | ||
chown -R ${STEAM_UID}:${STEAM_GID} /home/steam/valheim | ||
mkdir -p /home/steam/scripts | ||
chown -R ${STEAM_UID}:${STEAM_GID} /home/steam/scripts | ||
mkdir -p /home/steam/valheim | ||
echo "export PATH=\"/home/steam/.odin:$PATH\"" >> /home/steam/.bashrc | ||
cp /home/steam/steamcmd/linux64/steamclient.so /home/steam/valheim | ||
chown -R ${STEAM_UID}:${STEAM_GID} /home/steam/ | ||
chown -R ${STEAM_UID}:${STEAM_GID} /home/steam/valheim | ||
|
||
# Launch run.sh with user steam (-p allow to keep env variables) | ||
log "Launching as steam..." | ||
cd /home/steam/valheim || exit 1; | ||
|
||
su -s /bin/bash --login steam -c " | ||
PORT=${PORT} \ | ||
NAME=${NAME} \ | ||
WORLD=${WORLD} \ | ||
PASSWORD=${PASSWORD} \ | ||
/bin/bash /home/steam/scripts/entrypoint.sh | ||
" |