docs: add UI screenshots and logging section

This commit is contained in:
Ed Nielsen 2026-03-18 21:00:38 +01:00
parent 2a0053dee5
commit bd9f96f3a9
4 changed files with 111 additions and 66 deletions

View file

@ -1,4 +1,4 @@
# 🖥️ Update Manager - Version: 0.3.0 # 🖥️ Update Manager
Simple CLI tool to check and manage updates across multiple Ubuntu systems over SSH. Simple CLI tool to check and manage updates across multiple Ubuntu systems over SSH.
@ -26,10 +26,10 @@ Built for Lanx environments lightweight, fast and no unnecessary dependencie
## Features ## Features
* Check updates on multiple hosts * Check updates on multiple hosts
* Run checks remotely over SSH * Run updates remotely over SSH
* Interactive CLI menu (dialog-based UI)
* Centralized logging
* Simple config files * Simple config files
* Built-in logging (file + terminal)
* Dialog-based UI menu
* No agents required * No agents required
* Works with existing SSH setup * Works with existing SSH setup
@ -37,12 +37,20 @@ Built for Lanx environments lightweight, fast and no unnecessary dependencie
## Update Manager UI ## Update Manager UI
### Main menu
<p align="center"> <p align="center">
<img src="update-manager-ui.png" width="50%" alt="Update Manager CLI UI"> <img src="docs/images/menu-main.png" width="50%" alt="Main menu">
</p>
### Log menu
<p align="center">
<img src="docs/images/menu-logs.png" width="50%" alt="Log menu">
</p> </p>
<p align="center"> <p align="center">
<em>Lightweight • Terminal-based • Works over SSH</em> <em>Lightweight • No dependencies • Works over SSH</em>
</p> </p>
--- ---
@ -54,7 +62,7 @@ git clone https://github.com/YOUR-USER/update-manager.git
cd update-manager cd update-manager
sudo apt update sudo apt update
sudo apt install -y dialog openssh-client sudo apt install dialog openssh-client
sudo mkdir -p /opt/update-manager sudo mkdir -p /opt/update-manager
sudo cp update-manager.sh update-manager-ui.sh dialogrc /opt/update-manager/ sudo cp update-manager.sh update-manager-ui.sh dialogrc /opt/update-manager/
@ -62,8 +70,8 @@ sudo cp update-manager.sh update-manager-ui.sh dialogrc /opt/update-manager/
sudo chmod +x /opt/update-manager/update-manager.sh sudo chmod +x /opt/update-manager/update-manager.sh
sudo chmod +x /opt/update-manager/update-manager-ui.sh sudo chmod +x /opt/update-manager/update-manager-ui.sh
sudo ln -sf /opt/update-manager/update-manager.sh /usr/local/bin/update-manager sudo ln -s /opt/update-manager/update-manager.sh /usr/local/bin/update-manager
sudo ln -sf /opt/update-manager/update-manager-ui.sh /usr/local/bin/update-manager-ui sudo ln -s /opt/update-manager/update-manager-ui.sh /usr/local/bin/update-manager-ui
``` ```
--- ---
@ -134,6 +142,12 @@ server3 192.168.1.30 user
## Usage ## Usage
### Check updates
```bash
update-manager check
```
### Start UI ### Start UI
```bash ```bash
@ -142,42 +156,25 @@ update-manager-ui
--- ---
### Check updates (CLI)
```bash
update-manager check
```
---
## Logging ## Logging
The tool logs both to terminal and file. Log file location:
### Primary location
```bash ```bash
/opt/update-manager/log/update-manager.log /opt/update-manager/log/update-manager.log
``` ```
### Fallback location View log:
```bash ```bash
~/update-manager/log/update-manager.log less /opt/update-manager/log/update-manager.log
``` ```
### Notes Follow log:
* Log directory is created automatically ```bash
* Log file is created automatically tail -f /opt/update-manager/log/update-manager.log
* Output is written to both terminal and file ```
* Log levels:
* INFO
* WARN
* ERROR
Logs can be viewed directly from the UI.
--- ---
@ -189,8 +186,8 @@ Logs can be viewed directly from the UI.
├── update-manager-ui.sh ├── update-manager-ui.sh
├── update-manager.conf ├── update-manager.conf
├── hosts.conf ├── hosts.conf
── log/ ── log/
└── update-manager.log └── update-manager.log
``` ```
--- ---
@ -199,6 +196,7 @@ Logs can be viewed directly from the UI.
* Uses SSH to connect to each host * Uses SSH to connect to each host
* Runs `apt` commands remotely * Runs `apt` commands remotely
* Logs results locally
* No agents or services needed * No agents or services needed
* Designed for simple and efficient operations * Designed for simple and efficient operations
@ -209,7 +207,6 @@ Logs can be viewed directly from the UI.
* SSH access to all hosts * SSH access to all hosts
* SSH keys recommended (no password prompts) * SSH keys recommended (no password prompts)
* Ubuntu/Debian-based systems * Ubuntu/Debian-based systems
* `dialog` (for UI)
--- ---
@ -218,7 +215,6 @@ Logs can be viewed directly from the UI.
* 🔔 Notifications (ntfy / push alerts) * 🔔 Notifications (ntfy / push alerts)
* 🌐 Web interface * 🌐 Web interface
* 📧 Email reporting * 📧 Email reporting
* 📜 Advanced logging / audit trail
* 📊 Basic monitoring (status, last check, pending updates) * 📊 Basic monitoring (status, last check, pending updates)
* 🧩 Plugin system (extensible modules) * 🧩 Plugin system (extensible modules)
* 🔐 Security & compliance checks * 🔐 Security & compliance checks

