A brutal exploration and survival game for 1-10 players, set in a procedurally-generated purgatory inspired by viking culture incl the Plugin Framework BepInEx
Name | Github Profile | Buy me a Coffee |
---|---|---|
gOOvER | https://github.com/gOOvER |
A brutal exploration and survival game for 1-10 players, set in a procedurally-generated purgatory inspired by viking culture. Battle, build, and conquer your way to a saga worthy of Odin’s patronage! https://store.steampowered.com/app/892970/Valheim/
BepInEx is a general purpose framework for Unity modding. BepInEx includes tools and libraries to
BepInEx is currently one of the most popular modding tools for Unity on GitHub.
This pack is preconfigured and usable for Valheim modding. In particular, the changes from base BepInEx releases are:
Mods can be downloaded from modpacks automatically by entering the "dependency string" for the modpack from https://valheim.thunderstore.io/
Port | default |
---|---|
Game | 2456 |
Query | 2457 |
Because the DOORSTOP_CORLIB_OVERRIDE_PATH=./unstripped_corlib;
has been removed from the startup with the latest update of this egg. If your server is already running, update the startup manually.
Name | Tag |
---|---|
ghcr.io/ptero-eggs/games:valheim | ghcr.io/ptero-eggs/games:valheim |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
Server Name | Name that appears in server browser. | SERVER_NAME | My Server | Yes | Yes |
Server Password | Server password. | PASSWORD | secret | Yes | Yes |
World Name | Name to load if switching between multiple saved worlds. | WORLD | Dedicated | Yes | Yes |
Public Server | PUBLIC_SERVER | 1 | Yes | Yes | |
Auto Update | AUTO_UPDATE | 1 | Yes | Yes | |
Enable Crossplay | Enable crossplay support | ENABLE_CROSSPLAY | 0 | Yes | Yes |
Beta Branch | SRCDS_BETAID | Yes | Yes | ||
Beta Password | SRCDS_BETAPASS | Yes | Yes | ||
Backup Interval | Change how often the world will save in seconds. Default: 1800 (30 minutes). | BACKUP_INTERVAL | 1800 | Yes | Yes |
Backup Count | Sets how many automatic backups will be kept. The first is the 'short' backup length, and the rest are the 'long' backup length. When default values are used means one backup that is 2 hours old, and 3 backups that are 12 hours apart. Default: 4. | BACKUP_COUNT | 4 | Yes | Yes |
Backup Shorttime | Sets the interval between the first automatic backups in seconds. Default: 7200 (2 hours). | BACKUP_SHORTTIME | 7200 | Yes | Yes |
Backup Longtime | Sets the interval between the subsequent automatic backups in seconds. Default: 43200 (12 hours). | BACKUP_LONGTIME | 43200 | Yes | Yes |
[System] Console Filter | Remove unwanted outputs from the console. | CONSOLE_FILTER | /^\(Filename:.*Line:[[:space:]]+[[:digit:]]+\)$/d; /^([[:space:]]+)?$/d | No | No |
[System] App ID | Valheim steam app id for auto updates. | SRCDS_APPID | 896660 | Yes | No |
[System] LD Library Path | Required to load server libraries. | LD_LIBRARY_PATH | ./linux64 | No | No |
[System] Shutdown Command | STOP | kill -2 $!; wait; | No | No | |
ModPack | Enter the Dependency String name for a ModPack to automatically be installed NOTE: If the modpack Updates, you will need to update this variable with the new Dependency String. This is done to allow Old Versions to be used. CHANGING THIS REQUIRES A SERVER REINSTALL | V_MODPACK | Yes | Yes |
#!/bin/bash
# Valheim Installation Script
#
# Server Files: /mnt/server
# Image to install with is 'debian:buster-slim'
apt -y update
apt -y --no-install-recommends --no-install-suggests install wget
## just in case someone removed the defaults.
if [ "${STEAM_USER}" == "" ]; then
echo -e "steam user is not set.\n"
echo -e "Using anonymous user.\n"
STEAM_USER=anonymous
STEAM_PASS=""
STEAM_AUTH=""
else
echo -e "user set to ${STEAM_USER}"
fi
## download and install steamcmd
cd /tmp
mkdir -p /mnt/server/steamcmd
curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
cd /mnt/server/steamcmd
# SteamCMD fails otherwise for some reason, even running as root.
# This is changed at the end of the install process anyways.
chown -R root:root /mnt
export HOME=/mnt/server
## install game using steamcmd
./steamcmd.sh +force_install_dir /mnt/server +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} +quit
## set up 32 bit libraries
mkdir -p /mnt/server/.steam/sdk32
cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
## set up 64 bit libraries
mkdir -p /mnt/server/.steam/sdk64
cp -v linux64/steamclient.so ../.steam/sdk64/steamclient.so
echo "-------------------------------------------------------"
echo "installing BepInEx and Selected ModPacks..."
echo "-------------------------------------------------------"
if ! api_response=$(curl -sfSL -H "accept: application/json" "https://thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/"); then
fatal "Error: could not retrieve BepInEx release info from Thunderstore.io API"
fi
download_url=$(jq -r ".latest.download_url" <<< "$api_response" )
version_number=$(jq -r ".latest.version_number" <<< "$api_response" )
if [ ! -z "$V_MODPACK" ]
then
#Modpack Name dashes to slashes for URL
V_MODPACK=$(echo "$V_MODPACK" | sed 's/-/\//g')
#Extract dependencies from ModPack JSON data
V_MODPACK_DEPENDENCIES=$(curl -sfSL -H "accept: application/json" "https://thunderstore.io/api/experimental/package/${V_MODPACK}" | jq -r '.dependencies[]')
fi
cd /mnt/server
#echo $download_url
wget --content-disposition $download_url
unzip -o denikson-BepInExPack_Valheim-${version_number}.zip
cp -r /mnt/server/BepInExPack_Valheim/* /mnt/server
if [ ! -z "$V_MODPACK" ]
then
#Delete Old Mods
rm -rf /mnt/server/BepInEx/plugins/*
#Download and extract the modpack dlls files
for V_MODPACK_DEPENDENCY in $V_MODPACK_DEPENDENCIES; do
#ignore bepinex
if [[ "$V_MODPACK_DEPENDENCY" == *"denikson-BepInExPack_Valheim"* ]]; then
continue # Skip this dependency
fi
#replace dashes with slashes for url
V_MODPACK_DEPENDENCY_WITH_SLASH=$(echo "$V_MODPACK_DEPENDENCY" | sed 's/-/\//g')
#download dependencies
wget -O "$V_MODPACK_DEPENDENCY.zip" "https://thunderstore.io/package/download/$V_MODPACK_DEPENDENCY_WITH_SLASH"
#Set the destination directory and ensure it exists
destination_directory="/mnt/server/BepInEx/plugins"
if [ ! -d "$destination_directory" ]; then
mkdir -p "$destination_directory"
fi
#Extract DLL files from the ZIP and delete the zip file
unzip -j "$V_MODPACK_DEPENDENCY.zip" "*.dll" -d "$destination_directory"
#Cleanup
rm $V_MODPACK_DEPENDENCY.zip
done
fi
##cleanup
echo "-------------------------------------------------------"
echo "cleanup files..."
echo "-------------------------------------------------------"
rm -fR BepInExPack_Valheim
rm -fR icon.png
rm -fR denikson-BepInExPack_Valheim-*
rm -fR manifest.json
rm -fR README.m
#rm -fR start_*
echo "-------------------------------------------------------"
echo "Installation completed"
echo "-------------------------------------------------------"