@doguyilmaz/tapster 0.0.0-stage → 1.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +216 -2
  3. package/dist/cli.js +1001 -0
  4. package/package.json +32 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dogu Yilmaz
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 CHANGED
@@ -1,3 +1,217 @@
1
- # Temporary Holding Version
1
+ # tapster
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ tapster turns your Homebrew tap into the one place that signs, notarizes and publishes the releases of all your
4
+ projects. Each project only builds and opens a draft release. It holds no signing certificate, no notary key and no
5
+ tap token.
6
+
7
+ It covers command line tools written in Go (with GoReleaser) or Bun. Releases get Developer ID signatures, Apple
8
+ notarization, a Homebrew cask and, with Windows builds, a Scoop manifest. It also covers macOS apps that update
9
+ through Sparkle: the hub signs every piece of code in the app, builds and notarizes the DMG and signs the update feed.
10
+ Command line tools with Linux builds can also ship to apt and dnf from the hub's GitHub Pages site.
11
+
12
+ ## How it works
13
+
14
+ ```
15
+ project (push tag v1.2.3) hub: you/homebrew-tap
16
+ builds, attests, no secrets runs tapster on a schedule or when rung
17
+ -> draft release + checksums.txt -> signs and notarizes the macOS binaries
18
+ replaces the archives, publishes the release
19
+ writes Casks/<name>.rb and bucket/<name>.json
20
+ ```
21
+
22
+ 1. A project pushes a tag. Its workflow builds the archives, attests them and opens a draft release with
23
+ `checksums.txt`.
24
+ 2. The hub's `tapster` workflow finds drafts that are ready. It downloads them and checks every file against
25
+ `checksums.txt` and the project's build attestation. Then it signs and notarizes the macOS binaries.
26
+ 3. It swaps the signed archives into the draft, publishes the release and commits the cask and the Scoop manifest to
27
+ the hub.
28
+
29
+ The design, including the security model, is in
30
+ [docs/superpowers/specs/2026-10-18-tapster-design.md](docs/superpowers/specs/2026-10-18-tapster-design.md). Apps are in
31
+ [docs/superpowers/specs/2026-10-19-tapster-phase2-design.md](docs/superpowers/specs/2026-10-19-tapster-phase2-design.md),
32
+ the doorbell and Linux packages in
33
+ [docs/superpowers/specs/2026-10-19-tapster-phase3-design.md](docs/superpowers/specs/2026-10-19-tapster-phase3-design.md).
34
+
35
+ ## Set up a hub
36
+
37
+ You need [Bun](https://bun.sh) and the GitHub CLI (`gh auth login`). tapster serves repositories of a personal
38
+ account. To sign software for macOS you also need a Developer ID Application certificate exported as `.p12` and an App
39
+ Store Connect API key (`.p8`); a hub that ships only Linux or Windows builds needs neither.
40
+
41
+ ```sh
42
+ gh repo clone you/homebrew-tap && cd homebrew-tap
43
+ bunx @doguyilmaz/tapster init
44
+ ```
45
+
46
+ `init` protects the hub, creates a GitHub App for it and stores the App key and, if you sign for macOS, your Apple
47
+ credentials as secrets of a `tapster` environment that only the `main` branch can open. It checks the certificate type
48
+ and expiry and, on macOS, asks Apple whether the notary key works before storing it. It never prints them. Then it
49
+ writes `tapster.yml`, the workflow and a README; review and commit them. If it stops halfway, run it again: it skips
50
+ what is done. A private hub needs GitHub Pro for environments.
51
+
52
+ The workflow pins the exact tapster that ran `init`. The hub looks for drafts every 10 minutes. A private hub looks
53
+ every hour, because GitHub bills each of its runs as at least a minute; `--every <minutes>` changes it. To move a hub to a newer
54
+ tapster, run `bunx @doguyilmaz/tapster@<version> init --workflow` and review the diff. If the hub has a doorbell, run
55
+ `init --rotate doorbell` too, so the Worker gets the same version and schedule. A hub that moves to this version from
56
+ an earlier one refuses each project until you run `tapster add` in it once, which protects its branches and tags.
57
+
58
+ ## Add a project
59
+
60
+ Inside a clone of the project:
61
+
62
+ ```sh
63
+ bunx @doguyilmaz/tapster add
64
+ ```
65
+
66
+ - **Go with GoReleaser:** `add` turns on draft releases, names the checksum file `checksums.txt`, removes
67
+ `notarize`, `homebrew_casks`, `brews` and `scoops`. It adds an attestation step to the release workflow
68
+ (`--workflow` names it if it is not `release.yml`).
69
+ - **Bun:** `add` writes a release workflow whose build job cross-compiles every target without write access; a second
70
+ job attests the archives and opens the draft.
71
+
72
+ `add` asks once which hub publishes the project and remembers it. It then:
73
+
74
+ 1. protects the project so that only you can create, move or delete its branches and tags (a stolen App key could
75
+ otherwise tag code that the hub would sign). GitHub does not let personal repositories exempt Dependabot, so
76
+ `--allow-dependabot` leaves its `dependabot/...` branches open instead and adds `protection: dependabot` to the
77
+ entry, so the hub accepts that opening only where you wrote it down;
78
+ 2. opens a pull request on the hub with the project's entry, checked the way the hub checks it;
79
+ 3. opens the App's install page with the project selected, for one click;
80
+ 4. points the release workflow at the doorbell, if the hub has one.
81
+
82
+ Releases that a workflow tags by itself still work: `add --auto-tag` gives the project a deploy key that only its
83
+ default branch can use and prints the step that pushes the tag with it.
84
+
85
+ ## Apps
86
+
87
+ An app project builds the app in its own workflow and signs it ad hoc. It hands the app over as
88
+ `<App>-<version>.app.tar.gz` in a draft release. `tapster add` finds an XcodeGen `project.yml` or an `Info.plist`
89
+ with `SUFeedURL`, writes that workflow and prints the hub entry. The build job can only read the repository. A second
90
+ job attests the archive and opens the draft.
91
+
92
+ The hub then:
93
+
94
+ 1. checks the app before anything is signed: both version keys equal the tag, the bundle id, the feed address, the
95
+ pinned public key, the embedded Sparkle version and every nested bundle's identifier and name;
96
+ 2. signs every piece of code inside out with identifiers and entitlements it chooses itself (`code` in `tapster.yml`);
97
+ 3. builds the DMG without Finder, then signs, notarizes and staples it;
98
+ 4. signs the DMG and the appcast with the app's Sparkle key;
99
+ 5. publishes the DMG, the feed and `checksums.txt`, removes the unsigned archive and writes the cask.
100
+
101
+ The app must ask Sparkle for signed feeds. Set both keys in its `Info.plist`:
102
+
103
+ ```xml
104
+ <key>SURequireSignedFeed</key><true/>
105
+ <key>SUVerifyUpdateBeforeExtraction</key><true/>
106
+ ```
107
+
108
+ Store each Sparkle key once, from the Mac that holds it in its login keychain:
109
+
110
+ ```sh
111
+ bunx @doguyilmaz/tapster init --sparkle <label> --account <keychain account>
112
+ ```
113
+
114
+ It reads the key without showing it, checks it against the public key pinned in `tapster.yml`, asks you to confirm an
115
+ offline backup and stores it as the `SPARKLE_KEY_<LABEL>` secret. For a new app, `init --sparkle <label> --new` makes
116
+ the key, keeps it in your login keychain where Sparkle's own tools find it and prints the public key for
117
+ `SUPublicEDKey`. Apps that share a key share a label. Files that must
118
+ stay in every release unchanged, such as a frozen feed for old builds, go under `carry` with their digest.
119
+
120
+ ## Faster releases
121
+
122
+ The hub checks for drafts every 10 minutes. To start it within a minute instead, deploy the doorbell, a small
123
+ Cloudflare Worker on the free plan:
124
+
125
+ ```sh
126
+ bunx @doguyilmaz/tapster init --doorbell
127
+ ```
128
+
129
+ It signs you in to Cloudflare with Wrangler, creates a second GitHub App that may only start the hub's workflow, deploys
130
+ the Worker with that App's key and tells every project where the doorbell is. A project's release workflow then rings
131
+ it after opening the draft: it sends a short-lived GitHub token that proves which repository and tag it comes from, and
132
+ the Worker starts the hub. The Worker also starts the hub on the schedule's interval when no run started in that time,
133
+ because GitHub runs schedules on a best effort basis. It turns the workflow back on if GitHub paused it for
134
+ inactivity; a workflow you disabled stays off.
135
+
136
+ ## apt and dnf
137
+
138
+ Set `linux: true` on a command line tool with Linux builds and name a maintainer once:
139
+
140
+ ```yaml
141
+ linux: { maintainer: "Your Name <you@example.com>" }
142
+ packages:
143
+ - name: aims
144
+ linux: true
145
+ ```
146
+
147
+ Then make the signing key and turn on GitHub Pages for the hub:
148
+
149
+ ```sh
150
+ bunx @doguyilmaz/tapster init --linux
151
+ ```
152
+
153
+ The key also stays in your login keychain (or the Secret Service on Linux), because GitHub never gives secrets back.
154
+ `init --rotate linux` makes a new one; the old key keeps signing next to it until `init --rotate linux --finish`, so
155
+ apt and dnf users can fetch the new key first.
156
+
157
+ After each release the hub builds a `.deb` and an `.rpm` per architecture from the published Linux archives. A second
158
+ job, which holds the key, checks every package against those archives itself, signs the rpms and the repository
159
+ metadata and publishes the site. The site's front page shows users the two commands to add the repository.
160
+
161
+ ## Check the setup
162
+
163
+ ```sh
164
+ bunx @doguyilmaz/tapster doctor
165
+ ```
166
+
167
+ `doctor` runs in the hub clone. It reads the hub as it is on GitHub's `main` branch and checks every setting the hub's
168
+ security depends on: the workflow against the template, the environment, the rulesets, the Actions policy, who else
169
+ can push, the projects' protection and whether the hub ran in the last day. Each finding names the command that fixes
170
+ it.
171
+
172
+ A draft the hub will not publish turns the run red once and gets the reason at the top of its release notes, where the
173
+ project's owner sees it.
174
+
175
+ ## Security
176
+
177
+ - **One place for credentials.** The Apple certificate, the notary key and the App key live only in the hub's
178
+ `tapster` environment. Only workflows on `main` can open it. Projects hold nothing.
179
+ - **A stolen App key is not enough.** The App can write to the projects, so every project lets only you create or move
180
+ branches and tags. The hub signs a draft only when its tag exists and the draft and its files come from the
181
+ project's own workflow. tapster runs only from the hub workflow on `main`, stops when the App is installed on the hub
182
+ and stops when anyone but you changed `tapster.yml` or a workflow since your last push.
183
+ - **Nothing printed.** tapster reads each credential once, registers it and every derived value with the runner's
184
+ masking and removes it from the environment. On every change its CI runs each stage with known fake credentials:
185
+ the success path, GitHub errors (404, 422, 5xx and dropped connections), a broken certificate and a rejected
186
+ signature. It searches every log line for the fake values, in plain text and encoded. A second run uses them as real
187
+ secrets and fails if a tapster step prints anything the runner had to mask.
188
+ - **Short-lived access.** The hub reaches each project with an App token limited to that repository, revoked when the
189
+ work is done. Checking attestations gets a token that can only read them.
190
+ - **Only checked builds are signed.** Every file must match `checksums.txt`. Public projects must attest their
191
+ archives in their own release workflow. The hub verifies that before signing and checks the files once more right
192
+ before it publishes.
193
+ - **Only tapster's code sits next to a writing token.** Signing jobs hold no attestation rights; a separate job attests.
194
+ The hub runs no Homebrew; tapster's own CI checks the casks it renders with `brew style` and `brew audit`. The hub
195
+ allows only GitHub's actions and tapster's, pinned by commit.
196
+ - **Sparkle keys stay in the hub.** Only the step that signs the feed sees them. The key never reaches a command line
197
+ or a file. The hub refuses a key whose public half differs from the one installed copies trust.
198
+ - **Keys tapster makes are kept.** Sparkle and Linux keys that tapster creates are also saved in your keychain, where
199
+ every app must ask before reading them.
200
+ - **Packages are checked before they are signed.** The job that builds the Linux packages has no key. The job that signs
201
+ them rebuilds what each one must contain from the release and refuses scripts, dependencies, extra files or changed
202
+ files.
203
+ - **The doorbell can only knock.** Its App may start the hub's workflow and nothing else. It accepts only GitHub's own
204
+ tokens from your repositories, made for its address.
205
+
206
+ ## Limits
207
+
208
+ - tapster serves personal accounts, not organizations.
209
+ - Signing macOS code needs macOS runners, which are free for public repositories. Runs that sign nothing for macOS use
210
+ Ubuntu.
211
+ - The hub publishes private projects too, but a cask, a Scoop manifest or an apt and dnf package can only point at a
212
+ public project, because users download without a token.
213
+ - Homebrew asks users to trust a tap before it loads casks from it (`brew trust you/tap`); the hub's README says so.
214
+
215
+ ## License
216
+
217
+ MIT