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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jss start --port 8443 --idp --mashlib --conneg --git --nostr
### Creating a Pod

```bash
curl -X POST http://localhost:3000/.pods \
curl -X POST http://localhost:4443/.pods \
-H "Content-Type: application/json" \
-d '{"name": "alice"}'
```
Expand All @@ -57,10 +57,10 @@ curl -X POST http://localhost:3000/.pods \

```bash
# Read
curl http://localhost:3000/alice/public/
curl http://localhost:4443/alice/public/

# Write
curl -X PUT http://localhost:3000/alice/public/data.json \
curl -X PUT http://localhost:4443/alice/public/data.json \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/ld+json" \
-d '{"@id": "#data", "http://example.org/value": 42}'
Expand Down
10 changes: 5 additions & 5 deletions docs/activitypub.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ const server = createServer({

```bash
# Check WebFinger
curl "http://localhost:3000/.well-known/webfinger?resource=acct:alice@localhost:3000"
curl "http://localhost:4443/.well-known/webfinger?resource=acct:alice@localhost:4443"

# Get Actor (AP format)
curl -H "Accept: application/activity+json" http://localhost:3000/profile/card
curl -H "Accept: application/activity+json" http://localhost:4443/profile/card

# Check NodeInfo
curl http://localhost:3000/.well-known/nodeinfo/2.1
curl http://localhost:4443/.well-known/nodeinfo/2.1
```

## Mastodon-compatible API
Expand Down Expand Up @@ -99,11 +99,11 @@ Supports out-of-band (OOB) redirect for CLI/desktop clients.

```bash
# Register a client
curl -X POST http://localhost:3000/api/v1/apps \
curl -X POST http://localhost:4443/api/v1/apps \
-H "Content-Type: application/json" \
-d '{"client_name": "Test App", "redirect_uris": "urn:ietf:wg:oauth:2.0:oob"}'

# Check instance info
curl http://localhost:3000/api/v1/instance
curl http://localhost:4443/api/v1/instance
```

18 changes: 9 additions & 9 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Use the token returned from pod creation:

```bash
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:3000/alice/private/
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:4443/alice/private/
```

### Built-in Identity Provider (v0.0.12+)
Expand All @@ -19,7 +19,7 @@ jss start --idp
With IdP enabled, pod creation requires email and password:

```bash
curl -X POST http://localhost:3000/.pods \
curl -X POST http://localhost:4443/.pods \
-H "Content-Type: application/json" \
-d '{"name": "alice", "email": "alice@example.com", "password": "secret123"}'
```
Expand All @@ -28,10 +28,10 @@ Response:
```json
{
"name": "alice",
"webId": "http://localhost:3000/alice/#me",
"podUri": "http://localhost:3000/alice/",
"idpIssuer": "http://localhost:3000",
"loginUrl": "http://localhost:3000/idp/auth"
"webId": "http://localhost:4443/alice/#me",
"podUri": "http://localhost:4443/alice/",
"idpIssuer": "http://localhost:4443",
"loginUrl": "http://localhost:4443/idp/auth"
}
```

Expand All @@ -42,7 +42,7 @@ OIDC Discovery: `/.well-known/openid-configuration`
For automated testing and scripts, use the credentials endpoint:

```bash
curl -X POST http://localhost:3000/idp/credentials \
curl -X POST http://localhost:4443/idp/credentials \
-H "Content-Type: application/json" \
-d '{"email": "alice@example.com", "password": "secret123"}'
```
Expand All @@ -53,7 +53,7 @@ Response:
"access_token": "...",
"token_type": "Bearer",
"expires_in": 3600,
"webid": "http://localhost:3000/alice/#me"
"webid": "http://localhost:4443/alice/#me"
}
```

Expand Down Expand Up @@ -109,7 +109,7 @@ The server also accepts DPoP-bound access tokens from external Solid identity pr
```bash
curl -H "Authorization: DPoP ACCESS_TOKEN" \
-H "DPoP: DPOP_PROOF" \
http://localhost:3000/alice/private/
http://localhost:4443/alice/private/
```

### WebID-TLS (Client Certificates)
Expand Down
28 changes: 14 additions & 14 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ const server = createServer({ notifications: true });
Clients discover the WebSocket URL via the `Updates-Via` header:

```bash
curl -I http://localhost:3000/alice/public/
# Updates-Via: ws://localhost:3000/.notifications
curl -I http://localhost:4443/alice/public/
# Updates-Via: ws://localhost:4443/.notifications
```

Protocol (solid-0.1, compatible with SolidOS):
```
Server: protocol solid-0.1
Client: sub http://localhost:3000/alice/public/data.json
Server: ack http://localhost:3000/alice/public/data.json
Server: pub http://localhost:3000/alice/public/data.json (on change)
Client: sub http://localhost:4443/alice/public/data.json
Server: ack http://localhost:4443/alice/public/data.json
Server: pub http://localhost:4443/alice/public/data.json (on change)
```


Expand All @@ -131,7 +131,7 @@ Server: pub http://localhost:3000/alice/public/data.json (on change)

