Skip to content

Commit

Permalink
chore: add skip admission check (thanks YEGHRO)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameri committed Oct 22, 2024
1 parent f57d93e commit b0488ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Running `nostream` for the first time creates the settings file in `<project_roo
| mirroring.static[].address | Address of mirrored relay. (e.g. ws://100.100.100.100:8008) |
| mirroring.static[].filters | Subscription filters used to mirror. |
| mirroring.static[].limits.event | Event limit overrides for this mirror. See configurations under limits.event. |
| mirroring.static[].skipAdmissionCheck | Disable the admission fee check for events coming from this mirror. |
| mirroring.static[].secret | Secret to pass to relays. Nostream relays only. Optional. |
| workers.count | Number of workers to spin up to handle incoming connections. |
| | Spin workers as many CPUs are available when set to zero. Defaults to zero. |
Expand Down
1 change: 1 addition & 0 deletions src/@types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export interface Mirror {
limits?: {
event?: EventLimits
}
skipAdmissionCheck?: boolean
}

export interface Mirroring {
Expand Down
4 changes: 4 additions & 0 deletions src/app/static-mirroring-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ export class StaticMirroringWorker implements IRunnable {
protected async isUserAdmitted(event: Event): Promise<boolean> {
const currentSettings = this.settings()

if (this.config.skipAdmissionCheck === true) {
return true
}

if (currentSettings.payments?.enabled !== true) {
return true
}
Expand Down

0 comments on commit b0488ff

Please sign in to comment.