docker-dontstarvetogether: env MODS not working

Hi, I write my .env file like this:

# ... some configs
MODS=378160973,375859599,356930882,1271089343,501385076,2110246021,466732225
# ... some configs

And I run the container, but in the container’s /data/mods/dedicated_server_mods_setup.lua, there is no ServerModSetup(xxx) but a default file with some comments like:

--There are two functions that will install mods, ServerModSetup and ServerModCollectionSetup. Put the calls to the functions in this file and they will be executed on boot.

--ServerModSetup takes a string of a specific mod's Workshop id. It will download and install the mod to your mod directory on boot.
	--The Workshop id can be found at the end of the url to the mod's Workshop page.
	--Example: http://steamcommunity.com/sharedfiles/filedetails/?id=350811795
	--ServerModSetup("350811795")

--ServerModCollectionSetup takes a string of a specific mod's Workshop id. It will download all the mods in the collection and install them to the mod directory on boot.
	--The Workshop id can be found at the end of the url to the collection's Workshop page.
	--Example: http://steamcommunity.com/sharedfiles/filedetails/?id=379114180
	--ServerModCollectionSetup("379114180")

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Thanks for your input on this! 👍 I’ll probably have a look at this on the coming weekend.

This should be fixed.

The Docker image has already been updated on the Docker hub. Please feel free to pull the new image via docker pull yeetzone/dontstarvetogether and give it a try.

So far this seems to fix the mods issue; although I noticed that now, mods are still installed into the mods directory, but in addition to that, some files also get installed into the ugc_mods directory.

AFAIK this is an intended behaviour, old mods use the ./mods path and new ones use the path given in the parameter, this has something to do with recently released mod uploader tool by Klei. Glad you fixed the image, thanks!

@mateuszkozakiewicz, thanks for your help! I’ve now incorporated two separate changes based on your input.

First, I’m “brute-forcing” chmod in the entrypoint.sh to ensure proper permissions for the $STEAM_PATH directory. This was probably the issue in the first place. The solution is not super nice, but it executes fast and it seems to work anyway.

Second, I’ve integrated usage of the new ugc_directory parameter, using it slightly different than what you proposed. The actual installation/update of mods happens in the update script, which is called from the start script. Then, as you suggest, I’m using skip_update_server_mods on the actual launch command.

So far this seems to fix the mods issue; although I noticed that now, mods are still installed into the mods directory, but in addition to that, some files also get installed into the ugc_mods directory.

The Docker image has already been updated on the Docker hub. Please feel free to pull the new image via docker pull yeetzone/dontstarvetogether and give it a try. I’ll leave the issue open until I get some confirmation this works.

Thanks a lot to everyone participating on this issue! ❤️

This fixes all problems

/entrypoint.sh

        dontstarve_dedicated_server_nullrenderer -only_update_server_mods -ugc_directory $STEAM_PATH/ugc_mods | true

/opt/steam/scripts/command/start/script.sh

exec dontstarve_dedicated_server_nullrenderer \
        -skip_update_server_mods \
        -ugc_directory "$STEAM_PATH/ugc_mods" \
        -persistent_storage_root "$(dirname "$STORAGE_PATH")" \
        -conf_dir "$(basename "$STORAGE_PATH")" \
        -cluster "$CLUSTER_NAME" \
        -shard "$SHARD_NAME" \
        -backup_log_count "$BACKUP_LOG_COUNT"

Additionally this allows to use mods uploaded to workshop using the new method (note -ugc_directory without it some mods crash the server on startup i.e. global positions)

I think there is a permission issue because this

Running dontstarvetogether start within the running container seems to properly create the directories and install the mods.

is only true if you exec into container and run dontstarve_dedicated_server_nullrenderer as root, the steam user will never be able to install mods unless root runs that command first (some dir is created perhaps?)