Merge branch 'master' into feat/put/add-support

This commit is contained in:
mihaigalos 2022-11-28 07:58:19 +01:00
commit bb3f4c596d

View file

@ -7,8 +7,14 @@ This is a no-bullshit file hosting and URL shortening service that also runs
Configuration Configuration
------------- -------------
To change settings, modify ``instance/config.py``. For more information on To configure 0x0, create ``instance/config.py``.
instance configuration, see `the Flask documentation <https://flask.palletsprojects.com/en/2.0.x/config/#instance-folders>`_. The defaults are at the start of ``fhost.py``. To change them,
add them to ``instance/config.py``— for example::
SQLALCHEMY_DATABASE_URI = "sqlite:///some/path/db.sqlite"
For more information on instance configuration, see
`the Flask documentation <https://flask.palletsprojects.com/en/2.0.x/config/#instance-folders>`_.
To customize the home and error pages, simply create a ``templates`` directory To customize the home and error pages, simply create a ``templates`` directory
in your instance directory and copy any templates you want to modify there. in your instance directory and copy any templates you want to modify there.
@ -24,8 +30,10 @@ where ``/up`` is whatever youve configured as ``FHOST_STORAGE_PATH``.
For all other servers, set ``FHOST_USE_X_ACCEL_REDIRECT`` to ``False`` and For all other servers, set ``FHOST_USE_X_ACCEL_REDIRECT`` to ``False`` and
``USE_X_SENDFILE`` to ``True``, assuming your server supports this. ``USE_X_SENDFILE`` to ``True``, assuming your server supports this.
Otherwise, Flask will serve the file with chunked encoding, which sucks and Otherwise, Flask will serve the file with chunked encoding, which has several
should be avoided at all costs. downsides, one of them being that range requests will not work. This is a
problem for example when streaming media files: It wont be possible to seek,
and some ISOBMFF (MP4) files will not play at all.
To make files expire, simply create a cronjob that runs ``cleanup.py`` every To make files expire, simply create a cronjob that runs ``cleanup.py`` every
now and then. now and then.