Shinyproxy: Mounting shinyproxy to host filesystem.

Created on 5 Jan 2021  ·  8Comments  ·  Source: openanalytics/shinyproxy

I have a shiny app in which users can upload data, manipulate the data in the app, and then save the manipulated data to their local filesystem. I can get this to run locally with shinyproxy by using

container-volumes: ["/Users:/app_data"]

in application.yml. This mounts the host users filesystem (/Users) to the container (/app_data). However, when I deploy the app on a remote server I can no longer mount to the host filesystem. I would the user to be able to save to their own filesystem. Is this possible? I have tried some alternatives to /Users such as ${HOME} without success.

Thank you.

question

All 8 comments

yes, you can do that with the syntax like:

container-volumes: ["/home/#{proxy.userId}:/app_data"]

Using:
container-volumes: ["/home/#{proxy.userId}:/app_data"]
still results in me not being able to access to host filesystem when the app is deployed on a remote server. For context, I am using shinyFileSave within the shiny app and that code is as follows:
roots <- c("Home Directory" = "/app_data")
shinyFileSave(input = input, id = 'save', roots = roots, session = session)
When I deploy my app via a remote server and use the file save button I am mounted to a blank file system without any folders instead of my host filesystem with access to my desktop etc. Am I mounting to the host user's filesystem on the linux remote server instead of the filesystem on their desktop? Or perhaps it is a permissions issue. At the end of the day I would like the user to be able to save what they created in the webapp to their desktop. Thank you!

In case it is of use, here is a list of the various mounts that I have attempted. None have worked so far:

`container-volumes: ["${HOME}:/app_data"]`
`container-volumes: ["/$pwd:/app_data"]`
`container-volumes: ["$HOME:/app_data"]`
`container-volumes: ["/Users:/app_data"]`
`container-volumes: ["~:/app_data"]`
`container-volumes: ["/home/#{proxy.userId}:/app_data"]`

Am I mounting to the host user's filesystem on the linux remote server instead of the filesystem on their desktop?

Yes, correct. If the shinyproxy is running on a linux remote server, the host system is that remote server, which you can access with volume mounts.

At the end of the day I would like the user to be able to save what they created in the webapp to their desktop.

Wouldn't a downloadButton be sufficient in this case? (https://shiny.rstudio.com/articles/download.html)

The downloadButton and downloadHandler solution is not ideal but it will work. I think this is likely the only solution given the nature of ShinyProxy and that it would be impossible to mount to the desktop of a users computer. Thank you for the help!

The “host filesystem” is the remote sever’s file system. What you want to achieve is to save file to the client’s filesystem? It’s not possible in my opinion.

Yes the original goal was to save a file to the client's filesystem with shinyFileSave but I agree that this is impossible.

Hi @lucius-verus-fan

I think that you question is answered now, therefore I'm closing this issue. As always, feel free to open a new issue if you have any other question or issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thomas-chauvet picture thomas-chauvet  ·  5Comments

benkates picture benkates  ·  3Comments

donarus picture donarus  ·  3Comments

jat255 picture jat255  ·  4Comments

erossini picture erossini  ·  3Comments