Skip to content

Commit

Permalink
feat: use native TCP socket with Qrexec
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-grande committed Jun 24, 2024
1 parent 95289ed commit 4facf45
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 57 deletions.
2 changes: 1 addition & 1 deletion salt/sys-net/files/server/rpc/qusal.ConnectTCP
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ if test "${#port}" -gt 5 || test "${port}" -gt 65535; then
exit 1
fi

exec socat - "TCP:${host}:${port}"
exec socat STDIO "TCP:${host}:${port}"
7 changes: 0 additions & 7 deletions salt/sys-print/files/server/rpc/qusal.Print

This file was deleted.

9 changes: 9 additions & 0 deletions salt/sys-print/install-client.sls
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ SPDX-FileCopyrightText: 2024 Benjamin Grande M. S. <[email protected]>
SPDX-License-Identifier: AGPL-3.0-or-later
#}

"{{ slsdotpath }}-installed-client":
pkg.installed:
- require:
- sls: utils.tools.common.update
- install_recommends: False
- skip_suggestions: True
- pkgs:
- socat

"{{ slsdotpath }}-client-systemd-print-forwarder":
file.managed:
- name: /usr/lib/systemd/system/qusal-print-forwarder.service
Expand Down
15 changes: 12 additions & 3 deletions salt/sys-print/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,21 @@ include:
- user

"{{ slsdotpath }}-rpc":
file.managed:
file.symlink:
- name: /etc/qubes-rpc/qusal.Print
- source: salt://{{ slsdotpath }}/files/server/rpc/qusal.Print
- mode: '0755'
- target: /dev/tcp/127.0.0.1/631
- user: root
- group: root
- force: True
- makedirs: True

"{{ slsdotpath }}-rpc-config":
file.symlink:
- name: /etc/qubes/rpc-config/qusal.Print
- target: /etc/qubes/rpc-config/qubes.ConnectTCP
- user: root
- group: root
- force: True
- makedirs: True

"{{ slsdotpath }}-bind-dirs":
Expand Down
9 changes: 0 additions & 9 deletions salt/sys-rsync/files/server/rpc/qusal.Rsync

This file was deleted.

21 changes: 14 additions & 7 deletions salt/sys-rsync/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ include:
- skip_suggestions: True
- pkgs:
- rsync
- socat
- man-db

"{{ slsdotpath }}-stop-rsync":
Expand All @@ -42,14 +41,22 @@ include:
- group: root
- makedirs: True

"{{ slsdotpath }}-set-rpc-services":
file.recurse:
- name: /etc/qubes-rpc/
- source: salt://{{ slsdotpath }}/files/server/rpc/
- dir_mode: '0755'
- file_mode: '0755'
"{{ slsdotpath }}-rpc":
file.symlink:
- name: /etc/qubes-rpc/qusal.Rsync
- target: /dev/tcp/127.0.0.1/873
- user: root
- group: root
- force: True
- makedirs: True

"{{ slsdotpath }}-rpc-config":
file.symlink:
- name: /etc/qubes/rpc-config/qusal.Rsync
- target: /etc/qubes/rpc-config/qubes.ConnectTCP
- user: root
- group: root
- force: True
- makedirs: True

{% endif -%}
9 changes: 0 additions & 9 deletions salt/sys-ssh/files/server/rpc/qusal.Ssh

This file was deleted.

21 changes: 14 additions & 7 deletions salt/sys-ssh/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ include:
- skip_suggestions: True
- pkgs:
- openssh-server
- socat
- man-db

"{{ slsdotpath }}-stop-ssh":
Expand All @@ -33,14 +32,22 @@ include:
service.masked:
- name: ssh

"{{ slsdotpath }}-set-rpc-services":
file.recurse:
- name: /etc/qubes-rpc/
- source: salt://{{ slsdotpath }}/files/server/rpc/
- dir_mode: '0755'
- file_mode: '0755'
"{{ slsdotpath }}-rpc":
file.symlink:
- name: /etc/qubes-rpc/qusal.Ssh
- target: /dev/tcp/127.0.0.1/22
- user: root
- group: root
- force: True
- makedirs: True

"{{ slsdotpath }}-rpc-config":
file.symlink:
- name: /etc/qubes/rpc-config/qusal.Ssh
- target: /etc/qubes/rpc-config/qubes.ConnectTCP
- user: root
- group: root
- force: True
- makedirs: True

"{{ slsdotpath }}-sshd-config":
Expand Down
9 changes: 0 additions & 9 deletions salt/sys-syncthing/files/server/rpc/qusal.Syncthing

This file was deleted.

18 changes: 13 additions & 5 deletions salt/sys-syncthing/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,26 @@ include:
- qubes-core-agent-networking
- syncthing
- jq
- socat
- qubes-core-agent-thunar
- thunar
- man-db

"{{ slsdotpath }}-rpc-service":
file.managed:
"{{ slsdotpath }}-rpc":
file.symlink:
- name: /etc/qubes-rpc/qusal.Syncthing
- source: salt://{{ slsdotpath }}/files/server/rpc/qusal.Syncthing
- target: /dev/tcp/127.0.0.1/22000
- user: root
- group: root
- force: True
- makedirs: True

"{{ slsdotpath }}-rpc-config":
file.symlink:
- name: /etc/qubes/rpc-config/qusal.Syncthing
- target: /etc/qubes/rpc-config/qubes.ConnectTCP
- user: root
- group: root
- mode: '0755'
- force: True
- makedirs: True

"{{ slsdotpath }}-mask-syncthing":
Expand Down

0 comments on commit 4facf45

Please sign in to comment.