valheim-server-docker icon indicating copy to clipboard operation
valheim-server-docker copied to clipboard

copy / sync patchers directory of bepinex, too

Open himpich opened this issue 3 years ago • 9 comments

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

himpich avatar Sep 05 '21 15:09 himpich

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.

m-lindemann avatar Oct 05 '21 09:10 m-lindemann

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 avatar Oct 15 '21 06:10 maxfield-allison

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 avatar Oct 15 '21 06:10 maxfield-allison

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.

maxfield-allison avatar Oct 15 '21 14:10 maxfield-allison

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 avatar Oct 18 '21 16:10 m-lindemann

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...

m-lindemann avatar Oct 18 '21 16:10 m-lindemann

@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: - $HOME/valheim/config:/config - $HOME/valheim/data:/opt/valheim - $HOME/valheim/config/bepinex/patchers:/config/hookgenpatcher:ro

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

dougclarknc avatar Nov 16 '21 02:11 dougclarknc

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.

Danpiel avatar Dec 12 '21 09:12 Danpiel