mirror of https://git.sr.ht/~cadence/NewLeaf
Add robots.txt
This commit is contained in:
parent
0f877b06bc
commit
ccd3513c46
7
index.py
7
index.py
|
@ -1,5 +1,6 @@
|
||||||
import cherrypy
|
import cherrypy
|
||||||
import json
|
import json
|
||||||
|
import pathlib
|
||||||
import requests
|
import requests
|
||||||
import youtube_dlc
|
import youtube_dlc
|
||||||
from extractors.video import extract_video
|
from extractors.video import extract_video
|
||||||
|
@ -129,10 +130,14 @@ class NewLeaf(object):
|
||||||
|
|
||||||
bind_port = getattr(configuration, "bind_port", 3000)
|
bind_port = getattr(configuration, "bind_port", 3000)
|
||||||
bind_host = getattr(configuration, "bind_host", "0.0.0.0")
|
bind_host = getattr(configuration, "bind_host", "0.0.0.0")
|
||||||
|
server_root = pathlib.Path(__file__).parent.joinpath("root")
|
||||||
|
|
||||||
cherrypy.config.update({"server.socket_port": bind_port, "server.socket_host": bind_host})
|
cherrypy.config.update({"server.socket_port": bind_port, "server.socket_host": bind_host})
|
||||||
cherrypy.quickstart(NewLeaf(), "/", {
|
cherrypy.quickstart(NewLeaf(), "/", {
|
||||||
"/": {
|
"/": {
|
||||||
"tools.custom_headers.on": True
|
"tools.custom_headers.on": True,
|
||||||
|
"tools.staticdir.on": True,
|
||||||
|
"tools.staticdir.dir": str(server_root.absolute()),
|
||||||
|
"tools.staticdir.index": "index.html"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
User-Agent: *
|
||||||
|
Disallow: /
|
Loading…
Reference in New Issue