pull/635/head
bodybybuddha 6 years ago
commit d2e74a27cd

@ -44,5 +44,9 @@ if args.k:
print("Keyfilepath is invalid. Exiting...") print("Keyfilepath is invalid. Exiting...")
sys.exit(1) sys.exit(1)
if (args.k and not args.c) or (not args.k and args.c):
print("Certfile and Keyfile have to be used together. Exiting...")
sys.exit(1)
if args.k is "": if args.k is "":
keyfilepath = "" keyfilepath = ""

@ -5,6 +5,8 @@
from socket import error as SocketError from socket import error as SocketError
import sys import sys
import os import os
import signal
try: try:
from gevent.pywsgi import WSGIServer from gevent.pywsgi import WSGIServer
from gevent.pool import Pool from gevent.pool import Pool
@ -26,7 +28,8 @@ class server:
restart= False restart= False
def __init__(self): def __init__(self):
pass signal.signal(signal.SIGINT, self.killServer)
signal.signal(signal.SIGTERM, self.killServer)
def start_gevent(self): def start_gevent(self):
try: try:
@ -86,6 +89,9 @@ class server:
def setRestartTyp(self,starttyp): def setRestartTyp(self,starttyp):
self.restart=starttyp self.restart=starttyp
def killServer(self, signum, frame):
self.stopServer()
def stopServer(self): def stopServer(self):
if gevent_present: if gevent_present:
self.wsgiserver.close() self.wsgiserver.close()

@ -96,8 +96,8 @@
<div class="col-xs-6 col-sm-5">{% if config.config_remote_login %}<span class="glyphicon glyphicon-ok"></span>{% else %}<span class="glyphicon glyphicon-remove"></span>{% endif %}</div> <div class="col-xs-6 col-sm-5">{% if config.config_remote_login %}<span class="glyphicon glyphicon-ok"></span>{% else %}<span class="glyphicon glyphicon-remove"></span>{% endif %}</div>
</div> </div>
</div> </div>
<div class="btn btn-default"><a href="{{url_for('configuration')}}">{{_('Basic Configuration')}}</a></div> <div class="btn btn-default"><a id="basic_config" href="{{url_for('configuration')}}">{{_('Basic Configuration')}}</a></div>
<div class="btn btn-default"><a href="{{url_for('view_configuration')}}">{{_('UI Configuration')}}</a></div> <div class="btn btn-default"><a id="view_config" href="{{url_for('view_configuration')}}">{{_('UI Configuration')}}</a></div>
</div> </div>
</div> </div>
@ -105,8 +105,8 @@
<div class="col"> <div class="col">
<h2>{{_('Administration')}}</h2> <h2>{{_('Administration')}}</h2>
<div class="btn btn-default" id="restart_database">{{_('Reconnect to Calibre DB')}}</div> <div class="btn btn-default" id="restart_database">{{_('Reconnect to Calibre DB')}}</div>
<div class="btn btn-default" data-toggle="modal" data-target="#RestartDialog">{{_('Restart Calibre-Web')}}</div> <div class="btn btn-default" id="admin_restart"data-toggle="modal" data-target="#RestartDialog">{{_('Restart Calibre-Web')}}</div>
<div class="btn btn-default" data-toggle="modal" data-target="#ShutdownDialog">{{_('Stop Calibre-Web')}}</div> <div class="btn btn-default" id="admin_stop" data-toggle="modal" data-target="#ShutdownDialog">{{_('Stop Calibre-Web')}}</div>
</div> </div>
</div> </div>

@ -207,12 +207,12 @@
<div class="col-sm-12"> <div class="col-sm-12">
<button type="submit" class="btn btn-default">{{_('Submit')}}</button> <button type="submit" name="submit" class="btn btn-default">{{_('Submit')}}</button>
{% if not origin %} {% if not origin %}
<a href="{{ url_for('admin') }}" class="btn btn-default">{{_('Back')}}</a> <a href="{{ url_for('admin') }}" class="btn btn-default">{{_('Back')}}</a>
{% endif %} {% endif %}
{% if success %} {% if success %}
<a href="{{ url_for('login') }}" class="btn btn-default">{{_('Login')}}</a> <a href="{{ url_for('login') }}" name="login" class="btn btn-default">{{_('Login')}}</a>
{% endif %} {% endif %}
</div> </div>
</form> </form>

