lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.94k stars 272 forks source link

copy / sync patchers directory of bepinex, too #392

Open himpich opened 3 years ago

himpich commented 3 years ago

in the "common" file is a block which copies the plugins directory into the corresponding plugins directory of the docker container.

please do the same for the bepinex/patchers folder, this way we can configure and update patchers like the HookGenPatcher

m-lindemann commented 3 years ago

At the moment I worked around that with a

PRE_START_HOOK="rsync -a --delete /config/hookgenpatcher/patchers /opt/valheim/bepinex/BepInEx && rsync -a /config/hookgenpatcher/config/ /config/bepinex"

and a additional read only volume at /config/hookgenpatcher

Has to be proven with the next update, but seems to work.

maxfield-allison commented 3 years ago

I'd like to add my request for this here as well. @m-lindemann, is your solution still working? Do you have an example of what the docker compose looks like for your mount? Thanks

maxfield-allison commented 3 years ago

Looks like you could define the variables and just add

        if [ -d "$config_path/patchers" ] && [ -d "$patchers_path" ]; then
            info "Syncing BepInEx patchers from $config_path/patchers/ -> $patchers_path"
            rsync -a --itemize-changes "$config_path/patchers/" "$patchers_path"
        fi

Right below the plugins block. On mobile and need to sleep so I'll mess with it after my meeting in the AM.

maxfield-allison commented 3 years ago

In the meantime @m-lindemann it looks like you're using only bepinex, could you assist with what your command would look like for valheim plus? I'm assuming:

PRE_START_HOOK="rsync --delete /config/valheimplus/patchers /opt/valheim/plus/BepInEx && rsync -a /config/valheimplus/config/ /config/plus"

but not entirely sure thats correct. If you could help with a step by step that would be great. Not super familiar with rsync yet.

m-lindemann commented 3 years ago

I'd like to add my request for this here as well. @m-lindemann, is your solution still working? Do you have an example of what the docker compose looks like for your mount? Thanks

I´m not using docker-compose for that. But

volumes: 
  - $HOME/valheim-server/config:/config
  - $HOME/valheim-server/data:/opt/valheim
  - $HOME/valheim-server/hookgenpatcher:/config/hookgenpatcher:ro

should do the job.

m-lindemann commented 3 years ago

In the meantime @m-lindemann it looks like you're using only bepinex, could you assist with what your command would look like for valheim plus? I'm assuming:

PRE_START_HOOK="rsync --delete /config/valheimplus/patchers /opt/valheim/plus/BepInEx && rsync -a /config/valheimplus/config/ /config/plus"

but not entirely sure thats correct. If you could help with a step by step that would be great. Not super familiar with rsync yet.

Sorry, never tried that on Valheim Plus. And I'm also on a very very low level with rsync. Just doing try and error...

dougclarknc commented 2 years ago

@m-lindemann I'm trying to implement your workaround with no luck, so Im hoping to clarify some things. Ive passed in the shared folder to the container and your PRE_START_HOOK string as an environment variable. Is this how you configured yours?

volumes:

environment:

Danpiel commented 2 years ago

Hello, this rsync will not work in Kubernetes setup

Currently is there a way to inject addons from Thunderstore by supplying a list from configuration file and get updated by night cron ? If there is interest in this feature, I'll make PR.

Frechetta commented 2 months ago

I solved this for V+ with PRE_START_HOOK=cp -a /config/patchers/* /opt/valheim/plus/BepInEx/patchers/.