@patchstack/connect 0.5.17 → 0.5.19
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.
- package/AGENT-INSTALL.md +27 -2
- package/package.json +1 -1
package/AGENT-INSTALL.md
CHANGED
|
@@ -8,9 +8,15 @@ Use the package setup flow below for an existing JS/Node application. Work in it
|
|
|
8
8
|
|
|
9
9
|
### Plain HTML sites
|
|
10
10
|
|
|
11
|
-
For a standalone site made of HTML, CSS, and browser JavaScript, with no package-managed application or server request handler, use the Patchstack Connector directly. Do not create `package.json`, install a framework, invent build hooks, or add a server just to run Connect. `setup` requires an existing `package.json`; it is not a standalone HTML installer.
|
|
11
|
+
For a standalone site made of HTML, CSS, and browser JavaScript, with no package-managed application or server request handler, use the Patchstack Connector directly. Do not create `package.json`, install a framework, invent build hooks, or add a server just to run Connect, unless the person chooses that in step 1. `setup` requires an existing `package.json`; it is not a standalone HTML installer.
|
|
12
12
|
|
|
13
|
-
1. Use the public site UUID or widget snippet for the correct site in the Patchstack dashboard. An existing `.patchstackrc.json` can also supply `siteUuid`.
|
|
13
|
+
1. Use the public site UUID or widget snippet for the correct site in the Patchstack dashboard. An existing `.patchstackrc.json` can also supply `siteUuid`. Never invent a UUID or use a claim token or API key as the widget identifier. If neither is available, stop before editing the page and give the person these options in plain words, then wait for their choice:
|
|
14
|
+
|
|
15
|
+
- **Add the widget with a site from the dashboard.** They create an "Application" site in the Patchstack dashboard and paste its site ID or widget snippet. You add the tag in step 2. Nothing else is added to their folder. They get the widget only.
|
|
16
|
+
- **Create a Node project in the folder and let Connect set it up.** No trip to the dashboard first: `setup` creates the site and prints the link that connects it to their account. It adds `package.json`, a lockfile and `node_modules` to their folder. Packages they add later are checked for known security problems. A page with no packages of its own has little to check at first, and there is still no runtime protection without a server. Follow "Creating a Node project for a plain HTML site" below.
|
|
17
|
+
- **Stop here.** Nothing is changed.
|
|
18
|
+
|
|
19
|
+
Do not pick for them, and do not create the Node project unless they choose it.
|
|
14
20
|
2. Add one widget tag before `</body>` in the page or shared layout. Preserve an existing correct tag. For a page published directly without a build step, disable the widget's build-mode onboarding with `data-build-mode="false"`:
|
|
15
21
|
|
|
16
22
|
```html
|
|
@@ -22,6 +28,25 @@ For a standalone site made of HTML, CSS, and browser JavaScript, with no package
|
|
|
22
28
|
|
|
23
29
|
Report this as **Patchstack Connector installed**, with any remaining preview or publishing step. This path does not inventory local JavaScript files or scripts loaded from a CDN, scan npm dependencies, or install runtime exploit protection. External APIs used by the page require their own server-side integration.
|
|
24
30
|
|
|
31
|
+
#### Creating a Node project for a plain HTML site
|
|
32
|
+
|
|
33
|
+
Only when the person chose this option in step 1 above. Work in the folder that holds the site's pages.
|
|
34
|
+
|
|
35
|
+
1. Create the project and install Connect:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
npm init -y
|
|
39
|
+
npm install --save @patchstack/connect
|
|
40
|
+
npx @patchstack/connect setup
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
In a hosted builder, scope `PATCHSTACK_ENVIRONMENT=sandbox` to the `setup` command, as in "Automated setup". `setup` creates the site, writes its `siteUuid` to `.patchstackrc.json`, adds `"postinstall": "patchstack-connect scan"` to `package.json`, and prints the dashboard link. With no `build` script it adds no build steps.
|
|
44
|
+
2. Put the widget on the pages. `setup` adds the tag only to `index.html`, `public/index.html` or `src/app.html`. For any other page it lists the widget under `Missing` and prints the tag to add. Add one tag before `</body>` on each page, or in the shared layout. Because the pages are published without a build step, the tag needs `data-build-mode="false"`, as in step 2 above. If `setup` already added the tag to `index.html`, add that attribute to it. Later scans keep the attribute: they rewrite the tag only when the site ID changes.
|
|
45
|
+
3. Two `✘` lines are expected and need no fix:
|
|
46
|
+
- `Runtime protection: no server file found`. A plain HTML site has no server to guard. Do not add one. `setup` leaves a generic guard in `patchstack/`, which nothing loads until a server does.
|
|
47
|
+
- `Deploy project to protect live app`. Publishing the pages is the person's step.
|
|
48
|
+
4. End as in "The message you end on", with the dashboard link from the `Next:` line. Say that the widget, and a check of the packages the site installs, are active, and that runtime protection is not. Remind them to publish the pages when ready, and that `node_modules` is not part of the site. Do not publish anything yourself.
|
|
49
|
+
|
|
25
50
|
### JS/Node applications — the usual path
|
|
26
51
|
|
|
27
52
|
1. Check what is already done with `npx @patchstack/connect guide` (read-only). If the project is already provisioned, reuse it — see "Before you start — never install twice".
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patchstack/connect",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.19",
|
|
4
4
|
"description": "Runtime application security for JavaScript and Node.js: dependency inventory, attack-surface mapping, and an in-process guard that virtually patches known vulnerabilities and hardens responses.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"patchstack",
|