• Threads
  • Categories
  • Users
  • GitHub
  • Documentation
  • Discord
  • forum
  • group
  • search
  • chevron_right Threads
  • label Dev Development

Using "Amazon S3 Bucket" for attachments

anujmca
July 30, 2020
chat_bubble_outline 3
  • link
    anujmca
    Members 2 posts
    July 30, 2020, 3:29 a.m. July 30, 2020, 3:29 a.m.
    link

    Hi Friends,

    I am trying to use "Amazon S3 Bucket" for storing the attachments uploaded in any post or reply.

    Misago is currently placing all the attachments inside /media/attachments/{{postId}}/{{hash code}}. We want to avoid this getting uploaded on our web server, and S3 buckets are a cheaper alternative.

    Could you please help us guiding with this?

    Regards,
    Anuj

    anujmca likes this.

    favorite 1

  • arrow_forward

    Thread has been moved from Feedback, Ideas and Suggestions.

    • By rafalp on July 30, 2020, 10:59 p.m..
  • link
    rafalp
    Project Lead 1534 posts
    July 30, 2020, 11:29 p.m. July 30, 2020, 11:29 p.m.
    link

    Hi!

    This is actually possible to do.

    First, create file named requirements-plugins.txt in the same directory that contains requirements.txt (it should be misago). Inside this file put this line:

    django-storages
    

    Next, create settings_override.py file in same directory that contains settings.py (it should be misago/misagodocker). Fill its contents like this:

    DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
    
    AWS_ACCESS_KEY_ID = "YOUR AWS ACCESS KEY ID HERE"
    AWS_SECRET_ACCESS_KEY = "YOUR AWS SECRET ACCESS KEY HERE"
    AWS_STORAGE_BUCKET_NAME = "YOUR BUCKET NAME"
    AWS_S3_REGION_NAME = "YOUR REGION NAME"
    

    Remember to fill in valid values to AWS_ settings!

    Then, run ./appctl rebuild to rebuild your Misago site. After rebuild is complete, Misago should use S3 for uploads storage.

    hrod and orkan like this.

    favorite 2

  • link
    reza
    Members 7 posts
    Oct. 25, 2022, 12:53 p.m. Oct. 25, 2022, 12:53 p.m.
    link

    Does it support large files to be uploaded as parts(s3)?

  • link
    rafalp
    Project Lead 1534 posts
    Oct. 25, 2022, 1:05 p.m. Oct. 25, 2022, 1:05 p.m.
    link

    No. It was never optimized for that. In v4 you will be able to solve this by implementing custom plugin, but I don't plan for having that in core.

There are no more posts in this thread.

  • This site uses cookies to gather statistical data for use in traffic analysis. Header photo by Joanna Malinowska.
  • GitHub
  • Documentation
  • Discord
  • Terms of service
  • Privacy policy
powered by misago