shinyproxy icon indicating copy to clipboard operation
shinyproxy copied to clipboard

proxy.specs.id doesn't accept slashes "/"

Open wtarnawski opened this issue 3 years ago • 2 comments

Hi,

I would like to have an url like https://servername.org/app_direct/test/app

These settings:

  - id: test/app
    display-name: testapp
    container-cmd: ["R", "-e", "shiny::runApp('/home/app')"]
    container-image: testapp
    access-groups: [testapp]

give me 403 Forbidden error (coming from shinyproxy), the same when I try to access a nonexistent app.

I tried id testapp and it worked fine. So I guess the slashes are problems.

I tried ids:

  • test/app
  • test//app
  • test/app
  • test%2Fapp <- not even allowed
  • test\%2Fapp
  • test\app
  • test.app <- funny thing: this works, but slashes won't

but nothing works. Can you help me to get this working? Could you also provide an entry in configuration manual on how these names are parsed? I only found "id: the identifier of the application" but no clue on why the slashed won't work.

Thank you!

wtarnawski avatar Mar 29 '22 11:03 wtarnawski

Forward slash is not currently supported since apps may have sub-paths inside, and then it would be difficult to distinguish if by going to /test/app you want to access the app named "test/app" or the "/app" sub-path of the app named "test"... (I guess it might be possible to do this by checking all the app id's defined in the configuration file)

May I ask why do you need the url to look like that? Maybe an alternative could be to use url rewrite or redirect so that e.g. https://servername.org/test/app would point to https://servername.org/app_direct/testapp ?

mnazarov avatar Mar 30 '22 07:03 mnazarov

Thank you for your answer.

Could you tell me more about those subpaths? I can't find anything about it in the configuration and I could use them.

The reason behind this is that I would potentially have to migrate hundreds of apps that are functioning like this on Shiny Server and I would prefer to avoid url rewriting, as some of these apps use query parameters with symbols, for example I would have to parse something like ?starting_date="2022/01/01" and rewriting that would be prone to errors. Yes, I know that would be encoded, but still I would prefer not to rewrite these urls.

Another reason is that just joining the sublocations looks kind of ugly and is unreadable. I have some apps with 5 sublocations, like /test/app/demo/abc/asd. Using another delimiter is not an option, this is not how the HTTP was designed.

wtarnawski avatar Mar 30 '22 09:03 wtarnawski