cameri / nostream

A Nostr Relay written in TypeScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] settings.json is present, but settings.yaml is required?

amunrarara opened this issue · comments

Describe the bug
I've just cloned the project, then run docker-compose up from root. The following error appears:

nostream          | node:internal/fs/watchers:255
nostream          |     throw error;
nostream          |     ^
nostream          | 
nostream          | Error: ENOENT: no such file or directory, watch '/home/node/.nostr/settings.yaml'
nostream          |     at FSWatcher.<computed> (node:internal/fs/watchers:247:19)
nostream          |     at Object.watch (node:fs:2343:34)
nostream          |     at SettingsStatic.watchSettings (/app/src/utils/settings.js:107:26)
nostream          |     at App.run (/app/src/app/app.js:35:51)
nostream          |     at Object.<anonymous> (/app/src/index.js:33:30)
nostream          |     at Module._compile (node:internal/modules/cjs/loader:1254:14)
nostream          |     at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
nostream          |     at Module.load (node:internal/modules/cjs/loader:1117:32)
nostream          |     at Module._load (node:internal/modules/cjs/loader:958:12)
nostream          |     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
nostream          |   errno: -2,
nostream          |   syscall: 'watch',
nostream          |   code: 'ENOENT',
nostream          |   path: '/home/node/.nostr/settings.yaml',
nostream          |   filename: '/home/node/.nostr/settings.yaml'
nostream          | }
nostream          | 
nostream          | Node.js v18.16.0
nostream exited with code 1

Digging a bit deeper, I see that .nostr.local/settings.json exists, thus is made available when volumes: - ${PWD}/.nostr:/home/node/.nostr is called in the the docker-compose.yml

However, there is no settings.yaml file included in that folder, which causes the error above.

A bit of inspection of the codebase shows that settings.spec.ts references settings.json a couple of times, and it's mentioned in the README, but nowhere else does it appear. The rest of the codebase expects settings.yaml.

Why is settings.json included, and not settings.yaml? The instructions state that settings.json is being auto-created, but then it is never consumed?

I'll copy resources/default-settings.yaml by hand as-per the instructions, but it seems it should be auto-generated instead of a never-used settings.json, eh?

Having the same issue. What's the solution for this? ELI5, please. Thannks!

Got it to work with:

cp resources/default-settings.yaml ./.nostr/settings.yaml