Compare commits

..

No commits in common. "e3f86e1b54adc83d257742afe052149999777470" and "100a5056eb9401ccee3f4fe0d89988ab97fd1d72" have entirely different histories.

8 changed files with 14 additions and 37 deletions

View File

@ -7,9 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.0.0] - 2024-06-14
- Initial release
[unreleased]: https://gitlab.com/soapbox-pub/ditto/-/compare/v1.0.0...HEAD
[1.0.0]: https://gitlab.com/soapbox-pub/ditto/-/tags/v1.0.0
[unreleased]: https://gitlab.com/soapbox-pub/ditto/-/compare/main...HEAD

View File

@ -7,6 +7,8 @@ For more info see: https://docs.soapbox.pub/ditto/
<img width="400" src="ditto-planet.png">
⚠️ This software is a work in progress.
## Features
- [x] Built-in Nostr relay
@ -16,9 +18,9 @@ For more info see: https://docs.soapbox.pub/ditto/
- [x] Reposts
- [x] Notifications
- [x] Profiles
- [x] Search
- [ ] Search
- [x] Moderation
- [x] Zaps
- [ ] Zaps
- [x] Customizable
- [x] Open source
- [x] Self-hosted

View File

@ -23,7 +23,7 @@
"@db/sqlite": "jsr:@db/sqlite@^0.11.1",
"@isaacs/ttlcache": "npm:@isaacs/ttlcache@^1.4.1",
"@noble/secp256k1": "npm:@noble/secp256k1@^2.0.0",
"@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.23.2",
"@nostrify/nostrify": "jsr:@nostrify/nostrify@^0.23.1",
"@scure/base": "npm:@scure/base@^1.1.6",
"@sentry/deno": "https://deno.land/x/sentry@7.112.2/index.mjs",
"@soapbox/kysely-deno-sqlite": "jsr:@soapbox/kysely-deno-sqlite@^2.1.0",

View File

@ -10,7 +10,7 @@
"jsr:@nostrify/nostrify@^0.22.1": "jsr:@nostrify/nostrify@0.22.5",
"jsr:@nostrify/nostrify@^0.22.4": "jsr:@nostrify/nostrify@0.22.4",
"jsr:@nostrify/nostrify@^0.22.5": "jsr:@nostrify/nostrify@0.22.5",
"jsr:@nostrify/nostrify@^0.23.2": "jsr:@nostrify/nostrify@0.23.2",
"jsr:@nostrify/nostrify@^0.23.1": "jsr:@nostrify/nostrify@0.23.1",
"jsr:@soapbox/kysely-deno-sqlite@^2.1.0": "jsr:@soapbox/kysely-deno-sqlite@2.2.0",
"jsr:@soapbox/stickynotes@^0.4.0": "jsr:@soapbox/stickynotes@0.4.0",
"jsr:@std/assert@^0.217.0": "jsr:@std/assert@0.217.0",
@ -122,10 +122,11 @@
"npm:zod@^3.23.8"
]
},
"@nostrify/nostrify@0.23.2": {
"integrity": "c880fd91b5fe69a6239f98cae62297ffccc2a78d160af4d376dd05899352daf0",
"@nostrify/nostrify@0.23.1": {
"integrity": "7a242dedfe33cf38131696ad96d789d54257cfbfd5b5e63748fe5d53c057d99a",
"dependencies": [
"jsr:@std/encoding@^0.224.1",
"npm:@scure/base@^1.1.6",
"npm:@scure/bip32@^1.4.0",
"npm:@scure/bip39@^1.3.0",
"npm:kysely@^0.27.3",
@ -1359,7 +1360,7 @@
"dependencies": [
"jsr:@bradenmacdonald/s3-lite-client@^0.7.4",
"jsr:@db/sqlite@^0.11.1",
"jsr:@nostrify/nostrify@^0.23.2",
"jsr:@nostrify/nostrify@^0.23.1",
"jsr:@soapbox/kysely-deno-sqlite@^2.1.0",
"jsr:@soapbox/stickynotes@^0.4.0",
"jsr:@std/assert@^0.225.1",

View File

@ -69,17 +69,8 @@ const nameRequestSchema = z.object({
});
export const nameRequestController: AppController = async (c) => {
const store = await Storages.db();
const signer = c.get('signer')!;
const pubkey = await signer.getPublicKey();
const { name, reason } = nameRequestSchema.parse(await c.req.json());
const [existing] = await store.query([{ kinds: [3036], authors: [pubkey], '#r': [name], limit: 1 }]);
if (existing) {
return c.json({ error: 'Name request already exists' }, 400);
}
const event = await createEvent({
kind: 3036,
content: reason,
@ -135,7 +126,7 @@ export const nameRequestsController: AppController = async (c) => {
}
}
if (!ids.size) {
if (ids.size === 0) {
return c.json([]);
}

View File

@ -3,7 +3,7 @@ import { Conf } from '@/config.ts';
import { Storages } from '@/storages.ts';
import { getInstanceMetadata } from '@/utils/instance.ts';
const version = '3.0.0 (compatible; Ditto 1.0.0)';
const version = '0.0.0 (compatible; Ditto 0.0.1)';
const instanceV1Controller: AppController = async (c) => {
const { host, protocol } = Conf.url;

View File

@ -1,14 +0,0 @@
import { Kysely } from 'kysely';
export async function up(db: Kysely<any>): Promise<void> {
await db.schema
.createIndex('idx_tags_name')
.on('nostr_tags')
.column('name')
.ifNotExists()
.execute();
}
export async function down(db: Kysely<any>): Promise<void> {
await db.schema.dropIndex('idx_tags_name').ifExists().execute();
}

View File

@ -38,7 +38,7 @@ class EventsDB implements NStore {
'p': ({ event, count, value }) => (count < 15 || event.kind === 3) && isNostrId(value),
'proxy': ({ count, value }) => count === 0 && isURL(value),
'q': ({ event, count, value }) => count === 0 && event.kind === 1 && isNostrId(value),
'r': ({ event, count }) => (event.kind === 1985 ? count < 20 : count < 3),
'r': ({ event, count, value }) => (event.kind === 1985 ? count < 20 : count < 3) && isURL(value),
't': ({ event, count, value }) => (event.kind === 1985 ? count < 20 : count < 5) && value.length < 50,
};