Added uploader

This commit is contained in:
aewens 2018-07-31 17:28:53 -04:00
commit 67d781bd7c
2 changed files with 36 additions and 24 deletions

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
__pycache__/
.py[cod]
db.sqlite
up/
*.pyc

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from flask import Flask, abort, escape, make_response, redirect, request, send_from_directory, url_for, Response
@ -46,7 +46,7 @@ app.config["FHOST_MIME_BLACKLIST"] = [
app.config["FHOST_UPLOAD_BLACKLIST"] = "tornodes.txt"
app.config["NSFW_DETECT"] = True
app.config["NSFW_DETECT"] = False
app.config["NSFW_THRESHOLD"] = 0.608
if app.config["NSFW_DETECT"]:
@ -341,27 +341,35 @@ def fhost():
if maxsizehalf.is_integer():
maxsizehalf = int(maxsizehalf)
return """<pre>
THE NULL POINTER
================
return """
<html>
<head>
<link rel="stylesheet" href="https://tilde.team/css/hacker.css">
<title>0x0.tilde.team</title>
</head>
<body>
<div class="container">
<h1>THE NULL POINTER</h1>
<hr>
HTTP POST files here:
curl -F'file=@yourfile.png' {0}
<pre>curl -F'file=@yourfile.png' {0}</pre>
You can also POST remote URLs:
curl -F'url=http://example.com/image.jpg' {0}
<pre>curl -F'url=http://example.com/image.jpg' {0}</pre>
Or you can shorten URLs:
curl -F'shorten=http://example.com/some/long/url' {0}
<pre>curl -F'shorten=http://example.com/some/long/url' {0}</pre>
File URLs are valid for at least 30 days and up to a year (see below).
Shortened URLs do not expire.
<p>File URLs are valid for at least 30 days and up to a year (see below).
Shortened URLs do not expire.</p>
Maximum file size: {1}
Not allowed: {5}
<p>Maximum file size: {1}</p>
<p>Not allowed: {5}</p>
FILE RETENTION PERIOD
---------------------
<h3>FILE RETENTION PERIOD</h3>
<pre>
retention = min_age + (-max_age + min_age) * pow((file_size / max_size - 1), 3)
days
@ -385,26 +393,27 @@ retention = min_age + (-max_age + min_age) * pow((file_size / max_size - 1), 3)
30 | ....................
0{2}{3}
{4}
</pre>
<h3>ABUSE</h3>
<hr>
ABUSE
-----
<p>If you would like to request permanent deletion, please contact ben or khuxkm via
IRC on <a href="https://web.tilde.chat">tilde.chat</a>, or send an email to sudoers@tilde.team.</p>
If you would like to request permanent deletion, please contact lachs0r via
IRC on Freenode, or send an email to lachs0r@(this domain).
<p>Please allow up to 24 hours for a response.</p>
Please allow up to 24 hours for a response.
UPLOAD DIRECTLY
---------------
<h3>UPLOAD DIRECTLY</h3>
<hr>
<form action="{0}" method="POST" enctype="multipart/form-data">
<label for="file">File:</label>
<input class="form-control" type="file" name="file"><br><br>
<input class="form-control" type="submit" value="Submit">
</form>
</pre>
</div>
</body>
</html>
""".format(fhost_url(),
maxsize, str(maxsizehalf).rjust(27), str(maxsizenum).rjust(27),
maxsizeunit.rjust(54),