| Option | Description | Default |
|--------|-------------|---------|
| `-p, --port <n>` | Port to listen on | 3000 |
| `-p, --port <n>` | Port to listen on | 4443 |
| `-h, --host <addr>` | Host to bind to | 0.0.0.0 |
| `-r, --root <path>` | Data directory | ./data |
| `-c, --config <file>` | Config file path | - |
Expand Down Expand Up @@ -235,7 +235,7 @@ Then: `jss start --config config.json`
### Creating a Pod

```bash
curl -X POST http://localhost:3000/.pods \
curl -X POST http://localhost:4443/.pods \
-H "Content-Type: application/json" \
-d '{"name": "alice"}'
```
Expand All @@ -244,8 +244,8 @@ Response:
```json
{
"name": "alice",
"webId": "http://localhost:3000/alice/#me",
"podUri": "http://localhost:3000/alice/",
"webId": "http://localhost:4443/alice/#me",
"podUri": "http://localhost:4443/alice/",
"token": "eyJ..."
}
```
Expand Down Expand Up @@ -421,15 +421,15 @@ const server = createServer({ notifications: true });
Clients discover the WebSocket URL via the `Updates-Via` header:

```bash
curl -I http://localhost:3000/alice/public/
# Updates-Via: ws://localhost:3000/.notifications
curl -I http://localhost:4443/alice/public/
# Updates-Via: ws://localhost:4443/.notifications
```

Protocol (solid-0.1, compatible with SolidOS):
```
Server: protocol solid-0.1
Client: sub http://localhost:3000/alice/public/data.json
Server: ack http://localhost:3000/alice/public/data.json
Server: pub http://localhost:3000/alice/public/data.json (on change)
Client: sub http://localhost:4443/alice/public/data.json
Server: ack http://localhost:4443/alice/public/data.json
Server: pub http://localhost:4443/alice/public/data.json (on change)
```

4 changes: 2 additions & 2 deletions docs/git-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ JSS_GIT=true jss start

```bash
# Clone
git clone http://localhost:3000/myrepo
git clone http://localhost:4443/myrepo

# Clone with authentication (if required)
git clone http://localhost:3000/myrepo
git clone http://localhost:4443/myrepo
# Git will prompt for credentials

# Push (requires write access)
Expand Down
8 changes: 4 additions & 4 deletions docs/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ jss start --mongo --mongo-url mongodb://localhost:27017 --mongo-database solid

```bash
# Store a document
curl -X PUT http://localhost:3000/db/alice/notes/1 \
curl -X PUT http://localhost:4443/db/alice/notes/1 \
-H "Content-Type: application/ld+json" \
-H "Authorization: Bearer <token>" \
-d '{"@context": "https://schema.org/", "@type": "Note", "text": "Hello"}'

# Read it back
curl http://localhost:3000/db/alice/notes/1
curl http://localhost:4443/db/alice/notes/1

# List container (derived from URI prefixes)
curl http://localhost:3000/db/alice/
curl http://localhost:4443/db/alice/

# Delete
curl -X DELETE http://localhost:3000/db/alice/notes/1 \
curl -X DELETE http://localhost:4443/db/alice/notes/1 \
-H "Authorization: Bearer <token>"
```

Expand Down
10 changes: 5 additions & 5 deletions docs/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jss start --notifications
Clients discover the WebSocket URL via the `Updates-Via` header:

```bash
curl -I http://localhost:3000/alice/public/
# Updates-Via: ws://localhost:3000/.notifications
curl -I http://localhost:4443/alice/public/
# Updates-Via: ws://localhost:4443/.notifications
```

## Protocol

```
Server: protocol solid-0.1
Client: sub http://localhost:3000/alice/public/data.json
Server: ack http://localhost:3000/alice/public/data.json
Server: pub http://localhost:3000/alice/public/data.json (on change)
Client: sub http://localhost:4443/alice/public/data.json
Server: ack http://localhost:4443/alice/public/data.json
Server: pub http://localhost:4443/alice/public/data.json (on change)
```

## How It Works
Expand Down
26 changes: 13 additions & 13 deletions docs/payments.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ To fund their balance, users deposit via the `/pay/.deposit` endpoint using a TX
jss start --pay --pay-cost 10

# Create an article and payment-gated ACL
curl -X PUT http://localhost:3000/premium/article.jsonld \
curl -X PUT http://localhost:4443/premium/article.jsonld \
-H "Content-Type: application/ld+json" \
-d '{"@type": "Article", "headline": "Premium Content"}'

curl -X PUT http://localhost:3000/premium/article.jsonld.acl \
curl -X PUT http://localhost:4443/premium/article.jsonld.acl \
-H "Content-Type: application/ld+json" \
-d '{"@type":"acl:Authorization","acl:agent":{"@id":"did:nostr:YOUR_PUBKEY"},"acl:accessTo":{"@id":"/premium/article.jsonld"},"acl:mode":[{"@id":"acl:Read"}],"acl:condition":{"@type":"PaymentCondition","amount":"10","currency":"sats"}}'

# Try to read → 402 Payment Required
curl -H "Authorization: Nostr <nip98-token>" http://localhost:3000/premium/article.jsonld
curl -H "Authorization: Nostr <nip98-token>" http://localhost:4443/premium/article.jsonld

# Deposit testnet4 sats
curl -X POST -H "Authorization: Nostr <nip98-token>" \
http://localhost:3000/pay/.deposit -d 'txo:tbtc4:txid:vout'
http://localhost:4443/pay/.deposit -d 'txo:tbtc4:txid:vout'

# Try again → 200 OK + article
curl -H "Authorization: Nostr <nip98-token>" http://localhost:3000/premium/article.jsonld
curl -H "Authorization: Nostr <nip98-token>" http://localhost:4443/premium/article.jsonld
```

