Skip to content

Commit 6497229

Browse files
authored
fix: save event from mirrors (#376)
* fix: save event from mirrors * docs: add config for mirroring event limits * chore: add skip admission check (thanks YEGHRO) * 2.0.1 * chore: bump some deps
1 parent c2345ef commit 6497229

File tree

10 files changed

+259
-47
lines changed

10 files changed

+259
-47
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ dist
3535
*.env
3636

3737
# Nostr data folder
38-
.nostr
38+
.nostr
39+
40+
# Docker Compose overrides
41+
docker-compose.overrides.yml

CONFIGURATION.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Running `nostream` for the first time creates the settings file in `<project_roo
8787
| paymentProcessors.lnurl.invoiceURL | [LUD-06 Pay Request](https://github.com/lnurl/luds/blob/luds/06.md) provider URL. (e.g. https://getalby.com/lnurlp/your-username) |
8888
| mirroring.static[].address | Address of mirrored relay. (e.g. ws://100.100.100.100:8008) |
8989
| mirroring.static[].filters | Subscription filters used to mirror. |
90+
| mirroring.static[].limits.event | Event limit overrides for this mirror. See configurations under limits.event. |
91+
| mirroring.static[].skipAdmissionCheck | Disable the admission fee check for events coming from this mirror. |
9092
| mirroring.static[].secret | Secret to pass to relays. Nostream relays only. Optional. |
9193
| workers.count | Number of workers to spin up to handle incoming connections. |
9294
| | Spin workers as many CPUs are available when set to zero. Defaults to zero. |

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18-alpine3.16 as build
1+
FROM node:18-alpine3.16 AS build
22

33
WORKDIR /build
44

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ services:
7575
restart: on-failure
7676
networks:
7777
default:
78+
7879
nostream-db:
7980
image: postgres
8081
container_name: nostream-db
@@ -96,6 +97,7 @@ services:
9697
timeout: 5s
9798
retries: 5
9899
start_period: 360s
100+
99101
nostream-cache:
100102
image: redis:7.0.5-alpine3.16
101103
container_name: nostream-cache
@@ -110,6 +112,7 @@ services:
110112
interval: 1s
111113
timeout: 5s
112114
retries: 5
115+
113116
nostream-migrate:
114117
image: node:18-alpine3.16
115118
container_name: nostream-migrate
@@ -131,7 +134,6 @@ services:
131134
condition: service_healthy
132135
networks:
133136
default:
134-
ipv4_address: 10.10.10.254
135137

136138
networks:
137139
default:

package-lock.json

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nostream",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A Nostr relay written in Typescript.",
55
"supportedNips": [
66
1,
@@ -90,7 +90,7 @@
9090
"@types/ramda": "^0.28.13",
9191
"@types/sinon": "^10.0.11",
9292
"@types/sinon-chai": "^3.2.8",
93-
"@types/ws": "^8.5.3",
93+
"@types/ws": "^8.5.12",
9494
"@typescript-eslint/eslint-plugin": "^5.19.0",
9595
"@typescript-eslint/parser": "^5.19.0",
9696
"chai": "^4.3.6",
@@ -115,7 +115,7 @@
115115
},
116116
"dependencies": {
117117
"@noble/secp256k1": "1.7.1",
118-
"axios": "1.6.5",
118+
"axios": "^1.7.7",
119119
"bech32": "2.0.0",
120120
"body-parser": "1.20.1",
121121
"debug": "4.3.4",
@@ -132,7 +132,7 @@
132132
"redis": "4.5.1",
133133
"rxjs": "7.8.0",
134134
"tor-control-ts": "^1.0.0",
135-
"ws": "8.12.0"
135+
"ws": "^8.18.0"
136136
},
137137
"config": {
138138
"commitizen": {

src/@types/settings.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ export interface Mirror {
203203
address: string
204204
filters?: SubscriptionFilter[]
205205
secret?: Secret
206+
limits?: {
207+
event?: EventLimits
208+
}
209+
skipAdmissionCheck?: boolean
206210
}
207211

208212
export interface Mirroring {

0 commit comments

Comments
 (0)