Fixes for oauth login after programming basic tests

This commit is contained in:
Ozzieisaacs 2020-04-15 19:57:33 +02:00
parent ce4f1258b5
commit a784c6bd52
10 changed files with 450 additions and 385 deletions

View File

@ -43,6 +43,11 @@ try:
except ImportError: except ImportError:
unidecode_version = _(u'not installed') unidecode_version = _(u'not installed')
try:
from flask_dance import __version__ as flask_danceVersion
except ImportError:
flask_danceVersion = None
from . import services from . import services
about = flask.Blueprint('about', __name__) about = flask.Blueprint('about', __name__)
@ -68,10 +73,11 @@ _VERSIONS = OrderedDict(
iso639=isoLanguages.__version__, iso639=isoLanguages.__version__,
pytz=pytz.__version__, pytz=pytz.__version__,
Unidecode = unidecode_version, Unidecode = unidecode_version,
Flask_SimpleLDAP = u'installed' if bool(services.ldap) else u'not installed', Flask_SimpleLDAP = u'installed' if bool(services.ldap) else None,
python_LDAP = services.ldapVersion if bool(services.ldapVersion) else u'not installed', python_LDAP = services.ldapVersion if bool(services.ldapVersion) else None,
Goodreads = u'installed' if bool(services.goodreads_support) else u'not installed', Goodreads = u'installed' if bool(services.goodreads_support) else None,
jsonschema = services.SyncToken.__version__ if bool(services.SyncToken) else u'not installed', jsonschema = services.SyncToken.__version__ if bool(services.SyncToken) else None,
flask_dance = flask_danceVersion
) )
_VERSIONS.update(uploader.get_versions()) _VERSIONS.update(uploader.get_versions())

View File

@ -622,23 +622,22 @@ def _configuration_update_helper():
active_oauths = 0 active_oauths = 0
for element in oauthblueprints: for element in oauthblueprints:
if to_save["config_"+str(element['id'])+"_oauth_client_id"] \
and to_save["config_"+str(element['id'])+"_oauth_client_secret"]:
active_oauths += 1
element["active"] = 1
ub.session.query(ub.OAuthProvider).filter(ub.OAuthProvider.id == element['id']).update(
{"oauth_client_id":to_save["config_"+str(element['id'])+"_oauth_client_id"],
"oauth_client_secret":to_save["config_"+str(element['id'])+"_oauth_client_secret"],
"active":1})
if to_save["config_" + str(element['id']) + "_oauth_client_id"] != element['oauth_client_id'] \ if to_save["config_" + str(element['id']) + "_oauth_client_id"] != element['oauth_client_id'] \
or to_save["config_" + str(element['id']) + "_oauth_client_secret"] != element['oauth_client_secret']: or to_save["config_" + str(element['id']) + "_oauth_client_secret"] != element['oauth_client_secret']:
reboot_required = True reboot_required = True
element['oauth_client_id'] = to_save["config_" + str(element['id']) + "_oauth_client_id"] element['oauth_client_id'] = to_save["config_" + str(element['id']) + "_oauth_client_id"]
element['oauth_client_secret'] = to_save["config_" + str(element['id']) + "_oauth_client_secret"] element['oauth_client_secret'] = to_save["config_" + str(element['id']) + "_oauth_client_secret"]
if to_save["config_"+str(element['id'])+"_oauth_client_id"] \
and to_save["config_"+str(element['id'])+"_oauth_client_secret"]:
active_oauths += 1
element["active"] = 1
else: else:
ub.session.query(ub.OAuthProvider).filter(ub.OAuthProvider.id == element['id']).update(
{"active":0})
element["active"] = 0 element["active"] = 0
ub.session.query(ub.OAuthProvider).filter(ub.OAuthProvider.id == element['id']).update(
{"oauth_client_id":to_save["config_"+str(element['id'])+"_oauth_client_id"],
"oauth_client_secret":to_save["config_"+str(element['id'])+"_oauth_client_secret"],
"active":element["active"]})
reboot_required |= _config_int("config_log_level") reboot_required |= _config_int("config_log_level")
reboot_required |= _config_string("config_logfile") reboot_required |= _config_string("config_logfile")

View File

