From 48daa307b171fa947a6faef43efd110e16d6bd70 Mon Sep 17 00:00:00 2001 From: flxxyz Date: Fri, 2 Jun 2023 16:07:48 +0800 Subject: [PATCH] build: bumping up to v0.2.0 --- .bump/version | 2 +- deno.jsonc | 2 +- deployment/maintenance.yaml | 184 +------------------------ deployment/static-mirroring.yaml | 181 +----------------------- deployment/worker.yaml | 16 ++- docker-compose.yml | 2 +- package.json | 2 +- src/factories/worker-factory.ts | 1 - src/repositories/invoice-repository.ts | 2 +- 9 files changed, 24 insertions(+), 368 deletions(-) diff --git a/.bump/version b/.bump/version index 17e51c38..0ea3a944 100644 --- a/.bump/version +++ b/.bump/version @@ -1 +1 @@ -0.1.1 +0.2.0 diff --git a/deno.jsonc b/deno.jsonc index f335400d..3d7c7c67 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -18,7 +18,7 @@ "test:integration:nip28": "deno test test/integration/features/nip-28/nip-28.feature.test.ts --no-check -A", "test:integration:nip33": "deno test test/integration/features/nip-33/nip-33.feature.test.ts --no-check -A", "git-hooks": "deno run --no-check=remote --allow-run=deno,git --allow-read --allow-write=.git-hooks https://deno.land/x/githooked/mod.ts install", - "bump": "deno run --allow-all .bump/bump.ts", + "bump": "deno run -A .bump/bump.ts", "cache": "deno cache src/index.ts --reload", "cache:force": "deno cache src/index.ts --reload --lock-write" }, diff --git a/deployment/maintenance.yaml b/deployment/maintenance.yaml index d9dd962c..bbe8a97d 100644 --- a/deployment/maintenance.yaml +++ b/deployment/maintenance.yaml @@ -21,7 +21,7 @@ spec: - name: ghcr containers: - name: relay - image: ghcr.io/denostr-protocol/denostr:v0.1.1-maintenance + image: ghcr.io/denostr-protocol/denostr:v0.2.0-maintenance imagePullPolicy: Always resources: requests: @@ -38,187 +38,11 @@ spec: name: ws volumeMounts: - mountPath: /app/.nostr - name: denostr-maintenance-config-val + name: denostr-config-val volumes: - - name: denostr-maintenance-config-val + - name: denostr-config-val configMap: - name: denostr-maintenance-config + name: denostr-worker-config items: - key: settings.yaml path: settings.yaml - ---- -apiVersion: v1 -data: - settings.yaml: | - info: - relay_url: wss://your-domain.com - name: "nostr relay by denostr" - description: Deno-based, cloud-native nostr implementation supported by ByteTrade and Revo, forked from nostream. - pubkey: replace-with-your-pubkey-in-hex - contact: mailto:operator@your-domain.com - payments: - enabled: false - processor: lnbits - feeSchedules: - admission: - - enabled: false - description: Admission fee charged per public key in msats (1000 msats = 1 satoshi) - amount: 1000000 - whitelists: - pubkeys: - - replace-with-your-pubkey-in-hex - event_kinds: - - 9735 # Nip-57 Lightning Zap Receipts - paymentsProcessors: - zebedee: - baseURL: https://api.zebedee.io/ - callbackBaseURL: https://relay.your-domain.com/callbacks/zebedee - ipWhitelist: - - "3.225.112.64" - - "::ffff:3.225.112.64" - lnbits: - baseURL: https://lnbits.your-domain.com/ - callbackBaseURL: https://relay.your-domain.com/callbacks/lnbits - network: - maxPayloadSize: 524288 - # Comment the next line if using CloudFlare proxy - remoteIpHeader: x-forwarded-for - # Uncomment the next line if using CloudFlare proxy - # remoteIpHeader: cf-connecting-ip - workers: - count: 0 - mirroring: - static: [] - limits: - invoice: - rateLimits: - - period: 60000 - rate: 12 - - period: 3600000 - rate: 30 - ipWhitelist: - - "::1" - - "10.10.10.1" - - "::ffff:10.10.10.1" - connection: - rateLimits: - - period: 1000 - rate: 24 - - period: 60000 - rate: 72 - ipWhitelist: - - "::1" - - "10.10.10.1" - - "::ffff:10.10.10.1" - event: - eventId: - minLeadingZeroBits: 0 - kind: - whitelist: [] - blacklist: [] - pubkey: - minBalance: 0 - minLeadingZeroBits: 0 - whitelist: [] - blacklist: [] - createdAt: - maxPositiveDelta: 900 - maxNegativeDelta: 0 - content: - - description: 100 KB for event kind ranges 0-10 and 40-49 - kinds: - - - 0 - - 10 - - - 40 - - 49 - maxLength: 102400 - - description: 100 KB for event kind ranges 11-39 and 50-max - kinds: - - - 11 - - 39 - - - 50 - - 9007199254740991 - maxLength: 102400 - rateLimits: - - description: 30 events/min for event kinds 0, 3, 40 and 41 - kinds: - - 0 - - 3 - - 40 - - 41 - period: 60000 - rate: 30 - - description: 144 events/min for event kinds 1, 2, 4 and 42 - kinds: - - 1 - - 2 - - 4 - - 42 - period: 60000 - rate: 144 - - description: 1200 events/min for encrypted channel event kinds 104 and 140-142 - kinds: - - 104 - - 140 - - 141 - - 142 - period: 60000 - rate: 1200 - - description: 60 events/min for event kind ranges 5-7 and 43-49 - kinds: - - - 5 - - 7 - - - 43 - - 49 - period: 60000 - rate: 60 - - description: - 24 events/min for replaceable events and parameterized replaceable - events - kinds: - - - 10000 - - 19999 - - - 30000 - - 39999 - period: 60000 - rate: 24 - - description: 120 events/min for ephemeral events - kinds: - - - 20000 - - 29999 - period: 60000 - rate: 120 - - description: 4800 events/hour for all events - period: 3600000 - rate: 4800 - whitelists: - pubkeys: [] - ipAddresses: - - "::1" - - "10.10.10.1" - - "::ffff:10.10.10.1" - client: - subscription: - maxSubscriptions: 10 - maxFilters: 10 - maxFilterValues: 2500 - maxSubscriptionIdLength: 256 - maxLimit: 5000 - minPrefixLength: 4 - message: - rateLimits: - - description: 720 raw messages/min - period: 60000 - rate: 720 - ipWhitelist: - - "::1" - - "10.10.10.1" - - "::ffff:10.10.10.1" - -kind: ConfigMap -metadata: - labels: - component: denostr - name: denostr-maintenance-config - namespace: denostr diff --git a/deployment/static-mirroring.yaml b/deployment/static-mirroring.yaml index a1ea7096..cd171757 100644 --- a/deployment/static-mirroring.yaml +++ b/deployment/static-mirroring.yaml @@ -21,7 +21,7 @@ spec: - name: ghcr containers: - name: relay - image: ghcr.io/denostr-protocol/denostr:v0.1.1-static-mirroring + image: ghcr.io/denostr-protocol/denostr:v0.2.0-static-mirroring imagePullPolicy: Always resources: requests: @@ -40,184 +40,9 @@ spec: - mountPath: /app/.nostr name: denostr-static-mirroring-config-val volumes: - - name: denostr-static-mirroring-config-val + - name: denostr-config-val configMap: - name: denostr-static-mirroring-config + name: denostr-worker-config items: - key: settings.yaml path: settings.yaml - ---- -apiVersion: v1 -data: - settings.yaml: | - info: - relay_url: wss://your-domain.com - name: "nostr relay by denostr" - description: Deno-based, cloud-native nostr implementation supported by ByteTrade and Revo, forked from nostream. - pubkey: replace-with-your-pubkey-in-hex - contact: mailto:operator@your-domain.com - payments: - enabled: false - processor: lnbits - feeSchedules: - admission: - - enabled: false - description: Admission fee charged per public key in msats (1000 msats = 1 satoshi) - amount: 1000000 - whitelists: - pubkeys: - - replace-with-your-pubkey-in-hex - event_kinds: - - 9735 # Nip-57 Lightning Zap Receipts - paymentsProcessors: - zebedee: - baseURL: https://api.zebedee.io/ - callbackBaseURL: https://relay.your-domain.com/callbacks/zebedee - ipWhitelist: - - "3.225.112.64" - - "::ffff:3.225.112.64" - lnbits: - baseURL: https://lnbits.your-domain.com/ - callbackBaseURL: https://relay.your-domain.com/callbacks/lnbits - network: - maxPayloadSize: 524288 - # Comment the next line if using CloudFlare proxy - remoteIpHeader: x-forwarded-for - # Uncomment the next line if using CloudFlare proxy - # remoteIpHeader: cf-connecting-ip - workers: - count: 0 - mirroring: - static: [] - limits: - invoice: - rateLimits: - - period: 60000 - rate: 12 - - period: 3600000 - rate: 30 - ipWhitelist: - - "::1" - - "10.10.10.1" - - "::ffff:10.10.10.1" - connection: - rateLimits: - - period: 1000 - rate: 24 - - period: 60000 - rate: 72 - ipWhitelist: - - "::1" - - "10.10.10.1" - - "::ffff:10.10.10.1" - event: - eventId: - minLeadingZeroBits: 0 - kind: - whitelist: [] - blacklist: [] - pubkey: - minBalance: 0 - minLeadingZeroBits: 0 - whitelist: [] - blacklist: [] - createdAt: - maxPositiveDelta: 900 - maxNegativeDelta: 0 - content: - - description: 100 KB for event kind ranges 0-10 and 40-49 - kinds: - - - 0 - - 10 - - - 40 - - 49 - maxLength: 102400 - - description: 100 KB for event kind ranges 11-39 and 50-max - kinds: - - - 11 - - 39 - - - 50 - - 9007199254740991 - maxLength: 102400 - rateLimits: - - description: 30 events/min for event kinds 0, 3, 40 and 41 - kinds: - - 0 - - 3 - - 40 - - 41 - period: 60000 - rate: 30 - - description: 144 events/min for event kinds 1, 2, 4 and 42 - kinds: - - 1 - - 2 - - 4 - - 42 - period: 60000 - rate: 144 - - description: 1200 events/min for encrypted channel event kinds 104 and 140-142 - kinds: - - 104 - - 140 - - 141 - - 142 - period: 60000 - rate: 1200 - - description: 60 events/min for event kind ranges 5-7 and 43-49 - kinds: - - - 5 - - 7 - - - 43 - - 49 - period: 60000 - rate: 60 - - description: - 24 events/min for replaceable events and parameterized replaceable - events - kinds: - - - 10000 - - 19999 - - - 30000 - - 39999 - period: 60000 - rate: 24 - - description: 120 events/min for ephemeral events - kinds: - - - 20000 - - 29999 - period: 60000 - rate: 120 - - description: 4800 events/hour for all events - period: 3600000 - rate: 4800 - whitelists: - pubkeys: [] - ipAddresses: - - "::1" - - "10.10.10.1" - - "::ffff:10.10.10.1" - client: - subscription: - maxSubscriptions: 10 - maxFilters: 10 - maxFilterValues: 2500 - maxSubscriptionIdLength: 256 - maxLimit: 5000 - minPrefixLength: 4 - message: - rateLimits: - - description: 720 raw messages/min - period: 60000 - rate: 720 - ipWhitelist: - - "::1" - - "10.10.10.1" - - "::ffff:10.10.10.1" -kind: ConfigMap -metadata: - labels: - component: denostr - name: denostr-static-mirroring-config - namespace: denostr diff --git a/deployment/worker.yaml b/deployment/worker.yaml index af09b031..9386c231 100644 --- a/deployment/worker.yaml +++ b/deployment/worker.yaml @@ -21,7 +21,7 @@ spec: - name: ghcr containers: - name: relay - image: ghcr.io/denostr-protocol/denostr:v0.1.1-worker + image: ghcr.io/denostr-protocol/denostr:v0.2.0-worker imagePullPolicy: Always resources: requests: @@ -38,9 +38,9 @@ spec: name: ws volumeMounts: - mountPath: /app/.nostr - name: denostr-worker-config-val + name: denostr-config-val volumes: - - name: denostr-worker-config-val + - name: denostr-config-val configMap: name: denostr-worker-config items: @@ -80,6 +80,14 @@ data: lnbits: baseURL: https://lnbits.your-domain.com/ callbackBaseURL: https://relay.your-domain.com/callbacks/lnbits + lnurl: + invoiceURL: https://getalby.com/lnurlp/your-username + nodeless: + baseURL: https://nodeless.io + storeId: your-nodeless-io-store-id + opennode: + baseURL: api.opennode.com + callbackBaseURL: https://relay.your-domain.com/callbacks/opennode network: maxPayloadSize: 524288 # Comment the next line if using CloudFlare proxy @@ -118,7 +126,7 @@ data: whitelist: [] blacklist: [] pubkey: - minBalance: 0 + minBalance: 1000 minLeadingZeroBits: 0 whitelist: [] blacklist: [] diff --git a/docker-compose.yml b/docker-compose.yml index 4b281d65..5a774807 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: denostr-server0: - image: ghcr.io/denostr-protocol/denostr:v0.1.1-worker + image: ghcr.io/denostr-protocol/denostr:v0.2.0-worker container_name: denostr-server0 environment: RELAY_PORT: 8008 diff --git a/package.json b/package.json index e6a65a37..f9143d5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "denostr", - "version": "0.1.1", + "version": "0.2.0", "description": "💪🏻 Deno-based, cloud-native Nostr relay forked from nostream. Sponsored by ByteTrade and Revo.", "supportedNips": [ 1, diff --git a/src/factories/worker-factory.ts b/src/factories/worker-factory.ts index 73dc8887..0eac7572 100644 --- a/src/factories/worker-factory.ts +++ b/src/factories/worker-factory.ts @@ -7,7 +7,6 @@ import { UserRepository } from '../repositories/user-repository.ts' import { createWebApp } from './web-app-factory.ts' import { webSocketAdapterFactory } from './websocket-adapter-factory.ts' import { getCacheClient } from '../cache/client.ts' -import Config from '@/config/index.ts' export const workerFactory = (): AppWorker => { const eventRepository = new EventRepository(createSettings) diff --git a/src/repositories/invoice-repository.ts b/src/repositories/invoice-repository.ts index 36fcbc24..23b36a91 100644 --- a/src/repositories/invoice-repository.ts +++ b/src/repositories/invoice-repository.ts @@ -1,4 +1,4 @@ -import { always, applySpec, head, ifElse, is, map, omit, pipe, prop, propSatisfies, toString } from 'ramda' +import { always, applySpec, ifElse, is, pipe, prop, propSatisfies, toString } from 'ramda' import { DatabaseClient } from '@/@types/base.ts' import { DBInvoice, Invoice, InvoiceStatus } from '@/@types/invoice.ts'