Create a log in screen for shiny app without shiny server - r

I am fairly new to Shiny, but have created an app which I am hosting locally without shiny server.
What I'd like to do, is create a log in screen, which means that only authorised users can access my app.
Is there a way to do this? I have only found examples which use the shiny server, and this is something I do not want to do. I have also read something about Apache Web Server, but I wasn't sure how to do this, or if I needed to download something to get this set up.
Any help would be appreciated.

Related

Possibility of getting offline shinyApp without Publish Button, csv Data and seeing R code?

Hi guys i have made a shinyApp for a client using R.
The client for whom I’m working is asking for a shinyapp that works offline preferably in the form of an application or shiny window (as the online link of shinyapp.io will put load on the server). He wants to get the shiny output without seeing the R code.
He will later handover the shinyApp to his employees (>200) and they will mostly use the offline shinyApp on their desktop (in shiny window). Furthermore the data is very confidential so the client doesn't want his employees to either get csv data or publish the app online or see R code. Because every time they would run the app, they require csv data or codes to generate output.
That's why he doesn’t want a publish button anywhere in the app so that his employees doesn’t publish the app online.
Is there any way to do so? Any suggestions would be much appreciated
Method 1
I feel this is the best way to do it. This will give you an exe setup to install on your clients' server If you find it complicated you can try the below method, but my first preference would be this one.
Method 2
The process of making your standalone app is best explained here.
You can also use this site. If you feel the first is a little ambiguous
It is very much possible, and I do it often. If you have any doubts, you can ask me. This will not show the code to your client, it will be like any other desktop/server app, although the code can be seen if the app is probed, unlike the first method.
You can put the packaged app in a server which serves the local IPs.
I think you can do it without any hassle. Just follow the instructions line by line.
Regards/Revanth Nemani

R shiny app: Provide API-like interface for other calling applications

I have a running shiny app that displays some output-metrics on screen in response to purely on-screen UI inputs (no files to be read etc.) I can host it on shinyapps.io to make it accessible remotely 24x7.
A programmer working on another application (non-R, residing on a remote server) wants to access my shiny app to get my output-metrics into his code. What's a good way to do this?
On the input side, with bookmark-able state via the calling url it looks like I can get all inputs from the calling app.
What I haven't figured out is any way to send back outputs to the calling app with the current shiny framework. What I currently show on screen I want to be able to send back to the calling app.
Any ideas?
PS. There's rumors that some native functionality to provide this use-case is coming to shiny but there's nothing yet and I'm impatient to finish this project.

Deploy Shiny app that can read files from local computer (no possible Data-based solution)

I am trying to deploy a Shiny app on shinyapps, but it is not possible to read and write local files from the computer of the user. The idea is that every user can upload some datasets and images given a local path where this input is stored, not to have a same series of inputs for everyone stored in a ´Data´ folder.
I know there are other options to deploy shiny apps (amazon, shiny server), but I am afraid I will find the same kind of problems. Before losing too much time trying other approaches, I would like to know if there is any way to deploy a shiny app that can read these inputs given a local path and, if not, if there is an easy way to prepare an online app that can do this trasnlating from a shiny-based one. If not, I guess I will have to leave my app as a normal R package.
Thank you in advance.

Shiny Server User/UserGroup

Please suggest a clean(er) way of adding a user (like myself) to Shiny Server running on Ubuntu. I found this link: Setting up shiny User permissions but would like more advice on this. And I don't want to host RStudio server, just want to host Shiny server. Also can I run Tomcat along with Shiny server on the same machine?
I think you may be misunderstanding what that link is saying. You're not setting up different users for the Shiny server, you're setting up users on your computer, and managing them in such a way that you keep track of permissions for files you create on the computer. The important thing is to make sure the "shiny" user on your computer (which will be the one hosting your shiny server apps, unless you modify the default settings) has the correct permissions to access the files it will need when running those apps.
When you run a Shiny app, you won't be logged in as a user per se, rather the "shiny" user will host the computation for you, and deliver any output to you through your browser interface.
To my knowledge, unless you're using Shiny Server Pro, you won't have the ability to specify different users when using the apps (this is different to a "session", which is another topic).
When you create a shiny app, and install it (by moving it to the "/srv/shiny-server" folder), you'll need to make sure the user "shiny" on your computer has read access to that file at the very least. If your app involves reading data files from your computer, make sure the "shiny" user has read access to those too. If your app involves writing to files on our computer, make sure the "shiny" user also has write permission for those files.

Open a different Shiny application by clicking link in a Shiny application

I am building my first Shiny app and have been struggling with one issue that I am not even sure if it is possible to do.
I want to allow a user to click a link (or select something or click a button; some user action), and after this I want another Shiny app to be open in front of the user (the previous one might be shut down; I no longer care about it). To put it in other words, I want to make something like the following work:
if(input$datasetlist == "cars"){
runApp("C:/.../readdata")
}
Of course, trying this naive code returns a warning:
Error in startServer("0.0.0.0", port, httpuvCallbacks) :
Failed to create server
What is the correct approach for this, if it is even possible?
There's not a way to do this now in Shiny natively, but you might be interested in Shiny Server. It allows you to host multiple applications concurrently. It will manage the startup and shutdown of apps based on whether or not they're being used.
So you could just host all your apps in Shiny Server, then provide regular links (a(href="/anotherApp")) to allow users to navigate between apps.

Resources