BIN
menu-logs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
menu-main.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View file

@ -11,24 +11,85 @@ get_log_file() {
if [[ -f "$primary" ]]; then if [[ -f "$primary" ]]; then
echo "$primary" echo "$primary"
else elif [[ -f "$fallback" ]]; then
echo "$fallback" echo "$fallback"
else
echo ""
fi fi
} }
show_log_menu() {
while true; do
log_choice=$(dialog --clear \
--backtitle "Update Manager" \
--title "Log menu" \
--menu "Select log action:" 18 60 10 \
1 "View full log" \
2 "Follow log live" \
3 "Show log location" \
4 "Show last 20 log lines" \
0 "Back" \
3>&1 1>&2 2>&3)
clear
case "$log_choice" in
1)
log_file="$(get_log_file)"
if [[ -n "$log_file" ]]; then
less "$log_file"
else
echo "No log file found yet."
read -rp "Press Enter to continue..."
fi
;;
2)
log_file="$(get_log_file)"
if [[ -n "$log_file" ]]; then
echo "Press Ctrl+C to stop"
tail -n 20 -f "$log_file"
else
echo "No log file found yet."
fi
read -rp "Press Enter to continue..."
;;
3)
log_file="$(get_log_file)"
if [[ -n "$log_file" ]]; then
echo "Log file:"
echo "$log_file"
else
echo "No log file found yet."
fi
read -rp "Press Enter to continue..."
;;
4)
log_file="$(get_log_file)"
if [[ -n "$log_file" ]]; then
tail -n 20 "$log_file"
else
echo "No log file found yet."
fi
read -rp "Press Enter to continue..."
;;
0|"")
break
;;
esac
done
}
while true; do while true; do
choice=$(dialog --clear \ choice=$(dialog --clear \
--backtitle "Update Manager" \ --backtitle "Update Manager" \
--title "Choose an action" \ --title "Choose an action" \
--menu "Select option:" 16 60 9 \ --menu "Select option:" 20 60 10 \
1 "Check all hosts" \ 1 "Check all hosts" \
2 "View hosts file" \ 2 "View hosts file" \
3 "Edit hosts file" \ 3 "Edit hosts file" \
4 "Add host" \ 4 "Add host" \
5 "Remove host" \ 5 "Remove host" \
6 "View full log" \ 6 "Log menu" \
7 "Follow log live" \
8 "Show log location" \
0 "Exit" \ 0 "Exit" \
3>&1 1>&2 2>&3) 3>&1 1>&2 2>&3)
@ -40,12 +101,7 @@ while true; do
read -rp "Press Enter to continue..." read -rp "Press Enter to continue..."
;; ;;
2) 2)
if [[ -f "$HOSTS_FILE" ]]; then less "$HOSTS_FILE"
less "$HOSTS_FILE"
else
echo "Hosts file not found: $HOSTS_FILE"
read -rp "Press Enter to continue..."
fi
;; ;;
3) 3)
nano "$HOSTS_FILE" nano "$HOSTS_FILE"
@ -54,34 +110,27 @@ while true; do
read -rp "Name: " name read -rp "Name: " name
read -rp "IP: " ip read -rp "IP: " ip
read -rp "User: " user read -rp "User: " user
echo "$name $ip $user" >> "$HOSTS_FILE" if [[ -z "$name" || -z "$ip" || -z "$user" ]]; then
echo "Host added." echo "All fields are required."
else
echo "$name $ip $user" >> "$HOSTS_FILE"
echo "Host added."
fi
read -rp "Press Enter to continue..." read -rp "Press Enter to continue..."
;; ;;
5) 5)
if [[ -f "$HOSTS_FILE" ]]; then nl -w2 -s'. ' "$HOSTS_FILE"
nl -w2 -s'. ' "$HOSTS_FILE" read -rp "Line to remove: " line
read -rp "Line to remove: " line if [[ "$line" =~ ^[0-9]+$ ]]; then
sed -i "${line}d" "$HOSTS_FILE" sed -i "${line}d" "$HOSTS_FILE"
echo "Host removed." echo "Host removed."
else else
echo "Hosts file not found: $HOSTS_FILE" echo "Invalid line number."
fi fi
read -rp "Press Enter to continue..." read -rp "Press Enter to continue..."
;; ;;
6) 6)
less "$(get_log_file)" show_log_menu
;;
7)
echo "Following log: $(get_log_file)"
echo "Press Ctrl+C to stop."
tail -f "$(get_log_file)"
read -rp "Press Enter to continue..."
;;
8)
echo "Log file:"
echo "$(get_log_file)"
read -rp "Press Enter to continue..."
;; ;;
0|"") 0|"")
clear clear