Skip to content

Commit

Permalink
fix multiple issues from user exports config changes
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
hughrun authored and MaggieFero committed May 14, 2024
1 parent 091bbe3 commit 57c7a31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
9 changes: 3 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ TWO_FACTOR_LOGIN_MAX_SECONDS=60
# Value should be a comma-separated list of host names.
CSP_ADDITIONAL_HOSTS=

# Time before being logged out (in seconds)
# SESSION_COOKIE_AGE=2592000 # current default: 30 days

# Maximum allowed memory for file uploads (increase if users are having trouble
# uploading BookWyrm export files).
# DATA_UPLOAD_MAX_MEMORY_MiB=100
# Increase if users are having trouble uploading BookWyrm export files.
# Default value is 2.5MB, this value is 100MB
DATA_UPLOAD_MAX_MEMORY_SIZE=104857600
4 changes: 1 addition & 3 deletions bookwyrm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,4 @@
# user with the same username - in which case you should change it!
INSTANCE_ACTOR_USERNAME = "bookwyrm.instance.actor"

# We only allow specifying DATA_UPLOAD_MAX_MEMORY_SIZE in MiB from .env
# (note the difference in variable names).
DATA_UPLOAD_MAX_MEMORY_SIZE = env.int("DATA_UPLOAD_MAX_MEMORY_MiB", 100) << 20
DATA_UPLOAD_MAX_MEMORY_SIZE = env.int("DATA_UPLOAD_MAX_MEMORY_SIZE", 104857600)
8 changes: 4 additions & 4 deletions bookwyrm/templates/preferences/export-user.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ <h2 class="is-size-5">{% trans "Your file will not include:" %}</h2>
<p class="notification is-danger">
{% trans "New user exports are currently disabled." %}
{% if perms.bookwyrm.edit_instance_settings %}
<br/>
{% url 'settings-imports' as url %}
{% blocktrans trimmed %}
User exports settings can be changed from <a href="{{ url }}">the Imports page</a> in the Admin dashboard.
{% spaceless %}
{% blocktrans%}
<br/>User exports settings can be changed from <a href="/settings/imports">the Imports page</a> in the Admin dashboard.
{% endblocktrans %}
{% endspaceless %}
{% endif%}
</p>
{% elif next_available %}
Expand Down

0 comments on commit 57c7a31

Please sign in to comment.