SecureShare is a secure file sharing API built with Go, designed for efficient and secure file management through a RESTful interface. It provides robust authentication, parallel processing for batch operations, and secure access controls.
- Secure Authentication: JWT-based authentication system with role-based access control
- Efficient File Operations:
- Upload and store files securely
- Generate presigned URLs for secure file sharing
- Parallel processing for batch operations
- Support for both one-time and time-limited access tokens
- Admin Management: Administrative controls for user and file management
- Containerized Deployment: Docker and docker-compose support for easy deployment
- Object Storage Integration: MinIO integration for scalable object storage
- Database: MongoDB for metadata storage and user management
SecureShare uses a modern, scalable architecture:
- Backend: Go with Fiber web framework
- Authentication: JWT tokens with role-based permissions
- Storage:
- MinIO for file object storage
- MongoDB for user data and file metadata
- Containerization: Docker and docker-compose for deployment
- Go 1.21+
- MongoDB
- MinIO
- Docker and docker-compose (for containerized deployment)
-
Clone the repository:
git clone https://github.com/arzan03/SecureShare.git cd SecureShare -
Install dependencies:
go mod download
-
Create and configure your environment variables:
cp .env.example .env # Edit .env with your configuration -
Start the server:
go run cmd/main.go
- With docker-compose:
docker-compose up -d
Configure the following environment variables in your .env file:
# API Configuration
JWT_SECRET=change_this_in_production
# MongoDB Configuration
MONGO_URI=mongodb://localhost:27017/secure_files
# MinIO Configuration
MINIO_ENDPOINT=localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
# Server Configuration
PORT=8080
POST /auth/register- Register a new userPOST /auth/login- Login and get JWT token
GET /admin/users- List all usersGET /admin/files- List all filesGET /admin/user/:userid- Get user by IDDELETE /admin/file/:file_id- Delete file (admin only)
POST /file/upload- Upload a filePOST /file/presigned/:id- Generate presigned URL for a filePOST /file/presigned- Generate presigned URLs for multiple filesGET /file/download/:id- Validate and download a fileGET /file/list- List user's filesGET /file/metadata/:id- Get file metadataDELETE /file/:id- Delete a filePOST /file/delete- Delete multiple files
Run the automated tests:
go test -v ./testsThe project includes comprehensive API tests that verify all endpoints and functionality.
- Secure Tokens: Cryptographically secure tokens for file access
- Time-Limited Access: Files can be shared with time-limited access controls
- One-Time Downloads: Support for one-time download links
- Parallel Operations: Secure batch operations with proper access controls
Contributions are welcome! Please feel free to submit a Pull Request.