4

I am having trouble making my ShinyApps.io account install a private GitHub dependency:

First, on ShinyApps.io, I have authorized private repository access:

private access

Second, in my package that I am deploying, I have added the private dependency as a Remotes package in the DESCRIPTION file:

Remotes:
    myOrg/myDependency

Third, ShinyApps.io is and authorized application on GitHub under the repository settings.

However, when I attempt to manually deploy, ShinyApps is unable to find myDependency. I get an error that states:

Warning: Unable to determine the repository for package myDependency

What else do I need to check to be sure ShinyApps.io can reach and use my dependency

Dylan Russell
  • 936
  • 1
  • 10
  • 29

2 Answers2

1

Going to focusing on getting this working and not necessarily the most elegant or right solution here.

  1. Revoke access to shinyapps at https://github.com/settings/applications and re-establish the connection from shinyapps (make sure to include the organizational grant if your dependency repo is owned by an org and not you personally).

  1. Make the dependency install from github a source script as part of the beginning of your app launch?

Something like:

app.r

library(dplyr)
library(shiny)

source(private_dependency.R)

*app code here*

private_dependency.R

library(devtools)
install_github("hadley/private", auth_token = "abc")

Where auth_token is a value you generated at: https://github.com/settings/tokens

Comments on auth_token storage from the docs:

To install from a private repo, use auth_token with a token from https://github.com/settings/tokens. You only need the repo scope. Best practice is to save your PAT in env var called GITHUB_PAT.

Reference


  1. Support ticket? It just doesn't seem to me like anything about the github process here is verbose enough to know what's really going on.
sgdata
  • 2,543
  • 1
  • 19
  • 44
0

update 06.2023: I needed for some reasons to change the default location, the log in shinyapps.io said:

Warning in i.p(...) 'lib = "/opt/R/4.2.2/lib/R/library"' is not writable

So I added in app.R (before source("./private_dependency.R") code like this (put in proper 'myApp'):

`# NOTE log entry: Working directory: /srv/connect/apps/<myApp>
 # -> install here since default is not writable
 temp_path <- c("/srv/connect/apps/<myApp>", .libPaths())
 .libPaths(temp_path)`
4554888
  • 87
  • 1
  • 11