Skip to content

Commit a51f3c4

Browse files
committed
Update ct_worker/readme to mention scripts
1 parent 425a2f7 commit a51f3c4

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

crates/ct_worker/README.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,36 +104,48 @@ Follow these instructions to deploy a CT log with the `dev` configuration to Clo
104104
105105
Run the following for each of the `dev2025h1a` and `dev2025h2a` log shards to configure resources (or use `scripts/create-log.sh`):
106106
107-
1. Set log shard name and deployment environment.
107+
1. Set log shard name and deployment environment. The [location hint][location-hint] is optional.
108108
109-
export LOG_NAME=dev2025h1a
110-
export ENV=dev
109+
```bash
110+
export LOG_NAME=dev2025h1a
111+
export CLOUDFLARE_ACCOUNT_ID=some-account-id-here
112+
export ENV=dev
113+
export LOCATION=wnam # optional
114+
```
111115

112-
1. Create R2 bucket for public assets, optionally with a [location hint](https://developers.cloudflare.com/r2/reference/data-location/).
116+
1. Setup the roots kv namespace
113117

114-
npx wrangler r2 bucket create static-ct-public-${LOG_NAME} [--location <location>]
118+
```bash
119+
npx wrangler -e="${ENV}" kv namespace create static-ct-ccadb-roots --binding ccadb_roots
120+
```
115121

116-
1. Create KV namespace for per-log deduplication cache.
122+
**Alternatively run the script [create-root-kv.sh](./scripts/create-root-kv.sh)**
117123

118-
```text
119-
# After running, add generated namespace ID to `wrangler.jsonc`
120-
npx wrangler kv namespace create static-ct-cache-${LOG_NAME}
121-
```
124+
1. Create the the R2 bucket for public assets, the kv namespace for per-log
125+
deduplication cache and generate the [secrets][secrets-docs] for signing and witness keys.
122126

123-
1. Generate [secrets](https://developers.cloudflare.com/workers/configuration/secrets) for the signing and witness keys. NOTE: this will overwrite any existing secrets of the same name.
127+
```bash
128+
npx wrangler r2 bucket create static-ct-public-${LOG_NAME} [--location <location>]
129+
npx wrangler kv namespace create static-ct-cache-${LOG_NAME}
130+
openssl genpkey -algorithm ed25519 | npx wrangler -e=${ENV} secret put WITNESS_KEY_${LOG_NAME}
131+
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 | npx wrangler -e=${ENV} secret put SIGNING_KEY_${LOG_NAME}
132+
```
124133

125-
openssl genpkey -algorithm ed25519 | npx wrangler -e=${ENV} secret put WITNESS_KEY_${LOG_NAME}
126-
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 | npx wrangler -e=${ENV} secret put SIGNING_KEY_${LOG_NAME}
134+
**Alternatively, simply run the script [create-log.sh](./scripts/create-log.sh)**
127135

128-
(Note: For mtc_worker we use ed25519 for the signing key. There is no witness.)
136+
(Note: For mtc_worker we use ed25519 for the signing key. There is no witness.)
129137

130138
1. Deploy the worker. The worker will be available at `https://static-ct-${ENV}.<your-team>.workers.dev/logs/${LOG_NAME}`.
131139

132-
npx wrangler -e=${ENV} deploy
140+
```bash
141+
npx wrangler -e=${ENV} deploy
142+
```
133143

134144
1. Tail the worker:
135145

136-
npx wrangler -e=${ENV} tail
146+
```bash
147+
npx wrangler -e=${ENV} tail
148+
```
137149

138150
1. Send some requests. See [local development](#local-deployment) for examples.
139151

@@ -197,3 +209,7 @@ This project ports code from [sunlight](https://github.com/FiloSottile/sunlight)
197209
## License
198210

199211
The project is licensed under the [BSD-3-Clause License](./LICENSE).
212+
213+
214+
location-hint: https://developers.cloudflare.com/r2/reference/data-location/
215+
secrets-docs: https://developers.cloudflare.com/workers/configuration/secrets

0 commit comments

Comments
 (0)