···48from this git repository, run ``FLASK_APP=fhost flask db upgrade``.
495000000000000000000000000000000000000000000051NSFW Detection
52--------------
53
···48from this git repository, run ``FLASK_APP=fhost flask db upgrade``.
495051+Moderation UI
52+-------------
53+54+0x0 features a TUI program for file moderation. With it, you can view a list
55+of uploaded files, as well as extended information on them. It allows you to
56+take actions like removing files temporarily or permanently, as well as
57+blocking IP addresses and associated files.
58+59+If a sufficiently recent version of python-mpv with libmpv is present and
60+your terminal supports it, you also get graphical file previews, including
61+video playback. Upstream mpv currently supports sixel graphics, but there is
62+`an open pull request <https://github.com/mpv-player/mpv/pull/11002>`_ that
63+adds support for the `kitty graphics protocol <https://sw.kovidgoyal.net/kitty/graphics-protocol/>`_.
64+For this to work, set the ``MOD_PREVIEW_PROTO`` option in ``instance/config.py``.
65+66+Requirements:
67+68+* `Textual <https://textual.textualize.io/>`_
69+70+Optional:
71+72+* `python-mpv <https://github.com/jaseg/python-mpv>`_
73+ (graphical previews)
74+* `PyAV <https://github.com/PyAV-Org/PyAV>`_
75+ (information on multimedia files)
76+* `PyMuPDF <https://github.com/pymupdf/PyMuPDF>`_
77+ (previews and file information for PDF, XPS, EPUB, MOBI and FB2)
78+* `libarchive-c <https://github.com/Changaco/python-libarchive-c>`_
79+ (archive content listing)
80+81+.. note::
82+ `Mosh <https://mosh.org/>`_ currently does not support sixels or kitty graphics.
83+84+.. hint::
85+ You may need to set the ``COLORTERM`` environment variable to
86+ ``truecolor``.
87+88+.. tip::
89+ Using compression with SSH (``-C`` option) can significantly
90+ reduce the bandwidth requirements for graphics.
91+92+93NSFW Detection
94--------------
95
+11
instance/config.example.py
···58FHOST_MAX_EXPIRATION = 365 * 24 * 60 * 60 * 1000
59600000000000061# Use the X-SENDFILE header to speed up serving files w/ compatible webservers
62#
63# Some webservers can be configured use the X-Sendfile header to handle sending
···58FHOST_MAX_EXPIRATION = 365 * 24 * 60 * 60 * 1000
596061+# This should be detected automatically when running behind a reverse proxy, but needs
62+# to be set for URL resolution to work in e.g. the moderation UI.
63+# SERVER_NAME = "example.com"
64+65+66+# Specifies which graphics protocol to use for the media previews in the moderation UI.
67+# Requires pympv with libmpv >= 0.36.0 and terminal support.
68+# Available choices are "sixel" and "kitty".
69+# MOD_PREVIEW_PROTO = "sixel"
70+71+72# Use the X-SENDFILE header to speed up serving files w/ compatible webservers
73#
74# Some webservers can be configured use the X-Sendfile header to handle sending