From 6600be521734abea8335f18721f647f1949dd790 Mon Sep 17 00:00:00 2001 From: Charlotte Som Date: Thu, 21 Nov 2024 06:37:36 +0000 Subject: [PATCH] did:web attempt --- ngx/build.sh | 1 + ngx/char-bun-how.ts | 20 ++++++++++++++++++++ www/char.bun.how/.well-known/did.json | 26 ++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 ngx/char-bun-how.ts create mode 100644 www/char.bun.how/.well-known/did.json diff --git a/ngx/build.sh b/ngx/build.sh index a6f2044..517965c 100755 --- a/ngx/build.sh +++ b/ngx/build.sh @@ -3,3 +3,4 @@ mkdir out 2>/dev/null || true deno run ./default.ts > out/default.conf deno run ./pds.ts > out/pds.conf +deno run ./char-bun-how.ts > out/char-bun-how.conf diff --git a/ngx/char-bun-how.ts b/ngx/char-bun-how.ts new file mode 100644 index 0000000..aa54c14 --- /dev/null +++ b/ngx/char-bun-how.ts @@ -0,0 +1,20 @@ +import ngx from "jsr:@char/ngx@0.1"; + +export const domain = "char.bun.how" + +export const config = ngx("server", [ + [ + `server_name ${domain}`, + ...ngx.listen(), + ...ngx.letsEncrypt(domain), + ], + ngx("location /", [ + "add_header Access-Control-Allow-Origin *", + "if_modified_since off", + "expires off", + "etag off", + `root /srv/www/${domain}`, + ]), +]); + +if (import.meta.main) console.log(config.build()); diff --git a/www/char.bun.how/.well-known/did.json b/www/char.bun.how/.well-known/did.json new file mode 100644 index 0000000..10ca145 --- /dev/null +++ b/www/char.bun.how/.well-known/did.json @@ -0,0 +1,26 @@ +{ + "@context": [ + "https://www.w3.org/ns/did/v1", + "https://w3id.org/security/multikey/v1", + "https://w3id.org/security/suites/secp256k1-2019/v1" + ], + "id": "did:web:char.bun.how", + "alsoKnownAs": [ + "at://char.bun.how" + ], + "verificationMethod": [ + { + "id": "did:web:char.bun.how#atproto", + "type": "Multikey", + "controller": "did:web:char.bun.how", + "publicKeyMultibase": "zQ3shV6xQxreuVc7tjUL5aJK28YJv8FB24CNJX6fqknL7XgLW" + } + ], + "service": [ + { + "id": "#atproto_pds", + "type": "AtprotoPersonalDataServer", + "serviceEndpoint": "https://pds.bun.how" + } + ] +}