From 5998fdfe883f211b40f4bd5e8d76a3f94de633e5 Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Sat, 5 Dec 2026 17:14:51 +0100 Subject: [PATCH] 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 --- docs/deployment.adoc | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/docs/deployment.adoc b/docs/deployment.adoc index ea19baa..33aab11 100644 --- a/docs/deployment.adoc +++ b/docs/deployment.adoc @@ -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)