|
1 |
| -# Installation |
| 1 | +# Installation |
| 2 | + |
| 3 | +This article explains how to install the Gitploy server for GitHub. |
| 4 | + |
| 5 | +## Step 1: Preparation |
| 6 | + |
| 7 | +### Provision an instance |
| 8 | + |
| 9 | +The server should be installed on a server or virtual machine with standard http and https ports open. |
| 10 | + |
| 11 | +### Create an OAuth Application |
| 12 | + |
| 13 | +[Create a GitHub OAuth application.](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app) The Client Key and Client Secret are used to authorize access to GitHub resources. |
| 14 | + |
| 15 | +*The authorization callback URL must match with the format:* `GITPLOY_SERVER_PROTO://GITPLOY_SERVER_HOST/signin`. |
| 16 | + |
| 17 | +Figure) Github OAuth |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +## Step 2: Download |
| 22 | + |
| 23 | +The server is distributed as a Docker image. The image is self-contained and does not have any external dependencies. We recommend to use the last version. |
| 24 | + |
| 25 | +``` |
| 26 | +docker pull gitployio/gitploy:0.2 |
| 27 | +``` |
| 28 | + |
| 29 | +## Step 3: Configuration |
| 30 | + |
| 31 | +The server is configured using environment variables. This article only configures with least environment. See [Configurations](../references/configurations.md) for a complete list of configuration options. |
| 32 | + |
| 33 | +* **GITPLOY_SERVER_HOST**: |
| 34 | +Required string value configures the user-facing hostname. This value is used to create webhooks and redirect urls. |
| 35 | + |
| 36 | +* **GITPLOY_SERVER_PROTO**: |
| 37 | +Optional string value configures the user-facing protocol. This value is used to create webhooks and redirect urls. It can be one of them: `http` or `https`, and the default value is `https`. |
| 38 | + |
| 39 | +* **GITPLOY_GITHUB_CLIENT_ID**: |
| 40 | +Required string value configures the GitHub OAuth client id. This is used to authorize access to GitHub on behalf of a Gitploy user. |
| 41 | + |
| 42 | +* **GITPLOY_GITHUB_CLIENT_SECRET**: |
| 43 | +Required string value configures the GitHub OAuth client secret. This is used to authorize access to GitHub on behalf of a Gitploy user. |
| 44 | + |
| 45 | +## Step 4: Start server |
| 46 | + |
| 47 | +The server container can be started with the below command. The container is configured through environment variables. |
| 48 | + |
| 49 | +```shell |
| 50 | +docker run \ |
| 51 | + --volume=/var/lib/gitploy:/data \ |
| 52 | + --env=GITPLOY_SERVER_HOST={{GITPLOY_SERVER_HOST}} \ |
| 53 | + --env=GITPLOY_SERVER_PROTO={{GITPLOY_SERVER_PROTO}} \ |
| 54 | + --env=GITPLOY_GITHUB_CLIENT_ID={{GITPLOY_GITHUB_CLIENT_ID}} \ |
| 55 | + --env=GITPLOY_GITHUB_CLIENT_SECRET={{GITPLOY_GITHUB_CLIENT_SECRET}} \ |
| 56 | + --publish=80:80 \ |
| 57 | + --publish=443:443 \ |
| 58 | + --restart=always \ |
| 59 | + --detach=true \ |
| 60 | + --name=gitploy \ |
| 61 | + gitployio/gitploy:0.2 |
| 62 | +``` |
0 commit comments