Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DATA_UPLOAD_MAX_SIZE_MiB in .env #3251

Closed
wants to merge 5 commits into from

Conversation

dato
Copy link
Contributor

@dato dato commented Jan 24, 2024

Since arithmetic is not allowed in .env files, a change in unit for the variable seems most usable.


I missed #3226 during review, but while I was editing .env.example for another PR, I noticed the (1024**2 * 100) syntax, which I don't think would be allowed in the actual .envfile and hence could lead to confusion?

In cases like this, I think it's best to overshadow Django's own setting with a Bookwyrm-specific variable name, in another unit (MB in this case). Thoughts?

NOTE: I mark this PR as draft because, as implemented, it's not strictly backwards compatible (if, following .env.example, an admin set DATA_UPLOAD_MAX_MEMORY_SIZE in the environment for 0.7.2, this would no longer be honored). I do believe this will merit a mention in the release notes, but I don't think it would make sense to allow two variables in different units, from .env.

- improve nginx config
- fix DATA_UPLOAD_MAX_MEMORY_SIZE default not being an int
- translate fallback value in id_to_username template tag
- make location of setting to turn on user exports easier to locate for admins

fixes bookwyrm-social#3227
fixes bookwyrm-social#3231
fixes bookwyrm-social#3232
fixes bookwyrm-social#3236
# Maximum allowed memory for file uploads (increase if users are having trouble
# uploading BookWyrm export files).
# DATA_UPLOAD_MAX_MEMORY_MiB=100
Copy link
Contributor Author

@dato dato Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Preferring to leave this commented out so that settings.py can change the default value and have it affect default installs.)

@mouse-reeve
Copy link
Member

I think this is going to be in conflict with #3238?

mouse-reeve and others added 2 commits February 3, 2024 07:04
Since arithmetic is not allowed in .env files, a change in unit for
the variable seems most usable.
@dato
Copy link
Contributor Author

dato commented Feb 4, 2024

Good catch, thank you! I've rebased it on top of #3238 now (the full diff shows now, until that one is merged).

I've also opened hughrun#4 in case @hughrun likes it and prefers to merge it there directly. (Too bad Github doesn't allow chained PRs when forks are involved.)

@dato dato marked this pull request as ready for review February 4, 2024 18:38
@hughrun
Copy link
Contributor

hughrun commented Feb 5, 2024

Thanks I'll take a look soon. We're likely to have a few PR conflicts because I left a bit of a mess earlier and lots of people noticed 🙃. I'll see if there's a way to pull it all in to one PR.

@hughrun
Copy link
Contributor

hughrun commented Feb 6, 2024

I've merged this into #3238.

That will be ready for review again once I sort out some issues with the Reverse-Proxy nginx settings.

@dato
Copy link
Contributor Author

dato commented Feb 6, 2024

Great! Closing this one then.

@dato dato closed this Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants