feat(hip): manage reports and script execution

This commit is contained in:
Kevin Yue committed 2026-09-29 11:43:54 +08:00
1 parent 24d935ea61
commit 739cf7234b
54 files changed
+3122 -967

No files matched your search

+4
View File
@@ -3,6 +3,8 @@ install:
install -Dm755 artifacts/usr/bin/gpclient $(DESTDIR)/usr/bin/gpclient
install -Dm755 artifacts/usr/bin/gpservice $(DESTDIR)/usr/bin/gpservice
install -Dm755 artifacts/usr/libexec/gpclient/gp-hip-runner $(DESTDIR)/usr/libexec/gpclient/gp-hip-runner
install -Dm755 artifacts/usr/libexec/gpclient/gp-hip-script-installer $(DESTDIR)/usr/libexec/gpclient/gp-hip-script-installer
install -Dm755 artifacts/usr/bin/gpauth $(DESTDIR)/usr/bin/gpauth
install -Dm755 artifacts/usr/bin/gpgui-helper $(DESTDIR)/usr/bin/gpgui-helper
@@ -37,6 +39,8 @@ uninstall:
rm -f $(DESTDIR)/usr/bin/gpclient
rm -f $(DESTDIR)/usr/bin/gpservice
rm -f $(DESTDIR)/usr/libexec/gpclient/gp-hip-runner
rm -f $(DESTDIR)/usr/libexec/gpclient/gp-hip-script-installer
rm -f $(DESTDIR)/usr/bin/gpauth
rm -f $(DESTDIR)/usr/bin/gpgui-helper
rm -f $(DESTDIR)/usr/bin/gpgui
+11
View File
@@ -26,4 +26,15 @@
<annotate key="org.freedesktop.policykit.exec.path">/usr/local/libexec/gpclient/gp-vpnc-script-installer</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
<action id="com.yuezk.gpgui.manage-root-hip-script">
<description>Approve a GP Connect HIP script to run as root</description>
<message>Administrator authentication is required to run a HIP script as root</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/local/libexec/gpclient/gp-hip-script-installer</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>
@@ -1,7 +1,6 @@
#!/bin/sh
# Wrapper for gpclient hip
LOGFILE="/tmp/gpclient-hipreport.log"
LINUX_GPCLIENT_BIN="/usr/bin/gpclient"
ARM64_HOMEBREW_GPCLIENT_BIN="/opt/homebrew/bin/gpclient"
@@ -15,11 +14,8 @@ elif [ -x "$ARM64_HOMEBREW_GPCLIENT_BIN" ]; then
elif [ -x "$LOCAL_GPCLIENT_BIN" ]; then
GPCLIENT_BIN="$LOCAL_GPCLIENT_BIN"
else
echo "Error: gpclient binary not found." > "$LOGFILE"
echo "Error: gpclient binary not found." >&2
exit 1
fi
# Redirect the output to a file for debugging then output to stdout
HIP_REPORT_OUTPUT=$(exec 2> "$LOGFILE" "$GPCLIENT_BIN" hip -vv "$@")
echo "$HIP_REPORT_OUTPUT"
exec "$GPCLIENT_BIN" hip "$@"
@@ -26,4 +26,15 @@
<annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/gpclient/gp-vpnc-script-installer</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
<action id="com.yuezk.gpgui.manage-root-hip-script">
<description>Approve a GP Connect HIP script to run as root</description>
<message>Administrator authentication is required to run a HIP script as root</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/libexec/gpclient/gp-hip-script-installer</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>
@@ -73,6 +73,8 @@ make build
%{_bindir}/*
%{_libexecdir}/gpclient/vpnc-script
%{_libexecdir}/gpclient/hipreport.sh
%{_libexecdir}/gpclient/gp-hip-runner
%{_libexecdir}/gpclient/gp-hip-script-installer
%{_libexecdir}/gpclient/gp-vpnc-script-installer
%{_datadir}/applications/gpgui.desktop
%{_datadir}/icons/hicolor/32x32/apps/gpgui.png