Tuesday, September 3, 2019

Miscellaneous

I continued to work in the cg and in the Developer Guide as a preparation for the year 2020.

I read this started to try to use a Belgian phone number. Our new number in Belgium will be +32 43460150 (but it is still experimental and might change). The biggest problem will be to find a legal person in Belgium who is willing to act as representative.

Running Lino on Debian 10 (buster)

I continued with Hamza on #3095. We can already conclude that getlino has finished its work and has done a good job. Okay it doesn’t yet create a bash_aliases file. But anyway that’s maybe just a personal preference for me.

It took us some time to get my browser to open the new website through the SSH tunnel. TIL : When I changed something in the settings.py file, I must now restart supervisor instead of restarting the web browser.

Tidy 5.2 cleaned up curly quotes but 5.6 doesn’t

We still have the following error message during pm prep:

Exception: Errors while processing <p class=“Default“>Herrn Albert ADAM</p>

I opened #3188 for this.

This is obviously a bug in the contacts/Person/TermsConditions.odt template (in lino_xl.lib.contacts). That file contains the following appy statement:

do text
from html(u'<p class=“Default“>'+this.owner.get_address('<br>')+u'</p>')

The string passed to lino_xl.lib.appy.AppyRenderer.insert_html() accidentally contains curly quotes instead of straight quotes.

The actual work happens in lino.utils.html2xtml which says:

from tidylib import tidy_fragment

def html2xhtml(html, **options):
    options.update(doctype='omit')
    options.update(show_warnings=0)
    options.update(indent=0)
    # options.update(output_xml=1)
    options.update(output_xhtml=1)
    document, errors = tidy_fragment(html, options=options)

I might open the document in libreoffice, replace the curly quotes by straight ones, make a release of xl and update their environment.

But my problem is that we didn’t have this problem before. The demo2 fixture of lino_xl.lib.excerpts successfully creates the file media/cache/appypdf/excerpts.Excerpt-2.pdf which comes from above template.

It seems that tiny successfully parses those curly quotes on my machine (and on travis, and on other machines) and that it doesn’t like them any more on the new server. Yes, this is our first usage of Debian 10. We checked whether tidy has some option to control this behaviour http://tidy.sourceforge.net/docs/quickref.html

On Debian 9 we have HTML Tidy version 5.2.0, while on Debian 10 it is 5.6.0. This seems the relevant difference.

Edit 20190904: I asked the HTACG for advice: https://github.com/htacg/tidy-html5/issues/841

Configuring LDAP authentication

LDAP authentication is now done using nginx and django-auth-ldap instead of apache and mod_wsgi. So it is no longer done by the browser using plain http auth. Plain http auth is obsolete and has the disadvantage that you cannot sign out without leaving the browser and cannot remain signed in when leaving the browser.

But surprise: LDAP is more complex than Hamza and I thought. We tried to migrate the LDAP options from the Apache configuration to the settings.py file, as demonstrated in the lino_book.projects.team.settings.demo. But we decided to give up and ask somebody who knows how to configure LDAP server. Nicolas, Steve or Gerd.

Here are the docs for django-auth-ldap: - https://django-auth-ldap.readthedocs.io/en/latest/authentication.html - https://django-auth-ldap.readthedocs.io/en/latest/example.html