-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update internal dependencies with actual versions
- Loading branch information
Showing
7 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@nostrwatch/nostrings': minor | ||
'@nostrwatch/nwcache': minor | ||
'@nostrwatch/trawler': minor | ||
'@nostrwatch/nocapd': minor | ||
--- | ||
|
||
relay urls with usernames were slipping through, migrations and fix sanitizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import { MigrationFixRelayDuplicates } from './migrations/fix-non-normal-urls.js' | ||
import { FindClosestToRoot } from '@nostrwatch/nwcache/migrations/duplicates.js' | ||
import { AddIgnoreFieldToRelays } from '@nostrwatch/nwcache/migrations/add_ignore_field_to_relays.js' | ||
import { SanitizeRelayUrls } from '@nostrwatch/nwcache/migrations/sanitize.js' | ||
// import { MigrationFixRelayDuplicates } from './migrations/fix-non-normal-urls.js' | ||
// import { FindClosestToRoot } from '@nostrwatch/nwcache/migrations/duplicates.js' | ||
import { MigrationFixUsernamesInUrls } from '@nostrwatch/nwcache/migrations/fix_usernames_in_urls.js' | ||
// import { AddIgnoreFieldToRelays } from '@nostrwatch/nwcache/migrations/add_ignore_field_to_relays.js' | ||
// import { SanitizeRelayUrls } from '@nostrwatch/nwcache/migrations/sanitize.js' | ||
|
||
export default async(rcache) => { | ||
await MigrationFixRelayDuplicates(rcache) | ||
// await MigrationFixRelayDuplicates(rcache) | ||
// await AddIgnoreFieldToRelays(rcache) | ||
// await SanitizeRelayUrls(rcache) | ||
await FindClosestToRoot(rcache) | ||
await MigrationFixUsernamesInUrls(rcache) | ||
// await FindClosestToRoot(rcache) | ||
} |
13 changes: 13 additions & 0 deletions
13
apps/nocapd/src/migrate/migrations/fix-usernames-in-urls.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const MigrationFixUsernamesInUrls = async (rcache) => { | ||
const allRelays = await rcache.relay.get.all(['url']).map( relay => relay.url ) | ||
const deleted = [] | ||
for(const relay of allRelays) { | ||
const url = new URL(relay) | ||
if(url.username !== '') { | ||
// deleted.push(await rcache.relay.delete(relay)) | ||
deleted.push(relay) | ||
} | ||
} | ||
console.log(`deleted ${deleted.length} usernames from urls`) | ||
console.log(deleted) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { MigrationFixUsernamesInUrls } from '@nostrwatch/nwcache/migrations/fix_usernames_in_urls.js' | ||
|
||
export default async(rcache) => { | ||
await MigrationFixUsernamesInUrls(rcache) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const MigrationFixUsernamesInUrls = async (rcache) => { | ||
const allRelays = await rcache.relay.get.all(['url']).map( relay => relay.url ) | ||
const deleted = [] | ||
for(const relay of allRelays) { | ||
const url = new URL(relay) | ||
if(url.username !== '') { | ||
deleted.push(await rcache.relay.delete(relay)) | ||
// deleted.push(relay) | ||
} | ||
} | ||
console.log(`deleted ${deleted.length} usernames from urls`) | ||
console.log(deleted) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11242,6 +11242,11 @@ [email protected]: | |
resolved "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" | ||
integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== | ||
|
||
[email protected]: | ||
version "8.17.1" | ||
resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" | ||
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== | ||
|
||
[email protected]: | ||
version "8.18.0" | ||
resolved "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" | ||
|