From 6d899be8ea04b9ed49eda6c4894353ba5b470a3f Mon Sep 17 00:00:00 2001 From: Victor Wildner Date: Tue, 11 Nov 2025 20:04:54 +0100 Subject: [PATCH] chore(release): bump version to 1.2.1 - Updated version number in Cargo.toml files for akon and akon-core - Enhanced post-installation scripts to include warnings for missing commands - Improved sudoers configuration to allow command execution without password --- Cargo.toml | 2 +- akon-core/Cargo.toml | 2 +- debian/postinst | 33 ++++++++++++++++++++++++--------- rpm/post-install.sh | 33 ++++++++++++++++++++++++--------- 4 files changed, 50 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5ee2cf0..56c0db7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ resolver = "2" [package] name = "akon" -version = "1.2.0" +version = "1.2.1" edition = "2021" authors = ["vcwild"] description = "A CLI tool for managing VPN connections with OpenConnect" diff --git a/akon-core/Cargo.toml b/akon-core/Cargo.toml index e55d04b..2921976 100644 --- a/akon-core/Cargo.toml +++ b/akon-core/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "akon-core" -version = "1.2.0" +version = "1.2.1" [features] default = [] diff --git a/debian/postinst b/debian/postinst index 024c40a..47280d1 100644 --- a/debian/postinst +++ b/debian/postinst @@ -4,9 +4,24 @@ set -e # Post-installation script for akon # Configures passwordless sudo for required commands -OPENCONNECT_PATH=$(command -v openconnect) -PKILL_PATH=$(command -v pkill) -KILL_PATH=$(command -v kill || echo "/usr/bin/kill") +# Find command paths +OPENCONNECT_PATH=$(command -v openconnect 2>/dev/null || echo "") +PKILL_PATH=$(command -v pkill 2>/dev/null || echo "") +KILL_PATH=$(command -v kill 2>/dev/null || echo "/usr/bin/kill") + +# Verify paths exist +if [ -z "$OPENCONNECT_PATH" ]; then + echo "Warning: openconnect not found. Please install it: sudo apt install openconnect" + OPENCONNECT_PATH="/usr/sbin/openconnect" +fi + +if [ -z "$PKILL_PATH" ]; then + PKILL_PATH="/usr/bin/pkill" +fi + +if [ ! -f "$KILL_PATH" ]; then + KILL_PATH="/usr/bin/kill" +fi # Create sudoers.d file for akon SUDOERS_FILE="/etc/sudoers.d/akon" @@ -14,9 +29,9 @@ SUDOERS_FILE="/etc/sudoers.d/akon" cat > "$SUDOERS_FILE" << EOF # Allow all users to run akon-required commands without password # This file is automatically managed by the akon package -ALL ALL=(ALL) NOPASSWD: $OPENCONNECT_PATH -ALL ALL=(ALL) NOPASSWD: $PKILL_PATH -ALL ALL=(ALL) NOPASSWD: $KILL_PATH +ALL ALL=(ALL) NOPASSWD: $OPENCONNECT_PATH * +ALL ALL=(ALL) NOPASSWD: $PKILL_PATH * +ALL ALL=(ALL) NOPASSWD: $KILL_PATH * EOF # Set proper permissions on sudoers file @@ -31,9 +46,9 @@ fi echo "akon has been installed successfully!" echo "The following commands are now available without sudo password:" -echo " - openconnect" -echo " - pkill" -echo " - kill" +echo " - openconnect ($OPENCONNECT_PATH)" +echo " - pkill ($PKILL_PATH)" +echo " - kill ($KILL_PATH)" echo "" echo "Run 'akon --help' to get started." diff --git a/rpm/post-install.sh b/rpm/post-install.sh index f0f9acd..3c77387 100644 --- a/rpm/post-install.sh +++ b/rpm/post-install.sh @@ -2,9 +2,24 @@ # RPM post-installation script for akon # Configures passwordless sudo for required commands -OPENCONNECT_PATH=$(command -v openconnect) -PKILL_PATH=$(command -v pkill) -KILL_PATH=$(command -v kill || echo "/usr/bin/kill") +# Find command paths +OPENCONNECT_PATH=$(command -v openconnect 2>/dev/null || echo "") +PKILL_PATH=$(command -v pkill 2>/dev/null || echo "") +KILL_PATH=$(command -v kill 2>/dev/null || echo "/usr/bin/kill") + +# Verify paths exist +if [ -z "$OPENCONNECT_PATH" ]; then + echo "Warning: openconnect not found. Please install it: sudo dnf install openconnect" + OPENCONNECT_PATH="/usr/sbin/openconnect" +fi + +if [ -z "$PKILL_PATH" ]; then + PKILL_PATH="/usr/bin/pkill" +fi + +if [ ! -f "$KILL_PATH" ]; then + KILL_PATH="/usr/bin/kill" +fi # Create sudoers.d file for akon SUDOERS_FILE="/etc/sudoers.d/akon" @@ -12,9 +27,9 @@ SUDOERS_FILE="/etc/sudoers.d/akon" cat > "$SUDOERS_FILE" << EOF # Allow all users to run akon-required commands without password # This file is automatically managed by the akon package -ALL ALL=(ALL) NOPASSWD: $OPENCONNECT_PATH -ALL ALL=(ALL) NOPASSWD: $PKILL_PATH -ALL ALL=(ALL) NOPASSWD: $KILL_PATH +ALL ALL=(ALL) NOPASSWD: $OPENCONNECT_PATH * +ALL ALL=(ALL) NOPASSWD: $PKILL_PATH * +ALL ALL=(ALL) NOPASSWD: $KILL_PATH * EOF # Set proper permissions on sudoers file @@ -29,9 +44,9 @@ fi echo "akon has been installed successfully!" echo "The following commands are now available without sudo password:" -echo " - openconnect" -echo " - pkill" -echo " - kill" +echo " - openconnect ($OPENCONNECT_PATH)" +echo " - pkill ($PKILL_PATH)" +echo " - kill ($KILL_PATH)" echo "" echo "Run 'akon --help' to get started."