@ -36,7 +36,6 @@ from sqlalchemy.orm.exc import NoResultFound
from . import constants, logger, config, app, ub from . import constants, logger, config, app, ub
from .web import login_required from .web import login_required
from .oauth import OAuthBackend from .oauth import OAuthBackend
# from .web import github_oauth_required
oauth_check = {} oauth_check = {}
@ -59,29 +58,29 @@ def oauth_required(f):
return inner return inner
def register_oauth_blueprint(id, show_name): def register_oauth_blueprint(cid, show_name):
oauth_check[id] = show_name oauth_check[cid] = show_name
def register_user_with_oauth(user=None): def register_user_with_oauth(user=None):
all_oauth = {} all_oauth = {}
for oauth in oauth_check.keys(): for oauth_key in oauth_check.keys():
if str(oauth) + '_oauth_user_id' in session and session[str(oauth) + '_oauth_user_id'] != '': if str(oauth_key) + '_oauth_user_id' in session and session[str(oauth_key) + '_oauth_user_id'] != '':
all_oauth[oauth] = oauth_check[oauth] all_oauth[oauth_key] = oauth_check[oauth_key]
if len(all_oauth.keys()) == 0: if len(all_oauth.keys()) == 0:
return return
if user is None: if user is None:
flash(_(u"Register with %(provider)s", provider=", ".join(list(all_oauth.values()))), category="success") flash(_(u"Register with %(provider)s", provider=", ".join(list(all_oauth.values()))), category="success")
else: else:
for oauth in all_oauth.keys(): for oauth_key in all_oauth.keys():
# Find this OAuth token in the database, or create it # Find this OAuth token in the database, or create it
query = ub.session.query(ub.OAuth).filter_by( query = ub.session.query(ub.OAuth).filter_by(
provider=oauth, provider=oauth_key,
provider_user_id=session[str(oauth) + "_oauth_user_id"], provider_user_id=session[str(oauth_key) + "_oauth_user_id"],
) )
try: try:
oauth = query.one() oauth_key = query.one()
oauth.user_id = user.id oauth_key.user_id = user.id
except NoResultFound: except NoResultFound:
# no found, return error # no found, return error
return return
@ -93,22 +92,23 @@ def register_user_with_oauth(user=None):
def logout_oauth_user(): def logout_oauth_user():
for oauth in oauth_check.keys(): for oauth_key in oauth_check.keys():
if str(oauth) + '_oauth_user_id' in session: if str(oauth_key) + '_oauth_user_id' in session:
session.pop(str(oauth) + '_oauth_user_id') session.pop(str(oauth_key) + '_oauth_user_id')
if ub.oauth_support: if ub.oauth_support:
oauthblueprints = [] oauthblueprints = []
if not ub.session.query(ub.OAuthProvider).count(): if not ub.session.query(ub.OAuthProvider).count():
oauth = ub.OAuthProvider() oauthProvider = ub.OAuthProvider()
oauth.provider_name = "github" oauthProvider.provider_name = "github"
oauth.active = False oauthProvider.active = False
ub.session.add(oauth) ub.session.add(oauthProvider)
ub.session.commit() ub.session.commit()
oauth = ub.OAuthProvider() oauthProvider = ub.OAuthProvider()
oauth.provider_name = "google" oauthProvider.provider_name = "google"
oauth.active = False oauthProvider.active = False
ub.session.add(oauth) ub.session.add(oauthProvider)
ub.session.commit() ub.session.commit()
oauth_ids = ub.session.query(ub.OAuthProvider).all() oauth_ids = ub.session.query(ub.OAuthProvider).all()
@ -190,17 +190,17 @@ if ub.oauth_support:
provider_user_id=provider_user_id, provider_user_id=provider_user_id,
) )
try: try:
oauth = query.one() oauth_entry = query.one()
# update token # update token
oauth.token = token oauth_entry.token = token
except NoResultFound: except NoResultFound:
oauth = ub.OAuth( oauth_entry = ub.OAuth(
provider=provider_id, provider=provider_id,
provider_user_id=provider_user_id, provider_user_id=provider_user_id,
token=token, token=token,
) )
try: try:
ub.session.add(oauth) ub.session.add(oauth_entry)
ub.session.commit() ub.session.commit()
except Exception as e: except Exception as e:
log.exception(e) log.exception(e)
@ -216,17 +216,17 @@ if ub.oauth_support:
provider_user_id=provider_user_id, provider_user_id=provider_user_id,
) )
try: try:
oauth = query.one() oauth_entry = query.one()
# already bind with user, just login # already bind with user, just login
if oauth.user: if oauth_entry.user:
login_user(oauth.user) login_user(oauth_entry.user)
return redirect(url_for('web.index')) return redirect(url_for('web.index'))
else: else:
# bind to current user # bind to current user
if current_user and current_user.is_authenticated: if current_user and current_user.is_authenticated:
oauth.user = current_user oauth_entry.user = current_user
try: try:
ub.session.add(oauth) ub.session.add(oauth_entry)
ub.session.commit() ub.session.commit()
except Exception as e: except Exception as e:
log.exception(e) log.exception(e)
@ -248,8 +248,8 @@ if ub.oauth_support:
) )
try: try:
oauths = query.all() oauths = query.all()
for oauth in oauths: for oauth_entry in oauths:
status.append(int(oauth.provider)) status.append(int(oauth_entry.provider))
return status return status
except NoResultFound: except NoResultFound:
return None return None
@ -263,11 +263,11 @@ if ub.oauth_support:
user_id=current_user.id, user_id=current_user.id,
) )
try: try:
oauth = query.one() oauth_entry = query.one()
if current_user and current_user.is_authenticated: if current_user and current_user.is_authenticated:
oauth.user = current_user oauth_entry.user = current_user
try: try:
ub.session.delete(oauth) ub.session.delete(oauth_entry)
ub.session.commit() ub.session.commit()
logout_oauth_user() logout_oauth_user()
flash(_(u"Unlink to %(oauth)s success.", oauth=oauth_check[provider]), category="success") flash(_(u"Unlink to %(oauth)s success.", oauth=oauth_check[provider]), category="success")

View File

