Skip to content

Commit 93c421b

Browse files
authored
Merge pull request #25693 from github/repo-sync
repo sync
2 parents 4ec14dd + c353cad commit 93c421b

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

content/apps/creating-github-apps/setting-up-a-github-app/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ children:
1818
- /choosing-permissions-for-a-github-app
1919
- /using-webhooks-with-github-apps
2020
- /making-a-github-app-public-or-private
21+
- /making-your-github-app-available-for-github-enterprise-server
2122
- /creating-a-github-app-from-a-manifest
2223
- /creating-a-github-app-using-url-parameters
2324
- /creating-a-custom-badge-for-your-github-app
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: Making your GitHub App available for GitHub Enterprise Server
3+
shortTitle: Share with GHES
4+
intro: 'In order for {% data variables.product.prodname_ghe_server %} instances to use your {% data variables.product.prodname_github_app %}, you must take some additional steps.'
5+
versions:
6+
fpt: '*'
7+
ghes: '*'
8+
ghae: '*'
9+
ghec: '*'
10+
topics:
11+
- GitHub Apps
12+
---
13+
14+
## About developing {% data variables.product.prodname_github_app %}s for {% data variables.product.prodname_ghe_server %}
15+
16+
If you want your {% data variables.product.prodname_github_app %} to be available to organizations in a {% data variables.product.prodname_ghe_server %} instance that you are not part of, you must take the following steps.
17+
18+
These steps are not required if your {% data variables.product.prodname_github_app %} will only be used by organizations in a {% data variables.product.prodname_ghe_server %} instance that you are part of.
19+
20+
## Each {% data variables.product.prodname_ghe_server %} instance must create their own {% data variables.product.prodname_github_app %}
21+
22+
Organizations owned by a {% data variables.product.prodname_ghe_server %} instance cannot install {% data variables.product.prodname_github_app %}s registered on {% data variables.product.prodname_dotcom_the_website %} or on another {% data variables.product.prodname_ghe_server %} instance. Instead, they must create and install their own {% data variables.product.prodname_github_app %} for use on that instance.
23+
24+
1. The app developer creates a manifest or URL parameters. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest)" and "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-using-url-parameters)."
25+
1. The app developer shares the manifest or URL parameters with the {% data variables.product.prodname_ghe_server %} instance that wants to use the app. The same manifest or URL parameters can be shared with multiple {% data variables.product.prodname_ghe_server %} instances.
26+
1. An organization owned by the instance creates a {% data variables.product.prodname_github_app %} from the manifest or URL parameters.
27+
1. The organization installs the {% data variables.product.prodname_github_app %} that they created.
28+
29+
Optionally, if the organization made the {% data variables.product.prodname_github_app %} public, other organizations within the instance can install the {% data variables.product.prodname_github_app %} as well. There is not a way to install a {% data variables.product.prodname_github_app %} on an entire instance, only on organizations within an instance.
30+
31+
## The app code must be able to access the {% data variables.product.prodname_github_app %} credentials for the instance
32+
33+
You app's code will need the credentials of the {% data variables.product.prodname_github_app %} that the {% data variables.product.prodname_ghe_server %} instance created. It will also need the hostname of the instance. You have two options: get the credentials and hostname from the instance, or share the app code with the instance.
34+
35+
### Get the credentials from the {% data variables.product.prodname_ghe_server %} instance
36+
37+
The instance can share their {% data variables.product.prodname_github_app %} credentials and hostname with the app developer. The instance should only do this if they trust the app developer. Then, the app code can use the appropriate credentials depending on what actions it is taking. The app developer must take precautions to use the appropriate set of credentials and to not leak data.
38+
39+
Advantages:
40+
41+
- The app developer controls the infrastructure that the app runs on.
42+
- The app developer has more control over app updates.
43+
- The app developer may have more insight into app performance.
44+
45+
Disadvantages:
46+
47+
- The app developer must take precautions to avoid leaking data from the instance.
48+
49+
### Share the app code with the {% data variables.product.prodname_ghe_server %} instance
50+
51+
The app developer can share the code for their app with the instance. Then, the instance can host the code on their own servers.
52+
53+
Advantages:
54+
55+
- The instance remains more secure because they aren't sharing their app credentials.
56+
- The app developer doesn't need to worry about leaking data from the instance.
57+
58+
Disadvantages:
59+
60+
- The app developer relies on the instance to provide the infrastructure and set things up correctly.
61+
- Releasing updates to the app code may be more complex.
62+
- The app developer may lose visibility about app performance.
63+
64+
## The app code must use the correct URLs
65+
66+
{% data variables.product.prodname_ghe_server %} uses different URLs than {% data variables.product.prodname_free_user %}, {% data variables.product.prodname_pro %}, {% data variables.product.prodname_team %}, and {% data variables.product.prodname_ghe_cloud %}. You should update your app code to use the appropriate URL depending on whether it is working with a {% data variables.product.prodname_ghe_server %} instance. Replace `HOSTNAME` with the hostname of the {% data variables.product.prodname_ghe_server %} instance.
67+
68+
{% data variables.product.prodname_free_user %}<br>{% data variables.product.prodname_pro %}<br>{% data variables.product.prodname_team %}<br>{% data variables.product.prodname_ghe_cloud %} | {% data variables.product.prodname_ghe_server %}
69+
--- | ---
70+
`https://api.github.com` | `https://HOSTNAME/api/v3`
71+
`https://api.github.com/graphql` | `https://HOSTNAME/api/v3/graphql`
72+
`https://github.com/login/oauth/authorize` | `https://HOSTNAME/login/oauth/authorize`
73+
`https://github.com/login/oauth/access_token` | `https://HOSTNAME/login/oauth/access_token`
74+
75+
## The app code must be aware of feature differences
76+
77+
New REST API endpoints, GraphQL objects, and webhooks are released to {% data variables.product.prodname_ghe_server %} at a later date than {% data variables.product.prodname_free_user %}, {% data variables.product.prodname_pro %}, {% data variables.product.prodname_team %}, and {% data variables.product.prodname_ghe_cloud %}. Additionally, there are multiple versions of {% data variables.product.prodname_ghe_server %}, and older versions may have different REST API endpoints, GraphQL objects, and webhooks.
78+
79+
Therefore, the app code needs to be aware of these differences. API responses and webhook payloads include a `x-github-enterprise-version` header for {% data variables.product.prodname_ghe_server %} payloads to help you determine what version you are handling.
80+
81+
## Each {% data variables.product.prodname_ghe_server %} instance can configure rate limits
82+
83+
Each {% data variables.product.prodname_ghe_server %} instance can configure its own rate limits. If your app is hitting a rate limit and is already taking precautions to stay under the rate limit, you should talk to the admin of the {% data variables.product.prodname_ghe_server %} instance.

0 commit comments

Comments
 (0)