nf start resolves a relative --cert or --key against the loader folder

Aperta
#282 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bun, typescript
Ambito
cli

Direzione di ricerca

Read src/action/actions/start.action.ts around lines 221–222 to trace how certificate and key paths are passed to the loader; the issue says flags should resolve from the current working directory and config values from the project folder. Check the loader startup path and the start.mdx limitation, then verify both files are checked before startup and relative paths work for both input sources.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug command:start
Which package is this bug report for?

@nanoforge-dev/cli

Which command is this bug report for?

start

Issue description

nf start --cert <path> --key <path> (or tls.cert/tls.key in the config) only works with absolute paths (read from the code, not run). -d is made absolute with getCwd, but cert and key are passed as given (src/action/actions/start.action.ts#L221-L222). The loader runs with its cwd in node_modules/@nanoforge-dev/loader-client and opens the files with Bun.file(cert) (Loader apps/client/src/server.ts line 60). So --cert ./cert.pem, or a relative path in the config, points into the loader's folder and the client fails to start. Because of the exit-code issue on nf start, the command then exits 0 too.

start.mdx documents this as a limitation (lines 61 and 96). Related to #156, which added TLS to the config.

Expected: relative paths are resolved (from the cwd for the flags, from the project folder for config values), and both files are checked before the loader starts.

Found during a read-only audit of main at e95b881 (2026-11-11).

Code sample
params["--cert"] = target.tls.cert;   // passed as given
params["--key"] = target.tls.key;
// while "-d": getCwd(join(target.directory, target.outDir)) is made absolute
Versions
  • @nanoforge-dev/cli 3.0.1 (main, e95b881)
  • Node.js 26.7.0
  • Bun 1.3.14 (bundled)
  • Linux
Issue priority

Low (slightly annoying)

I have tested this issue on a development release

No response

Lingua principale
TypeScript
Stelle
2
Fork
2
Merge medio
2g 18h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NanoForge-dev/CLI

Tutte le issue di NanoForge-dev/CLI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.