"last_seen" : format_datetime(datetime.fromtimestamp(row[5])),
})
- return templates.TemplateResponse("rss.xml", {
+ return templates.TemplateResponse("views/rss.xml", {
"request" : request,
"timestamp": format_datetime(datetime.now()),
"domain" : domain,
@router.get(config.get("base_url") + "/robots.txt", response_class=PlainTextResponse)
def robots(request: Request):
- return templates.TemplateResponse("robots.txt", {
+ return templates.TemplateResponse("views/robots.txt", {
"request" : request,
"base_url": config.get("base_url")
})
+++ /dev/null
-User-Agent: *
-Disallow {{base_url}}/api/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<rss version="2.0">
-<channel>
- <title>fedi-block-api{% if domain %} {{domain}}{% endif %}</title>
- <description>Feed of latest blocks{% if domain %} for {{domain}}{% endif %} from fedi-block-api</description>
- <pubDate>{{timestamp}}</pubDate>
- <ttl>1800</ttl>
- {% for block in blocks %}
- <item>
- <title>{{block['blocker']}} has applied '{{block['block_level']}}' restriction to {{block['blocked']}}</title>
- <description>{{block['reason']}}</description>
- <link>https://{{hostname}}/top?mode=reverse&value={{block['blocker']}}</link>
- <pubDate>{{block['first_seen']}}</pubDate>
- </item>
- {% endfor %}
-</channel>
-</rss>
--- /dev/null
+User-Agent: *
+Disallow {{base_url}}/api/
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0">
+<channel>
+ <title>fedi-block-api{% if domain %} {{domain}}{% endif %}</title>
+ <description>Feed of latest blocks{% if domain %} for {{domain}}{% endif %} from fedi-block-api</description>
+ <pubDate>{{timestamp}}</pubDate>
+ <ttl>1800</ttl>
+ {% for block in blocks %}
+ <item>
+ <title>{{block['blocker']}} has applied '{{block['block_level']}}' restriction to {{block['blocked']}}</title>
+ <description>{{block['reason']}}</description>
+ <link>https://{{hostname}}/top?mode=reverse&value={{block['blocker']}}</link>
+ <pubDate>{{block['first_seen']}}</pubDate>
+ </item>
+ {% endfor %}
+</channel>
+</rss>