Metadata-Version: 2.5
Name: secret_paste
Version: 0.0.4
Summary: The explainer and the paste-page link around a self-hosted, zero-knowledge secret paste (PrivateBin), rendered per site from one source
Project-URL: Homepage, https://github.com/thorwhalen/secret_paste
Project-URL: Repository, https://github.com/thorwhalen/secret_paste
Author: Thor Whalen
License-Expression: MIT
License-File: LICENSE
Keywords: encryption,explainer,pastebin,privatebin,secrets,zero-knowledge
Requires-Python: >=3.11
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == 'dev'
Description-Content-Type: text/markdown

# secret_paste

The pages around a self-hosted, zero-knowledge secret paste ([PrivateBin](https://privatebin.info/)), rendered per site from one source.

```bash
secret-paste explainer site.toml -o frontend/index.html
secret-paste privatebin-template site.toml -o server/secretpaste.php
```

`site.toml` holds what differs between sites:

```toml
operator = "Ada Lovelace"
site = "example.org"
paste_url = "https://secrets.apps.example.org/"     # where PrivateBin answers; its own host is best
explainer_url = "https://apps.example.org/secrets/" # where the explainer is served
voice = "I"                                          # "we" for a team
signin_phrase = "a sign-in"                          # "Creating a paste needs <this>"
brand = ""                                           # optional prefix in the page's kicker
og_image = ""                                        # optional social-card image URL
```

## What you get

- **The explainer** (`explainer`): one self-contained HTML page, no external loads. How the key stays in the link's `#fragment` and never reaches the server, an animated walk-through, a live in-page demo with the browser's Web Crypto, an honest threat model (a compromised server defeats it), and what the service stores and for how long.
- **The paste-page link** (`privatebin-template`): a PrivateBin template that includes upstream's `bootstrap5.php` unchanged and adds one "How this works" link near the top of the page. Mount it read-only at `/srv/tpl/secretpaste.php` in the official `privatebin/nginx-fpm-alpine` image and set `template = "secretpaste"` in `conf.php`. No fork: an image bump keeps upstream's page; if upstream ever renames the anchor, the page is served without the link rather than broken.

## Keeping copies current

A platform that commits the rendered files can check them in its tests:

```bash
secret-paste explainer site.toml -o frontend/index.html --check   # exit 1 when stale
```

or from Python:

```python
from secret_paste import Site, render_explainer

assert Path("frontend/index.html").read_text() == render_explainer(
    Site.from_mapping(tomllib.load(f))
)
```
