@pipeup/share 0.0.1 → 0.5.0
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/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/cli.js +1196 -0
- package/dist/pipeup+share.min.js +12 -0
- package/dist/share.esm.js +1 -0
- package/dist/share.headless.js +1 -0
- package/dist/share.min.js +1 -0
- package/dist/types/index.d.ts +10 -0
- package/package.json +58 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeup contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @pipeup/share
|
|
2
|
+
|
|
3
|
+
Shares a Pipeup page's comments through an encrypted service, so everyone who has the page sees the comments
|
|
4
|
+
others chose to share. Comments last while nobody is online, arrive within about 30 seconds while people are
|
|
5
|
+
commenting (a few minutes otherwise), keep working offline, and survive browsers that can't keep comments.
|
|
6
|
+
|
|
7
|
+
## What it sends, and to whom
|
|
8
|
+
|
|
9
|
+
> Sends the comments you choose to share, sealed so only people with this page can read them, to the sharing
|
|
10
|
+
> service the page names. That service sees when and how much is sent, and your network address.
|
|
11
|
+
|
|
12
|
+
- **Only to the address in the page's `data-pipeup-share`.** Nothing is sent when the attribute is missing, and
|
|
13
|
+
nothing is ever sent to anyone else.
|
|
14
|
+
- **Sealed before it leaves.** Comments are encrypted in the browser with a key that is in the page's address
|
|
15
|
+
(after the `#`), which no server receives. The service can't read or forge comments.
|
|
16
|
+
- **Only your own comments.** A reviewer's browser sends only that reviewer's comments, plus ones it received
|
|
17
|
+
from the shared copy. It never uploads comments someone else gave you by file or live review.
|
|
18
|
+
- **Comments written before sharing began wait for you.** The first time a page is shared, your earlier comments
|
|
19
|
+
are held until you choose "Share my N earlier comments" or "Keep them on this machine".
|
|
20
|
+
- **You can stop sending.** "Send my comments" is a switch. While it is off, new comments (and edits and replies
|
|
21
|
+
in those threads) stay on your machine, and you still see everyone else's.
|
|
22
|
+
- People who already have your comments, by file or live, could pass them on. Deleting a comment hides it
|
|
23
|
+
everywhere, but anyone who already received it keeps its words.
|
|
24
|
+
- The service sees when and how much is sent, and the network addresses of everyone reading and writing. Anyone
|
|
25
|
+
with the page can add unreadable data (Pipeup discards it) and, on a free service, fill the shared copy.
|
|
26
|
+
|
|
27
|
+
## Add it to a page
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/pipeup@0.4.1/dist/pipeup.min.js"></script>
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@pipeup/share@0.4.1/dist/share.min.js"></script>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
or one file, `pipeup+share.min.js`. The page needs a document identity (`data-pipeup-doc`) and a sharing address
|
|
35
|
+
(`data-pipeup-share`). Without either, the add-on stays off and says why; `Pipeup.addons()` shows the reason.
|
|
36
|
+
|
|
37
|
+
## Set up sharing (the author's command line)
|
|
38
|
+
|
|
39
|
+
Reviewers can't create a shared copy from inside the page; the author does it once:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
npx @pipeup/share create page.html --server https://paste.example.org/
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This makes a PrivateBin paste with discussions on and the longest expiry (`never`), reads it back and tells you
|
|
46
|
+
in words how long the instance keeps it, writes `data-pipeup-share` into `page.html` (every other byte stays as it
|
|
47
|
+
was), and prints the **stop key on the terminal only**. Keep the stop key private; never put it in the page.
|
|
48
|
+
|
|
49
|
+
| Command | What it does |
|
|
50
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `create <page.html> --server <url>` | makes the shared copy and writes its address into the page |
|
|
52
|
+
| `create … --from feedback.json` | also puts that file's comments into the shared copy |
|
|
53
|
+
| `create … --new-doc` | gives the page a document identity if it has none |
|
|
54
|
+
| `create … --mailbox` | uses your own server (below); a create token comes from `PIPEUP_MAILBOX_CREATE_TOKEN`, never the command line |
|
|
55
|
+
| `stop <page.html> --key <stop key>` | deletes the shared copy |
|
|
56
|
+
| `update <page.html>` | points the page at the newest copy (PrivateBin starts a newer one when a paste grows) |
|
|
57
|
+
|
|
58
|
+
Exit codes: 0 done; 1 the service or a file failed; 2 the command wasn't understood or needs something first.
|
|
59
|
+
|
|
60
|
+
### How much each reviewer downloads (PrivateBin)
|
|
61
|
+
|
|
62
|
+
PrivateBin returns the whole paste on every read, so the cost is the number of reads times the paste size:
|
|
63
|
+
|
|
64
|
+
| Paste size | Active (120 reads an hour) | Quiet (30) | Idle or hidden (12) |
|
|
65
|
+
| ------------------------------------------ | -------------------------- | ---------- | ------------------- |
|
|
66
|
+
| 50 KB (a few hundred comments) | 6 MB | 1.5 MB | 0.6 MB |
|
|
67
|
+
| 256 KB (just before a new copy is started) | 31 MB | 7.7 MB | 3 MB |
|
|
68
|
+
|
|
69
|
+
For documents with many reviewers, use your own instance or a large public one, and respect each volunteer
|
|
70
|
+
instance's rules. A mailbox reads only what is new: well under 1 MB an hour.
|
|
71
|
+
|
|
72
|
+
### What each kind of sharing keeps
|
|
73
|
+
|
|
74
|
+
| | PrivateBin | HTTP mailbox |
|
|
75
|
+
| ------------------------------------ | ---------------------------------------------------------- | ---------------------------- |
|
|
76
|
+
| Comments last while nobody is online | for the instance's retention | for the operator's retention |
|
|
77
|
+
| Live updates | polling, 30 s to 5 min | polling, 30 s to 5 min |
|
|
78
|
+
| Presence | no | no |
|
|
79
|
+
| Only holders of the page can read | yes | yes |
|
|
80
|
+
| Only holders can write | no: anyone with the address can add junk, which is dropped | with a write token, yes |
|
|
81
|
+
| The service can't read or forge | yes | yes |
|
|
82
|
+
| Missing comments can be detected | no | no |
|
|
83
|
+
| The author can delete it | the first copy only | yes |
|
|
84
|
+
|
|
85
|
+
## Your own server: the HTTP mailbox
|
|
86
|
+
|
|
87
|
+
A company that won't send even ciphertext to a volunteer PrivateBin can run its own server. The contract is four
|
|
88
|
+
endpoints and is published in the add-ons design (section 7.7); `@pipeup/mailbox` is a reference server. Pages
|
|
89
|
+
need `https:` addresses; the sharing address looks like `https://share.example.com/pipeup/m/<id>#pm1.<key>`
|
|
90
|
+
(with `.<write token>` when the operator turns tokens on).
|
|
91
|
+
|
|
92
|
+
## From code (agents, scripts)
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
import { connectShare } from "@pipeup/share/headless"; // over `pipeup/core`, Node 22 or later
|
|
96
|
+
const conn = await connectShare(doc, { share: pageShareAddress });
|
|
97
|
+
await conn.flush(); // reads what is new and sends everything waiting
|
|
98
|
+
conn.stop();
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
It uses the same transports, checks and send policy as the page, with no interface. The agent writes as its own
|
|
102
|
+
reviewer; it sends only its own comments (plus ones received from the shared copy).
|
|
103
|
+
|
|
104
|
+
## Notes
|
|
105
|
+
|
|
106
|
+
- Works from `file://`, `http(s)` pages and hosted pages. The browser build refuses `http:` addresses.
|
|
107
|
+
- Size: about 8 KB gzip.
|
|
108
|
+
- Licence: MIT.
|