Skip to content

Commit

Permalink
Merge pull request #1172 from appirio-tech/dev
Browse files Browse the repository at this point in the history
Promoting Post Editor changes to production
  • Loading branch information
vikasrohit committed Sep 13, 2017
2 parents 504ac4a + 2c8509c commit a5d3fe4
Show file tree
Hide file tree
Showing 39 changed files with 6,268 additions and 6,655 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ SCSS Files
- Configure Emmet to work with React, e.g. classes expand to `className` instead of `class`
- Follow the instructions under [Get Emmet working](http://www.nitinh.com/2015/02/setting-sublime-text-react-jsx-development/)
- **Note:** Add the last snippet of code to `reg_replace.sublime-settings` by navigating to `Sublime Text -> Preferences -> Package Settings -> Reg Replace -> Settings-User`

© 2017 Topcoder. All Rights Reserved
49 changes: 49 additions & 0 deletions docs/LocalSetup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Start tc-message-service

Follow ``tc-message-service/local/README.md`` to setup the Discourse and tc-message-service locally.

- Note the Discourse has some strict validation constraints and we can loose them for dev (For example by default Discourse has **mailinator.com** email domain in blacklist, but we'll use some test users which have **mailinator.com** email addresses).

```shell
# Disable the email domain blacklist by setting an empty string
curl -X PUT 'http://talk.topcoder-dev.com:3002/admin/site_settings/email_domains_blacklist?api_key=<api_key>&api_username=system' -H 'content-type: application/x-www-form-urlencoded' -d email_domains_blacklist=''

# Refer to tc-message-service/local/README.md for more commands to configure Discourse
......
```



- Note the jwt token got from accounts.topcoder-dev.com cannot be verified locally (not knowing its secret key), so we'll use a loose auth strategy which just decodes the token without verfiying its signature. Start the tc-message-server by prepending *TC_MESSAGE_SERVICE_AUTH_LOOSE=true*:

```shell
TC_MESSAGE_SERVICE_AUTH_LOOSE=true npm run start:dev
```

The message service will be started at 8001 port.



# Configure reference lookup

Login to postgres either by install psql locally, or entering the postgres docker container:

```shell
psql messages coder -h local.topcoder-dev.com
```

And execute the following statement:

```sql
INSERT INTO "referenceLookups" (reference, endpoint, "createdAt", "updatedAt") VALUES ('project', 'https://api.topcoder-dev.com/v4/projects/{id}', now(), now());
```



# Start connect-app

```shell
CONNECT_MESSAGE_API_URL=http://localhost:8001 npm start
```

The connect app will be started at 3000 port.
Loading

0 comments on commit a5d3fe4

Please sign in to comment.