Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
305 changes: 212 additions & 93 deletions .agents/skills/alchemy/SKILL.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .agents/skills/alchemy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"check": "bun scripts/build-skill.ts --check"
},
"dependencies": {
"effect": "4.0.0",
"effect": "4.1.4",
"yaml": "^2.9.1"
}
}
3 changes: 2 additions & 1 deletion .agents/skills/alchemy/references/acme/INDEX.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# acme index

8 pages. Manage TLS certificates independently of your hosting provider, at deploy time or from an application.
9 pages. Manage TLS certificates independently of your hosting provider, at deploy time or from an application.

| Page | File | Covers |
| --- | --- | --- |
Expand All @@ -12,3 +12,4 @@
| Runtime issuance | `runtime.md` | Deploy an authenticated Worker that issues and revokes certificates using a bound ACME account. |
| Troubleshooting | `troubleshooting.md` | Diagnose failed DNS challenges, rejected orders, rate limits, and runtime certificate operations. |
| Using certificates | `using-certificates.md` | Upload an ACME certificate to Fly or pass its chain and private key to another TLS consumer. |
| What is ACME? | `what-is-acme.md` | The concepts behind ACME certificates — certificate authorities, accounts, orders, challenges and DNS-01 validation, certificates and keys, renewal and revocation — and how @alchemy.run/acme models each of them. |
10 changes: 5 additions & 5 deletions .agents/skills/alchemy/references/acme/_overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- source: https://alchemy.run/acme
upstream: website/src/content/docs/acme/index.mdx
alchemy 2.0.0-beta.79 @ e354a45 -->
alchemy 2.0.0-beta.87 @ d1f364a -->

# ACME

Expand All @@ -12,6 +12,8 @@ certificates. Alchemy manages the account and certificate separately from the
service that terminates TLS. You can issue a certificate once and pass its PEM
chain and private key to Fly or another consumer.

**New to ACME?** [What is ACME?](/acme/what-is-acme) walks through certificate authorities, accounts, orders, DNS challenges, certificates, renewal and revocation, once each, and shows how Alchemy models every one.

## Choose when to issue

| | During deployment | From an application |
Expand Down Expand Up @@ -60,7 +62,5 @@ certificate in production.

The generated references document each property and method:

- [Account](/providers/acme/account)
- [Certificate](/providers/acme/certificate)
- [IssueCertificate](/providers/acme/issuecertificate)
- [IssueCertificateHttp](/providers/acme/issuecertificatehttp)
- [Account](/providers/acme/reference/account)
- [Certificate](/providers/acme/reference/certificate)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- source: https://alchemy.run/acme/certificate-authorities
upstream: website/src/content/docs/acme/certificate-authorities.mdx
alchemy 2.0.0-beta.79 @ e354a45 -->
alchemy 2.0.0-beta.87 @ d1f364a -->

# Certificate authorities

Expand Down Expand Up @@ -61,7 +61,7 @@ account. Obtain a matching key ID and HMAC key from ZeroSSL and put them in your
secret configuration as `ZEROSSL_EAB_KID` and `ZEROSSL_EAB_HMAC_KEY`.

```typescript
import * as ACME from "alchemy/ACME";
import * as ACME from "@alchemy.run/acme";
import * as Config from "effect/Config";

export const Issuer = ACME.Account("Issuer", {
Expand All @@ -86,7 +86,7 @@ const account = yield* Issuer;
const certificate = yield* ACME.Certificate("Api", {
account,
identifiers: ["api.example.com"],
solver: Cloudflare.DNS.AcmeSolver({
solver: Cloudflare.ACME.ZoneSolver({
zoneId: Config.String("CLOUDFLARE_ZONE_ID"),
}),
});
Expand Down
26 changes: 13 additions & 13 deletions .agents/skills/alchemy/references/acme/dns-validation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- source: https://alchemy.run/acme/dns-validation
upstream: website/src/content/docs/acme/dns-validation.mdx
alchemy 2.0.0-beta.79 @ e354a45 -->
alchemy 2.0.0-beta.87 @ d1f364a -->

# DNS validation

Expand All @@ -19,15 +19,15 @@ Inside the stack from [Getting started](/acme/getting-started):
const certificate = yield* ACME.Certificate("Site", {
account,
identifiers: ["example.com"],
solver: Cloudflare.DNS.AcmeSolver({
solver: Cloudflare.ACME.ZoneSolver({
zoneId: Config.String("CLOUDFLARE_ZONE_ID"),
}),
});
```

