mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2036903918 | ||
|
|
1ca1a4e4ea |
No files matched your search
@@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [9.16.4] - 2026-09-16
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Published sites carry only the tags the nsite spec defines — the relay hints Shakespeare used to attach were read by nothing, and taking a site back no longer rewrites them
|
||||||
|
|
||||||
## [9.16.3] - 2026-09-14
|
## [9.16.3] - 2026-09-14
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "shakespeare.diy",
|
"name": "shakespeare.diy",
|
||||||
"version": "9.16.2",
|
"version": "9.16.4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "shakespeare.diy",
|
"name": "shakespeare.diy",
|
||||||
"version": "9.16.2",
|
"version": "9.16.4",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/app": "^8.1.0",
|
"@capacitor/app": "^8.1.0",
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
"description": "Build custom apps with AI assistance using Shakespeare, an open-source development environment",
|
"description": "Build custom apps with AI assistance using Shakespeare, an open-source development environment",
|
||||||
"homepage": "https://shakespeare.diy",
|
"homepage": "https://shakespeare.diy",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"version": "9.16.3",
|
"version": "9.16.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "shakespeare.diy",
|
"name": "shakespeare.diy",
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [9.16.4] - 2026-09-16
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Published sites carry only the tags the nsite spec defines — the relay hints Shakespeare used to attach were read by nothing, and taking a site back no longer rewrites them
|
||||||
|
|
||||||
## [9.16.3] - 2026-09-14
|
## [9.16.3] - 2026-09-14
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export function NpanelMigrationDialog({ open, onOpenChange, provider }: NpanelMi
|
|||||||
kind: NAMED_SITE_KIND,
|
kind: NAMED_SITE_KIND,
|
||||||
content: claim.step.manifest.content,
|
content: claim.step.manifest.content,
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
tags: republishTags(claim.step.manifest, claim.step.identifier, provider.relayUrls, {
|
tags: republishTags(claim.step.manifest, claim.step.identifier, {
|
||||||
title: claim.suggestedTitle,
|
title: claim.suggestedTitle,
|
||||||
description: claim.suggestedDescription,
|
description: claim.suggestedDescription,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -250,8 +250,8 @@ async function runConcurrent<T>(
|
|||||||
* - HEAD-checks each file on each Blossom server before uploading
|
* - HEAD-checks each file on each Blossom server before uploading
|
||||||
* - PUTs files to Blossom servers with pre-signed auth headers
|
* - PUTs files to Blossom servers with pre-signed auth headers
|
||||||
* - Publishes a single kind-15128 (root) or kind-35128 (named) site manifest event
|
* - Publishes a single kind-15128 (root) or kind-35128 (named) site manifest event
|
||||||
* containing all ["path", "/path", sha256] tags, ["server", url] Blossom hints,
|
* containing all ["path", "/path", sha256] tags and ["server", url] Blossom
|
||||||
* and ["relay", url] relay hints — no separate kind 10002 or kind 10063 published
|
* hints — no separate kind 10002 or kind 10063 published
|
||||||
*
|
*
|
||||||
* Named sites (kind 35128, siteIdentifier set):
|
* Named sites (kind 35128, siteIdentifier set):
|
||||||
* URL = https://{base36pubkey}{siteIdentifier}.{gateway}
|
* URL = https://{base36pubkey}{siteIdentifier}.{gateway}
|
||||||
@@ -367,8 +367,10 @@ export class NsiteAdapter implements DeployAdapter {
|
|||||||
pathTags.push(['path', '/404.html', indexFile.sha256]);
|
pathTags.push(['path', '/404.html', indexFile.sha256]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NIP-5A defines no relay-hint tag for a manifest, so the relays a site was
|
||||||
|
// published to are not written into it. Where to find the event is the
|
||||||
|
// reader's problem and the author's kind 10002, not the manifest's.
|
||||||
const serverTags: string[][] = serverBases.map(url => ['server', url]);
|
const serverTags: string[][] = serverBases.map(url => ['server', url]);
|
||||||
const relayTags: string[][] = this.relayUrls.map(url => ['relay', url]);
|
|
||||||
|
|
||||||
const tags: string[][] = [];
|
const tags: string[][] = [];
|
||||||
|
|
||||||
@@ -377,7 +379,7 @@ export class NsiteAdapter implements DeployAdapter {
|
|||||||
tags.push(['d', this.siteIdentifier]);
|
tags.push(['d', this.siteIdentifier]);
|
||||||
}
|
}
|
||||||
|
|
||||||
tags.push(...pathTags, ...serverTags, ...relayTags);
|
tags.push(...pathTags, ...serverTags);
|
||||||
|
|
||||||
if (this.siteTitle) {
|
if (this.siteTitle) {
|
||||||
tags.push(['title', this.siteTitle]);
|
tags.push(['title', this.siteTitle]);
|
||||||
@@ -399,7 +401,7 @@ export class NsiteAdapter implements DeployAdapter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ── Step 5: Publish manifest ──────────────────────────────────────────────
|
// ── Step 5: Publish manifest ──────────────────────────────────────────────
|
||||||
// Relay and server hints are embedded as tags in the manifest itself —
|
// Blossom server hints are embedded as tags in the manifest itself —
|
||||||
// no separate kind 10002 or kind 10063 events are published.
|
// no separate kind 10002 or kind 10063 events are published.
|
||||||
//
|
//
|
||||||
// Relay by relay, because the site is only as findable as the relays that
|
// Relay by relay, because the site is only as findable as the relays that
|
||||||
|
|||||||
@@ -154,15 +154,15 @@ describe('republishTags', () => {
|
|||||||
const tags = republishTags(
|
const tags = republishTags(
|
||||||
{ ...manifest, tags: [...manifest.tags, ['relay', 'wss://gone.example']] },
|
{ ...manifest, tags: [...manifest.tags, ['relay', 'wss://gone.example']] },
|
||||||
'mysite',
|
'mysite',
|
||||||
['wss://relay.ditto.pub'],
|
|
||||||
{ title: 'My Site', description: 'What it is for.' },
|
{ title: 'My Site', description: 'What it is for.' },
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(tags[0]).toEqual(['d', 'mysite']);
|
expect(tags[0]).toEqual(['d', 'mysite']);
|
||||||
expect(tags).toContainEqual(['path', '/index.html', 'c'.repeat(64)]);
|
expect(tags).toContainEqual(['path', '/index.html', 'c'.repeat(64)]);
|
||||||
expect(tags).toContainEqual(['server', 'https://blossom.ditto.pub/']);
|
expect(tags).toContainEqual(['server', 'https://blossom.ditto.pub/']);
|
||||||
expect(tags).toContainEqual(['relay', 'wss://relay.ditto.pub']);
|
// NIP-5A has no relay-hint tag, so the archive's are dropped and none of
|
||||||
expect(tags).not.toContainEqual(['relay', 'wss://gone.example']);
|
// ours take their place.
|
||||||
|
expect(tags.some(([name]) => name === 'relay' || name === 'r')).toBe(false);
|
||||||
expect(tags.filter(([name]) => name === 'd')).toHaveLength(1);
|
expect(tags.filter(([name]) => name === 'd')).toHaveLength(1);
|
||||||
|
|
||||||
// The archive's title was the hostname and its `alt` says the site is
|
// The archive's title was the hostname and its `alt` says the site is
|
||||||
@@ -180,7 +180,7 @@ describe('republishTags', () => {
|
|||||||
// Roughly a third of these are shells that set their title from JavaScript.
|
// Roughly a third of these are shells that set their title from JavaScript.
|
||||||
// No title is what an nsite manifest without one has always meant, and is
|
// No title is what an nsite manifest without one has always meant, and is
|
||||||
// better than a domain wearing a name's clothes.
|
// better than a domain wearing a name's clothes.
|
||||||
const tags = republishTags(manifest, 'mysite', [], {});
|
const tags = republishTags(manifest, 'mysite', {});
|
||||||
|
|
||||||
expect(tags.some(([name]) => name === 'title')).toBe(false);
|
expect(tags.some(([name]) => name === 'title')).toBe(false);
|
||||||
expect(tags).toContainEqual(['path', '/index.html', 'c'.repeat(64)]);
|
expect(tags).toContainEqual(['path', '/index.html', 'c'.repeat(64)]);
|
||||||
@@ -188,7 +188,7 @@ describe('republishTags', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('retitleTags', () => {
|
describe('retitleTags', () => {
|
||||||
it('swaps the archive’s words and passes everything else through', () => {
|
it('swaps the archive’s words, drops the tags NIP-5A never had, and passes the rest through', () => {
|
||||||
const event = {
|
const event = {
|
||||||
id: 'e'.repeat(64),
|
id: 'e'.repeat(64),
|
||||||
pubkey: PUBKEY,
|
pubkey: PUBKEY,
|
||||||
@@ -208,10 +208,13 @@ describe('retitleTags', () => {
|
|||||||
const tags = retitleTags(event, { title: 'My Site' });
|
const tags = retitleTags(event, { title: 'My Site' });
|
||||||
|
|
||||||
expect(tags).toContainEqual(['d', 'mysite']);
|
expect(tags).toContainEqual(['d', 'mysite']);
|
||||||
expect(tags).toContainEqual(['path', '/index.html', 'c'.repeat(64)]);
|
|
||||||
// Built from the event as relays hold it, so a site redeployed since this
|
// Built from the event as relays hold it, so a site redeployed since this
|
||||||
// migration ran keeps whatever it has become.
|
// migration ran keeps whatever it has become.
|
||||||
expect(tags).toContainEqual(['relay', 'wss://relay.ditto.pub']);
|
expect(tags).toContainEqual(['path', '/index.html', 'c'.repeat(64)]);
|
||||||
|
expect(tags).toContainEqual(['server', 'https://blossom.ditto.pub/']);
|
||||||
|
// Except the relay hints an older deploy wrote, which re-signing is the
|
||||||
|
// chance to stop carrying.
|
||||||
|
expect(tags.some(([name]) => name === 'relay')).toBe(false);
|
||||||
expect(tags).toContainEqual(['title', 'My Site']);
|
expect(tags).toContainEqual(['title', 'My Site']);
|
||||||
expect(tags.filter(([name]) => name === 'title')).toHaveLength(1);
|
expect(tags.filter(([name]) => name === 'title')).toHaveLength(1);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -208,13 +208,14 @@ export function planClaim(
|
|||||||
* called gets no title, which is what an nsite manifest without one has always
|
* called gets no title, which is what an nsite manifest without one has always
|
||||||
* meant and is more honest than a domain.
|
* meant and is more honest than a domain.
|
||||||
*
|
*
|
||||||
* Relay hints are replaced for the same reason: the archive's say where the
|
* The archive's relay hints are dropped and not replaced. NIP-5A gives a
|
||||||
* archive published, and this event is going somewhere else.
|
* manifest no tag for saying where it was published, so the archive's `relay`
|
||||||
|
* and `r` tags are tags that were never part of the spec, and re-signing them
|
||||||
|
* under someone else's key would only spread them further.
|
||||||
*/
|
*/
|
||||||
export function republishTags(
|
export function republishTags(
|
||||||
manifest: NpanelClaimManifest,
|
manifest: NpanelClaimManifest,
|
||||||
identifier: string,
|
identifier: string,
|
||||||
relayUrls: string[],
|
|
||||||
identity: SiteIdentity = {},
|
identity: SiteIdentity = {},
|
||||||
): string[][] {
|
): string[][] {
|
||||||
const kept = manifest.tags.filter(
|
const kept = manifest.tags.filter(
|
||||||
@@ -226,7 +227,6 @@ export function republishTags(
|
|||||||
['d', identifier],
|
['d', identifier],
|
||||||
...kept,
|
...kept,
|
||||||
...describeTags(identity),
|
...describeTags(identity),
|
||||||
...relayUrls.map((url) => ['relay', url]),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,10 +237,16 @@ export function republishTags(
|
|||||||
* holds, because the two are not always the same thing: a site republished by
|
* holds, because the two are not always the same thing: a site republished by
|
||||||
* this migration and then redeployed normally has moved on, and rebuilding it
|
* this migration and then redeployed normally has moved on, and rebuilding it
|
||||||
* out of the gateway's copy would quietly restore an older version of the site.
|
* out of the gateway's copy would quietly restore an older version of the site.
|
||||||
* Everything but the archive's own words is passed through untouched.
|
* Everything but the archive's own words and the relay hints NIP-5A never
|
||||||
|
* defined is passed through untouched; signing an event is the moment to stop
|
||||||
|
* carrying a tag that does not exist.
|
||||||
*/
|
*/
|
||||||
export function retitleTags(event: NostrEvent, identity: SiteIdentity): string[][] {
|
export function retitleTags(event: NostrEvent, identity: SiteIdentity): string[][] {
|
||||||
return [...event.tags.filter(([name]) => !ARCHIVE_TAGS.has(name)), ...describeTags(identity)];
|
const kept = event.tags.filter(
|
||||||
|
([name]) => name !== 'relay' && name !== 'r' && !ARCHIVE_TAGS.has(name),
|
||||||
|
);
|
||||||
|
|
||||||
|
return [...kept, ...describeTags(identity)];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user