Skip to content

HideyoshiSolutions/storage-hideyoshi.com

Repository files navigation

storage-hideyoshi.com

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.

Environment Variables

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 ip

    SERVER_PORT: FastAPI server port

  • Redis Configuration:

    REDIS_HOST: Redis Host

    REDIS_PORT: Redis Port

    REDIS_PASSWORD: Redis Password

  • Storage Service Configuration:

    STORAGE_TYPE: Currently only supports s3

    • 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 supports total_virus

    VIRUS_CHECKER_API_KEY

Usage

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

API Reference

Get file read link

  GET /file
Parameter Type Description
username string Required. Username of file owner
file_postfix string Required. Type of desired file

Returns:

{
    "presigned_url": string
}

Get file write link

  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

  DELETE /file
Parameter Type Description
username string Required. Username of file owner
file_postfix string Required. Type of desired file

Process file

  POST /file/process
Parameter Type Description
username string Required. Username of file owner
file_postfix string Required. Type of desired file

Authors

About

Storage Service MicroService for the Hideyoshi.com Portfolio

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages