On 2023-12-07, Rip Van SpaceDock awoke to discover the world changed around him. Formerly working and supported Python modules no longer loaded:
Flask-Markdown threw an exception at loading because flask no longer exports Markup
flask.json no longer exports JSONEncoder
flask_oauthlib.client had a similar problem that I didn't capture, and all of the OAuth stuff wasn't being used anyway.
This was hacked around by live-editing lib/python3.10/site-packages/flaskext/markdown.py in production 🤮.
From the description, it sounds likely that this broke some part of the site that we don't know about yet.
Motivation
The KSP forum's user profile link format changed (/index.php? was dropped), so recently posted URLs aren't rendered as name-and-link as they are supposed to be.
Changes
Now the Dockerfile builds for Python 3.10 instead of 3.8, because this is what's current in Ubuntu LTS
Now we make our own markdown filter from the standard module instead of using Flask-Markdown. As a bonus, the underlying converter is now shared with common.render_markdown (which previously didn't support emojis), so the format will now be reliably consistent.
Now all the unused OAuth stuff is deleted
Now we use json.JSONEncoder instead of flask.json.JSONEncoder
The docker compose file is updated to no longer mount /dev/log because this is OS-specific and was breaking on Windows
The forum profile parser is updated to support the new format in addition to the old
I'll probably just merge this to keep things moving along...
Problems
On 2023-12-07, Rip Van SpaceDock awoke to discover the world changed around him. Formerly working and supported Python modules no longer loaded:
flask
no longer exportsMarkup
flask.json
no longer exportsJSONEncoder
flask_oauthlib.client
had a similar problem that I didn't capture, and all of the OAuth stuff wasn't being used anyway.This was hacked around by live-editing
lib/python3.10/site-packages/flaskext/markdown.py
in production 🤮. From the description, it sounds likely that this broke some part of the site that we don't know about yet.Motivation
The KSP forum's user profile link format changed (
/index.php?
was dropped), so recently posted URLs aren't rendered as name-and-link as they are supposed to be.Changes
markdown
filter from the standard module instead of using Flask-Markdown. As a bonus, the underlying converter is now shared withcommon.render_markdown
(which previously didn't support emojis), so the format will now be reliably consistent.json.JSONEncoder
instead offlask.json.JSONEncoder
/dev/log
because this is OS-specific and was breaking on WindowsI'll probably just merge this to keep things moving along...