Setting up GitHub Integration
This section is for administrators - if you are looking for help on connecting to GitHub as an end-user of RSpace, please see GitHub Integration
Aim of this document
This section explains how, as an RSpace admin, you can set up RSpace to enable users to browse and import code snippets from GitHub into RSpace documents.
You don't need to do this if your RSpace web address has .researchspace.com domain. RSpace is supplied with default clientId and clientSecret. This work is only necessary if you prefer to create your own GitHub RSpace app for your users.
This is a one-off step - it does not need to be done for every RSpace user!
Pre-requisites
- An account on GitHub
- An organization on GitHub
- The account used on GitHub must have Admin rights on the organization.
- Access to RSpace server in order to set in clientIds and secret you will acquire from GitHub
- The RSpace server must allow 2-way HTTPS communication with GitHub
We recommend setting up the GitHub application in an organization, so that the application is not tied to a specific staff member. That said, it is possible to set up the GitHub application on a regular user account.
Setting up the app on GitHub
- Go to your organization, click on the Settings tab, then Developer Settings -> OAuth Apps.
- If you are setting up the application on a user, Click on your profile picture on the top right, then click on Settings.
- Click on the New OAuth app button.
- Fill in the form with the following information:
- Application Name: This will be displayed to your users. For example: RSpace GitHub Integration
- Homepage URL: This will be displayed to your users. We recommend using your RSpace instance URL.
- Application description: This is optional, and can be left blank.
- Authorization callback URL: this must be in the form of
https://<RSpace Instance URL>/app/github/redirect_uri(e.g.https://myresearchspace.com/app/github/redirect_uri) - Enable Device Flow: Leave unchecked.
- Click Register Application.
- You will then be taken to the OAuth App's settings page. Under Client Secrets, click on Generate a new client secret.
- Note both the Client ID and Client Secret displayed on the page.
Steps in RSpace
- Connect to the RSpace server using ssh, or Putty, or your preferred client
- Open
/etc/rspace/deployment.properties
and add the following properties:github.client.id=<the client ID from GitHub>github.secret=<the client secret from GitHub> - Save the file and restart RSpace
- Log into RSpace, go to System -> Configuration -> System Settings, then set
github.availableto Allowed.
Testing the App
- Logon to RSpace web application as an RSpace user and open Apps page. The GitHub integration should be listed under Disabled integrations.
- Click on the GitHub card, then click Enable.
- Click Add. This should take you through the GitHub authentication flow.
- You should now be able to link GitHub repositories to your RSpace account.