park4night's login: Firefox's session store (there's no remember me), kept alive every 15 min; the plugin and its timer now in home-gitops
This commit is contained in:
1 parent
462303eed6
commit
5998fdfe88
1 file changed
+12
-23
+12
-23
@@ -197,32 +197,21 @@ Its `.env` adds:
|
||||
|
||||
The private p4n2gpx plugin (`data/plugins/p4n2gpx/`) borrows a logged-in
|
||||
browser's cookies (park4night's login is behind reCAPTCHA). Log in once in
|
||||
Firefox on the Pi as `randy` ("remember me" ticked; on its screen or over
|
||||
remote desktop). A timer on the host runs the plugin's `firefox_cookie.py`
|
||||
as that user: it copies only park4night.com's cookies into
|
||||
Firefox on the Pi as `randy` (on its screen or over remote desktop) and
|
||||
leave it logged in: there's no "remember me", the login is only the
|
||||
PHPSESSID session cookie, which Firefox keeps in its session store rather
|
||||
than in `cookies.sqlite`. A timer on the host runs the plugin's
|
||||
`firefox_cookie.py` as that user: it copies only park4night.com's cookies
|
||||
(both stores; profiles in `~/.config/mozilla/firefox` or `~/.mozilla/firefox`) into
|
||||
`data/plugins/p4n2gpx/firefox-cookie` (mode 600). The profile itself (every
|
||||
synced password, every site's cookies) is never mounted into the container.
|
||||
Every 15 min it also asks park4night with them, which keeps the session
|
||||
alive; once park4night refuses it, it stops asking until the next login.
|
||||
|
||||
----
|
||||
# /etc/systemd/system/p4n-cookie.service
|
||||
[Unit]
|
||||
Description=park4night cookies from Firefox for maptool's p4n2gpx plugin
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=randy
|
||||
ExecStart=/usr/bin/python3 -I /srv/podman/maptool/data/plugins/p4n2gpx/firefox_cookie.py
|
||||
|
||||
# /etc/systemd/system/p4n-cookie.timer
|
||||
[Unit]
|
||||
Description=park4night cookies from Firefox every 15 min
|
||||
[Timer]
|
||||
OnBootSec=2min
|
||||
OnUnitActiveSec=15min
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
----
|
||||
|
||||
`systemctl daemon-reload && systemctl enable --now p4n-cookie.timer`.
|
||||
The plugin, `p4n-cookie.service` and `p4n-cookie.timer` live in the private
|
||||
home-gitops repo (`ansible/files/p4n2gpx/`), not here: its
|
||||
`deploy-p4n2gpx` workflow runs `ansible/playbooks/p4n2gpx.yaml` against
|
||||
the Pi on every change.
|
||||
|
||||
=== Updates (a button, not CI)
|
||||
|
||||
|
||||
Reference in new issue
Block a user