Add SFTP atomic upload functionality

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
node.js, typescript
Ambito
networking

Direzione di ricerca

Non è indicato alcun file o test del repository. Inizia individuando i punti di ingresso per l'upload di file e directory tramite SFTP, quindi confronta l'implementazione monkeypatched collegata. Il lavoro è completato quando gli utenti possono attivare o agganciare gli upload atomici, in modo che i trasferimenti usino un nome temporaneo e vengano rinominati solo dopo il completamento.

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

Descrizione

When uploading a file to a remote directory, the file is incomplete until finished. If pushed to a directory with a webserver, clients could download partial files and be very confused (I'm sure there are other situations where this could be an issue as well). rsync doesn't have this issue -- it uploads a temporary file, then rename it once the transfer is completed. However, rsync doesn't work everywhere.

I filed an issue at ssh2, but they were of the opinion that something higher up the stack should do this sort of thing, so here we are. In particular, it would be annoying to have to reimplement the directory upload code to insert this sort of functionality -- so it would be nice if either:

  • There was a hook that made this possible for a user to implement
  • Or there was an option that could be passed in that would activate the 'atomicPut' functionality

I've created a monkeypatch'ed version of this, works great on my server. It pushes as a dot + filename so that the webserver doesn't show it to clients, and then changes the filename once the upload is finished. I'd rather get rid of the monkeypatch, and I'm happy to do the changes + make a PR here if you'll accept it.

Lingua principale
TypeScript
Stelle
1k
Fork
94
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 steelbrain/node-ssh

Tutte le issue di steelbrain/node-ssh

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.