Once your ShinyProxy server is up and running, you need to maintain and update it. This section explains how to update existing apps and how to add new ones hassle free.
The most important part is adding apps:
The keys for the apps are the following (see the official docs). The three most important ones are:
id: the identifier of the application, this will also be part of the path to the app
container-cmd: the command that will be run when the Docker container is launched
container-image: name of the docker image to be started for every new user of this app
The Docker images need to be pulled beforehand. If you are using private images,
docker login will also be required before pulling images.
This step is optional if private registry access is needed for pulling Docker images.
Log into your droplet via ssh and lig into your registry via
(Docker Hub by default, use
docker login registry.gitlab.com for the GitLab
container registry). You will be asked to authenticate interactively
and your personal access token will be saved on the droplet for future use.
application.yml is ready,
cd into the directory where the configuration file is located and download the following script file:
The following command line arguments need to be passed to the
-i: path to your ssh key,
-s: user name (root for DigitalOcean droplets) and the IP address:
-f: path and file name to the yml with the ShinyProxy config, e.g.
The script then takes care of the rest:
- Copies the
application.ymlto the droplet,
- pulls the Docker images listed in the
application.ymlfile: updates the ones already pulled before, and the ones newly added too,
- and restarts the ShinyProxy and Docker services.
If the config file is not changing (i.e. no new apps added), you can set up cron job to regularly update the images that are already pulled to the server.
We have access to the cron utility: run
pick an editor (nano) if you haven't done so already and then add
these lines to the bottom and save it:
The cleanup command removes dangling (not needed) images that take up unnecessary space.
The second command updates all the images that are already present.
Check settings using
Cron jobs represent a polling type of update, which means we are regularly checking for updates. However, if changes to the images are infrequent, there is no need for constant polling. Setting cron intervals too large might lead to missing important updates.
Webhooks in general are considered a better alternative to polling, although webhooks require a bit more work. The next section will explain how to do it.