feat: docker support

master
Tim 9 months ago
parent 0db6e4b895
commit a84d2e50e4

@ -0,0 +1,16 @@
FROM python:3.8-slim-buster
WORKDIR /python-docker
ENV FLASK_APP=fhost
ENV FLASK_ENV=production
COPY requirements.txt requirements.txt
RUN apt update && apt install -y libmagic-dev && apt clean
RUN pip3 install -r requirements.txt
COPY . .
RUN flask db upgrade
CMD [ "flask", "run", "-h", "0.0.0.0" ]

@ -0,0 +1,15 @@
# Insance?
FHOST_STORAGE_PATH = "upload/"
SQLALCHEMY_DATABASE_URI = "sqlite:///fhost_db.sql"
FHOST_USE_X_ACCEL_REDIRECT = False
USE_X_SENDFILE = False
FHOST_MIME_BLACKLIST = [
"application/x-dosexec",
"application/x-executable",
"application/x-hdf5",
"application/java-archive"
]
MAX_CONTENT_LENGTH = 256 * 1024 * 1024
MAX_URL_LENGTH = 0
PREFERRED_URL_SCHEME = "https"
URL_ALPHABET = "hd2uCRYFteibPwq0SWBInTpA_jcZL5GDEQKz314Ulk87Jors9vNHgfaOmMXy6Vx-"

@ -46,6 +46,7 @@ app.config.update(
"audio/flac" : ".flac",
"image/gif" : ".gif",
"image/jpeg" : ".jpg",
"image/jpeg" : ".jpeg",
"image/png" : ".png",
"image/svg+xml" : ".svg",
"video/webm" : ".webm",

@ -1,21 +1,59 @@
<pre>
THE NULL POINTER
================
{% set fhost_url = url_for("fhost", _external=True).rstrip("/") %}
THE FIRST REGISTER
==================
{% set fhost_url = url_for("fhost", _external=True).rstrip("/").replace("http","https") %}
HTTP POST files here:
curl -F'file=@yourfile.png' {{ fhost_url }}
You can also POST remote URLs:
curl -F'url=http://example.com/image.jpg' {{ fhost_url }}
Or you can shorten URLs:
curl -F'shorten=http://example.com/some/long/url' {{ fhost_url }}
File URLs are valid for at least 30 days and up to a year (see below).
Shortened URLs do not expire.
{% set max_size = config["MAX_CONTENT_LENGTH"]|filesizeformat(True) %}
Maximum file size: {{ max_size }}
Not allowed: {{ config["FHOST_MIME_BLACKLIST"]|join(", ") }}
TERMS OF SERVICE
--------------
{{ fhost_url }} is NOT a platform for:
* piracy
* pornography and gore
* extremist material of any kind
* malware / botnet C&C
* anything related to crypto currencies
* backups (yes, this includes your minecraft stuff, seriously
people have been dumping terabytes of it here for years)
* CI build artifacts
* doxxing, database dumps containing personal information
* anything illegal under Australian law
Uploads found to be in violation of these rules will be removed,
and the originating IP address blocked from further uploads.
WEB UPLOAD
----------
<form action="/" method="post" enctype="multipart/form-data">
<input type="file" id="file" name="file">
<input type="submit">
</form>
OPERATOR NOTES
--------------
If you run a server and like this site, clone it! Centralization is bad.
https://git.0x0.st/mia/0x0
You can also support it financially via libreapay.
<img src="https://img.shields.io/liberapay/receives/~1788687.svg?logo=liberapay">
Initial hosting costs about 20 AUD a month currently, and I expect it to scale with time to 50 AUD a month
If you wish to make just a small one-time donation, that is cool too!
It will go towards my coffee habits.
FILE RETENTION PERIOD
---------------------
@ -42,4 +80,13 @@ retention = min_age + (-max_age + min_age) * pow((file_size / max_size - 1), 3)
30 | ....................
0{{ ((config["MAX_CONTENT_LENGTH"]/2)|filesizeformat(True)).split(" ")[0].rjust(27) }}{{ max_size.split(" ")[0].rjust(27) }}
{{ max_size.split(" ")[1].rjust(54) }}
ABUSE
-----
If you would like to request permanent deletion, please contact me via email to:
abuse 0x1a.ro (do not copy and paste).
Please allow up to 48 hours for a response.
</pre>

Loading…
Cancel
Save