`AcmeSolver` returns serializable data containing the solver type and zone ID.
Include both `ACME.providers()` and `Cloudflare.providers()` in the stack. The
Cloudflare credentials must allow listing, creating, and deleting TXT records in
`ZoneSolver` returns serializable data containing the solver type and zone ID.
`Cloudflare.providers()` runs it with the profile's Cloudflare credentials, which
must allow listing, creating, and deleting TXT records in
that zone. The domain must already be delegated to that zone's nameservers.

## Use a managed zone instead
Expand All @@ -39,10 +39,10 @@ If your stack already owns a Cloudflare `Zone` resource, pass the resolved zone:
const certificate = yield* ACME.Certificate("Site", {
account,
identifiers: ["example.com"],
- solver: Cloudflare.DNS.AcmeSolver({
- solver: Cloudflare.ACME.ZoneSolver({
- zoneId: Config.String("CLOUDFLARE_ZONE_ID"),
- }),
+ solver: Cloudflare.DNS.AcmeSolver(zone),
+ solver: Cloudflare.ACME.ZoneSolver(zone),
});
```

Expand Down Expand Up @@ -80,7 +80,7 @@ possible.
const certificate = yield* ACME.Certificate("Site", {
account,
identifiers: ["example.com", "*.example.com"],
solver: Cloudflare.DNS.AcmeSolver(zone),
solver: Cloudflare.ACME.ZoneSolver(zone),
+ propagation: {
+ delay: "60 seconds",
+ timeout: "90 seconds",
Expand Down Expand Up @@ -120,11 +120,11 @@ Inside a Worker's initialization Effect:

```typescript
const dns = yield* Cloudflare.DNS.WriteDns(Zone);
const solver = Cloudflare.DNS.acmeDnsSolver(dns);
const solver = Cloudflare.ACME.zoneSolver(dns);
```

The runtime helper is **`acmeDnsSolver`**, while the deploy-time helper is
**`AcmeSolver`**. Provide `Cloudflare.DNS.WriteDnsHttp` on the host Effect. Its
The runtime helper is **`zoneSolver`**, while the deploy-time helper is
**`ZoneSolver`**. Provide `Cloudflare.DNS.WriteDnsHttp` on the host Effect. Its
client uses a zone-scoped token created at deployment, rather than exposing the
deployer's entire credential set to the application.

Expand All @@ -149,7 +149,7 @@ hosting and scheduling implications.
A custom solver adapts an existing DNS client's idempotent operations:

```typescript
import type * as ACME from "alchemy/ACME";
import type * as ACME from "@alchemy.run/acme";
import type * as Effect from "effect/Effect";

export const makeSolver = <R>(dns: {
Expand Down Expand Up @@ -178,7 +178,7 @@ For an adapter whose client has no remaining Effect requirements, register a
factory with this shape:

```typescript
import * as ACME from "alchemy/ACME";
import * as ACME from "@alchemy.run/acme";
import type * as Effect from "effect/Effect";

export const registerExampleDns = (
Expand Down
26 changes: 14 additions & 12 deletions .agents/skills/alchemy/references/acme/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<!-- source: https://alchemy.run/acme/getting-started
upstream: website/src/content/docs/acme/getting-started.mdx
alchemy 2.0.0-beta.79 @ e354a45 -->
alchemy 2.0.0-beta.87 @ d1f364a -->

# Getting started

> Issue a staging TLS certificate with Let's Encrypt and an existing Cloudflare DNS zone.

This guide issues a certificate for a domain you control. It uses Let's Encrypt
Issue a certificate for a domain you control from Let's Encrypt
staging, so you can validate the deployment without consuming production issuance
limits. The resulting certificate is deliberately **not trusted by browsers**.

## Prepare the project

Install Alchemy and the matching Effect version using [Cloudflare setup](/cloudflare/setup).
Install Alchemy and the matching Effect version using [Cloudflare setup](/cloudflare/setup),
then add `@alchemy.run/acme`.
You need an active Cloudflare DNS zone, its zone ID, and credentials that can read,
create, and delete DNS records in that zone. The domain's authoritative nameservers
must already point to Cloudflare.

Use a domain you own wherever this guide says `example.com`. Set
Use a domain you own wherever the examples say `example.com`. Set
`CLOUDFLARE_ZONE_ID` in your project's `.env` to the zone ID from its Cloudflare
dashboard. This example references the existing zone by ID; it does not create,
adopt, modify the settings of, or delete the zone itself.
Expand Down Expand Up @@ -47,8 +48,8 @@ shared deployment runner, use a protected [remote state store](/state-store).
## Register the providers

```diff lang="typescript"
+import * as ACME from "alchemy/ACME";
+import * as Cloudflare from "alchemy/Cloudflare";
+import * as ACME from "@alchemy.run/acme";
+import * as Cloudflare from "@alchemy.run/cloudflare";

export default Alchemy.Stack(
"Certificates",
Expand All @@ -59,8 +60,9 @@ shared deployment runner, use a protected [remote state store](/state-store).
+ },
```

`ACME.providers()` manages accounts and certificates. `Cloudflare.providers()`
registers the Cloudflare DNS solver used to prove control of the domain.
`ACME.providers()` manages accounts and certificates, and
`Cloudflare.providers()` includes the Cloudflare DNS solver used to prove
control of the domain.

## Connect Cloudflare

Expand Down Expand Up @@ -104,7 +106,7 @@ reuses on subsequent deployments.
+ const certificate = yield* ACME.Certificate("Site", {
+ account,
+ identifiers: ["example.com"],
+ solver: Cloudflare.DNS.AcmeSolver({
+ solver: Cloudflare.ACME.ZoneSolver({
+ zoneId: Config.String("CLOUDFLARE_ZONE_ID"),
+ }),
+ });
Expand Down Expand Up @@ -143,8 +145,8 @@ The steps above produce this `alchemy.run.ts`:

```typescript
import * as Alchemy from "alchemy";
import * as ACME from "alchemy/ACME";
import * as Cloudflare from "alchemy/Cloudflare";
import * as ACME from "@alchemy.run/acme";
import * as Cloudflare from "@alchemy.run/cloudflare";
import * as Config from "effect/Config";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
Expand All @@ -164,7 +166,7 @@ export default Alchemy.Stack(
const certificate = yield* ACME.Certificate("Site", {
account,
identifiers: ["example.com"],
solver: Cloudflare.DNS.AcmeSolver({
solver: Cloudflare.ACME.ZoneSolver({
zoneId: Config.String("CLOUDFLARE_ZONE_ID"),
}),
});
Expand Down
6 changes: 3 additions & 3 deletions .agents/skills/alchemy/references/acme/renewal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- source: https://alchemy.run/acme/renewal
upstream: website/src/content/docs/acme/renewal.mdx
alchemy 2.0.0-beta.79 @ e354a45 -->
alchemy 2.0.0-beta.87 @ d1f364a -->

# Renewal & revocation

Expand All @@ -18,7 +18,7 @@ In the certificate from [Getting started](/acme/getting-started):
const certificate = yield* ACME.Certificate("Site", {
account,
identifiers: ["example.com"],
solver: Cloudflare.DNS.AcmeSolver({
solver: Cloudflare.ACME.ZoneSolver({
zoneId: Config.String("CLOUDFLARE_ZONE_ID"),
}),
+ renewBefore: "30 days",
Expand Down Expand Up @@ -73,7 +73,7 @@ process needs explicit revocation after cutover.
const certificate = yield* ACME.Certificate("Site", {
account,
identifiers: ["example.com"],
solver: Cloudflare.DNS.AcmeSolver({
solver: Cloudflare.ACME.ZoneSolver({
zoneId: Config.String("CLOUDFLARE_ZONE_ID"),
}),
+ revokeOnDelete: true,
Expand Down
18 changes: 9 additions & 9 deletions .agents/skills/alchemy/references/acme/runtime.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- source: https://alchemy.run/acme/runtime
upstream: website/src/content/docs/acme/runtime.mdx
alchemy 2.0.0-beta.79 @ e354a45 -->
alchemy 2.0.0-beta.87 @ d1f364a -->

# Runtime issuance

Expand Down Expand Up @@ -40,7 +40,7 @@ issuance allowance.
Create `resources.ts`:

```typescript
import * as ACME from "alchemy/ACME";
import * as ACME from "@alchemy.run/acme";
import * as Config from "effect/Config";

export const Issuer = ACME.Account("Issuer", {
Expand All @@ -63,7 +63,7 @@ Add a zone resource to `resources.ts`:

```typescript
import { adopt } from "alchemy/AdoptPolicy";
import * as Cloudflare from "alchemy/Cloudflare";
import * as Cloudflare from "@alchemy.run/cloudflare";
import { retain } from "alchemy/RemovalPolicy";

export const Zone = Cloudflare.Zone.Zone("DnsZone", {
Expand Down Expand Up @@ -117,7 +117,7 @@ serialization; possession of a DNS token alone is not tenant authorization.
```typescript
const issued = yield* issuer.issue({
identifiers: ["api.example.com"],
solver: Cloudflare.DNS.acmeDnsSolver(dns),
solver: Cloudflare.ACME.zoneSolver(dns),
});
```

Expand All @@ -142,8 +142,8 @@ Create `issuer-worker.ts`. This complete file combines the bindings, authorizati
and two operations above:

```typescript
import * as ACME from "alchemy/ACME";
import * as Cloudflare from "alchemy/Cloudflare";
import * as ACME from "@alchemy.run/acme";
import * as Cloudflare from "@alchemy.run/cloudflare";
import * as Config from "effect/Config";
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
Expand Down Expand Up @@ -176,7 +176,7 @@ export default class IssuerWorker extends Cloudflare.Worker<IssuerWorker>()(
if (pathname === "/issue") {
const issued = yield* issuer.issue({
identifiers: ["api.example.com"],
solver: Cloudflare.DNS.acmeDnsSolver(dns),
solver: Cloudflare.ACME.zoneSolver(dns),
});
return yield* HttpServerResponse.json(
{
Expand Down Expand Up @@ -242,8 +242,8 @@ Create `alchemy.run.ts`:

```typescript
import * as Alchemy from "alchemy";
import * as ACME from "alchemy/ACME";
import * as Cloudflare from "alchemy/Cloudflare";
import * as ACME from "@alchemy.run/acme";
import * as Cloudflare from "@alchemy.run/cloudflare";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import IssuerWorker from "./issuer-worker.ts";
Expand Down
15 changes: 5 additions & 10 deletions .agents/skills/alchemy/references/acme/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- source: https://alchemy.run/acme/troubleshooting
upstream: website/src/content/docs/acme/troubleshooting.mdx
alchemy 2.0.0-beta.79 @ e354a45 -->
alchemy 2.0.0-beta.87 @ d1f364a -->

# Troubleshooting

Expand All @@ -14,15 +14,10 @@ values, and authorization headers out of logs.
## Missing DNS solver

`ACME.DnsSolverNotRegistered` means the descriptor's `type` has no registered
factory in the stack's provider context. For Cloudflare, register both providers:

```typescript
const providers = Layer.mergeAll(ACME.providers(), Cloudflare.providers());
```

Pass this layer as the stack's `providers`. For runtime issuance, use
`acmeDnsSolver(dns)` with a bound DNS client instead of passing the deploy-time
descriptor returned by `AcmeSolver`.
factory in the stack's provider context. `ACME.providers()` registers the
Cloudflare solver, so include it in the stack's `providers`. For runtime issuance, use
`zoneSolver(dns)` with a bound DNS client instead of passing the deploy-time
descriptor returned by `ZoneSolver`.

## DNS API access fails

Expand Down
12 changes: 6 additions & 6 deletions .agents/skills/alchemy/references/acme/using-certificates.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- source: https://alchemy.run/acme/using-certificates
upstream: website/src/content/docs/acme/using-certificates.mdx
alchemy 2.0.0-beta.79 @ e354a45 -->
alchemy 2.0.0-beta.87 @ d1f364a -->

# Using certificates

Expand Down Expand Up @@ -28,7 +28,7 @@ consumer needs the **certificate's** private key, never the account's key.
Start with the [Getting started](/acme/getting-started) stack and add Fly:

```diff lang="typescript"
+import * as Fly from "alchemy/Fly";
+import * as Fly from "@alchemy.run/fly";

- providers: Layer.mergeAll(ACME.providers(), Cloudflare.providers()),
+ providers: Layer.mergeAll(
Expand Down Expand Up @@ -79,9 +79,9 @@ with your own values:

```typescript
import * as Alchemy from "alchemy";
import * as ACME from "alchemy/ACME";
import * as Cloudflare from "alchemy/Cloudflare";
import * as Fly from "alchemy/Fly";
import * as ACME from "@alchemy.run/acme";
import * as Cloudflare from "@alchemy.run/cloudflare";
import * as Fly from "@alchemy.run/fly";
import * as Config from "effect/Config";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
Expand All @@ -106,7 +106,7 @@ export default Alchemy.Stack(
const certificate = yield* ACME.Certificate("Site", {
account,
identifiers: ["example.com"],
solver: Cloudflare.DNS.AcmeSolver({
solver: Cloudflare.ACME.ZoneSolver({
zoneId: Config.String("CLOUDFLARE_ZONE_ID"),
}),
});
Expand Down
Loading
Loading