ci: bump Go-1.23
all: migrate to codeberg.org/emersion/go-scfg
cmd/uca-print-cfg: first import
uca-print
is a set of tools to print documents from the command-line.
$> go install git.sr.ht/~sbinet/uca-print/cmd/uca-print
$> uca-print -h
Usage: uca-print [options] file1.pdf [file2.odt [...]]
ex:
$> uca-print ./file1.pdf
$> uca-print -u username ./file1.pdf ./file2.pdf
$> uca-print -u username -p s3cr3t ./file1.pdf ./file2.pdf
options:
-p string
password for papercut
-t duration
timeout for sending files to print (default 20s)
-u string
username for papercut
$> uca-print ./f1.pdf ./f2.pdf
uca-print: file: [ERR] "f1.pdf": Disallowed paper size: submission error
uca-print: file: [ OK] "f2.pdf"
$> echo $?
1
Credentials for uca-print
can also be stored in $HOME/.config/uca-print/auth.cfg
:
$> cat ~/.config/uca-print/auth.cfg
user my-username
cred-cmd some authentication command # optional.
cred-cmd
would typically point at, e.g.:
cred-cmd pass uca.fr/me
uca-print-srv
uca-print
also provides a REST-like server that can forward printing requests:
$> go install git.sr.ht/~sbinet/uca-print/cmd/uca-print-srv
$> uca-print-srv -addr :8080 -cert ./cert/server.crt -priv ./cert/server.key
and, in another terminal:
$> curl -X POST \
-k ## to allow self-signed certificates \
-u username:s3cr3t \
--form file='@path-to-file1.pdf' \
--form file='@path-to-file2.pdf' \
--form file='@path-to-file3.pdf' \
https://localhost:8080