@ -174,8 +174,10 @@
{% if entry.comments|length > 0 and entry.comments[0].text|length > 0%} {% if entry.comments|length > 0 and entry.comments[0].text|length > 0%}
<div class="comments">
<h3>{{_('Description:')}}</h3> <h3>{{_('Description:')}}</h3>
{{entry.comments[0].text|safe}} {{entry.comments[0].text|safe}}
</div>
{% endif %} {% endif %}

@ -122,16 +122,16 @@
<li id="nav_new" {% if page == 'root' %}class="active"{% endif %}><a href="{{url_for('index')}}"><span class="glyphicon glyphicon-book"></span> {{_('Recently Added')}}</a></li> <li id="nav_new" {% if page == 'root' %}class="active"{% endif %}><a href="{{url_for('index')}}"><span class="glyphicon glyphicon-book"></span> {{_('Recently Added')}}</a></li>
{%endif%} {%endif%}
{% if g.user.show_sorted() %} {% if g.user.show_sorted() %}
<li class="dropdown"> <li id="nav_sort" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-sort-by-attributes"></span>{{_('Sorted Books')}} <span class="glyphicon glyphicon-sort-by-attributes"></span>{{_('Sorted Books')}}
<span class="caret"></span> <span class="caret"></span>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li {% if page == 'newest' %}class="active"{% endif %}><a href="{{url_for('newest_books')}}">{{_('Sort By')}} {{_('Newest')}}</a></li> <li id="nav_sort_old" {% if page == 'newest' %}class="active"{% endif %}><a href="{{url_for('newest_books')}}">{{_('Sort By')}} {{_('Newest')}}</a></li>
<li {% if page == 'oldest' %}class="active"{% endif %}><a href="{{url_for('oldest_books')}}">{{_('Sort By')}} {{_('Oldest')}}</a></li> <li id="nav_sort_new" {% if page == 'oldest' %}class="active"{% endif %}><a href="{{url_for('oldest_books')}}">{{_('Sort By')}} {{_('Oldest')}}</a></li>
<li {% if page == 'a-z' %}class="active"{% endif %}><a href="{{url_for('titles_ascending')}}">{{_('Sort By')}} {{_('Title')}} ({{_('Ascending')}})</a></li> <li id="nav_sort_asc" {% if page == 'a-z' %}class="active"{% endif %}><a href="{{url_for('titles_ascending')}}">{{_('Sort By')}} {{_('Title')}} ({{_('Ascending')}})</a></li>
<li {% if page == 'z-a' %}class="active"{% endif %}><a href="{{url_for('titles_descending')}}">{{_('Sort By')}} {{_('Title')}} ({{_('Descending')}})</a></li> <li id="nav_sort_desc" {% if page == 'z-a' %}class="active"{% endif %}><a href="{{url_for('titles_descending')}}">{{_('Sort By')}} {{_('Title')}} ({{_('Descending')}})</a></li>
</ul> </ul>
</li> </li>
{%endif%} {%endif%}
@ -139,13 +139,13 @@
<li id="nav_hot" {% if page == 'hot' %}class="active"{% endif %}><a href="{{url_for('hot_books')}}"><span class="glyphicon glyphicon-fire"></span>{{_('Hot Books')}}</a></li> <li id="nav_hot" {% if page == 'hot' %}class="active"{% endif %}><a href="{{url_for('hot_books')}}"><span class="glyphicon glyphicon-fire"></span>{{_('Hot Books')}}</a></li>
{%endif%} {%endif%}
{% if g.user.show_best_rated_books() %} {% if g.user.show_best_rated_books() %}
<li {% if page == 'rated' %}class="active"{% endif %}><a href="{{url_for('best_rated_books')}}"><span class="glyphicon glyphicon-star"></span>{{_('Best rated Books')}}</a></li> <li id="nav_rated" {% if page == 'rated' %}class="active"{% endif %}><a href="{{url_for('best_rated_books')}}"><span class="glyphicon glyphicon-star"></span>{{_('Best rated Books')}}</a></li>
{%endif%} {%endif%}
{% if g.user.show_read_and_unread() %} {% if g.user.show_read_and_unread() %}
{% if not g.user.is_anonymous %} {% if not g.user.is_anonymous %}
<li {% if page == 'read' %}class="active"{% endif %}><a href="{{url_for('read_books')}}"><span class="glyphicon glyphicon-eye-open"></span>{{_('Read Books')}}</a></li> <li id="nav_read" {% if page == 'read' %}class="active"{% endif %}><a href="{{url_for('read_books')}}"><span class="glyphicon glyphicon-eye-open"></span>{{_('Read Books')}}</a></li>
{%endif%} {%endif%}
<li {% if page == 'read' %}class="active"{% endif %}><a href="{{url_for('unread_books')}}"><span class="glyphicon glyphicon-eye-close"></span>{{_('Unread Books')}}</a></li> <li id="nav_unread" {% if page == 'read' %}class="active"{% endif %}><a href="{{url_for('unread_books')}}"><span class="glyphicon glyphicon-eye-close"></span>{{_('Unread Books')}}</a></li>
{%endif%} {%endif%}
{% if g.user.show_random_books() %} {% if g.user.show_random_books() %}
<li id="nav_rand" {% if page == 'discover' %}class="active"{% endif %}><a href="{{url_for('discover')}}"><span class="glyphicon glyphicon-random"></span>{{_('Discover')}}</a></li> <li id="nav_rand" {% if page == 'discover' %}class="active"{% endif %}><a href="{{url_for('discover')}}"><span class="glyphicon glyphicon-random"></span>{{_('Discover')}}</a></li>

