Commit graph

22 commits

Author SHA1 Message Date
Hugh Rundle dd27684d4b
set signed s3 url expiry with env value
Adds S3_SIGNED_URL_EXPIRY val to .env and settings (defaults to 15 mins)
Note that this is reset every time the user loads the exports page
and is independent of the _creation_ of export files.
2024-03-24 20:53:49 +11:00
Hugh Rundle 2c231acebe
linting and tests 2024-01-28 20:35:47 +11:00
Hugh Rundle 2bb9a85591
various fixes
- use signed url for s3 downloads
- re-arrange tar.gz file to match original
- delete all working files after tarring
- import from s3 export

TODO

- check local export and import
- fix error when avatar missing
- deal with multiple s3 storage options (e.g. Azure)
2024-01-28 15:07:55 +11:00
Hugh Rundle 469172947b
cleanup and linting 2024-01-18 18:43:45 +11:00
Carlos Camara 854eb36618 Export bookshelves and review date 2024-01-13 16:47:51 +00:00
Carlos Camara ce18d343e8 Fix pylint error and code format 2024-01-06 09:55:39 +01:00
Carlos Camara c2622a510c Change else statement to None vs "" 2024-01-04 11:40:40 +01:00
Carlos Camara 30c9ec9611 Prevent lint error
See @hughrun 's explanation https://github.com/bookwyrm-social/bookwyrm/pull/3189#issuecomment-1876145423
2024-01-04 11:28:17 +01:00
Carlos Camara 51cb70d344 Change readhtrough order 2024-01-04 11:27:17 +01:00
Carlos Camara 9acb5f66fe Convert DateTime to date 2024-01-04 11:26:44 +01:00
Carlos Camara 766a2163dd Code formatting 2024-01-03 20:41:31 +01:00
Carlos Camara db8c686dd3 Include book Readtrhough in the csv export 2024-01-03 15:43:15 +01:00
Hugh Rundle 07ef12ce8e
fix tests and linting 2023-10-22 17:26:27 +11:00
Hugh Rundle fd1ebf5f71
formatting and pylint fixes 2023-10-22 16:52:29 +11:00
Hugh Rundle b34a491172
run black 2023-10-22 15:34:25 +11:00
Hugh Rundle a27c652501
admin view for user imports
- makes user_import_time_limit a site setting rather than a value in settings.py (note this applies to exports as well as imports)
- admins can change user_import_time_limit from UI
- admins can cancel stuck user imports
- disabling new imports also disables user imports
2023-10-22 15:07:49 +11:00
Hugh Rundle 836127f369
cooldown period for user exports
add USER_EXPORT_COOLDOWN_HOURS setting for controlling user exports and imports
2023-10-22 10:49:13 +11:00
CSDUMMI 688978369f Implement self-contained archives to import and export entire users between instances (#38)
Co-authored-by: Daniel Burgess <developerdannymate@gmail.com>
Co-authored-by: Hugh Rundle <hugh@hughrundle.net>
Co-authored-by: dannymate <dannymate@noreply.codeberg.org>
Co-authored-by: hughrun <hughrun@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/GuildAlpha/bookwyrm/pulls/38
Co-authored-by: CSDUMMI <csdummi.misquality@simplelogin.co>
Co-committed-by: CSDUMMI <csdummi.misquality@simplelogin.co>
2023-09-07 22:37:28 +02:00
Wesley Aptekar-Cassels 60fee54da9 Optimize CSV export query
Splitting this into five separate queries avoids the large join that
prevents us from using indexes, and requires materializing to disk.

Fixes: #2157 (hopefully)
2023-03-13 15:45:21 -04:00
Wesley Aptekar-Cassels 50a81bdfdd Change CSV export to buffer instead of streaming
The idea behind a streaming CSV export was to reduce the amount of
memory used, by avoiding building the entire CSV file in memory before
sending it to the client. However, it didn't work out this way in
practice: the query objects that were created to represent each line
caused Postgres to generate a very large (~200MB on bookwyrm.social)
temp file, not to mention the memory being used by the Query object
likely being similar to, if not larger than that used by the finalized
CSV row.

While we should in the long term run our CSV exports as a Celery task,
this change should allow CSV exports to work on large servers without
causing disk-space problems.

Fixes: #2157
2023-03-08 21:37:56 -05:00
Mouse Reeve 42e29e40b3 Use HTTP post for csv export
Also fixes a missing translation string
2022-07-11 07:51:51 -07:00
Mouse Reeve 701a644c31
Export user book data as csv (#1556)
Simple book data export
2022-03-26 13:04:59 -07:00