[mirror of https://git.0x0.st/mia/0x0] No-bullshit file hosting and URL shortening service https://0x0.st
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 68 lines 2.7 kB view raw
1<pre> 2THE NULL POINTER 3================ 4{% set fhost_url = url_for("fhost", _external=True).rstrip("/") %} 5HTTP POST files here: 6 curl -F'file=@yourfile.png' {{ fhost_url }} 7You can also POST remote URLs: 8 curl -F'url=http://example.com/image.jpg' {{ fhost_url }} 9If you don't want the resulting URL to be easy to guess: 10 curl -F'file=@yourfile.png' -Fsecret= {{ fhost_url }} 11 curl -F'url=http://example.com/image.jpg' -Fsecret= {{ fhost_url }} 12Or you can shorten URLs: 13 curl -F'shorten=http://example.com/some/long/url' {{ fhost_url }} 14 15It is possible to append your own file name to the URL: 16 {{ fhost_url }}/aaa.jpg/image.jpeg 17 18File URLs are valid for at least 30 days and up to a year (see below). 19Shortened URLs do not expire. 20 21Files can be set to expire sooner by adding an "expires" parameter (in hours) 22 curl -F'file=@yourfile.png' -Fexpires=24 {{ fhost_url }} 23OR by setting "expires" to a timestamp in epoch milliseconds 24 curl -F'file=@yourfile.png' -Fexpires=1681996320000 {{ fhost_url }} 25 26Expired files won't be removed immediately, but will be removed as part of 27the next purge. 28 29Whenever a file that does not already exist or has expired is uploaded, 30the HTTP response header includes an X-Token field. You can use this 31to perform management operations on the file. 32 33To delete the file immediately: 34 curl -Ftoken=token_here -Fdelete= {{ fhost_url }}/abc.txt 35To change the expiration date (see above): 36 curl -Ftoken=token_here -Fexpires=3 {{ fhost_url }}/abc.txt 37 38{% set max_size = config["MAX_CONTENT_LENGTH"]|filesizeformat(True) %} 39Maximum file size: {{ max_size }} 40 41 42FILE RETENTION PERIOD 43--------------------- 44 45retention = min_age + (-max_age + min_age) * pow((file_size / max_size - 1), 3) 46 47 days 48 {{'{: 6}'.format(config.get("FHOST_MAX_EXPIRATION", 31536000000)//86400000)}} | \ 49 | \ 50 | \ 51 | \ 52 | \ 53 | \ 54 | .. 55 | \ 56 {{'{: 6.1f}'.format((config.get("FHOST_MIN_EXPIRATION", 2592000000)/2 + config.get("FHOST_MAX_EXPIRATION", 31536000000)/2)/86400000)}} | ----------..------------------------------------------- 57 | .. 58 | \ 59 | .. 60 | ... 61 | .. 62 | ... 63 | .... 64 | ...... 65 {{'{: 6}'.format(config.get("FHOST_MIN_EXPIRATION", 2592000000)//86400000)}} | .................... 66 0{{ ((config["MAX_CONTENT_LENGTH"]/2)|filesizeformat(True)).split(" ")[0].rjust(27) }}{{ max_size.split(" ")[0].rjust(27) }} 67 {{ max_size.split(" ")[1].rjust(54) }} 68</pre>