summaryrefslogtreecommitdiff
path: root/fhost.py
AgeCommit message (Collapse)Author
2022-12-17Fix NSFW detectionMia Herkt
2022-12-13Prevent unreasonably long MIME typesMia Herkt
2022-12-13File: Fix 404 case with secret URLsMia Herkt
2022-12-13Record file sizes in dbMia Herkt
Moderation interface is going to use this.
2022-12-13File: Add is_nsfw propertyMia Herkt
2022-12-12Add support for ClamAVMia Herkt
2022-12-01Add support for “secret” file URLsMia Herkt
Closes #47
2022-12-01Fix 500 on invalid pathsMia Herkt
2022-12-01Fix handling double file name extensionsMia Herkt
Long names would get truncated at the end, causing problems including unresolvable file URLs. Example with default settings: .package.lst → .package. Fixes #61
2022-11-30Add X-Expires to file response headersMia Herkt
Tells clients when files will expire, in milliseconds since Unix epoch. Closes #50.
2022-11-30Allow changing expiration dateMia Herkt
2022-11-30Allow management operations like deleting filesMia Herkt
This introduces the X-Token header field in the response of newly uploaded files as a simple way for users to manage their own files. It does not need to be particularly secure.
2022-11-29Add support for expiring filesEmi Simpson
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 Squashed commits: Add a note explaining that expired files aren't immediately removed Show correct times on the index page graph Improve the migration script, removing the need for --legacy Use automap in place of an explicit file map in migration Remove vestigial `touch()` Don't crash when upgrading a fresh database Remove vestigial warning about legacy files More efficiently filter to unexpired files when migrating https://git.0x0.st/mia/0x0/pulls/72#issuecomment-224 Coalesce updates to the database during migration https://git.0x0.st/mia/0x0/pulls/72#issuecomment-226 Remove vestigial database model https://git.0x0.st/mia/0x0/pulls/72#issuecomment-261 prune: Stream expired files from the database (as opposed to collecting them all first) config.example.py: Add min & max expiration + description
2022-08-11Fix non-seekable file handlesMia Herkt
Closes #59
2022-08-01Open upload blacklist in text modeMia Herkt
This wasn’t working since Flask opens files in bin mode by default.
2022-01-01Fix mime splittingAlexey Sakovets
mime[:mime.find(";")] will remove last character if mime does not contain ";". Use mime.split(";") instead.
2021-12-01remove short_url and add in-tree URLencoder (#53)mia
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: https://git.0x0.st/mia/0x0/pulls/53 Co-authored-by: mia <mia@0x0.st> Co-committed-by: mia <mia@0x0.st>
2021-05-23Support instance templatesMia Herkt
2021-05-23Support client-defined names in file URL routingMia Herkt
This allows requests like /j4Tf.bin/myfilename.dat to be served without having to rewrite URLs at the frontend server.
2021-05-23Move storage to classes, support double suffixesMia Herkt
2021-05-23Use pathlibMia Herkt
2021-05-23Drop Flask-ManagerMia Herkt
2021-05-23Drop dump_urls endpointMia Herkt
who cares lol (originally added for issue #1 but they never archived 0x0)
2021-05-23Use template responsesMia Herkt
2021-05-23Support instance configMia Herkt
2020-11-03Add text/plain exception for .log name extensionMia Herkt
Fixes #29
2020-11-03Change license to EUPLMia Herkt
2018-12-22Disable NSFW detection by defaultMartin Herkt
See #11
2018-01-09add extension override for audio/flacMartin Herkt
2017-12-22Add extension override for text/x-diffMartin Herkt
2017-11-08Add command to delete all files uploaded by addressMartin Herkt
2017-11-08Fix indent error in queryblMartin Herkt
2017-10-30store_url: only accept identity content encodingMartin Herkt
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-27Tweak NSFW thresholdMartin Herkt
Of course it’ll have a few false positives, but this seems to work well with the 0x0.st dataset.
2017-10-27Faster query commands, add removed query filterMartin Herkt
2017-10-27Add NSFW filter to address query commandsMartin Herkt
2017-10-27Add NSFW detectionMartin Herkt
2017-10-27Add querybl command to query uploads by addresses in blacklistMartin Herkt
2017-03-27Fix try/except syntaxMartin Herkt
2017-02-03Add support for upload IP blacklistsMartin Herkt
The format is one address per line, with # used for comments.
2017-01-01add more URL validationMartin Herkt
Turns out ShareX users and shell script authors are fucking retarded.
2017-01-01add BEACON dump with start index for urlte.amMartin Herkt
fixes #1
2017-01-01do not shorten our host URLsMartin Herkt
Turns out ShareX users are fucking retarded.
2017-01-01use function to format host URLMartin Herkt
2016-11-23fix text/ MIME charset workaround for realMartin Herkt
2016-11-01fix text/ MIME charset workaroundMartin Herkt
2016-11-01initMartin Herkt