1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-25 17:40:31 +00:00
This commit is contained in:
bodybybuddha 2018-09-23 19:51:32 -04:00
commit d2e74a27cd
16 changed files with 231 additions and 237 deletions

View File

@ -44,5 +44,9 @@ if args.k:
print("Keyfilepath is invalid. Exiting...")
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 "":
keyfilepath = ""

View File

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

View File

@ -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>
</div>
<div class="btn btn-default"><a 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="basic_config" href="{{url_for('configuration')}}">{{_('Basic Configuration')}}</a></div>
<div class="btn btn-default"><a id="view_config" href="{{url_for('view_configuration')}}">{{_('UI Configuration')}}</a></div>
</div>
</div>
@ -105,8 +105,8 @@
<div class="col">
<h2>{{_('Administration')}}</h2>
<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" data-toggle="modal" data-target="#ShutdownDialog">{{_('Stop 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" id="admin_stop" data-toggle="modal" data-target="#ShutdownDialog">{{_('Stop Calibre-Web')}}</div>
</div>
</div>

View File

@ -207,12 +207,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 %}
<a href="{{ url_for('admin') }}" class="btn btn-default">{{_('Back')}}</a>
{% endif %}
{% 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 %}
</div>
</form>

View File

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

View File

@ -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>
{%endif%}
{% 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">
<span class="glyphicon glyphicon-sort-by-attributes"></span>{{_('Sorted Books')}}
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li {% 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 {% 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_old" {% if page == 'newest' %}class="active"{% endif %}><a href="{{url_for('newest_books')}}">{{_('Sort By')}} {{_('Newest')}}</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 id="nav_sort_asc" {% if page == 'a-z' %}class="active"{% endif %}><a href="{{url_for('titles_ascending')}}">{{_('Sort By')}} {{_('Title')}} ({{_('Ascending')}})</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>
</li>
{%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>
{%endif%}
{% 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%}
{% if g.user.show_read_and_unread() %}
{% 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%}
<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%}
{% 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>

View File

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

View File

@ -14,7 +14,7 @@
</label>
</div>
{% 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 %}
<a href="{{ url_for('show_shelf', shelf_id=shelf.id) }}" class="btn btn-default">{{_('Back')}}</a>
{% endif %}

View File

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

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Calibre-Web\n"
"Report-Msgid-Bugs-To: https://github.com/janeczku/Calibre-Web\n"
"POT-Creation-Date: 2018-09-14 21:11+0200\n"
"PO-Revision-Date: 2018-09-08 17:48+0200\n"
"POT-Creation-Date: 2018-09-23 19:00+0200\n"
"PO-Revision-Date: 2018-09-16 00:46+0200\n"
"Last-Translator: Nicolas Roudninski <nicoroud@gmail.com>\n"
"Language: fr\n"
"Language-Team: \n"
@ -120,35 +120,35 @@ msgstr "Inconnu"
#: cps/web.py:1121 cps/web.py:1152
msgid "HTTP Error"
msgstr ""
msgstr "Erreur HTTP"
#: cps/web.py:1123 cps/web.py:1154
msgid "Connection error"
msgstr ""
msgstr "Erreur de connexion"
#: cps/web.py:1125 cps/web.py:1156
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
msgid "General error"
msgstr ""
msgstr "Erreur générale"
#: cps/web.py:1133
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
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
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
msgid "Could not fetch update information"
msgstr ""
msgstr "Impossible d'extraire les informations de mise à jour"
#: cps/web.py:1230
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
#, python-format
msgid "%(langname)s is not a valid language"
msgstr ""
msgstr "%(langname)s n'est pas une langue valide"
#: cps/web.py:3676
msgid "Error editing book, please check logfile for details"
@ -826,19 +826,19 @@ msgstr "Arrêter Calibre-Web"
#: cps/templates/admin.html:115
msgid "Update"
msgstr ""
msgstr "Mise à jour de Calibre-Web"
#: cps/templates/admin.html:119
msgid "Version"
msgstr ""
msgstr "Version"
#: cps/templates/admin.html:120
msgid "Details"
msgstr ""
msgstr "Détails"
#: cps/templates/admin.html:126
msgid "Current version"
msgstr ""
msgstr "Version actuellement installée"
#: cps/templates/admin.html:132
msgid "Check for update"

File diff suppressed because it is too large Load Diff

View File

@ -108,8 +108,8 @@ current_milli_time = lambda: int(round(time.time() * 1000))
gdrive_watch_callback_token = 'target=calibreweb-watch_files'
EXTENSIONS_UPLOAD = {'txt', 'pdf', 'epub', 'mobi', 'azw', 'azw3', 'cbr', 'cbz', 'cbt', 'djvu', 'prc', 'doc', 'docx',
'fb2'}
EXTENSIONS_CONVERT = {'pdf', 'epub', 'mobi', 'azw3', 'docx', 'rtf', 'fb2', 'lit', 'lrf', 'txt'}
'fb2', 'html', 'rtf', 'odt'}
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 []))
@ -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)
elif db_type == 'custom':
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)
db_session.add(new_element)
# 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.series, db.Series, db.session, 'series')
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()
for c in cc:
@ -3012,7 +3012,8 @@ def configuration_helper(origin):
if content.config_logfile != to_save["config_logfile"]:
# check valid path, only path or file
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"]
else:
ub.session.commit()
@ -3060,8 +3061,6 @@ def configuration_helper(origin):
gdriveError=gdriveError, goodreads=goodreads_support, rarfile_support=rar_support,
title=_(u"Basic Configuration"), page="config")
if reboot_required:
# ub.session.close()
# ub.engine.dispose()
# stop Server
server.Server.setRestartTyp(True)
server.Server.stopServer()

View File

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

View File

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