Skip to content
A Docker stack of RStudio, VS Code, and Shiny Server; driven by ShinyProxy.
Branch: master
Clone or download
donald
donald updated docs.
Latest commit 09425fa May 4, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
content/_docs updated docs. May 4, 2019
controls added vscode May 3, 2019
influxdb initial Apr 3, 2019
rstudio_rshiny_vscode updated doc. May 4, 2019
shinyproxy updated doc. May 4, 2019
.env initial Apr 3, 2019
.gitignore Update .gitignore, CHANGELOG.md, and README Apr 11, 2019
CHANGELOG.md updated doc. May 3, 2019
README.md updated docs. May 4, 2019
control.sh added vscode May 3, 2019
docker-compose.yml added vscode May 3, 2019
resetup.sh added vscode May 3, 2019
setup.sh restructured repo; improved compatibility with SELinux. Apr 4, 2019

README.md

What is ShinyStudio?

NOTE: v1.0.0 is a major overhaul that includes many changes that are not backwards compatible. If you are running an existing version, backup existing content and re-setup from scratch.

The ShinyStudio project is an orchestration of Docker services with the goal of providing:

  • a collaborative, self-hosted development environment with a choice of IDE (RStudio or VS Code).
  • a centralized document repository, capable of displaying pre-rendered HTML, Markdown, or live, interactive RMarkdown documents.
  • a secure method for sharing web apps developed with RStudio Shiny.

The ShinyStudio ecosystem primarily consists of the products described below:

ShinyStudio is not a product; it is a project / ecosystem wholly composed of the above products. ShinyStudio is not affiliated with or supported by RStudio, Microsoft, or OpenAnalytics.

How to get it

Prereqs:

Setup your ShinyStudio site with:

# Clone this repository.
git clone https://github.com/dm3ll3n/ShinyStudio

# Enter the new directory.
cd ShinyStudio

# Setup and run.
./control.sh setup

This operation can take a few minutes.

Once complete, open a web browser and navigate to http://localhost:8080.

The default logins are:

  • user: user
  • admin: admin
  • superadmin: superadmin

Personal Branch

A “personal” branch of ShinyStudio exists. It’s configuration differs in a few key ways:

  • ShinyProxy only listens on the loopback interface (127.0.0.1)
  • The site is hosted on port 12345.
  • All users are admins.
  • Any local user can log in with default password changeme.

The setup slightly differs:

# Clone this repository.
git clone https://github.com/dm3ll3n/ShinyStudio -b personal

# Enter the new directory.
cd ShinyStudio

# Setup and run.
./control.sh setup "${HOME}/shinystudio"

The last argument to control.sh specifies the directory where content and settings will be stored.

Access

Authentication is managed by ShinyProxy, which supports basic auth, LDAP, Kerberos, and others (read more).

ShinyStudio defines three levels of access:

  • readers: can only view content from “Apps & Reports”, “Documents”, and “Personal”.
  • admins: can view all site content and develop content with RStudio and VS Code.
  • superadmins: can view and develop site content across multiple instances of ShinyStudio.

Admin/Superadmin landing page:

Readers:

Develop

Open your IDE of choice and notice two important directories:

  • __ShinyStudio__
  • __Personal__

Files must be saved in either of these two directories in order to persist between sessions.

These two folders are shared between instances RStudio, VS Code, and Shiny Server. So, creating new content is as simple as saving a file to the appropriate directory.

Tools

The ShinyStudio ecosystem comes with…

  • R
  • Python
  • PowerShell

…and ODBC drivers for:

  • SQL Server
  • PostgresSQL
  • Cloudera Impala.

These are persistent because they are built into the image.

Apps / drivers installed through RStudio/VS Code will not persist.

Libraries for R, Python, and PowerShell will persist. Additionally, user workspace settings (e.g. themes) are persistent.

Content

All persisted content is stored locally on the host system at:

/srv/shinystudio

To store files in another directory, edit the MOUNTPOINT variable in control.sh.

Configuration

Security

To apply a custom security configuration, modify the ShinyProxy configuration file for the site. All available options are detailed here.

./shinyproxy/config/sites/8080.yml

Open 8080.yml and edit the following lines as desired:

authentication: simple
users:
  - name: superadmin
    password: *change*me*
    groups: superadmins
  - name: admin
    password: *change*me*
    groups: admins
  - name: user
    password: *change*me*
    groups: readers

After modifying any part of the configuration, stop and re-setup the site with:

./control.sh setup

Multiple Sites

Multiple sites can be useful to segment content or provide unique customizations.

The configs below will setup two unique, independent instances of ShinyStudio, hosted on ports 8080, 8081.

./shinyproxy/config/sites/8080.yml
./shinyproxy/config/sites/8081.yml

Shared Content

It is possible to have multiple sites with independent configurations have access to the same content. To do this, name the file PORT_SITE.yml, where PORT is the port to broadcast on, and SITE is the port number of the site that already has content.

./shinyproxy/config/sites/8080.yml
./shinyproxy/config/sites/8081_8080.yml

Customizing

To customize the landing page, edit:

./shinyproxy/config/templates/grid-layout/index.html

To simply replace the background, replace the file below with the background desired background:

./shinyproxy/config/templates/grid-layout/assets/img/background.png

Reinstalling

Site content is never removed by any of the provided control scripts; you must do this manually, if desired.

To thoroughly remove and reinstall ShinyStudio:

# remove ShinyStudio Docker containers & images.
./control.sh remove

# remove site content!
sudo rm -rf "$MOUNTPOINT"

# removes *all* unused Docker volumes!
docker volume prune

# setup ShinyStudio
./control.sh setup

By removing existing images, the setup will pull the latest versions of the base Docker image for RStudio/Shiny.

References

Contributing

Pull requests are welcome and appreciated, particularly with:

  • Enhance the setup experience (e.g., parameterizing control.sh)
  • Enable Shiny bookmark functionality.
  • Shiny app to serve as searchable index page for each section.
  • Shiny app for viewing ShinyProxy events from InfluxDB.
  • Automated SSL setup
You can’t perform that action at this time.