Made for managing files in Storage Services, currently only supporting AWS S3. This project was made for the hideyoshi.com project, but all code in this repo is distributed freely by the GPLv3 License.
This project implements endpoints for manipulation of files in Storage Services and implements a worker for treatment of files and virus checking.
To run this project, you will need to add the following environment variables to your .env file
-
Server Configuration:
ALLOWED_ORIGINS
: Url of the allowed origins;SERVER_HOST
: FastAPI server ipSERVER_PORT
: FastAPI server port -
Redis Configuration:
REDIS_HOST
: Redis HostREDIS_PORT
: Redis PortREDIS_PASSWORD
: Redis Password -
Storage Service Configuration:
STORAGE_TYPE
: Currently only supportss3
-
S3 Configuration:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION_NAME
AWS_BUCKET_NAME
EXPIRES_IN
-
-
Virus Checker Configuration:
VIRUS_CHECKER_TYPE
: Currently only supportstotal_virus
VIRUS_CHECKER_API_KEY
All dependencies can be installed via poetry:
poetry install --no-dev
For the execution of REST Server:
poetry run ./run-queue.sh
For the execution of the Queue Worker:
poetry run ./run-queue.sh --queue
GET /file
Parameter | Type | Description |
---|---|---|
username |
string |
Required. Username of file owner |
file_postfix |
string |
Required. Type of desired file |
Returns:
{
"presigned_url": string
}
POST /file
Parameter | Type | Description |
---|---|---|
username |
string |
Required. Username of file owner |
file_postfix |
string |
Required. Type of desired file |
file_type |
string |
Required. File format |
Returns:
{
"presigned_url": string,
"file_key": string
}
DELETE /file
Parameter | Type | Description |
---|---|---|
username |
string |
Required. Username of file owner |
file_postfix |
string |
Required. Type of desired file |
POST /file/process
Parameter | Type | Description |
---|---|---|
username |
string |
Required. Username of file owner |
file_postfix |
string |
Required. Type of desired file |