diff --git a/Dockerfile b/Dockerfile index 925bc96..96d10cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,11 @@ ENV DEPOT_ID=996562 # Set a specific manifest ID to download an older version of the server, defaults to latest version ENV MANIFEST_ID=7306793446776857728 +# Steam credentials +ENV STEAM_USER=anonymous +ENV STEAM_PASSWORD="" +ENV STEAM_GUARD_CODE="" + # Install dependencies RUN apt-get update && \ apt-get install -y libicu-dev gosu && \ diff --git a/README.md b/README.md index 6185c31..c3f4eda 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ services: # To use a specific server version, uncomment the next line and set a manifest ID. # See the "Using an Older Server Version" section for details. # - MANIFEST_ID=none + # If you need to use your own Steam credentials, uncomment and set the following variables. + # - STEAM_USER=your_steam_username + # - STEAM_PASSWORD=your_steam_password + # - STEAM_GUARD_CODE=your_2fa_code restart: unless-stopped ``` @@ -65,6 +69,10 @@ docker run -d \ # To use a specific server version, uncomment the next line and set a manifest ID. # See the "Using an Older Server Version" section for details. # -e MANIFEST_ID=none \ + # If you need to use your own Steam credentials, uncomment and set the following variables. + # -e STEAM_USER=your_steam_username \ + # -e STEAM_PASSWORD=your_steam_password \ + # -e STEAM_GUARD_CODE=your_2fa_code \ --restart unless-stopped \ greenmatthew/scp-secret-laboratory-server:latest ``` @@ -87,6 +95,9 @@ Mounting the .config directory allows you to configure any server setting and ha - `TZ`: [Timezone identifier](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) for the container (default: Etc/UTC). Examples: `America/Chicago`, `Europe/London`, `Asia/Tokyo` - `DEPOT_ID`: The Steam Depot ID for the server files (default: `996562`). This generally should not be changed. - `MANIFEST_ID`: The Steam Manifest ID for a specific server version (default: `none`). See the "Using an Older Server Version" section for details. +- `STEAM_USER`: Your Steam username (default: `anonymous`). +- `STEAM_PASSWORD`: Your Steam password (default: `""`). +- `STEAM_GUARD_CODE`: The 2FA code from your authenticator app (default: `""`). Only needed if your account has Steam Guard enabled. ## Using an Older Server Version diff --git a/compose.yaml b/compose.yaml index 654f759..ff818ee 100644 --- a/compose.yaml +++ b/compose.yaml @@ -15,4 +15,8 @@ services: # - TZ=Etc/UTC # To download a specific version of the server, uncomment the next line and set the value to a valid manifest ID. # - MANIFEST_ID=none + # If you need to use your own Steam credentials, uncomment and set the following variables. + # - STEAM_USER=your_steam_username + # - STEAM_PASSWORD=your_steam_password + # - STEAM_GUARD_CODE=your_2fa_code restart: unless-stopped diff --git a/start.sh b/start.sh index 7857b31..302f21a 100644 --- a/start.sh +++ b/start.sh @@ -6,12 +6,12 @@ echo "Current user is: $(whoami)" # Install/update SCP:SL server if [ "$MANIFEST_ID" = "none" ]; then echo "MANIFEST_ID not set, downloading latest server version..." - steamcmd +force_install_dir $SERVER_DIR +login anonymous +app_update 996560 validate +quit + steamcmd +force_install_dir $SERVER_DIR +login "$STEAM_USER" "$STEAM_PASSWORD" "$STEAM_GUARD_CODE" +app_update 996560 validate +quit else echo "MANIFEST_ID set to $MANIFEST_ID, downloading specific server version..." # download_depot downloads to a specific folder, not the one specified by force_install_dir # It will be downloaded to /steamapps/content/app_/depot_ - steamcmd +login anonymous +download_depot 996560 $DEPOT_ID $MANIFEST_ID +quit + steamcmd +login "$STEAM_USER" "$STEAM_PASSWORD" "$STEAM_GUARD_CODE" +download_depot 996560 $DEPOT_ID $MANIFEST_ID +quit DEPOT_DOWNLOAD_DIR="$INSTALL_DIR/steamapps/content/app_996560/depot_$DEPOT_ID"