Qubes print server

This commit is contained in:
unman 2021-02-11 15:38:08 +00:00
parent 0dfc769ac4
commit c1dc5c418e
No known key found for this signature in database
GPG Key ID: FDD1B8244731B36C
6 changed files with 65 additions and 0 deletions

15
print/configure.sls Normal file
View File

@ -0,0 +1,15 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
/rw/config/qubes-bind-dirs.d/50_user.conf:
file.append:
- text: |
binds+=( '/etc/cups/printers.conf' )
binds+=( '/etc/qubes-rpc/qubes.Print' )
- makedirs: True
/rw/bind-dirs/etc/qubes-rpc/qubes.Print:
file.append:
- text: |
#!/bin/sh
exec socat STDIO TCP:localhost:631
- makedirs: True

5
print/configure.top Normal file
View File

@ -0,0 +1,5 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
base:
printer:
- print.configure

23
print/create.sls Normal file
View File

@ -0,0 +1,23 @@
qvm-present-id:
qvm.present:
- name: printer
- template: debian-10
- label: gray
qvm-prefs-id:
qvm.prefs:
- name: printer
- netvm: sys-firewall
qvm-features-id:
qvm.features:
- name: printer
- disable:
- service.cups-browsed
- enable:
- service.cups
update_file:
file.prepend:
- name: '/etc/qubes-rpc/policy/qubes.Print'
- text: '@anyvm @anyvm ask,default_target=printer'

4
print/create.top Normal file
View File

@ -0,0 +1,4 @@
base:
dom0:
- match: nodegroup
- print.create

13
print/print_client.sls Normal file
View File

@ -0,0 +1,13 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
/rw/config/rc.local:
file.append:
- text: |
socat TCP4-LISTEN:9100,reuseaddr,fork EXEC:"qrexec-client-vm print qubes.Print"
/home/user/.cups/client.conf:
file.append:
- text: |
Servername 127.0.0.1:9100
- makedirs: True

5
print/print_client.top Normal file
View File

@ -0,0 +1,5 @@
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
base:
'*':
- print.print_client