Self Hostable Managed File Transfer app
LunaTransfer can be configured by editing the config file before startup. The following settings can be customized:
- Port number
- Storage path
- Log directory
- JWT secret and expiration time
- Rate limiting settings
curl -X POST http://localhost:8080/setup \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"password": "AdminPassword123!",
"email": "[email protected]"
}'
curl -X POST http://localhost:8080/signup \
-H "Content-Type: application/json" \
-d '{"username":"test1","password":"Test1Password123","email":"[email protected]","role":"user"}'
curl -X POST http://localhost:8080/login \
-H "Content-Type: application/json" \
-d '{"username":"test1","password":"Test1Password123"}'
curl -X POST http://localhost:8080/logout \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
curl -X POST http://localhost:8080/api/refresh \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
curl -X POST http://localhost:8080/api/upload \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-F "file=@/path/to/your/file.txt" \
-F "path=photos/vacation2023"
curl -X GET "http://localhost:8080/api/files?path=photos/vacation2023" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
curl -X GET "http://localhost:8080/api/search?term=project" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Search in specific directory
curl -X GET "http://localhost:8080/api/search?term=report&path=documents" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Search by file type (extension)
curl -X GET "http://localhost:8080/api/search?term=data&type=csv" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Search by file size (in bytes)
curl -X GET "http://localhost:8080/api/search?term=video&minSize=1000000&maxSize=5000000" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Search by date modified
curl -X GET "http://localhost:8080/api/search?term=report&after=2005-08-08&before=2005-08-08" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Combining multiple filters
curl -X GET "http://localhost:8080/api/search?term=presentation&path=work&type=pptx&minSize=500000" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
curl -X GET http://localhost:8080/api/download/file.txt \
-H "Authorization: Bearer YOUR_JWT_KEY" \
--output downloaded_file.txt
curl -X DELETE http://localhost:8080/api/delete/file.txt \
-H "Authorization: Bearer YOUR_JWT_KEY"
curl -X POST http://localhost:8080/api/directory \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"path":"photos", "name":"vacation2023"}'
curl -X GET http://localhost:8080/api/admin/users \
-H "Authorization: Bearer ADMIN_JWT_TOKEN"
curl -X DELETE http://localhost:8080/api/admin/users/username \
-H "Authorization: Bearer ADMIN_JWT_TOKEN"
curl -X GET http://localhost:8080/api/admin/system/stats \
-H "Authorization: Bearer ADMIN_JWT_TOKEN"
curl -X POST http://localhost:8080/api/admin/groups \
-H "Authorization: Bearer ADMIN_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing Team",
"description": "Group for marketing department files"
}'
curl -X GET http://localhost:8080/api/admin/groups \
-H "Authorization: Bearer ADMIN_JWT_TOKEN"
curl -X POST "http://localhost:8080/api/admin/groups/YOUR_GROUP_ID/members" \
-H "Authorization: Bearer ADMIN_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "user1",
"role": "member"
}'
curl -X DELETE "http://localhost:8080/api/admin/groups/YOUR_GROUP_ID/members/username" \
-H "Authorization: Bearer ADMIN_JWT_TOKEN"
curl -X GET "http://localhost:8080/api/admin/groups/YOUR_GROUP_ID/members" \
-H "Authorization: Bearer ADMIN_JWT_TOKEN"
curl -X POST http://localhost:8080/api/upload/group \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-F "file=@/path/to/your/file.txt" \
-F "groupId=YOUR_GROUP_ID" \
-F "path=reports/monthly"
curl -X GET http://localhost:8080/api/download/groups/YOUR_GROUP_ID/path/to/file.txt \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
--output downloaded_file.txt
curl -X GET "http://localhost:8080/api/files?path=groups/YOUR_GROUP_ID/reports" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
curl -X POST "http://localhost:8080/api/admin/groups/YOUR_GROUP_ID/members" \
-H "Authorization: Bearer ADMIN_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"username": "user1",
"role": "contributor"
}'
LunaTransfer supports three levels of group roles:
- admin: Can manage group members and has full access to all group files
- contributor: Can upload, modify, and download files but cannot manage members
- reader: Can only view and download files
curl -X POST http://localhost:8080/api/share \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"file_path": "path/to/file.txt",
"source_group": "SOURCE_GROUP_ID",
"target_group": "TARGET_GROUP_ID",
"permission": "read"
}'
curl -X GET "http://localhost:8080/api/shared?groupId=YOUR_GROUP_ID" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
curl -X DELETE http://localhost:8080/api/share/SHARE_ID \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
curl -X GET http://localhost:8080/api/dashboard \
-H "Authorization: Bearer YOUR_JWT_KEY"
# Using a WebSocket client like wscat
wscat -c "ws://localhost:8080/ws" -H "Authorization: Bearer YOUR_JWT_KEY"
- CONNECTED: Sent when a WebSocket connection is established
- FILE_UPLOADED: Sent when a new file is uploaded
- FILE_DELETED: Sent when a file is deleted
- SHARE_CREATED: Sent when a file is shared with a group
- SHARE_REMOVED: Sent when a file share is removed