Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Harden file permissions of settings.json, the app known_hosts and the data directory

Aperta
#38 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
mysql, postgresql, react, rust, sqlite, tauri, typescript

Direzione di ricerca

Start with src-tauri/src/settings.rs, src-tauri/src/known_hosts.rs (or the SSH host key store), src-tauri/src/lib.rs, and src/stores/settings.ts; read the two linked notes for context. Check the startup and settings save/load paths, then add the requested Unix mode and per-field fallback coverage. Done means the stated permission and settings criteria pass, with pnpm test && pnpm lint and the Rust checks when Rust changes.

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

Descrizione

area:backend area:security size:S status:ready type:task

Context

The v1 smoke run found settings.json and the app's own known_hosts written 0664, and an app data directory created before the first launch (for example by scripts/demo-db.sh) stays 0775. app.db is already 0600. None of these files holds a secret, but they should be private like the database. Related settings-file robustness minors were deferred from plan 5.

To do

  • Create/write settings.json and the app known_hosts with mode 0600, and tighten the data directory to 0700 at startup (also when it already exists), on Unix only.
  • fsync the parent directory after the atomic rename of settings.json.
  • A numeric overflow or negative value in settings.json resets ALL fields to defaults (serde fails on the whole struct): clamp or default per field instead.
  • The settings store's load() is not sequenced against an in-flight update(), and a failed stale update's error is dropped silently.

Acceptance criteria

  • After a fresh launch (and after launching over a 0775 directory) stat shows 0600 files and a 0700 data directory.
  • A settings.json with one bad number keeps its other fields.
  • Unit tests cover the modes (cfg(unix)) and the per-field fallback.
  • pnpm test && pnpm lint green (plus cargo clippy --all-targets -- -D warnings and pnpm test:rust when Rust changes)

Likely files touched

  • src-tauri/src/settings.rs, src-tauri/src/known_hosts.rs (or the SSH host key store), src-tauri/src/lib.rs (data dir setup)
  • src/stores/settings.ts

Linked docs

  • docs/notes/integration-v1-smoke.md ("Seen, not fixed")
  • docs/notes/plan-05-followups.md (Settings, Task 1)
Lingua principale
TypeScript
Stelle
0
Fork
0
Merge medio
1h 2m
PR unite (30g)
41

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 Cemoche/tablemax

Tutte le issue di Cemoche/tablemax

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.