@ -25,20 +25,22 @@
<a href="{{url_for('web.remote_login')}}" class="pull-right">{{_('Log in with Magic Link')}}</a> <a href="{{url_for('web.remote_login')}}" class="pull-right">{{_('Log in with Magic Link')}}</a>
{% endif %} {% endif %}
{% if config.config_login_type == 2 %} {% if config.config_login_type == 2 %}
<a href="{{url_for('oauth.github_login')}}" class="pull-right"> {% if 1 in oauth_check %}
<a href="{{url_for('oauth.github_login')}}" class="pull-right github">
<svg height="32" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true"> <svg height="32" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true">
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path> <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
</svg> </svg>
</a> </a>
{% endif %} {% endif %}
{% if config.config_login_type == 3 %} {% if 2 in oauth_check %}
<a href="{{url_for('oauth.google_login')}}" class="pull-right"> <a href="{{url_for('oauth.google_login')}}" class="pull-right google">
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" <svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
width="40" height="40" width="40" height="40"
viewBox="0 3 48 49" viewBox="0 3 48 49"
style="fill:#000000;"><g id="surface1"><path style=" fill:#FFC107;" d="M 43.609375 20.082031 L 42 20.082031 L 42 20 L 24 20 L 24 28 L 35.304688 28 C 33.652344 32.65625 29.222656 36 24 36 C 17.371094 36 12 30.628906 12 24 C 12 17.371094 17.371094 12 24 12 C 27.058594 12 29.84375 13.152344 31.960938 15.039063 L 37.617188 9.382813 C 34.046875 6.054688 29.269531 4 24 4 C 12.953125 4 4 12.953125 4 24 C 4 35.046875 12.953125 44 24 44 C 35.046875 44 44 35.046875 44 24 C 44 22.660156 43.863281 21.351563 43.609375 20.082031 Z "></path><path style=" fill:#FF3D00;" d="M 6.304688 14.691406 L 12.878906 19.511719 C 14.65625 15.109375 18.960938 12 24 12 C 27.058594 12 29.84375 13.152344 31.960938 15.039063 L 37.617188 9.382813 C 34.046875 6.054688 29.269531 4 24 4 C 16.316406 4 9.65625 8.335938 6.304688 14.691406 Z "></path><path style=" fill:#4CAF50;" d="M 24 44 C 29.164063 44 33.859375 42.023438 37.410156 38.808594 L 31.21875 33.570313 C 29.210938 35.089844 26.714844 36 24 36 C 18.796875 36 14.382813 32.683594 12.71875 28.054688 L 6.195313 33.078125 C 9.503906 39.554688 16.226563 44 24 44 Z "></path><path style=" fill:#1976D2;" d="M 43.609375 20.082031 L 42 20.082031 L 42 20 L 24 20 L 24 28 L 35.304688 28 C 34.511719 30.238281 33.070313 32.164063 31.214844 33.570313 C 31.21875 33.570313 31.21875 33.570313 31.21875 33.570313 L 37.410156 38.808594 C 36.972656 39.203125 44 34 44 24 C 44 22.660156 43.863281 21.351563 43.609375 20.082031 Z "></path></g></svg> style="fill:#000000;"><g id="surface1"><path style=" fill:#FFC107;" d="M 43.609375 20.082031 L 42 20.082031 L 42 20 L 24 20 L 24 28 L 35.304688 28 C 33.652344 32.65625 29.222656 36 24 36 C 17.371094 36 12 30.628906 12 24 C 12 17.371094 17.371094 12 24 12 C 27.058594 12 29.84375 13.152344 31.960938 15.039063 L 37.617188 9.382813 C 34.046875 6.054688 29.269531 4 24 4 C 12.953125 4 4 12.953125 4 24 C 4 35.046875 12.953125 44 24 44 C 35.046875 44 44 35.046875 44 24 C 44 22.660156 43.863281 21.351563 43.609375 20.082031 Z "></path><path style=" fill:#FF3D00;" d="M 6.304688 14.691406 L 12.878906 19.511719 C 14.65625 15.109375 18.960938 12 24 12 C 27.058594 12 29.84375 13.152344 31.960938 15.039063 L 37.617188 9.382813 C 34.046875 6.054688 29.269531 4 24 4 C 16.316406 4 9.65625 8.335938 6.304688 14.691406 Z "></path><path style=" fill:#4CAF50;" d="M 24 44 C 29.164063 44 33.859375 42.023438 37.410156 38.808594 L 31.21875 33.570313 C 29.210938 35.089844 26.714844 36 24 36 C 18.796875 36 14.382813 32.683594 12.71875 28.054688 L 6.195313 33.078125 C 9.503906 39.554688 16.226563 44 24 44 Z "></path><path style=" fill:#1976D2;" d="M 43.609375 20.082031 L 42 20.082031 L 42 20 L 24 20 L 24 28 L 35.304688 28 C 34.511719 30.238281 33.070313 32.164063 31.214844 33.570313 C 31.21875 33.570313 31.21875 33.570313 31.21875 33.570313 L 37.410156 38.808594 C 36.972656 39.203125 44 34 44 24 C 44 22.660156 43.863281 21.351563 43.609375 20.082031 Z "></path></g></svg>
</a> </a>
{% endif %} {% endif %}
{% endif %}
</form> </form>
</div> </div>
{% if error %} {% if error %}

View File

@ -35,10 +35,12 @@
</thead> </thead>
<tbody> <tbody>
{% for library,version in versions.items() %} {% for library,version in versions.items() %}
{% if version %}
<tr> <tr>
<th>{{library}}</th> <th>{{library}}</th>
<td>{{_(version)}}</td> <td>{{_(version)}}</td>
</tr> </tr>
{% endif %}
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>

View File

