1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/jupyterhub/templates/patch_FUA.sh.j2.unused

17 lines
990 B
Text
Raw Normal View History

2021-09-03 23:13:48 +00:00
#!/bin/bash -x
# Apply 2 patches to firstuseauthenticator.py
# SITE_PACKAGES=$({{ jupyterhub_venv }}/bin/python -m site | grep {{ jupyterhub_venv }} | grep /site-packages | cut -d\' -f2)
SITE_PACKAGES=$({{ jupyterhub_venv }}/bin/getsite.py)
file=$SITE_PACKAGES/firstuseauthenticator/firstuseauthenticator.py
# e.g. /opt/iiab/jupyterhub/lib/python3.9/site-packages/firstuseauthenticator/firstuseauthenticator.py
# (1) Add await to asyncio change password function:
# https://github.com/iiab/iiab/issues/2918 == JupyterHub password-changing page shows "500 : Internal Server Error"
# https://github.com/jupyterhub/firstuseauthenticator/issues/36 == 500 Error on path /hub/auth/change-password
# https://github.com/jupyterhub/firstuseauthenticator/pull/37 == proposed fix to issue 36
sed -i 's/= self\.render/= await self.render/' $file
# (2) https://github.com/jupyterhub/firstuseauthenticator/pull/38 == lowercase username to lock password
sed -i "s/data\['username'\]$/&.lower()/" $file