### Pay Route (Full Backend)
Expand Down Expand Up @@ -97,26 +97,26 @@ jss start --pay --pay-cost 10 --pay-address your-address --pay-token PODS --pay-

```bash
# Check balance
curl -H "Authorization: Nostr <base64-event>" http://localhost:3000/pay/.balance
curl -H "Authorization: Nostr <base64-event>" http://localhost:4443/pay/.balance

# Deposit (post a confirmed transaction output)
curl -X POST -H "Authorization: Nostr <base64-event>" \
http://localhost:3000/pay/.deposit \
http://localhost:4443/pay/.deposit \
-d "txid:vout"

# Access paid resource
curl -H "Authorization: Nostr <base64-event>" http://localhost:3000/pay/my-resource
curl -H "Authorization: Nostr <base64-event>" http://localhost:4443/pay/my-resource

# Buy tokens with sat balance
curl -X POST -H "Authorization: Nostr <base64-event>" \
-H "Content-Type: application/json" \
http://localhost:3000/pay/.buy \
http://localhost:4443/pay/.buy \
-d '{"amount": 100}'

# Withdraw entire balance as portable tokens
curl -X POST -H "Authorization: Nostr <base64-event>" \
-H "Content-Type: application/json" \
http://localhost:3000/pay/.withdraw \
http://localhost:4443/pay/.withdraw \
-d '{"all": true}'
```

Expand All @@ -140,17 +140,17 @@ Deposits detect the chain from the TXO URI prefix (`txo:tbtc3:txid:vout`). Each
# Add liquidity
curl -X POST -H "Authorization: Nostr <token>" \
-H "Content-Type: application/json" \
http://localhost:3000/pay/.pool \
http://localhost:4443/pay/.pool \
-d '{"action": "add-liquidity", "tbtc3": 1000, "tbtc4": 5000}'

# Swap
curl -X POST -H "Authorization: Nostr <token>" \
-H "Content-Type: application/json" \
http://localhost:3000/pay/.pool \
http://localhost:4443/pay/.pool \
-d '{"action": "swap", "sell": "tbtc3", "amount": 100}'

# Check pool state
curl http://localhost:3000/pay/.pool
curl http://localhost:4443/pay/.pool
```

Supported chains: `btc`, `tbtc3`, `tbtc4`, `ltc`, `signet`.
10 changes: 5 additions & 5 deletions docs/remotestorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jss start --activitypub --idp
remoteStorage clients discover the storage endpoint via WebFinger:

```bash
curl "http://localhost:3000/.well-known/webfinger?resource=acct:me@localhost:3000"
curl "http://localhost:4443/.well-known/webfinger?resource=acct:me@localhost:4443"
```

The response includes a `remotestorage` link relation pointing to `/storage/me/`.
Expand All @@ -38,21 +38,21 @@ The response includes a `remotestorage` link relation pointing to `/storage/me/`

```bash
# Write a file (needs Bearer token from OAuth flow)
curl -X PUT http://localhost:3000/storage/me/documents/hello.txt \
curl -X PUT http://localhost:4443/storage/me/documents/hello.txt \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: text/plain" \
-d "Hello, remoteStorage!"

# Read it back
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://localhost:3000/storage/me/documents/hello.txt
http://localhost:4443/storage/me/documents/hello.txt

# List a folder
curl -H "Authorization: Bearer YOUR_TOKEN" \
http://localhost:3000/storage/me/documents/
http://localhost:4443/storage/me/documents/

# Read from public folder (no auth needed)
curl http://localhost:3000/storage/me/public/readme.txt
curl http://localhost:4443/storage/me/public/readme.txt
```

### Linking Nostr to WebID (did:nostr)
Expand Down
4 changes: 2 additions & 2 deletions scripts/demo-402.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
# Demo: HTTP 402 Payment-Gated Article
# Requires: JSS running on localhost:3000 with --pay --pay-cost 10
# Requires: JSS running on localhost:4443 with --pay --pay-cost 10

BASE="http://localhost:3000"
BASE="http://localhost:4443"

echo "=== Setting up payment-gated article demo ==="

Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import path from 'path';
*/
export const defaults = {
// Server
port: 3000,
port: 4443,
host: '0.0.0.0',
root: './data',

Expand Down