You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if not provided, then SSL connection is not used, direct insecure connection is used;
34
+
if provided, it can be either path to private key file or private key content
35
+
-**Topcoder API**
36
+
-`TC_API_V5_BASE_URL`: the TopCoder API V5 base URL
37
+
-**Notifications API**
38
+
-`API_CONTEXT_PATH`: path to serve API on
39
+
-**Machine to machine auth0 token**
40
+
-`AUTH0_URL`: auth0 URL
41
+
-`AUTH0_AUDIENCE`: auth0 audience
42
+
-`TOKEN_CACHE_TIME`: time period of the cached token
43
+
-`AUTH0_CLIENT_ID`: auth0 client id
44
+
-`AUTH0_CLIENT_SECRET`: auth0 client secret
45
+
46
+
### Connect notification server
38
47
Configuration for the connect notification server is at `connect/config.js`.
39
48
The following parameters can be set in config files or in env variables:
40
-
- TC_API_V3_BASE_URL: the TopCoder API V3 base URL
41
-
- TC_API_V4_BASE_URL: the TopCoder API V4 base URL
42
-
- TC_ADMIN_TOKEN: the admin token to access TopCoder API - same for V3 and V4<br>
43
-
Also it has probably temporary variables of TopCoder role ids for 'Connect Manager', 'Connect Copilot' and 'administrator':
44
-
- CONNECT_MANAGER_ROLE_ID: 8,
45
-
- CONNECT_COPILOT_ROLE_ID: 4,
46
-
- ADMINISTRATOR_ROLE_ID: 1<br>
47
-
Provided values are for development backend. For production backend they may be different.
48
-
These variables are currently being used to retrieve above role members using API V3 `/roles` endpoint. As soon as this endpoint is replaced with more suitable one, these variables has to be removed if no need anymore.
49
-
- TCWEBSERVICE_ID - id of the BOT user which creates post with various events in discussions
50
-
49
+
-**Topcoder API**
50
+
-`TC_API_V3_BASE_URL`: the TopCoder API V3 base URL
51
+
-`TC_API_V4_BASE_URL`: the TopCoder API V4 base URL
52
+
-`MESSAGE_API_BASE_URL`: the TopCoder message service API base URL
53
+
-**Topcder specific**<br>
54
+
Also it has probably temporary variables of TopCoder role ids for 'Connect Manager', 'Connect Copilot' and 'administrator':
55
+
-`CONNECT_MANAGER_ROLE_ID`: 8,
56
+
-`CONNECT_COPILOT_ROLE_ID`: 4,
57
+
-`ADMINISTRATOR_ROLE_ID`: 1<br>
58
+
Provided values are for development backend. For production backend they may be different.
59
+
These variables are currently being used to retrieve above role members using API V3 `/roles` endpoint. As soon as this endpoint is replaced with more suitable one, these variables has to be removed if no need anymore.
60
+
-`TCWEBSERVICE_ID` - id of the BOT user which creates post with various events in discussions
61
+
-**Machine to machine auth0 token**
62
+
-`AUTH0_URL`: auth0 URL
63
+
-`AUTH0_AUDIENCE`: auth0 audience
64
+
-`TOKEN_CACHE_TIME`: time period of the cached token
65
+
-`AUTH0_CLIENT_ID`: auth0 client id
66
+
-`AUTH0_CLIENT_SECRET`: auth0 client secret
67
+
-**Email notification service**
68
+
-`ENV`: environment variable (used to generate reply emails)
69
+
-`AUTH_SECRET`: auth secret (used to sign reply emails)
70
+
-`ENABLE_EMAILS`: if email service has to be enabled
71
+
-`ENABLE_DEV_MODE`: send all emails to the `DEV_MODE_EMAIL` email address
72
+
-`DEV_MODE_EMAIL`: address to send all email when `ENABLE_DEV_MODE` is enabled
73
+
-`MENTION_EMAIL`: recipient email used for `notifications.action.email.connect.project.post.mention` event
74
+
-`REPLY_EMAIL_PREFIX`: prefix of the genereated reply email address
75
+
-`REPLY_EMAIL_DOMAIN`: email domain
76
+
-`DEFAULT_REPLY_EMAIL`: default reply to email address, for example no-reply@topcoder.com
51
77
52
78
Note that the above two configuration are separate because the common notification server config
53
79
will be deployed to a NPM package, the connect notification server will use that NPM package,
@@ -67,31 +93,19 @@ so we can run `node test/token 305384` to generate a token to manage notificatio
67
93
The generated token is already configured in the Postman notification server API environment TOKEN variable.
68
94
You may reuse it during review.
69
95
70
-
71
-
## TC API Admin Token
72
-
73
-
An admin token is needed to access TC API. This is already configured Postman notification
74
-
server API environment TC_ADMIN_TOKEN variable.
75
-
In case it expires, you may get a new token in this way:
76
-
77
-
- use Chrome to browse connect.topcoder-dev.com
78
-
- open developer tools, click the Network tab
79
-
- log in with suser1 / Topcoder123, or mess / appirio123
80
-
- once logged in, open some project, for example https://connect.topcoder-dev.com/projects/1936 and in the network inspector
81
-
look for the call to the project api and get the token from the auth header, see
- for local development environment you can set variables as following:
87
-
-`authSecret`, `authDomain`, `validIssuers` can get from [tc-project-service config](https://github.com/topcoder-platform/tc-project-service/blob/dev/config/default.json)
98
+
-`AUTH_SECRET`,`VALID_ISSUERS` can get from [tc-project-service config](https://github.com/topcoder-platform/tc-project-service/blob/dev/config/default.json)
88
99
-`PORT=4000` because **connect-app** call this port by default
89
-
-`jwksUri` - any
90
100
-`KAFKA_TOPIC_IGNORE_PREFIX=joan-26673.` (with point at the end)
-`TC_ADMIN_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoic3VzZXIxIiwiZXhwIjoxNTEzNDAxMjU4LCJ1c2VySWQiOiI0MDE1MzkzOCIsImlhdCI6MTUwOTYzNzYzOSwiZW1haWwiOiJtdHdvbWV5QGJlYWtzdGFyLmNvbSIsImp0aSI6IjIzZTE2YjA2LWM1NGItNDNkNS1iY2E2LTg0ZGJiN2JiNDA0NyJ9.REds35fdBvY7CMDGGFyT_tOD7DxGimFfVzIyEy9YA0Y` or follow section **TC API Admin Token** to obtain a new one if expired
94
103
-`KAFKA_URL`, `KAFKA_CLIENT_CERT` and `KAFKA_CLIENT_CERT_KEY` get from [tc-bus-api readme](https://github.com/topcoder-platform/tc-bus-api/tree/dev)
104
+
- if you are willing to use notifications API which is hosted by the notifications server locally, you will need to use some patched `tc-core-library-js` module, which skips verification of user token. Because we don't know Topcoder `AUTH_SECRET` locally. So you can install this fork:
105
+
```
106
+
npm i https://github.com/maxceem/tc-core-library-js/tree/skip-validation
107
+
```
108
+
**WARNING** do not push package.json with this dependency as it skips users token validation.
95
109
- start local PostgreSQL db, create an empty database, update the config/default.js DATABASE_URL param to point to the db
96
110
- install dependencies `npm i`
97
111
- run code lint check `npm run lint`
@@ -130,5 +144,5 @@ In case it expires, you may get a new token in this way:
130
144
## Swagger
131
145
132
146
Swagger API definition is provided at `docs/swagger_api.yaml`,
0 commit comments