Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of using external-url #491

Open
danielloader opened this issue May 7, 2024 · 4 comments
Open

Example of using external-url #491

danielloader opened this issue May 7, 2024 · 4 comments
Labels

Comments

@danielloader
Copy link

Excitedly been watching the released notifications for 3.1.0 and this feature has turned up, but I don't know how to use it, so a simple example would be appreciated!

Thanks

@LEDfan
Copy link
Member

LEDfan commented May 8, 2024

Hi, I just added an example to the documentation: https://shinyproxy.io/documentation/configuration/#external-url
Hope this helps!

@LEDfan LEDfan added the question label May 8, 2024
@danielloader
Copy link
Author

danielloader commented May 9, 2024

I've tried this and I get this error:

image

eu.openanalytics.containerproxy.ProxyFailedToStartException: Container failed to start
	at eu.openanalytics.containerproxy.service.ProxyService.prepareProxyForStart(ProxyService.java:458) ~[containerproxy-1.1.0.jar!/:1.1.0]
	at eu.openanalytics.containerproxy.service.ProxyService.startOrResumeProxy(ProxyService.java:466)
	at eu.openanalytics.containerproxy.service.ProxyService.lambda$startProxy$7(ProxyService.java:293)
	at eu.openanalytics.containerproxy.service.ProxyService.lambda$action$14(ProxyService.java:638)
	... 5 frames excluded
Caused by: java.lang.IllegalStateException: This is an external app and cannot be started
	at eu.openanalytics.shinyproxy.external.ExternalAppSpecExtension.firstResolve(ExternalAppSpecExtension.java:49) ~[!/:3.1.0]
	at eu.openanalytics.shinyproxy.external.ExternalAppSpecExtension.firstResolve(ExternalAppSpecExtension.java:35)
	at eu.openanalytics.containerproxy.model.spec.ProxySpec.lambda$firstResolve$0(ProxySpec.java:135) ~[containerproxy-1.1.0.jar!/:1.1.0]
	at java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:180) ~[na:na]
	at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1850)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at eu.openanalytics.containerproxy.model.spec.ProxySpec.firstResolve(ProxySpec.java:133) ~[containerproxy-1.1.0.jar!/:1.1.0]
	at eu.openanalytics.containerproxy.service.ProxyService.prepareProxyForStart(ProxyService.java:433)
	... 8 common frames omitted

With the relevant config:

proxy:
  specs:
    - id: basic-external-url
      display-name: Basic External URL
      description: Example description
      external-url: https://shinyproxy.io
      access-groups:
        - admins

Thanks for any help you can provide.

Can cross-link this over to the shinyproxy repository if this is a bug that needs fixing.

@LEDfan LEDfan transferred this issue from openanalytics/shinyproxy-config-examples May 10, 2024
@LEDfan
Copy link
Member

LEDfan commented May 10, 2024

Thanks for your additional testing, are you perhaps using custom templates? The idea of the external url feature is that the link on the main page redirects the user to the external url. In order for this to work, you'll need to use the templates that come with ShinyProxy 3.1.0.

If you open the app url of the external app, you'll indeed get an error, because there is no way to start an external app. But maybe it makes sense here to also redirect the user to the external URL.

@danielloader
Copy link
Author

danielloader commented May 10, 2024

Edit: You were correct the custom template was the issue!

So it's not expected to embed it inside the iframe/application, it's just a static link that the browser goes to wholesale?

A shim to a url "as an app" would be quite beneficial in a kubernetes context, if you had a bunch of R/Shiny apps that needed to have pods launched but you also want to embed some more traditional applications that are already deployed you could have an entry to 'service-name.namespace:8080' and it's pretty seamless to the user.

At that point it allows for a cohesive experience using R applications where you're expecting a pod launch per user session, and something more traditional hitting a horizontally scaled replica deployment.

I know you can (and we do) launch other arbitrary web apps via shinyproxy, just musing aloud about effectively allowing one of your apps/navbar items being a very simple reverse proxy implemented by shinyproxy, so that the Oauth2 flow can be retained as a single session across the domain serving the web traffic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants