From 3ddb7f1da36c991c4d8fd1bacda9d76ec77f1d83 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 2 Jan 2015 22:45:55 +0530 Subject: [PATCH] Add a noindex directive for robots to the content server There are people that apparently expose their content server instances over the public internet. See http://www.mobileread.com/forums/showthread.php?t=202662 --- resources/content_server/browse/browse.html | 1 + resources/content_server/index.html | 1 + src/calibre/library/server/mobile.py | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/content_server/browse/browse.html b/resources/content_server/browse/browse.html index 619ba5aa48..1ae0d005f4 100644 --- a/resources/content_server/browse/browse.html +++ b/resources/content_server/browse/browse.html @@ -6,6 +6,7 @@ ..:: calibre {library} ::.. {title} + diff --git a/resources/content_server/index.html b/resources/content_server/index.html index 42ebb0d422..c5a57f764b 100644 --- a/resources/content_server/index.html +++ b/resources/content_server/index.html @@ -3,6 +3,7 @@ calibre library + diff --git a/src/calibre/library/server/mobile.py b/src/calibre/library/server/mobile.py index 8b880ce12a..1b6468f710 100644 --- a/src/calibre/library/server/mobile.py +++ b/src/calibre/library/server/mobile.py @@ -12,7 +12,7 @@ from urllib import quote import cherrypy from lxml import html from lxml.html.builder import HTML, HEAD, TITLE, LINK, DIV, IMG, BODY, \ - OPTION, SELECT, INPUT, FORM, SPAN, TABLE, TR, TD, A, HR + OPTION, SELECT, INPUT, FORM, SPAN, TABLE, TR, TD, A, HR, META from calibre.library.server import custom_fields_to_display from calibre.library.server.utils import strftime, format_tag_string @@ -173,7 +173,8 @@ def build_index(books, num, search, sort, order, start, total, url_base, CKEYS, type='image/x-icon'), LINK(rel='stylesheet', type='text/css', href=prefix+'/mobile/style.css'), - LINK(rel='apple-touch-icon', href="/static/calibre.png") + LINK(rel='apple-touch-icon', href="/static/calibre.png"), + META(name="robots", content="noindex") ), # End head body ) # End html