@ -7,15 +7,11 @@
<label for="nickname">{{_('Username')}}</label> <label for="nickname">{{_('Username')}}</label>
<input type="text" class="form-control" id="nickname" name="nickname" placeholder="{{_('Choose a username')}}" required> <input type="text" class="form-control" id="nickname" name="nickname" placeholder="{{_('Choose a username')}}" required>
</div> </div>
<!--div class="form-group required">
<label for="password">{{_('Password')}}</label>
<input type="password" class="form-control" id="password" name="password" placeholder="{{_('Choose a password')}}" required>
</div-->
<div class="form-group required"> <div class="form-group required">
<label for="email">{{_('E-mail address')}}</label> <label for="email">{{_('E-mail address')}}</label>
<input type="email" class="form-control" id="email" name="email" placeholder="{{_('Your email address')}}" required> <input type="email" class="form-control" id="email" name="email" placeholder="{{_('Your email address')}}" required>
</div> </div>
<button type="submit" class="btn btn-primary">{{_('Register')}}</button> <button type="submit" id="submit" class="btn btn-primary">{{_('Register')}}</button>
</form> </form>
</div> </div>
{% if error %} {% if error %}

@ -14,7 +14,7 @@
</label> </label>
</div> </div>
{% endif %} {% endif %}
<button type="submit" class="btn btn-default">{{_('Submit')}}</button> <button type="submit" class="btn btn-default" id="submit">{{_('Submit')}}</button>
{% if shelf.id != None %} {% if shelf.id != None %}
<a href="{{ url_for('show_shelf', shelf_id=shelf.id) }}" class="btn btn-default">{{_('Back')}}</a> <a href="{{ url_for('show_shelf', shelf_id=shelf.id) }}" class="btn btn-default">{{_('Back')}}</a>
{% endif %} {% endif %}

