Secure cargo transport for your digital files
A self-hosted, end-to-end encrypted file sharing system for local networks
Features β’ Quick Start β’ API Usage β’ Security β’ Contributing
Like the USCSS Nostromo, this system reliably transports your digital cargo across local networks with military-grade security. Perfect for teams, families, or anyone who needs to share files securely within their local network.
- End-to-end encryption using AES-256-GCM and libsodium
- HTTPS with self-signed certificates for secure local communication
- Device fingerprint verification with trust-on-first-use
- API key authentication with configurable permissions
- Automatic file expiration to prevent data accumulation
- Device discovery and identification
- Device management with trust levels
- File tracking by source device
- mDNS/Bonjour support for automatic network discovery (optional)
- RESTful API for programmatic file upload/download
- cURL/wget compatible for easy scripting
- Multiple API keys with different permissions
- Bulk operations and file management
- Modern React interface with Tailwind CSS
- Drag-and-drop file uploads with progress tracking
- Device and file management dashboards
- Real-time status updates and notifications
- Docker support with docker-compose
- PostgreSQL or SQLite database options
- Environment-based configuration
- Portable and self-contained
-
Clone and setup:
git clone https://github.com/yourusername/nostromo.git cd nostromo -
Start the application:
# Using Docker (recommended) docker-compose up -d # Or run manually npm run install:all npm run dev
-
Access the application:
- Web interface: https://localhost:3000
- API endpoint: https://localhost:8080/api
Note: On first run, the application will generate self-signed certificates and initial API keys automatically.
- Node.js 18+
- npm or yarn
- PostgreSQL (optional, SQLite used by default)
-
Install dependencies:
npm run install:all
-
Configure environment:
cp .env.example .env # Edit .env with your configuration -
Start development servers:
npm run dev
-
For production:
npm run build npm start
| Variable | Description | Default |
|---|---|---|
FILE_STORAGE_PATH |
Directory for encrypted files | ./uploads |
ENCRYPTION_KEY |
32-character encryption key | Required |
API_KEY |
Initial API key | Required |
JWT_SECRET |
JWT signing secret | Required |
MAX_FILE_AGE |
Auto-expiry time (seconds) | 3600 |
PORT |
Server port | 8080 |
DB_TYPE |
Database type (sqlite/postgresql) |
sqlite |
DB_PATH |
SQLite database path | ./data/database.sqlite |
POSTGRES_URL |
PostgreSQL connection string | - |
DEVICE_NAME |
Device display name | hostname-platform |
HTTPS_ENABLED |
Enable HTTPS | true |
CERT_PATH |
Certificate directory | ./certs |
DB_TYPE=sqlite
DB_PATH=./data/database.sqliteDB_TYPE=postgresql
POSTGRES_URL=postgresql://user:password@localhost:5432/fileshareAll API requests require an API key in the header:
curl -H "X-API-Key: your-api-key" [endpoint]curl -X POST http://localhost:8080/api/auth/api-key \
-H "Content-Type: application/json" \
-d '{
"deviceId": "optional-device-id",
"permissions": "read,write",
"expiresInHours": 24
}'curl -X POST \
-H "X-API-Key: your-api-key" \
-F "file=@example.txt" \
-F "deviceName=My Laptop" \
-F "expiresInMinutes=60" \
http://localhost:8080/api/filescurl -H "X-API-Key: your-api-key" \
http://localhost:8080/api/filescurl -H "X-API-Key: your-api-key" \
http://localhost:8080/api/files/FILE_ID \
-o downloaded_filecurl -X DELETE \
-H "X-API-Key: your-api-key" \
http://localhost:8080/api/files/FILE_IDcurl -H "X-API-Key: your-api-key" \
http://localhost:8080/api/devicescurl -X POST \
-H "X-API-Key: your-api-key" \
http://localhost:8080/api/devices/DEVICE_ID/trust- File Encryption: AES-256-GCM with unique keys per file
- Key Exchange: libsodium curve25519 for device-to-device communication
- Storage: All files encrypted at rest
- Transport: HTTPS with self-signed certificates
- First Use: Devices auto-register but require manual trust
- Fingerprints: SHA-256 fingerprints for device verification
- Trust Levels: Trusted devices can share files, untrusted cannot
- Key-based Authentication: SHA-256 hashed API keys
- Permission System: Read-only or read-write access
- Expiration: Optional time-based key expiration
- Rate Limiting: Built-in rate limiting per IP
nostromo/
βββ server/ # Node.js backend
β βββ lib/ # Core libraries
β β βββ database.js # Database abstraction
β β βββ encryption.js # Encryption service
β β βββ certificates.js # SSL certificate handling
β β βββ deviceManager.js # Device management
β βββ routes/ # API routes
β β βββ auth.js # Authentication
β β βββ files.js # File operations
β β βββ devices.js # Device management
β βββ index.js # Server entry point
βββ client/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ utils/ # Utilities and API client
β β βββ App.jsx # Main application
β βββ public/
βββ docker-compose.yml # Docker orchestration
βββ Dockerfile # Container definition
βββ README.md
- Add route in
server/routes/ - Update API client in
client/src/utils/api.js - Add corresponding React component if needed
- Extend
EncryptionServiceinserver/lib/encryption.js - Update file upload/download logic
- Ensure backward compatibility
# Start development environment
npm run dev
# Test file upload
curl -X POST -H "X-API-Key: test-key" -F "file=@test.txt" http://localhost:8080/api/files
# Test file download
curl -H "X-API-Key: test-key" http://localhost:8080/api/files/FILE_ID -o downloaded.txt- Generate secure encryption keys
- Configure HTTPS certificates
- Set up persistent storage volumes
- Configure database backups
- Review security settings
- Test cross-device functionality
# docker-compose.prod.yml
version: '3.8'
services:
app:
build: .
ports:
- "443:8080" # HTTPS only
environment:
- NODE_ENV=production
- HTTPS_ENABLED=true
volumes:
- ./uploads:/app/uploads
- ./certs:/app/certs
- ./data:/app/data# nginx.conf
server {
listen 443 ssl;
server_name your-domain.local;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}Self-signed certificates will show browser warnings. This is expected for local networks.
# Regenerate certificates
rm -rf certs/
# Restart application to auto-generate new certificates# SQLite permissions
chmod 644 data/database.sqlite
# PostgreSQL connection
psql -h localhost -p 5432 -U fileshare -d fileshare- Check disk space in upload directory
- Verify file size limits (default 500MB)
- Ensure encryption key is properly set
- Check network connectivity
- Verify mDNS/Bonjour support
- Manual device registration available as fallback
# Docker logs
docker-compose logs -f app
# Development logs
npm run dev # Shows server and client logsWe welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
git clone https://github.com/yourusername/nostromo.git
cd nostromo
npm run install:all
npm run devReport security vulnerabilities privately to the maintainers.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Node.js, React, and modern web technologies
- Encryption powered by libsodium and Node.js crypto
- UI components from Heroicons and Tailwind CSS
- Icons and badges from Shields.io