handoff

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package handoff gives a browser a URL that carries an access token without putting the token on a command line.

The local pages of `remohop web`, quick support and the desktop viewer are reached through URLs that contain an access token. The argument list of the program that opens a browser (xdg-open, open, the browser itself) can be read by every local user on Unix, so the browser is pointed at a private file (mode 0600 in a 0700 directory) that only redirects to the URL, and the file is removed soon after.

The file must be somewhere the browser can read. Browsers packaged as a Snap or a Flatpak (Firefox and Chromium on Ubuntu are Snaps) run in a sandbox that cannot read hidden directories under the home directory, such as ~/.config, where RemoHop keeps its state. For those, the file goes into the sandbox's own private directory instead (see Dir).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(browser string) (string, error)

Dir is the directory for a handoff file that browser will open. browser is the path of the browser program, or empty for the user's default browser (opened through xdg-open, open or the shell). It is the RemoHop run directory, except for sandboxed (Snap or Flatpak) browsers on Linux, which get a directory inside their sandbox.

REMOHOP_HANDOFF_DIR overrides the choice (for unusual sandboxes, and for tests that must not look at the real desktop's browser).

func Page

func Page(url, text string) string

Page is a self-contained HTML page that forwards to url, showing text while it does.

func Sweep

func Sweep(dir string)

Sweep removes handoff files in dir that a crashed or killed process left behind. Only regular files named like handoff files and older than a few minutes are touched.

func Write

func Write(dir, kind, page string) (path string, remove func(), err error)

Write creates a new handoff file in dir holding page and returns its path and a function that removes it. kind is part of the file name ("web", "quick", "desktop"), for people who look at the directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL