nostream icon indicating copy to clipboard operation
nostream copied to clipboard

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

Open amunrarara opened this issue 1 year ago • 3 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?

amunrarara avatar May 05 '24 20:05 amunrarara

README?

cameri avatar May 06 '24 11:05 cameri

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

Fastidious avatar May 22 '24 12:05 Fastidious

Got it to work with:

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

Fastidious avatar May 22 '24 12:05 Fastidious

@amunrarara I'll try and make this work automatically with docker compose up, but please use ./scripts/start to start Nostream. That script takes care of creating the settings.yaml you are missing. The .nostr.local isn't used unless you are developing locally, I will get rid of that functionality as it has implemented but never used and causes confusion. Closing this ticket for now.

cameri avatar Oct 22 '24 13:10 cameri