Defdrive is a project that allows users to create multiple expiry keys based on time and has features like one-time use of the link, specific data traffic allowed, subnet restriction, public IP restriction, and TTL (Time to Live).
- User authentication with JWT
- Create and manage expiry keys
- One-time use links
- Data traffic control
- Subnet restriction
- Public IP restriction
- TTL (Time to Live)
- Public access links for files
- Clone the repository.
- Create a
.envfile in the root directory. Take.env.examplefor reference. - Ensure a PostgreSQL database is running on the specified port and set all necessary environment variables in the
.envfile. - Run
go mod tidyto install dependencies. - Run
go run main.goto start the server.
- Clone the repository.
- Create a
.envfile in the root directory. Take.env.examplefor reference. - Run
docker-compose up --buildto start the services.
POST /api/signup: Register a new user.POST /api/login: Authenticate a user and return a JWT token.POST /api/upload: Upload a file.GET /api/files: Retrieve all files for the authenticated user.PUT /api/files/:fileID/access: Update the public access status of a file.DELETE /api/files/:fileID: Delete a file.POST /api/files/:fileID/accesses: Create a new access record for a file.GET /api/files/:fileID/accesses: Retrieve all access records for a file.GET /api/accesses/:accessID: Retrieve details of a specific access record.PUT /api/accesses/:accessID/access: Update an access record.DELETE /api/accesses/:accessID: Delete an access record.GET /link/:hash: Access a file using a public link.
