release(v2.0.1): fix version CLI reporting, secrets access permissions, and tray companion autostart

This commit is contained in:
2026-08-09 14:46:19 -04:00
parent a3a21c3884
commit 775878437e
3 changed files with 48 additions and 13 deletions
+7
View File
@@ -5,6 +5,13 @@ All notable changes to the `theta-agent` daemon will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.0.1] - 2026-08-09
### Fixed
- **CLI version reporting**: Expose correct version string (`v2.0.0` / `AgentVersion`) dynamically via CLI command flags.
- **Secrets access for non-root users**: Configure `theta-secrets` and `theta` groups with appropriate directory permissions (`0750` / `0640` on `/etc/theta42/agent.yml`) to allow authorized non-root users to retrieve secrets.
- **Autostart Tray Icon Companion**: Install tray icon companion app and configure `/etc/xdg/autostart/theta-agent-tray.desktop` entry for desktop environments.
## [v2.0.0] - 2026-08-09 ## [v2.0.0] - 2026-08-09
### Added ### Added
+1 -1
View File
@@ -32,7 +32,7 @@ func handleCLI(args []string) bool {
runReinitialize(args[1:]) runReinitialize(args[1:])
return true return true
case "--version", "version", "-v": case "--version", "version", "-v":
fmt.Println("Theta Agent v1.7.0") fmt.Println("Theta Agent " + AgentVersion)
return true return true
case "--help", "help", "-h": case "--help", "help", "-h":
printUsage() printUsage()
+40 -12
View File
@@ -174,20 +174,48 @@ EOF
else else
log "Preserving existing configuration at $CONFIG_FILE" log "Preserving existing configuration at $CONFIG_FILE"
fi fi
chmod 600 "$CONFIG_FILE" # Ensure theta-secrets & theta groups exist for non-root secret access
log "Configuring non-root secret access groups (theta-secrets)..."
# An agent with no public_key cannot verify signed commands and will refuse if command -v groupadd >/dev/null 2>&1; then
# every one of them. That is the safe default, but it is silent at run time, so getent group theta-secrets >/dev/null 2>&1 || groupadd -r theta-secrets 2>/dev/null || true
# say it plainly here where the operator is watching. getent group theta >/dev/null 2>&1 || groupadd -r theta 2>/dev/null || true
if ! grep -qE '^public_key:[[:space:]]*"[^"]+"' "$CONFIG_FILE" 2>/dev/null; then
log "WARNING: no public_key configured — this agent will report telemetry but"
log " REFUSE reboot / configure_ldap / arbitrary_bash / update_binary."
log " Re-run with --public-key \"<base64 key>\" (shown at enrollment)."
fi fi
SECRETS_GROUP="root"
if getent group theta-secrets >/dev/null 2>&1; then
SECRETS_GROUP="theta-secrets"
elif getent group theta >/dev/null 2>&1; then
SECRETS_GROUP="theta"
fi
chown -R "root:$SECRETS_GROUP" "$CONFIG_DIR" 2>/dev/null || true
chmod 750 "$CONFIG_DIR"
chmod 640 "$CONFIG_FILE"
# 4b. Ensure SSSD dependencies are installed if configure_ldap is enabled # 4c. Setup Desktop Tray Icon companion
if [ "$INSTALL_SSSD" -eq 1 ] || grep -qE -i 'configure_ldap:[[:space:]]*true' "$CONFIG_FILE" 2>/dev/null; then TRAY_BINARY_NAME="theta-agent-tray-${OS_NAME}-${ARCH_NAME}"
install_sssd_deps case "$OS_NAME" in
linux*) TRAY_BINARY_NAME="theta-agent-tray-linux-amd64" ;;
windows*) TRAY_BINARY_NAME="theta-agent-tray-windows-amd64.exe" ;;
esac
TRAY_BIN_PATH="/usr/local/bin/theta-agent-tray"
TRAY_URL="https://github.com/theta42/theta-agent/releases/latest/download/${TRAY_BINARY_NAME}"
log "Attempting to install desktop tray companion ($TRAY_BINARY_NAME)..."
if curl -fsSL "$TRAY_URL" -o "$TRAY_BIN_PATH.tmp" 2>/dev/null; then
chmod +x "$TRAY_BIN_PATH.tmp"
mv -f "$TRAY_BIN_PATH.tmp" "$TRAY_BIN_PATH"
mkdir -p /etc/xdg/autostart
cat <<EOF > /etc/xdg/autostart/theta-agent-tray.desktop
[Desktop Entry]
Type=Application
Name=Theta Agent Tray
Comment=Theta Agent Desktop Tray Companion
Exec=/usr/local/bin/theta-agent-tray
Icon=network-workgroup
Terminal=false
Categories=Utility;System;
X-GNOME-Autostart-enabled=true
EOF
log "Desktop tray companion installed at $TRAY_BIN_PATH with autostart."
fi fi
# 5. Setup systemd service # 5. Setup systemd service