games-on-whales / wolf

Stream virtual desktops and games running in Docker
https://games-on-whales.github.io/wolf/stable/
MIT License
292 stars 20 forks source link

Docker: mount different folders for different sessions #25

Closed ABeltramo closed 1 year ago

ABeltramo commented 1 year ago

At the moment users have to specify the "state" folder in the config.toml ex: /home/ale/retro:/home/retro:rw.

Ideally, we should have a way to mount different folders for different sessions so that it resolves to something like: <HOST_STATE_FOLDER>/<SESSION_ID>/<APP_NAME>:/home/retro:rw.

To keep this as flexible as possible I think we should add an extra option under [[paired_clients]]:

[[paired_clients]]
app_state_folder = "12345" # Defaults to session_id (which is hash(client_cert))

That app_state_folder will be concatenated with HOST_STATE_FOLDER which is a new env variable (so that users don't have to fiddle with the config.toml when first starting).

This way, by default each user will have his own state folder, but if you want to share the same folders with multiple users you can just override the config.toml file.