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

Commit da37f70

Browse files
committed
Merge remote-tracking branch 'github/develop'
2 parents 1788b7b + 50f8efb commit da37f70

34 files changed

+1011
-621
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ Note: heroku domain should match subdomain of topcoder-dev or topcoder depending
7373

7474
## Verification
7575

76-
- run `npm serve` to start the app
76+
- run `npm run serve` to start the app
7777
- go to topcoderx.topcoder-dev.com and it will redirect to Topcoder login page, after successful login it will redirect back to Topcoder x app.
7878
- go to settings by clicking username at top right corner
7979
- setup both git provider to authorize topcoder-x to manage your repo on behalf of you
8080
- go to project management and create/edit projects, create hook and label
8181
- go to git access control menu and check list of groups have authorized
82-
- click get link button to get the shareable link which can be used by topcoder member to self assign to the repository.
82+
- click get link button to get the shareable link which can be used by topcoder member to self assign to the repository. Click to icon next to url to copy to clipboard.
83+
- normal member cannot use the application, allowed roles are configured in API, if normal user tries to access the app, error is shown in login page.
8384

configuration.md

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
1-
# Topcoder x configuration
1+
# 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 |
13-
| MONGODB_URI | the MongoDB URI | mongodb://localhost:27017/topcoderx |
8+
| PORT | the port the application will listen on | 80 |
9+
| API_VERSION | the API version | v1 |
10+
| LOG_LEVEL | the log level | info |
1411
| 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 | |
12+
| GITHUB_CLIENT_ID | the GitHub client id | No default - needs to be set up using the instructions below |
13+
| GITHUB_CLIENT_SECRET | the GitHub client secret | No default - needs to be set up using the instructions below |
14+
| GITLAB_CLIENT_ID | the GitLab client id | No default - needs to be set up using the instructions below |
15+
| GITLAB_CLIENT_SECRET | the GitLab client secret | No default - needs to be set up using the instructions below |
1916
| WEBSITE | used as base to construct various URLs | http://topcoderx.topcoder-dev.com/ |
2017
| GITLAB_API_BASE_URL | The Gitlab API base URL | https://gitlab.com|
21-
|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||
18+
| MONGODB_URI | The MongoDB URI. This needs to be the same MongoDB used by topcoder-x-receiver, topcoder-x-processor, and topcoder-x-site | mongodb://127.0.0.1:27017/topcoderx |
19+
|TOPIC | The Kafka topic where events are published. This must be the same as the configured value for topcoder-x-processor| |
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)