Commit Graph

59 Commits

Author SHA1 Message Date
Emi Simpson 7bb18b17dc
config.example.py: Add min & max expiration + description 2022-11-28 17:09:18 -05:00
Emi Simpson b6833b6e51
Merge remote-tracking branch 'mia/master' into expiration 2022-11-28 17:05:40 -05:00
Emi Simpson 11cfd07d71
prune: Stream expired files from the database
(as opposed to collecting them all first)
2022-11-28 16:49:09 -05:00
Emi Simpson 60db7938c8
Remove vestigial database model
mia/0x0#72 (comment)
2022-11-28 16:43:34 -05:00
Mia Herkt 00dba0e189
config.example.py: Clarify MIME ext mapping 2022-11-28 22:30:53 +01:00
Ember Hearth be796b9b5b
Add example configuration file
See #73.
2022-11-28 22:30:43 +01:00
Emi Simpson 55ee3740b0
Coalesce updates to the database during migration
mia/0x0#72 (comment)
2022-11-28 16:28:22 -05:00
Emi Simpson 19d989b696
More efficiently filter to unexpired files when migrating
mia/0x0#72 (comment)
2022-11-28 16:24:39 -05:00
Emi Simpson 74b6f986ee
Remove vestigial warning about legacy files 2022-11-28 16:21:03 -05:00
Emi Simpson 64ddfdb702
Don't crash when upgrading a fresh database 2022-11-28 16:20:43 -05:00
Emi Simpson 39d24e56c3
Remove vestigial `touch()` 2022-11-28 16:18:16 -05:00
Emi Simpson d14713d077
Use automap in place of an explicit file map in migration 2022-11-28 16:14:31 -05:00
Ember Hearth f507de8256 Improve the migration script, removing the need for --legacy 2022-11-26 21:24:00 -05:00
Emi Simpson bed8c1d047
Show correct times on the index page graph 2022-11-22 17:16:38 -05:00
Emi Simpson 78b8a73ea5
Add a note explaining that expired files aren't immediately removed 2022-11-22 16:51:54 -05:00
Emi Simpson 6d036eeb7d
Add support for expiring files
SUPPLEMENTALLY:
- Add an `expiration` field to the `file` table of the database
- Produce a migration for the above change
- Overhaul the cleanup script, and integrate into fhost.py
  (now run using FLASK_APP=fhost flask prune)
- Replace the old cleanup script with a deprecation notice
- Add information about how to expire files to the index
- Update the README with information about the new script
2022-11-22 16:15:50 -05:00
Mia Herkt b5f0cfdf6f
README: Clarify why serving file requests from the app is bad 2022-11-20 16:54:46 +01:00
Mia Herkt 4ba18146e1
README: Clarify how to change configuration 2022-11-20 13:05:17 +01:00
Mia Herkt afb5811879
README: Warn users about URL fetch network security implications 2022-08-19 22:27:29 +02:00
Mia Herkt c7a728ce84
Fix non-seekable file handles
Closes #59
2022-08-11 05:49:46 +02:00
Mia Herkt 5216e9ebaf
Open upload blacklist in text mode
This wasn’t working since Flask opens files in bin mode by default.
2022-08-01 18:26:35 +02:00
Alexey Sakovets 0db6e4b895 Fix mime splitting
mime[:mime.find(";")]   will remove last character if mime does not contain ";".
Use mime.split(";") instead.
2022-01-01 23:46:41 +03:00
mia 9c4a0fd5a6 remove short_url and add in-tree URLencoder (#53)
This PR removes the short_url dependency as per issue #41.
This implementation is pretty much the same as in short_url except I've rewritten the enbase() function to be iterative instead of recursive.
The only functions of the class are enbase() and debase() since those were the only functions being used by fhost.

Co-authored-by: 7415963987456321 <hrs70@hi.is>
Reviewed-on: mia/0x0#53
Co-authored-by: mia <mia@0x0.st>
Co-committed-by: mia <mia@0x0.st>
2021-12-01 13:25:33 +01:00
Nikolas Nyby b8def71a94 Fix some flake8 errors in cleanup and nsfw_detect
Just some minor code cleanup
2021-08-06 15:19:08 -04:00
Mia Herkt 47ff3a1152
Support instance templates 2021-05-23 19:13:51 +02:00
Mia Herkt b65209db7b
Add tests 2021-05-23 19:13:51 +02:00
Mia Herkt 3bdbab96c1
Support client-defined names in file URL routing
This allows requests like /j4Tf.bin/myfilename.dat to be served without
having to rewrite URLs at the frontend server.
2021-05-23 19:13:51 +02:00
Mia Herkt 73045dc5e5
Move storage to classes, support double suffixes 2021-05-23 19:13:51 +02:00
Mia Herkt cd083a7f83
Use pathlib 2021-05-23 19:13:51 +02:00
Mia Herkt b5ce94edeb
Update README 2021-05-23 19:13:51 +02:00
Mia Herkt b7c12902da
Update requirements.txt 2021-05-23 19:13:51 +02:00
Mia Herkt 493119fc68
Drop Flask-Manager 2021-05-23 19:13:51 +02:00
Mia Herkt 59a0439c1a
Drop dump_urls endpoint
who cares lol
(originally added for issue #1 but they never archived 0x0)
2021-05-23 19:13:51 +02:00
Mia Herkt d815d6855f
Use template responses 2021-05-23 19:13:51 +02:00
Mia Herkt 5db62c2dbf
Support instance config 2021-05-23 19:13:51 +02:00
Mia Herkt a4da58f3f3
Add mailmap 2021-05-23 19:13:51 +02:00
Mia Herkt a52127f0c3
Add text/plain exception for .log name extension
Fixes #29
2020-11-03 04:02:13 +01:00
Mia Herkt a4d496d42d
Change license to EUPL 2020-11-03 04:01:30 +01:00
Martin Herkt f66418ad4d
Update requirements.txt 2019-04-30 19:06:25 +02:00
Martin Herkt cfee463780
Disable NSFW detection by default
See #11
2018-12-22 19:50:32 +01:00
Martin Herkt b1c79e582b
add extension override for audio/flac 2018-01-09 08:26:11 +01:00
Martin Herkt 4b8c9eb758
Add extension override for text/x-diff 2017-12-22 21:41:51 +01:00
Martin Herkt 0b288d9a94
Add command to delete all files uploaded by address 2017-11-08 11:29:02 +01:00
Martin Herkt 5608c72e03
Fix indent error in querybl 2017-11-08 11:20:46 +01:00
Martin Herkt b2d830e2aa
store_url: only accept identity content encoding
Some servers (like IPFS gateways) will use chunked transfer encoding on
anything but identity content encoding. Also, probably fix a potential
zip bomb vulnerability.
2017-10-30 05:36:03 +01:00
Martin Herkt 04b46bd01a
Tweak NSFW threshold
Of course it’ll have a few false positives, but this seems to work well
with the 0x0.st dataset.
2017-10-27 09:38:19 +02:00
Martin Herkt c3c29ab500
Faster query commands, add removed query filter 2017-10-27 08:53:19 +02:00
Martin Herkt ebfbc6b153
Add NSFW filter to address query commands 2017-10-27 08:36:36 +02:00
Martin Herkt 7bbeb2d144
Add NSFW detection 2017-10-27 05:28:45 +02:00
Martin Herkt def5d9802f Add querybl command to query uploads by addresses in blacklist 2017-10-27 02:21:33 +02:00