clone

nostr relays on demand at <name>.bind.ws: claim one with your key, pay in zaps past the free allowance

tidy: relay.ts imports each module once and nothing it no longer uses; verifyNIP98 is imported from auth.ts, not re-exported through manage.ts; the suite typechecks with unused locals on

Dami committed 5d7e3a5
commit
5d7e3a563da6fc261255adefd4f35abf47b6c9d2
parent
bf7b437c8fb6825d2b8c2391a1c05da85aff9908
author
Dami <dami.etoile@gmail.com>
8 files changed, +8 -17
Msrc/bridge.ts2+-
Msrc/dumps.ts2+-
Msrc/imports.ts2+-
Msrc/index.ts2+-
Msrc/manage.ts3---
Msrc/nip96.ts2+-
Msrc/relay.ts10++--------
Mtest/object/sync.test.ts2+-
M src/bridge.ts +1 -1
M src/dumps.ts +1 -1
M src/imports.ts +1 -1
M src/index.ts +1 -1
M src/manage.ts +0 -3
M src/nip96.ts +1 -1
M src/relay.ts +2 -8
@@ -11,29 +11,24 @@ import { discovery } from "./nip66.ts";
1111 import { Audit } from "./audit.ts";1212 import { ERR_DUPLICATE, ERR_TOO_BIG, Store, type Access } from "./store.ts";1313 import { Settings, isReplaceable, isProtected } from "./settings.ts";14+import { blobBytes, type Blob } from "./blossom.ts";15+import { DIGEST_DAYS, digestText, notify, fuelLow, fuelText } from "./notify.ts";1416 import { Succession } from "./succession.ts";1517 import { isGated, route } from "./routes.ts";1618 import { guestPass, readGate, writeGate } from "./gates.ts";1719 import { Fuel, fuelConfig, acceptReceipt, type Fetcher, type LnurlParams } from "./fuel.ts";1820 import { Identity } from "./identity.ts";1921 import { Bucket } from "./ratelimit.ts";20-import { blobBytes } from "./blossom.ts";2122 import { dumpBytes, dumpDue, writeDump } from "./dumps.ts";2223 import { importBytes } from "./imports.ts";23-import { DIGEST_DAYS, digestText } from "./notify.ts";2424 import { claimFromProfile } from "./nip05.ts";25-import { checkInvite, claimInviteRequest, invitePage, termsPage } from "./invites.ts";26-import { verifyNIP98, whoAsks } from "./auth.ts";2725 import type { PullFilter, PullJob, PullResult } from "./pull.ts";2826 import { leaseDays, leaseNames, validName } from "./names.ts";2927 import { MAX_JOBS, MAX_STANDING, checkJob, finishRun, newJobID, pruneFinished, pullView, runRound, startRun, type Job, type JobSpec } from "./jobs.ts";3028 import { Hostnames, forgetDomains } from "./domains.ts";3129 import { hostOf } from "./edge.ts";3230 import { groupFacts, handleGroupEvent, isGroupManagement, isNIP43Request } from "./groups.ts";33-import { isPagePath, pages } from "./pages.ts";34-import { notify, fuelLow, fuelText } from "./notify.ts";3531 import { markView, notePresence, viewsTick } from "./views.ts";36-import type { Blob } from "./blossom.ts";3732 import { KIND_VANISH, KIND_AUTH, KIND_REPORT, KIND_NOSTR_CONNECT, KIND_GROUP_MEMBERS, KIND_GROUP_PINS, KIND_RELAY_DISCOVERY } from "./kinds.ts";3833 3934 export interface Env {
@@ -428,7 +423,6 @@ export class Relay extends DurableObject<Env> {
428423 429424 // mayUpload applies the write policy to Blossom uploads. "" allows.430425 mayUpload(pubkey: string, host: string): string {431- const p = this.settings.policy;432426 if (this.settings.isUnclaimed()) return "restricted: this relay is unclaimed";433427 if (this.settings.leaseExpired(now())) return "restricted: this temporary relay has expired";434428 if (this.settings.isBanned(pubkey)) return "blocked: this pubkey is banned from this relay";
M test/object/sync.test.ts +1 -1