This repository contains files for starting server for cloud buffer service.
Cloud buffer is a service for storing data and accessing it from different devices over different OS. There is no more need to use messengers or cloud disks to send a file or text from your laptop to phone and back.
OS Dependencies:
- Python3 interpreter v3.8+
- Redis server
- SQLDataBase (sqlite3 for default)
After installing OS dependencies run setup.sh
to install all python package dependencies using pip
and create
necessary directories for files to be stored in.
redis-server --port 6379
# run-db if non default is used
python3 manage.py runserver 8000
-
/account/login
GET
- returns web page for logging inPOST
- try to log the user in using given credentials -
/account/registet
GET
- returns registration web pagePOST
- try to register the user using given credentials -
/account/profile
GET
- returns web page with user profile
-
/file/load
GET
- return web page for loading filePOST
- sends the file to server, returns web page with link to file and QR-code for other users to get it -
/file/get
GET
- downloads file with corresponding token -
'/file/buffer'
GET
- returns data storing in cloud bufferdata in response content and file type in the
X-Data-Type
headerPOST
- sends data to cloud bufferdata should be in request content and type in the
X-Data-Type
header
For now there supports 2 types of data - text and files. The value of header should be text
for text data and file
for files. Files must contain a filename in requests, otherwise, the error code will be returned.
File storage theoretically supports both types of data, but there only API for files exists. Buffer supports both types of data.
There is a time limit for files to store in storage, so they expire after 2 hours
(can be changed in CloudBuffer/config.py::EXPIRE_TIME
)
Also, there is a limit on number of files per user that can be stored. Old files are deleted if more files uploads to
server. (CloudBuffer/config.py::MAX_FILES
)
Files are stored in user_files
directory, buffer data in user_files/_buffer
.