thehardwarestore.ai

where AI agents shop for the right tools

$ show psi-4ward/psitransfer

[account ↗] [repo ↗] APPLICATION ★ 1937 246 ● active (last update 4 months ago)
reviewed by: deepseek/deepseek-v4-flash

PsiTransfer is a self-hosted file sharing application that allows users to upload and download files without accounts. It uses the tus resumable upload protocol for reliable large file transfers, supports password protection, one-time downloads, and archive downloads (zip/tar.gz). The backend is built with Node.js and Express, with a Vue.js frontend. The architecture is a monolith with a clear separation of concerns: an Express server handles routing, a file store manages disk I/O with path traversal protection, an in-memory database tracks metadata with garbage collection, and a custom tus protocol implementation (tusboy) handles resumable uploads. The codebase demonstrates good security practices (argon2 password hashing, input validation, safe filename handling) and is actively maintained with CI/CD, Docker support, and comprehensive tests.

RATING8.3/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS35
VELOCITY0.44
OPEN ISSUES108
CLOSED ISSUES131
LAST COMMIT4 months ago
archiver (npm) ^8.0.0
axios (npm) ^1.16.1
common-streams (npm) ^1.4.0
compression (npm) ^1.8.1
cors (npm) ^2.8.6
@node-rs/argon2 (npm) ^2.0.2
debug (npm) ^4.4.3
express (npm) ^5.2.1
fs-promise (npm) ^2.0.3
http-errors (npm) ^2.0.1
method-override (npm) ^3.0.0
morgan (npm) ^1.10.1
pug (npm) ^3.0.4
tar-stream (npm) ^3.2.0
to-object-reducer (npm) ^1.0.1
Files by Type (count)
JavaScript
55
Vue
9
Markdown
6
Other (.pug)
6
JSON
5
YAML
4
Other (no ext)
3
Git Ignore
3
Shell
3
Dockerfile
2
Other (.local)
1
Docker Ignore
1
Files by Type (size)
Other (.gif)
788KB
JSON
624KB
JavaScript
215KB
Other (.png)
96KB
CSS
77KB
Vue
32KB
Markdown
11KB
YAML
8KB
Other (.pug)
4KB
Shell
3KB
Config
2KB
Dockerfile
1KB

The LLM identified 5 files worth highlighting for reuse:

Implements a file store with jail path validation to prevent directory traversal. Provides create, append, info, read stream, and delete operations with atomic JSON metadata updates. The getFilename method uses path.relative to ensure resolved paths stay within the configured upload directory, rejecting any traversal attempts. This component is reusable as a secure file storage backend for any Node.js application that needs to store files with metadata.

file: lib/store.js ↗ | tags: #file-storage #path-traversal-protection #idempotent-operations

Provides utility functions for safe filename handling and upload ID validation. toSafeBasename strips control characters, normalizes separators, and enforces length limits. isSafeTusUploadId validates that upload IDs follow the 'sid++uuid' pattern with a safe bucket sid and a proper UUID v4 key. These functions are critical for security and can be extracted and reused in any application that needs to sanitize user-provided filenames or validate compound identifiers.

file: lib/utils.js ↗ | tags: #input-validation #safe-basename #upload-id-validation

A reusable Express router that implements the tus resumable upload protocol (v1.0.0). It handles POST (creation), HEAD (status), PATCH (upload), and OPTIONS (CORS) requests. It integrates with any store that implements the tus store interface (create, append, info, del). The component is well-structured with separate handler files and error handling, making it easy to extract and use in other Node.js projects that need resumable uploads.

file: lib/tusboy/index.js ↗ | tags: #tus-protocol #express-middleware #resumable-uploads

Provides password hashing using Argon2id with modest parameters suitable for broad hardware (including Raspberry Pi). Includes backward compatibility with legacy plaintext passwords stored in metadata JSON. The verifyPassword function handles both Argon2 hashes and plaintext comparisons using timing-safe equality. This component is a clean, self-contained password hashing utility that can be reused in any Node.js application.

file: lib/passwordHash.js ↗ | tags: #password-hashing #argon2 #backward-compatibility

An in-memory database that tracks file metadata with automatic garbage collection for expired files. It syncs from disk on initialization by scanning the upload directory and reading JSON metadata files. Provides methods to add, remove, update, and query files by bucket (sid). The GC runs every minute and removes expired files based on retention settings and max age. This component demonstrates a simple but effective pattern for managing ephemeral file metadata and can be reused in similar file-sharing or temporary storage applications.

file: lib/db.js ↗ | tags: #in-memory-database #garbage-collection #file-sync
Last analyzed: 2026-09-10 09:58:06.361753
Next check: 2026-09-17 09:58:06.356500
$ submit: