Taildrop to Downloads, exit nodes past captive portals, stay awake

Ports the rest of CoreDesktop's 9dc5eb1 that applies to Pop!_OS.

- configure tailscale turns on federated-connector-taildrop.service,
  which saves files sent here with Taildrop to Downloads and says so in
  a notification. COSMIC Files has no Scripts menu, so CoreDesktop's
  "Send with Tailscale" isn't ported; send with tailscale file cp.
  Leaving the network turns it off.
- It also installs a NetworkManager dispatcher script that stops using a
  Tailscale exit node while you sign in to a captive portal, and uses it
  again once online. Pop!_OS checks connectivity (20-connectivity-pop),
  so NetworkManager sees the portal.
- A computer joined before this shows Tailscale as to do, and configure
  tailscale adds both without signing in again. update restarts the
  Taildrop service on the new version, as it does the email watcher.
- install.sh keeps the computer from sleeping until an install or update
  finishes.

The pacman guard, unowned files and hardware.sh are Arch only.

Smoketest: 75-taildrop-portal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-28 19:06:31 -07:00
co-authored by Claude Opus 5.5
parent 7185d6cb3e
commit 0eff0c70d3
10 changed files with 265 additions and 19 deletions
+17 -4
View File
@@ -190,7 +190,7 @@ put_on_path() {
}
# The services configure set up run from copies of system/systemd's units;
# bring those up to date, and restart the email watcher on the new version
# bring those up to date, and restart the ones running on the new version
refresh_units() {
local unit changed=0
for unit in "$CONNECTOR"/system/systemd/*; do
@@ -199,15 +199,28 @@ refresh_units() {
cp "$unit" "$UNITS/" && changed=1
done
[ $changed -eq 1 ] && systemctl --user daemon-reload 2> /dev/null
if systemctl --user is-active -q federated-connector-email-watch.service 2> /dev/null; then
systemctl --user restart federated-connector-email-watch.service 2> /dev/null
fi
for unit in federated-connector-email-watch.service federated-connector-taildrop.service; do
if systemctl --user is-active -q "$unit" 2> /dev/null; then
systemctl --user restart "$unit" 2> /dev/null
fi
done
return 0
}
# Keep the computer from suspending, from idle or a closed lid, until this
# exits, so an install isn't left half done. tail exits with it, and that ends
# the inhibitor.
stay_awake() {
command -v systemd-inhibit > /dev/null || return 0
systemd-inhibit --what=sleep:idle --who="Federated Connector" --mode=block \
--why="$([ "$1" -eq 1 ] && echo Updating || echo Installing) Federated Connector" \
tail --pid=$$ -f /dev/null > /dev/null 2>&1 &
}
main() {
local update=0 installed latest log
[ "$1" = --update ] && update=1
stay_awake $update
mkdir -p "$LOG_DIR" && log="$LOG_DIR/$([ $update -eq 1 ] && echo update || echo install)-$(date +%Y-%m-%d-%H%M%S).log"
[ -n "$log" ] && exec > >(tee -a "$log") 2>&1