@ -22,8 +22,6 @@
<input type="password" class="form-control" name="password" id="password" value="" autocomplete="off"> <input type="password" class="form-control" name="password" id="password" value="" autocomplete="off">
</div> </div>
{% endif %} {% endif %}
{% endif %} {% endif %}
<div class="form-group"> <div class="form-group">
<label for="kindle_mail">{{_('Kindle E-Mail')}}</label> <label for="kindle_mail">{{_('Kindle E-Mail')}}</label>

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Calibre-Web\n" "Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n" "Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2018-09-14 21:11+0200\n" "POT-Creation-Date: 2018-09-23 19:00+0200\n"
"PO-Revision-Date: 2018-09-08 17:48+0200\n" "PO-Revision-Date: 2018-09-16 00:46+0200\n"
"Last-Translator: Nicolas Roudninski <nicoroud@gmail.com>\n" "Last-Translator: Nicolas Roudninski <nicoroud@gmail.com>\n"
"Language: fr\n" "Language: fr\n"
"Language-Team: \n" "Language-Team: \n"
@ -120,35 +120,35 @@ msgstr "Inconnu"
#: cps/web.py:1121 cps/web.py:1152 #: cps/web.py:1121 cps/web.py:1152
msgid "HTTP Error" msgid "HTTP Error"
msgstr "" msgstr "Erreur HTTP"
#: cps/web.py:1123 cps/web.py:1154 #: cps/web.py:1123 cps/web.py:1154
msgid "Connection error" msgid "Connection error"
msgstr "" msgstr "Erreur de connexion"
#: cps/web.py:1125 cps/web.py:1156 #: cps/web.py:1125 cps/web.py:1156
msgid "Timeout while establishing connection" msgid "Timeout while establishing connection"
msgstr "" msgstr "Délai d'attente dépassé lors de l'établissement de connexion"
#: cps/web.py:1127 cps/web.py:1158 #: cps/web.py:1127 cps/web.py:1158
msgid "General error" msgid "General error"
msgstr "" msgstr "Erreur générale"
#: cps/web.py:1133 #: cps/web.py:1133
msgid "Unexpected data while reading update information" msgid "Unexpected data while reading update information"
msgstr "" msgstr "Données inattendues lors de la lecture des informations de mise à jour"
#: cps/web.py:1140 #: cps/web.py:1140
msgid "No update available. You already have the latest version installed" msgid "No update available. You already have the latest version installed"
msgstr "" msgstr "Aucune mise à jour disponible. Vous avez déjà la dernière version installée"
#: cps/web.py:1165 #: cps/web.py:1165
msgid "A new update is available. Click on the button below to update to the latest version." msgid "A new update is available. Click on the button below to update to the latest version."
msgstr "" msgstr "Une nouvelle mise à jour est disponible. Cliquez sur le bouton ci-dessous pour charger la dernière version."
#: cps/web.py:1215 #: cps/web.py:1215
msgid "Could not fetch update information" msgid "Could not fetch update information"
msgstr "" msgstr "Impossible d'extraire les informations de mise à jour"
#: cps/web.py:1230 #: cps/web.py:1230
msgid "Requesting update package" msgid "Requesting update package"
@ -637,7 +637,7 @@ msgstr "Le fichier de couverture nest pas au format jpg, impossible de sauveg
#: cps/web.py:3554 #: cps/web.py:3554
#, python-format #, python-format
msgid "%(langname)s is not a valid language" msgid "%(langname)s is not a valid language"
msgstr "" msgstr "%(langname)s n'est pas une langue valide"
#: cps/web.py:3676 #: cps/web.py:3676
msgid "Error editing book, please check logfile for details" msgid "Error editing book, please check logfile for details"
@ -826,19 +826,19 @@ msgstr "Arrêter Calibre-Web"
#: cps/templates/admin.html:115 #: cps/templates/admin.html:115
msgid "Update" msgid "Update"
msgstr "" msgstr "Mise à jour de Calibre-Web"
#: cps/templates/admin.html:119 #: cps/templates/admin.html:119
msgid "Version" msgid "Version"
msgstr "" msgstr "Version"
#: cps/templates/admin.html:120 #: cps/templates/admin.html:120
msgid "Details" msgid "Details"
msgstr "" msgstr "Détails"
#: cps/templates/admin.html:126 #: cps/templates/admin.html:126
msgid "Current version" msgid "Current version"
msgstr "" msgstr "Version actuellement installée"
#: cps/templates/admin.html:132 #: cps/templates/admin.html:132
msgid "Check for update" msgid "Check for update"

File diff suppressed because it is too large Load Diff

