Commit Graph

89 Commits

Author SHA1 Message Date
Tim 74602fd9ff Update '.gitea/workflows/build.yml'
ci / build (push) Successful in 4m51s Details
multiple platforms please!
2023-05-19 05:09:11 +00:00
Tim f235a21da7 feat: docker build changes
ci / build (push) Successful in 1m14s Details
2023-05-19 15:05:31 +10:00
Tim f83f4155f5 Update '.gitea/workflows/build.yml'
ci / build (push) Failing after 1m2s Details
2023-05-19 05:00:27 +00:00
Tim 075514ab7c Add '.gitea/workflows/build.yml'
ci / build (push) Failing after 1m11s Details
2023-05-19 14:44:16 +10:00
Slowpoke The Bot ad56618c40 chore(deps): update python docker tag to v3.11 (#2)
This PR contains the following updates:

| Package | Type | Update | Change |
| python | final | minor | `3.8-slim-buster` -> `3.11-slim-buster` |


### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.


 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box


This PR has been generated by [Renovate Bot](

Co-authored-by: Slowpoke Bot <>
Reviewed-on: #2
Co-authored-by: Slowpoke The Bot <>
Co-committed-by: Slowpoke The Bot <>
2023-05-19 14:40:41 +10:00
Slowpoke The Bot 23918d3a7a Configure Renovate (#1)
Welcome to [Renovate](! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.

### Detected Package Files

 * `Dockerfile` (dockerfile)
 * `requirements.txt` (pip_requirements)

### Configuration Summary

Based on the default config's presets, Renovate will:

  - Start dependency updates only once this onboarding PR is merged
  - Enable Renovate Dependency Dashboard creation.
  - Use semantic commit type `fix` for dependencies and `chore` for all others if semantic commits are in use.
  - Ignore `node_modules`, `bower_components`, `vendor` and various test/tests directories.
  - Group known monorepo packages together.
  - Use curated list of recommended non-monorepo package groupings.
  - Apply crowd-sourced package replacement rules.
  - Apply crowd-sourced workarounds for known problems with packages.

🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the `renovate.json` in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


### What to Expect

With your current configuration, Renovate will create 1 Pull Request:

<summary>chore(deps): update python docker tag to v3.11</summary>

  - Schedule: ["at any time"]
  - Branch name: `renovate/python-3.x`
  - Merge into: `master`
  - Upgrade python to `3.11-slim-buster`



 Got questions? Check out Renovate's [Docs](, particularly the Getting Started section.
If you need any further assistance then you can also [request help here](


This PR has been generated by [Renovate Bot](

Co-authored-by: Slowpoke Bot <>
Reviewed-on: #1
Co-authored-by: Slowpoke The Bot <>
Co-committed-by: Slowpoke The Bot <>
2023-05-19 14:40:41 +10:00
Tim e184ad21d9 fix: readme 2023-05-19 14:40:38 +10:00
Tim 153814603f merge temlate 2023-05-19 14:39:43 +10:00
Mia Herkt c2b5e95903
ModUI: Handle opening filter panel with NULL user agent 2023-03-29 07:49:56 +02:00
Mia Herkt c189c47306
ModUI: Allow LIKE matching for address filtering 2023-03-29 07:38:36 +02:00
Mia Herkt 3d1facaec3
Store user agent with files
Needed for moderation.
2023-03-29 07:36:49 +02:00
Mia Herkt e00866f5e4
URL: Explicitly set upper-case table name
Looks like recent SQLAlchemy/Alembic chose to lower-case it by
default. Try not to break existing schemas.
2023-03-29 07:19:47 +02:00
jonas-w 3950f6e8eb
fix 500 error when file extension could not be guessed
when a file without an extension was uploaded
and the mimetypes.guess_extension returned None
because there is no official file extension
for that mimetype a NoneType was subscripted
which yielded a 500 http error
2023-01-15 20:36:39 +01:00
Mia Herkt e1e99957b6
ModUI: Fix crash when encountering null NSFW score
Fixes #78
2022-12-29 19:51:04 +01:00
Mia Herkt 647e3a54f1
ModUI: Add application/xml to text handler 2022-12-22 09:55:41 +01:00
Mia Herkt 0e4f0206ab
ModUI: Fix jinja2 func call in ban action 2022-12-22 09:44:32 +01:00
Mia Herkt 53249df28d
README: Kitty support was merged in mpv 2022-12-21 19:47:49 +01:00
Mia Herkt 556cd8aeae
README: Add ModUI screenshot 2022-12-20 16:57:07 +01:00
Mia Herkt 8b04e08fd6
ModUI: Add application/json to text handler 2022-12-20 16:23:35 +01:00
Mia Herkt 455863c138
Update requirements.txt 2022-12-20 16:19:49 +01:00
Mia Herkt eebd5d8c6d
Add moderation TUI
This ended up way fancier than I imagined.
2022-12-20 16:19:49 +01:00
Mia Herkt dcea8bffe1
migrations: Fix file expirations on SQLite
Well that was what we feared. I love arbitrary hardcoded limits.
2022-12-20 14:23:14 +01:00
Mia Herkt f76dbef82f
Fix NSFW detection 2022-12-17 02:32:51 +01:00
Mia Herkt 57c4b6853f
Prevent unreasonably long MIME types 2022-12-13 23:41:12 +01:00
Mia Herkt 77801efd21
Fix URL test issue 2022-12-13 23:18:40 +01:00
Mia Herkt d5763a9854
File: Fix 404 case with secret URLs 2022-12-13 23:17:56 +01:00
Mia Herkt aaf0e4492a
Record file sizes in db
Moderation interface is going to use this.
2022-12-13 23:04:48 +01:00
Mia Herkt 6055a50948
File: Add is_nsfw property 2022-12-13 21:51:39 +01:00
Mia Herkt b1ed63c401
README: Add note about StreamMaxLength in clamd.conf 2022-12-12 07:40:38 +01:00
Mia Herkt a904922cbd
Add support for ClamAV 2022-12-12 07:35:05 +01:00
Mia Herkt da30c8f8ff
index.html: Document appending file names 2022-12-01 03:28:25 +01:00
Mia Herkt 0b80a62f80
Add support for “secret” file URLs
Closes #47
2022-12-01 02:49:28 +01:00
Mia Herkt ed84d3752c
Fix 500 on invalid paths 2022-12-01 01:26:32 +01:00
Mia Herkt 7661216bc0
Fix handling double file name extensions
Long names would get truncated at the end, causing problems
including unresolvable file URLs. Example with default settings:
    .package.lst → .package.

Fixes #61
2022-12-01 01:19:05 +01:00
Mia Herkt 9214bb4832
Add X-Expires to file response headers
Tells clients when files will expire, in milliseconds since Unix epoch.

Closes #50.
2022-11-30 02:30:52 +01:00
Mia Herkt e168534258
Allow changing expiration date 2022-11-30 02:19:29 +01:00
Mia Herkt afe2329bf5
templates/index: Remove unnecessary escaping 2022-11-30 02:19:29 +01:00
Mia Herkt a182b6199b
Allow management operations like deleting files
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-30 02:19:29 +01:00
Mia Herkt eb0b1d2f69
nsfw_detect: Use PyAV instead of ffmpegthumbnailer 2022-11-29 21:54:43 +01:00
Mia Herkt 14cfe3da58
nsfw_detect: Use pathlib, fix deprecation warning
Also fix glog suppression
2022-11-29 21:44:07 +01:00
Mia Herkt aa443178e1
README: Also run db upgrade after git pull! 2022-11-29 17:23:56 +01:00
Mia Herkt db9a20c94d
Add example systemd unit files for prune job 2022-11-29 17:23:30 +01:00
Mia Herkt f25619b7e3
nsfw_detect: Tolerate score computation failure 2022-11-29 13:31:35 +01:00
Emi Simpson af4b3b06c0
Add support for expiring files
- 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
  (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

Coalesce updates to the database during migration

Remove vestigial database model

prune:  Stream expired files from the database

(as opposed to collecting them all first)  Add min & max expiration + description
2022-11-29 13:09:26 +01:00
Mia Herkt 00dba0e189 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
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