create-pds 0.0.6 → 0.0.7
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.
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# create-pds
|
|
2
2
|
|
|
3
|
-
Scaffold a new [AT Protocol](https://atproto.com) Personal Data Server (PDS) on Cloudflare Workers.
|
|
3
|
+
Scaffold a new [AT Protocol](https://atproto.com) Personal Data Server (PDS) on Cloudflare Workers. Creates a Cirrus PDS project.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ This will:
|
|
|
24
24
|
create-pds [name]
|
|
25
25
|
|
|
26
26
|
Arguments:
|
|
27
|
-
name Project name (default: pds
|
|
27
|
+
name Project name (default: my-pds)
|
|
28
28
|
|
|
29
29
|
Options:
|
|
30
30
|
--package-manager Package manager to use (npm, yarn, pnpm, bun)
|
|
@@ -45,4 +45,4 @@ npm run dev
|
|
|
45
45
|
|
|
46
46
|
Your PDS will be running at http://localhost:5173
|
|
47
47
|
|
|
48
|
-
See the [@
|
|
48
|
+
See the [@getcirrus/pds documentation](https://github.com/ascorbic/cirrus/tree/main/packages/pds) for configuration and deployment instructions.
|
package/dist/index.js
CHANGED
|
@@ -2564,7 +2564,7 @@ async function replaceInFile(filePath, replacements) {
|
|
|
2564
2564
|
}
|
|
2565
2565
|
async function getLatestPdsVersion() {
|
|
2566
2566
|
try {
|
|
2567
|
-
const response = await fetch("https://registry.npmjs.org/@
|
|
2567
|
+
const response = await fetch("https://registry.npmjs.org/@getcirrus/pds/latest");
|
|
2568
2568
|
if (!response.ok) throw new Error(`Failed to fetch: ${response.status}`);
|
|
2569
2569
|
const data = await response.json();
|
|
2570
2570
|
if (data.version) return data.version;
|
|
@@ -2689,9 +2689,9 @@ runMain(defineCommand({
|
|
|
2689
2689
|
initGit = gitResult;
|
|
2690
2690
|
}
|
|
2691
2691
|
const spinner = Y();
|
|
2692
|
-
spinner.start("Fetching latest @
|
|
2692
|
+
spinner.start("Fetching latest @getcirrus/pds version...");
|
|
2693
2693
|
const pdsVersion = await getLatestPdsVersion();
|
|
2694
|
-
spinner.stop(`Using @
|
|
2694
|
+
spinner.stop(`Using @getcirrus/pds ${pdsVersion}`);
|
|
2695
2695
|
spinner.start("Copying template...");
|
|
2696
2696
|
await copyTemplateDir(join(__dirname, "..", "templates", "pds-worker"), targetDir);
|
|
2697
2697
|
await replaceInFile(join(targetDir, "package.json"), {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pds",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Create a new AT Protocol PDS on Cloudflare Workers",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"description": "Create a new Cirrus AT Protocol PDS on Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-pds": "./dist/index.js"
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/ascorbic/
|
|
23
|
+
"url": "git+https://github.com/ascorbic/cirrus.git",
|
|
24
24
|
"directory": "packages/create-pds"
|
|
25
25
|
},
|
|
26
|
-
"homepage": "https://github.com/ascorbic/
|
|
26
|
+
"homepage": "https://github.com/ascorbic/cirrus",
|
|
27
27
|
"keywords": [
|
|
28
28
|
"atproto",
|
|
29
29
|
"bluesky",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Personal PDS
|
|
1
|
+
# Your Personal PDS
|
|
2
2
|
|
|
3
3
|
A single-user AT Protocol Personal Data Server running on Cloudflare Workers.
|
|
4
4
|
|
|
@@ -6,26 +6,29 @@ A single-user AT Protocol Personal Data Server running on Cloudflare Workers.
|
|
|
6
6
|
>
|
|
7
7
|
> This is an early-stage project under active development. **Do not migrate your main Bluesky account to this PDS yet.** Use a test account or create a new identity for experimentation.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Getting Started
|
|
10
10
|
|
|
11
11
|
### 1. Install dependencies
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
pnpm install
|
|
15
|
+
# or: npm install / yarn install
|
|
15
16
|
```
|
|
16
17
|
|
|
17
|
-
### 2. Configure
|
|
18
|
+
### 2. Configure the PDS
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
Run the setup wizard if not already done:
|
|
20
21
|
|
|
21
22
|
```bash
|
|
22
23
|
pnpm pds init
|
|
23
|
-
# or
|
|
24
|
-
npm run pds init
|
|
25
|
-
yarn pds init
|
|
26
24
|
```
|
|
27
25
|
|
|
28
|
-
This prompts for
|
|
26
|
+
This prompts for:
|
|
27
|
+
- **PDS hostname** – The deployment domain (e.g., `pds.example.com`)
|
|
28
|
+
- **Handle** – The Bluesky username (e.g., `alice.example.com`)
|
|
29
|
+
- **Password** – For logging in from Bluesky apps
|
|
30
|
+
|
|
31
|
+
The wizard generates cryptographic keys and writes configuration to `.dev.vars` and `wrangler.jsonc`.
|
|
29
32
|
|
|
30
33
|
### 3. Run locally
|
|
31
34
|
|
|
@@ -33,60 +36,153 @@ This prompts for your hostname, handle, and password, then writes configuration
|
|
|
33
36
|
pnpm dev
|
|
34
37
|
```
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
The PDS is now running at http://localhost:5173. Test it with:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
curl http://localhost:5173/health
|
|
43
|
+
curl http://localhost:5173/.well-known/did.json
|
|
44
|
+
```
|
|
37
45
|
|
|
38
46
|
### 4. Deploy to production
|
|
39
47
|
|
|
40
|
-
First
|
|
48
|
+
First, push secrets to Cloudflare:
|
|
41
49
|
|
|
42
50
|
```bash
|
|
43
51
|
pnpm pds init --production
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then deploy:
|
|
44
55
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
yarn pds init --production
|
|
56
|
+
```bash
|
|
57
|
+
pnpm run deploy
|
|
48
58
|
```
|
|
49
59
|
|
|
50
|
-
|
|
60
|
+
Finally, configure DNS to point your domain to the worker.
|
|
51
61
|
|
|
52
|
-
|
|
62
|
+
## Migrating an Existing Account
|
|
63
|
+
|
|
64
|
+
To move an existing Bluesky account from bsky.social or another PDS:
|
|
65
|
+
|
|
66
|
+
### 1. Configure for migration
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pnpm pds init
|
|
70
|
+
# Answer "Yes" when asked about migrating an existing account
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 2. Deploy and transfer the data
|
|
53
74
|
|
|
54
75
|
```bash
|
|
55
76
|
pnpm run deploy
|
|
77
|
+
pnpm pds migrate
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This downloads the repository (posts, follows, likes) and all images/videos from the current PDS.
|
|
81
|
+
|
|
82
|
+
### 3. Update the identity
|
|
83
|
+
|
|
84
|
+
Follow the [AT Protocol account migration guide](https://atproto.com/guides/account-migration) to update the DID document. This requires email verification from the current PDS.
|
|
85
|
+
|
|
86
|
+
### 4. Go live
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pnpm pds activate
|
|
56
90
|
```
|
|
57
91
|
|
|
92
|
+
The account is now live on the new PDS.
|
|
93
|
+
|
|
94
|
+
## CLI Commands
|
|
95
|
+
|
|
96
|
+
| Command | Description |
|
|
97
|
+
|---------|-------------|
|
|
98
|
+
| `pnpm pds init` | Interactive setup wizard |
|
|
99
|
+
| `pnpm pds init --production` | Deploy secrets to Cloudflare |
|
|
100
|
+
| `pnpm pds migrate` | Transfer account from source PDS |
|
|
101
|
+
| `pnpm pds migrate --clean` | Reset and re-import data |
|
|
102
|
+
| `pnpm pds activate` | Enable writes (go live) |
|
|
103
|
+
| `pnpm pds deactivate` | Disable writes (for re-import) |
|
|
104
|
+
| `pnpm pds secret key` | Generate new signing keypair |
|
|
105
|
+
| `pnpm pds secret jwt` | Generate new JWT secret |
|
|
106
|
+
| `pnpm pds secret password` | Set account password |
|
|
107
|
+
|
|
108
|
+
Add `--dev` to target your local development server instead of production.
|
|
109
|
+
|
|
58
110
|
## Configuration
|
|
59
111
|
|
|
60
|
-
|
|
112
|
+
### Public Variables (wrangler.jsonc)
|
|
113
|
+
|
|
114
|
+
| Variable | Description |
|
|
115
|
+
|----------|-------------|
|
|
116
|
+
| `PDS_HOSTNAME` | Public hostname (e.g., pds.example.com) |
|
|
117
|
+
| `DID` | Account DID |
|
|
118
|
+
| `HANDLE` | Account handle |
|
|
119
|
+
| `SIGNING_KEY_PUBLIC` | Public key for DID document |
|
|
120
|
+
|
|
121
|
+
### Secrets (.dev.vars or Cloudflare)
|
|
122
|
+
|
|
123
|
+
| Variable | Description |
|
|
124
|
+
|----------|-------------|
|
|
125
|
+
| `AUTH_TOKEN` | Bearer token for API write operations |
|
|
126
|
+
| `SIGNING_KEY` | Private signing key |
|
|
127
|
+
| `JWT_SECRET` | Secret for session tokens |
|
|
128
|
+
| `PASSWORD_HASH` | Bcrypt hash of the account password |
|
|
129
|
+
|
|
130
|
+
## Handle Verification
|
|
131
|
+
|
|
132
|
+
Bluesky verifies control of the handle domain.
|
|
133
|
+
|
|
134
|
+
**If the handle matches the PDS hostname** (for example, both are `pds.example.com`):
|
|
135
|
+
- No extra setup needed. The PDS handles verification automatically.
|
|
136
|
+
|
|
137
|
+
**If the handle is on a different domain** (for example, handle `alice.example.com`, PDS at `pds.example.com`):
|
|
138
|
+
|
|
139
|
+
Add a DNS TXT record:
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
_atproto.alice.example.com TXT "did=did:web:pds.example.com"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Verify with:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
dig TXT _atproto.alice.example.com
|
|
149
|
+
```
|
|
61
150
|
|
|
62
|
-
|
|
151
|
+
## Project Structure
|
|
63
152
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
153
|
+
```
|
|
154
|
+
├── src/
|
|
155
|
+
│ └── index.ts # Worker entry point (re-exports PDS)
|
|
156
|
+
├── wrangler.jsonc # Cloudflare Worker configuration
|
|
157
|
+
├── .dev.vars # Local secrets (not committed)
|
|
158
|
+
└── package.json
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Troubleshooting
|
|
68
162
|
|
|
69
|
-
|
|
163
|
+
### "PDS not responding"
|
|
70
164
|
|
|
71
|
-
|
|
72
|
-
- `SIGNING_KEY` - Private signing key (secp256k1 JWK)
|
|
73
|
-
- `JWT_SECRET` - Secret for signing session JWTs
|
|
74
|
-
- `PASSWORD_HASH` - Bcrypt hash of account password (for Bluesky app login)
|
|
165
|
+
Ensure the worker is deployed (`pnpm run deploy`) or the dev server is running (`pnpm dev`).
|
|
75
166
|
|
|
76
|
-
|
|
167
|
+
### "Failed to resolve handle"
|
|
77
168
|
|
|
78
|
-
|
|
169
|
+
Check the handle configuration:
|
|
170
|
+
- For DNS verification: ensure the TXT record has propagated (`dig TXT _atproto.yourhandle.com`)
|
|
171
|
+
- For same-domain handles: ensure the PDS is accessible at `https://yourdomain.com/.well-known/atproto-did`
|
|
79
172
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- `
|
|
84
|
-
- `
|
|
85
|
-
- `POST /xrpc/com.atproto.repo.uploadBlob` - Upload a blob (authenticated)
|
|
86
|
-
- And more...
|
|
173
|
+
### Migration issues
|
|
174
|
+
|
|
175
|
+
If migration fails partway through:
|
|
176
|
+
- Run `pnpm pds migrate` again to resume from where you left off
|
|
177
|
+
- Use `pnpm pds migrate --clean` to start fresh (only on deactivated accounts)
|
|
87
178
|
|
|
88
179
|
## Resources
|
|
89
180
|
|
|
90
|
-
- [AT Protocol
|
|
181
|
+
- [AT Protocol Documentation](https://atproto.com)
|
|
91
182
|
- [Cloudflare Workers Docs](https://developers.cloudflare.com/workers/)
|
|
92
|
-
- [@
|
|
183
|
+
- [@getcirrus/pds Documentation](https://github.com/ascorbic/cirrus/tree/main/packages/pds)
|
|
184
|
+
- [Account Migration Guide](https://atproto.com/guides/account-migration)
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
MIT
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{name}}",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"description": "AT Protocol PDS on Cloudflare Workers",
|
|
4
|
+
"description": "Cirrus – AT Protocol PDS on Cloudflare Workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": true,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@
|
|
8
|
+
"@getcirrus/pds": "{{pdsVersion}}"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@cloudflare/vite-plugin": "^1.17.0",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Re-export the PDS worker - that's all you need!
|
|
2
|
-
export { default, AccountDurableObject } from "@
|
|
2
|
+
export { default, AccountDurableObject } from "@getcirrus/pds";
|