@ -108,8 +108,8 @@ current_milli_time = lambda: int(round(time.time() * 1000))
gdrive_watch_callback_token = 'target=calibreweb-watch_files' gdrive_watch_callback_token = 'target=calibreweb-watch_files'
EXTENSIONS_UPLOAD = {'txt', 'pdf', 'epub', 'mobi', 'azw', 'azw3', 'cbr', 'cbz', 'cbt', 'djvu', 'prc', 'doc', 'docx', EXTENSIONS_UPLOAD = {'txt', 'pdf', 'epub', 'mobi', 'azw', 'azw3', 'cbr', 'cbz', 'cbt', 'djvu', 'prc', 'doc', 'docx',
'fb2'} 'fb2', 'html', 'rtf', 'odt'}
EXTENSIONS_CONVERT = {'pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2', 'lit', 'lrf', 'txt'} EXTENSIONS_CONVERT = {'pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2', 'lit', 'lrf', 'txt', 'html', 'rtf', 'odt'}
# EXTENSIONS_READER = set(['txt', 'pdf', 'epub', 'zip', 'cbz', 'tar', 'cbt'] + (['rar','cbr'] if rar_support else [])) # EXTENSIONS_READER = set(['txt', 'pdf', 'epub', 'zip', 'cbz', 'tar', 'cbt'] + (['rar','cbr'] if rar_support else []))
@ -591,7 +591,7 @@ def modify_database_object(input_elements, db_book_object, db_object, db_session
new_element = db_object(add_element, add_element) new_element = db_object(add_element, add_element)
elif db_type == 'custom': elif db_type == 'custom':
new_element = db_object(value=add_element) new_element = db_object(value=add_element)
else: # db_type should be tag, or languages else: # db_type should be tag, language or publisher
new_element = db_object(add_element) new_element = db_object(add_element)
db_session.add(new_element) db_session.add(new_element)
# add element to book # add element to book
@ -1703,7 +1703,7 @@ def delete_book(book_id, book_format):
modify_database_object([u''], book.tags, db.Tags, db.session, 'tags') modify_database_object([u''], book.tags, db.Tags, db.session, 'tags')
modify_database_object([u''], book.series, db.Series, db.session, 'series') modify_database_object([u''], book.series, db.Series, db.session, 'series')
modify_database_object([u''], book.languages, db.Languages, db.session, 'languages') modify_database_object([u''], book.languages, db.Languages, db.session, 'languages')
modify_database_object([u''], book.publishers, db.Publishers, db.session, 'series') modify_database_object([u''], book.publishers, db.Publishers, db.session, 'publishers')
cc = db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all() cc = db.session.query(db.Custom_Columns).filter(db.Custom_Columns.datatype.notin_(db.cc_exceptions)).all()
for c in cc: for c in cc:
@ -3012,7 +3012,8 @@ def configuration_helper(origin):
if content.config_logfile != to_save["config_logfile"]: if content.config_logfile != to_save["config_logfile"]:
# check valid path, only path or file # check valid path, only path or file
if os.path.dirname(to_save["config_logfile"]): if os.path.dirname(to_save["config_logfile"]):
if os.path.exists(os.path.dirname(to_save["config_logfile"])): if os.path.exists(os.path.dirname(to_save["config_logfile"])) and \
os.path.basename(to_save["config_logfile"]) and not os.path.isdir(to_save["config_logfile"]):
content.config_logfile = to_save["config_logfile"] content.config_logfile = to_save["config_logfile"]
else: else:
ub.session.commit() ub.session.commit()
@ -3060,8 +3061,6 @@ def configuration_helper(origin):
gdriveError=gdriveError, goodreads=goodreads_support, rarfile_support=rar_support, gdriveError=gdriveError, goodreads=goodreads_support, rarfile_support=rar_support,
title=_(u"Basic Configuration"), page="config") title=_(u"Basic Configuration"), page="config")
if reboot_required: if reboot_required:
# ub.session.close()
# ub.engine.dispose()
# stop Server # stop Server
server.Server.setRestartTyp(True) server.Server.setRestartTyp(True)
server.Server.stopServer() server.Server.stopServer()

@ -487,6 +487,7 @@ class WorkerThread(threading.Thread):
datetime.now() - self.queue[self.current]['starttime']) datetime.now() - self.queue[self.current]['starttime'])
# Enable logging of smtp lib debug output
class StderrLogger(object): class StderrLogger(object):
buffer = '' buffer = ''

@ -15,6 +15,6 @@ six==1.10.0
goodreads>=0.3.2 goodreads>=0.3.2
python-Levenshtein>=0.12.0 python-Levenshtein>=0.12.0
# other # other
lxml==3.7.2 lxml>=3.8.0
rarfile>=2.7 rarfile>=2.7
natsort>=2.2.0 natsort>=2.2.0

Loading…
Cancel
Save