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
|
The private p4n2gpx plugin (`data/plugins/p4n2gpx/`) borrows a logged-in
|
||||||
browser's cookies (park4night's login is behind reCAPTCHA). Log in once 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
|
Firefox on the Pi as `randy` (on its screen or over remote desktop) and
|
||||||
remote desktop). A timer on the host runs the plugin's `firefox_cookie.py`
|
leave it logged in: there's no "remember me", the login is only the
|
||||||
as that user: it copies only park4night.com's cookies into
|
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
|
`data/plugins/p4n2gpx/firefox-cookie` (mode 600). The profile itself (every
|
||||||
synced password, every site's cookies) is never mounted into the container.
|
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.
|
||||||
|
|
||||||
----
|
The plugin, `p4n-cookie.service` and `p4n-cookie.timer` live in the private
|
||||||
# /etc/systemd/system/p4n-cookie.service
|
home-gitops repo (`ansible/files/p4n2gpx/`), not here: its
|
||||||
[Unit]
|
`deploy-p4n2gpx` workflow runs `ansible/playbooks/p4n2gpx.yaml` against
|
||||||
Description=park4night cookies from Firefox for maptool's p4n2gpx plugin
|
the Pi on every change.
|
||||||
[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`.
|
|
||||||
|
|
||||||
=== Updates (a button, not CI)
|
=== Updates (a button, not CI)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user