From 834caa5d36dbe4b95256f43a76497352ef473780 Mon Sep 17 00:00:00 2001 From: tearran Date: Sun, 6 Oct 2024 22:08:12 -0500 Subject: [PATCH 1/6] Split JSON into multible files --- tools/config-jobs | 126 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100755 tools/config-jobs diff --git a/tools/config-jobs b/tools/config-jobs new file mode 100755 index 000000000..bc60d18ce --- /dev/null +++ b/tools/config-jobs @@ -0,0 +1,126 @@ +#!/bin/bash + + +SCRIPT_DIR="$(dirname "$0")" +LIB_DIR="$SCRIPT_DIR/../lib/armbian-config" + +DEFAULT_FILE="$LIB_DIR/config.jobs.json" +DEFAULT_DIR="$SCRIPT_DIR/json" + + +# Function to display the help message +print_help() { + echo "Usage: $0 [OPTIONS]" + echo "Options:" + echo " -s Split JSON file into smaller parts" + echo " -j Join multiple JSON files into one" + echo " -h Display this help message" +} + +# Function to split JSON into smaller files +split_json() { + input_file="$1" + output_dir="$DEFAULT_DIR" + + # Check if input file exists + if [[ ! -f "$input_file" ]]; then + echo "Error: Input file '$input_file' does not exist." + return 1 + fi + + # Create output directory if it doesn't exist + if [[ ! -d "$output_dir" ]]; then + mkdir -p "$output_dir" + fi + + # Extract the total number of menu items + count=$(jq '.menu | length' "$input_file") + + # Iterate over each menu item and save it as a separate JSON file + for ((i=0; i "$output_dir/config.${filename}.json" + + # Extract 'sub' and replace it with 'menu' if it exists + # jq ".menu[$i] | if has(\"sub\") then .sub | {menu: .} else {menu: [.] } end" "$input_file" > "$output_dir/config.${filename}.json" + done + + echo "Splitting and transformation completed. Files are saved in '$output_dir'." +} + +# Function to join JSON files into a single file +join_json() { + input_dir="$DEFAULT_DIR" + output_file="$1" + + # Check if input directory exists + if [[ ! -d "$input_dir" ]]; then + echo "Error: Input directory '$input_dir' does not exist." + return 1 + fi + + # Initialize an empty array for holding the merged JSON data + merged_json="[]" + help_section="null" + + # Loop through all JSON files in the directory + for file in "$input_dir"/*.json; do + if [[ -f "$file" ]]; then + # Check if the JSON file is the "Help" section + if jq -e '.menu[] | select(.id == "Help")' "$file" > /dev/null 2>&1; then + # Extract the "Help" item if it's found + help_section=$(jq '.menu[] | select(.id == "Help")' "$file") + else + # Extract the rest of the "menu" array content and add it to the merged array + array_content=$(jq '.menu' "$file") + merged_json=$(jq --argjson new_item "$array_content" '. + $new_item' <<< "$merged_json") + fi + fi + done + + # Add the "Help" section to the merged JSON + if [[ "$help_section" != "null" ]]; then + merged_json=$(jq --argjson help_item "$help_section" '. + [$help_item]' <<< "$merged_json") + fi + + # Construct the final JSON structure + final_json=$(jq -n --argjson menu "$merged_json" '{"menu": $menu}') + + # Write the final JSON structure to a file + echo "$final_json" | jq '.' > "$output_file" + + echo "JSON files rejoined into '$output_file'." +} + + +# Main script logic with case statement +case "$1" in + -s) + if [[ -z "$2" ]]; then + echo "Error: Missing arguments for -s option." + print_help + exit 1 + fi + split_json "$2" + ;; + -j) + if [[ -z "$2" ]]; then + echo "Error: Missing arguments for -j option." + print_help + exit 1 + fi + join_json "$2" + ;; + -h) + print_help + ;; + *) + echo "Error: Invalid option." + print_help + exit 1 + ;; +esac From 7a1a5c5db90a9dfa25fd3322399472c50ece8796 Mon Sep 17 00:00:00 2001 From: tearran Date: Sun, 6 Oct 2024 22:09:36 -0500 Subject: [PATCH 2/6] split json --- tools/json/config.help.json | 32 +++ tools/json/config.localisation.json | 66 +++++ tools/json/config.network.json | 127 +++++++++ tools/json/config.software.json | 412 ++++++++++++++++++++++++++++ tools/json/config.system.json | 403 +++++++++++++++++++++++++++ 5 files changed, 1040 insertions(+) create mode 100644 tools/json/config.help.json create mode 100644 tools/json/config.localisation.json create mode 100644 tools/json/config.network.json create mode 100644 tools/json/config.software.json create mode 100644 tools/json/config.system.json diff --git a/tools/json/config.help.json b/tools/json/config.help.json new file mode 100644 index 000000000..b0ccdec89 --- /dev/null +++ b/tools/json/config.help.json @@ -0,0 +1,32 @@ +{ + "menu": [ + { + "id": "Help", + "description": "About this app", + "sub": [ + { + "id": "H00", + "description": "About This system. (WIP)", + "command": [ + "show_message <<< \"This app is to help execute procedures to configure your system\n\nSome options may not work on manually modified systems\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "H02", + "description": "List of Config function(WIP)", + "command": [ + "show_message <<< see_use" + ], + "status": "Disabled", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] + } + ] +} diff --git a/tools/json/config.localisation.json b/tools/json/config.localisation.json new file mode 100644 index 000000000..0229d9617 --- /dev/null +++ b/tools/json/config.localisation.json @@ -0,0 +1,66 @@ +{ + "menu": [ + { + "id": "Localisation", + "description": "Localisation", + "sub": [ + { + "id": "L00", + "description": "Change Global timezone (WIP)", + "command": [ + "dpkg-reconfigure tzdata" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L01", + "description": "Change Locales reconfigure the language and character set", + "command": [ + "dpkg-reconfigure locales", + "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", + "export LANGUAGE=$LANG" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L02", + "description": "Change Keyboard layout", + "command": [ + "dpkg-reconfigure keyboard-configuration ; setupcon ", + "update-initramfs -u" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L03", + "description": "Change APT mirrors", + "prompt": "This will change the APT mirrors\nWould you like to continue?", + "command": [ + "get_user_continue \"This is only a frontend test\" process_input" + ], + "status": "Disabled", + "author": "" + }, + { + "id": "L04", + "description": "Change System Hostname", + "command": [ + "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", + "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" + ], + "status": "Preview", + "author": "" + } + ] + } + ] +} diff --git a/tools/json/config.network.json b/tools/json/config.network.json new file mode 100644 index 000000000..5a6a9c32a --- /dev/null +++ b/tools/json/config.network.json @@ -0,0 +1,127 @@ +{ + "menu": [ + { + "id": "Network", + "description": "Fixed and wireless network settings", + "sub": [ + { + "id": "N01", + "description": "Configure network interfaces", + "sub": [ + { + "id": "N02", + "description": "Add interface", + "command": [ + "network_config armbian" + ], + "status": "Preview", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "N03", + "description": "Revert to defaults", + "command": [ + "default_network_config" + ], + "status": "Preview", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" + }, + { + "id": "N04", + "description": "Show draft configuration", + "command": [ + "show_message <<< \"$(netplan get all)\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]]" + }, + { + "id": "N05", + "description": "Apply changes", + "prompt": "This will apply new network configuration\n\nwould you like to continue?", + "command": [ + "netplan apply" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" + }, + { + "id": "N06", + "description": "Show active status", + "command": [ + "show_message <<< \"$(netplan status --all)\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" + } + ] + }, + { + "id": "N15", + "description": "Install Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" + }, + { + "id": "N16", + "description": "Remove Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", + "debconf-apt-progress -- apt -y -qq autoremove" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N17", + "description": "Bluetooth Discover", + "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", + "command": [ + "connect_bt_interface" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N18", + "description": "Toggle system IPv6/IPv4 internet protocol", + "prompt": "This will toggle your internet protocol\nWould you like to continue?", + "command": [ + "toggle_ipv6 | show_infobox" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] + } + ] +} diff --git a/tools/json/config.software.json b/tools/json/config.software.json new file mode 100644 index 000000000..147438001 --- /dev/null +++ b/tools/json/config.software.json @@ -0,0 +1,412 @@ +{ + "menu": [ + { + "id": "Software", + "description": "Run/Install 3rd party applications", + "sub": [ + { + "id": "Desktops", + "description": "Install Desktop Environments", + "sub": [ + { + "id": "SW02", + "description": "Install XFCE desktop", + "command": [ + "install_de \"xfce\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW03", + "description": "Install Gnome desktop", + "command": [ + "install_de \"gnome\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW04", + "description": "Install i3-wm desktop", + "command": [ + "install_de \"i3-wm\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW05", + "description": "Install Cinnamon desktop", + "command": [ + "install_de \"cinnamon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW06", + "description": "Install kde-neon desktop", + "command": [ + "install_de \"kde-neon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + } + ] + }, + { + "id": "Netconfig", + "description": "Network tools", + "sub": [ + { + "id": "SW08", + "description": "Install realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install nload" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed nload" + }, + { + "id": "SW09", + "description": "Remove realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge nload" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed nload" + }, + { + "id": "SW10", + "description": "Install bandwidth measuring tool (iperf3)", + "command": [ + "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iperf3" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed iperf3" + }, + { + "id": "SW11", + "description": "Remove bandwidth measuring tool (iperf3)", + "command": [ + "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iperf3" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed iperf3" + }, + { + "id": "SW12", + "description": "Install IP LAN monitor (iptraf-ng)", + "command": [ + "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iptraf-ng" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed iptraf-ng" + }, + { + "id": "SW13", + "description": "Remove IP LAN monitor (iptraf-ng)", + "command": [ + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iptraf-ng" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed iptraf-ng" + }, + { + "id": "SW14", + "description": "Install hostname broadcast via mDNS (avahi-daemon)", + "command": [ + "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", + "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", + "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", + "service avahi-daemon restart" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed avahi-daemon" + }, + { + "id": "SW15", + "description": "Remove hostname broadcast via mDNS (avahi-daemon)", + "command": [ + "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "systemctl stop avahi-daemon avahi-daemon.socket", + "debconf-apt-progress -- apt-get -y purge avahi-daemon" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed avahi-daemon" + } + ] + }, + { + "id": "DevTools", + "description": "Development", + "sub": [ + { + "id": "SW17", + "description": "Install tools for cloning and managing repositories (git)", + "command": [ + "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install git" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed git" + }, + { + "id": "SW18", + "description": "Remove tools for cloning and managing repositories (git)", + "command": [ + "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge git" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed git" + } + ] + }, + { + "id": "Benchy", + "description": "System benchmaking and diagnostics", + "command": [ + "see_monitoring" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /usr/bin/armbianmonitor ]" + }, + { + "id": "Containers", + "description": "Containerlization and Virtual Machines", + "sub": [ + { + "id": "SW25", + "description": "Install Docker Minimal", + "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", + "command": [ + "install_docker" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-ce" + }, + { + "id": "SW26", + "description": "Install Docker Engine", + "prompt": "This operation will install Docker Engine.\nWould you like to continue?", + "command": [ + "install_docker engine" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-compose-plugin" + }, + { + "id": "SW27", + "description": "Remove Docker", + "prompt": "This operation will purge Docker.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed docker-ce" + }, + { + "id": "SW28", + "description": "Purge all Docker images, containers, and volumes", + "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", + "command": [ + "rm -rf /var/lib/docker", + "rm -rf /var/lib/containerd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" + } + ] + }, + { + "id": "Media", + "description": "Media Servers and Editors", + "sub": [ + { + "id": "SW21", + "description": "Install Plex Media server", + "prompt": "This operation will install Plex Media server.\nWould you like to continue?", + "command": [ + "install_plexmediaserver" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed plexmediaserver" + }, + { + "id": "SW22", + "description": "Remove Plex Media server", + "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt-get -y purge plexmediaserver", + "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed plexmediaserver" + }, + { + "id": "SW23", + "description": "Install Emby server", + "prompt": "This operation will install Emby server.\nWould you like to continue?", + "command": [ + "install_embyserver" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed emby-server" + }, + { + "id": "SW24", + "description": "Remove Emby server", + "prompt": "This operation will purge Emby server.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge emby-server" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed emby-server" + } + ] + }, + { + "id": "Management", + "description": "Remote Management tools", + "sub": [ + { + "id": "M00", + "description": "Install Cockpit web-based management tool", + "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", + "command": [ + "see_current_apt update", + "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed cockpit" + }, + { + "id": "M01", + "description": "Purge Cockpit web-based management tool", + "prompt": "This operation will purge Cockpit.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge cockpit" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit" + }, + { + "id": "M02", + "description": "Start Cockpit Service", + "command": [ + "sudo systemctl enable --now cockpit.socket | show_infobox " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" + }, + { + "id": "M03", + "description": "Stop Cockpit Service", + "command": [ + "systemctl stop cockpit cockpit.socket", + "systemctl disable cockpit.socket | show_infobox " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" + } + ] + } + ] + } + ] +} diff --git a/tools/json/config.system.json b/tools/json/config.system.json new file mode 100644 index 000000000..f1c425047 --- /dev/null +++ b/tools/json/config.system.json @@ -0,0 +1,403 @@ +{ + "menu": [ + { + "id": "System", + "description": "System wide and admin settings", + "sub": [ + { + "id": "S01", + "description": "Enable Armbian kernel/firmware upgrades", + "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", + "command": [ + "armbian_fw_manipulate unhold" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[[ -n \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S02", + "description": "Disable Armbian kernel upgrades", + "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", + "command": [ + "armbian_fw_manipulate hold" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S03", + "description": "Edit the boot environment", + "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", + "command": [ + "nano /boot/armbianEnv.txt" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "S04", + "description": "Install Linux headers", + "command": [ + "Headers_install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "! are_headers_installed" + }, + { + "id": "S05", + "description": "Remove Linux headers", + "command": [ + "Headers_remove" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "are_headers_installed" + }, + { + "id": "S06", + "description": "Install to internal storage", + "command": [ + "armbian-install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ -n $(ls /sbin/armbian-install) ]]" + }, + { + "id": "S07.1", + "description": "Manage SSH login options", + "sub": [ + { + "id": "S07", + "description": "Disable root login", + "command": [ + "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" + }, + { + "id": "S08", + "description": "Enable root login", + "command": [ + "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" + }, + { + "id": "S09", + "description": "Disable password login", + "command": [ + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S10", + "description": "Enable password login", + "command": [ + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" + }, + { + "id": "S11", + "description": "Disable Public key authentication login", + "command": [ + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S12", + "description": "Enable Public key authentication login", + "command": [ + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" + }, + { + "id": "S13", + "description": "Disable OTP authentication", + "command": [ + "clear", + "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S14", + "description": "Enable OTP authentication", + "command": [ + "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", + "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", + "[ ! -f /root/.google_authenticator ] && qr_code generate", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" + }, + { + "id": "S15", + "description": "Generate new OTP authentication QR code", + "command": [ + "qr_code generate" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S16", + "description": "Show OTP authentication QR code", + "command": [ + "qr_code" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" + }, + { + "id": "S30", + "description": "Disable last login banner", + "command": [ + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" + }, + { + "id": "S31", + "description": "Enable last login banner", + "command": [ + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" + } + ] + }, + { + "id": "S17", + "description": "Change shell system wide to BASH", + "command": [ + "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" + }, + { + "id": "S18", + "description": "Change shell system wide to ZSH", + "command": [ + "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" + }, + { + "id": "S19", + "description": "Switch to rolling release", + "prompt": "This will switch to rolling releases\n\nwould you like to continue?", + "command": [ + "set_rolling" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S20", + "description": "Switch to stable release", + "prompt": "This will switch to stable releases\n\nwould you like to continue?", + "command": [ + "set_stable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S21", + "description": "Enable read only filesystem", + "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs enable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" + }, + { + "id": "S22", + "description": "Disable read only filesystem", + "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs disable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" + }, + { + "id": "S23", + "description": "Adjust welcome screen (motd)", + "command": [ + "adjust_motd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /etc/default/armbian-motd ]" + }, + { + "id": "S24", + "description": "Install alternative kernels", + "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", + "command": [ + "switch_kernels" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "S25", + "description": "Distribution upgrades", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", + "sub": [ + { + "id": "S26", + "description": "Upgrade to latest stable / LTS", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade stable" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" + }, + { + "id": "S27", + "description": "Upgrade to rolling unstable", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade rolling" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" + } + ] + }, + { + "id": "S28", + "description": "Manage device tree overlays", + "command": [ + "manage_dtoverlays" + ], + "status": "Active", + "doc_link": "", + "src_reference": "", + "author": "Gunjan Gupta", + "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" + } + ] + } + ] +} From c6e62fe5eececa3c8aab7ec0f1e551c922d838dc Mon Sep 17 00:00:00 2001 From: tearran Date: Sun, 6 Oct 2024 22:11:04 -0500 Subject: [PATCH 3/6] rejointed JSON --- lib/armbian-configng/config.ng.jobs.json | 2024 +++++++++++----------- 1 file changed, 1012 insertions(+), 1012 deletions(-) diff --git a/lib/armbian-configng/config.ng.jobs.json b/lib/armbian-configng/config.ng.jobs.json index e6d711f7d..308239300 100644 --- a/lib/armbian-configng/config.ng.jobs.json +++ b/lib/armbian-configng/config.ng.jobs.json @@ -1,1024 +1,1024 @@ { - "menu": [ + "menu": [ + { + "id": "Localisation", + "description": "Localisation", + "sub": [ { - "id": "System", - "description": "System wide and admin settings", - "sub": [ - { - "id": "S01", - "description": "Enable Armbian kernel/firmware upgrades", - "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", - "command": [ - "armbian_fw_manipulate unhold" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[[ -n \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S02", - "description": "Disable Armbian kernel upgrades", - "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", - "command": [ - "armbian_fw_manipulate hold" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S03", - "description": "Edit the boot environment", - "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", - "command": [ - "nano /boot/armbianEnv.txt" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "S04", - "description": "Install Linux headers", - "command": [ - "Headers_install" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", - "author": "https://github.com/Tearran", - "condition": "! are_headers_installed" - }, - { - "id": "S05", - "description": "Remove Linux headers", - "command": [ - "Headers_remove" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", - "author": "https://github.com/Tearran", - "condition": "are_headers_installed" - }, - { - "id": "S06", - "description": "Install to internal storage", - "command": [ - "armbian-install" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ -n $(ls /sbin/armbian-install) ]]" - }, - { - "id": "S07.1", - "description": "Manage SSH login options", - "sub": [ - { - "id": "S07", - "description": "Disable root login", - "command": [ - "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" - }, - { - "id": "S08", - "description": "Enable root login", - "command": [ - "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" - }, - { - "id": "S09", - "description": "Disable password login", - "command": [ - "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S10", - "description": "Enable password login", - "command": [ - "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" - }, - { - "id": "S11", - "description": "Disable Public key authentication login", - "command": [ - "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S12", - "description": "Enable Public key authentication login", - "command": [ - "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" - }, - { - "id": "S13", - "description": "Disable OTP authentication", - "command": [ - "clear", - "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", - "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", - "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S14", - "description": "Enable OTP authentication", - "command": [ - "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", - "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", - "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", - "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", - "[ ! -f /root/.google_authenticator ] && qr_code generate", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" - }, - { - "id": "S15", - "description": "Generate new OTP authentication QR code", - "command": [ - "qr_code generate" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S16", - "description": "Show OTP authentication QR code", - "command": [ - "qr_code" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" - }, - { - "id": "S30", - "description": "Disable last login banner", - "command": [ - "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" - }, - { - "id": "S31", - "description": "Enable last login banner", - "command": [ - "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" - } - ] - }, - { - "id": "S17", - "description": "Change shell system wide to BASH", - "command": [ - "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", - "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", - "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", - "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", - "update_skel", - "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" - }, - { - "id": "S18", - "description": "Change shell system wide to ZSH", - "command": [ - "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", - "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", - "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", - "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", - "update_skel", - "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" - }, - { - "id": "S19", - "description": "Switch to rolling release", - "prompt": "This will switch to rolling releases\n\nwould you like to continue?", - "command": [ - "set_rolling" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", - "author": "Igor Pecovnik", - "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S20", - "description": "Switch to stable release", - "prompt": "This will switch to stable releases\n\nwould you like to continue?", - "command": [ - "set_stable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", - "author": "Igor Pecovnik", - "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S21", - "description": "Enable read only filesystem", - "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", - "command": [ - "manage_overlayfs enable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" - }, - { - "id": "S22", - "description": "Disable read only filesystem", - "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", - "command": [ - "manage_overlayfs disable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" - }, - { - "id": "S23", - "description": "Adjust welcome screen (motd)", - "command": [ - "adjust_motd" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[ -f /etc/default/armbian-motd ]" - }, - { - "id": "S24", - "description": "Install alternative kernels", - "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", - "command": [ - "switch_kernels" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "" - }, - { - "id": "S25", - "description": "Distribution upgrades", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", - "sub": [ - { - "id": "S26", - "description": "Upgrade to latest stable / LTS", - "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", - "command": [ - "release_upgrade stable" - ], - "status": "Active", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" - }, - { - "id": "S27", - "description": "Upgrade to rolling unstable", - "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", - "command": [ - "release_upgrade rolling" - ], - "status": "Active", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" - } - ] - }, - { - "id": "S28", - "description": "Manage device tree overlays", - "command": [ - "manage_dtoverlays" - ], - "status": "Active", - "doc_link": "", - "src_reference": "", - "author": "Gunjan Gupta", - "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" - } - ] + "id": "L00", + "description": "Change Global timezone (WIP)", + "command": [ + "dpkg-reconfigure tzdata" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" }, { - "id": "Network", - "description": "Fixed and wireless network settings", - "sub": [ - { - "id": "N01", - "description": "Configure network interfaces", - "sub": [ - { - "id": "N02", - "description": "Add interface", - "command": [ - "network_config armbian" - ], - "status": "Preview", - "author": "Igor Pecovnik", - "condition": "" - }, - { - "id": "N03", - "description": "Revert to defaults", - "command": [ - "default_network_config" - ], - "status": "Preview", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" - }, - { - "id": "N04", - "description": "Show draft configuration", - "command": [ - "show_message <<< \"$(netplan get all)\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]]" - }, - { - "id": "N05", - "description": "Apply changes", - "prompt": "This will apply new network configuration\n\nwould you like to continue?", - "command": [ - "netplan apply" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" - }, - { - "id": "N06", - "description": "Show active status", - "command": [ - "show_message <<< \"$(netplan status --all)\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" - } - ] - }, - { - "id": "N15", - "description": "Install Bluetooth support", - "command": [ - "see_current_apt ", - "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", - "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" - }, - { - "id": "N16", - "description": "Remove Bluetooth support", - "command": [ - "see_current_apt ", - "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", - "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", - "debconf-apt-progress -- apt -y -qq autoremove" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" - }, - { - "id": "N17", - "description": "Bluetooth Discover", - "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", - "command": [ - "connect_bt_interface" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" - }, - { - "id": "N18", - "description": "Toggle system IPv6/IPv4 internet protocol", - "prompt": "This will toggle your internet protocol\nWould you like to continue?", - "command": [ - "toggle_ipv6 | show_infobox" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - } - ] + "id": "L01", + "description": "Change Locales reconfigure the language and character set", + "command": [ + "dpkg-reconfigure locales", + "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", + "export LANGUAGE=$LANG" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" }, { - "id": "Localisation", - "description": "Localisation", - "sub": [ - { - "id": "L00", - "description": "Change Global timezone (WIP)", - "command": [ - "dpkg-reconfigure tzdata" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "L01", - "description": "Change Locales reconfigure the language and character set", - "command": [ - "dpkg-reconfigure locales", - "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", - "export LANGUAGE=$LANG" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "L02", - "description": "Change Keyboard layout", - "command": [ - "dpkg-reconfigure keyboard-configuration ; setupcon ", - "update-initramfs -u" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "L03", - "description": "Change APT mirrors", - "prompt": "This will change the APT mirrors\nWould you like to continue?", - "command": [ - "get_user_continue \"This is only a frontend test\" process_input" - ], - "status": "Disabled", - "author": "" - }, - { - "id": "L04", - "description": "Change System Hostname", - "command": [ - "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", - "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" - ], - "status": "Preview", - "author": "" - } - ] + "id": "L02", + "description": "Change Keyboard layout", + "command": [ + "dpkg-reconfigure keyboard-configuration ; setupcon ", + "update-initramfs -u" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" }, { - "id": "Software", - "description": "Run/Install 3rd party applications", - "sub": [ - { - "id": "Desktops", - "description": "Install Desktop Environments", - "sub": [ - { - "id": "SW02", - "description": "Install XFCE desktop", - "command": [ - "install_de \"xfce\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW03", - "description": "Install Gnome desktop", - "command": [ - "install_de \"gnome\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW04", - "description": "Install i3-wm desktop", - "command": [ - "install_de \"i3-wm\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW05", - "description": "Install Cinnamon desktop", - "command": [ - "install_de \"cinnamon\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW06", - "description": "Install kde-neon desktop", - "command": [ - "install_de \"kde-neon\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - } - ] - }, - { - "id": "Netconfig", - "description": "Network tools", - "sub": [ - { - "id": "SW08", - "description": "Install realtime console network usage monitor (nload)", - "command": [ - "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install nload" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed nload" - }, - { - "id": "SW09", - "description": "Remove realtime console network usage monitor (nload)", - "command": [ - "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge nload" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed nload" - }, - { - "id": "SW10", - "description": "Install bandwidth measuring tool (iperf3)", - "command": [ - "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install iperf3" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed iperf3" - }, - { - "id": "SW11", - "description": "Remove bandwidth measuring tool (iperf3)", - "command": [ - "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge iperf3" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed iperf3" - }, - { - "id": "SW12", - "description": "Install IP LAN monitor (iptraf-ng)", - "command": [ - "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install iptraf-ng" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed iptraf-ng" - }, - { - "id": "SW13", - "description": "Remove IP LAN monitor (iptraf-ng)", - "command": [ - "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge iptraf-ng" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed iptraf-ng" - }, - { - "id": "SW14", - "description": "Install hostname broadcast via mDNS (avahi-daemon)", - "command": [ - "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", - "check_if_installed avahi-daemon", - "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", - "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", - "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", - "service avahi-daemon restart" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed avahi-daemon" - }, - { - "id": "SW15", - "description": "Remove hostname broadcast via mDNS (avahi-daemon)", - "command": [ - "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", - "check_if_installed avahi-daemon", - "systemctl stop avahi-daemon avahi-daemon.socket", - "debconf-apt-progress -- apt-get -y purge avahi-daemon" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed avahi-daemon" - } - ] - }, - { - "id": "DevTools", - "description": "Development", - "sub": [ - { - "id": "SW17", - "description": "Install tools for cloning and managing repositories (git)", - "command": [ - "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install git" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed git" - }, - { - "id": "SW18", - "description": "Remove tools for cloning and managing repositories (git)", - "command": [ - "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge git" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed git" - } - ] - }, - { - "id": "Benchy", - "description": "System benchmaking and diagnostics", - "command": [ - "see_monitoring" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[ -f /usr/bin/armbianmonitor ]" - }, - { - "id": "Containers", - "description": "Containerlization and Virtual Machines", - "sub": [ - { - "id": "SW25", - "description": "Install Docker Minimal", - "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", - "command": [ - "install_docker" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-ce" - }, - { - "id": "SW26", - "description": "Install Docker Engine", - "prompt": "This operation will install Docker Engine.\nWould you like to continue?", - "command": [ - "install_docker engine" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-compose-plugin" - }, - { - "id": "SW27", - "description": "Remove Docker", - "prompt": "This operation will purge Docker.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed docker-ce" - }, - { - "id": "SW28", - "description": "Purge all Docker images, containers, and volumes", - "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", - "command": [ - "rm -rf /var/lib/docker", - "rm -rf /var/lib/containerd" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" - } - ] - }, - { - "id": "Media", - "description": "Media Servers and Editors", - "sub": [ - { - "id": "SW21", - "description": "Install Plex Media server", - "prompt": "This operation will install Plex Media server.\nWould you like to continue?", - "command": [ - "install_plexmediaserver" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed plexmediaserver" - }, - { - "id": "SW22", - "description": "Remove Plex Media server", - "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt-get -y purge plexmediaserver", - "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed plexmediaserver" - }, - { - "id": "SW23", - "description": "Install Emby server", - "prompt": "This operation will install Emby server.\nWould you like to continue?", - "command": [ - "install_embyserver" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed emby-server" - }, - { - "id": "SW24", - "description": "Remove Emby server", - "prompt": "This operation will purge Emby server.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge emby-server" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed emby-server" - } - ] - }, - { - "id": "Management", - "description": "Remote Management tools", - "sub": [ - { - "id": "M00", - "description": "Install Cockpit web-based management tool", - "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", - "command": [ - "see_current_apt update", - "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed cockpit" - }, - { - "id": "M01", - "description": "Purge Cockpit web-based management tool", - "prompt": "This operation will purge Cockpit.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge cockpit" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit" - }, - { - "id": "M02", - "description": "Start Cockpit Service", - "command": [ - "sudo systemctl enable --now cockpit.socket | show_infobox " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" - }, - { - "id": "M03", - "description": "Stop Cockpit Service", - "command": [ - "systemctl stop cockpit cockpit.socket", - "systemctl disable cockpit.socket | show_infobox " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" - } - ] - } - ] + "id": "L03", + "description": "Change APT mirrors", + "prompt": "This will change the APT mirrors\nWould you like to continue?", + "command": [ + "get_user_continue \"This is only a frontend test\" process_input" + ], + "status": "Disabled", + "author": "" }, { - "id": "Help", - "description": "About this app", - "sub": [ - { - "id": "H00", - "description": "About This system. (WIP)", - "command": [ - "show_message <<< \"This app is to help execute procedures to configure your system\n\nSome options may not work on manually modified systems\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "H02", - "description": "List of Config function(WIP)", - "command": [ - "show_message <<< see_use" - ], - "status": "Disabled", - "doc_link": "", - "src_reference": "", - "author": "" - } - ] + "id": "L04", + "description": "Change System Hostname", + "command": [ + "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", + "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" + ], + "status": "Preview", + "author": "" } - ] + ] + }, + { + "id": "Network", + "description": "Fixed and wireless network settings", + "sub": [ + { + "id": "N01", + "description": "Configure network interfaces", + "sub": [ + { + "id": "N02", + "description": "Add interface", + "command": [ + "network_config armbian" + ], + "status": "Preview", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "N03", + "description": "Revert to defaults", + "command": [ + "default_network_config" + ], + "status": "Preview", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" + }, + { + "id": "N04", + "description": "Show draft configuration", + "command": [ + "show_message <<< \"$(netplan get all)\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]]" + }, + { + "id": "N05", + "description": "Apply changes", + "prompt": "This will apply new network configuration\n\nwould you like to continue?", + "command": [ + "netplan apply" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" + }, + { + "id": "N06", + "description": "Show active status", + "command": [ + "show_message <<< \"$(netplan status --all)\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" + } + ] + }, + { + "id": "N15", + "description": "Install Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" + }, + { + "id": "N16", + "description": "Remove Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", + "debconf-apt-progress -- apt -y -qq autoremove" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N17", + "description": "Bluetooth Discover", + "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", + "command": [ + "connect_bt_interface" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N18", + "description": "Toggle system IPv6/IPv4 internet protocol", + "prompt": "This will toggle your internet protocol\nWould you like to continue?", + "command": [ + "toggle_ipv6 | show_infobox" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] + }, + { + "id": "Software", + "description": "Run/Install 3rd party applications", + "sub": [ + { + "id": "Desktops", + "description": "Install Desktop Environments", + "sub": [ + { + "id": "SW02", + "description": "Install XFCE desktop", + "command": [ + "install_de \"xfce\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW03", + "description": "Install Gnome desktop", + "command": [ + "install_de \"gnome\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW04", + "description": "Install i3-wm desktop", + "command": [ + "install_de \"i3-wm\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW05", + "description": "Install Cinnamon desktop", + "command": [ + "install_de \"cinnamon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW06", + "description": "Install kde-neon desktop", + "command": [ + "install_de \"kde-neon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + } + ] + }, + { + "id": "Netconfig", + "description": "Network tools", + "sub": [ + { + "id": "SW08", + "description": "Install realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install nload" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed nload" + }, + { + "id": "SW09", + "description": "Remove realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge nload" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed nload" + }, + { + "id": "SW10", + "description": "Install bandwidth measuring tool (iperf3)", + "command": [ + "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iperf3" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed iperf3" + }, + { + "id": "SW11", + "description": "Remove bandwidth measuring tool (iperf3)", + "command": [ + "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iperf3" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed iperf3" + }, + { + "id": "SW12", + "description": "Install IP LAN monitor (iptraf-ng)", + "command": [ + "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iptraf-ng" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed iptraf-ng" + }, + { + "id": "SW13", + "description": "Remove IP LAN monitor (iptraf-ng)", + "command": [ + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iptraf-ng" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed iptraf-ng" + }, + { + "id": "SW14", + "description": "Install hostname broadcast via mDNS (avahi-daemon)", + "command": [ + "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", + "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", + "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", + "service avahi-daemon restart" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed avahi-daemon" + }, + { + "id": "SW15", + "description": "Remove hostname broadcast via mDNS (avahi-daemon)", + "command": [ + "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "systemctl stop avahi-daemon avahi-daemon.socket", + "debconf-apt-progress -- apt-get -y purge avahi-daemon" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed avahi-daemon" + } + ] + }, + { + "id": "DevTools", + "description": "Development", + "sub": [ + { + "id": "SW17", + "description": "Install tools for cloning and managing repositories (git)", + "command": [ + "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install git" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed git" + }, + { + "id": "SW18", + "description": "Remove tools for cloning and managing repositories (git)", + "command": [ + "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge git" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed git" + } + ] + }, + { + "id": "Benchy", + "description": "System benchmaking and diagnostics", + "command": [ + "see_monitoring" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /usr/bin/armbianmonitor ]" + }, + { + "id": "Containers", + "description": "Containerlization and Virtual Machines", + "sub": [ + { + "id": "SW25", + "description": "Install Docker Minimal", + "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", + "command": [ + "install_docker" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-ce" + }, + { + "id": "SW26", + "description": "Install Docker Engine", + "prompt": "This operation will install Docker Engine.\nWould you like to continue?", + "command": [ + "install_docker engine" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-compose-plugin" + }, + { + "id": "SW27", + "description": "Remove Docker", + "prompt": "This operation will purge Docker.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed docker-ce" + }, + { + "id": "SW28", + "description": "Purge all Docker images, containers, and volumes", + "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", + "command": [ + "rm -rf /var/lib/docker", + "rm -rf /var/lib/containerd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" + } + ] + }, + { + "id": "Media", + "description": "Media Servers and Editors", + "sub": [ + { + "id": "SW21", + "description": "Install Plex Media server", + "prompt": "This operation will install Plex Media server.\nWould you like to continue?", + "command": [ + "install_plexmediaserver" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed plexmediaserver" + }, + { + "id": "SW22", + "description": "Remove Plex Media server", + "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt-get -y purge plexmediaserver", + "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed plexmediaserver" + }, + { + "id": "SW23", + "description": "Install Emby server", + "prompt": "This operation will install Emby server.\nWould you like to continue?", + "command": [ + "install_embyserver" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed emby-server" + }, + { + "id": "SW24", + "description": "Remove Emby server", + "prompt": "This operation will purge Emby server.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge emby-server" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed emby-server" + } + ] + }, + { + "id": "Management", + "description": "Remote Management tools", + "sub": [ + { + "id": "M00", + "description": "Install Cockpit web-based management tool", + "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", + "command": [ + "see_current_apt update", + "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed cockpit" + }, + { + "id": "M01", + "description": "Purge Cockpit web-based management tool", + "prompt": "This operation will purge Cockpit.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge cockpit" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit" + }, + { + "id": "M02", + "description": "Start Cockpit Service", + "command": [ + "sudo systemctl enable --now cockpit.socket | show_infobox " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" + }, + { + "id": "M03", + "description": "Stop Cockpit Service", + "command": [ + "systemctl stop cockpit cockpit.socket", + "systemctl disable cockpit.socket | show_infobox " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" + } + ] + } + ] + }, + { + "id": "System", + "description": "System wide and admin settings", + "sub": [ + { + "id": "S01", + "description": "Enable Armbian kernel/firmware upgrades", + "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", + "command": [ + "armbian_fw_manipulate unhold" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[[ -n \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S02", + "description": "Disable Armbian kernel upgrades", + "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", + "command": [ + "armbian_fw_manipulate hold" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S03", + "description": "Edit the boot environment", + "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", + "command": [ + "nano /boot/armbianEnv.txt" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "S04", + "description": "Install Linux headers", + "command": [ + "Headers_install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "! are_headers_installed" + }, + { + "id": "S05", + "description": "Remove Linux headers", + "command": [ + "Headers_remove" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "are_headers_installed" + }, + { + "id": "S06", + "description": "Install to internal storage", + "command": [ + "armbian-install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ -n $(ls /sbin/armbian-install) ]]" + }, + { + "id": "S07.1", + "description": "Manage SSH login options", + "sub": [ + { + "id": "S07", + "description": "Disable root login", + "command": [ + "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" + }, + { + "id": "S08", + "description": "Enable root login", + "command": [ + "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" + }, + { + "id": "S09", + "description": "Disable password login", + "command": [ + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S10", + "description": "Enable password login", + "command": [ + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" + }, + { + "id": "S11", + "description": "Disable Public key authentication login", + "command": [ + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S12", + "description": "Enable Public key authentication login", + "command": [ + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" + }, + { + "id": "S13", + "description": "Disable OTP authentication", + "command": [ + "clear", + "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S14", + "description": "Enable OTP authentication", + "command": [ + "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", + "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", + "[ ! -f /root/.google_authenticator ] && qr_code generate", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" + }, + { + "id": "S15", + "description": "Generate new OTP authentication QR code", + "command": [ + "qr_code generate" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S16", + "description": "Show OTP authentication QR code", + "command": [ + "qr_code" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" + }, + { + "id": "S30", + "description": "Disable last login banner", + "command": [ + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" + }, + { + "id": "S31", + "description": "Enable last login banner", + "command": [ + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" + } + ] + }, + { + "id": "S17", + "description": "Change shell system wide to BASH", + "command": [ + "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" + }, + { + "id": "S18", + "description": "Change shell system wide to ZSH", + "command": [ + "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" + }, + { + "id": "S19", + "description": "Switch to rolling release", + "prompt": "This will switch to rolling releases\n\nwould you like to continue?", + "command": [ + "set_rolling" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S20", + "description": "Switch to stable release", + "prompt": "This will switch to stable releases\n\nwould you like to continue?", + "command": [ + "set_stable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S21", + "description": "Enable read only filesystem", + "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs enable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" + }, + { + "id": "S22", + "description": "Disable read only filesystem", + "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs disable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" + }, + { + "id": "S23", + "description": "Adjust welcome screen (motd)", + "command": [ + "adjust_motd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /etc/default/armbian-motd ]" + }, + { + "id": "S24", + "description": "Install alternative kernels", + "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", + "command": [ + "switch_kernels" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "S25", + "description": "Distribution upgrades", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", + "sub": [ + { + "id": "S26", + "description": "Upgrade to latest stable / LTS", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade stable" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" + }, + { + "id": "S27", + "description": "Upgrade to rolling unstable", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade rolling" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" + } + ] + }, + { + "id": "S28", + "description": "Manage device tree overlays", + "command": [ + "manage_dtoverlays" + ], + "status": "Active", + "doc_link": "", + "src_reference": "", + "author": "Gunjan Gupta", + "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" + } + ] + }, + { + "id": "Help", + "description": "About this app", + "sub": [ + { + "id": "H00", + "description": "About This system. (WIP)", + "command": [ + "show_message <<< \"This app is to help execute procedures to configure your system\n\nSome options may not work on manually modified systems\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "H02", + "description": "List of Config function(WIP)", + "command": [ + "show_message <<< see_use" + ], + "status": "Disabled", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] + } + ] } From 19d0c74279ea077c1e8a8df1c96ea8a07b3f1181 Mon Sep 17 00:00:00 2001 From: tearran Date: Sun, 6 Oct 2024 22:37:23 -0500 Subject: [PATCH 4/6] fix code style error --- lib/armbian-configng/config.ng.jobs.json | 2024 +++++++++++----------- tools/config-jobs | 4 +- tools/json/config.help.json | 56 +- tools/json/config.localisation.json | 124 +- tools/json/config.network.json | 246 +-- tools/json/config.software.json | 816 ++++----- tools/json/config.system.json | 798 ++++----- 7 files changed, 2034 insertions(+), 2034 deletions(-) diff --git a/lib/armbian-configng/config.ng.jobs.json b/lib/armbian-configng/config.ng.jobs.json index 308239300..fa4ebc667 100644 --- a/lib/armbian-configng/config.ng.jobs.json +++ b/lib/armbian-configng/config.ng.jobs.json @@ -1,1024 +1,1024 @@ { - "menu": [ - { - "id": "Localisation", - "description": "Localisation", - "sub": [ + "menu": [ { - "id": "L00", - "description": "Change Global timezone (WIP)", - "command": [ - "dpkg-reconfigure tzdata" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" + "id": "Localisation", + "description": "Localisation", + "sub": [ + { + "id": "L00", + "description": "Change Global timezone (WIP)", + "command": [ + "dpkg-reconfigure tzdata" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L01", + "description": "Change Locales reconfigure the language and character set", + "command": [ + "dpkg-reconfigure locales", + "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", + "export LANGUAGE=$LANG" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L02", + "description": "Change Keyboard layout", + "command": [ + "dpkg-reconfigure keyboard-configuration ; setupcon ", + "update-initramfs -u" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L03", + "description": "Change APT mirrors", + "prompt": "This will change the APT mirrors\nWould you like to continue?", + "command": [ + "get_user_continue \"This is only a frontend test\" process_input" + ], + "status": "Disabled", + "author": "" + }, + { + "id": "L04", + "description": "Change System Hostname", + "command": [ + "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", + "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" + ], + "status": "Preview", + "author": "" + } + ] }, { - "id": "L01", - "description": "Change Locales reconfigure the language and character set", - "command": [ - "dpkg-reconfigure locales", - "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", - "export LANGUAGE=$LANG" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" + "id": "Network", + "description": "Fixed and wireless network settings", + "sub": [ + { + "id": "N01", + "description": "Configure network interfaces", + "sub": [ + { + "id": "N02", + "description": "Add interface", + "command": [ + "network_config armbian" + ], + "status": "Preview", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "N03", + "description": "Revert to defaults", + "command": [ + "default_network_config" + ], + "status": "Preview", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" + }, + { + "id": "N04", + "description": "Show draft configuration", + "command": [ + "show_message <<< \"$(netplan get all)\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]]" + }, + { + "id": "N05", + "description": "Apply changes", + "prompt": "This will apply new network configuration\n\nwould you like to continue?", + "command": [ + "netplan apply" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" + }, + { + "id": "N06", + "description": "Show active status", + "command": [ + "show_message <<< \"$(netplan status --all)\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" + } + ] + }, + { + "id": "N15", + "description": "Install Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" + }, + { + "id": "N16", + "description": "Remove Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", + "debconf-apt-progress -- apt -y -qq autoremove" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N17", + "description": "Bluetooth Discover", + "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", + "command": [ + "connect_bt_interface" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N18", + "description": "Toggle system IPv6/IPv4 internet protocol", + "prompt": "This will toggle your internet protocol\nWould you like to continue?", + "command": [ + "toggle_ipv6 | show_infobox" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] }, { - "id": "L02", - "description": "Change Keyboard layout", - "command": [ - "dpkg-reconfigure keyboard-configuration ; setupcon ", - "update-initramfs -u" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" + "id": "Software", + "description": "Run/Install 3rd party applications", + "sub": [ + { + "id": "Desktops", + "description": "Install Desktop Environments", + "sub": [ + { + "id": "SW02", + "description": "Install XFCE desktop", + "command": [ + "install_de \"xfce\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW03", + "description": "Install Gnome desktop", + "command": [ + "install_de \"gnome\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW04", + "description": "Install i3-wm desktop", + "command": [ + "install_de \"i3-wm\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW05", + "description": "Install Cinnamon desktop", + "command": [ + "install_de \"cinnamon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW06", + "description": "Install kde-neon desktop", + "command": [ + "install_de \"kde-neon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + } + ] + }, + { + "id": "Netconfig", + "description": "Network tools", + "sub": [ + { + "id": "SW08", + "description": "Install realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install nload" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed nload" + }, + { + "id": "SW09", + "description": "Remove realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge nload" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed nload" + }, + { + "id": "SW10", + "description": "Install bandwidth measuring tool (iperf3)", + "command": [ + "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iperf3" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed iperf3" + }, + { + "id": "SW11", + "description": "Remove bandwidth measuring tool (iperf3)", + "command": [ + "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iperf3" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed iperf3" + }, + { + "id": "SW12", + "description": "Install IP LAN monitor (iptraf-ng)", + "command": [ + "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iptraf-ng" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed iptraf-ng" + }, + { + "id": "SW13", + "description": "Remove IP LAN monitor (iptraf-ng)", + "command": [ + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iptraf-ng" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed iptraf-ng" + }, + { + "id": "SW14", + "description": "Install hostname broadcast via mDNS (avahi-daemon)", + "command": [ + "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", + "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", + "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", + "service avahi-daemon restart" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed avahi-daemon" + }, + { + "id": "SW15", + "description": "Remove hostname broadcast via mDNS (avahi-daemon)", + "command": [ + "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "systemctl stop avahi-daemon avahi-daemon.socket", + "debconf-apt-progress -- apt-get -y purge avahi-daemon" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed avahi-daemon" + } + ] + }, + { + "id": "DevTools", + "description": "Development", + "sub": [ + { + "id": "SW17", + "description": "Install tools for cloning and managing repositories (git)", + "command": [ + "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install git" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed git" + }, + { + "id": "SW18", + "description": "Remove tools for cloning and managing repositories (git)", + "command": [ + "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge git" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed git" + } + ] + }, + { + "id": "Benchy", + "description": "System benchmaking and diagnostics", + "command": [ + "see_monitoring" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /usr/bin/armbianmonitor ]" + }, + { + "id": "Containers", + "description": "Containerlization and Virtual Machines", + "sub": [ + { + "id": "SW25", + "description": "Install Docker Minimal", + "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", + "command": [ + "install_docker" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-ce" + }, + { + "id": "SW26", + "description": "Install Docker Engine", + "prompt": "This operation will install Docker Engine.\nWould you like to continue?", + "command": [ + "install_docker engine" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-compose-plugin" + }, + { + "id": "SW27", + "description": "Remove Docker", + "prompt": "This operation will purge Docker.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed docker-ce" + }, + { + "id": "SW28", + "description": "Purge all Docker images, containers, and volumes", + "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", + "command": [ + "rm -rf /var/lib/docker", + "rm -rf /var/lib/containerd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" + } + ] + }, + { + "id": "Media", + "description": "Media Servers and Editors", + "sub": [ + { + "id": "SW21", + "description": "Install Plex Media server", + "prompt": "This operation will install Plex Media server.\nWould you like to continue?", + "command": [ + "install_plexmediaserver" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed plexmediaserver" + }, + { + "id": "SW22", + "description": "Remove Plex Media server", + "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt-get -y purge plexmediaserver", + "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed plexmediaserver" + }, + { + "id": "SW23", + "description": "Install Emby server", + "prompt": "This operation will install Emby server.\nWould you like to continue?", + "command": [ + "install_embyserver" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed emby-server" + }, + { + "id": "SW24", + "description": "Remove Emby server", + "prompt": "This operation will purge Emby server.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge emby-server" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed emby-server" + } + ] + }, + { + "id": "Management", + "description": "Remote Management tools", + "sub": [ + { + "id": "M00", + "description": "Install Cockpit web-based management tool", + "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", + "command": [ + "see_current_apt update", + "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed cockpit" + }, + { + "id": "M01", + "description": "Purge Cockpit web-based management tool", + "prompt": "This operation will purge Cockpit.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge cockpit" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit" + }, + { + "id": "M02", + "description": "Start Cockpit Service", + "command": [ + "sudo systemctl enable --now cockpit.socket | show_infobox " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" + }, + { + "id": "M03", + "description": "Stop Cockpit Service", + "command": [ + "systemctl stop cockpit cockpit.socket", + "systemctl disable cockpit.socket | show_infobox " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" + } + ] + } + ] }, { - "id": "L03", - "description": "Change APT mirrors", - "prompt": "This will change the APT mirrors\nWould you like to continue?", - "command": [ - "get_user_continue \"This is only a frontend test\" process_input" - ], - "status": "Disabled", - "author": "" + "id": "System", + "description": "System wide and admin settings", + "sub": [ + { + "id": "S01", + "description": "Enable Armbian kernel/firmware upgrades", + "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", + "command": [ + "armbian_fw_manipulate unhold" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[[ -n \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S02", + "description": "Disable Armbian kernel upgrades", + "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", + "command": [ + "armbian_fw_manipulate hold" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S03", + "description": "Edit the boot environment", + "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", + "command": [ + "nano /boot/armbianEnv.txt" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "S04", + "description": "Install Linux headers", + "command": [ + "Headers_install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "! are_headers_installed" + }, + { + "id": "S05", + "description": "Remove Linux headers", + "command": [ + "Headers_remove" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "are_headers_installed" + }, + { + "id": "S06", + "description": "Install to internal storage", + "command": [ + "armbian-install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ -n $(ls /sbin/armbian-install) ]]" + }, + { + "id": "S07.1", + "description": "Manage SSH login options", + "sub": [ + { + "id": "S07", + "description": "Disable root login", + "command": [ + "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" + }, + { + "id": "S08", + "description": "Enable root login", + "command": [ + "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" + }, + { + "id": "S09", + "description": "Disable password login", + "command": [ + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S10", + "description": "Enable password login", + "command": [ + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" + }, + { + "id": "S11", + "description": "Disable Public key authentication login", + "command": [ + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S12", + "description": "Enable Public key authentication login", + "command": [ + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" + }, + { + "id": "S13", + "description": "Disable OTP authentication", + "command": [ + "clear", + "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S14", + "description": "Enable OTP authentication", + "command": [ + "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", + "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", + "[ ! -f /root/.google_authenticator ] && qr_code generate", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" + }, + { + "id": "S15", + "description": "Generate new OTP authentication QR code", + "command": [ + "qr_code generate" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S16", + "description": "Show OTP authentication QR code", + "command": [ + "qr_code" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" + }, + { + "id": "S30", + "description": "Disable last login banner", + "command": [ + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" + }, + { + "id": "S31", + "description": "Enable last login banner", + "command": [ + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" + } + ] + }, + { + "id": "S17", + "description": "Change shell system wide to BASH", + "command": [ + "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" + }, + { + "id": "S18", + "description": "Change shell system wide to ZSH", + "command": [ + "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" + }, + { + "id": "S19", + "description": "Switch to rolling release", + "prompt": "This will switch to rolling releases\n\nwould you like to continue?", + "command": [ + "set_rolling" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S20", + "description": "Switch to stable release", + "prompt": "This will switch to stable releases\n\nwould you like to continue?", + "command": [ + "set_stable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S21", + "description": "Enable read only filesystem", + "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs enable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" + }, + { + "id": "S22", + "description": "Disable read only filesystem", + "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs disable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" + }, + { + "id": "S23", + "description": "Adjust welcome screen (motd)", + "command": [ + "adjust_motd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /etc/default/armbian-motd ]" + }, + { + "id": "S24", + "description": "Install alternative kernels", + "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", + "command": [ + "switch_kernels" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "S25", + "description": "Distribution upgrades", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", + "sub": [ + { + "id": "S26", + "description": "Upgrade to latest stable / LTS", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade stable" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" + }, + { + "id": "S27", + "description": "Upgrade to rolling unstable", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade rolling" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" + } + ] + }, + { + "id": "S28", + "description": "Manage device tree overlays", + "command": [ + "manage_dtoverlays" + ], + "status": "Active", + "doc_link": "", + "src_reference": "", + "author": "Gunjan Gupta", + "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" + } + ] }, { - "id": "L04", - "description": "Change System Hostname", - "command": [ - "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", - "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" - ], - "status": "Preview", - "author": "" + "id": "Help", + "description": "About this app", + "sub": [ + { + "id": "H00", + "description": "About This system. (WIP)", + "command": [ + "show_message <<< \"This app is to help execute procedures to configure your system\n\nSome options may not work on manually modified systems\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "H02", + "description": "List of Config function(WIP)", + "command": [ + "show_message <<< see_use" + ], + "status": "Disabled", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] } - ] - }, - { - "id": "Network", - "description": "Fixed and wireless network settings", - "sub": [ - { - "id": "N01", - "description": "Configure network interfaces", - "sub": [ - { - "id": "N02", - "description": "Add interface", - "command": [ - "network_config armbian" - ], - "status": "Preview", - "author": "Igor Pecovnik", - "condition": "" - }, - { - "id": "N03", - "description": "Revert to defaults", - "command": [ - "default_network_config" - ], - "status": "Preview", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" - }, - { - "id": "N04", - "description": "Show draft configuration", - "command": [ - "show_message <<< \"$(netplan get all)\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]]" - }, - { - "id": "N05", - "description": "Apply changes", - "prompt": "This will apply new network configuration\n\nwould you like to continue?", - "command": [ - "netplan apply" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" - }, - { - "id": "N06", - "description": "Show active status", - "command": [ - "show_message <<< \"$(netplan status --all)\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" - } - ] - }, - { - "id": "N15", - "description": "Install Bluetooth support", - "command": [ - "see_current_apt ", - "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", - "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" - }, - { - "id": "N16", - "description": "Remove Bluetooth support", - "command": [ - "see_current_apt ", - "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", - "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", - "debconf-apt-progress -- apt -y -qq autoremove" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" - }, - { - "id": "N17", - "description": "Bluetooth Discover", - "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", - "command": [ - "connect_bt_interface" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" - }, - { - "id": "N18", - "description": "Toggle system IPv6/IPv4 internet protocol", - "prompt": "This will toggle your internet protocol\nWould you like to continue?", - "command": [ - "toggle_ipv6 | show_infobox" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - } - ] - }, - { - "id": "Software", - "description": "Run/Install 3rd party applications", - "sub": [ - { - "id": "Desktops", - "description": "Install Desktop Environments", - "sub": [ - { - "id": "SW02", - "description": "Install XFCE desktop", - "command": [ - "install_de \"xfce\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW03", - "description": "Install Gnome desktop", - "command": [ - "install_de \"gnome\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW04", - "description": "Install i3-wm desktop", - "command": [ - "install_de \"i3-wm\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW05", - "description": "Install Cinnamon desktop", - "command": [ - "install_de \"cinnamon\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW06", - "description": "Install kde-neon desktop", - "command": [ - "install_de \"kde-neon\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - } - ] - }, - { - "id": "Netconfig", - "description": "Network tools", - "sub": [ - { - "id": "SW08", - "description": "Install realtime console network usage monitor (nload)", - "command": [ - "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install nload" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed nload" - }, - { - "id": "SW09", - "description": "Remove realtime console network usage monitor (nload)", - "command": [ - "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge nload" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed nload" - }, - { - "id": "SW10", - "description": "Install bandwidth measuring tool (iperf3)", - "command": [ - "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install iperf3" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed iperf3" - }, - { - "id": "SW11", - "description": "Remove bandwidth measuring tool (iperf3)", - "command": [ - "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge iperf3" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed iperf3" - }, - { - "id": "SW12", - "description": "Install IP LAN monitor (iptraf-ng)", - "command": [ - "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install iptraf-ng" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed iptraf-ng" - }, - { - "id": "SW13", - "description": "Remove IP LAN monitor (iptraf-ng)", - "command": [ - "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge iptraf-ng" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed iptraf-ng" - }, - { - "id": "SW14", - "description": "Install hostname broadcast via mDNS (avahi-daemon)", - "command": [ - "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", - "check_if_installed avahi-daemon", - "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", - "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", - "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", - "service avahi-daemon restart" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed avahi-daemon" - }, - { - "id": "SW15", - "description": "Remove hostname broadcast via mDNS (avahi-daemon)", - "command": [ - "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", - "check_if_installed avahi-daemon", - "systemctl stop avahi-daemon avahi-daemon.socket", - "debconf-apt-progress -- apt-get -y purge avahi-daemon" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed avahi-daemon" - } - ] - }, - { - "id": "DevTools", - "description": "Development", - "sub": [ - { - "id": "SW17", - "description": "Install tools for cloning and managing repositories (git)", - "command": [ - "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install git" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed git" - }, - { - "id": "SW18", - "description": "Remove tools for cloning and managing repositories (git)", - "command": [ - "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge git" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed git" - } - ] - }, - { - "id": "Benchy", - "description": "System benchmaking and diagnostics", - "command": [ - "see_monitoring" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[ -f /usr/bin/armbianmonitor ]" - }, - { - "id": "Containers", - "description": "Containerlization and Virtual Machines", - "sub": [ - { - "id": "SW25", - "description": "Install Docker Minimal", - "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", - "command": [ - "install_docker" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-ce" - }, - { - "id": "SW26", - "description": "Install Docker Engine", - "prompt": "This operation will install Docker Engine.\nWould you like to continue?", - "command": [ - "install_docker engine" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-compose-plugin" - }, - { - "id": "SW27", - "description": "Remove Docker", - "prompt": "This operation will purge Docker.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed docker-ce" - }, - { - "id": "SW28", - "description": "Purge all Docker images, containers, and volumes", - "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", - "command": [ - "rm -rf /var/lib/docker", - "rm -rf /var/lib/containerd" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" - } - ] - }, - { - "id": "Media", - "description": "Media Servers and Editors", - "sub": [ - { - "id": "SW21", - "description": "Install Plex Media server", - "prompt": "This operation will install Plex Media server.\nWould you like to continue?", - "command": [ - "install_plexmediaserver" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed plexmediaserver" - }, - { - "id": "SW22", - "description": "Remove Plex Media server", - "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt-get -y purge plexmediaserver", - "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed plexmediaserver" - }, - { - "id": "SW23", - "description": "Install Emby server", - "prompt": "This operation will install Emby server.\nWould you like to continue?", - "command": [ - "install_embyserver" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed emby-server" - }, - { - "id": "SW24", - "description": "Remove Emby server", - "prompt": "This operation will purge Emby server.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge emby-server" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed emby-server" - } - ] - }, - { - "id": "Management", - "description": "Remote Management tools", - "sub": [ - { - "id": "M00", - "description": "Install Cockpit web-based management tool", - "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", - "command": [ - "see_current_apt update", - "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed cockpit" - }, - { - "id": "M01", - "description": "Purge Cockpit web-based management tool", - "prompt": "This operation will purge Cockpit.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge cockpit" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit" - }, - { - "id": "M02", - "description": "Start Cockpit Service", - "command": [ - "sudo systemctl enable --now cockpit.socket | show_infobox " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" - }, - { - "id": "M03", - "description": "Stop Cockpit Service", - "command": [ - "systemctl stop cockpit cockpit.socket", - "systemctl disable cockpit.socket | show_infobox " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" - } - ] - } - ] - }, - { - "id": "System", - "description": "System wide and admin settings", - "sub": [ - { - "id": "S01", - "description": "Enable Armbian kernel/firmware upgrades", - "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", - "command": [ - "armbian_fw_manipulate unhold" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[[ -n \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S02", - "description": "Disable Armbian kernel upgrades", - "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", - "command": [ - "armbian_fw_manipulate hold" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S03", - "description": "Edit the boot environment", - "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", - "command": [ - "nano /boot/armbianEnv.txt" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "S04", - "description": "Install Linux headers", - "command": [ - "Headers_install" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", - "author": "https://github.com/Tearran", - "condition": "! are_headers_installed" - }, - { - "id": "S05", - "description": "Remove Linux headers", - "command": [ - "Headers_remove" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", - "author": "https://github.com/Tearran", - "condition": "are_headers_installed" - }, - { - "id": "S06", - "description": "Install to internal storage", - "command": [ - "armbian-install" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ -n $(ls /sbin/armbian-install) ]]" - }, - { - "id": "S07.1", - "description": "Manage SSH login options", - "sub": [ - { - "id": "S07", - "description": "Disable root login", - "command": [ - "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" - }, - { - "id": "S08", - "description": "Enable root login", - "command": [ - "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" - }, - { - "id": "S09", - "description": "Disable password login", - "command": [ - "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S10", - "description": "Enable password login", - "command": [ - "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" - }, - { - "id": "S11", - "description": "Disable Public key authentication login", - "command": [ - "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S12", - "description": "Enable Public key authentication login", - "command": [ - "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" - }, - { - "id": "S13", - "description": "Disable OTP authentication", - "command": [ - "clear", - "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", - "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", - "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S14", - "description": "Enable OTP authentication", - "command": [ - "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", - "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", - "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", - "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", - "[ ! -f /root/.google_authenticator ] && qr_code generate", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" - }, - { - "id": "S15", - "description": "Generate new OTP authentication QR code", - "command": [ - "qr_code generate" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S16", - "description": "Show OTP authentication QR code", - "command": [ - "qr_code" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" - }, - { - "id": "S30", - "description": "Disable last login banner", - "command": [ - "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" - }, - { - "id": "S31", - "description": "Enable last login banner", - "command": [ - "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" - } - ] - }, - { - "id": "S17", - "description": "Change shell system wide to BASH", - "command": [ - "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", - "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", - "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", - "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", - "update_skel", - "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" - }, - { - "id": "S18", - "description": "Change shell system wide to ZSH", - "command": [ - "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", - "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", - "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", - "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", - "update_skel", - "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" - }, - { - "id": "S19", - "description": "Switch to rolling release", - "prompt": "This will switch to rolling releases\n\nwould you like to continue?", - "command": [ - "set_rolling" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", - "author": "Igor Pecovnik", - "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S20", - "description": "Switch to stable release", - "prompt": "This will switch to stable releases\n\nwould you like to continue?", - "command": [ - "set_stable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", - "author": "Igor Pecovnik", - "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S21", - "description": "Enable read only filesystem", - "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", - "command": [ - "manage_overlayfs enable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" - }, - { - "id": "S22", - "description": "Disable read only filesystem", - "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", - "command": [ - "manage_overlayfs disable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" - }, - { - "id": "S23", - "description": "Adjust welcome screen (motd)", - "command": [ - "adjust_motd" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[ -f /etc/default/armbian-motd ]" - }, - { - "id": "S24", - "description": "Install alternative kernels", - "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", - "command": [ - "switch_kernels" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "" - }, - { - "id": "S25", - "description": "Distribution upgrades", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", - "sub": [ - { - "id": "S26", - "description": "Upgrade to latest stable / LTS", - "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", - "command": [ - "release_upgrade stable" - ], - "status": "Active", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" - }, - { - "id": "S27", - "description": "Upgrade to rolling unstable", - "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", - "command": [ - "release_upgrade rolling" - ], - "status": "Active", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" - } - ] - }, - { - "id": "S28", - "description": "Manage device tree overlays", - "command": [ - "manage_dtoverlays" - ], - "status": "Active", - "doc_link": "", - "src_reference": "", - "author": "Gunjan Gupta", - "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" - } - ] - }, - { - "id": "Help", - "description": "About this app", - "sub": [ - { - "id": "H00", - "description": "About This system. (WIP)", - "command": [ - "show_message <<< \"This app is to help execute procedures to configure your system\n\nSome options may not work on manually modified systems\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "H02", - "description": "List of Config function(WIP)", - "command": [ - "show_message <<< see_use" - ], - "status": "Disabled", - "doc_link": "", - "src_reference": "", - "author": "" - } - ] - } - ] + ] } diff --git a/tools/config-jobs b/tools/config-jobs index bc60d18ce..99701e242 100755 --- a/tools/config-jobs +++ b/tools/config-jobs @@ -43,7 +43,7 @@ split_json() { filename=$(echo "$menu_id" | tr '[:upper:]' '[:lower:]') # Convert filename to lowercase # Save backup file with proper indentation - echo "{\"menu\": [$item]}" | jq '.' > "$output_dir/config.${filename}.json" + echo "{\"menu\": [$item]}" | jq --indent 4 '.' > "$output_dir/config.${filename}.json" # Extract 'sub' and replace it with 'menu' if it exists # jq ".menu[$i] | if has(\"sub\") then .sub | {menu: .} else {menu: [.] } end" "$input_file" > "$output_dir/config.${filename}.json" @@ -91,7 +91,7 @@ join_json() { final_json=$(jq -n --argjson menu "$merged_json" '{"menu": $menu}') # Write the final JSON structure to a file - echo "$final_json" | jq '.' > "$output_file" + echo "$final_json" | jq --indent 4 '.' > "$output_file" echo "JSON files rejoined into '$output_file'." } diff --git a/tools/json/config.help.json b/tools/json/config.help.json index b0ccdec89..a48ac95d6 100644 --- a/tools/json/config.help.json +++ b/tools/json/config.help.json @@ -1,32 +1,32 @@ { - "menu": [ - { - "id": "Help", - "description": "About this app", - "sub": [ + "menu": [ { - "id": "H00", - "description": "About This system. (WIP)", - "command": [ - "show_message <<< \"This app is to help execute procedures to configure your system\n\nSome options may not work on manually modified systems\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "H02", - "description": "List of Config function(WIP)", - "command": [ - "show_message <<< see_use" - ], - "status": "Disabled", - "doc_link": "", - "src_reference": "", - "author": "" + "id": "Help", + "description": "About this app", + "sub": [ + { + "id": "H00", + "description": "About This system. (WIP)", + "command": [ + "show_message <<< \"This app is to help execute procedures to configure your system\n\nSome options may not work on manually modified systems\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "H02", + "description": "List of Config function(WIP)", + "command": [ + "show_message <<< see_use" + ], + "status": "Disabled", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] } - ] - } - ] + ] } diff --git a/tools/json/config.localisation.json b/tools/json/config.localisation.json index 0229d9617..d05486bf8 100644 --- a/tools/json/config.localisation.json +++ b/tools/json/config.localisation.json @@ -1,66 +1,66 @@ { - "menu": [ - { - "id": "Localisation", - "description": "Localisation", - "sub": [ + "menu": [ { - "id": "L00", - "description": "Change Global timezone (WIP)", - "command": [ - "dpkg-reconfigure tzdata" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "L01", - "description": "Change Locales reconfigure the language and character set", - "command": [ - "dpkg-reconfigure locales", - "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", - "export LANGUAGE=$LANG" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "L02", - "description": "Change Keyboard layout", - "command": [ - "dpkg-reconfigure keyboard-configuration ; setupcon ", - "update-initramfs -u" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "L03", - "description": "Change APT mirrors", - "prompt": "This will change the APT mirrors\nWould you like to continue?", - "command": [ - "get_user_continue \"This is only a frontend test\" process_input" - ], - "status": "Disabled", - "author": "" - }, - { - "id": "L04", - "description": "Change System Hostname", - "command": [ - "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", - "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" - ], - "status": "Preview", - "author": "" + "id": "Localisation", + "description": "Localisation", + "sub": [ + { + "id": "L00", + "description": "Change Global timezone (WIP)", + "command": [ + "dpkg-reconfigure tzdata" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L01", + "description": "Change Locales reconfigure the language and character set", + "command": [ + "dpkg-reconfigure locales", + "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", + "export LANGUAGE=$LANG" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L02", + "description": "Change Keyboard layout", + "command": [ + "dpkg-reconfigure keyboard-configuration ; setupcon ", + "update-initramfs -u" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L03", + "description": "Change APT mirrors", + "prompt": "This will change the APT mirrors\nWould you like to continue?", + "command": [ + "get_user_continue \"This is only a frontend test\" process_input" + ], + "status": "Disabled", + "author": "" + }, + { + "id": "L04", + "description": "Change System Hostname", + "command": [ + "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", + "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" + ], + "status": "Preview", + "author": "" + } + ] } - ] - } - ] + ] } diff --git a/tools/json/config.network.json b/tools/json/config.network.json index 5a6a9c32a..2952939f9 100644 --- a/tools/json/config.network.json +++ b/tools/json/config.network.json @@ -1,127 +1,127 @@ { - "menu": [ - { - "id": "Network", - "description": "Fixed and wireless network settings", - "sub": [ + "menu": [ { - "id": "N01", - "description": "Configure network interfaces", - "sub": [ - { - "id": "N02", - "description": "Add interface", - "command": [ - "network_config armbian" - ], - "status": "Preview", - "author": "Igor Pecovnik", - "condition": "" - }, - { - "id": "N03", - "description": "Revert to defaults", - "command": [ - "default_network_config" - ], - "status": "Preview", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" - }, - { - "id": "N04", - "description": "Show draft configuration", - "command": [ - "show_message <<< \"$(netplan get all)\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]]" - }, - { - "id": "N05", - "description": "Apply changes", - "prompt": "This will apply new network configuration\n\nwould you like to continue?", - "command": [ - "netplan apply" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" - }, - { - "id": "N06", - "description": "Show active status", - "command": [ - "show_message <<< \"$(netplan status --all)\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" - } - ] - }, - { - "id": "N15", - "description": "Install Bluetooth support", - "command": [ - "see_current_apt ", - "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", - "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" - }, - { - "id": "N16", - "description": "Remove Bluetooth support", - "command": [ - "see_current_apt ", - "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", - "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", - "debconf-apt-progress -- apt -y -qq autoremove" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" - }, - { - "id": "N17", - "description": "Bluetooth Discover", - "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", - "command": [ - "connect_bt_interface" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" - }, - { - "id": "N18", - "description": "Toggle system IPv6/IPv4 internet protocol", - "prompt": "This will toggle your internet protocol\nWould you like to continue?", - "command": [ - "toggle_ipv6 | show_infobox" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" + "id": "Network", + "description": "Fixed and wireless network settings", + "sub": [ + { + "id": "N01", + "description": "Configure network interfaces", + "sub": [ + { + "id": "N02", + "description": "Add interface", + "command": [ + "network_config armbian" + ], + "status": "Preview", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "N03", + "description": "Revert to defaults", + "command": [ + "default_network_config" + ], + "status": "Preview", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" + }, + { + "id": "N04", + "description": "Show draft configuration", + "command": [ + "show_message <<< \"$(netplan get all)\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]]" + }, + { + "id": "N05", + "description": "Apply changes", + "prompt": "This will apply new network configuration\n\nwould you like to continue?", + "command": [ + "netplan apply" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" + }, + { + "id": "N06", + "description": "Show active status", + "command": [ + "show_message <<< \"$(netplan status --all)\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" + } + ] + }, + { + "id": "N15", + "description": "Install Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" + }, + { + "id": "N16", + "description": "Remove Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", + "debconf-apt-progress -- apt -y -qq autoremove" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N17", + "description": "Bluetooth Discover", + "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", + "command": [ + "connect_bt_interface" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N18", + "description": "Toggle system IPv6/IPv4 internet protocol", + "prompt": "This will toggle your internet protocol\nWould you like to continue?", + "command": [ + "toggle_ipv6 | show_infobox" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] } - ] - } - ] + ] } diff --git a/tools/json/config.software.json b/tools/json/config.software.json index 147438001..5a2745326 100644 --- a/tools/json/config.software.json +++ b/tools/json/config.software.json @@ -1,412 +1,412 @@ { - "menu": [ - { - "id": "Software", - "description": "Run/Install 3rd party applications", - "sub": [ + "menu": [ { - "id": "Desktops", - "description": "Install Desktop Environments", - "sub": [ - { - "id": "SW02", - "description": "Install XFCE desktop", - "command": [ - "install_de \"xfce\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW03", - "description": "Install Gnome desktop", - "command": [ - "install_de \"gnome\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW04", - "description": "Install i3-wm desktop", - "command": [ - "install_de \"i3-wm\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW05", - "description": "Install Cinnamon desktop", - "command": [ - "install_de \"cinnamon\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - }, - { - "id": "SW06", - "description": "Install kde-neon desktop", - "command": [ - "install_de \"kde-neon\"" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "" - } - ] - }, - { - "id": "Netconfig", - "description": "Network tools", - "sub": [ - { - "id": "SW08", - "description": "Install realtime console network usage monitor (nload)", - "command": [ - "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install nload" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed nload" - }, - { - "id": "SW09", - "description": "Remove realtime console network usage monitor (nload)", - "command": [ - "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge nload" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed nload" - }, - { - "id": "SW10", - "description": "Install bandwidth measuring tool (iperf3)", - "command": [ - "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install iperf3" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed iperf3" - }, - { - "id": "SW11", - "description": "Remove bandwidth measuring tool (iperf3)", - "command": [ - "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge iperf3" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed iperf3" - }, - { - "id": "SW12", - "description": "Install IP LAN monitor (iptraf-ng)", - "command": [ - "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install iptraf-ng" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed iptraf-ng" - }, - { - "id": "SW13", - "description": "Remove IP LAN monitor (iptraf-ng)", - "command": [ - "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge iptraf-ng" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed iptraf-ng" - }, - { - "id": "SW14", - "description": "Install hostname broadcast via mDNS (avahi-daemon)", - "command": [ - "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", - "check_if_installed avahi-daemon", - "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", - "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", - "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", - "service avahi-daemon restart" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed avahi-daemon" - }, - { - "id": "SW15", - "description": "Remove hostname broadcast via mDNS (avahi-daemon)", - "command": [ - "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", - "check_if_installed avahi-daemon", - "systemctl stop avahi-daemon avahi-daemon.socket", - "debconf-apt-progress -- apt-get -y purge avahi-daemon" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed avahi-daemon" - } - ] - }, - { - "id": "DevTools", - "description": "Development", - "sub": [ - { - "id": "SW17", - "description": "Install tools for cloning and managing repositories (git)", - "command": [ - "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install git" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed git" - }, - { - "id": "SW18", - "description": "Remove tools for cloning and managing repositories (git)", - "command": [ - "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge git" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed git" - } - ] - }, - { - "id": "Benchy", - "description": "System benchmaking and diagnostics", - "command": [ - "see_monitoring" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[ -f /usr/bin/armbianmonitor ]" - }, - { - "id": "Containers", - "description": "Containerlization and Virtual Machines", - "sub": [ - { - "id": "SW25", - "description": "Install Docker Minimal", - "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", - "command": [ - "install_docker" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-ce" - }, - { - "id": "SW26", - "description": "Install Docker Engine", - "prompt": "This operation will install Docker Engine.\nWould you like to continue?", - "command": [ - "install_docker engine" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-compose-plugin" - }, - { - "id": "SW27", - "description": "Remove Docker", - "prompt": "This operation will purge Docker.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed docker-ce" - }, - { - "id": "SW28", - "description": "Purge all Docker images, containers, and volumes", - "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", - "command": [ - "rm -rf /var/lib/docker", - "rm -rf /var/lib/containerd" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" - } - ] - }, - { - "id": "Media", - "description": "Media Servers and Editors", - "sub": [ - { - "id": "SW21", - "description": "Install Plex Media server", - "prompt": "This operation will install Plex Media server.\nWould you like to continue?", - "command": [ - "install_plexmediaserver" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed plexmediaserver" - }, - { - "id": "SW22", - "description": "Remove Plex Media server", - "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt-get -y purge plexmediaserver", - "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed plexmediaserver" - }, - { - "id": "SW23", - "description": "Install Emby server", - "prompt": "This operation will install Emby server.\nWould you like to continue?", - "command": [ - "install_embyserver" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed emby-server" - }, - { - "id": "SW24", - "description": "Remove Emby server", - "prompt": "This operation will purge Emby server.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge emby-server" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed emby-server" - } - ] - }, - { - "id": "Management", - "description": "Remote Management tools", - "sub": [ - { - "id": "M00", - "description": "Install Cockpit web-based management tool", - "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", - "command": [ - "see_current_apt update", - "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed cockpit" - }, - { - "id": "M01", - "description": "Purge Cockpit web-based management tool", - "prompt": "This operation will purge Cockpit.\nWould you like to continue?", - "command": [ - "apt_install_wrapper apt -y purge cockpit" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit" - }, - { - "id": "M02", - "description": "Start Cockpit Service", - "command": [ - "sudo systemctl enable --now cockpit.socket | show_infobox " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" - }, - { - "id": "M03", - "description": "Stop Cockpit Service", - "command": [ - "systemctl stop cockpit cockpit.socket", - "systemctl disable cockpit.socket | show_infobox " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" - } - ] + "id": "Software", + "description": "Run/Install 3rd party applications", + "sub": [ + { + "id": "Desktops", + "description": "Install Desktop Environments", + "sub": [ + { + "id": "SW02", + "description": "Install XFCE desktop", + "command": [ + "install_de \"xfce\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW03", + "description": "Install Gnome desktop", + "command": [ + "install_de \"gnome\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW04", + "description": "Install i3-wm desktop", + "command": [ + "install_de \"i3-wm\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW05", + "description": "Install Cinnamon desktop", + "command": [ + "install_de \"cinnamon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + }, + { + "id": "SW06", + "description": "Install kde-neon desktop", + "command": [ + "install_de \"kde-neon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + } + ] + }, + { + "id": "Netconfig", + "description": "Network tools", + "sub": [ + { + "id": "SW08", + "description": "Install realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install nload" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed nload" + }, + { + "id": "SW09", + "description": "Remove realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge nload" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed nload" + }, + { + "id": "SW10", + "description": "Install bandwidth measuring tool (iperf3)", + "command": [ + "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iperf3" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed iperf3" + }, + { + "id": "SW11", + "description": "Remove bandwidth measuring tool (iperf3)", + "command": [ + "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iperf3" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed iperf3" + }, + { + "id": "SW12", + "description": "Install IP LAN monitor (iptraf-ng)", + "command": [ + "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iptraf-ng" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed iptraf-ng" + }, + { + "id": "SW13", + "description": "Remove IP LAN monitor (iptraf-ng)", + "command": [ + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iptraf-ng" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed iptraf-ng" + }, + { + "id": "SW14", + "description": "Install hostname broadcast via mDNS (avahi-daemon)", + "command": [ + "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", + "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", + "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", + "service avahi-daemon restart" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed avahi-daemon" + }, + { + "id": "SW15", + "description": "Remove hostname broadcast via mDNS (avahi-daemon)", + "command": [ + "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "systemctl stop avahi-daemon avahi-daemon.socket", + "debconf-apt-progress -- apt-get -y purge avahi-daemon" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed avahi-daemon" + } + ] + }, + { + "id": "DevTools", + "description": "Development", + "sub": [ + { + "id": "SW17", + "description": "Install tools for cloning and managing repositories (git)", + "command": [ + "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install git" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed git" + }, + { + "id": "SW18", + "description": "Remove tools for cloning and managing repositories (git)", + "command": [ + "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge git" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed git" + } + ] + }, + { + "id": "Benchy", + "description": "System benchmaking and diagnostics", + "command": [ + "see_monitoring" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /usr/bin/armbianmonitor ]" + }, + { + "id": "Containers", + "description": "Containerlization and Virtual Machines", + "sub": [ + { + "id": "SW25", + "description": "Install Docker Minimal", + "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", + "command": [ + "install_docker" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-ce" + }, + { + "id": "SW26", + "description": "Install Docker Engine", + "prompt": "This operation will install Docker Engine.\nWould you like to continue?", + "command": [ + "install_docker engine" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-compose-plugin" + }, + { + "id": "SW27", + "description": "Remove Docker", + "prompt": "This operation will purge Docker.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed docker-ce" + }, + { + "id": "SW28", + "description": "Purge all Docker images, containers, and volumes", + "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", + "command": [ + "rm -rf /var/lib/docker", + "rm -rf /var/lib/containerd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" + } + ] + }, + { + "id": "Media", + "description": "Media Servers and Editors", + "sub": [ + { + "id": "SW21", + "description": "Install Plex Media server", + "prompt": "This operation will install Plex Media server.\nWould you like to continue?", + "command": [ + "install_plexmediaserver" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed plexmediaserver" + }, + { + "id": "SW22", + "description": "Remove Plex Media server", + "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt-get -y purge plexmediaserver", + "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed plexmediaserver" + }, + { + "id": "SW23", + "description": "Install Emby server", + "prompt": "This operation will install Emby server.\nWould you like to continue?", + "command": [ + "install_embyserver" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed emby-server" + }, + { + "id": "SW24", + "description": "Remove Emby server", + "prompt": "This operation will purge Emby server.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge emby-server" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed emby-server" + } + ] + }, + { + "id": "Management", + "description": "Remote Management tools", + "sub": [ + { + "id": "M00", + "description": "Install Cockpit web-based management tool", + "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", + "command": [ + "see_current_apt update", + "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed cockpit" + }, + { + "id": "M01", + "description": "Purge Cockpit web-based management tool", + "prompt": "This operation will purge Cockpit.\nWould you like to continue?", + "command": [ + "apt_install_wrapper apt -y purge cockpit" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit" + }, + { + "id": "M02", + "description": "Start Cockpit Service", + "command": [ + "sudo systemctl enable --now cockpit.socket | show_infobox " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" + }, + { + "id": "M03", + "description": "Stop Cockpit Service", + "command": [ + "systemctl stop cockpit cockpit.socket", + "systemctl disable cockpit.socket | show_infobox " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" + } + ] + } + ] } - ] - } - ] + ] } diff --git a/tools/json/config.system.json b/tools/json/config.system.json index f1c425047..e1ea45088 100644 --- a/tools/json/config.system.json +++ b/tools/json/config.system.json @@ -1,403 +1,403 @@ { - "menu": [ - { - "id": "System", - "description": "System wide and admin settings", - "sub": [ + "menu": [ { - "id": "S01", - "description": "Enable Armbian kernel/firmware upgrades", - "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", - "command": [ - "armbian_fw_manipulate unhold" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[[ -n \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S02", - "description": "Disable Armbian kernel upgrades", - "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", - "command": [ - "armbian_fw_manipulate hold" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S03", - "description": "Edit the boot environment", - "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", - "command": [ - "nano /boot/armbianEnv.txt" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "S04", - "description": "Install Linux headers", - "command": [ - "Headers_install" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", - "author": "https://github.com/Tearran", - "condition": "! are_headers_installed" - }, - { - "id": "S05", - "description": "Remove Linux headers", - "command": [ - "Headers_remove" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", - "author": "https://github.com/Tearran", - "condition": "are_headers_installed" - }, - { - "id": "S06", - "description": "Install to internal storage", - "command": [ - "armbian-install" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ -n $(ls /sbin/armbian-install) ]]" - }, - { - "id": "S07.1", - "description": "Manage SSH login options", - "sub": [ - { - "id": "S07", - "description": "Disable root login", - "command": [ - "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" - }, - { - "id": "S08", - "description": "Enable root login", - "command": [ - "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" - }, - { - "id": "S09", - "description": "Disable password login", - "command": [ - "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S10", - "description": "Enable password login", - "command": [ - "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" - }, - { - "id": "S11", - "description": "Disable Public key authentication login", - "command": [ - "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S12", - "description": "Enable Public key authentication login", - "command": [ - "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" - }, - { - "id": "S13", - "description": "Disable OTP authentication", - "command": [ - "clear", - "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", - "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", - "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S14", - "description": "Enable OTP authentication", - "command": [ - "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", - "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", - "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", - "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", - "[ ! -f /root/.google_authenticator ] && qr_code generate", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" - }, - { - "id": "S15", - "description": "Generate new OTP authentication QR code", - "command": [ - "qr_code generate" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" - }, - { - "id": "S16", - "description": "Show OTP authentication QR code", - "command": [ - "qr_code" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" - }, - { - "id": "S30", - "description": "Disable last login banner", - "command": [ - "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" - }, - { - "id": "S31", - "description": "Enable last login banner", - "command": [ - "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" - } - ] - }, - { - "id": "S17", - "description": "Change shell system wide to BASH", - "command": [ - "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", - "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", - "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", - "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", - "update_skel", - "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" - }, - { - "id": "S18", - "description": "Change shell system wide to ZSH", - "command": [ - "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", - "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", - "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", - "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", - "update_skel", - "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" - }, - { - "id": "S19", - "description": "Switch to rolling release", - "prompt": "This will switch to rolling releases\n\nwould you like to continue?", - "command": [ - "set_rolling" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", - "author": "Igor Pecovnik", - "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S20", - "description": "Switch to stable release", - "prompt": "This will switch to stable releases\n\nwould you like to continue?", - "command": [ - "set_stable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", - "author": "Igor Pecovnik", - "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S21", - "description": "Enable read only filesystem", - "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", - "command": [ - "manage_overlayfs enable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" - }, - { - "id": "S22", - "description": "Disable read only filesystem", - "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", - "command": [ - "manage_overlayfs disable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" - }, - { - "id": "S23", - "description": "Adjust welcome screen (motd)", - "command": [ - "adjust_motd" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[ -f /etc/default/armbian-motd ]" - }, - { - "id": "S24", - "description": "Install alternative kernels", - "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", - "command": [ - "switch_kernels" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "" - }, - { - "id": "S25", - "description": "Distribution upgrades", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", - "sub": [ - { - "id": "S26", - "description": "Upgrade to latest stable / LTS", - "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", - "command": [ - "release_upgrade stable" - ], - "status": "Active", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" - }, - { - "id": "S27", - "description": "Upgrade to rolling unstable", - "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", - "command": [ - "release_upgrade rolling" - ], - "status": "Active", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" - } - ] - }, - { - "id": "S28", - "description": "Manage device tree overlays", - "command": [ - "manage_dtoverlays" - ], - "status": "Active", - "doc_link": "", - "src_reference": "", - "author": "Gunjan Gupta", - "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" + "id": "System", + "description": "System wide and admin settings", + "sub": [ + { + "id": "S01", + "description": "Enable Armbian kernel/firmware upgrades", + "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", + "command": [ + "armbian_fw_manipulate unhold" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[[ -n \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S02", + "description": "Disable Armbian kernel upgrades", + "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", + "command": [ + "armbian_fw_manipulate hold" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S03", + "description": "Edit the boot environment", + "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", + "command": [ + "nano /boot/armbianEnv.txt" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "S04", + "description": "Install Linux headers", + "command": [ + "Headers_install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "! are_headers_installed" + }, + { + "id": "S05", + "description": "Remove Linux headers", + "command": [ + "Headers_remove" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "are_headers_installed" + }, + { + "id": "S06", + "description": "Install to internal storage", + "command": [ + "armbian-install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ -n $(ls /sbin/armbian-install) ]]" + }, + { + "id": "S07.1", + "description": "Manage SSH login options", + "sub": [ + { + "id": "S07", + "description": "Disable root login", + "command": [ + "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" + }, + { + "id": "S08", + "description": "Enable root login", + "command": [ + "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" + }, + { + "id": "S09", + "description": "Disable password login", + "command": [ + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S10", + "description": "Enable password login", + "command": [ + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" + }, + { + "id": "S11", + "description": "Disable Public key authentication login", + "command": [ + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S12", + "description": "Enable Public key authentication login", + "command": [ + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" + }, + { + "id": "S13", + "description": "Disable OTP authentication", + "command": [ + "clear", + "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S14", + "description": "Enable OTP authentication", + "command": [ + "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", + "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", + "[ ! -f /root/.google_authenticator ] && qr_code generate", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" + }, + { + "id": "S15", + "description": "Generate new OTP authentication QR code", + "command": [ + "qr_code generate" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + }, + { + "id": "S16", + "description": "Show OTP authentication QR code", + "command": [ + "qr_code" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" + }, + { + "id": "S30", + "description": "Disable last login banner", + "command": [ + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" + }, + { + "id": "S31", + "description": "Enable last login banner", + "command": [ + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" + } + ] + }, + { + "id": "S17", + "description": "Change shell system wide to BASH", + "command": [ + "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" + }, + { + "id": "S18", + "description": "Change shell system wide to ZSH", + "command": [ + "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" + }, + { + "id": "S19", + "description": "Switch to rolling release", + "prompt": "This will switch to rolling releases\n\nwould you like to continue?", + "command": [ + "set_rolling" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S20", + "description": "Switch to stable release", + "prompt": "This will switch to stable releases\n\nwould you like to continue?", + "command": [ + "set_stable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S21", + "description": "Enable read only filesystem", + "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs enable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" + }, + { + "id": "S22", + "description": "Disable read only filesystem", + "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs disable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" + }, + { + "id": "S23", + "description": "Adjust welcome screen (motd)", + "command": [ + "adjust_motd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /etc/default/armbian-motd ]" + }, + { + "id": "S24", + "description": "Install alternative kernels", + "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", + "command": [ + "switch_kernels" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "S25", + "description": "Distribution upgrades", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", + "sub": [ + { + "id": "S26", + "description": "Upgrade to latest stable / LTS", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade stable" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" + }, + { + "id": "S27", + "description": "Upgrade to rolling unstable", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "command": [ + "release_upgrade rolling" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" + } + ] + }, + { + "id": "S28", + "description": "Manage device tree overlays", + "command": [ + "manage_dtoverlays" + ], + "status": "Active", + "doc_link": "", + "src_reference": "", + "author": "Gunjan Gupta", + "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" + } + ] } - ] - } - ] + ] } From df92fea563ebf0de5df9e833548c8ad04047c797 Mon Sep 17 00:00:00 2001 From: tearran Date: Sun, 6 Oct 2024 22:57:34 -0500 Subject: [PATCH 5/6] added tool readme --- tools/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/README.md diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 000000000..d8b9c4408 --- /dev/null +++ b/tools/README.md @@ -0,0 +1,20 @@ +# Tools Directory + +This folder contains scripts for managing files for the armbian-config project. + +## Overview + +**config-jobs** -h + +``` +Options: + -s Split JSON file into smaller parts + -j Join multiple JSON files into one + -h Display this help message +``` + +## Dependencies + +- Requires [jq](https://stedolan.github.io/jq/) for JSON processing. + + From 15c6fec589756e3ce28a9fec879ef47a6fb5331a Mon Sep 17 00:00:00 2001 From: tearran Date: Mon, 7 Oct 2024 13:16:17 -0500 Subject: [PATCH 6/6] added sort order --- lib/armbian-configng/config.ng.jobs.json | 1248 +++++++++++----------- tools/config-jobs | 48 +- tools/json/config.temp.json | 48 + 3 files changed, 719 insertions(+), 625 deletions(-) create mode 100644 tools/json/config.temp.json diff --git a/lib/armbian-configng/config.ng.jobs.json b/lib/armbian-configng/config.ng.jobs.json index fa4ebc667..1ec9f6923 100644 --- a/lib/armbian-configng/config.ng.jobs.json +++ b/lib/armbian-configng/config.ng.jobs.json @@ -1,39 +1,41 @@ { "menu": [ { - "id": "Localisation", - "description": "Localisation", + "id": "System", + "description": "System wide and admin settings", "sub": [ { - "id": "L00", - "description": "Change Global timezone (WIP)", + "id": "S01", + "description": "Enable Armbian kernel/firmware upgrades", + "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", "command": [ - "dpkg-reconfigure tzdata" + "armbian_fw_manipulate unhold" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "" + "author": "", + "condition": "[[ -n \"$(apt-mark showhold)\" ]]" }, { - "id": "L01", - "description": "Change Locales reconfigure the language and character set", + "id": "S02", + "description": "Disable Armbian kernel upgrades", + "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", "command": [ - "dpkg-reconfigure locales", - "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", - "export LANGUAGE=$LANG" + "armbian_fw_manipulate hold" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "" + "author": "", + "condition": "[[ -z \"$(apt-mark showhold)\" ]]" }, { - "id": "L02", - "description": "Change Keyboard layout", + "id": "S03", + "description": "Edit the boot environment", + "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", "command": [ - "dpkg-reconfigure keyboard-configuration ; setupcon ", - "update-initramfs -u" + "nano /boot/armbianEnv.txt" ], "status": "Preview", "doc_link": "", @@ -41,954 +43,952 @@ "author": "" }, { - "id": "L03", - "description": "Change APT mirrors", - "prompt": "This will change the APT mirrors\nWould you like to continue?", + "id": "S04", + "description": "Install Linux headers", "command": [ - "get_user_continue \"This is only a frontend test\" process_input" + "Headers_install" ], - "status": "Disabled", - "author": "" + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "! are_headers_installed" }, { - "id": "L04", - "description": "Change System Hostname", + "id": "S05", + "description": "Remove Linux headers", "command": [ - "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", - "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" + "Headers_remove" ], "status": "Preview", - "author": "" - } - ] - }, - { - "id": "Network", - "description": "Fixed and wireless network settings", - "sub": [ + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", + "author": "https://github.com/Tearran", + "condition": "are_headers_installed" + }, { - "id": "N01", - "description": "Configure network interfaces", + "id": "S06", + "description": "Install to internal storage", + "command": [ + "armbian-install" + ], + "status": "Preview", + "doc_link": "https://github.com/armbian/config/wiki#System", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ -n $(ls /sbin/armbian-install) ]]" + }, + { + "id": "S07.1", + "description": "Manage SSH login options", "sub": [ { - "id": "N02", - "description": "Add interface", + "id": "S07", + "description": "Disable root login", "command": [ - "network_config armbian" + "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" ], "status": "Preview", - "author": "Igor Pecovnik", - "condition": "" + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" }, { - "id": "N03", - "description": "Revert to defaults", + "id": "S08", + "description": "Enable root login", "command": [ - "default_network_config" + "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" ], "status": "Preview", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" }, { - "id": "N04", - "description": "Show draft configuration", + "id": "S09", + "description": "Disable password login", "command": [ - "show_message <<< \"$(netplan get all)\"" + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]]" + "author": "", + "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" }, { - "id": "N05", - "description": "Apply changes", - "prompt": "This will apply new network configuration\n\nwould you like to continue?", + "id": "S10", + "description": "Enable password login", "command": [ - "netplan apply" + "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" + "author": "", + "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" }, { - "id": "N06", - "description": "Show active status", + "id": "S11", + "description": "Disable Public key authentication login", "command": [ - "show_message <<< \"$(netplan status --all)\"" + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" - } - ] - }, - { - "id": "N15", - "description": "Install Bluetooth support", - "command": [ - "see_current_apt ", - "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", - "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" - }, - { - "id": "N16", - "description": "Remove Bluetooth support", - "command": [ - "see_current_apt ", - "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", - "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", - "debconf-apt-progress -- apt -y -qq autoremove" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" - }, - { - "id": "N17", - "description": "Bluetooth Discover", - "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", - "command": [ - "connect_bt_interface" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" - }, - { - "id": "N18", - "description": "Toggle system IPv6/IPv4 internet protocol", - "prompt": "This will toggle your internet protocol\nWould you like to continue?", - "command": [ - "toggle_ipv6 | show_infobox" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - } - ] - }, - { - "id": "Software", - "description": "Run/Install 3rd party applications", - "sub": [ - { - "id": "Desktops", - "description": "Install Desktop Environments", - "sub": [ + "author": "", + "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" + }, { - "id": "SW02", - "description": "Install XFCE desktop", + "id": "S12", + "description": "Enable Public key authentication login", "command": [ - "install_de \"xfce\"" + "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "" + "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" }, { - "id": "SW03", - "description": "Install Gnome desktop", + "id": "S13", + "description": "Disable OTP authentication", "command": [ - "install_de \"gnome\"" + "clear", + "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "" + "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" }, { - "id": "SW04", - "description": "Install i3-wm desktop", + "id": "S14", + "description": "Enable OTP authentication", "command": [ - "install_de \"i3-wm\"" + "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", + "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", + "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", + "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", + "[ ! -f /root/.google_authenticator ] && qr_code generate", + "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "" + "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" }, { - "id": "SW05", - "description": "Install Cinnamon desktop", + "id": "S15", + "description": "Generate new OTP authentication QR code", "command": [ - "install_de \"cinnamon\"" + "qr_code generate" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "" + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" }, { - "id": "SW06", - "description": "Install kde-neon desktop", + "id": "S16", + "description": "Show OTP authentication QR code", "command": [ - "install_de \"kde-neon\"" + "qr_code" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "", - "condition": "" - } - ] - }, - { - "id": "Netconfig", - "description": "Network tools", - "sub": [ + "author": "Igor Pecovnik", + "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" + }, { - "id": "SW08", - "description": "Install realtime console network usage monitor (nload)", + "id": "S30", + "description": "Disable last login banner", "command": [ - "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install nload" + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed nload" + "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" }, { - "id": "SW09", - "description": "Remove realtime console network usage monitor (nload)", + "id": "S31", + "description": "Enable last login banner", "command": [ - "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge nload" + "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", + "systemctl restart ssh.service " ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "check_if_installed nload" - }, + "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" + } + ] + }, + { + "id": "S17", + "description": "Change shell system wide to BASH", + "command": [ + "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" + }, + { + "id": "S18", + "description": "Change shell system wide to ZSH", + "command": [ + "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", + "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", + "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", + "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", + "update_skel", + "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "https://github.com/igorpecovnik", + "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" + }, + { + "id": "S19", + "description": "Switch to rolling release", + "prompt": "This will switch to rolling releases\n\nwould you like to continue?", + "command": [ + "set_rolling" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S20", + "description": "Switch to stable release", + "prompt": "This will switch to stable releases\n\nwould you like to continue?", + "command": [ + "set_stable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", + "author": "Igor Pecovnik", + "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" + }, + { + "id": "S21", + "description": "Enable read only filesystem", + "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs enable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" + }, + { + "id": "S22", + "description": "Disable read only filesystem", + "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", + "command": [ + "manage_overlayfs disable" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" + }, + { + "id": "S23", + "description": "Adjust welcome screen (motd)", + "command": [ + "adjust_motd" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "[ -f /etc/default/armbian-motd ]" + }, + { + "id": "S24", + "description": "Install alternative kernels", + "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", + "command": [ + "switch_kernels" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "Igor Pecovnik", + "condition": "" + }, + { + "id": "S25", + "description": "Distribution upgrades", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", + "sub": [ { - "id": "SW10", - "description": "Install bandwidth measuring tool (iperf3)", + "id": "S26", + "description": "Upgrade to latest stable / LTS", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", "command": [ - "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install iperf3" + "release_upgrade stable" ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed iperf3" + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" }, { - "id": "SW11", - "description": "Remove bandwidth measuring tool (iperf3)", + "id": "S27", + "description": "Upgrade to rolling unstable", + "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", "command": [ - "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge iperf3" + "release_upgrade rolling" + ], + "status": "Active", + "author": "Igor Pecovnik", + "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" + } + ] + }, + { + "id": "S28", + "description": "Manage device tree overlays", + "command": [ + "manage_dtoverlays" + ], + "status": "Active", + "doc_link": "", + "src_reference": "", + "author": "Gunjan Gupta", + "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" + } + ] + }, + { + "id": "Network", + "description": "Fixed and wireless network settings", + "sub": [ + { + "id": "N01", + "description": "Configure network interfaces", + "sub": [ + { + "id": "N02", + "description": "Add interface", + "command": [ + "network_config armbian" ], "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "check_if_installed iperf3" + "author": "Igor Pecovnik", + "condition": "" }, { - "id": "SW12", - "description": "Install IP LAN monitor (iptraf-ng)", + "id": "N03", + "description": "Revert to defaults", "command": [ - "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install iptraf-ng" + "default_network_config" ], "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "! check_if_installed iptraf-ng" + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ ! -f /etc/netplan/10-dhcp-all-interfaces.yaml ]] && ! cat /etc/netplan/10-dhcp-all-interfaces.yaml 2>/dev/null | diff -q 1>/dev/null <(netplan get all) -" }, { - "id": "SW13", - "description": "Remove IP LAN monitor (iptraf-ng)", + "id": "N04", + "description": "Show draft configuration", "command": [ - "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge iptraf-ng" + "show_message <<< \"$(netplan get all)\"" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "", - "condition": "check_if_installed iptraf-ng" + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]]" }, { - "id": "SW14", - "description": "Install hostname broadcast via mDNS (avahi-daemon)", + "id": "N05", + "description": "Apply changes", + "prompt": "This will apply new network configuration\n\nwould you like to continue?", "command": [ - "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", - "check_if_installed avahi-daemon", - "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", - "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", - "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", - "service avahi-daemon restart" + "netplan apply" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "", - "condition": "! check_if_installed avahi-daemon" + "author": "Igor Pecovnik", + "condition": "[[ -f /etc/netplan/armbian.yaml ]] && ! cat /etc/netplan/armbian.yaml | diff -q 1>/dev/null <(netplan get all) - || [[ -f /etc/netplan/10-dhcp-all-interfaces.yaml ]]" }, { - "id": "SW15", - "description": "Remove hostname broadcast via mDNS (avahi-daemon)", + "id": "N06", + "description": "Show active status", "command": [ - "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", - "check_if_installed avahi-daemon", - "systemctl stop avahi-daemon avahi-daemon.socket", - "debconf-apt-progress -- apt-get -y purge avahi-daemon" + "show_message <<< \"$(netplan status --all)\"" ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "", - "condition": "check_if_installed avahi-daemon" + "author": "Igor Pecovnik", + "condition": "[ -f /etc/netplan/armbian.yaml ] && [ netplan status 2>/dev/null ]" } ] }, { - "id": "DevTools", - "description": "Development", + "id": "N15", + "description": "Install Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y install bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y --no-install-recommends install pulseaudio-module-bluetooth blueman" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "! check_if_installed bluetooth && ! check_if_installed bluez && ! check_if_installed bluez-tools" + }, + { + "id": "N16", + "description": "Remove Bluetooth support", + "command": [ + "see_current_apt ", + "debconf-apt-progress -- apt-get -y remove bluetooth bluez bluez-tools", + "check_if_installed xserver-xorg && debconf-apt-progress -- apt-get -y remove pulseaudio-module-bluetooth blueman", + "debconf-apt-progress -- apt -y -qq autoremove" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N17", + "description": "Bluetooth Discover", + "prompt": "This will enable bluetooth and discover devices\n\nWould you like to continue?", + "command": [ + "connect_bt_interface" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed bluetooth || check_if_installed bluez || check_if_installed bluez-tools" + }, + { + "id": "N18", + "description": "Toggle system IPv6/IPv4 internet protocol", + "prompt": "This will toggle your internet protocol\nWould you like to continue?", + "command": [ + "toggle_ipv6 | show_infobox" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + } + ] + }, + { + "id": "Localisation", + "description": "Localisation", + "sub": [ + { + "id": "L00", + "description": "Change Global timezone (WIP)", + "command": [ + "dpkg-reconfigure tzdata" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L01", + "description": "Change Locales reconfigure the language and character set", + "command": [ + "dpkg-reconfigure locales", + "source /etc/default/locale ; sed -i \"s/^LANGUAGE=.*/LANGUAGE=$LANG/\" /etc/default/locale", + "export LANGUAGE=$LANG" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L02", + "description": "Change Keyboard layout", + "command": [ + "dpkg-reconfigure keyboard-configuration ; setupcon ", + "update-initramfs -u" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "" + }, + { + "id": "L03", + "description": "Change APT mirrors", + "prompt": "This will change the APT mirrors\nWould you like to continue?", + "command": [ + "get_user_continue \"This is only a frontend test\" process_input" + ], + "status": "Disabled", + "author": "" + }, + { + "id": "L04", + "description": "Change System Hostname", + "command": [ + "NEW_HOSTNAME=$(whiptail --title \"Enter new hostnane\" --inputbox \"\" 7 50 3>&1 1>&2 2>&3)", + "[ $? -eq 0 ] && [ -n \"${NEW_HOSTNAME}\" ] && hostnamectl set-hostname \"${NEW_HOSTNAME}\"" + ], + "status": "Preview", + "author": "" + } + ] + }, + { + "id": "Software", + "description": "Run/Install 3rd party applications", + "sub": [ + { + "id": "Desktops", + "description": "Install Desktop Environments", "sub": [ { - "id": "SW17", - "description": "Install tools for cloning and managing repositories (git)", + "id": "SW02", + "description": "Install XFCE desktop", "command": [ - "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y install git" + "install_de \"xfce\"" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed git" + "condition": "" }, { - "id": "SW18", - "description": "Remove tools for cloning and managing repositories (git)", + "id": "SW03", + "description": "Install Gnome desktop", "command": [ - "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", - "debconf-apt-progress -- apt-get -y purge git" + "install_de \"gnome\"" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "check_if_installed git" - } - ] - }, - { - "id": "Benchy", - "description": "System benchmaking and diagnostics", - "command": [ - "see_monitoring" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[ -f /usr/bin/armbianmonitor ]" - }, - { - "id": "Containers", - "description": "Containerlization and Virtual Machines", - "sub": [ + "condition": "" + }, { - "id": "SW25", - "description": "Install Docker Minimal", - "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", + "id": "SW04", + "description": "Install i3-wm desktop", "command": [ - "install_docker" + "install_de \"i3-wm\"" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed docker-ce" + "condition": "" }, { - "id": "SW26", - "description": "Install Docker Engine", - "prompt": "This operation will install Docker Engine.\nWould you like to continue?", + "id": "SW05", + "description": "Install Cinnamon desktop", "command": [ - "install_docker engine" + "install_de \"cinnamon\"" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed docker-compose-plugin" + "condition": "" }, { - "id": "SW27", - "description": "Remove Docker", - "prompt": "This operation will purge Docker.\nWould you like to continue?", + "id": "SW06", + "description": "Install kde-neon desktop", "command": [ - "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" + "install_de \"kde-neon\"" + ], + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "" + } + ] + }, + { + "id": "Netconfig", + "description": "Network tools", + "sub": [ + { + "id": "SW08", + "description": "Install realtime console network usage monitor (nload)", + "command": [ + "get_user_continue \"This operation will install nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install nload" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "check_if_installed docker-ce" + "condition": "! check_if_installed nload" }, { - "id": "SW28", - "description": "Purge all Docker images, containers, and volumes", - "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", + "id": "SW09", + "description": "Remove realtime console network usage monitor (nload)", "command": [ - "rm -rf /var/lib/docker", - "rm -rf /var/lib/containerd" + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge nload" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" - } - ] - }, - { - "id": "Media", - "description": "Media Servers and Editors", - "sub": [ + "condition": "check_if_installed nload" + }, { - "id": "SW21", - "description": "Install Plex Media server", - "prompt": "This operation will install Plex Media server.\nWould you like to continue?", + "id": "SW10", + "description": "Install bandwidth measuring tool (iperf3)", "command": [ - "install_plexmediaserver" + "get_user_continue \"This operation will install iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iperf3" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed plexmediaserver" + "condition": "! check_if_installed iperf3" }, { - "id": "SW22", - "description": "Remove Plex Media server", - "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", + "id": "SW11", + "description": "Remove bandwidth measuring tool (iperf3)", "command": [ - "apt_install_wrapper apt-get -y purge plexmediaserver", - "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" + "get_user_continue \"This operation will purge iperf3.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iperf3" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "check_if_installed plexmediaserver" + "condition": "check_if_installed iperf3" }, { - "id": "SW23", - "description": "Install Emby server", - "prompt": "This operation will install Emby server.\nWould you like to continue?", + "id": "SW12", + "description": "Install IP LAN monitor (iptraf-ng)", "command": [ - "install_embyserver" + "get_user_continue \"This operation will install iptraf-ng.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install iptraf-ng" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed emby-server" + "condition": "! check_if_installed iptraf-ng" }, { - "id": "SW24", - "description": "Remove Emby server", - "prompt": "This operation will purge Emby server.\nWould you like to continue?", + "id": "SW13", + "description": "Remove IP LAN monitor (iptraf-ng)", "command": [ - "apt_install_wrapper apt -y purge emby-server" + "get_user_continue \"This operation will purge nload.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge iptraf-ng" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "check_if_installed emby-server" - } - ] - }, - { - "id": "Management", - "description": "Remote Management tools", - "sub": [ + "condition": "check_if_installed iptraf-ng" + }, { - "id": "M00", - "description": "Install Cockpit web-based management tool", - "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", + "id": "SW14", + "description": "Install hostname broadcast via mDNS (avahi-daemon)", "command": [ - "see_current_apt update", - "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " + "get_user_continue \"This operation will install avahi-daemon and add configuration files.\nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "debconf-apt-progress -- apt-get -y install avahi-daemon libnss-mdns", + "cp /usr/share/doc/avahi-daemon/examples/sftp-ssh.service /etc/avahi/services/", + "cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/", + "service avahi-daemon restart" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed cockpit" + "condition": "! check_if_installed avahi-daemon" }, { - "id": "M01", - "description": "Purge Cockpit web-based management tool", - "prompt": "This operation will purge Cockpit.\nWould you like to continue?", + "id": "SW15", + "description": "Remove hostname broadcast via mDNS (avahi-daemon)", "command": [ - "apt_install_wrapper apt -y purge cockpit" + "get_user_continue \"This operation will purge avahi-daemon \nDo you wish to continue?\" process_input", + "check_if_installed avahi-daemon", + "systemctl stop avahi-daemon avahi-daemon.socket", + "debconf-apt-progress -- apt-get -y purge avahi-daemon" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "check_if_installed cockpit" - }, + "condition": "check_if_installed avahi-daemon" + } + ] + }, + { + "id": "DevTools", + "description": "Development", + "sub": [ { - "id": "M02", - "description": "Start Cockpit Service", + "id": "SW17", + "description": "Install tools for cloning and managing repositories (git)", "command": [ - "sudo systemctl enable --now cockpit.socket | show_infobox " + "get_user_continue \"This operation will install git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y install git" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" + "condition": "! check_if_installed git" }, { - "id": "M03", - "description": "Stop Cockpit Service", + "id": "SW18", + "description": "Remove tools for cloning and managing repositories (git)", "command": [ - "systemctl stop cockpit cockpit.socket", - "systemctl disable cockpit.socket | show_infobox " + "get_user_continue \"This operation will remove git.\n\nDo you wish to continue?\" process_input", + "debconf-apt-progress -- apt-get -y purge git" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" + "condition": "check_if_installed git" } ] - } - ] - }, - { - "id": "System", - "description": "System wide and admin settings", - "sub": [ - { - "id": "S01", - "description": "Enable Armbian kernel/firmware upgrades", - "prompt": "This will enable Armbian kernel upgrades?\nWould you like to continue?", - "command": [ - "armbian_fw_manipulate unhold" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[[ -n \"$(apt-mark showhold)\" ]]" }, { - "id": "S02", - "description": "Disable Armbian kernel upgrades", - "prompt": "Disable Armbian kernel/firmware upgrades\nWould you like to continue?", + "id": "Benchy", + "description": "System benchmaking and diagnostics", "command": [ - "armbian_fw_manipulate hold" + "see_monitoring" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "[[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S03", - "description": "Edit the boot environment", - "prompt": "This will open /boot/armbianEnv.txt file to edit\nCTRL+S to save\nCTLR+X to exit\nwould you like to continue?", - "command": [ - "nano /boot/armbianEnv.txt" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "" - }, - { - "id": "S04", - "description": "Install Linux headers", - "command": [ - "Headers_install" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", - "author": "https://github.com/Tearran", - "condition": "! are_headers_installed" - }, - { - "id": "S05", - "description": "Remove Linux headers", - "command": [ - "Headers_remove" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L160", - "author": "https://github.com/Tearran", - "condition": "are_headers_installed" - }, - { - "id": "S06", - "description": "Install to internal storage", - "command": [ - "armbian-install" - ], - "status": "Preview", - "doc_link": "https://github.com/armbian/config/wiki#System", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ -n $(ls /sbin/armbian-install) ]]" + "condition": "[ -f /usr/bin/armbianmonitor ]" }, { - "id": "S07.1", - "description": "Manage SSH login options", + "id": "Containers", + "description": "Containerlization and Virtual Machines", "sub": [ { - "id": "S07", - "description": "Disable root login", - "command": [ - "sed -i \"s|^#\\?PermitRootLogin.*|PermitRootLogin no|\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "grep -q '^PermitRootLogin yes' /etc/ssh/sshd_config" - }, - { - "id": "S08", - "description": "Enable root login", + "id": "SW25", + "description": "Install Docker Minimal", + "prompt": "This operation will install Docker Minimal.\nWould you like to continue?", "command": [ - "sed -i \"s/^#\\?PermitRootLogin.*/PermitRootLogin yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "install_docker" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q '^PermitRootLogin no' /etc/ssh/sshd_config" + "condition": "! check_if_installed docker-ce" }, { - "id": "S09", - "description": "Disable password login", + "id": "SW26", + "description": "Install Docker Engine", + "prompt": "This operation will install Docker Engine.\nWould you like to continue?", "command": [ - "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "install_docker engine" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q 'PasswordAuthentication yes' /etc/ssh/sshd_config" + "condition": "! check_if_installed docker-compose-plugin" }, { - "id": "S10", - "description": "Enable password login", + "id": "SW27", + "description": "Remove Docker", + "prompt": "This operation will purge Docker.\nWould you like to continue?", "command": [ - "sed -i \"s/^#\\?PasswordAuthentication.*/PasswordAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "apt_install_wrapper apt -y purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q 'PasswordAuthentication no' /etc/ssh/sshd_config" + "condition": "check_if_installed docker-ce" }, { - "id": "S11", - "description": "Disable Public key authentication login", - "command": [ - "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication no/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "id": "SW28", + "description": "Purge all Docker images, containers, and volumes", + "prompt": "This operation will delete all Docker images, containers, and volumes.\nWould you like to continue?", + "command": [ + "rm -rf /var/lib/docker", + "rm -rf /var/lib/containerd" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q 'PubkeyAuthentication yes' /etc/ssh/sshd_config" - }, + "condition": "! check_if_installed docker-ce && [ -d /var/lib/docker ]" + } + ] + }, + { + "id": "Media", + "description": "Media Servers and Editors", + "sub": [ { - "id": "S12", - "description": "Enable Public key authentication login", + "id": "SW21", + "description": "Install Plex Media server", + "prompt": "This operation will install Plex Media server.\nWould you like to continue?", "command": [ - "sed -i \"s/^#\\?PubkeyAuthentication.*/PubkeyAuthentication yes/\" /etc/ssh/sshd_config", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "install_plexmediaserver" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q 'PubkeyAuthentication no' /etc/ssh/sshd_config" + "condition": "! check_if_installed plexmediaserver" }, { - "id": "S13", - "description": "Disable OTP authentication", + "id": "SW22", + "description": "Remove Plex Media server", + "prompt": "This operation will purge Plex Media server.\nWould you like to continue?", "command": [ - "clear", - "! check_if_installed libpam-google-authenticator && ! check_if_installed qrencode || debconf-apt-progress -- apt-get -y purge libpam-google-authenticator qrencode", - "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/\" /etc/ssh/sshd_config || sed -i \"0,/KbdInteractiveAuthentication/s//ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", - "sed -i '/^auth required pam_google_authenticator.so nullok/ d' /etc/pam.d/sshd", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "apt_install_wrapper apt-get -y purge plexmediaserver", + "sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q 'ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" + "condition": "check_if_installed plexmediaserver" }, { - "id": "S14", - "description": "Enable OTP authentication", + "id": "SW23", + "description": "Install Emby server", + "prompt": "This operation will install Emby server.\nWould you like to continue?", "command": [ - "check_if_installed libpam-google-authenticator || debconf-apt-progress -- apt-get -y install libpam-google-authenticator", - "check_if_installed qrencode || debconf-apt-progress -- apt-get -y install qrencode", - "sed -i \"s/^#\\?ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/\" /etc/ssh/sshd_config", - "sed -i $'/KbdInteractiveAuthentication/{iChallengeResponseAuthentication yes\\n:a;n;ba}' /etc/ssh/sshd_config || sed -n -i '/password updating/{p;:a;N;/@include common-password/!ba;s/.*\\n/auth required pam_google_authenticator.so nullok\\nauth required pam_permit.so\\n/};p' /etc/pam.d/sshd", - "[ ! -f /root/.google_authenticator ] && qr_code generate", - "systemctl restart sshd.service 2>/dev/null | systemctl restart ssh.service 2>/dev/null" + "install_embyserver" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "! check_if_installed libpam-google-authenticator || ! check_if_installed qrencode || grep -q '^ChallengeResponseAuthentication no' /etc/ssh/sshd_config || ! grep -q 'ChallengeResponseAuthentication' /etc/ssh/sshd_config" + "condition": "! check_if_installed emby-server" }, { - "id": "S15", - "description": "Generate new OTP authentication QR code", + "id": "SW24", + "description": "Remove Emby server", + "prompt": "This operation will purge Emby server.\nWould you like to continue?", "command": [ - "qr_code generate" + "apt_install_wrapper apt -y purge emby-server" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config" - }, + "condition": "check_if_installed emby-server" + } + ] + }, + { + "id": "Management", + "description": "Remote Management tools", + "sub": [ { - "id": "S16", - "description": "Show OTP authentication QR code", + "id": "M00", + "description": "Install Cockpit web-based management tool", + "prompt": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged\nWould you like to continue?", "command": [ - "qr_code" + "see_current_apt update", + "apt_install_wrapper apt -y install cockpit cockpit-ws cockpit-system cockpit-storaged " ], "status": "Preview", "doc_link": "", "src_reference": "", - "author": "Igor Pecovnik", - "condition": "grep -q '^ChallengeResponseAuthentication yes' /etc/ssh/sshd_config && [ -f /root/.google_authenticator ]" + "author": "", + "condition": "! check_if_installed cockpit" }, { - "id": "S30", - "description": "Disable last login banner", + "id": "M01", + "description": "Purge Cockpit web-based management tool", + "prompt": "This operation will purge Cockpit.\nWould you like to continue?", "command": [ - "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog no/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " + "apt_install_wrapper apt -y purge cockpit" ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q '^PrintLastLog yes' /etc/ssh/sshd_config" + "condition": "check_if_installed cockpit" }, { - "id": "S31", - "description": "Enable last login banner", + "id": "M02", + "description": "Start Cockpit Service", "command": [ - "sed -i \"s/^#\\?PrintLastLog.*/PrintLastLog yes/\" /etc/ssh/sshd_config", - "systemctl restart ssh.service " + "sudo systemctl enable --now cockpit.socket | show_infobox " ], "status": "Preview", "doc_link": "", "src_reference": "", "author": "", - "condition": "grep -q '^PrintLastLog no' /etc/ssh/sshd_config" - } - ] - }, - { - "id": "S17", - "description": "Change shell system wide to BASH", - "command": [ - "export BASHLOCATION=$(grep /bash$ /etc/shells | tail -1)", - "sed -i \"s|^SHELL=.*|SHELL=${BASHLOCATION}|\" /etc/default/useradd", - "sed -i \"s|^DSHELL=.*|DSHELL=${BASHLOCATION}|\" /etc/adduser.conf", - "apt_install_wrapper apt-get -y purge armbian-zsh zsh-common zsh tmux", - "update_skel", - "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /bash$ /etc/shells | tail -1)" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"zsh\" ]]" - }, - { - "id": "S18", - "description": "Change shell system wide to ZSH", - "command": [ - "export ZSHLOCATION=$(grep /zsh$ /etc/shells | tail -1)", - "sed -i \"s|^SHELL=.*|SHELL=${ZSHLOCATION}|\" /etc/default/useradd", - "sed -i \"s|^DSHELL=.*|DSHELL=${ZSHLOCATION}|\" /etc/adduser.conf", - "apt_install_wrapper apt-get -y install armbian-zsh zsh-common zsh tmux", - "update_skel", - "awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534 || $3 == 0) print $1}' /etc/passwd | xargs -L1 chsh -s $(grep /zsh$ /etc/shells | tail -1)" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "https://github.com/igorpecovnik", - "condition": "[[ $(cat /etc/passwd | grep \"^root:\" | rev | cut -d\":\" -f1 | cut -d\"/\" -f1| rev) == \"bash\" ]]" - }, - { - "id": "S19", - "description": "Switch to rolling release", - "prompt": "This will switch to rolling releases\n\nwould you like to continue?", - "command": [ - "set_rolling" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", - "author": "Igor Pecovnik", - "condition": "grep -q 'apt.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S20", - "description": "Switch to stable release", - "prompt": "This will switch to stable releases\n\nwould you like to continue?", - "command": [ - "set_stable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "https://github.com/armbian/config/blob/master/debian-config-jobs#L1446", - "author": "Igor Pecovnik", - "condition": "grep -q 'beta.armbian.com' /etc/apt/sources.list.d/armbian.list && [[ -z \"$(apt-mark showhold)\" ]]" - }, - { - "id": "S21", - "description": "Enable read only filesystem", - "prompt": "This will enable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", - "command": [ - "manage_overlayfs enable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "modinfo overlay > /dev/null 2>&1 && [[ -z $(findmnt -k /media/root-ro | tail -1) ]] && [[ \"${DISTRO}\"=Ubuntu ]]" - }, - { - "id": "S22", - "description": "Disable read only filesystem", - "prompt": "This will disable Armbian read-only filesystem. Reboot is mandatory?\n\nWould you like to continue?", - "command": [ - "manage_overlayfs disable" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "command -v overlayroot-chroot > /dev/null 2>&1 && findmnt -k /media/root-ro | tail -1 | grep -w /media/root-ro > /dev/null 2>&1" - }, - { - "id": "S23", - "description": "Adjust welcome screen (motd)", - "command": [ - "adjust_motd" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "", - "condition": "[ -f /etc/default/armbian-motd ]" - }, - { - "id": "S24", - "description": "Install alternative kernels", - "prompt": "Switching between kernels might change functionality of your device. \n\nIt might fail to boot!", - "command": [ - "switch_kernels" - ], - "status": "Preview", - "doc_link": "", - "src_reference": "", - "author": "Igor Pecovnik", - "condition": "" - }, - { - "id": "S25", - "description": "Distribution upgrades", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify || release_upgrade stable verify", - "sub": [ - { - "id": "S26", - "description": "Upgrade to latest stable / LTS", - "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", - "command": [ - "release_upgrade stable" - ], - "status": "Active", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade stable verify" + "condition": "check_if_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" }, { - "id": "S27", - "description": "Upgrade to rolling unstable", - "prompt": "Release upgrade is irriversible operation which upgrades all packages. \n\nResoulted upgrade might break your build beyond repair!", + "id": "M03", + "description": "Stop Cockpit Service", "command": [ - "release_upgrade rolling" + "systemctl stop cockpit cockpit.socket", + "systemctl disable cockpit.socket | show_infobox " ], - "status": "Active", - "author": "Igor Pecovnik", - "condition": "[ -f /etc/armbian-distribution-status ] && release_upgrade rolling verify" + "status": "Preview", + "doc_link": "", + "src_reference": "", + "author": "", + "condition": "check_if_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" } ] - }, - { - "id": "S28", - "description": "Manage device tree overlays", - "command": [ - "manage_dtoverlays" - ], - "status": "Active", - "doc_link": "", - "src_reference": "", - "author": "Gunjan Gupta", - "condition": "[ -n $OVERLAYDIR ] && [ -n $BOOT_SOC ]" } ] }, diff --git a/tools/config-jobs b/tools/config-jobs index 99701e242..554f9c2c0 100755 --- a/tools/config-jobs +++ b/tools/config-jobs @@ -53,7 +53,7 @@ split_json() { } # Function to join JSON files into a single file -join_json() { +join_json_previous_draft() { input_dir="$DEFAULT_DIR" output_file="$1" @@ -96,6 +96,52 @@ join_json() { echo "JSON files rejoined into '$output_file'." } +# Function to join JSON files into a single file with enforced ordering +join_json() { + input_dir="$DEFAULT_DIR" + output_file="$1" + + # Check if input directory exists + if [[ ! -d "$input_dir" ]]; then + echo "Error: Input directory '$input_dir' does not exist." + return 1 + fi + + # Initialize an empty array for holding the merged JSON data + merged_json="[]" + + # Define desired order for menu items (IDs) + declare -a ordered_ids=( + "System" + "Network" + "Localisation" + "Software" + "Help" + ) + + # Loop through ordered IDs to extract menu items in the correct order + for id in "${ordered_ids[@]}"; do + for file in "$input_dir"/*.json; do + if [[ -f "$file" ]]; then + # Find item matching the current ID + item=$(jq --arg id "$id" '.menu[] | select(.id == $id)' "$file" 2>/dev/null) + if [[ -n "$item" ]]; then + merged_json=$(jq --argjson new_item "$item" '. + [$new_item]' <<< "$merged_json") + fi + fi + done + done + + # Construct the final JSON structure + final_json=$(jq -n --argjson menu "$merged_json" '{"menu": $menu}') + + # Write the final JSON structure to a file + echo "$final_json" | jq --indent 4 '.' > "$output_file" + + echo "JSON files rejoined into '$output_file'." +} + + # Main script logic with case statement case "$1" in diff --git a/tools/json/config.temp.json b/tools/json/config.temp.json new file mode 100644 index 000000000..0cfe9d78b --- /dev/null +++ b/tools/json/config.temp.json @@ -0,0 +1,48 @@ +{ + "menu": [ + { + "id": "Template", + "description": "Description ... ", + "sub": [ + { + "id": "UID01", + "description": "Description ... ", + "prompt": "", + "sub": [ + { + "id": "SUB02", + "description": "Description ... ", + "command": [ + "show_message <<< \" Message ... \"" + ], + "status": "", + "author": "Github Username", + "condition": "" + } + ] + }, + { + "id": "UID03", + "description": "Description ... ", + "command": [ + "show_message <<< \" Message ... \"" + ], + "status": "", + "author": "Github Username", + "condition": "" + }, + { + "id": "UID04", + "description": "Description ... ", + "prompt": "Prompt\nContinue?", + "command": [ + "show_message <<< \" Message ... \"" + ], + "status": "", + "author": "Github Username", + "condition": "" + } + ] + } + ] +} \ No newline at end of file