Configure an agent with GitHub
Configuring your Moderne Agent instance with GitHub is a prerequisite for both viewing recipe results within the Moderne application and committing changes from a recipe.
This guide will walk you through configuring a new OAuth Application in GitHub
Prerequisites
  • Administrator access to your organization's GitHub account.

Step 1 - Create an OAuth application with client id and secret.

  1. 1.
    Navigate to the settings page for your organization: https://github.com/organizations/<yourorg>/settings/applications
  2. 2.
    Expand Developer settings on the bottom left of the page.
    ​
  3. 3.
    Click the New OAuth App button in the upper right of your screen.
  4. 4.
    Supply the required fields and Register the application. (See examples below)
    ​
  5. 5.
    On your newly created application click the Generate a new client secret button
    ​
  6. 6.
    Copy the Client ID and Client secret from this page; they will be used as arguments for the Moderne Agent.

Example values

Field
Example
Application Name
Moderne SaaS
Homepage URL
https://myorg.moderne.io
Authorization callback URL
https://myorg.moderne.io

Step 2 - Configure the Moderne Agent arguments

OCI Container
Executeable JAR
The following arguments must be provided in addition to the arguments provided in
. You can configure multiple GitHub OAuth Apps by including multiple entries with different indices. The Client ID and secret of each index must match up with the host for that index.
  • moderne_agent_github[{index}]_oauth_clientId - Client id configured in the previous step
  • moderne_agent_github[{index}]_oauth_clientSecret - Client secret configured in the previous step
  • moderne_agent_github[{index}]_url - fully-qualified hostname of running GitHub instance
By default, the OAuth app will only have access to public repositories within your organization(s). To provide the OAuth app access to private repositories, you can include the following optional configuration:
  • moderne_agent_github[{index}]_oauth_includePrivateRepos=true
​
Example (note that host, client id, and client secret are fake):
1
docker run \
2
...
3
-e moderne_agent_github_0_oauth_clientId=ABCDE\
4
-e moderne_agent_github_0_oauth_clientSecret=d70a0527 \
5
-e moderne_agent_github_0_oauth_includePrivateRepos=true \
6
-e moderne_agent_github_0_url=https://myorg.github.com \
7
...
Copied!
The following arguments must be provided in addition to the arguments provided in
. You can configure multiple GitHub OAuth Apps by including multiple entries with different indices. The private key of each index must match up with the host for that index.
  • moderne.agent.github[{index}].oauth.clientId - Client id configured in the previous step
  • moderne.agent.github[{index}].oauth.clientSecret - Client secret configured in the previous step
  • moderne.agent.github[{index}].url - fully-qualified hostname of running GitHub instance
​
By default, the OAuth app will only have access to public repositories within your organization(s). To provide the OAuth app access to private repositories, you can include the following optional configuration:
  • moderne_agent_github[{index}].oauth.includePrivateRepos=true
​
Note: system properties can be used in place of arguments. As an example, use -Dmoderne.agent.token={token_value} as an argument instead of --moderne.agent.token={token_value} as an argument.
Example (note that host, client id, and client secret are fake):
1
java -jar moderne-agent-{version}.jar \
2
...
3
--moderne.agent.github[0].oauth.clientId=ABCDE \
4
--moderne.agent.github[0].oauth.clientSecret=d70a0527 \
5
--moderne.agent.github[0].oauth.includePrivateRepos=true \
6
--moderne.agent.github[0].url=https://myorg.github.com \
7
...
Copied!
​
Export as PDF
Copy link
Contents