@ -161,7 +161,7 @@
</div> </div>
<div class="modal-body">...</div> <div class="modal-body">...</div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{_('Close')}}</button> <button type="button" id="kobo_close" class="btn btn-default" data-dismiss="modal">{{_('Close')}}</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -61,6 +61,7 @@ feature_support = {
try: try:
from .oauth_bb import oauth_check, register_user_with_oauth, logout_oauth_user, get_oauth_status from .oauth_bb import oauth_check, register_user_with_oauth, logout_oauth_user, get_oauth_status
feature_support['oauth'] = True feature_support['oauth'] = True
except ImportError: except ImportError:
feature_support['oauth'] = False feature_support['oauth'] = False
@ -110,14 +111,15 @@ for ex in default_exceptions:
elif ex == 500: elif ex == 500:
app.register_error_handler(ex, internal_error) app.register_error_handler(ex, internal_error)
web = Blueprint('web', __name__) web = Blueprint('web', __name__)
log = logger.create() log = logger.create()
# ################################### Login logic and rights management ############################################### # ################################### Login logic and rights management ###############################################
def _fetch_user_by_name(username): def _fetch_user_by_name(username):
return ub.session.query(ub.User).filter(func.lower(ub.User.nickname) == username.lower()).first() return ub.session.query(ub.User).filter(func.lower(ub.User.nickname) == username.lower()).first()
@lm.user_loader @lm.user_loader
def load_user(user_id): def load_user(user_id):
return ub.session.query(ub.User).filter(ub.User.id == int(user_id)).first() return ub.session.query(ub.User).filter(ub.User.id == int(user_id)).first()
@ -165,6 +167,7 @@ def login_required_if_no_ano(func):
if config.config_anonbrowse == 1: if config.config_anonbrowse == 1:
return func(*args, **kwargs) return func(*args, **kwargs)
return login_required(func)(*args, **kwargs) return login_required(func)(*args, **kwargs)
return decorated_view return decorated_view
@ -257,7 +260,8 @@ def edit_required(f):
# Returns the template for rendering and includes the instance name # Returns the template for rendering and includes the instance name
def render_title_template(*args, **kwargs): def render_title_template(*args, **kwargs):
sidebar = ub.get_sidebar_config(kwargs) sidebar = ub.get_sidebar_config(kwargs)
return render_template(instance=config.config_calibre_web_title, sidebar=sidebar, accept=constants.EXTENSIONS_UPLOAD, return render_template(instance=config.config_calibre_web_title, sidebar=sidebar,
accept=constants.EXTENSIONS_UPLOAD,
*args, **kwargs) *args, **kwargs)
@ -269,8 +273,10 @@ def before_request():
g.allow_upload = config.config_uploading g.allow_upload = config.config_uploading
g.current_theme = config.config_theme g.current_theme = config.config_theme
g.config_authors_max = config.config_authors_max g.config_authors_max = config.config_authors_max
g.shelves_access = ub.session.query(ub.Shelf).filter(or_(ub.Shelf.is_public == 1, ub.Shelf.user_id == current_user.id)).order_by(ub.Shelf.name).all() g.shelves_access = ub.session.query(ub.Shelf).filter(
if not config.db_configured and request.endpoint not in ('admin.basic_configuration', 'login') and '/static/' not in request.path: or_(ub.Shelf.is_public == 1, ub.Shelf.user_id == current_user.id)).order_by(ub.Shelf.name).all()
if not config.db_configured and request.endpoint not in (
'admin.basic_configuration', 'login') and '/static/' not in request.path:
return redirect(url_for('admin.basic_configuration')) return redirect(url_for('admin.basic_configuration'))
@ -477,7 +483,6 @@ def get_publishers_json():
return get_typeahead(db.Publishers, request.args.get('q'), ('|', ',')) return get_typeahead(db.Publishers, request.args.get('q'), ('|', ','))
@web.route("/get_tags_json", methods=['GET']) @web.route("/get_tags_json", methods=['GET'])
@login_required_if_no_ano @login_required_if_no_ano
def get_tags_json(): def get_tags_json():
@ -497,7 +502,6 @@ def get_languages_json():
language_names = isoLanguages.get_language_names(get_locale()) language_names = isoLanguages.get_language_names(get_locale())
entries_start = [s for key, s in language_names.items() if s.lower().startswith(query.lower())] entries_start = [s for key, s in language_names.items() if s.lower().startswith(query.lower())]
if len(entries_start) < 5: if len(entries_start) < 5:
entries = [s for key, s in language_names.items() if query in s.lower()] entries = [s for key, s in language_names.items() if query in s.lower()]
entries_start.extend(entries[0:(5 - len(entries_start))]) entries_start.extend(entries[0:(5 - len(entries_start))])
entries_start = list(set(entries_start)) entries_start = list(set(entries_start))
@ -636,13 +640,13 @@ def render_hot_books(page):
abort(404) abort(404)
def render_author_books(page, author_id, order): def render_author_books(page, author_id, order):
entries, __, pagination = fill_indexpage(page, db.Books, db.Books.authors.any(db.Authors.id == author_id), entries, __, pagination = fill_indexpage(page, db.Books, db.Books.authors.any(db.Authors.id == author_id),
[order[0], db.Series.name, db.Books.series_index], [order[0], db.Series.name, db.Books.series_index],
db.books_series_link, db.Series) db.books_series_link, db.Series)
if entries is None or not len(entries): if entries is None or not len(entries):
flash(_(u"Oops! Selected book title is unavailable. File does not exist or is not accessible"), category="error") flash(_(u"Oops! Selected book title is unavailable. File does not exist or is not accessible"),
category="error")
return redirect(url_for("web.index")) return redirect(url_for("web.index"))
author = db.session.query(db.Authors).get(author_id) author = db.session.query(db.Authors).get(author_id)
@ -697,7 +701,8 @@ def render_ratings_books(page, book_id, order):
def render_formats_books(page, book_id, order): def render_formats_books(page, book_id, order):
name = db.session.query(db.Data).filter(db.Data.format == book_id.upper()).first() name = db.session.query(db.Data).filter(db.Data.format == book_id.upper()).first()
if name: if name:
entries, random, pagination = fill_indexpage(page, db.Books, db.Books.data.any(db.Data.format == book_id.upper()), entries, random, pagination = fill_indexpage(page, db.Books,
db.Books.data.any(db.Data.format == book_id.upper()),
[db.Books.timestamp.desc(), order[0]]) [db.Books.timestamp.desc(), order[0]])
return render_title_template('index.html', random=random, pagination=pagination, entries=entries, id=book_id, return render_title_template('index.html', random=random, pagination=pagination, entries=entries, id=book_id,
title=_(u"File format: %(format)s", format=name.format), page="formats") title=_(u"File format: %(format)s", format=name.format), page="formats")
@ -873,6 +878,7 @@ def reconnect():
db.reconnect_db(config) db.reconnect_db(config)
return json.dumps({}) return json.dumps({})
@web.route("/search", methods=["GET"]) @web.route("/search", methods=["GET"])
@login_required_if_no_ano @login_required_if_no_ano
def search(): def search():
@ -1105,6 +1111,7 @@ def serve_book(book_id, book_format, anyname):
else: else:
return send_from_directory(os.path.join(config.config_calibre_dir, book.path), data.name + "." + book_format) return send_from_directory(os.path.join(config.config_calibre_dir, book.path), data.name + "." + book_format)
@web.route("/download/<int:book_id>/<book_format>", defaults={'anyname': 'None'}) @web.route("/download/<int:book_id>/<book_format>", defaults={'anyname': 'None'})
@web.route("/download/<int:book_id>/<book_format>/<anyname>") @web.route("/download/<int:book_id>/<book_format>/<anyname>")
@login_required_if_no_ano @login_required_if_no_ano
@ -1210,16 +1217,14 @@ def login():
.first() .first()
if config.config_login_type == constants.LOGIN_LDAP and services.ldap and user and form['password'] != "": if config.config_login_type == constants.LOGIN_LDAP and services.ldap and user and form['password'] != "":
login_result, error = services.ldap.bind_user(form['username'], form['password']) login_result, error = services.ldap.bind_user(form['username'], form['password'])
# None if credentials are not matching
# -1 if LDAP Server error
# 0 if wrong passwort
if login_result: if login_result:
login_user(user, remember=True) login_user(user, remember=True)
log.debug(u"You are now logged in as: '%s'", user.nickname) log.debug(u"You are now logged in as: '%s'", user.nickname)
flash(_(u"you are now logged in as: '%(nickname)s'", nickname=user.nickname), flash(_(u"you are now logged in as: '%(nickname)s'", nickname=user.nickname),
category="success") category="success")
return redirect_back(url_for("web.index")) return redirect_back(url_for("web.index"))
elif login_result is None and user and check_password_hash(str(user.password), form['password']) and user.nickname != "Guest": elif login_result is None and user and check_password_hash(str(user.password), form['password']) \
and user.nickname != "Guest":
login_user(user, remember=True) login_user(user, remember=True)
log.info("Local Fallback Login as: '%s'", user.nickname) log.info("Local Fallback Login as: '%s'", user.nickname)
flash(_(u"Fallback Login as: '%(nickname)s', LDAP Server not reachable, or user not known", flash(_(u"Fallback Login as: '%(nickname)s', LDAP Server not reachable, or user not known",
@ -1258,8 +1263,17 @@ def login():
log.info('Login failed for user "%s" IP-adress: %s', form['username'], ipAdress) log.info('Login failed for user "%s" IP-adress: %s', form['username'], ipAdress)
flash(_(u"Wrong Username or Password"), category="error") flash(_(u"Wrong Username or Password"), category="error")
if feature_support['oauth']:
oauth_status = get_oauth_status()
else:
oauth_status = None
next_url = url_for('web.index') next_url = url_for('web.index')
return render_title_template('login.html', title=_(u"login"), next_url=next_url, config=config, return render_title_template('login.html',
title=_(u"login"),
next_url=next_url,
config=config,
# oauth_status=oauth_status,
oauth_check=oauth_check,
mail=config.get_mail_server_configured(), page="login") mail=config.get_mail_server_configured(), page="login")
@ -1550,7 +1564,8 @@ def show_book(book_id):
audioentries.append(media_format.format.lower()) audioentries.append(media_format.format.lower())
return render_title_template('detail.html', entry=entries, audioentries=audioentries, cc=cc, return render_title_template('detail.html', entry=entries, audioentries=audioentries, cc=cc,
is_xhr=request.headers.get('X-Requested-With')=='XMLHttpRequest', title=entries.title, books_shelfs=book_in_shelfs, is_xhr=request.headers.get('X-Requested-With') == 'XMLHttpRequest',
title=entries.title, books_shelfs=book_in_shelfs,
have_read=have_read, kindle_list=kindle_list, reader_list=reader_list, page="book") have_read=have_read, kindle_list=kindle_list, reader_list=reader_list, page="book")
else: else:
log.debug(u"Error opening eBook. File does not exist or file is not accessible:") log.debug(u"Error opening eBook. File does not exist or file is not accessible:")

View File

@ -18,7 +18,7 @@ python-Levenshtein>=0.12.0,<0.13.0
# ldap login # ldap login
python_ldap>=3.0.0,<3.3.0 python_ldap>=3.0.0,<3.3.0
flask-simpleldap>1.3.0,<1.5.0 flask-simpleldap>=1.4.0,<1.5.0
#oauth #oauth
flask-dance>=1.4.0,<3.1.0 flask-dance>=1.4.0,<3.1.0

View File

@ -36,17 +36,17 @@
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<div class="row"> <div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3" style="margin-top:50px;"> <div class="col-xs-6 col-md-6 col-sm-offset-3" style="margin-top:50px;">
<p class='text-justify attribute'><strong>Start Time: </strong>2020-04-13 20:58:27</p> <p class='text-justify attribute'><strong>Start Time: </strong>2020-04-15 20:58:24</p>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3"> <div class="col-xs-6 col-md-6 col-sm-offset-3">
<p class='text-justify attribute'><strong>Stop Time: </strong>2020-04-13 21:36:17</p> <p class='text-justify attribute'><strong>Stop Time: </strong>2020-04-15 21:44:34</p>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-6 col-md-6 col-sm-offset-3"> <div class="col-xs-6 col-md-6 col-sm-offset-3">
<p class='text-justify attribute'><strong>Duration: </strong>2002.47 s</p> <p class='text-justify attribute'><strong>Duration: </strong>2409.70 s</p>
</div> </div>
</div> </div>
</div> </div>
@ -301,8 +301,8 @@
<tr class="result['header']['style']"> <tr class="result['header']['style']">
<td>test_ebook_convert.test_ebook_convert</td> <td>test_ebook_convert.test_ebook_convert</td>
<td class="text-center">11</td> <td class="text-center">11</td>
<td class="text-center">7</td> <td class="text-center">11</td>
<td class="text-center">4</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center"> <td class="text-center">
@ -339,33 +339,11 @@
<tr id='ft3.4' class='none bg-danger'> <tr id='pt3.4' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_convert_email</div> <div class='testcase'>test_convert_email</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft3.4')">FAIL</a>
</div>
<!--css div popup start-->
<div id='div_ft3.4' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft3.4').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_ebook_convert.py", line 194, in test_convert_email
self.assertEqual(ret[-1]['result'], 'Finished')
AssertionError: 'Failed' != 'Finished'
- Failed
+ Finished</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr> </tr>
@ -379,64 +357,20 @@ AssertionError: 'Failed' != 'Finished'
<tr id='ft3.6' class='none bg-danger'> <tr id='pt3.6' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_convert_only</div> <div class='testcase'>test_convert_only</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft3.6')">FAIL</a>
</div>
<!--css div popup start-->
<div id='div_ft3.6' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft3.6').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_ebook_convert.py", line 329, in test_convert_only
self.assertEqual(ret[-3]['result'], 'Finished')
AssertionError: 'Failed' != 'Finished'
- Failed
+ Finished</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr> </tr>
<tr id='ft3.7' class='none bg-danger'> <tr id='pt3.7' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_convert_parameter</div> <div class='testcase'>test_convert_parameter</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft3.7')">FAIL</a>
</div>
<!--css div popup start-->
<div id='div_ft3.7' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft3.7').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_ebook_convert.py", line 157, in test_convert_parameter
self.assertEqual(ret[-1]['result'], 'Finished')
AssertionError: 'Failed' != 'Finished'
- Failed
+ Finished</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr> </tr>
@ -459,33 +393,11 @@ AssertionError: 'Failed' != 'Finished'
<tr id='ft3.10' class='none bg-danger'> <tr id='pt3.10' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_email_only</div> <div class='testcase'>test_email_only</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center">
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_ft3.10')">FAIL</a>
</div>
<!--css div popup start-->
<div id='div_ft3.10' class="popup_window test_output" style="display:none;">
<div class='close_button pull-right'>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();'
onclick="document.getElementById('div_ft3.10').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_ebook_convert.py", line 381, in test_email_only
self.assertEqual(ret[-1]['result'], 'Finished')
AssertionError: 'Failed' != 'Finished'
- Failed
+ Finished</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td>
</tr> </tr>
@ -502,13 +414,13 @@ AssertionError: 'Failed' != 'Finished'
<tr class="result['header']['style']"> <tr class="result['header']['style']">
<td>test_edit_books.test_edit_books</td> <td>test_edit_books.test_edit_books</td>
<td class="text-center">30</td> <td class="text-center">31</td>
<td class="text-center">27</td> <td class="text-center">28</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">3</td> <td class="text-center">3</td>
<td class="text-center"> <td class="text-center">
<a onclick="showClassDetail('c4', 30)">Detail</a> <a onclick="showClassDetail('c4', 31)">Detail</a>
</td> </td>
</tr> </tr>
@ -720,7 +632,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.18' class='hiddenRow bg-success'> <tr id='pt4.18' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_typeahead_language</div> <div class='testcase'>test_typeahead_functions</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -729,7 +641,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.19' class='hiddenRow bg-success'> <tr id='pt4.19' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_typeahead_publisher</div> <div class='testcase'>test_typeahead_language</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -738,7 +650,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.20' class='hiddenRow bg-success'> <tr id='pt4.20' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_typeahead_series</div> <div class='testcase'>test_typeahead_publisher</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -747,7 +659,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.21' class='hiddenRow bg-success'> <tr id='pt4.21' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_typeahead_tag</div> <div class='testcase'>test_typeahead_series</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -756,7 +668,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.22' class='hiddenRow bg-success'> <tr id='pt4.22' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_book_cbr</div> <div class='testcase'>test_typeahead_tag</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -765,7 +677,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.23' class='hiddenRow bg-success'> <tr id='pt4.23' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_book_cbt</div> <div class='testcase'>test_upload_book_cbr</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -774,7 +686,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.24' class='hiddenRow bg-success'> <tr id='pt4.24' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_book_cbz</div> <div class='testcase'>test_upload_book_cbt</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -783,7 +695,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.25' class='hiddenRow bg-success'> <tr id='pt4.25' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_book_epub</div> <div class='testcase'>test_upload_book_cbz</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -792,7 +704,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.26' class='hiddenRow bg-success'> <tr id='pt4.26' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_book_fb2</div> <div class='testcase'>test_upload_book_epub</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -801,7 +713,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.27' class='hiddenRow bg-success'> <tr id='pt4.27' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_book_lit</div> <div class='testcase'>test_upload_book_fb2</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -810,7 +722,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.28' class='hiddenRow bg-success'> <tr id='pt4.28' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_book_mobi</div> <div class='testcase'>test_upload_book_lit</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -819,7 +731,7 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.29' class='hiddenRow bg-success'> <tr id='pt4.29' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_book_pdf</div> <div class='testcase'>test_upload_book_mobi</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -827,6 +739,15 @@ AssertionError: 'Failed' != 'Finished'
<tr id='pt4.30' class='hiddenRow bg-success'> <tr id='pt4.30' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_upload_book_pdf</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt4.31' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_upload_cover_hdd</div> <div class='testcase'>test_upload_cover_hdd</div>
</td> </td>
@ -921,46 +842,132 @@ AssertionError: 'Failed' != 'Finished'
<tr class="result['header']['style']"> <tr class="result['header']['style']">
<td>unittest.suite._ErrorHolder</td> <td>test_helper.calibre_helper</td>
<td class="text-center">1</td> <td class="text-center">13</td>
<td class="text-center">13</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center"> <td class="text-center">
<a onclick="showClassDetail('c7', 1)">Detail</a> <a onclick="showClassDetail('c7', 13)">Detail</a>
</td> </td>
</tr> </tr>
<tr id='et7.1' class='none bg-info'> <tr id='pt7.1' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>setUpClass (test_helper)</div> <div class='testcase'>test_author_sort</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center"> </tr>
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et7.1')">ERROR</a>
</div>
<!--css div popup start-->
<div id='div_et7.1' class="popup_window test_output" style="display:none;"> <tr id='pt7.2' class='hiddenRow bg-success'>
<div class='close_button pull-right'> <td>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <div class='testcase'>test_author_sort_comma</div>
onclick="document.getElementById('div_et7.1').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_helper.py", line 18, in setUpClass
from cps import helper
File "/home/matthias/Entwicklung/calibre-web/cps/__init__.py", line 28, in <module>
from babel import Locale as LC
ModuleNotFoundError: No module named 'babel'</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td> </td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.3' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_author_sort_junior</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.4' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_author_sort_oneword</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.5' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_author_sort_roman</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.6' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_check_Limit_Length</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.7' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_check_char_replacement</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.8' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_check_chinese_Characters</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.9' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_check_degEUR_replacement</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.10' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_check_doubleS</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.11' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_check_finish_Dot</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.12' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_check_high23</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt7.13' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_check_umlauts</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -968,13 +975,13 @@ ModuleNotFoundError: No module named 'babel'</pre>
<tr class="result['header']['style']"> <tr class="result['header']['style']">
<td>test_kobo_sync.test_kobo_sync</td> <td>test_kobo_sync.test_kobo_sync</td>
<td class="text-center">3</td>
<td class="text-center">2</td> <td class="text-center">2</td>
<td class="text-center">1</td> <td class="text-center">1</td>
<td class="text-center">1</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center"> <td class="text-center">
<a onclick="showClassDetail('c8', 2)">Detail</a> <a onclick="showClassDetail('c8', 3)">Detail</a>
</td> </td>
</tr> </tr>
@ -997,11 +1004,11 @@ ModuleNotFoundError: No module named 'babel'</pre>
</div> </div>
<div class="text-left pull-left"> <div class="text-left pull-left">
<pre class="text-left">Traceback (most recent call last): <pre class="text-left">Traceback (most recent call last):
File "/home/matthias/Entwicklung/calibre-web-test/test/test_kobo_sync.py", line 87, in test_check_sync File "/home/matthias/Entwicklung/calibre-web-test/test/test_kobo_sync.py", line 89, in test_check_sync
self.assertEqual(r.json()['Resources']['image_url_quality_template'], self.kobo_adress+"/{ImageId}/{width}/{height}/image.jpg") self.assertEqual(r.json()['Resources']['image_url_quality_template'], self.kobo_adress+"/{ImageId}/{width}/{height}/image.jpg")
AssertionError: 'http[35 chars]1d50f75da2a5578ea9baa6a77/{ImageId}/image.jpg' != 'http[35 chars]1d50f75da2a5578ea9baa6a77/{ImageId}/{width}/{height}/image.jpg' AssertionError: 'http[35 chars]4304a11f244beb23c60f4b7b0/{ImageId}/image.jpg' != 'http[35 chars]4304a11f244beb23c60f4b7b0/{ImageId}/{width}/{height}/image.jpg'
- http://192.168.188.33:8083/kobo/c97e71f1d50f75da2a5578ea9baa6a77/{ImageId}/image.jpg - http://192.168.188.33:8083/kobo/1b4c3e84304a11f244beb23c60f4b7b0/{ImageId}/image.jpg
+ http://192.168.188.33:8083/kobo/c97e71f1d50f75da2a5578ea9baa6a77/{ImageId}/{width}/{height}/image.jpg + http://192.168.188.33:8083/kobo/1b4c3e84304a11f244beb23c60f4b7b0/{ImageId}/{width}/{height}/image.jpg
? +++++++++++++++++</pre> ? +++++++++++++++++</pre>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
@ -1013,6 +1020,15 @@ AssertionError: 'http[35 chars]1d50f75da2a5578ea9baa6a77/{ImageId}/image.jpg' !=
<tr id='pt8.2' class='hiddenRow bg-success'> <tr id='pt8.2' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_kobo_about</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt8.3' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_sync_invalid</div> <div class='testcase'>test_sync_invalid</div>
</td> </td>
@ -1023,62 +1039,78 @@ AssertionError: 'http[35 chars]1d50f75da2a5578ea9baa6a77/{ImageId}/image.jpg' !=
<tr class="result['header']['style']"> <tr class="result['header']['style']">
<td>unittest.loader._FailedTest</td> <td>test_ldap.test_ldap_login</td>
<td class="text-center">1</td> <td class="text-center">7</td>
<td class="text-center">7</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">1</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center"> <td class="text-center">
<a onclick="showClassDetail('c9', 1)">Detail</a> <a onclick="showClassDetail('c9', 7)">Detail</a>
</td> </td>
</tr> </tr>
<tr id='et9.1' class='none bg-info'> <tr id='pt9.1' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>unittestloader_FailedTest)</div> <div class='testcase'>test_LDAP_SSL</div>
</td> </td>
<td colspan='6'> <td colspan='6' align='center'>PASS</td>
<div class="text-center"> </tr>
<a class="popup_link text-center" onfocus='blur()' onclick="showTestDetail('div_et9.1')">ERROR</a>
</div>
<!--css div popup start-->
<div id='div_et9.1' class="popup_window test_output" style="display:none;"> <tr id='pt9.2' class='hiddenRow bg-success'>
<div class='close_button pull-right'> <td>
<button type="button" class="close" aria-label="Close" onfocus='this.blur();' <div class='testcase'>test_LDAP_STARTTLS</div>
onclick="document.getElementById('div_et9.1').style.display='none'"><span
aria-hidden="true">&times;</span></button>
</div>
<div class="text-left pull-left">
<pre class="text-left">ImportError: Failed to import test module: test_ldap
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/home/matthias/Entwicklung/calibre-web-test/test/test_ldap.py", line 9, in <module>
from helper_ldap import TestLDApServer
File "/home/matthias/Entwicklung/calibre-web-test/test/helper_ldap.py", line 13, in <module>
from ldaptor.inmemory import fromLDIFFile
File "/home/matthias/.local/lib/python3.8/site-packages/ldaptor/inmemory.py", line 5, in <module>
from ldaptor import interfaces, entry, entryhelpers
File "/home/matthias/.local/lib/python3.8/site-packages/ldaptor/entry.py", line 10, in <module>
from ldaptor import interfaces, attributeset, delta
File "/home/matthias/.local/lib/python3.8/site-packages/ldaptor/delta.py", line 11, in <module>
from ldaptor.protocols import pureldap, pureber
File "/home/matthias/.local/lib/python3.8/site-packages/ldaptor/protocols/pureldap.py", line 22, in <module>
from ldaptor.protocols.pureber import (
File "/home/matthias/.local/lib/python3.8/site-packages/ldaptor/protocols/pureber.py", line 394
raise UnknownBERTag(i, context)
^
TabError: inconsistent use of tabs and spaces in indentation</pre>
</div>
<div class="clearfix"></div>
</div>
<!--css div popup end-->
</td> </td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt9.3' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_LDAP_fallback_Login</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt9.4' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_LDAP_import</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt9.5' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_LDAP_login</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt9.6' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_invalid_LDAP</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt9.7' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_ldap_about</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -1910,13 +1942,13 @@ AssertionError: False is not true : logfile config value is not empty after rese
<tr class="result['header']['style']"> <tr class="result['header']['style']">
<td>test_visiblilitys.calibre_web_visibilitys</td> <td>test_visiblilitys.calibre_web_visibilitys</td>
<td class="text-center">22</td> <td class="text-center">23</td>
<td class="text-center">22</td> <td class="text-center">23</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center">0</td> <td class="text-center">0</td>
<td class="text-center"> <td class="text-center">
<a onclick="showClassDetail('c17', 22)">Detail</a> <a onclick="showClassDetail('c17', 23)">Detail</a>
</td> </td>
</tr> </tr>
@ -2104,7 +2136,7 @@ AssertionError: False is not true : logfile config value is not empty after rese
<tr id='pt17.21' class='hiddenRow bg-success'> <tr id='pt17.21' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_user_email_available</div> <div class='testcase'>test_search_functions</div>
</td> </td>
<td colspan='6' align='center'>PASS</td> <td colspan='6' align='center'>PASS</td>
</tr> </tr>
@ -2112,6 +2144,15 @@ AssertionError: False is not true : logfile config value is not empty after rese
<tr id='pt17.22' class='hiddenRow bg-success'> <tr id='pt17.22' class='hiddenRow bg-success'>
<td>
<div class='testcase'>test_user_email_available</div>
</td>
<td colspan='6' align='center'>PASS</td>
</tr>
<tr id='pt17.23' class='hiddenRow bg-success'>
<td> <td>
<div class='testcase'>test_user_visibility_sidebar</div> <div class='testcase'>test_user_visibility_sidebar</div>
</td> </td>
@ -2122,10 +2163,10 @@ AssertionError: False is not true : logfile config value is not empty after rese
<tr id='total_row' class="text-center bg-grey"> <tr id='total_row' class="text-center bg-grey">
<td>Total</td> <td>Total</td>
<td>162</td> <td>183</td>
<td>147</td> <td>174</td>
<td>6</td>
<td>2</td> <td>2</td>
<td>0</td>
<td>7</td> <td>7</td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
@ -2154,13 +2195,13 @@ AssertionError: False is not true : logfile config value is not empty after rese
<tr> <tr>
<th>Platform</th> <th>Platform</th>
<td>Linux 5.5.16-1-MANJARO #1 SMP PREEMPT Wed Apr 8 10:07:00 UTC 2020 x86_64</td> <td>Linux 5.3.0-46-generic #38~18.04.1-Ubuntu SMP Tue Mar 31 04:17:56 UTC 2020 x86_64 x86_64</td>
<td>Basic</td> <td>Basic</td>
</tr> </tr>
<tr> <tr>
<th>Python</th> <th>Python</th>
<td>3.8.2</td> <td>3.7.5</td>
<td>Basic</td> <td>Basic</td>
</tr> </tr>
@ -2214,7 +2255,7 @@ AssertionError: False is not true : logfile config value is not empty after rese
<tr> <tr>
<th>requests</th> <th>requests</th>
<td>2.22.0</td> <td>2.23.0</td>
<td>Basic</td> <td>Basic</td>
</tr> </tr>
@ -2274,7 +2315,7 @@ AssertionError: False is not true : logfile config value is not empty after rese
</div> </div>
<script> <script>
drawCircle(147, 6, 2, 7); drawCircle(174, 2, 0, 7);
</script> </script>
</div> </div>