Skip to content

Server setup

martin-hajek edited this page May 3, 2024 · 4 revisions

Requirements

To run the Requal as a Shiny application on a server, it's necessary to first prepare the environment. The specific setup steps might differ based on your operating system. Follow the relevant instructions below to install the required system dependencies on your server:

reQual Shiny Application Setup

  • Establish a PostgreSQL database to act as the data storage for requal. At this stage, you only need to create the database. The requal application will define the database schema upon its initial launch.
  • Create a directory within your Shiny Server path (e.g., /srv/shiny-server/requal). This will be the home of your application. Open this directory as an R project or navigate to it using setwd("/srv/shiny-server/requal") in R.
  • We advise using the renv package for managing the requal installation. This approach enables you to isolate each requal application instance and operate multiple versions on the same server.
  • Use the following script to install requal:
# install.packages("renv")
renv::install("RE-QDA/requal")
renv::snapshot(prompt = FALSE)
renv::isolate()
  • To update requal, run the script above.
  • Generate an R file named app.R in your application's directory.
  • Populate the app.R with:
requal::run_app(
  mode = "server",
  dbname = "YOUR_DATABASE_NAME",
  dbusername = "YOUR_DATABASE_OWNER",
  dbpassword = "YOUR_DATABASE_PASSWORD",
  credentials_path = "USER_DATABASE_NAME.sqlite",
  credentials_pass = "USER_DATABASE_PASSWORD"
)
  • After installing requal and configuring your application, reboot the Shiny Server service using the terminal command:
sudo systemctl restart shiny-server

Your requal application instance should now be accessible via the Shiny Server.

Security

As the administrator of the installation, you can dictate the level of access management to the application (e.g., restricting access to a firewall-protected VPN).

To supply passwords from your secrets' store, use the keyring package. Consult the keyring documentation for more information.

The handling of user logins and passwords by requal is explained in the shinymanager documentation. Please refer to it for more details.

Clone this wiki locally