Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 2c8516e

Browse files
committed
Update configuration documentation for deployment
1 parent 22eb602 commit 2c8516e

File tree

1 file changed

+33
-32
lines changed

1 file changed

+33
-32
lines changed

configuration.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
11
# Topcoder x configuration
22

3-
Map the localhost to topcoderx.topcoder-dev.com or topcoderx.topcoder.com depending upon target topcoder environment by editing `hosts` file.
4-
5-
The following config parameters are supported, they are defined in `src/config.js` and can be configured in system environment:
3+
The following config parameters are supported, they are defined in `src/config.js` and can be configured as env variables:
64

75

86
| Name | Description | Default |
97
| :------------------------------------- | :----------------------------------------: | :------------------------------: |
10-
| PORT | the port the application will listen on | 80 |
11-
| API_VERSION | the API version | v1 |
12-
| LOG_LEVEL | the log level | info |
8+
| PORT | the port the application will listen on | 80 |
9+
| API_VERSION | the API version | v1 |
10+
| LOG_LEVEL | the log level | info |
1311
| MONGODB_URI | the MongoDB URI | mongodb://localhost:27017/topcoderx |
1412
| SESSION_SECRET | the session secret | kjsdfkj34857 |
15-
| GITHUB_CLIENT_ID | the GitHub client id | |
16-
| GITHUB_CLIENT_SECRET | the GitHub client secret | |
17-
| GITLAB_CLIENT_ID | the GitLab client id | |
18-
| GITLAB_CLIENT_SECRET | the GitLab client secret | |
13+
| GITHUB_CLIENT_ID | the GitHub client id | No default - needs to be set up using the instructions below |
14+
| GITHUB_CLIENT_SECRET | the GitHub client secret | No default - needs to be set up using the instructions below |
15+
| GITLAB_CLIENT_ID | the GitLab client id | No default - needs to be set up using the instructions below |
16+
| GITLAB_CLIENT_SECRET | the GitLab client secret | No default - needs to be set up using the instructions below |
1917
| WEBSITE | used as base to construct various URLs | http://topcoderx.topcoder-dev.com/ |
2018
| GITLAB_API_BASE_URL | The Gitlab API base URL | https://gitlab.com|
2119
|TOPIC | kafka topic| |
22-
|KAFKA_OPTIONS | kafka options| |
23-
| HOOK_BASE_URL | The generated ngrok url of receiver service|
24-
| TOPCODER_ENV | The topcoder environment to use, can support 'dev' or 'prod' | 'dev' |
25-
|LABELS| Labels we are going to add to the repository in the form of array of object with `name` and `colo` property. color should be hex code without hash||
20+
|KAFKA_OPTIONS | Kafka connection options| |
21+
|KAFKA_HOST | The Kafka host to connect to| localhost:9092 |
22+
|KAFKA_CLIENT_CERT | The Kafka SSL certificate to use when connecting| Read from kafka_client.cer file, but this can be set as a string like it is on Heroku |
23+
|KAFKA_CLIENT_CERT_KEY | The Kafka SSL certificate key to use when connecting| Read from kafka_client.key file, but this can be set as a string like it is on Heroku|
24+
| HOOK_BASE_URL | The base URL of the topcoder-x-receiver, used when adding webhooks automatically to repositories | |
25+
| TOPCODER_ENV | The topcoder environment to use, can support 'dev' or 'prod' | 'dev' |
26+
|LABELS| Labels we are going to add to the repository in the form of array of object with `name` and `color` property. Color should be hex code without hash||
2627

2728
## GitHub OAuth App Setup
2829

29-
- login into github.com
30-
- click the upper right avatar, then click `Settings`
31-
- click the left panel --> Developer settings --> OAuth Apps
32-
- click the `Register a new application`, fill in the fields,
33-
note that the `Authorization callback URL` should be the deployed web site,
30+
These instructions should be used to generate the GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET values for configuration
31+
32+
- Login into github.com
33+
- Click the upper right avatar, then click `Settings`
34+
- Click the left panel --> Developer settings --> OAuth Apps
35+
- Click the `Register a new application`, fill in the fields,
36+
note that the `Authorization callback URL` should be the deployed topcoder-x web site,
3437
for local deployment, it should be `http://topcoderx.topcoder-dev.com`
35-
- after creating the OAuth app, you can see its client id and client secret,
38+
- After creating the OAuth app, you can see its client id and client secret,
3639
these should be set to GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET environment variables
3740

3841
## GitLab OAuth App Setup
3942

40-
- login into gitlab.com
41-
- click the upper right avatar, then click `Settings`
42-
- click the `Applications` tab
43-
- enter application name, e.g. `Topcoder-x`
44-
- for Redirect URI, enter two callback URLs, one callback URL per line, so there are two lines:
43+
These instructions should be used to generate the GITLAB_CLIENT_ID and GITLAB_CLIENT_SECRET values for configuration
44+
45+
46+
- Login into gitlab.com
47+
- Click the upper right avatar, then click `Settings`
48+
- Click the `Applications` tab
49+
- Enter an application name, e.g. `Topcoder-X`
50+
- For Redirect URI, enter two callback URLs, one callback URL per line, so there are two lines:
4551
http://topcoderx.topcoder-dev.com/api/v1/gitlab/owneruser/callback
4652
http://topcoderx.topcoder-dev.com/api/v1/gitlab/normaluser/callback
47-
- for Scopes, check the `api` and `read_user`, the `api` is for owner user, the `read_user` is for normal user
48-
- finally click `Save application` to save the OAuth app, then you will see its generated Application Id and Secret,
53+
- For Scopes, check the `api` and `read_user`, the `api` is for owner user, the `read_user` is for normal user
54+
- Finally, click `Save application` to save the OAuth app, then you will see its generated Application Id and Secret,
4955
these should be set to GITLAB_CLIENT_ID and GITLAB_CLIENT_SECRET environment variables
5056

5157
## Topcoder environment
@@ -55,8 +61,3 @@ The following config parameters are supported, they are defined in `src/config.j
5561
To switch to production, simply change the TOPCODER_DEV to 'prod' and use topcoderx.topcoder.com
5662

5763
Default configuration is for topcoder-dev environment.
58-
59-
## Credentials
60-
61-
- for topcoder login in dev environment you can use any valid topcoder handle with default password 'appirio123'
62-
- for gitlab/github, you can use your own user account

0 commit comments

Comments
 (0)