Skip to content

Commit 00361b1

Browse files
committed
Add Publishing Secrets page with pgp key generator
1 parent 5cf64c0 commit 00361b1

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

docs/directory.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
laika.navigationOrder = [
22
index.md
33
site.md
4+
secrets.md
45
faq.md
56
customization.md
6-
]
7+
]

docs/secrets.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Publishing Secrets
2+
3+
## Generate a PGP key
4+
5+
Key generation occurs locally in your browser using [OpenPGP.js](https://github.com/openpgpjs/openpgpjs).
6+
7+
<div>
8+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/openpgp.min.js"></script>
9+
<script type="text/javascript">
10+
async function tlGenerateKey() {
11+
const project = document.getElementById('project').value
12+
const email = document.getElementById('email').value
13+
const { publicKey, privateKey } = await openpgp.generateKey({
14+
userIDs: [{ name: `${project} bot`, email }]
15+
});
16+
document.getElementById('publicKey').value = publicKey;
17+
document.getElementById('privateKey').value = btoa(privateKey);
18+
}
19+
</script>
20+
21+
<label for="project"><b>Your project name:</b></label><br/>
22+
<input type="text" id="project" name="project" size="64"/><br/>
23+
<label for="email"><b>Your email:</b></label><br/>
24+
<input type="text" id="email" name="email" size="64"/><br/>
25+
<button onClick="tlGenerateKey()">Generate Key</button>
26+
27+
</div>
28+
29+
### Public key
30+
31+
Copy-paste and submit your public key to the [Ubuntu key server](https://keyserver.ubuntu.com/).
32+
33+
<textarea id="publicKey" readonly rows="16" cols="64" style="resize: none;"></textarea>
34+
35+
### Private key
36+
37+
Copy-paste and set your private key as the `PGP_SECRET` in your repository secrets.
38+
39+
<textarea id="privateKey" readonly rows="16" cols="64" style="resize: none;"></textarea>

0 commit comments

Comments
 (0)