Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cc9e7e2
Added JetBrains WebStorm config file to ignore list
danmenzies Feb 13, 2019
1176fbb
Added Amazon Cognito oAuth using Passport
danmenzies Feb 13, 2019
3a8f8aa
Added server start-up routine suitable for Windows x64 environments
danmenzies Feb 13, 2019
cce1c72
Added contributor's note for Jerram Digital
danmenzies Feb 13, 2019
bb815b5
Added BASIC error checking to Cognito Passport, added example files
danmenzies Feb 13, 2019
279586b
Removed unnecessary example files
danmenzies Feb 13, 2019
6428fd1
Merge pull request #2 from danmenzies-jerram/feature/aws-cognito
danmenzies-jerram Feb 13, 2019
d5163b9
Added Jira REST API connector, added example connection strings, adde…
danmenzies Feb 14, 2019
668da7d
Added Jira setup and notifications
danmenzies Feb 19, 2019
d0c0a00
Removed debugging code. Sorry :-(
danmenzies Feb 19, 2019
c74a4da
Removed unnecessary whitespace
danmenzies Feb 19, 2019
25a80f8
Pulled current version of master into this bug/windows-launch
danmenzies Feb 19, 2019
97e5772
Improved efficiency of Jira test code
danmenzies Feb 19, 2019
d9f8e12
Updated jira push to use jira config, instead of re-difining all cons…
danmenzies Feb 19, 2019
c2904c1
Updated declarations, to be more consistant
danmenzies Feb 19, 2019
c3c041a
Added error checking for Jira notifier
danmenzies Feb 19, 2019
a688737
Cleaning up Jira code
danmenzies Feb 19, 2019
1ce2e79
Cleaning up Jira code
danmenzies Feb 19, 2019
02ead81
Updated README to reflect *actual* product being supported (Jira Clou…
danmenzies Feb 19, 2019
ec64c05
Added cross-env, so x64 Windows Dev Machines can launch the server wi…
danmenzies Feb 19, 2019
7f4667b
Restored test/index.html to default, after accidental commit
danmenzies Feb 19, 2019
c07e78c
Updated NPM Package list
danmenzies Feb 19, 2019
7347b76
Removed unnecessary Cognito error checking
danmenzies Feb 19, 2019
f168e1d
Merge pull request #1 from danmenzies-jerram/bug/windows-launch
danmenzies-jerram Feb 19, 2019
b5dc274
Merged in master, ready for merge back
danmenzies Feb 19, 2019
a4f8184
Merge pull request #3 from danmenzies-jerram/feature/jira-notifictions
danmenzies-jerram Feb 19, 2019
1cd32c7
Pulled master into local branch, after updates
danmenzies Feb 19, 2019
f964ec6
Added cognito and SSL, updated documentation
danmenzies Feb 20, 2019
67f6e9b
Removed debugging code
danmenzies Feb 20, 2019
fab2819
Added SSL certificate path 'placeholders' to example config file
danmenzies Feb 20, 2019
040e132
Updated variable scopes and declarations
danmenzies Mar 5, 2019
52c7831
Merged in Jira & SSL Changes
danmenzies Mar 5, 2019
39bfd55
Refactored calls to SSL server
danmenzies Mar 6, 2019
2743101
Added constant declaration
danmenzies Mar 6, 2019
e72c37c
Merge branch 'master' into feature/cognito-enhancements
danmenzies-jerram Mar 6, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ yarn.lock
config.json
npm-debug.log
*.sublime-*
.DS_Store
.DS_Store
/.idea
/wordpress-comments.xml
84 changes: 83 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,92 @@ You will find further information on the [schnack page](https://schnack.cool/).
* slack
* rss
* sendmail
* [Jira Cloud](https://developer.atlassian.com/cloud/jira/platform/rest/v3/)

#### Setting up Jira

The Jira notifier adds a task to the backlog of your nominated project. This allows your team to assign a workflow to the moderation / approval process.

**1: Setup the Application in Jira**

1. Log into Jira using a privileged account, then visit [Atlassian Account API Token Manager](https://id.atlassian.com/manage/api-tokens)
1. Click _Create API Token_ and enter a label
1. When the [Your new API token](https://confluence.atlassian.com/cloud/files/938839638/938839639/1/1507010022324/Screen+Shot+2017-09-25+at+5.09.09+pm.png) modal is shown, click the _Copy to clipboard_ button
1. Using [your favourite Base64 Encoding tool](https://www.base64decode.org/), create the Base64 encoded string `my-email@example.com:my-copied-atlassian-token`
1. Copy the resulting string to the `notify.jira.basic_auth.base64` property

**2: Assign a board to receive notifications**

1. Collect a list of the boards available by running `npm run jira-boards`
2. Find the board you'd like to push notifications to, and note the `projectKey`
3. Add the `projectKey` to the `notify.jira.project_key`

**3: Test**

1. Send a test task to the board, by running `npm run jira-test`


**Authentication Providers:**

* Twitter
* GitHub
* Google Accounts
* Facebook
* Mastodon
* [AWS Cognito](https://aws.amazon.com/cognito/)

#### Setting up Cognito

**Set up a user pool**

1. Log in to your Amazon AWS Account, and find the Cognito service
1. Sign up for Cognito if you have not already
1. Click _Manage User Pools_
1. Click _Create a user pool_
1. Create a pool name (can be anything you like)
1. Click _Step Through Settings_ and follow the wizard to set up the new user pool

**Set up an authentication app**

1. From the main screen / control panel for your new user pool, click _App Integration=> App client settings_
1. Check _Enabled Identity Providers => Select All_ (making sure _Cognito User Pool_ is also checked)
1. Enter your Sign-in URL (`http://mydomain/auth/cognito/callback`)
1. Check _OAuth 2.0 => Authorization code grant_
1. Check **at least** _Allowed OAuth Scopes => aws.cognito.signin.user.admin_ (others can be used, if required)
1. Note the _App client => ID_, and copy to the `oauth.cognito.client_id` property in the `config.json` file

**Get / create a domain prefix**

1. From the main screen / control panel for your new user pool, click _App Integration=> Domain name_
1. If there isn't one already, create a new domain prefix
1. Note the domain prefix, and copy to the `oauth.cognito.domain_prefix` property in the `config.json` file
1. Note the region (between the `auth` and the `amazoncognito` parts of the domain, eg `eu-west-1`) and copy to the `oauth.cognito.region` property in the `config.json` file

**Get the client secret**

1. From the main screen / control panel for your new user pool, click _General settings => App clients_
1. Find the app you'd like to integrate (or create a new app client, if needed)
1. Click the _Show Details_ button
1. Note the App client secret, and copy and copy to the `oauth.cognito.client_secret` property in the `config.json` file

#### CORS Issues

If you bump into CORS issues when attempting authentication across different ports **during development**, you may need to use a proxy tunnel to pipe requests from one port to another. Eg:

`https://comments.localhost.lcl` => `https://localhost:8080`
`https://schnack.localhost.lcl` => `https://localhost:3000`

This can be achieved using third party servers like Apache or Nginx, combined with _Proxy Pass_ to forward traffic from a neutral port (like `443`), to the server ports.

If you do this, you will also need to update `test/index.html` with the address of the proxied Schnack server.

### Included SSL Certificates

The SSL Certificates included in the `/certs` directory are for **development purposes only**. These are used to make it possible to fetch data and perform authentication over SSL, on `localhost`. **DO NOT** use them in a production environment.

### Who is behind Schnack?

Schnack is [yet another](https://github.com/gka/canvid/) happy collaboration between [Webkid](https://webkid.io/) and [Gregor Aisch](https://www.vis4.net).
Schnack is [yet another](https://github.com/gka/canvid/) happy collaboration between [Webkid](https://webkid.io/) and [Gregor Aisch](https://www.vis4.net), with a few minor additions from [Jerram Digital](https://jerram.co.uk/).

### Who is using Schnack?

Expand Down
21 changes: 21 additions & 0 deletions certs/local.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDXTCCAkWgAwIBAgIJAOE6sLa+lkbXMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
aWRnaXRzIFB0eSBMdGQwHhcNMTkwMjIwMTMyMjA2WhcNMjAwMjIwMTMyMjA2WjBF
MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAtjgHIX9O6ROw3VHkE5eT39dJaDm60YPwiouHtaBIPXeFgFTTL91LMoG4
6AZ+n5Ec/UAEJoAdSs4kwyo6ChHnbEhrW83DGUtmKETWzmiNM00riBgHa/+GmNAh
fHIzGoNdmO3uffpvViGM38N5oQV4L9/tNuTAHfb9PRzsR1ghOaRBC+dxwmBaJ4Yh
AqN6Tqth6McmnHO/4ftvwDXCS1UcUEb7i8+yiyebu26PFpOhFrB7y+WtJpMNOCtS
ipQQGbEXEC/zqw3ptMWdQZ8BoaglV4UgDZoD97Gzvd55C4Yq5NMsVVFnuagM88nw
68iTmm38jC5U8WWnBP6ZAL2TCGvXfwIDAQABo1AwTjAdBgNVHQ4EFgQUpAoiHZdR
AcxspD5PDQhNDs2yXekwHwYDVR0jBBgwFoAUpAoiHZdRAcxspD5PDQhNDs2yXekw
DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABsM+QeUif6po0GY/SmHW
/zLY1NXJ6/Wvkdq2/ZJb3M49HpRFY6AES8aqfj2XOIPLExDXSiBiIHtYwVBcM9ka
PKOuFY/Pm7h9Ud19NGa3XdogztoQjd9nabILk9m1zLTFYmQXRTmBNoRbJqhx9Oqv
YSLgg0RaNqxqOdsjKVy799Uz17cATx95adkTRCCL3R9crpXoZ5sUuY66ax3NL4Ar
g2xVa/CU09fErqLwTgibzbDMNnphBNPOxFMVpqflZ1WXYlIysbKpO72ZaWT9428A
xALeoy1dFUaGC3/IAoELDJj9EqitUOyHT9uqvJ4aG0emM48agFOXAWu0bwtY2SNv
3w==
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions certs/local.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC2OAchf07pE7Dd
UeQTl5Pf10loObrRg/CKi4e1oEg9d4WAVNMv3UsygbjoBn6fkRz9QAQmgB1KziTD
KjoKEedsSGtbzcMZS2YoRNbOaI0zTSuIGAdr/4aY0CF8cjMag12Y7e59+m9WIYzf
w3mhBXgv3+025MAd9v09HOxHWCE5pEEL53HCYFonhiECo3pOq2Hoxyacc7/h+2/A
NcJLVRxQRvuLz7KLJ5u7bo8Wk6EWsHvL5a0mkw04K1KKlBAZsRcQL/OrDem0xZ1B
nwGhqCVXhSANmgP3sbO93nkLhirk0yxVUWe5qAzzyfDryJOabfyMLlTxZacE/pkA
vZMIa9d/AgMBAAECggEBAJOJ+fwdYH9H+kS5MbrLWGg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ilOknq95qSVJcSxE5Cg/QFvmFXlcR1aCG+VGXdgEkf0EW
2wrIkGpFbGjL2Q1a0/GFF7uOCoPaqi4BQQW6I6pruD/TCuL3B6lFjlhP5VAtl6iN
tyOO3Y1QKyMnjeucROUuo+cf
-----END PRIVATE KEY-----
18 changes: 18 additions & 0 deletions config.tpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
"mastodon": {
"app_name": "your website name",
"app_website": "https://blog.example.com/"
},
"cognito": {
"domain_prefix": "xxxxx",
"region": "xxxxx",
"client_id": "xxxxx",
"client_secret": "xxxxx"
}
},
"notify": {
Expand All @@ -41,7 +47,19 @@
},
"slack": {
"webhook_url": "xxxxx"
},
"jira": {
"host": "myhost.atlassian.net",
"project_key": "xxxxx",
"issue_type": "Story",
"basic_auth": {
"base64": "xxxxx"
}
}
},
"ssl": {
"certificate_path": "./certs/local.crt",
"certificate_key": "./certs/local.key"
},
"date_format": "MMMM DD, YYYY - h:mm a"
}
Loading