Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Increasing the file size for image attachments #14

Open
f2k1de opened this issue May 10, 2020 · 3 comments
Open

Increasing the file size for image attachments #14

f2k1de opened this issue May 10, 2020 · 3 comments

Comments

@f2k1de
Copy link
Member

f2k1de commented May 10, 2020

edit line 77 and 78 of media_attachment.rb:

@e1mo e1mo self-assigned this May 10, 2020
@e1mo
Copy link
Member

e1mo commented May 10, 2020

I'm unable to find anyhting related to this in app/models/media_attachment.rb. But in Line 133 and 134 there is:

IMAGE_LIMIT = 10.megabytes
VIDEO_LIMIT = 40.megabytes

I think we could work with that?

https://github.com/tootsuite/mastodon/blob/85f0e0a606905ecda1322a0f7b65d8b4ff91dd69/app/models/media_attachment.rb#L133.L134

@f2k1de
Copy link
Member Author

f2k1de commented May 10, 2020

ja genau das wird es sein. dann ist das nur seit dem was ich da gefunden habe mittlerweile im quellcode verrutscht.

@e1mo e1mo removed their assignment May 10, 2020
@n0emis
Copy link
Contributor

n0emis commented May 10, 2020

Ich hab da bei meiner letzten Patching-Session schonmal dran rum gepatcht, leider hat das zu Instabiliäten/Abstürzen von sidekiq gefuehrt. Vllt. waere da ein genauer Test um gute Maximalwerte auszuloten notwendig. Anyway, hier der Code:

- name: patch image filesize limit
  lineinfile:
    path: "{{ mastodon_path }}/app/models/media_attachment.rb"
    regexp: IMAGE_LIMIT =
    line: "  IMAGE_LIMIT = (ENV['MAX_IMG_SIZE'] || 10).to_i.megabytes"

- name: patch video filesize limit
  lineinfile:
    path: "{{ mastodon_path }}/app/models/media_attachment.rb"
    regexp: VIDEO_LIMIT =
    line: "  VIDEO_LIMIT = (ENV['MAX_VID_SIZE'] || 40).to_i.megabytes"

- name: patch video resolution limit
  lineinfile:
    path: "{{ mastodon_path }}/app/models/media_attachment.rb"
    regexp: MAX_VIDEO_MATRIX_LIMIT =
    line: "  MAX_VIDEO_MATRIX_LIMIT = (ENV['MAX_VID_RESOLUTION'] || 2_304_000).to_i.megabytes"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants