#!/usr/bin/env python3
from pathlib import Path
from datetime import datetime
p=Path('/srv/apps/sotlab-users/sotlab_users_app.py')
s=p.read_text()
bak=p.with_name(p.name + '.bak.public-chrome.' + datetime.now().strftime('%Y%m%d%H%M%S'))
bak.write_text(s)
s=s.replace('<span>Sot Lab Users</span>', '<span>Sot Lab</span>')
s=s.replace('<a href="/">Enrol profile</a><a href="/users">Profiles</a><a href="/passwords">SSO passwords</a><a href="https://sotlab.co.uk/">Portal</a><a href="https://status.sotlab.co.uk/">Status</a>', '<a href="https://sotlab.co.uk/">Portal</a><a href="https://music.sotlab.co.uk/">Music</a><a href="https://status.sotlab.co.uk/">Status</a><a href="https://users.sotlab.co.uk/">Profiles</a>')
s=s.replace('<footer class="shell">Admin-only enrolment. Do not collect user passwords here.</footer>', '<footer class="shell">Sot Lab · Private profile-gated services · Cloudflare Tunnel front door.</footer>')
p.write_text(s)
print(f'backup={bak}')
