Skip to content

Commit b78279d

Browse files
committed
Add flatpak update notification and auto proxy config
Automatic proxy config for flatpak in TemplateVMs. Notify dom0 if system-wide (in TemplateVM) flatpaks are outdated. A separate patch to `qubes-core-admin-linux` & `vmupdate` will enable easy update of (in Template) flatpaks via the updater. related: QubesOS/qubes-issues#2766
1 parent 6034fe1 commit b78279d

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

network/update-proxy-configs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,26 @@ RSYNC_PROXY=\"${PROXY_ADDR_BASE}\""
191191
update_conf /etc/hosts ""
192192
fi
193193
fi
194+
195+
# Flatpak
196+
if [ -f /usr/bin/flatpak ]; then
197+
if [ -n "$PROXY_ADDR" ]; then
198+
mkdir -p /run/qubes/bin
199+
cat > /run/qubes/bin/flatpak <<EOF
200+
#!/bin/bash
201+
### This file is automatically generated by Qubes ($0 script).
202+
### All modifications here will be lost.
203+
all_proxy="$PROXY_ADDR" \\
204+
/usr/bin/flatpak "\$@"
205+
EOF
206+
chmod +x /run/qubes/bin/flatpak
207+
cat > /etc/profile.d/qubes-flatpak-proxy.sh << EOF
208+
### This file is automatically generated by Qubes ($0 script).
209+
### All modifications here will be lost.
210+
export PATH=/run/qubes/bin:\$PATH
211+
EOF
212+
else
213+
rm -f /run/qubes/bin/flatpak
214+
rm -f /etc/profile.d/qubes-flatpak-proxy.sh
215+
fi
216+
fi

package-managers/upgrades-status-notify

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ fi
2121

2222
upgrades_installed="$(/usr/lib/qubes/upgrades-installed-check $script_arg)"
2323

24+
if [ "$upgrades_installed" = "true" ] && [ -f "/usr/bin/flatpak" ]; then
25+
for remote in "$(flatpak remotes --columns name)"; do
26+
if [ -n "$(flatpak remote-ls --system --updates $remote)" ]; then
27+
upgrades_installed="false"
28+
break
29+
fi
30+
done
31+
fi
32+
2433
if [ "$upgrades_installed" = "true" ]; then
2534
/usr/lib/qubes/qrexec-client-vm dom0 qubes.NotifyUpdates /bin/sh -c 'echo 0'
2635
elif [ "$upgrades_installed" = "false" ]; then

0 commit comments

Comments
 (0)