gemini: ask the sysop before making a certificate

The BBS no longer makes a Gemini certificate by itself at startup.
bbs gemini cert asks for the host names (and addresses), organization
and years, shows what it will make and where, and makes it only on a
yes. It will not replace a certificate without -force, and keeps the
old one as .old. Without one, bbs serve stops and says to run it, and
bbs check says there is none yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSz48BzvGbSP2U45F8
This commit is contained in:
Claude committed 2026-11-09 05:25:40 +00:00
1 parent 8086ae7690
commit 1536e00a97
12 files changed
+332 -65

No files matched your search

+3 -3
View File
@@ -662,9 +662,9 @@ gemini: gopher's capsule over Gemini (gemini://, TLS): about the system, who is
| key | default | live | what it does |
|---|---|---|---|
| `address` | | | See the section above. Examples: `:1965`. |
| `hostname` | | | the name a certificate made here is for. Examples: `bbs.example.org`. |
| `cert_file` | | | the certificate and key (PEM); with neither, a self-signed one is made beside the database (gemini-cert.pem, gemini-key.pem) at the first start and kept: clients trust it on first use and warn if it ever changes. Examples: `/etc/bbs/gemini-cert.pem`. |
| `key_file` | | | the certificate and key (PEM); with neither, a self-signed one is made beside the database (gemini-cert.pem, gemini-key.pem) at the first start and kept: clients trust it on first use and warn if it ever changes. Examples: `/etc/bbs/gemini-key.pem`. |
| `hostname` | | | the host name bbs gemini cert offers for a new certificate. Examples: `bbs.example.org`. |
| `cert_file` | | | the certificate and key (PEM); with neither, gemini-cert.pem and gemini-key.pem beside the database, which bbs gemini cert makes (it asks for the host names, organization and years first). Clients trust it on first use and warn if it ever changes. Examples: `/etc/bbs/gemini-cert.pem`. |
| `key_file` | | | the certificate and key (PEM); with neither, gemini-cert.pem and gemini-key.pem beside the database, which bbs gemini cert makes (it asks for the host names, organization and years first). Clients trust it on first use and warn if it ever changes. Examples: `/etc/bbs/gemini-key.pem`. |
| `areas` | | | message areas shown (a wildmat of area names; "": none) Examples: `general,announcements`. |
| `files` | | | file areas listed and downloadable. Examples: `no`. |
| `users` | | | /users: look up a user, as finger tells of them. Examples: `yes`. |
+1 -1
View File
@@ -139,7 +139,7 @@ and answering, the page command (and that it runs no shell); two callers
chatting and paging on the text BBS; a 3270 (s3270) chatting with a text
caller and getting a node message on its message line. Finger,
gopher and Gemini: their answers and refusals, with the finger program and
curl as clients, and Gemini's certificate made once and kept. Customization: finding display files by terminal, SAUCE,
curl as clients, and `bbs gemini cert` asking before it makes a certificate. Customization: finding display files by terminal, SAUCE,
@-codes and widths, colour tags; menus and strings in the configuration
and what it refuses; a text caller through an ANSI logon (CP437 as it
is), the strings, a welcome screen, the sysop's menus and submenus, a
+34 -8
View File
@@ -77,8 +77,8 @@ $ lynx gopher://bbs.example.org
```
[gemini]
address = :1965
hostname = bbs.example.org ; the name a certificate made here is for
;cert_file = /etc/bbs/gemini-cert.pem ; or neither, for one made here
hostname = bbs.example.org ; offered by bbs gemini cert
;cert_file = /etc/bbs/gemini-cert.pem ; or neither, for bbs gemini cert's
;key_file = /etc/bbs/gemini-key.pem
areas = general,announcements ; as gopher's
files = no
@@ -99,12 +99,38 @@ a link or a heading. A file goes as it is, typed by its name
Gemini clients trust a capsule's certificate the first time they see it
and warn if it ever changes, so self-signed certificates are the usual
thing. With no `cert_file` and `key_file`, the BBS makes one for
`hostname` at its first start, beside the database (`gemini-cert.pem`,
`gemini-key.pem`), and keeps it; `bbs check` shows its SHA-256
fingerprint. Keep those two files with your backups: a new certificate
makes every client that has been before warn. A certificate from a
certificate authority (Let's Encrypt's, say) works too.
thing. The BBS never makes one by itself: with no `cert_file` and
`key_file`, make one with `bbs gemini cert` before starting it. It asks
what goes in the certificate, shows it, and makes it only when you say
yes:
```
$ bbs -config /etc/bbs/bbs.conf gemini cert
A certificate for the Gemini server, made here and signed by itself.
Clients trust it the first time they connect and warn if it ever changes:
make it once, and keep it (and its key) with your backups.
Host names callers use, by commas [bbs.example.org]: bbs.example.org, gemini.example.org
Organization (- for none) [D-Modem BBS]:
Years it is good for [20]:
For: bbs.example.org, gemini.example.org
Org: D-Modem BBS
Until: 2046-11-09
Files: /var/lib/bbs/gemini-cert.pem, /var/lib/bbs/gemini-key.pem
Make it? (yes/no) [no]: yes
Made: bbs.example.org, gemini.example.org until 2046-11-09, SHA-256 3F2A...
```
The first host name is the certificate's common name; addresses (IPv4 or
IPv6) can be listed too. The files go beside the database
(`gemini-cert.pem`, `gemini-key.pem`). Keep them with your backups: a new
certificate makes every client that has been before warn, which is why
`bbs gemini cert` will not replace one without `-force` (and then keeps
the old one as `.old`). `bbs check` shows the certificate's names, expiry
and SHA-256 fingerprint, or that there is none yet; without one, `bbs
serve` stops and says to make it. A certificate from a certificate
authority (Let's Encrypt's, say) works too: set `cert_file` and
`key_file`.
What gopher shows anyone, Gemini shows anyone: no areas and no files by
default, `bbs check` warns when `areas` or `files` is set, and file areas