The backend API for SecuSend - a secure, self-destructing note sharing application. This Go-based REST API handles encrypted note storage, retrieval, and automatic cleanup with MongoDB as the database.
The backend powers the live application at: https://secusend.eu.org
- AES-256 Encryption: Notes are encrypted using AES-256-GCM with PBKDF2 key derivation
- Self-Destructing Notes: Automatic deletion after first read
- Time-Based Expiration: Configurable expiration times (1h, 1d, 1w, 1m, 1y)
- Rate Limiting: Built-in protection against abuse (3 requests/second per IP)
- Automatic Cleanup: Daily cron job removes expired notes
- Security Headers: Helmet middleware for enhanced security
- CORS Support: Cross-origin resource sharing enabled
- Request Compression: Gzip/Brotli compression for optimal performance
- Go 1.24.3 or higher
- MongoDB instance
- Git
-
Clone the repository:
git clone https://github.com/secusend/secusend-backend.git cd secusend-backend
-
Install dependencies:
go mod download
-
Set up environment variables in
.env
:MONGOURI=mongodb://...
-
Run the application:
go run main.go
The server will start on http://localhost:3000
For development with automatic reloading:
# Install Air
go install github.com/air-verse/air@latest
# Run with hot reload
air
docker build -t secusend-backend .
docker run -d \
--name secusend-backend \
-p 3000:3000 \
-e MONGOURI="your-mongodb-connection-string" \
secusend-backend
version: '3.8'
services:
secusend-backend:
build: .
ports:
- "3000:3000"
environment:
- MONGOURI=mongodb://mongo:27017
depends_on:
- mongo
mongo:
image: mongo:latest
ports:
- "27017:27017"
volumes:
- mongo_data:/data/db
volumes:
mongo_data:
- AES-256-GCM Encryption: Industry-standard encryption for password-protected notes
- PBKDF2 Key Derivation: Secure password-based key generation with 10,000 iterations
- Rate Limiting: 3 requests per second per IP address
- Input Validation: Size limits and sanitization
- Security Headers: Helmet middleware for XSS, CSRF protection
- Unique Key Generation: Cryptographically secure random keys
We 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 'feat: Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- SecuSend Frontend - Vue web interface
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.