Skip to content

Commit

Permalink
Merge branch '4-social-instructions' into 'master'
Browse files Browse the repository at this point in the history
Instructions for connecting Linkedin, Twitter and Reddit

Closes #4

See merge request BigDataBoutique/elastiquill!15
  • Loading branch information
synhershko committed Apr 16, 2019
2 parents 60baee7 + 4a0380c commit 39aafad
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Once that is done, go to https://console.developers.google.com/apis/credentials,
* Authorized JavaScript origins to `hostname`
* Authorized redirect URIs to `https://hostname/api/auth/google/callback`

Where `hostname` is your blog DNS. Copy the Client ID and Client Secret and add them to your config.yml file.
Where `hostname` is your blog DNS. Copy the Client ID and Client Secret and add them to your `config.yml` file.

### Github

Expand All @@ -81,7 +81,27 @@ Set:
* Homepage URL to `hostname`
* Authorization callback URL to `hostname/api/auth/github/callback`

Where `hostname` is your blog DNS. Copy the Client ID and Client Secret and add them to your config.yml file.
Where `hostname` is your blog DNS. Copy the Client ID and Client Secret and add them to your `config.yml` file.

## Integration with social networks

You can connect your Linkedin, Twitter and Reddit accounts to Elastiquill to repost your blogposts from the admin panel.

### Linkedin
* Go to https://www.linkedin.com/developers/apps/new and create an app with default settings
* Under OAuth 2.0 settings, add a redirect URL `http://localhost:5000/api/connect/linkedin/callback`. Change `http://localhost:5000` to your `blog.url` configuration.
* In the app page, select the `Auth` tab. Copy the Client ID and Client Secret and add them to your `config.yml` file.

### Twitter
* Go to https://developer.twitter.com/en/apps/create
* Set Callback URL to `http://localhost:5000/api/social/twitter/callback`. Change `http://localhost:5000` to your `blog.url` configuration.
* `Sign in with Twitter` can be left disabled.
* In the app page, select the `Keys and tokens` tab. Copy Consumer and Access token keys, and add them to your `config.yml` file.

### Reddit
* Go to https://www.reddit.com/prefs/apps/ and create a `script` app. You can write any value in `redirect uri`.
* Copy Client ID (code under `personal use script` line) and Client Secret and add them to your `config.yml` file.
* Add account's username and password to `config.yml` file.

## Configuration

Expand Down Expand Up @@ -124,3 +144,13 @@ See [config.yml](config.yml) for a sample configuration file.
| credentials.aws.s3-bucket | S3 bucket | `AWS_S3_BUCKET` |
| credentials.aws.access-key-id | AWS access key ID | `AWS_ACCESS_KEY_ID` |
| credentials.aws.secret-access-key | AWS secret access key | `AWS_SECRET_ACCESS_KEY` |
| credentials.linkedin.client-id | Linkedin Client ID | `LINKEDIN_CLIENT_ID` |
| credentials.linkedin.client-secret | Linkedin Client Secret | `LINKEDIN_CLIENT_SECRET` |
| credentials.twitter.consumer-key | Twitter Consumer Key | `TWITTER_CONSUMER_KEY` |
| credentials.twitter.consumer-secret | Twitter Consumer Secret | `TWITTER_CONSUMER_SECRET` |
| credentials.twitter.access-token-key | Twitter access token key | `TWITTER_ACCESS_TOKEN_KEY` |
| credentials.twitter.access-token-secret | Twitter access token secret | `TWITTER_ACCESS_TOKEN_SECRET` |
| credentials.reddit.client-id | Reddit Client ID | `REDDIT_CLIENT_ID` |
| credentials.reddit.client-secret | Reddit Client Secret | `REDDIT_CLIENT_SECRET` |
| credentials.reddit.username | Reddit account username | `REDDIT_USERNAME` |
| credentials.reddit.password | Reddit account password | `REDDIT_PASSWORD` |
4 changes: 3 additions & 1 deletion backend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ function initConfig() {
['credentials.linkedin.client-id', 'LINKEDIN_CLIENT_ID'],
['credentials.linkedin.client-secret', 'LINKEDIN_CLIENT_SECRET'],
['credentials.reddit.client-id', 'REDDIT_CLIENT_ID'],
['credentials.reddit.client-secret', 'REDDIT_CLIENT_SECRET']
['credentials.reddit.client-secret', 'REDDIT_CLIENT_SECRET'],
['credentials.reddit.username', 'REDDIT_USERNAME'],
['credentials.reddit.password', 'REDDIT_PASSWORD']
];

envOverrides.forEach(override => {
Expand Down

0 comments on commit 39aafad

Please sign in to comment.