Skip to content

Commit b301043

Browse files
DaanSelenDaanSelen
andauthored
feat: add steam downloading support. Bypassing self-packaging (#17)
Co-authored-by: DaanSelen <dselen@systemec.nl>
1 parent 7f69a87 commit b301043

File tree

5 files changed

+75
-14
lines changed

5 files changed

+75
-14
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
save*
2-
*.tar.gz
2+
*.tar.gz*
33
conf*
44
!*configure*
55

66
# The mods I cannot directly present
77
AutoLoadGame
88
DefaultOnCheats
99
Multi-UserChest
10-
NoFenceDecayRedux
10+
NoFenceDecayRedux

Dockerfile

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
1+
# Install Microsoft's DotNet for the game
2+
13
FROM alpine:latest AS dotnet-installer
24

35
RUN apk add --no-cache \
46
bash curl \
57
&& curl -o /tmp/dotnet-install.sh https://raw.githubusercontent.com/dotnet/install-scripts/refs/heads/main/src/dotnet-install.sh \
68
&& bash /tmp/dotnet-install.sh --install-dir /usr/local/share/dotnet
79

10+
# Download the Stardew Valley game files from Steam (bypasses self-packaging)
11+
12+
FROM steamcmd/steamcmd:debian-trixie AS steam-downloader
13+
14+
ARG STEAM_USER
15+
ARG STEAM_PASS
16+
17+
RUN if [ -n "$STEAM_USER" ] && [ -n "$STEAM_PASS" ]; then \
18+
echo "Trying to use Steam credentials!"; \
19+
steamcmd +force_install_dir /tmp/stardew +login ${STEAM_USER} ${STEAM_PASS} +app_update 413150 +quit; \
20+
else \
21+
mkdir /tmp/stardew; \
22+
echo "Steam username or Password not provided"; \
23+
fi
24+
825
# Unpack Stardew Valley
926
FROM debian:stable-slim AS unpacker
1027
# You'll need to supply your own Stardew Valley game files, in the followin name: 'latest.tar.gz' or change the following line.
1128

29+
ARG METHOD="LOCAL"
1230
ARG SMAPI_VERSION="4.3.2"
1331

1432
RUN apt-get update \
@@ -17,11 +35,23 @@ RUN apt-get update \
1735
unzip \
1836
libicu-dev
1937

20-
COPY ./latest.tar.gz /tmp/latest.tar.gz
21-
RUN mkdir -p /game/nexus \
22-
&& tar zxf /tmp/latest.tar.gz -C /game \
23-
&& rm /tmp/latest.tar.gz \
24-
&& mv /game/Stardew\ Valley /game/stardewvalley
38+
### UNPACKER PROVIDE GAME FILES
39+
COPY ./latest.tar.gz /tmp/local-stardew.tar.gz
40+
COPY --from=steam-downloader /tmp/stardew /tmp/steam-stardew
41+
42+
RUN mkdir -p /game/nexus; \
43+
echo "METHOD: $METHOD"; \
44+
if [ "$METHOD" = "LOCAL" ]; then \
45+
tar -zxf /tmp/local-stardew.tar.gz -C /game; \
46+
\
47+
if [ -d "/game/Stardew Valley" ]; then \
48+
echo "Renaming Stardew Valley folder."; \
49+
mv -v "/game/Stardew Valley" "/game/stardewvalley"; \
50+
fi; \
51+
elif [ "$METHOD" = "STEAM" ]; then \
52+
mv /tmp/steam-stardew /game/stardewvalley; \
53+
fi; \
54+
rm -rfv /tmp/*-stardew.*
2555

2656
RUN curl -L -o /tmp/nexus.zip https://github.com/Pathoschild/SMAPI/releases/download/${SMAPI_VERSION}/SMAPI-${SMAPI_VERSION}-installer.zip \
2757
&& unzip /tmp/nexus.zip -d /game/nexus \

README.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ Therefor this project, it tries to modernize the packages with the same function
1111

1212
# Overview:
1313

14+
Just new! Steam downloading also supported now! Might be janky sometimes in terms of Steam Guard Authentication. But it works.<br>
15+
1416
This container setup has a couple things to know. First off you need to get the game files yourself. I cannot legally present them here.<br>
1517
Furthermore you'll have to know that this server exposes at least 1 port, and at most 3 ports for a succesful server.<br>
1618
These are:
1719

20+
For peace of mind, Chromium based browsers did perform the best for me.<br>
21+
Though I use Firefox for everything else.<br>
22+
1823
```
1924
- 24642/udp # This is the Stardew Valley Server port
2025
- 3000/tcp # This is the raw-VNC port. For remote connections
@@ -23,17 +28,39 @@ These are:
2328

2429
Steps to get it running:
2530

26-
1. Package the game files.
31+
1. Package the game files. (Steam or Local)
2732
2. Build the container.
2833
3. Run the container.
2934
4. Go to the (web)-VNC port and access the server.
30-
5. Create a world and prepare for multiplayer.
35+
5. Create a world and prepare for multiplayer. (Be mindful you need the Autoload mod!)
3136
6. Once its done, you can join the server.
3237

3338
# Getting the game files.
3439

35-
Getting the game files is arguably the hardest part. I love this game, and I do recommend buying it for yourself.<br>
36-
Have fun!<br>
40+
Steam is now supported, so there are two methods. Local and Steam.
41+
42+
Steam:
43+
44+
For the Steam method, you need to have purchased the game on Steam and have your credentials ready.<br>
45+
In my case I also needed to have my authenticator mobile app ready to confirm.<br>
46+
47+
When building just pass the following arguments:
48+
49+
```sh
50+
--build-arg METHOD="STEAM"
51+
--build-arg STEAM_USER="<Your Steam Username>"
52+
--build-arg STEAM_PASS="<Your Steam Password>"
53+
```
54+
55+
Alternatively you can also use/change the predefined fields inside the `./compose.yaml`<br>
56+
57+
Be mindful that even though you are not supplying the game files locally, you still need to have an empty file present at `./latest.tar.gz`.<br>
58+
This is because the Dockerfile expects it to.
59+
60+
Local:
61+
62+
I love this game, and I do recommend buying it for yourself.<br>
63+
However if you are unable or unwilling to give Steam credentials, you can also use the packaging guide!<br>
3764

3865
For indication on how to package the game yourself look at this document: [Packaging Guide](./guides/packaging.md).
3966

compose.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ services:
88
build:
99
context: .
1010
dockerfile: ./Dockerfile
11+
args:
12+
METHOD: "LOCAL"
13+
# STEAM_USER: "<your-steam-username>"
14+
# STEAM_PASS: "<your-steam-password>"
1115
environment:
1216
- TZ=Europe/Amsterdam
1317
- CUSTOM_USER=stardew
1418
- PASSWORD=stardew
1519
- TITLE=Stardew Valley Game Server
1620
ports:
17-
# - 3000:3000/tcp # Real VNC
21+
- 3000:3000/tcp # Real VNC
1822
- 3001:3001/tcp # Web VNC
1923
- 24642:24642/udp # Stardew Valley Game Server
2024
volumes:

guides/mods.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Mods/ (folder)
1313
..other mods
1414
```
1515

16-
## AutoLoadGame (Nexus Mods)
16+
## AutoLoadGame (Nexus Mods) HIGHLY RECOMMENDED
1717

1818
The first mod, AutoLoadMods is needed for automatically loading the save game when the container is restarted.
1919

@@ -39,4 +39,4 @@ https://www.nexusmods.com/stardewvalley/mods/20802
3939

4040
## Closing
4141

42-
Hopefully this satisfies the copyright set by the owners and the ease-of-use for the players.
42+
Hopefully this satisfies the copyright set by the owners and the ease-of-use for the players.

0 commit comments

Comments
 (0)