@tryghost/algolia-netlify 0.2.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -7
  2. package/package.json +5 -6
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ### Set up Algolia
8
8
 
9
- First step is to grap the API keys and Application ID from Algolia. For the setup we need both, the "Search-Only API Key" as well as the "Admin API Key".
9
+ First step is to grab the API keys and Application ID from Algolia. For the setup we need both, the "Search-Only API Key" as well as the "Admin API Key".
10
10
 
11
11
  The Admin API Key can either be the general one, or can be created just for this specific search index.
12
12
 
@@ -31,6 +31,7 @@ The Ghost Algolia tooling uses [Ghost Webhooks](https://ghost.org/docs/api/webho
31
31
  - Algolia Application ID
32
32
  - The Algolia Admin API key or and API key with the permissions as described above
33
33
  - The name of the index you want to use
34
+ - Set the `NETLIFY_KEY` to be used with the target URL
34
35
 
35
36
  ### Set up Ghost Webhooks
36
37
 
@@ -39,28 +40,32 @@ Ghost webhooks will initiate posts to be indexed to Algolia. This can be a new e
39
40
  1. `post.published`
40
41
  - Name: Post published
41
42
  - Event: Post published
42
- - Target URL: the endpoint of the post-published function, found on Netlify's admin panel (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-published)
43
+ - Target URL: the endpoint of the post-published function, found on Netlify's admin panel plus the `NETLIFY_KEY` as a query parameter as defined in the configuration data above (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-published?key=NETLIFY_KEY)
43
44
 
44
45
  2. `post.published.edited`
45
46
  - Name: Post updated
46
47
  - Event: Published post updated
47
- - Target URL: the endpoint of the post-published function, found on Netlify's admin panel (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-published)
48
+ - Target URL: the endpoint of the post-published function, found on Netlify's admin panel plus the `NETLIFY_KEY` as a query parameter as defined in the configuration data above (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-published?key=NETLIFY_KEY)
48
49
 
49
50
  3. `post.unpublished`
50
51
  - Name: Post unpublished
51
52
  - Event: Post unpublished
52
- - Target URL: the endpoint of the post-published function, found on Netlify's admin panel (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-unpublished)
53
+ - Target URL: the endpoint of the post-published function, found on Netlify's admin panel plus the `NETLIFY_KEY` as a query parameter as defined in the configuration data above (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-unpublished?key=NETLIFY_KEY)
53
54
 
54
- 4. `post.updated`
55
+ 4. `post.deleted`
55
56
  - Name: Post deleted
56
57
  - Event: Post deleted
57
- - Target URL: the endpoint of the post-published function, found on Netlify's admin panel (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-unpublished)
58
+ - Target URL: the endpoint of the post-published function, found on Netlify's admin panel plus the `NETLIFY_KEY` as a query parameter as defined in the configuration data above (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-unpublished?key=NETLIFY_KEY)
58
59
 
59
60
  These webhooks will trigger an index on every **future change of posts**.
60
61
 
61
62
  > To run an initial index of all the content, you can use the handy CLI from our Ghost Algolia tooling. Head over [here](https://github.com/TryGhost/algolia/tree/master/packages/algolia) and follow the instructions from there.
62
63
 
63
64
 
65
+ ## Security
66
+
67
+ To avoid unauthorized access to the Netlify functions endpoints, we highly recommend to setup the `NETLIFY_KEY` variable. This key is currently optional but will be enforced in the future.
68
+
64
69
  ## Develop
65
70
 
66
71
  This is a mono repository, managed with [lerna](https://lernajs.io/).
@@ -86,4 +91,4 @@ you will create a server on `localhost:9000` where your functions will be expose
86
91
 
87
92
  # Copyright & License
88
93
 
89
- Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE).
94
+ Copyright (c) 2013-2023 Ghost Foundation - Released under the [MIT license](LICENSE).
package/package.json CHANGED
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "name": "@tryghost/algolia-netlify",
3
- "version": "0.2.0",
3
+ "version": "0.3.2",
4
4
  "repository": "https://github.com/TryGhost/algolia/tree/master/packages/algolia-netlify",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
8
8
  "scripts": {
9
- "dev": "yarn serve",
9
+ "dev": "yarn build && netlify dev",
10
10
  "test": "NODE_ENV=testing mocha './test/**/*.test.js'",
11
11
  "lint": "eslint . --ext .js --cache",
12
12
  "posttest": "yarn lint",
13
- "serve": "netlify dev",
14
- "start": "NODE_ENV=production netlify functions:build --functions build/functions --src functions"
13
+ "build": "NODE_ENV=production netlify functions:build --functions build/functions --src functions"
15
14
  },
16
15
  "files": [
17
16
  "index.js",
@@ -39,7 +38,7 @@
39
38
  "eslint-plugin-ghost": "3.2.0",
40
39
  "eslint-plugin-import": "2.27.5",
41
40
  "mocha": "10.2.0",
42
- "netlify-cli": "15.6.0",
41
+ "netlify-cli": "15.7.0",
43
42
  "should": "13.2.3",
44
43
  "sinon": "15.2.0"
45
44
  },
@@ -47,5 +46,5 @@
47
46
  "@tryghost/algolia-fragmenter": "^0.2.5",
48
47
  "@tryghost/algolia-indexer": "^0.2.2"
49
48
  },
50
- "gitHead": "fb4018e348fa926cdb5c007fd2d0c71439ece6f2"
49
+ "gitHead": "dc344943864e0bc94accdec743c0ae041c4d3d4a"
51
50
  }