From 720956d7cf15bdea6f2151cffb63bb5e0ee6ec7b Mon Sep 17 00:00:00 2001 From: Tearran Date: Wed, 25 Dec 2024 06:02:27 +0000 Subject: [PATCH 01/20] update parsing with new data points --- generate_json_data.sh | 194 ++++++++++++++++++++ tools/modules/docs/generate_json_data.sh | 143 +++++++++++++++ tools/modules/functions/config_interface.sh | 6 +- tools/modules/runtime/config.runtime.sh | 2 +- 4 files changed, 341 insertions(+), 4 deletions(-) create mode 100644 generate_json_data.sh create mode 100644 tools/modules/docs/generate_json_data.sh diff --git a/generate_json_data.sh b/generate_json_data.sh new file mode 100644 index 000000000..12f0cc98e --- /dev/null +++ b/generate_json_data.sh @@ -0,0 +1,194 @@ + + + +function set_json_data() { + local i=0 + + features=() + for key in "${!module_options[@]}"; do + if [[ $key == *",feature" ]]; then + features+=("${module_options[$key]}") + fi + done + +{ + echo -e "[" + + for feature in "${features[@]}"; do + feature_prefix=$(echo "${feature:0:3}" | tr '[:lower:]' '[:upper:]') # Extract first 3 letters and convert to uppercase + + i=$((i + 1)) + id=$(printf "%s%03d" "$feature_prefix" "$i") # Combine prefix with padded number + + # Get keys pairs + desc_key="${feature},desc" + example_key="${feature},example" + author_key="${feature},author" + ref_key="${feature},ref_link" + status_key="${feature},status" + doc_key="${feature},doc_link" + helpers_key="${feature},helpers" + group_key="${feature},group" + commands_key="${feature},commands" + port_key="${feature},port" + arch_key="${feature},arch" + + # Get array info + author="${module_options[$author_key]}" + ref_link="${module_options[$ref_key]}" + status="${module_options[$status_key]}" + doc_link="${module_options[$doc_key]}" + desc="${module_options[$desc_key]}" + example="${module_options[$example_key]}" + helpers="${module_options[$helpers_key]}" + group="${module_options[$group_key]}" + commands="${module_options[$commands_key]}" + port="${module_options[$port_key]}" + arch="${module_options[$arch_key]}" + + echo " {" + echo " \"id\": \"$id\"," + echo " \"feature\": \"$feature\"," + echo " \"helpers\": \"$helpers\"," + echo " \"description\": \"$desc ($feature)\"," + echo " \"command\": \"$feature\"," + echo " \"options\": \"$example\"," + echo " \"status\": \"$status\"," + echo " \"condition\": \" \"," + echo " \"reference\": \"$ref_link\"," + echo " \"author\": \"$author\"," + echo " \"group\": \"$group\"," + echo " \"commands\": \"$commands\"," + echo " \"port\": \"$port\"," + echo " \"arch\": \"$arch\"" + + if [ $i -ne ${#features[@]} ]; then + echo " }," + else + echo " }" + fi + done + echo "]" + +} | jq . + +} + + +function generate_module_list() { + set_json_data | jq ' + # Define an array of allowed software groups + def softwareGroups: ["WebHosting", "Netconfig", "Downloaders", "Database", "DNS", "DevTools", "HomeAutomation", "Benchy", "Containers", "Media", "Monitoring", "Management"]; + + { + "menu": [ + { + "id": "Software", + "description": "Run/Install 3rd party applications", + "sub": ( + group_by(.group) + # Skip grouped arrays where the group is null, empty, or not in softwareGroups + | map(select(.[0].group != null and .[0].group != "" and (.[0].group | IN(softwareGroups[])))) + | map({ + "id": .[0].group, + "description": .[0].group, + "sub": ( + map({ + "id": .id, + "description": .description, + "command": [("see_menu " + .feature)], + "options": ("help " + .options + " status"), + "status": .status, + "condition": "", + "author": .author + }) + ) + }) + ) + } + ] + } + ' + } + + +function generate_json_data() { + set_json_data | jq '{ + "menu": [ + { + "id": "tests", + "description": "Run/Install 3rd party applications", + "sub": [ + { + "id": "Modules", + "description": "Various installable modules", + "sub": [ + .[] | + if (.feature | type == "string") and (.feature | startswith("module_")) then + { + "id": .id, + "description": .description, + "command": [("see_menu " + .feature)], + "options": ("help " + .options + " status"), + "status": .status, + "condition": "", + "author": .author + } + else empty + end + ] + } + ] + } + ] + }' + +} + + +# Test Function +interface_json_data_old() { + + # uncomment to set the data to a file + set_json_data | jq --tab --indent 4 '.' > tools/json/config.temp.json + #generate_json_data | jq --indent 4 "." > tools/json/config.temp.json + #json_file="$tools_dir/json/config.temp.json + + json_data=$(generate_json_data) + #generate_top_menu "$json_data" + + generate_menu "Software" "$json_data" +} + + +# Test Function +interface_json_data() { + # Convert the example string to an array + local commands=("raw" "mnu" "top" "sub" "help") + json_data=$(generate_json_data) + case "$1" in + + "${commands[0]}") + echo "Setting JSON data to file..." + set_json_data | jq --tab --indent 4 '.' > tools/json/config.temp.json + ;; + "${commands[1]}") + echo "Generating JSON data..." + generate_json_data | jq --tab --indent 4 '.' > tools/json/config.temp.json + ;; + "${commands[2]}") + generate_top_menu "$json_data" + ;; + "${commands[3]}") + generate_menu "Software" "$json_data" + ;; + "${commands[-1]}") + echo "Usage: interface_json_data " + echo "Available commands:" + echo -e "\traw\t- Set flat JSON data to a file for inspection not used" + echo -e "\tmnu\t- Generate the Menu JSON data to file for inspection not used" + echo -e "\ttop\t- Show the top menu using the JSON data." + echo -e "\tsub\t- Show the Software menu using the JSON data." + ;; + esac +} diff --git a/tools/modules/docs/generate_json_data.sh b/tools/modules/docs/generate_json_data.sh new file mode 100644 index 000000000..dcea06872 --- /dev/null +++ b/tools/modules/docs/generate_json_data.sh @@ -0,0 +1,143 @@ + + +function set_json_data() { + local i=0 + + features=() + for key in "${!module_options[@]}"; do + if [[ $key == *",feature" ]]; then + features+=("${module_options[$key]}") + fi + done + +{ + echo -e "[" + + for feature in "${features[@]}"; do + feature_prefix=$(echo "${feature:0:3}" | tr '[:lower:]' '[:upper:]') # Extract first 3 letters and convert to uppercase + + i=$((i + 1)) + id=$(printf "%s%03d" "$feature_prefix" "$i") # Combine prefix with padded number + + # Get keys pairs + desc_key="${feature},desc" + example_key="${feature},example" + author_key="${feature},author" + ref_key="${feature},ref_link" + status_key="${feature},status" + doc_key="${feature},doc_link" + helpers_key="${feature},helpers" + group_key="${feature},group" + commands_key="${feature},commands" + port_key="${feature},port" + arch_key="${feature},arch" + + # Get array info + author="${module_options[$author_key]}" + ref_link="${module_options[$ref_key]}" + status="${module_options[$status_key]}" + doc_link="${module_options[$doc_key]}" + desc="${module_options[$desc_key]}" + example="${module_options[$example_key]}" + helpers="${module_options[$helpers_key]}" + group="${module_options[$group_key]}" + commands="${module_options[$commands_key]}" + port="${module_options[$port_key]}" + arch="${module_options[$arch_key]}" + + echo " {" + echo " \"id\": \"$id\"," + echo " \"feature\": \"$feature\"," + echo " \"helpers\": \"$helpers\"," + echo " \"description\": \"$desc ($feature)\"," + echo " \"command\": \"$feature\"," + echo " \"options\": \"$example\"," + echo " \"status\": \"$status\"," + echo " \"condition\": \" \"," + echo " \"reference\": \"$ref_link\"," + echo " \"author\": \"$author\"," + echo " \"group\": \"$group\"," + echo " \"commands\": \"$commands\"," + echo " \"port\": \"$port\"," + echo " \"arch\": \"$arch\"" + + if [ $i -ne ${#features[@]} ]; then + echo " }," + else + echo " }" + fi + done + echo "]" + +} | jq . + +} + + +function generate_software_json() { + set_json_data | jq ' + # Define an array of allowed software groups + def softwareGroups: ["WebHosting", "Netconfig", "Downloaders", "Database", "DNS", "DevTools", "HomeAutomation", "Benchy", "Containers", "Media", "Monitoring", "Management"]; + + { + "menu": [ + { + "id": "Software", + "description": "Run/Install 3rd party applications", + "sub": ( + group_by(.group) + # Skip grouped arrays where the group is null, empty, or not in softwareGroups + | map(select(.[0].group != null and .[0].group != "" and (.[0].group | IN(softwareGroups[])))) + | map({ + "id": .[0].group, + "description": .[0].group, + "sub": ( + map({ + "id": .id, + "description": .description, + "command": [("see_menu " + .feature)], + "options": ("help " + .options + " status"), + "status": .status, + "condition": "", + "author": .author + }) + ) + }) + ) + } + ] + } + ' + } + +# Test Function +interface_json_data() { + # Convert the example string to an array + local commands=("raw" "mnu" "top" "sub" "help") + json_data=$(generate_software_json) + case "$1" in + + "${commands[0]}") + echo "Setting JSON data to file..." + set_json_data | jq --tab --indent 4 '.' > tools/json/config.temp.json + ;; + "${commands[1]}") + echo "Generating JSON data..." + generate_software_json | jq --tab --indent 4 '.' > tools/json/config.temp.json + ;; + "${commands[2]}") + generate_top_menu "$json_data" + ;; + "${commands[3]}") + generate_menu "Software" "$json_data" + ;; + "${commands[-1]}") + echo "Usage: interface_json_data " + echo "Available commands:" + echo -e "\traw\t- Set flat JSON data to a file for inspection not used" + echo -e "\tmnu\t- Generate the Menu JSON data to file for inspection not used" + echo -e "\ttop\t- Show the top menu using the JSON data." + echo -e "\tsub\t- Show the Software menu using the JSON data." + ;; + esac +} diff --git a/tools/modules/functions/config_interface.sh b/tools/modules/functions/config_interface.sh index f4669824a..dcc40680f 100644 --- a/tools/modules/functions/config_interface.sh +++ b/tools/modules/functions/config_interface.sh @@ -172,7 +172,7 @@ function generate_menu() { [ -z "$OPTION" ] && break # Check if the selected option has a submenu - local submenu_count=$(jq -r --arg id "$OPTION" '.menu[] | .. | objects | select(.id==$id) | .sub? | length' "$json_file") + local submenu_count=$(jq -r --arg id "$OPTION" '.menu[] | .. | objects | select(.id==$id) | .sub? | length' <(echo "$json_data")) submenu_count=${submenu_count:-0} # If submenu_count is null or empty, set it to 0 if [ "$submenu_count" -gt 0 ]; then # If it does, generate a new menu for the submenu @@ -208,7 +208,7 @@ function execute_command() { .. | objects | select(.id == $id) | - .command[]?' "$json_file") + .command[]?' <(echo "$json_data")) # Check if a about exists local about=$(jq -r --arg id "$id" ' @@ -216,7 +216,7 @@ function execute_command() { .. | objects | select(.id == $id) | - .about?' "$json_file") + .about?' <(echo "$json_data")) # If a about exists, display it and wait for user confirmation if [[ "$about" != "null" && $INPUTMODE != "cmd" ]]; then diff --git a/tools/modules/runtime/config.runtime.sh b/tools/modules/runtime/config.runtime.sh index 5dad1148c..8083737bc 100644 --- a/tools/modules/runtime/config.runtime.sh +++ b/tools/modules/runtime/config.runtime.sh @@ -54,7 +54,7 @@ module_options+=( ["update_sub_submenu_data,author"]="@Tearran" ["update_sub_submenu_data,feature"]="update_sub_submenu_data" ["update_sub_submenu_data,desc"]="Update sub-submenu descriptions based on conditions" - ["update_sub_submenu_data,example"]="update_sub_submenu_data \"MenuID\" \"SubID\" \"SubSubID\" \"CMD\"" + ["update_sub_submenu_data,example"]="update_sub_submenu_data MenuID SubID SubSubID CMD" ["update_sub_submenu_data,status"]="" ) # From 319f7a2ac8f61d6718ffa1cabb0c8cf8a49acc0b Mon Sep 17 00:00:00 2001 From: Tearran Date: Wed, 25 Dec 2024 06:20:16 +0000 Subject: [PATCH 02/20] revert name --- tools/modules/docs/generate_json_data.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/modules/docs/generate_json_data.sh b/tools/modules/docs/generate_json_data.sh index dcea06872..823902127 100644 --- a/tools/modules/docs/generate_json_data.sh +++ b/tools/modules/docs/generate_json_data.sh @@ -74,7 +74,7 @@ function set_json_data() { } -function generate_software_json() { +function generate_json_data() { set_json_data | jq ' # Define an array of allowed software groups def softwareGroups: ["WebHosting", "Netconfig", "Downloaders", "Database", "DNS", "DevTools", "HomeAutomation", "Benchy", "Containers", "Media", "Monitoring", "Management"]; From 847f28a3b3e49829285604f8a023a19e95630941 Mon Sep 17 00:00:00 2001 From: Tearran Date: Wed, 25 Dec 2024 06:24:31 +0000 Subject: [PATCH 03/20] fix missed --- tools/modules/docs/generate_json_data.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/modules/docs/generate_json_data.sh b/tools/modules/docs/generate_json_data.sh index 823902127..99611f54f 100644 --- a/tools/modules/docs/generate_json_data.sh +++ b/tools/modules/docs/generate_json_data.sh @@ -114,7 +114,7 @@ function generate_json_data() { interface_json_data() { # Convert the example string to an array local commands=("raw" "mnu" "top" "sub" "help") - json_data=$(generate_software_json) + json_data=$(generate_json_data) case "$1" in "${commands[0]}") @@ -123,7 +123,7 @@ interface_json_data() { ;; "${commands[1]}") echo "Generating JSON data..." - generate_software_json | jq --tab --indent 4 '.' > tools/json/config.temp.json + generate_json_data | jq --tab --indent 4 '.' > tools/json/config.temp.json ;; "${commands[2]}") generate_top_menu "$json_data" From 582ceaccb38bf304251b8ae7ae88fe34c3a76e65 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 06:17:04 +0000 Subject: [PATCH 04/20] added missing module_cockpit.sh --- tools/modules/software/module_cockpit.sh | 103 +++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 tools/modules/software/module_cockpit.sh diff --git a/tools/modules/software/module_cockpit.sh b/tools/modules/software/module_cockpit.sh new file mode 100644 index 000000000..ff9a832c9 --- /dev/null +++ b/tools/modules/software/module_cockpit.sh @@ -0,0 +1,103 @@ +module_options+=( + ["module_cockpit,author"]="@tearran" + ["module_cockpit,maintainer"]="@igorpecovnik" + ["module_cockpit,feature"]="module_cockpit" + ["module_cockpit,example"]="help install remove start stop enable disable status check" + ["module_cockpit,desc"]="Cockpit setup and service setting." + ["module_cockpit,status"]="Stable" + ["module_cockpit,doc_link"]="https://cockpit-project.org/guide/latest/" + ["module_cockpit,group"]="Management" + ["module_cockpit,port"]="9090" + ["module_cockpit,arch"]="x86-64 arm64 armhf" +) + +function module_cockpit() { + local title="cockpit" + local condition=$(dpkg -s "cockpit" 2>/dev/null | sed -n "s/Status: //p") + # Convert the example string to an array + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_cockpit,example"]}" + + case "$1" in + "${commands[0]}") + ## help/menu options for the module + echo -e "\nUsage: ${module_options["module_cockpit,feature"]} " + echo -e "Commands: ${module_options["module_cockpit,example"]}" + echo "Available commands:" + if [[ -z "$condition" ]]; then + echo -e " install\t- Install $title." + else + if [[ "$(systemctl is-active cockpit.socket 2>/dev/null)" == "active" ]]; then + echo -e "\tstop\t- Stop the $title service." + else + echo -e "\tstart\t- Start the $title service." + fi + if [[ $(systemctl is-enabled cockpit.socket) == "enabled" ]]; then + echo -e "\tdisable\t- Disable $title from starting on boot." + elif [[ $(systemctl is-enabled cockpit.socket) == "disabled" ]]; then + echo -e "\tenable\t- Enable $title to start on boot." + + fi + echo -e "\tstatus\t- Show the status of the $title service." + echo -e "\tremove\t- Remove $title." + fi + echo + ;; + "${commands[1]}") + ## install cockpit + pkg_update + pkg_install cockpit cockpit-ws cockpit-system cockpit-storaged + echo "Cockpit installed successfully." + ;; + "${commands[2]}") + ## remove cockpit + systemctl disable cockpit cockpit.socket + pkg_remove cockpit + echo "Cockpit removed successfully." + ;; + "${commands[3]}") + ## start cockpit + + systemctl start cockpit.socket + echo "Cockpit service started." + ;; + "${commands[4]}") + ## stop cockpit + + systemctl stop cockpit.socket + echo "Cockpit service stopped." + ;; + "${commands[5]}") + ## enable cockpit + #systemctl enable cockpit + systemctl enable cockpit.socket + echo "Cockpit service enabled." + ;; + "${commands[6]}") + ## disable cockpit + #systemctl disable cockpit + systemctl disable cockpit.socket + echo "Cockpit service disabled." + ;; + "${commands[7]}") + ## status cockpit + #systemctl status cockpit + systemctl status cockpit.socket + ;; + "${commands[-1]}") + ## check cockpit status + if [[ $(systemctl is-active cockpit.socket) == "active" ]]; then + echo "Cockpit service is active." + return 0 + elif [[ $(systemctl is-enabled cockpit.socket) == "disabled" ]]; then + echo "Cockpit service is disabled." + return 0 + else + return 1 + fi + ;; + *) + echo "Invalid command. Try: '${module_options["module_cockpit,example"]}'" + ;; + esac +} From fd52baa710a9b56f94d7d11e5532154472ac7182 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 06:55:03 +0000 Subject: [PATCH 05/20] mv config.software.json to config.temp.json --- bin/armbian-config | 19 +- tools/json/config.software.json | 1431 ------------------------------ tools/json/config.temp.json | 1437 ++++++++++++++++++++++++++++++- 3 files changed, 1428 insertions(+), 1459 deletions(-) delete mode 100644 tools/json/config.software.json diff --git a/bin/armbian-config b/bin/armbian-config index 30590e663..5db69457b 100755 --- a/bin/armbian-config +++ b/bin/armbian-config @@ -26,7 +26,8 @@ json_file="$lib_dir/config.jobs.json" # # Load The Bash procedure Objects -json_data=$(<"$json_file") +old_json_data=$(<"$json_file") + # # Prepare the module options array @@ -55,6 +56,22 @@ echo "Loaded Software helpers..." #| show_infobox ; source "$lib_dir/config.runtime.sh" echo "Loaded Runtime conditions..." #| show_infobox ; +# Generate the new JSON data +new_json_data=$(generate_json_data) + +json_data=$(jq -s ' + .[0] as $existing | + .[1] as $new | + { + menu: ($existing.menu + $new.menu) + } +' <(echo "$old_json_data") <(echo "$new_json_data")) +# Output the combined JSON data +#echo "$combined_json" > "$lib_dir/combined.config.jobs.json" + + + + clear case "$1" in diff --git a/tools/json/config.software.json b/tools/json/config.software.json deleted file mode 100644 index 0cbbd0db8..000000000 --- a/tools/json/config.software.json +++ /dev/null @@ -1,1431 +0,0 @@ -{ - "menu": [ - { - "id": "Software", - "description": "Run/Install 3rd party applications", - "sub": [ - { - "id": "WebHosting", - "description": "Web server, LEMP, reverse proxy, Let's Encrypt SSL", - "status": "Stable", - "sub": [ - { - "id": "SWAG01", - "description": "SWAG reverse proxy install", - "command": [ - "module_swag install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_swag status" - }, - { - "id": "SWAG02", - "description": "SWAG reverse proxy .htpasswd set", - "command": [ - "module_swag password" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_swag status" - }, - { - "id": "SWAG03", - "description": "SWAG remove", - "command": [ - "module_swag remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_swag status" - }, - { - "id": "SWAG04", - "description": "SWAG purge with data folder", - "command": [ - "module_swag purge" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_swag status" - } - ] - }, - { - "id": "HomeAutomation", - "description": "Home Automation for monitoring and/or control home appliances", - "sub": [ - { - "id": "HAB001", - "description": "openHAB empowering the smart home", - "about": "This operation will install openHAB.", - "command": [ - "module_openhab install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_openhab status" - }, - { - "id": "HAB002", - "description": "openHAB remove", - "about": "This operation will purge openHAB.", - "command": [ - "module_openhab remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_openhab status" - }, - { - "id": "HAB003", - "description": "openHAB purge with data folder", - "about": "This operation will purge openHAB.", - "command": [ - "module_openhab purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_openhab status" - }, - { - "id": "HAS001", - "description": "Home Assistant open source home automation", - "about": "This operation will install Home Assistant.", - "command": [ - "module_haos install" - ], - "status": "Preview", - "author": "@igorpecovnik", - "condition": "! module_haos status && grep -q bookworm /etc/os-release" - }, - { - "id": "HAS002", - "description": "Home Assistant remove", - "about": "This operation will remove Home Assistant.", - "command": [ - "module_haos remove" - ], - "status": "Preview", - "author": "@igorpecovnik", - "condition": "module_haos status" - }, - { - "id": "HAS003", - "description": "Home Assistant purge with data folder", - "about": "This operation will purge Home Assistant.", - "command": [ - "module_haos purge" - ], - "status": "Preview", - "author": "@igorpecovnik", - "condition": "module_haos status" - } - ] - }, - { - "id": "DNS", - "description": "Network-wide ad blockers servers", - "sub": [ - { - "id": "DNS001", - "description": "Pi-hole DNS ad blocker install", - "command": [ - "module_pi_hole install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_pi_hole status" - }, - { - "id": "DNS003", - "description": "Pi-hole remove", - "command": [ - "module_pi_hole remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_pi_hole status" - }, - { - "id": "DNS002", - "description": "Pi-hole change web admin password", - "command": [ - "module_pi_hole password" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_pi_hole status" - }, - { - "id": "DNS004", - "description": "Pi-hole purge", - "command": [ - "module_pi_hole remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_pi_hole status" - } - ] - }, - { - "id": "Desktops", - "description": "Desktop Environments", - "status": "Disabled", - "sub": [ - { - "id": "XFCE", - "description": "XFCE desktop", - "status": "Disabled", - "sub": [ - { - "id": "XFCE01", - "about": "Install XFCE:\nXfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.", - "description": "XFCE desktop Install", - "command": [ - "manage_desktops 'xfce' 'install'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ ! -f /usr/share/xsessions/xfce.desktop ]" - }, - { - "id": "XFCE02", - "description": "Uninstall", - "command": [ - "manage_desktops 'xfce' 'uninstall'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/xfce.desktop ]" - }, - { - "id": "XFCE03", - "description": "Enable autologin", - "command": [ - "manage_desktops 'xfce' 'auto'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/xfce.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" - }, - { - "id": "XFCE04", - "description": "Disable autologin", - "command": [ - "manage_desktops 'xfce' 'manual'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/xfce.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" - } - ] - }, - { - "id": "Gnome", - "description": "Gnome desktop", - "status": "Disabled", - "sub": [ - { - "id": "GNOME01", - "description": "Gnome desktop Install", - "command": [ - "manage_desktops 'gnome' 'install'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" - }, - { - "id": "GNOME02", - "description": "Uninstall", - "command": [ - "manage_desktops 'gnome' 'uninstall'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" - }, - { - "id": "GNOME03", - "description": "Enable autologin", - "command": [ - "manage_desktops 'gnome' 'auto'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && ! cat /etc/gdm3/custom.conf 2>/dev/null | grep AutomaticLoginEnable | grep true >/dev/null" - }, - { - "id": "GNOME04", - "description": "Disable autologin", - "command": [ - "manage_desktops 'gnome' 'manual'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && cat /etc/gdm3/custom.conf 2>/dev/null | grep AutomaticLoginEnable | grep true >/dev/null" - } - ] - }, - { - "id": "I3WM", - "description": "i3-wm desktop", - "status": "Disabled", - "sub": [ - { - "id": "I3WM01", - "description": "i3 desktop Install", - "command": [ - "manage_desktops 'i3-wm' 'install'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ ! -f /usr/share/xsessions/i3.desktop ]" - }, - { - "id": "I3WM02", - "description": "i3 desktop uninstall", - "command": [ - "manage_desktops 'i3-wm' 'uninstall'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/i3.desktop ]" - }, - { - "id": "I3WM03", - "description": "Enable autologin", - "command": [ - "manage_desktops 'i3-wm' 'auto'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/i3.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" - }, - { - "id": "I3WM04", - "description": "Disable autologin", - "command": [ - "manage_desktops 'i3-wm' 'manual'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/i3.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" - } - ] - }, - { - "id": "Cinnamon", - "description": "Cinnamon desktop", - "status": "Disabled", - "sub": [ - { - "id": "CINNAMON01", - "description": "Cinnamon desktop Install", - "command": [ - "manage_desktops 'cinnamon' 'install'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ ! -f /usr/share/xsessions/cinnamon.desktop ] && [ ! -f /usr/share/xsessions/cinnamon2d.desktop ]" - }, - { - "id": "CINNAMON02", - "description": "Cinnamon desktop uninstall", - "command": [ - "manage_desktops 'cinnamon' 'uninstall'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] || [ -f /usr/share/xsessions/cinnamon2d.desktop ]" - }, - { - "id": "CINNAMON03", - "description": "Enable autologin", - "command": [ - "manage_desktops 'cinnamon' 'auto'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" - }, - { - "id": "CINNAMON04", - "description": "Disable autologin", - "command": [ - "manage_desktops 'cinnamon' 'manual'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" - } - ] - }, - { - "id": "KDEN", - "description": "Kde-neon desktop", - "status": "Disabled", - "sub": [ - { - "id": "KDENEON01", - "description": "Kde-neon desktop Install", - "command": [ - "manage_desktops 'kde-neon' 'install'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" - }, - { - "id": "KDENEON02", - "description": "Uninstall", - "command": [ - "manage_desktops 'kde-neon' 'uninstall'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" - }, - { - "id": "KDENEON03", - "description": "Enable autologin", - "command": [ - "manage_desktops 'kde-neon' 'auto'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" - }, - { - "id": "KDENEON04", - "description": "Disable autologin", - "command": [ - "manage_desktops 'kde-neon' 'manual'" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" - } - ] - }, - { - "id": "Xapian", - "description": "Improve application search speed", - "command": [ - "update-apt-xapian-index -u; sleep 3" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "systemctl is-active --quiet service display-manager" - } - ] - }, - { - "id": "Downloaders", - "description": "P2P download managers for movies, TV shows, music and subtitles", - "sub": [ - { - "id": "DOW001", - "description": "qBittorrent BitTorrent server ", - "about": "This operation will install qBittorrent BitTorrent server", - "command": [ - "module_qbittorrent install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_qbittorrent status" - }, - { - "id": "DOW002", - "description": "qBittorrent remove", - "about": "This operation will remove qBittorrent BitTorrent server", - "command": [ - "module_qbittorrent remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_qbittorrent status" - }, - { - "id": "DOW003", - "description": "qBittorrent purge with data folder", - "about": "This operation will remove qBittorrent BitTorrent data folder", - "command": [ - "module_qbittorrent purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_qbittorrent status" - }, - { - "id": "DEL001", - "description": "Deluge BitTorrent server", - "about": "This operation will install BitTorrent server", - "command": [ - "module_deluge install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_deluge status" - }, - { - "id": "DEL002", - "description": "Deluge remove", - "about": "This operation will remove Deluge BitTorrent server", - "command": [ - "module_deluge remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_deluge status" - }, - { - "id": "DEL003", - "description": "Deluge purge with data folder", - "about": "This operation will remove Deluge BitTorrent server data folder", - "command": [ - "module_deluge purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_deluge status" - }, - { - "id": "TRA001", - "description": "Transmission BitTorrent server", - "about": "This operation will install Transmission BitTorrent server", - "command": [ - "module_transmission install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_transmission status" - }, - { - "id": "TRA002", - "description": "Transmission remove", - "about": "This operation will remove Transmission BitTorrent server", - "command": [ - "module_transmission remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_transmission status" - }, - { - "id": "TRA003", - "description": "Transmission purge with data folder", - "about": "This operation will remove Transmission BitTorrent server data folder", - "command": [ - "module_transmission purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_transmission status" - }, - { - "id": "SABN01", - "description": "SABnzbd newsgroup downloader", - "about": "This operation will install SABnzbd newsgroup downloader", - "command": [ - "module_sabnzbd install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_sabnzbd status" - }, - { - "id": "SABN02", - "description": "SABnzbd remove", - "about": "This operation will remove SABnzbd newsgroup downloader", - "command": [ - "module_sabnzbd remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_sabnzbd status" - }, - { - "id": "SABN03", - "description": "SABnzbd purge with data folder", - "about": "This operation will purge SABnzbd newsgroup data folder", - "command": [ - "module_sabnzbd purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_sabnzbd status" - }, - { - "id": "MDS001", - "description": "Medusa automatic downloader for TV shows", - "about": "This operation will install Medusa TV shows downloader", - "command": [ - "module_medusa install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_medusa status" - }, - { - "id": "MDS002", - "description": "Medusa TV shows downloader remove", - "about": "This operation will remove Medusa TV shows downloader", - "command": [ - "module_medusa remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_medusa status" - }, - { - "id": "MDS003", - "description": "Medusa TV shows downloader purge", - "about": "This operation will purge Medusa TV shows data folder", - "command": [ - "module_medusa purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_medusa status" - }, - { - "id": "SON001", - "description": "Sonarr automatic downloader for TV shows", - "about": "This operation will install Sonarr PVR for Usenet and BitTorrent", - "command": [ - "module_sonarr install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_sonarr status" - }, - { - "id": "SON002", - "description": "Sonarr remove", - "about": "This operation will remove Sonarr PVR for Usenet and BitTorrent", - "command": [ - "module_sonarr remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_sonarr status" - }, - { - "id": "SON003", - "description": "Sonarr purge with data folder", - "about": "This operation will purge Sonarr PVR for Usenet and BitTorrent purge data folder", - "command": [ - "module_sonarr purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_sonarr status" - }, - { - "id": "RAD001", - "description": "Radarr automatic downloader for movies", - "about": "This operation will install Radarr movie collection manager", - "command": [ - "module_radarr install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_radarr status" - }, - { - "id": "RAD002", - "description": "Radarr remove", - "about": "This operation will remove Radarr movie collection manager", - "command": [ - "module_radarr remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_radarr status" - }, - { - "id": "RAD003", - "description": "Radarr purge with data folder", - "about": "This operation will purge Radarr movie collection manager data folder", - "command": [ - "module_radarr purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_radarr status" - }, - { - "id": "BAZ001", - "description": "Bazarr automatic subtitles downloader for Sonarr and Radarr", - "about": "This operation will install Bazarr subtitles manager for Sonarr and Radarr", - "command": [ - "module_bazarr install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_bazarr status" - }, - { - "id": "BAZ002", - "description": "Bazarr remove", - "about": "This operation will remove Bazarr subtitles manager for Sonarr and Radarr", - "command": [ - "module_bazarr remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_bazarr status" - }, - { - "id": "BAZ003", - "description": "Bazarr purge with data folder", - "about": "This operation will purge Bazarr subtitles manager with data folder", - "command": [ - "module_bazarr purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_bazarr status" - }, - { - "id": "LID001", - "description": "Lidarr automatic music downloader", - "about": "This operation will install Lidarr music collection manager for Usenet and BitTorrent users", - "command": [ - "module_lidarr install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_lidarr status" - }, - { - "id": "LID002", - "description": "Lidarr remove", - "about": "This operation will remove Lidarr", - "command": [ - "module_lidarr remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_lidarr status" - }, - { - "id": "LID003", - "description": "Lidarr purge with data folder", - "about": "This operation will purge Lidarr with data folder", - "command": [ - "module_lidarr purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_lidarr status" - }, - { - "id": "RDR001", - "description": "Readarr automatic downloader for Ebooks", - "about": "This operation will install Readarr", - "command": [ - "module_readarr install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_readarr status" - }, - { - "id": "RDR002", - "description": "Readarr remove", - "about": "This operation will remove Readarr", - "command": [ - "module_readarr remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_readarr status" - }, - { - "id": "RDR003", - "description": "Readarr purge with data folder", - "about": "This operation will purge Readarr with data folder", - "command": [ - "module_readarr purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_readarr status" - }, - { - "id": "DOW025", - "description": "Prowlarr index manager and proxy for PVR", - "about": "This operation will install Prowlarr", - "command": [ - "module_prowlarr install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_prowlarr status" - }, - { - "id": "DOW026", - "description": "Prowlarr remove", - "about": "This operation will remove Prowlarr", - "command": [ - "module_prowlarr remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_prowlarr status" - }, - { - "id": "DOW027", - "description": "Prowlarr purge with data folder", - "about": "This operation will purge Prowlarr with data folder", - "command": [ - "module_prowlarr purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_prowlarr status" - }, - { - "id": "JEL001", - "description": "Jellyseerr Jellyfin/Emby/Plex integration install", - "about": "This operation will install Jellyseerr", - "command": [ - "module_jellyseerr install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_jellyseerr status" - }, - { - "id": "JEL002", - "description": "Jellyseerr remove", - "about": "This operation will remove Jellyseerr", - "command": [ - "module_jellyseerr remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_jellyseerr status" - }, - { - "id": "JEL003", - "description": "Jellyseerr purge with data folder", - "about": "This operation will purge Jellyseerr with data folder", - "command": [ - "module_jellyseerr purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_jellyseerr status ]]" - } - ] - }, - { - "id": "Database", - "description": "SQL database servers and web interface managers", - "sub": [ - { - "id": "DAT001", - "description": "Mariadb install", - "command": [ - "module_mariadb install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_mariadb status" - }, - { - "id": "DAT002", - "description": "Mariadb remove", - "command": [ - "module_mariadb remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_mariadb status" - }, - { - "id": "DAT003", - "description": "Mariadb purge", - "command": [ - "module_mariadb purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_mariadb status && [[ -d \"${SOFTWARE_FOLDER}/mariadb\" ]]" - }, - { - "id": "DAT005", - "description": "phpMyAdmin install", - "command": [ - "module_phpmyadmin install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_phpmyadmin status" - }, - { - "id": "DAT006", - "description": "phpMyAdmin remove", - "command": [ - "module_phpmyadmin remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_phpmyadmin status" - }, - { - "id": "DAT007", - "description": "phpMyAdmin purge", - "command": [ - "module_phpmyadmin purge" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_phpmyadmin status && [[ -d \"${SOFTWARE_FOLDER}/phpmyadmin\" ]]" - } - ] - }, - { - "id": "DevTools", - "description": "Applications and tools for development", - "sub": [ - { - "id": "DEV001", - "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", - "pkg_install git" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! pkg_installed git" - }, - { - "id": "DEV002", - "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", - "pkg_remove git" - ], - "status": "Stable", - "author": "@armbian", - "condition": "pkg_installed git" - } - ] - }, - { - "id": "Benchy", - "description": "System benchmaking and diagnostics", - "command": [ - "see_monitoring" - ], - "status": "Disabled", - "author": "@armbian", - "condition": "[ -f /usr/bin/armbianmonitor ]" - }, - { - "id": "Containers", - "description": "Docker containerization and KVM virtual machines", - "sub": [ - { - "id": "CON001", - "description": "Docker Minimal Install", - "about": "This operation will install Docker Minimal.", - "command": [ - "module_docker install minimal" - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "! module_docker status docker-ce" - }, - { - "id": "CON002", - "description": "Docker Engine Install", - "about": "This operation will install Docker Engine.", - "command": [ - "module_docker install engine" - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "! module_docker status docker-compose-plugin" - }, - { - "id": "CON003", - "description": "Docker Remove", - "about": "This operation will purge Docker.", - "command": [ - "module_docker remove" - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "module_docker status docker-ce" - }, - { - "id": "CON004", - "description": "Docker Purge all images, containers, and volumes", - "about": "This operation will delete all Docker images, containers, and volumes.", - "command": [ - "module_docker purge" - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "! module_docker status docker-ce && [ -d /var/lib/docker ]" - }, - { - "id": "CON005", - "description": "Portainer container management platform", - "prompt": "This operation will install Portainer container management platform.", - "command": [ - "module_portainer install" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! module_portainer status" - }, - { - "id": "CON006", - "description": "Portainer remove", - "prompt": "This operation will remove Portainer container management platform.", - "command": [ - "module_portainer remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_portainer status" - }, - { - "id": "CON007", - "description": "Portainer purge with with data folder", - "prompt": "This operation will remove Portainer container management platform.", - "command": [ - "module_portainer remove" - ], - "status": "Stable", - "author": "@armbian", - "condition": "module_portainer status" - } - ] - }, - { - "id": "Media", - "description": "Media servers, organizers and editors", - "sub": [ - { - "id": "MED001", - "description": "Plex Media server", - "about": "This operation will install Plex Media server.", - "command": [ - "module_plexmediaserver install" - ], - "status": "Disabled", - "author": "@schwar3kat", - "condition": "! module_plexmediaserver status" - }, - { - "id": "MED002", - "description": "Plex Media server remove", - "about": "This operation will purge Plex Media server.", - "command": [ - "module_plexmediaserver remove" - ], - "status": "Disabled", - "author": "@schwar3kat", - "condition": "module_plexmediaserver status" - }, - { - "id": "MED003", - "description": "Emby organizes video, music, live TV, and photos", - "about": "This operation will install Emby server.", - "command": [ - "module_embyserver install" - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "! module_embyserver status" - }, - { - "id": "MED004", - "description": "Emby server remove", - "about": "This operation will remove Emby server", - "command": [ - "module_embyserver remove" - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "module_embyserver status" - }, - { - "id": "MED005", - "description": "Emby server purge with data folder", - "command": [ - "module_embyserver purge" - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "module_embyserver status" - }, - { - "id": "MED010", - "description": "Stirling PDF tools for viewing and editing PDF files", - "about": "This operation will install Stirling-PDF tools.", - "command": [ - "module_stirling install" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "! module_stirling status" - }, - { - "id": "MED011", - "description": "Stirling PDF remove", - "about": "This operation will remove Stirling-PDF tools.", - "command": [ - "module_stirling remove" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_stirling status" - }, - { - "id": "MED012", - "description": "Stirling PDF purge with data folder", - "about": "This operation will purge Stirling-PDF tools with data folder.", - "command": [ - "module_stirling purge" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_stirling status" - }, - { - "id": "MED015", - "description": "Syncthing continuous file synchronization", - "command": [ - "module_syncthing install" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "! module_syncthing status" - }, - { - "id": "MED016", - "description": "Syncthing remove", - "command": [ - "module_syncthing remove" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_syncthing status" - }, - { - "id": "MED017", - "description": "Syncthing purge with data folder", - "command": [ - "module_syncthing purge" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_syncthing status" - }, - { - "id": "MED020", - "description": "Nextcloud content collaboration platform", - "command": [ - "module_nextcloud install" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "! module_nextcloud status" - }, - { - "id": "MED021", - "description": "Nextcloud remove", - "command": [ - "module_nextcloud remove" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_nextcloud status" - }, - { - "id": "MED022", - "description": "Nextcloud purge with data folder", - "command": [ - "module_nextcloud purge" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_nextcloud status" - }, - { - "id": "MED025", - "description": "Owncloud share files and folders, easy and secure", - "command": [ - "module_owncloud install" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "! module_owncloud status" - }, - { - "id": "MED026", - "description": "Owncloud remove", - "command": [ - "module_owncloud remove" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_owncloud status" - }, - { - "id": "MED027", - "description": "Owncloud purge with data folder", - "command": [ - "module_owncloud purge" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_owncloud status" - } - ] - }, - { - "id": "Monitoring", - "description": "Real-time monitoring, collecting metrics, up-time status", - "sub": [ - { - "id": "MON001", - "description": "Uptime Kuma self-hosted monitoring tool", - "about": "This operation will install Uptime Kuma", - "command": [ - "module_uptimekuma install" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "! module_uptimekuma status" - }, - { - "id": "MON002", - "description": "Uptime Kuma remove", - "about": "This operation will remove Uptime Kuma", - "command": [ - "module_uptimekuma remove" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_uptimekuma status" - }, - { - "id": "MON003", - "description": "Uptime Kuma purge with data folder", - "about": "This operation will remove Uptime Kuma with data folder", - "command": [ - "module_uptimekuma purge" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_uptimekuma status" - }, - { - "id": "MON005", - "description": "Netdata - monitoring real-time metrics", - "about": "This operation will install Netdata", - "command": [ - "module_netdata install" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "! module_netdata status" - }, - { - "id": "MON006", - "description": "Netdata remove", - "about": "This operation will remove Netdata", - "command": [ - "module_netdata remove" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_netdata status" - }, - { - "id": "MON007", - "description": "Netdata purge with data folder", - "about": "This operation will purge Netdata with data folder", - "command": [ - "module_netdata purge" - ], - "status": "Stable", - "author": "@igorpecovnik", - "condition": "module_netdata status" - } - - ] - }, - { - "id": "Management", - "description": "Remote Management tools", - "sub": [ - { - "id": "MAN001", - "description": "Install Cockpit web-based management tool", - "about": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged", - "command": [ - "see_current_apt update", - "pkg_install cockpit cockpit-ws cockpit-system cockpit-storaged " - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "! pkg_installed cockpit" - }, - { - "id": "MAN002", - "description": "Purge Cockpit web-based management tool", - "about": "This operation will purge Cockpit.", - "command": [ - "pkg_remove cockpit" - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "pkg_installed cockpit" - }, - { - "id": "MAN003", - "description": "Start Cockpit Service", - "command": [ - "sudo systemctl enable --now cockpit.socket | show_infobox " - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "pkg_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" - }, - { - "id": "MAN004", - "description": "Stop Cockpit Service", - "command": [ - "systemctl stop cockpit cockpit.socket", - "systemctl disable cockpit.socket | show_infobox " - ], - "status": "Stable", - "author": "@schwar3kat", - "condition": "pkg_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" - }, - { - "id": "MAN005", - "description": "Webmin web-based management tool", - "command": [ - "see_menu module_webmin" - ], - "status": "Stable", - "author": "@Tearran", - "condition": "" - } - ] - }, - { - "id": "Netconfig", - "description": "Console network tools for measuring load and bandwidth", - "sub": [ - { - "id": "NET001", - "description": "nload -realtime console network usage monitor", - "prompt": "This operation will install nload.", - "command": [ - "pkg_install nload" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! pkg_installed nload" - }, - { - "id": "NET002", - "description": "nload - remove", - "prompt": "This operation will remove nload.", - "command": [ - "pkg_remove nload" - ], - "status": "Stable", - "author": "@armbian", - "condition": "pkg_installed nload" - }, - { - "id": "NET003", - "description": "iperf3 bandwidth measuring tool", - "prompt": "This operation will install iperf3.", - "command": [ - "pkg_install iperf3" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! pkg_installed iperf3" - }, - { - "id": "NET004", - "description": "iperf3 remove", - "prompt": "This operation will remove iperf3.", - "command": [ - "pkg_remove iperf3" - ], - "status": "Stable", - "author": "@armbian", - "condition": "pkg_installed iperf3" - }, - { - "id": "NET005", - "description": "iptraf-ng IP LAN monitor", - "prompt": "This operation will install iptraf-ng.", - "command": [ - "pkg_install iptraf-ng" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! pkg_installed iptraf-ng" - }, - { - "id": "NET006", - "description": "iptraf-ng remove", - "prompt": "This operation will remove iptraf-ng.", - "command": [ - "pkg_remove iptraf-ng" - ], - "status": "Stable", - "author": "@armbian", - "condition": "pkg_installed iptraf-ng" - }, - { - "id": "NET007", - "description": "avahi-daemon hostname broadcast via mDNS", - "prompt": "This operation will install avahi-daemon.", - "command": [ - "pkg_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 restart avahi-daemon" - ], - "status": "Stable", - "author": "@armbian", - "condition": "! pkg_installed avahi-daemon" - }, - { - "id": "NET008", - "description": "avahi-daemon remove", - "prompt": "This operation will remove avahi-daemon.", - "command": [ - "systemctl stop avahi-daemon avahi-daemon.socket", - "pkg_remove avahi-daemon" - ], - "status": "Stable", - "author": "@armbian", - "condition": "pkg_installed avahi-daemon" - } - ] - } - ] - } - ] -} diff --git a/tools/json/config.temp.json b/tools/json/config.temp.json index 0cfe9d78b..9a856db4b 100644 --- a/tools/json/config.temp.json +++ b/tools/json/config.temp.json @@ -1,48 +1,1431 @@ { "menu": [ { - "id": "Template", - "description": "Description ... ", + "id": "Software00", + "description": "Run/Install 3rd party applications", "sub": [ { - "id": "UID01", - "description": "Description ... ", - "prompt": "", + "id": "WebHosting", + "description": "Web server, LEMP, reverse proxy, Let's Encrypt SSL", + "status": "Stable", "sub": [ { - "id": "SUB02", - "description": "Description ... ", + "id": "SWAG01", + "description": "SWAG reverse proxy install", "command": [ - "show_message <<< \" Message ... \"" + "module_swag install" ], - "status": "", - "author": "Github Username", - "condition": "" + "status": "Stable", + "author": "@armbian", + "condition": "! module_swag status" + }, + { + "id": "SWAG02", + "description": "SWAG reverse proxy .htpasswd set", + "command": [ + "module_swag password" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_swag status" + }, + { + "id": "SWAG03", + "description": "SWAG remove", + "command": [ + "module_swag remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_swag status" + }, + { + "id": "SWAG04", + "description": "SWAG purge with data folder", + "command": [ + "module_swag purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_swag status" } ] }, { - "id": "UID03", - "description": "Description ... ", - "command": [ - "show_message <<< \" Message ... \"" - ], - "status": "", - "author": "Github Username", - "condition": "" + "id": "HomeAutomation", + "description": "Home Automation for monitoring and/or control home appliances", + "sub": [ + { + "id": "HAB001", + "description": "openHAB empowering the smart home", + "about": "This operation will install openHAB.", + "command": [ + "module_openhab install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_openhab status" + }, + { + "id": "HAB002", + "description": "openHAB remove", + "about": "This operation will purge openHAB.", + "command": [ + "module_openhab remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_openhab status" + }, + { + "id": "HAB003", + "description": "openHAB purge with data folder", + "about": "This operation will purge openHAB.", + "command": [ + "module_openhab purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_openhab status" + }, + { + "id": "HAS001", + "description": "Home Assistant open source home automation", + "about": "This operation will install Home Assistant.", + "command": [ + "module_haos install" + ], + "status": "Preview", + "author": "@igorpecovnik", + "condition": "! module_haos status && grep -q bookworm /etc/os-release" + }, + { + "id": "HAS002", + "description": "Home Assistant remove", + "about": "This operation will remove Home Assistant.", + "command": [ + "module_haos remove" + ], + "status": "Preview", + "author": "@igorpecovnik", + "condition": "module_haos status" + }, + { + "id": "HAS003", + "description": "Home Assistant purge with data folder", + "about": "This operation will purge Home Assistant.", + "command": [ + "module_haos purge" + ], + "status": "Preview", + "author": "@igorpecovnik", + "condition": "module_haos status" + } + ] + }, + { + "id": "DNS", + "description": "Network-wide ad blockers servers", + "sub": [ + { + "id": "DNS001", + "description": "Pi-hole DNS ad blocker install", + "command": [ + "module_pi_hole install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_pi_hole status" + }, + { + "id": "DNS003", + "description": "Pi-hole remove", + "command": [ + "module_pi_hole remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_pi_hole status" + }, + { + "id": "DNS002", + "description": "Pi-hole change web admin password", + "command": [ + "module_pi_hole password" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_pi_hole status" + }, + { + "id": "DNS004", + "description": "Pi-hole purge", + "command": [ + "module_pi_hole remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_pi_hole status" + } + ] + }, + { + "id": "Desktops", + "description": "Desktop Environments", + "status": "Disabled", + "sub": [ + { + "id": "XFCE", + "description": "XFCE desktop", + "status": "Disabled", + "sub": [ + { + "id": "XFCE01", + "about": "Install XFCE:\nXfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.", + "description": "XFCE desktop Install", + "command": [ + "manage_desktops 'xfce' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/xfce.desktop ]" + }, + { + "id": "XFCE02", + "description": "Uninstall", + "command": [ + "manage_desktops 'xfce' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ]" + }, + { + "id": "XFCE03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'xfce' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "XFCE04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'xfce' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] + }, + { + "id": "Gnome", + "description": "Gnome desktop", + "status": "Disabled", + "sub": [ + { + "id": "GNOME01", + "description": "Gnome desktop Install", + "command": [ + "manage_desktops 'gnome' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "GNOME02", + "description": "Uninstall", + "command": [ + "manage_desktops 'gnome' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "GNOME03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'gnome' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && ! cat /etc/gdm3/custom.conf 2>/dev/null | grep AutomaticLoginEnable | grep true >/dev/null" + }, + { + "id": "GNOME04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'gnome' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && cat /etc/gdm3/custom.conf 2>/dev/null | grep AutomaticLoginEnable | grep true >/dev/null" + } + ] + }, + { + "id": "I3WM", + "description": "i3-wm desktop", + "status": "Disabled", + "sub": [ + { + "id": "I3WM01", + "description": "i3 desktop Install", + "command": [ + "manage_desktops 'i3-wm' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/i3.desktop ]" + }, + { + "id": "I3WM02", + "description": "i3 desktop uninstall", + "command": [ + "manage_desktops 'i3-wm' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/i3.desktop ]" + }, + { + "id": "I3WM03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'i3-wm' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/i3.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "I3WM04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'i3-wm' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/i3.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] + }, + { + "id": "Cinnamon", + "description": "Cinnamon desktop", + "status": "Disabled", + "sub": [ + { + "id": "CINNAMON01", + "description": "Cinnamon desktop Install", + "command": [ + "manage_desktops 'cinnamon' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/cinnamon.desktop ] && [ ! -f /usr/share/xsessions/cinnamon2d.desktop ]" + }, + { + "id": "CINNAMON02", + "description": "Cinnamon desktop uninstall", + "command": [ + "manage_desktops 'cinnamon' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] || [ -f /usr/share/xsessions/cinnamon2d.desktop ]" + }, + { + "id": "CINNAMON03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'cinnamon' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "CINNAMON04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'cinnamon' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] + }, + { + "id": "KDEN", + "description": "Kde-neon desktop", + "status": "Disabled", + "sub": [ + { + "id": "KDENEON01", + "description": "Kde-neon desktop Install", + "command": [ + "manage_desktops 'kde-neon' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "KDENEON02", + "description": "Uninstall", + "command": [ + "manage_desktops 'kde-neon' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "KDENEON03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'kde-neon' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "KDENEON04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'kde-neon' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] + }, + { + "id": "Xapian", + "description": "Improve application search speed", + "command": [ + "update-apt-xapian-index -u; sleep 3" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "systemctl is-active --quiet service display-manager" + } + ] + }, + { + "id": "Downloaders", + "description": "P2P download managers for movies, TV shows, music and subtitles", + "sub": [ + { + "id": "DOW001", + "description": "qBittorrent BitTorrent server ", + "about": "This operation will install qBittorrent BitTorrent server", + "command": [ + "module_qbittorrent install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_qbittorrent status" + }, + { + "id": "DOW002", + "description": "qBittorrent remove", + "about": "This operation will remove qBittorrent BitTorrent server", + "command": [ + "module_qbittorrent remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_qbittorrent status" + }, + { + "id": "DOW003", + "description": "qBittorrent purge with data folder", + "about": "This operation will remove qBittorrent BitTorrent data folder", + "command": [ + "module_qbittorrent purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_qbittorrent status" + }, + { + "id": "DEL001", + "description": "Deluge BitTorrent server", + "about": "This operation will install BitTorrent server", + "command": [ + "module_deluge install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_deluge status" + }, + { + "id": "DEL002", + "description": "Deluge remove", + "about": "This operation will remove Deluge BitTorrent server", + "command": [ + "module_deluge remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_deluge status" + }, + { + "id": "DEL003", + "description": "Deluge purge with data folder", + "about": "This operation will remove Deluge BitTorrent server data folder", + "command": [ + "module_deluge purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_deluge status" + }, + { + "id": "TRA001", + "description": "Transmission BitTorrent server", + "about": "This operation will install Transmission BitTorrent server", + "command": [ + "module_transmission install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_transmission status" + }, + { + "id": "TRA002", + "description": "Transmission remove", + "about": "This operation will remove Transmission BitTorrent server", + "command": [ + "module_transmission remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_transmission status" + }, + { + "id": "TRA003", + "description": "Transmission purge with data folder", + "about": "This operation will remove Transmission BitTorrent server data folder", + "command": [ + "module_transmission purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_transmission status" + }, + { + "id": "SABN01", + "description": "SABnzbd newsgroup downloader", + "about": "This operation will install SABnzbd newsgroup downloader", + "command": [ + "module_sabnzbd install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_sabnzbd status" + }, + { + "id": "SABN02", + "description": "SABnzbd remove", + "about": "This operation will remove SABnzbd newsgroup downloader", + "command": [ + "module_sabnzbd remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sabnzbd status" + }, + { + "id": "SABN03", + "description": "SABnzbd purge with data folder", + "about": "This operation will purge SABnzbd newsgroup data folder", + "command": [ + "module_sabnzbd purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sabnzbd status" + }, + { + "id": "MDS001", + "description": "Medusa automatic downloader for TV shows", + "about": "This operation will install Medusa TV shows downloader", + "command": [ + "module_medusa install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_medusa status" + }, + { + "id": "MDS002", + "description": "Medusa TV shows downloader remove", + "about": "This operation will remove Medusa TV shows downloader", + "command": [ + "module_medusa remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_medusa status" + }, + { + "id": "MDS003", + "description": "Medusa TV shows downloader purge", + "about": "This operation will purge Medusa TV shows data folder", + "command": [ + "module_medusa purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_medusa status" + }, + { + "id": "SON001", + "description": "Sonarr automatic downloader for TV shows", + "about": "This operation will install Sonarr PVR for Usenet and BitTorrent", + "command": [ + "module_sonarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_sonarr status" + }, + { + "id": "SON002", + "description": "Sonarr remove", + "about": "This operation will remove Sonarr PVR for Usenet and BitTorrent", + "command": [ + "module_sonarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sonarr status" + }, + { + "id": "SON003", + "description": "Sonarr purge with data folder", + "about": "This operation will purge Sonarr PVR for Usenet and BitTorrent purge data folder", + "command": [ + "module_sonarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sonarr status" + }, + { + "id": "RAD001", + "description": "Radarr automatic downloader for movies", + "about": "This operation will install Radarr movie collection manager", + "command": [ + "module_radarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_radarr status" + }, + { + "id": "RAD002", + "description": "Radarr remove", + "about": "This operation will remove Radarr movie collection manager", + "command": [ + "module_radarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_radarr status" + }, + { + "id": "RAD003", + "description": "Radarr purge with data folder", + "about": "This operation will purge Radarr movie collection manager data folder", + "command": [ + "module_radarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_radarr status" + }, + { + "id": "BAZ001", + "description": "Bazarr automatic subtitles downloader for Sonarr and Radarr", + "about": "This operation will install Bazarr subtitles manager for Sonarr and Radarr", + "command": [ + "module_bazarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_bazarr status" + }, + { + "id": "BAZ002", + "description": "Bazarr remove", + "about": "This operation will remove Bazarr subtitles manager for Sonarr and Radarr", + "command": [ + "module_bazarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_bazarr status" + }, + { + "id": "BAZ003", + "description": "Bazarr purge with data folder", + "about": "This operation will purge Bazarr subtitles manager with data folder", + "command": [ + "module_bazarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_bazarr status" + }, + { + "id": "LID001", + "description": "Lidarr automatic music downloader", + "about": "This operation will install Lidarr music collection manager for Usenet and BitTorrent users", + "command": [ + "module_lidarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_lidarr status" + }, + { + "id": "LID002", + "description": "Lidarr remove", + "about": "This operation will remove Lidarr", + "command": [ + "module_lidarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_lidarr status" + }, + { + "id": "LID003", + "description": "Lidarr purge with data folder", + "about": "This operation will purge Lidarr with data folder", + "command": [ + "module_lidarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_lidarr status" + }, + { + "id": "RDR001", + "description": "Readarr automatic downloader for Ebooks", + "about": "This operation will install Readarr", + "command": [ + "module_readarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_readarr status" + }, + { + "id": "RDR002", + "description": "Readarr remove", + "about": "This operation will remove Readarr", + "command": [ + "module_readarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_readarr status" + }, + { + "id": "RDR003", + "description": "Readarr purge with data folder", + "about": "This operation will purge Readarr with data folder", + "command": [ + "module_readarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_readarr status" + }, + { + "id": "DOW025", + "description": "Prowlarr index manager and proxy for PVR", + "about": "This operation will install Prowlarr", + "command": [ + "module_prowlarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_prowlarr status" + }, + { + "id": "DOW026", + "description": "Prowlarr remove", + "about": "This operation will remove Prowlarr", + "command": [ + "module_prowlarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_prowlarr status" + }, + { + "id": "DOW027", + "description": "Prowlarr purge with data folder", + "about": "This operation will purge Prowlarr with data folder", + "command": [ + "module_prowlarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_prowlarr status" + }, + { + "id": "JEL001", + "description": "Jellyseerr Jellyfin/Emby/Plex integration install", + "about": "This operation will install Jellyseerr", + "command": [ + "module_jellyseerr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_jellyseerr status" + }, + { + "id": "JEL002", + "description": "Jellyseerr remove", + "about": "This operation will remove Jellyseerr", + "command": [ + "module_jellyseerr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_jellyseerr status" + }, + { + "id": "JEL003", + "description": "Jellyseerr purge with data folder", + "about": "This operation will purge Jellyseerr with data folder", + "command": [ + "module_jellyseerr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_jellyseerr status ]]" + } + ] + }, + { + "id": "Database", + "description": "SQL database servers and web interface managers", + "sub": [ + { + "id": "DAT001", + "description": "Mariadb install", + "command": [ + "module_mariadb install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_mariadb status" + }, + { + "id": "DAT002", + "description": "Mariadb remove", + "command": [ + "module_mariadb remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_mariadb status" + }, + { + "id": "DAT003", + "description": "Mariadb purge", + "command": [ + "module_mariadb purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_mariadb status && [[ -d \"${SOFTWARE_FOLDER}/mariadb\" ]]" + }, + { + "id": "DAT005", + "description": "phpMyAdmin install", + "command": [ + "module_phpmyadmin install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_phpmyadmin status" + }, + { + "id": "DAT006", + "description": "phpMyAdmin remove", + "command": [ + "module_phpmyadmin remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_phpmyadmin status" + }, + { + "id": "DAT007", + "description": "phpMyAdmin purge", + "command": [ + "module_phpmyadmin purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_phpmyadmin status && [[ -d \"${SOFTWARE_FOLDER}/phpmyadmin\" ]]" + } + ] + }, + { + "id": "DevTools", + "description": "Applications and tools for development", + "sub": [ + { + "id": "DEV001", + "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", + "pkg_install git" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed git" + }, + { + "id": "DEV002", + "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", + "pkg_remove git" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed git" + } + ] }, { - "id": "UID04", - "description": "Description ... ", - "prompt": "Prompt\nContinue?", + "id": "Benchy", + "description": "System benchmaking and diagnostics", "command": [ - "show_message <<< \" Message ... \"" + "see_monitoring" ], - "status": "", - "author": "Github Username", - "condition": "" + "status": "Disabled", + "author": "@armbian", + "condition": "[ -f /usr/bin/armbianmonitor ]" + }, + { + "id": "Containers", + "description": "Docker containerization and KVM virtual machines", + "sub": [ + { + "id": "CON001", + "description": "Docker Minimal Install", + "about": "This operation will install Docker Minimal.", + "command": [ + "module_docker install minimal" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! module_docker status docker-ce" + }, + { + "id": "CON002", + "description": "Docker Engine Install", + "about": "This operation will install Docker Engine.", + "command": [ + "module_docker install engine" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! module_docker status docker-compose-plugin" + }, + { + "id": "CON003", + "description": "Docker Remove", + "about": "This operation will purge Docker.", + "command": [ + "module_docker remove" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "module_docker status docker-ce" + }, + { + "id": "CON004", + "description": "Docker Purge all images, containers, and volumes", + "about": "This operation will delete all Docker images, containers, and volumes.", + "command": [ + "module_docker purge" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! module_docker status docker-ce && [ -d /var/lib/docker ]" + }, + { + "id": "CON005", + "description": "Portainer container management platform", + "prompt": "This operation will install Portainer container management platform.", + "command": [ + "module_portainer install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_portainer status" + }, + { + "id": "CON006", + "description": "Portainer remove", + "prompt": "This operation will remove Portainer container management platform.", + "command": [ + "module_portainer remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_portainer status" + }, + { + "id": "CON007", + "description": "Portainer purge with with data folder", + "prompt": "This operation will remove Portainer container management platform.", + "command": [ + "module_portainer remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_portainer status" + } + ] + }, + { + "id": "Media", + "description": "Media servers, organizers and editors", + "sub": [ + { + "id": "MED001", + "description": "Plex Media server", + "about": "This operation will install Plex Media server.", + "command": [ + "module_plexmediaserver install" + ], + "status": "Disabled", + "author": "@schwar3kat", + "condition": "! module_plexmediaserver status" + }, + { + "id": "MED002", + "description": "Plex Media server remove", + "about": "This operation will purge Plex Media server.", + "command": [ + "module_plexmediaserver remove" + ], + "status": "Disabled", + "author": "@schwar3kat", + "condition": "module_plexmediaserver status" + }, + { + "id": "MED003", + "description": "Emby organizes video, music, live TV, and photos", + "about": "This operation will install Emby server.", + "command": [ + "module_embyserver install" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! module_embyserver status" + }, + { + "id": "MED004", + "description": "Emby server remove", + "about": "This operation will remove Emby server", + "command": [ + "module_embyserver remove" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "module_embyserver status" + }, + { + "id": "MED005", + "description": "Emby server purge with data folder", + "command": [ + "module_embyserver purge" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "module_embyserver status" + }, + { + "id": "MED010", + "description": "Stirling PDF tools for viewing and editing PDF files", + "about": "This operation will install Stirling-PDF tools.", + "command": [ + "module_stirling install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_stirling status" + }, + { + "id": "MED011", + "description": "Stirling PDF remove", + "about": "This operation will remove Stirling-PDF tools.", + "command": [ + "module_stirling remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_stirling status" + }, + { + "id": "MED012", + "description": "Stirling PDF purge with data folder", + "about": "This operation will purge Stirling-PDF tools with data folder.", + "command": [ + "module_stirling purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_stirling status" + }, + { + "id": "MED015", + "description": "Syncthing continuous file synchronization", + "command": [ + "module_syncthing install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_syncthing status" + }, + { + "id": "MED016", + "description": "Syncthing remove", + "command": [ + "module_syncthing remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_syncthing status" + }, + { + "id": "MED017", + "description": "Syncthing purge with data folder", + "command": [ + "module_syncthing purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_syncthing status" + }, + { + "id": "MED020", + "description": "Nextcloud content collaboration platform", + "command": [ + "module_nextcloud install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_nextcloud status" + }, + { + "id": "MED021", + "description": "Nextcloud remove", + "command": [ + "module_nextcloud remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_nextcloud status" + }, + { + "id": "MED022", + "description": "Nextcloud purge with data folder", + "command": [ + "module_nextcloud purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_nextcloud status" + }, + { + "id": "MED025", + "description": "Owncloud share files and folders, easy and secure", + "command": [ + "module_owncloud install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_owncloud status" + }, + { + "id": "MED026", + "description": "Owncloud remove", + "command": [ + "module_owncloud remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_owncloud status" + }, + { + "id": "MED027", + "description": "Owncloud purge with data folder", + "command": [ + "module_owncloud purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_owncloud status" + } + ] + }, + { + "id": "Monitoring", + "description": "Real-time monitoring, collecting metrics, up-time status", + "sub": [ + { + "id": "MON001", + "description": "Uptime Kuma self-hosted monitoring tool", + "about": "This operation will install Uptime Kuma", + "command": [ + "module_uptimekuma install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_uptimekuma status" + }, + { + "id": "MON002", + "description": "Uptime Kuma remove", + "about": "This operation will remove Uptime Kuma", + "command": [ + "module_uptimekuma remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_uptimekuma status" + }, + { + "id": "MON003", + "description": "Uptime Kuma purge with data folder", + "about": "This operation will remove Uptime Kuma with data folder", + "command": [ + "module_uptimekuma purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_uptimekuma status" + }, + { + "id": "MON005", + "description": "Netdata - monitoring real-time metrics", + "about": "This operation will install Netdata", + "command": [ + "module_netdata install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_netdata status" + }, + { + "id": "MON006", + "description": "Netdata remove", + "about": "This operation will remove Netdata", + "command": [ + "module_netdata remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_netdata status" + }, + { + "id": "MON007", + "description": "Netdata purge with data folder", + "about": "This operation will purge Netdata with data folder", + "command": [ + "module_netdata purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_netdata status" + } + + ] + }, + { + "id": "Management", + "description": "Remote Management tools", + "sub": [ + { + "id": "MAN001", + "description": "Install Cockpit web-based management tool", + "about": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged", + "command": [ + "see_current_apt update", + "pkg_install cockpit cockpit-ws cockpit-system cockpit-storaged " + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! pkg_installed cockpit" + }, + { + "id": "MAN002", + "description": "Purge Cockpit web-based management tool", + "about": "This operation will purge Cockpit.", + "command": [ + "pkg_remove cockpit" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "pkg_installed cockpit" + }, + { + "id": "MAN003", + "description": "Start Cockpit Service", + "command": [ + "sudo systemctl enable --now cockpit.socket | show_infobox " + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "pkg_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" + }, + { + "id": "MAN004", + "description": "Stop Cockpit Service", + "command": [ + "systemctl stop cockpit cockpit.socket", + "systemctl disable cockpit.socket | show_infobox " + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "pkg_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" + }, + { + "id": "MAN005", + "description": "Webmin web-based management tool", + "command": [ + "see_menu module_webmin" + ], + "status": "Stable", + "author": "@Tearran", + "condition": "" + } + ] + }, + { + "id": "Netconfig", + "description": "Console network tools for measuring load and bandwidth", + "sub": [ + { + "id": "NET001", + "description": "nload -realtime console network usage monitor", + "prompt": "This operation will install nload.", + "command": [ + "pkg_install nload" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed nload" + }, + { + "id": "NET002", + "description": "nload - remove", + "prompt": "This operation will remove nload.", + "command": [ + "pkg_remove nload" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed nload" + }, + { + "id": "NET003", + "description": "iperf3 bandwidth measuring tool", + "prompt": "This operation will install iperf3.", + "command": [ + "pkg_install iperf3" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed iperf3" + }, + { + "id": "NET004", + "description": "iperf3 remove", + "prompt": "This operation will remove iperf3.", + "command": [ + "pkg_remove iperf3" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed iperf3" + }, + { + "id": "NET005", + "description": "iptraf-ng IP LAN monitor", + "prompt": "This operation will install iptraf-ng.", + "command": [ + "pkg_install iptraf-ng" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed iptraf-ng" + }, + { + "id": "NET006", + "description": "iptraf-ng remove", + "prompt": "This operation will remove iptraf-ng.", + "command": [ + "pkg_remove iptraf-ng" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed iptraf-ng" + }, + { + "id": "NET007", + "description": "avahi-daemon hostname broadcast via mDNS", + "prompt": "This operation will install avahi-daemon.", + "command": [ + "pkg_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 restart avahi-daemon" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed avahi-daemon" + }, + { + "id": "NET008", + "description": "avahi-daemon remove", + "prompt": "This operation will remove avahi-daemon.", + "command": [ + "systemctl stop avahi-daemon avahi-daemon.socket", + "pkg_remove avahi-daemon" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed avahi-daemon" + } + ] } ] } ] -} \ No newline at end of file +} From a7c30727465053c33606125ff06f666c5c81b69b Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 07:36:02 +0000 Subject: [PATCH 06/20] removed config.help.json --- tools/json/config.help.json | 28 --------------------- tools/modules/functions/config_interface.sh | 12 ++++++--- 2 files changed, 9 insertions(+), 31 deletions(-) delete mode 100644 tools/json/config.help.json diff --git a/tools/json/config.help.json b/tools/json/config.help.json deleted file mode 100644 index 3cdb463c3..000000000 --- a/tools/json/config.help.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "menu": [ - { - "id": "Help", - "description": "About this tool", - "sub": [ - { - "id": "HE001", - "description": "Contribute", - "command": [ - "show_message <<< $(about_armbian_configng)" - ], - "status": "Stable", - "author": "@armbian" - }, - { - "id": "HE002", - "description": "List of Config function(WIP)", - "command": [ - "show_message <<< see_use" - ], - "status": "Disabled", - "author": "@armbian" - } - ] - } - ] -} diff --git a/tools/modules/functions/config_interface.sh b/tools/modules/functions/config_interface.sh index dcc40680f..8bf19a37d 100644 --- a/tools/modules/functions/config_interface.sh +++ b/tools/modules/functions/config_interface.sh @@ -103,8 +103,11 @@ parse_menu_items() { else # If the condition field is empty or null, add the menu item to the menu options+=("$id" " - $description ") + fi + done < <(echo "$json_data" | jq -r '.menu[] | '${parent_id:+".. | objects | select(.id==\"$parent_id\") | .sub[]? |"}' select(.status != "Disabled") | "\(.id)\n\(.description)\n\(.condition)"' || exit 1) + } module_options+=( @@ -128,15 +131,18 @@ generate_top_menu() { local menu_options=() parse_menu_items menu_options - + menu_options+=("Help" " - About this tool") local OPTION=$($DIALOG --backtitle "$backtitle" --title "$TITLE" --menu "$status" 0 80 9 "${menu_options[@]}" \ --ok-button Select --cancel-button Exit 3>&1 1>&2 2>&3) local exitstatus=$? if [ $exitstatus = 0 ]; then [ -z "$OPTION" ] && break - [[ -n "$debug" ]] && echo "$OPTION" - generate_menu "$OPTION" + if [[ "$OPTION" == "Help" ]]; then + show_message <<< "$(about_armbian_configng)" ; + else + generate_menu "$OPTION" + fi fi done } From 9c0c6a7ff78619ee4e79764d2a675572853b356c Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 08:04:57 +0000 Subject: [PATCH 07/20] rename strings --- bin/armbian-config | 23 +++++++++++++---------- tools/modules/docs/generate_json_data.sh | 7 +++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/bin/armbian-config b/bin/armbian-config index 5db69457b..804ec93d5 100755 --- a/bin/armbian-config +++ b/bin/armbian-config @@ -24,10 +24,6 @@ lib_dir="$script_dir/../lib/armbian-config" doc_dir="$script_dir/../share/doc/armbian-config" json_file="$lib_dir/config.jobs.json" -# -# Load The Bash procedure Objects -old_json_data=$(<"$json_file") - # # Prepare the module options array @@ -38,7 +34,7 @@ declare -A module_options source "$lib_dir/config.functions.sh" set_runtime_variables -check_distro_status +#check_distro_status echo "Loaded Runtime variables..." #| show_infobox ; #set_newt_colors 2 echo "Loaded Dialog..." #| show_infobox ; @@ -53,11 +49,13 @@ echo "Loaded Software helpers..." #| show_infobox ; # # Loads the variables from beta armbian-config for runtime handling -source "$lib_dir/config.runtime.sh" -echo "Loaded Runtime conditions..." #| show_infobox ; + +# +# Load The Bash procedure Objects +old_json_data=$(<"$json_file") # Generate the new JSON data -new_json_data=$(generate_json_data) +new_json_data=$(generate_software_json) json_data=$(jq -s ' .[0] as $existing | @@ -66,8 +64,13 @@ json_data=$(jq -s ' menu: ($existing.menu + $new.menu) } ' <(echo "$old_json_data") <(echo "$new_json_data")) -# Output the combined JSON data -#echo "$combined_json" > "$lib_dir/combined.config.jobs.json" + + +#source "$lib_dir/config.runtime.sh" +echo "Loaded Runtime conditions..." #| show_infobox ; + + + diff --git a/tools/modules/docs/generate_json_data.sh b/tools/modules/docs/generate_json_data.sh index 99611f54f..c7031ee9d 100644 --- a/tools/modules/docs/generate_json_data.sh +++ b/tools/modules/docs/generate_json_data.sh @@ -1,5 +1,4 @@ - function set_json_data() { local i=0 @@ -74,7 +73,7 @@ function set_json_data() { } -function generate_json_data() { +function generate_software_json() { set_json_data | jq ' # Define an array of allowed software groups def softwareGroups: ["WebHosting", "Netconfig", "Downloaders", "Database", "DNS", "DevTools", "HomeAutomation", "Benchy", "Containers", "Media", "Monitoring", "Management"]; @@ -114,7 +113,7 @@ function generate_json_data() { interface_json_data() { # Convert the example string to an array local commands=("raw" "mnu" "top" "sub" "help") - json_data=$(generate_json_data) + json_data=$(generate_software_json) case "$1" in "${commands[0]}") @@ -123,7 +122,7 @@ interface_json_data() { ;; "${commands[1]}") echo "Generating JSON data..." - generate_json_data | jq --tab --indent 4 '.' > tools/json/config.temp.json + generate_software_json | jq --tab --indent 4 '.' > tools/json/config.temp.json ;; "${commands[2]}") generate_top_menu "$json_data" From f1a22a1d59da1592970bba83f4cdb6b4dda94b78 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 14:36:10 +0000 Subject: [PATCH 08/20] style --- tools/modules/functions/config_interface.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/modules/functions/config_interface.sh b/tools/modules/functions/config_interface.sh index 8bf19a37d..90f41e63a 100644 --- a/tools/modules/functions/config_interface.sh +++ b/tools/modules/functions/config_interface.sh @@ -133,13 +133,13 @@ generate_top_menu() { parse_menu_items menu_options menu_options+=("Help" " - About this tool") local OPTION=$($DIALOG --backtitle "$backtitle" --title "$TITLE" --menu "$status" 0 80 9 "${menu_options[@]}" \ - --ok-button Select --cancel-button Exit 3>&1 1>&2 2>&3) + --ok-button Select --cancel-button Exit 3>&1 1>&2 2>&3) local exitstatus=$? if [ $exitstatus = 0 ]; then [ -z "$OPTION" ] && break if [[ "$OPTION" == "Help" ]]; then - show_message <<< "$(about_armbian_configng)" ; + show_message <<< "$(about_armbian_configng)" ; else generate_menu "$OPTION" fi From 36a4506625b394b75b3c3fdf6f7a40515430b94a Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 14:50:37 +0000 Subject: [PATCH 09/20] new file: tools/json/config.software.json --- tools/json/config.software.json | 1431 +++++++++++++++++++++++++++++++ 1 file changed, 1431 insertions(+) create mode 100644 tools/json/config.software.json diff --git a/tools/json/config.software.json b/tools/json/config.software.json new file mode 100644 index 000000000..9a856db4b --- /dev/null +++ b/tools/json/config.software.json @@ -0,0 +1,1431 @@ +{ + "menu": [ + { + "id": "Software00", + "description": "Run/Install 3rd party applications", + "sub": [ + { + "id": "WebHosting", + "description": "Web server, LEMP, reverse proxy, Let's Encrypt SSL", + "status": "Stable", + "sub": [ + { + "id": "SWAG01", + "description": "SWAG reverse proxy install", + "command": [ + "module_swag install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_swag status" + }, + { + "id": "SWAG02", + "description": "SWAG reverse proxy .htpasswd set", + "command": [ + "module_swag password" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_swag status" + }, + { + "id": "SWAG03", + "description": "SWAG remove", + "command": [ + "module_swag remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_swag status" + }, + { + "id": "SWAG04", + "description": "SWAG purge with data folder", + "command": [ + "module_swag purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_swag status" + } + ] + }, + { + "id": "HomeAutomation", + "description": "Home Automation for monitoring and/or control home appliances", + "sub": [ + { + "id": "HAB001", + "description": "openHAB empowering the smart home", + "about": "This operation will install openHAB.", + "command": [ + "module_openhab install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_openhab status" + }, + { + "id": "HAB002", + "description": "openHAB remove", + "about": "This operation will purge openHAB.", + "command": [ + "module_openhab remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_openhab status" + }, + { + "id": "HAB003", + "description": "openHAB purge with data folder", + "about": "This operation will purge openHAB.", + "command": [ + "module_openhab purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_openhab status" + }, + { + "id": "HAS001", + "description": "Home Assistant open source home automation", + "about": "This operation will install Home Assistant.", + "command": [ + "module_haos install" + ], + "status": "Preview", + "author": "@igorpecovnik", + "condition": "! module_haos status && grep -q bookworm /etc/os-release" + }, + { + "id": "HAS002", + "description": "Home Assistant remove", + "about": "This operation will remove Home Assistant.", + "command": [ + "module_haos remove" + ], + "status": "Preview", + "author": "@igorpecovnik", + "condition": "module_haos status" + }, + { + "id": "HAS003", + "description": "Home Assistant purge with data folder", + "about": "This operation will purge Home Assistant.", + "command": [ + "module_haos purge" + ], + "status": "Preview", + "author": "@igorpecovnik", + "condition": "module_haos status" + } + ] + }, + { + "id": "DNS", + "description": "Network-wide ad blockers servers", + "sub": [ + { + "id": "DNS001", + "description": "Pi-hole DNS ad blocker install", + "command": [ + "module_pi_hole install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_pi_hole status" + }, + { + "id": "DNS003", + "description": "Pi-hole remove", + "command": [ + "module_pi_hole remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_pi_hole status" + }, + { + "id": "DNS002", + "description": "Pi-hole change web admin password", + "command": [ + "module_pi_hole password" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_pi_hole status" + }, + { + "id": "DNS004", + "description": "Pi-hole purge", + "command": [ + "module_pi_hole remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_pi_hole status" + } + ] + }, + { + "id": "Desktops", + "description": "Desktop Environments", + "status": "Disabled", + "sub": [ + { + "id": "XFCE", + "description": "XFCE desktop", + "status": "Disabled", + "sub": [ + { + "id": "XFCE01", + "about": "Install XFCE:\nXfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly.", + "description": "XFCE desktop Install", + "command": [ + "manage_desktops 'xfce' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/xfce.desktop ]" + }, + { + "id": "XFCE02", + "description": "Uninstall", + "command": [ + "manage_desktops 'xfce' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ]" + }, + { + "id": "XFCE03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'xfce' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "XFCE04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'xfce' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/xfce.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] + }, + { + "id": "Gnome", + "description": "Gnome desktop", + "status": "Disabled", + "sub": [ + { + "id": "GNOME01", + "description": "Gnome desktop Install", + "command": [ + "manage_desktops 'gnome' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "GNOME02", + "description": "Uninstall", + "command": [ + "manage_desktops 'gnome' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "GNOME03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'gnome' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && ! cat /etc/gdm3/custom.conf 2>/dev/null | grep AutomaticLoginEnable | grep true >/dev/null" + }, + { + "id": "GNOME04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'gnome' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && cat /etc/gdm3/custom.conf 2>/dev/null | grep AutomaticLoginEnable | grep true >/dev/null" + } + ] + }, + { + "id": "I3WM", + "description": "i3-wm desktop", + "status": "Disabled", + "sub": [ + { + "id": "I3WM01", + "description": "i3 desktop Install", + "command": [ + "manage_desktops 'i3-wm' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/i3.desktop ]" + }, + { + "id": "I3WM02", + "description": "i3 desktop uninstall", + "command": [ + "manage_desktops 'i3-wm' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/i3.desktop ]" + }, + { + "id": "I3WM03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'i3-wm' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/i3.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "I3WM04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'i3-wm' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/i3.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] + }, + { + "id": "Cinnamon", + "description": "Cinnamon desktop", + "status": "Disabled", + "sub": [ + { + "id": "CINNAMON01", + "description": "Cinnamon desktop Install", + "command": [ + "manage_desktops 'cinnamon' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/cinnamon.desktop ] && [ ! -f /usr/share/xsessions/cinnamon2d.desktop ]" + }, + { + "id": "CINNAMON02", + "description": "Cinnamon desktop uninstall", + "command": [ + "manage_desktops 'cinnamon' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] || [ -f /usr/share/xsessions/cinnamon2d.desktop ]" + }, + { + "id": "CINNAMON03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'cinnamon' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "CINNAMON04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'cinnamon' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/cinnamon.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] + }, + { + "id": "KDEN", + "description": "Kde-neon desktop", + "status": "Disabled", + "sub": [ + { + "id": "KDENEON01", + "description": "Kde-neon desktop Install", + "command": [ + "manage_desktops 'kde-neon' 'install'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ ! -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "KDENEON02", + "description": "Uninstall", + "command": [ + "manage_desktops 'kde-neon' 'uninstall'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ]" + }, + { + "id": "KDENEON03", + "description": "Enable autologin", + "command": [ + "manage_desktops 'kde-neon' 'auto'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && [ ! -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + }, + { + "id": "KDENEON04", + "description": "Disable autologin", + "command": [ + "manage_desktops 'kde-neon' 'manual'" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "[ -f /usr/share/xsessions/gnome.desktop ] && [ -f /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf ]" + } + ] + }, + { + "id": "Xapian", + "description": "Improve application search speed", + "command": [ + "update-apt-xapian-index -u; sleep 3" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "systemctl is-active --quiet service display-manager" + } + ] + }, + { + "id": "Downloaders", + "description": "P2P download managers for movies, TV shows, music and subtitles", + "sub": [ + { + "id": "DOW001", + "description": "qBittorrent BitTorrent server ", + "about": "This operation will install qBittorrent BitTorrent server", + "command": [ + "module_qbittorrent install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_qbittorrent status" + }, + { + "id": "DOW002", + "description": "qBittorrent remove", + "about": "This operation will remove qBittorrent BitTorrent server", + "command": [ + "module_qbittorrent remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_qbittorrent status" + }, + { + "id": "DOW003", + "description": "qBittorrent purge with data folder", + "about": "This operation will remove qBittorrent BitTorrent data folder", + "command": [ + "module_qbittorrent purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_qbittorrent status" + }, + { + "id": "DEL001", + "description": "Deluge BitTorrent server", + "about": "This operation will install BitTorrent server", + "command": [ + "module_deluge install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_deluge status" + }, + { + "id": "DEL002", + "description": "Deluge remove", + "about": "This operation will remove Deluge BitTorrent server", + "command": [ + "module_deluge remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_deluge status" + }, + { + "id": "DEL003", + "description": "Deluge purge with data folder", + "about": "This operation will remove Deluge BitTorrent server data folder", + "command": [ + "module_deluge purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_deluge status" + }, + { + "id": "TRA001", + "description": "Transmission BitTorrent server", + "about": "This operation will install Transmission BitTorrent server", + "command": [ + "module_transmission install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_transmission status" + }, + { + "id": "TRA002", + "description": "Transmission remove", + "about": "This operation will remove Transmission BitTorrent server", + "command": [ + "module_transmission remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_transmission status" + }, + { + "id": "TRA003", + "description": "Transmission purge with data folder", + "about": "This operation will remove Transmission BitTorrent server data folder", + "command": [ + "module_transmission purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_transmission status" + }, + { + "id": "SABN01", + "description": "SABnzbd newsgroup downloader", + "about": "This operation will install SABnzbd newsgroup downloader", + "command": [ + "module_sabnzbd install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_sabnzbd status" + }, + { + "id": "SABN02", + "description": "SABnzbd remove", + "about": "This operation will remove SABnzbd newsgroup downloader", + "command": [ + "module_sabnzbd remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sabnzbd status" + }, + { + "id": "SABN03", + "description": "SABnzbd purge with data folder", + "about": "This operation will purge SABnzbd newsgroup data folder", + "command": [ + "module_sabnzbd purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sabnzbd status" + }, + { + "id": "MDS001", + "description": "Medusa automatic downloader for TV shows", + "about": "This operation will install Medusa TV shows downloader", + "command": [ + "module_medusa install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_medusa status" + }, + { + "id": "MDS002", + "description": "Medusa TV shows downloader remove", + "about": "This operation will remove Medusa TV shows downloader", + "command": [ + "module_medusa remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_medusa status" + }, + { + "id": "MDS003", + "description": "Medusa TV shows downloader purge", + "about": "This operation will purge Medusa TV shows data folder", + "command": [ + "module_medusa purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_medusa status" + }, + { + "id": "SON001", + "description": "Sonarr automatic downloader for TV shows", + "about": "This operation will install Sonarr PVR for Usenet and BitTorrent", + "command": [ + "module_sonarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_sonarr status" + }, + { + "id": "SON002", + "description": "Sonarr remove", + "about": "This operation will remove Sonarr PVR for Usenet and BitTorrent", + "command": [ + "module_sonarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sonarr status" + }, + { + "id": "SON003", + "description": "Sonarr purge with data folder", + "about": "This operation will purge Sonarr PVR for Usenet and BitTorrent purge data folder", + "command": [ + "module_sonarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sonarr status" + }, + { + "id": "RAD001", + "description": "Radarr automatic downloader for movies", + "about": "This operation will install Radarr movie collection manager", + "command": [ + "module_radarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_radarr status" + }, + { + "id": "RAD002", + "description": "Radarr remove", + "about": "This operation will remove Radarr movie collection manager", + "command": [ + "module_radarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_radarr status" + }, + { + "id": "RAD003", + "description": "Radarr purge with data folder", + "about": "This operation will purge Radarr movie collection manager data folder", + "command": [ + "module_radarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_radarr status" + }, + { + "id": "BAZ001", + "description": "Bazarr automatic subtitles downloader for Sonarr and Radarr", + "about": "This operation will install Bazarr subtitles manager for Sonarr and Radarr", + "command": [ + "module_bazarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_bazarr status" + }, + { + "id": "BAZ002", + "description": "Bazarr remove", + "about": "This operation will remove Bazarr subtitles manager for Sonarr and Radarr", + "command": [ + "module_bazarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_bazarr status" + }, + { + "id": "BAZ003", + "description": "Bazarr purge with data folder", + "about": "This operation will purge Bazarr subtitles manager with data folder", + "command": [ + "module_bazarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_bazarr status" + }, + { + "id": "LID001", + "description": "Lidarr automatic music downloader", + "about": "This operation will install Lidarr music collection manager for Usenet and BitTorrent users", + "command": [ + "module_lidarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_lidarr status" + }, + { + "id": "LID002", + "description": "Lidarr remove", + "about": "This operation will remove Lidarr", + "command": [ + "module_lidarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_lidarr status" + }, + { + "id": "LID003", + "description": "Lidarr purge with data folder", + "about": "This operation will purge Lidarr with data folder", + "command": [ + "module_lidarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_lidarr status" + }, + { + "id": "RDR001", + "description": "Readarr automatic downloader for Ebooks", + "about": "This operation will install Readarr", + "command": [ + "module_readarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_readarr status" + }, + { + "id": "RDR002", + "description": "Readarr remove", + "about": "This operation will remove Readarr", + "command": [ + "module_readarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_readarr status" + }, + { + "id": "RDR003", + "description": "Readarr purge with data folder", + "about": "This operation will purge Readarr with data folder", + "command": [ + "module_readarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_readarr status" + }, + { + "id": "DOW025", + "description": "Prowlarr index manager and proxy for PVR", + "about": "This operation will install Prowlarr", + "command": [ + "module_prowlarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_prowlarr status" + }, + { + "id": "DOW026", + "description": "Prowlarr remove", + "about": "This operation will remove Prowlarr", + "command": [ + "module_prowlarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_prowlarr status" + }, + { + "id": "DOW027", + "description": "Prowlarr purge with data folder", + "about": "This operation will purge Prowlarr with data folder", + "command": [ + "module_prowlarr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_prowlarr status" + }, + { + "id": "JEL001", + "description": "Jellyseerr Jellyfin/Emby/Plex integration install", + "about": "This operation will install Jellyseerr", + "command": [ + "module_jellyseerr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_jellyseerr status" + }, + { + "id": "JEL002", + "description": "Jellyseerr remove", + "about": "This operation will remove Jellyseerr", + "command": [ + "module_jellyseerr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_jellyseerr status" + }, + { + "id": "JEL003", + "description": "Jellyseerr purge with data folder", + "about": "This operation will purge Jellyseerr with data folder", + "command": [ + "module_jellyseerr purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_jellyseerr status ]]" + } + ] + }, + { + "id": "Database", + "description": "SQL database servers and web interface managers", + "sub": [ + { + "id": "DAT001", + "description": "Mariadb install", + "command": [ + "module_mariadb install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_mariadb status" + }, + { + "id": "DAT002", + "description": "Mariadb remove", + "command": [ + "module_mariadb remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_mariadb status" + }, + { + "id": "DAT003", + "description": "Mariadb purge", + "command": [ + "module_mariadb purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_mariadb status && [[ -d \"${SOFTWARE_FOLDER}/mariadb\" ]]" + }, + { + "id": "DAT005", + "description": "phpMyAdmin install", + "command": [ + "module_phpmyadmin install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_phpmyadmin status" + }, + { + "id": "DAT006", + "description": "phpMyAdmin remove", + "command": [ + "module_phpmyadmin remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_phpmyadmin status" + }, + { + "id": "DAT007", + "description": "phpMyAdmin purge", + "command": [ + "module_phpmyadmin purge" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_phpmyadmin status && [[ -d \"${SOFTWARE_FOLDER}/phpmyadmin\" ]]" + } + ] + }, + { + "id": "DevTools", + "description": "Applications and tools for development", + "sub": [ + { + "id": "DEV001", + "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", + "pkg_install git" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed git" + }, + { + "id": "DEV002", + "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", + "pkg_remove git" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed git" + } + ] + }, + { + "id": "Benchy", + "description": "System benchmaking and diagnostics", + "command": [ + "see_monitoring" + ], + "status": "Disabled", + "author": "@armbian", + "condition": "[ -f /usr/bin/armbianmonitor ]" + }, + { + "id": "Containers", + "description": "Docker containerization and KVM virtual machines", + "sub": [ + { + "id": "CON001", + "description": "Docker Minimal Install", + "about": "This operation will install Docker Minimal.", + "command": [ + "module_docker install minimal" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! module_docker status docker-ce" + }, + { + "id": "CON002", + "description": "Docker Engine Install", + "about": "This operation will install Docker Engine.", + "command": [ + "module_docker install engine" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! module_docker status docker-compose-plugin" + }, + { + "id": "CON003", + "description": "Docker Remove", + "about": "This operation will purge Docker.", + "command": [ + "module_docker remove" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "module_docker status docker-ce" + }, + { + "id": "CON004", + "description": "Docker Purge all images, containers, and volumes", + "about": "This operation will delete all Docker images, containers, and volumes.", + "command": [ + "module_docker purge" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! module_docker status docker-ce && [ -d /var/lib/docker ]" + }, + { + "id": "CON005", + "description": "Portainer container management platform", + "prompt": "This operation will install Portainer container management platform.", + "command": [ + "module_portainer install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_portainer status" + }, + { + "id": "CON006", + "description": "Portainer remove", + "prompt": "This operation will remove Portainer container management platform.", + "command": [ + "module_portainer remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_portainer status" + }, + { + "id": "CON007", + "description": "Portainer purge with with data folder", + "prompt": "This operation will remove Portainer container management platform.", + "command": [ + "module_portainer remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_portainer status" + } + ] + }, + { + "id": "Media", + "description": "Media servers, organizers and editors", + "sub": [ + { + "id": "MED001", + "description": "Plex Media server", + "about": "This operation will install Plex Media server.", + "command": [ + "module_plexmediaserver install" + ], + "status": "Disabled", + "author": "@schwar3kat", + "condition": "! module_plexmediaserver status" + }, + { + "id": "MED002", + "description": "Plex Media server remove", + "about": "This operation will purge Plex Media server.", + "command": [ + "module_plexmediaserver remove" + ], + "status": "Disabled", + "author": "@schwar3kat", + "condition": "module_plexmediaserver status" + }, + { + "id": "MED003", + "description": "Emby organizes video, music, live TV, and photos", + "about": "This operation will install Emby server.", + "command": [ + "module_embyserver install" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! module_embyserver status" + }, + { + "id": "MED004", + "description": "Emby server remove", + "about": "This operation will remove Emby server", + "command": [ + "module_embyserver remove" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "module_embyserver status" + }, + { + "id": "MED005", + "description": "Emby server purge with data folder", + "command": [ + "module_embyserver purge" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "module_embyserver status" + }, + { + "id": "MED010", + "description": "Stirling PDF tools for viewing and editing PDF files", + "about": "This operation will install Stirling-PDF tools.", + "command": [ + "module_stirling install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_stirling status" + }, + { + "id": "MED011", + "description": "Stirling PDF remove", + "about": "This operation will remove Stirling-PDF tools.", + "command": [ + "module_stirling remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_stirling status" + }, + { + "id": "MED012", + "description": "Stirling PDF purge with data folder", + "about": "This operation will purge Stirling-PDF tools with data folder.", + "command": [ + "module_stirling purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_stirling status" + }, + { + "id": "MED015", + "description": "Syncthing continuous file synchronization", + "command": [ + "module_syncthing install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_syncthing status" + }, + { + "id": "MED016", + "description": "Syncthing remove", + "command": [ + "module_syncthing remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_syncthing status" + }, + { + "id": "MED017", + "description": "Syncthing purge with data folder", + "command": [ + "module_syncthing purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_syncthing status" + }, + { + "id": "MED020", + "description": "Nextcloud content collaboration platform", + "command": [ + "module_nextcloud install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_nextcloud status" + }, + { + "id": "MED021", + "description": "Nextcloud remove", + "command": [ + "module_nextcloud remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_nextcloud status" + }, + { + "id": "MED022", + "description": "Nextcloud purge with data folder", + "command": [ + "module_nextcloud purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_nextcloud status" + }, + { + "id": "MED025", + "description": "Owncloud share files and folders, easy and secure", + "command": [ + "module_owncloud install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_owncloud status" + }, + { + "id": "MED026", + "description": "Owncloud remove", + "command": [ + "module_owncloud remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_owncloud status" + }, + { + "id": "MED027", + "description": "Owncloud purge with data folder", + "command": [ + "module_owncloud purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_owncloud status" + } + ] + }, + { + "id": "Monitoring", + "description": "Real-time monitoring, collecting metrics, up-time status", + "sub": [ + { + "id": "MON001", + "description": "Uptime Kuma self-hosted monitoring tool", + "about": "This operation will install Uptime Kuma", + "command": [ + "module_uptimekuma install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_uptimekuma status" + }, + { + "id": "MON002", + "description": "Uptime Kuma remove", + "about": "This operation will remove Uptime Kuma", + "command": [ + "module_uptimekuma remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_uptimekuma status" + }, + { + "id": "MON003", + "description": "Uptime Kuma purge with data folder", + "about": "This operation will remove Uptime Kuma with data folder", + "command": [ + "module_uptimekuma purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_uptimekuma status" + }, + { + "id": "MON005", + "description": "Netdata - monitoring real-time metrics", + "about": "This operation will install Netdata", + "command": [ + "module_netdata install" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_netdata status" + }, + { + "id": "MON006", + "description": "Netdata remove", + "about": "This operation will remove Netdata", + "command": [ + "module_netdata remove" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_netdata status" + }, + { + "id": "MON007", + "description": "Netdata purge with data folder", + "about": "This operation will purge Netdata with data folder", + "command": [ + "module_netdata purge" + ], + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_netdata status" + } + + ] + }, + { + "id": "Management", + "description": "Remote Management tools", + "sub": [ + { + "id": "MAN001", + "description": "Install Cockpit web-based management tool", + "about": "This operation will install Cockpit.\ncockpit cockpit-ws cockpit-system cockpit-storaged", + "command": [ + "see_current_apt update", + "pkg_install cockpit cockpit-ws cockpit-system cockpit-storaged " + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "! pkg_installed cockpit" + }, + { + "id": "MAN002", + "description": "Purge Cockpit web-based management tool", + "about": "This operation will purge Cockpit.", + "command": [ + "pkg_remove cockpit" + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "pkg_installed cockpit" + }, + { + "id": "MAN003", + "description": "Start Cockpit Service", + "command": [ + "sudo systemctl enable --now cockpit.socket | show_infobox " + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "pkg_installed cockpit && ! systemctl is-enabled cockpit.socket > /dev/null 2>&1" + }, + { + "id": "MAN004", + "description": "Stop Cockpit Service", + "command": [ + "systemctl stop cockpit cockpit.socket", + "systemctl disable cockpit.socket | show_infobox " + ], + "status": "Stable", + "author": "@schwar3kat", + "condition": "pkg_installed cockpit && systemctl is-enabled cockpit.socket > /dev/null 2>&1" + }, + { + "id": "MAN005", + "description": "Webmin web-based management tool", + "command": [ + "see_menu module_webmin" + ], + "status": "Stable", + "author": "@Tearran", + "condition": "" + } + ] + }, + { + "id": "Netconfig", + "description": "Console network tools for measuring load and bandwidth", + "sub": [ + { + "id": "NET001", + "description": "nload -realtime console network usage monitor", + "prompt": "This operation will install nload.", + "command": [ + "pkg_install nload" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed nload" + }, + { + "id": "NET002", + "description": "nload - remove", + "prompt": "This operation will remove nload.", + "command": [ + "pkg_remove nload" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed nload" + }, + { + "id": "NET003", + "description": "iperf3 bandwidth measuring tool", + "prompt": "This operation will install iperf3.", + "command": [ + "pkg_install iperf3" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed iperf3" + }, + { + "id": "NET004", + "description": "iperf3 remove", + "prompt": "This operation will remove iperf3.", + "command": [ + "pkg_remove iperf3" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed iperf3" + }, + { + "id": "NET005", + "description": "iptraf-ng IP LAN monitor", + "prompt": "This operation will install iptraf-ng.", + "command": [ + "pkg_install iptraf-ng" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed iptraf-ng" + }, + { + "id": "NET006", + "description": "iptraf-ng remove", + "prompt": "This operation will remove iptraf-ng.", + "command": [ + "pkg_remove iptraf-ng" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed iptraf-ng" + }, + { + "id": "NET007", + "description": "avahi-daemon hostname broadcast via mDNS", + "prompt": "This operation will install avahi-daemon.", + "command": [ + "pkg_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 restart avahi-daemon" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! pkg_installed avahi-daemon" + }, + { + "id": "NET008", + "description": "avahi-daemon remove", + "prompt": "This operation will remove avahi-daemon.", + "command": [ + "systemctl stop avahi-daemon avahi-daemon.socket", + "pkg_remove avahi-daemon" + ], + "status": "Stable", + "author": "@armbian", + "condition": "pkg_installed avahi-daemon" + } + ] + } + ] + } + ] +} From c70b06e7b5ae86cd4ee186bb4803af690ae650f8 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 18:53:06 +0000 Subject: [PATCH 10/20] test --- .github/workflows/json-unit-testing.yml | 93 +++++++++++++++++++++++++ tests/CON002.conf | 2 +- tests/CON005.conf | 2 +- tests/HAB001.conf | 2 +- tests/MAN001.conf | 2 +- tests/MON001.conf | 2 +- tests/SY008.conf | 2 +- tests/SY101.conf | 2 +- tests/SY102.conf | 2 +- tests/SY202.conf | 2 +- tests/SY203.conf | 2 +- tests/SY206.conf | 2 +- tests/SY207.conf | 2 +- 13 files changed, 105 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/json-unit-testing.yml diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml new file mode 100644 index 000000000..68cce63cd --- /dev/null +++ b/.github/workflows/json-unit-testing.yml @@ -0,0 +1,93 @@ +name: "JSON Unit Tests" +on: + workflow_dispatch: + repository_dispatch: + types: ["JSON Unit Tests"] + schedule: + - cron: '0 3 * * *' + pull_request: + types: [opened, reopened, edited, synchronize, review_requested] + +env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.number }} + +concurrency: + group: pipeline-pr-json-${{github.event.pull_request.number}} + cancel-in-progress: true + +jobs: + test: + name: "JSON Unit Tests" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: 'config' + + - name: Load JSON + id: load-json + run: | + echo "Loading JSON data..." + DATA=$(cat ./tools/json/config.temp.json) + echo "DATA=$DATA" >> $GITHUB_ENV + + - name: Run Tests + run: | + echo "Running tests..." + for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do + _jq() { + echo ${row} | base64 --decode | jq -r ${1} + } + ID=$(_jq '.id') + COMMAND=$(_jq '.command') + OPTIONS=$(_jq '.options') + STATUS=$(_jq '.status') + ARCH=$(_jq '.arch') + + echo "Running test for $ID: $COMMAND with options $OPTIONS on status $STATUS for arch $ARCH" + # Add the logic to run the actual command here + done + + gradle: + needs: test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: 'config' + + - name: Install + run: | + # Add installation and testing steps here + + stop: + name: "Merge test artifacts" + if: always() + needs: gradle + runs-on: ubuntu-latest + steps: + - name: "Download changes" + uses: actions/download-artifact@v3-node20 + with: + name: TESTDATA + + - name: Generate Summary + run: | + echo "# Successful tests:" >> $GITHUB_STEP_SUMMARY + echo "|ID|Command|Options|Status|Arch|" >> $GITHUB_STEP_SUMMARY + echo "|:---|:---|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY + for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do + _jq() { + echo ${row} | base64 --decode | jq -r ${1} + } + ID=$(_jq '.id') + COMMAND=$(_jq '.command') + OPTIONS=$(_jq '.options') + STATUS=$(_jq '.status') + ARCH=$(_jq '.arch') + + echo "|$ID|$COMMAND|$OPTIONS|$STATUS|$ARCH|" >> $GITHUB_STEP_SUMMARY + done \ No newline at end of file diff --git a/tests/CON002.conf b/tests/CON002.conf index 57f7cf42e..ad3b1e7cd 100644 --- a/tests/CON002.conf +++ b/tests/CON002.conf @@ -1,3 +1,3 @@ -ENABLED=true +ENABLED=false RELEASE="bookworm:jammy:noble" CONDITION="docker run hello-world" diff --git a/tests/CON005.conf b/tests/CON005.conf index 0493851cb..b017aed30 100644 --- a/tests/CON005.conf +++ b/tests/CON005.conf @@ -1,3 +1,3 @@ -ENABLED=true +ENABLED=false RELEASE="bookworm:jammy:noble" CONDITION="test=\$(docker container ls -a | grep portainer )" diff --git a/tests/HAB001.conf b/tests/HAB001.conf index af065d462..58e61ef31 100644 --- a/tests/HAB001.conf +++ b/tests/HAB001.conf @@ -1,2 +1,2 @@ -ENABLED=true +ENABLED=false CONDITION="[ -f /lib/systemd/system/openhab.service ]" diff --git a/tests/MAN001.conf b/tests/MAN001.conf index 7fb6f613e..c0e79f80f 100644 --- a/tests/MAN001.conf +++ b/tests/MAN001.conf @@ -1,2 +1,2 @@ -ENABLED=true +ENABLED=false CONDITION="[ -f /usr/bin/cockpit-bridge ]" diff --git a/tests/MON001.conf b/tests/MON001.conf index d8a5c0e39..5c4700adc 100644 --- a/tests/MON001.conf +++ b/tests/MON001.conf @@ -1,3 +1,3 @@ -ENABLED=true +ENABLED=false RELEASE="bookworm:jammy:noble" CONDITION="test=\$(docker container ls -a | grep uptime-kuma )" diff --git a/tests/SY008.conf b/tests/SY008.conf index 50d6d2118..c29bc036e 100644 --- a/tests/SY008.conf +++ b/tests/SY008.conf @@ -1,3 +1,3 @@ -ENABLED=true +ENABLED=false PREINSTALL="bash bin/armbian-config --cmd SY009" CONDITION="[ ! -f /usr/bin/zsh ]" diff --git a/tests/SY101.conf b/tests/SY101.conf index 6c6ecbea0..a5d252f7a 100644 --- a/tests/SY101.conf +++ b/tests/SY101.conf @@ -1,2 +1,2 @@ -ENABLED=true +ENABLED=false RELEASE="jammy:bullseye" diff --git a/tests/SY102.conf b/tests/SY102.conf index f1b50ac98..2c70f403b 100644 --- a/tests/SY102.conf +++ b/tests/SY102.conf @@ -1,2 +1,2 @@ -ENABLED=true +ENABLED=false RELEASE="bullseye:bookworm:trixie:jammy:noble" diff --git a/tests/SY202.conf b/tests/SY202.conf index 8bd7d091c..421296f1b 100644 --- a/tests/SY202.conf +++ b/tests/SY202.conf @@ -1 +1 @@ -ENABLED=true +ENABLED=false diff --git a/tests/SY203.conf b/tests/SY203.conf index 8bd7d091c..421296f1b 100644 --- a/tests/SY203.conf +++ b/tests/SY203.conf @@ -1 +1 @@ -ENABLED=true +ENABLED=false diff --git a/tests/SY206.conf b/tests/SY206.conf index 8bd7d091c..421296f1b 100644 --- a/tests/SY206.conf +++ b/tests/SY206.conf @@ -1 +1 @@ -ENABLED=true +ENABLED=false diff --git a/tests/SY207.conf b/tests/SY207.conf index 8bd7d091c..421296f1b 100644 --- a/tests/SY207.conf +++ b/tests/SY207.conf @@ -1 +1 @@ -ENABLED=true +ENABLED=false From c9ef40fdcc3ff75dd96f8333dcb332de1d6a1b2b Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:26:36 +0000 Subject: [PATCH 11/20] worflow test --- .github/workflows/unit-tests.yml | 186 ++++++++++--------------------- 1 file changed, 58 insertions(+), 128 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ca6dbea45..90cfeeab8 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,10 +1,10 @@ -name: "Unit tests" +name: "JSON Unit Tests" on: workflow_dispatch: repository_dispatch: - types: ["Unit tests"] + types: ["JSON Unit Tests"] schedule: - - cron: '0 2 * * *' + - cron: '0 3 * * *' pull_request: types: [opened, reopened, edited, synchronize, review_requested] @@ -13,158 +13,88 @@ env: PR_NUMBER: ${{ github.event.number }} concurrency: - group: pipeline-pr-${{github.event.pull_request.number}} + group: pipeline-pr-json-${{github.event.pull_request.number}} cancel-in-progress: true jobs: - test: - name: "Unit tests" + name: "JSON Unit Tests" runs-on: ubuntu-latest - outputs: - matrix: ${{steps.json.outputs.JSON_CONTENT}} steps: - - name: Checkout uses: actions/checkout@v4 with: path: 'config' - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v45 + - name: Checkout JSON config + uses: actions/checkout@v4 with: - path: config - files: | - tests/*.conf + path: './tools/json' - - name: "Make JSON ${{ steps.changed-files.outputs.all_changed_files }}" - id: json + - name: Load JSON + id: load-json run: | - - echo 'JSON_CONTENT<> $GITHUB_OUTPUT - # define docker images where we will run test install - dockerimages=("debian:bookworm" "ubuntu:jammy" "ubuntu:noble") - - # go to repo folder - cd config - - # read tests cases - if [[ -n "${{ steps.changed-files.outputs.all_changed_files }}" ]]; then - tests=($(grep -rwl ${{ steps.changed-files.outputs.all_changed_files }} -e "ENABLED=true" | cut -d":" -f1)) - else - tests=($(grep -rwl tests/*.conf -e "ENABLED=true" | cut -d":" -f1)) + echo "Loading JSON data..." + if [ ! -f ./tools/json/config.temp.json ]; then + echo "Error: JSON file not found at ./tools/json/config.temp.json" + exit 1 fi + DATA=$(cat ./tools/json/config.temp.json) + echo "DATA=$DATA" >> $GITHUB_ENV - # loop enabled test cases - for i in "${tests[@]}"; do - unset RELEASE - source "${i}" - if [[ -z "${RELEASE}" ]]; then RELEASE=all; fi - # if we speficy releases, we need to loop docker images and use if there is a match - if [[ $RELEASE != all || -z $RELEASE ]]; then - for j in ${dockerimages[@]}; do - elements=($(echo $RELEASE | tr ':' "\n")) - for SELECTED_RELEASE in "${elements[@]}"; do - if [[ $j == *"${SELECTED_RELEASE}"* ]]; then - echo "{\"package\":\"${i}\",\"image\":\"$j\"}" - fi - done - done - else - for j in ${dockerimages[@]}; do - echo "{\"package\":\"${i}\",\"image\":\"$j\"}" - done - fi - - done | jq -s >> $GITHUB_OUTPUT - echo 'EOF' >> $GITHUB_OUTPUT + - name: Run Tests + run: | + echo "Running tests..." + for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do + _jq() { + echo ${row} | base64 --decode | jq -r ${1} + } + ID=$(_jq '.id') + COMMAND=$(_jq '.command') + OPTIONS=$(_jq '.options') + STATUS=$(_jq '.status') + ARCH=$(_jq '.arch') + + echo "Running test for $ID: $COMMAND with options $OPTIONS on status $STATUS for arch $ARCH" + # Add the logic to run the actual command here + # Example: touch a dummy file for the artifact + echo "Test result for $ID" > "./config/${ID}.result" + done + + - name: Upload test artifacts + uses: actions/upload-artifact@v3 + with: + name: TESTDATA + path: './config/*.result' gradle: needs: test - strategy: - fail-fast: false - max-parallel: 32 - matrix: - image: ${{ fromJSON(needs.test.outputs.matrix) }} - - name: "I" runs-on: ubuntu-latest - timeout-minutes: 7 - container: - image: "${{ matrix.image.image }}" steps: - - name: Checkout uses: actions/checkout@v4 with: path: 'config' - - name: Install - run: | - - # source vars - . "config/${{ matrix.image.package }}" - echo ${TEST_TITLE} - - RELEASE=$(echo "${{ matrix.image.image }}" | cut -d":" -f2) - TEST_ID=$(echo "${{ matrix.image.package }}" | cut -d "/" -f2 | cut -d "." -f1) - # update index - apt update - # install basics - DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata keyboard-configuration wget gpg netcat-traditional lsof - - # add armbian repository - URL=beta.armbian.com - wget https://${URL}/armbian.key -O key - gpg --dearmor < key | tee /usr/share/keyrings/armbian.gpg > /dev/null - chmod go+r /usr/share/keyrings/armbian.gpg - echo "deb [signed-by=/usr/share/keyrings/armbian.gpg] http://${URL} $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" | tee /etc/apt/sources.list.d/armbian.list - apt update -y - apt upgrade -y - apt -y -o Dpkg::Options::="--force-confold" install sudo procps systemd whiptail jq lsb-release iproute2 armbian-bsp-cli-wsl2-x86-current-grub - sudo -b unshare --pid --fork --mount-proc /lib/systemd/systemd --system-unit=basic.target - cat /etc/armbian-distribution-status - - # install packages / except howdy as its too large - export DEBIAN_FRONTEND=noninteractive - cd config - bash tools/config-assemble.sh -p - #eval $"( "${PREINSTALL}" )" - eval "$PREINSTALL" - sudo bash bin/armbian-config --cmd "$TEST_ID" - #eval $"( "${CONDITION}" )" - eval "$CONDITION" - - # stats - FILENAME="data-"$(echo ${{ matrix.image.image }} | sed "s/:/-/g")"-${TEST_ID}.teststats" - RAWCOMMAND=$(bash bin/armbian-config --cmd | grep "${TEST_ID}" | xargs) - COMMAND=$(echo $RAWCOMMAND | cut -d" " -f1,2) - DESCRIPTION=$(echo $RAWCOMMAND | cut -d" " -f4-) - echo "|${RELEASE}|\`armbian-config ${COMMAND}\`| ${DESCRIPTION} |" > ../${FILENAME} - - - name: Upload test - uses: actions/upload-artifact@v3.2.1-node20 + - name: Download test artifacts + uses: actions/download-artifact@v3 with: name: TESTDATA - path: data-*.teststats - stop: - name: "Merge test artifacts" - if: always() - needs: gradle - runs-on: ubuntu-latest - steps: - - - name: "Download changes" - uses: actions/download-artifact@v3-node20 - with: - name: TESTDATA - - - name: Install + - name: Generate Summary run: | - - echo "# Succesful tests:" >> $GITHUB_STEP_SUMMARY - echo "|Release|Command|Description|" >> $GITHUB_STEP_SUMMARY - echo "|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY - cat ./*.teststats | sed '$ s/.$//' >> $GITHUB_STEP_SUMMARY + echo "# Successful tests:" >> $GITHUB_STEP_SUMMARY + echo "|ID|Command|Options|Status|Arch|" >> $GITHUB_STEP_SUMMARY + echo "|:---|:---|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY + for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do + _jq() { + echo ${row} | base64 --decode | jq -r ${1} + } + ID=$(_jq '.id') + COMMAND=$(_jq '.command') + OPTIONS=$(_jq '.options') + STATUS=$(_jq '.status') + ARCH=$(_jq '.arch') + + echo "|$ID|$COMMAND|$OPTIONS|$STATUS|$ARCH|" >> $GITHUB_STEP_SUMMARY + done \ No newline at end of file From c3d742b5b14dd5a734a0623cf2d6432b20094b52 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:29:16 +0000 Subject: [PATCH 12/20] test2 workflow --- .github/workflows/unit-tests.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 90cfeeab8..0a003fade 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -26,20 +26,14 @@ jobs: with: path: 'config' - - name: Checkout JSON config - uses: actions/checkout@v4 - with: - path: './tools/json' - - name: Load JSON - id: load-json run: | echo "Loading JSON data..." - if [ ! -f ./tools/json/config.temp.json ]; then - echo "Error: JSON file not found at ./tools/json/config.temp.json" + if [ ! -f config/tools/json/config.temp.json ]; then + echo "Error: JSON file not found at config/tools/json/config.temp.json" exit 1 fi - DATA=$(cat ./tools/json/config.temp.json) + DATA=$(cat config/tools/json/config.temp.json) echo "DATA=$DATA" >> $GITHUB_ENV - name: Run Tests @@ -66,6 +60,7 @@ jobs: with: name: TESTDATA path: './config/*.result' + if-no-files-found: error gradle: needs: test From 91e5bbdd7088dd8902eec462907586c95204ee2a Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:36:13 +0000 Subject: [PATCH 13/20] test3 --- .github/workflows/json-unit-testing.yml | 37 ++--- .github/workflows/unit-tests.yml | 185 +++++++++++++++++------- 2 files changed, 149 insertions(+), 73 deletions(-) diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml index 68cce63cd..7503e82e8 100644 --- a/.github/workflows/json-unit-testing.yml +++ b/.github/workflows/json-unit-testing.yml @@ -23,19 +23,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - path: 'config' - name: Load JSON id: load-json run: | echo "Loading JSON data..." - DATA=$(cat ./tools/json/config.temp.json) - echo "DATA=$DATA" >> $GITHUB_ENV + if [ ! -f tools/json/config.temp.json ]; then + echo "Error: JSON file not found at tools/json/config.temp.json" + exit 1 + fi + DATA=$(cat tools/json/config.temp.json) + echo "$DATA" > $GITHUB_WORKSPACE/loaded_data.json - name: Run Tests run: | echo "Running tests..." + DATA=$(cat $GITHUB_WORKSPACE/loaded_data.json) for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do _jq() { echo ${row} | base64 --decode | jq -r ${1} @@ -48,29 +51,26 @@ jobs: echo "Running test for $ID: $COMMAND with options $OPTIONS on status $STATUS for arch $ARCH" # Add the logic to run the actual command here + # Example: touch a dummy file for the artifact + echo "Test result for $ID" > "./config/${ID}.result" done + - name: Upload test artifacts + uses: actions/upload-artifact@v3 + with: + name: TESTDATA + path: './config/*.result' + if-no-files-found: error + gradle: needs: test runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - with: - path: 'config' - - name: Install - run: | - # Add installation and testing steps here - - stop: - name: "Merge test artifacts" - if: always() - needs: gradle - runs-on: ubuntu-latest - steps: - - name: "Download changes" - uses: actions/download-artifact@v3-node20 + - name: Download test artifacts + uses: actions/download-artifact@v3 with: name: TESTDATA @@ -79,6 +79,7 @@ jobs: echo "# Successful tests:" >> $GITHUB_STEP_SUMMARY echo "|ID|Command|Options|Status|Arch|" >> $GITHUB_STEP_SUMMARY echo "|:---|:---|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY + DATA=$(cat $GITHUB_WORKSPACE/loaded_data.json) for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do _jq() { echo ${row} | base64 --decode | jq -r ${1} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 0a003fade..ca6dbea45 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,10 +1,10 @@ -name: "JSON Unit Tests" +name: "Unit tests" on: workflow_dispatch: repository_dispatch: - types: ["JSON Unit Tests"] + types: ["Unit tests"] schedule: - - cron: '0 3 * * *' + - cron: '0 2 * * *' pull_request: types: [opened, reopened, edited, synchronize, review_requested] @@ -13,83 +13,158 @@ env: PR_NUMBER: ${{ github.event.number }} concurrency: - group: pipeline-pr-json-${{github.event.pull_request.number}} + group: pipeline-pr-${{github.event.pull_request.number}} cancel-in-progress: true jobs: + test: - name: "JSON Unit Tests" + name: "Unit tests" runs-on: ubuntu-latest + outputs: + matrix: ${{steps.json.outputs.JSON_CONTENT}} steps: + - name: Checkout uses: actions/checkout@v4 with: path: 'config' - - name: Load JSON + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v45 + with: + path: config + files: | + tests/*.conf + + - name: "Make JSON ${{ steps.changed-files.outputs.all_changed_files }}" + id: json run: | - echo "Loading JSON data..." - if [ ! -f config/tools/json/config.temp.json ]; then - echo "Error: JSON file not found at config/tools/json/config.temp.json" - exit 1 + + echo 'JSON_CONTENT<> $GITHUB_OUTPUT + # define docker images where we will run test install + dockerimages=("debian:bookworm" "ubuntu:jammy" "ubuntu:noble") + + # go to repo folder + cd config + + # read tests cases + if [[ -n "${{ steps.changed-files.outputs.all_changed_files }}" ]]; then + tests=($(grep -rwl ${{ steps.changed-files.outputs.all_changed_files }} -e "ENABLED=true" | cut -d":" -f1)) + else + tests=($(grep -rwl tests/*.conf -e "ENABLED=true" | cut -d":" -f1)) fi - DATA=$(cat config/tools/json/config.temp.json) - echo "DATA=$DATA" >> $GITHUB_ENV - - name: Run Tests - run: | - echo "Running tests..." - for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do - _jq() { - echo ${row} | base64 --decode | jq -r ${1} - } - ID=$(_jq '.id') - COMMAND=$(_jq '.command') - OPTIONS=$(_jq '.options') - STATUS=$(_jq '.status') - ARCH=$(_jq '.arch') - - echo "Running test for $ID: $COMMAND with options $OPTIONS on status $STATUS for arch $ARCH" - # Add the logic to run the actual command here - # Example: touch a dummy file for the artifact - echo "Test result for $ID" > "./config/${ID}.result" - done - - - name: Upload test artifacts - uses: actions/upload-artifact@v3 - with: - name: TESTDATA - path: './config/*.result' - if-no-files-found: error + # loop enabled test cases + for i in "${tests[@]}"; do + unset RELEASE + source "${i}" + if [[ -z "${RELEASE}" ]]; then RELEASE=all; fi + # if we speficy releases, we need to loop docker images and use if there is a match + if [[ $RELEASE != all || -z $RELEASE ]]; then + for j in ${dockerimages[@]}; do + elements=($(echo $RELEASE | tr ':' "\n")) + for SELECTED_RELEASE in "${elements[@]}"; do + if [[ $j == *"${SELECTED_RELEASE}"* ]]; then + echo "{\"package\":\"${i}\",\"image\":\"$j\"}" + fi + done + done + else + for j in ${dockerimages[@]}; do + echo "{\"package\":\"${i}\",\"image\":\"$j\"}" + done + fi + + done | jq -s >> $GITHUB_OUTPUT + echo 'EOF' >> $GITHUB_OUTPUT gradle: needs: test + strategy: + fail-fast: false + max-parallel: 32 + matrix: + image: ${{ fromJSON(needs.test.outputs.matrix) }} + + name: "I" runs-on: ubuntu-latest + timeout-minutes: 7 + container: + image: "${{ matrix.image.image }}" steps: + - name: Checkout uses: actions/checkout@v4 with: path: 'config' - - name: Download test artifacts - uses: actions/download-artifact@v3 + - name: Install + run: | + + # source vars + . "config/${{ matrix.image.package }}" + echo ${TEST_TITLE} + + RELEASE=$(echo "${{ matrix.image.image }}" | cut -d":" -f2) + TEST_ID=$(echo "${{ matrix.image.package }}" | cut -d "/" -f2 | cut -d "." -f1) + # update index + apt update + # install basics + DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata keyboard-configuration wget gpg netcat-traditional lsof + + # add armbian repository + URL=beta.armbian.com + wget https://${URL}/armbian.key -O key + gpg --dearmor < key | tee /usr/share/keyrings/armbian.gpg > /dev/null + chmod go+r /usr/share/keyrings/armbian.gpg + echo "deb [signed-by=/usr/share/keyrings/armbian.gpg] http://${URL} $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" | tee /etc/apt/sources.list.d/armbian.list + apt update -y + apt upgrade -y + apt -y -o Dpkg::Options::="--force-confold" install sudo procps systemd whiptail jq lsb-release iproute2 armbian-bsp-cli-wsl2-x86-current-grub + sudo -b unshare --pid --fork --mount-proc /lib/systemd/systemd --system-unit=basic.target + cat /etc/armbian-distribution-status + + # install packages / except howdy as its too large + export DEBIAN_FRONTEND=noninteractive + cd config + bash tools/config-assemble.sh -p + #eval $"( "${PREINSTALL}" )" + eval "$PREINSTALL" + sudo bash bin/armbian-config --cmd "$TEST_ID" + #eval $"( "${CONDITION}" )" + eval "$CONDITION" + + # stats + FILENAME="data-"$(echo ${{ matrix.image.image }} | sed "s/:/-/g")"-${TEST_ID}.teststats" + RAWCOMMAND=$(bash bin/armbian-config --cmd | grep "${TEST_ID}" | xargs) + COMMAND=$(echo $RAWCOMMAND | cut -d" " -f1,2) + DESCRIPTION=$(echo $RAWCOMMAND | cut -d" " -f4-) + echo "|${RELEASE}|\`armbian-config ${COMMAND}\`| ${DESCRIPTION} |" > ../${FILENAME} + + - name: Upload test + uses: actions/upload-artifact@v3.2.1-node20 with: name: TESTDATA + path: data-*.teststats - - name: Generate Summary + stop: + name: "Merge test artifacts" + if: always() + needs: gradle + runs-on: ubuntu-latest + steps: + + - name: "Download changes" + uses: actions/download-artifact@v3-node20 + with: + name: TESTDATA + + - name: Install run: | - echo "# Successful tests:" >> $GITHUB_STEP_SUMMARY - echo "|ID|Command|Options|Status|Arch|" >> $GITHUB_STEP_SUMMARY - echo "|:---|:---|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY - for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do - _jq() { - echo ${row} | base64 --decode | jq -r ${1} - } - ID=$(_jq '.id') - COMMAND=$(_jq '.command') - OPTIONS=$(_jq '.options') - STATUS=$(_jq '.status') - ARCH=$(_jq '.arch') - - echo "|$ID|$COMMAND|$OPTIONS|$STATUS|$ARCH|" >> $GITHUB_STEP_SUMMARY - done \ No newline at end of file + + echo "# Succesful tests:" >> $GITHUB_STEP_SUMMARY + echo "|Release|Command|Description|" >> $GITHUB_STEP_SUMMARY + echo "|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY + cat ./*.teststats | sed '$ s/.$//' >> $GITHUB_STEP_SUMMARY From 0f6e8170f20a698d4fed628d5d4cc2ba55d658e4 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:37:57 +0000 Subject: [PATCH 14/20] test4 --- .github/workflows/json-unit-testing.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml index 7503e82e8..0a003fade 100644 --- a/.github/workflows/json-unit-testing.yml +++ b/.github/workflows/json-unit-testing.yml @@ -23,22 +23,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + path: 'config' - name: Load JSON - id: load-json run: | echo "Loading JSON data..." - if [ ! -f tools/json/config.temp.json ]; then - echo "Error: JSON file not found at tools/json/config.temp.json" + if [ ! -f config/tools/json/config.temp.json ]; then + echo "Error: JSON file not found at config/tools/json/config.temp.json" exit 1 fi - DATA=$(cat tools/json/config.temp.json) - echo "$DATA" > $GITHUB_WORKSPACE/loaded_data.json + DATA=$(cat config/tools/json/config.temp.json) + echo "DATA=$DATA" >> $GITHUB_ENV - name: Run Tests run: | echo "Running tests..." - DATA=$(cat $GITHUB_WORKSPACE/loaded_data.json) for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do _jq() { echo ${row} | base64 --decode | jq -r ${1} @@ -68,6 +68,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + path: 'config' - name: Download test artifacts uses: actions/download-artifact@v3 @@ -79,7 +81,6 @@ jobs: echo "# Successful tests:" >> $GITHUB_STEP_SUMMARY echo "|ID|Command|Options|Status|Arch|" >> $GITHUB_STEP_SUMMARY echo "|:---|:---|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY - DATA=$(cat $GITHUB_WORKSPACE/loaded_data.json) for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do _jq() { echo ${row} | base64 --decode | jq -r ${1} From 74fa73ce8301ebeadbf2e00d627c68cfe54347b2 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:39:48 +0000 Subject: [PATCH 15/20] fix --- .github/workflows/json-unit-testing.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml index 0a003fade..7503e82e8 100644 --- a/.github/workflows/json-unit-testing.yml +++ b/.github/workflows/json-unit-testing.yml @@ -23,22 +23,22 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - path: 'config' - name: Load JSON + id: load-json run: | echo "Loading JSON data..." - if [ ! -f config/tools/json/config.temp.json ]; then - echo "Error: JSON file not found at config/tools/json/config.temp.json" + if [ ! -f tools/json/config.temp.json ]; then + echo "Error: JSON file not found at tools/json/config.temp.json" exit 1 fi - DATA=$(cat config/tools/json/config.temp.json) - echo "DATA=$DATA" >> $GITHUB_ENV + DATA=$(cat tools/json/config.temp.json) + echo "$DATA" > $GITHUB_WORKSPACE/loaded_data.json - name: Run Tests run: | echo "Running tests..." + DATA=$(cat $GITHUB_WORKSPACE/loaded_data.json) for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do _jq() { echo ${row} | base64 --decode | jq -r ${1} @@ -68,8 +68,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - path: 'config' - name: Download test artifacts uses: actions/download-artifact@v3 @@ -81,6 +79,7 @@ jobs: echo "# Successful tests:" >> $GITHUB_STEP_SUMMARY echo "|ID|Command|Options|Status|Arch|" >> $GITHUB_STEP_SUMMARY echo "|:---|:---|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY + DATA=$(cat $GITHUB_WORKSPACE/loaded_data.json) for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do _jq() { echo ${row} | base64 --decode | jq -r ${1} From 9b42bd8be497021182f7a0cabeedbb81f577c607 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:43:48 +0000 Subject: [PATCH 16/20] test5 --- .github/workflows/json-unit-testing.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml index 7503e82e8..607f3bcc8 100644 --- a/.github/workflows/json-unit-testing.yml +++ b/.github/workflows/json-unit-testing.yml @@ -24,16 +24,29 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Load JSON + - name: Verify JSON File + id: verify-json + run: | + echo "Verifying JSON file location..." + JSON_FILE_PATH="tools/json/config.temp.json" + if [ ! -f $JSON_FILE_PATH ]; then + echo "Error: JSON file not found at $JSON_FILE_PATH" + exit 1 + fi + + - name: Load and Parse JSON id: load-json run: | echo "Loading JSON data..." - if [ ! -f tools/json/config.temp.json ]; then - echo "Error: JSON file not found at tools/json/config.temp.json" + JSON_FILE_PATH="tools/json/config.temp.json" + DATA=$(cat $JSON_FILE_PATH) + echo "DATA=$DATA" >> $GITHUB_ENV + echo "$DATA" > $GITHUB_WORKSPACE/loaded_data.json + PARSED_DATA=$(jq '.' $GITHUB_WORKSPACE/loaded_data.json) + if [ $? -ne 0 ]; then + echo "Error: Failed to parse JSON data" exit 1 fi - DATA=$(cat tools/json/config.temp.json) - echo "$DATA" > $GITHUB_WORKSPACE/loaded_data.json - name: Run Tests run: | From 9c09354b9e1d5dc30a61e4ea7bd71723cb966b3c Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:46:12 +0000 Subject: [PATCH 17/20] test6 --- .github/workflows/json-unit-testing.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml index 607f3bcc8..ed1950d70 100644 --- a/.github/workflows/json-unit-testing.yml +++ b/.github/workflows/json-unit-testing.yml @@ -40,9 +40,8 @@ jobs: echo "Loading JSON data..." JSON_FILE_PATH="tools/json/config.temp.json" DATA=$(cat $JSON_FILE_PATH) - echo "DATA=$DATA" >> $GITHUB_ENV echo "$DATA" > $GITHUB_WORKSPACE/loaded_data.json - PARSED_DATA=$(jq '.' $GITHUB_WORKSPACE/loaded_data.json) + jq '.' $GITHUB_WORKSPACE/loaded_data.json > /dev/null if [ $? -ne 0 ]; then echo "Error: Failed to parse JSON data" exit 1 From 096142a491ad64e355da6226d40d54105c8315c2 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:48:12 +0000 Subject: [PATCH 18/20] test7 --- .github/workflows/json-unit-testing.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml index ed1950d70..db5d80729 100644 --- a/.github/workflows/json-unit-testing.yml +++ b/.github/workflows/json-unit-testing.yml @@ -34,6 +34,17 @@ jobs: exit 1 fi + - name: Validate JSON + id: validate-json + run: | + echo "Validating JSON format..." + JSON_FILE_PATH="tools/json/config.temp.json" + jq '.' $JSON_FILE_PATH > /dev/null + if [ $? -ne 0 ]; then + echo "Error: Invalid JSON format in $JSON_FILE_PATH" + exit 1 + fi + - name: Load and Parse JSON id: load-json run: | @@ -41,11 +52,6 @@ jobs: JSON_FILE_PATH="tools/json/config.temp.json" DATA=$(cat $JSON_FILE_PATH) echo "$DATA" > $GITHUB_WORKSPACE/loaded_data.json - jq '.' $GITHUB_WORKSPACE/loaded_data.json > /dev/null - if [ $? -ne 0 ]; then - echo "Error: Failed to parse JSON data" - exit 1 - fi - name: Run Tests run: | From ed741979f80f2b75360bf379861ec9dcc913f26e Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:50:59 +0000 Subject: [PATCH 19/20] test8 --- .github/workflows/json-unit-testing.yml | 112 +++++------------------- 1 file changed, 21 insertions(+), 91 deletions(-) diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml index db5d80729..6514aa77a 100644 --- a/.github/workflows/json-unit-testing.yml +++ b/.github/workflows/json-unit-testing.yml @@ -1,112 +1,42 @@ -name: "JSON Unit Tests" +name: "Validate JSON" + on: - workflow_dispatch: - repository_dispatch: - types: ["JSON Unit Tests"] - schedule: - - cron: '0 3 * * *' + push: + branches: + - main pull_request: - types: [opened, reopened, edited, synchronize, review_requested] - -env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.number }} - -concurrency: - group: pipeline-pr-json-${{github.event.pull_request.number}} - cancel-in-progress: true + branches: + - main + workflow_dispatch: jobs: - test: - name: "JSON Unit Tests" + validate-json: + name: "Validate JSON File" runs-on: ubuntu-latest + steps: - - name: Checkout + - name: Checkout Repository uses: actions/checkout@v4 - - name: Verify JSON File + - name: Verify JSON File Exists id: verify-json run: | - echo "Verifying JSON file location..." JSON_FILE_PATH="tools/json/config.temp.json" - if [ ! -f $JSON_FILE_PATH ]; then + if [ -f "$JSON_FILE_PATH" ]; then + echo "JSON file found at $JSON_FILE_PATH" + else echo "Error: JSON file not found at $JSON_FILE_PATH" exit 1 fi - - name: Validate JSON + - name: Validate JSON Format id: validate-json run: | - echo "Validating JSON format..." JSON_FILE_PATH="tools/json/config.temp.json" jq '.' $JSON_FILE_PATH > /dev/null - if [ $? -ne 0 ]; then + if [ $? -eq 0 ]; then + echo "JSON format is valid" + else echo "Error: Invalid JSON format in $JSON_FILE_PATH" exit 1 - fi - - - name: Load and Parse JSON - id: load-json - run: | - echo "Loading JSON data..." - JSON_FILE_PATH="tools/json/config.temp.json" - DATA=$(cat $JSON_FILE_PATH) - echo "$DATA" > $GITHUB_WORKSPACE/loaded_data.json - - - name: Run Tests - run: | - echo "Running tests..." - DATA=$(cat $GITHUB_WORKSPACE/loaded_data.json) - for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do - _jq() { - echo ${row} | base64 --decode | jq -r ${1} - } - ID=$(_jq '.id') - COMMAND=$(_jq '.command') - OPTIONS=$(_jq '.options') - STATUS=$(_jq '.status') - ARCH=$(_jq '.arch') - - echo "Running test for $ID: $COMMAND with options $OPTIONS on status $STATUS for arch $ARCH" - # Add the logic to run the actual command here - # Example: touch a dummy file for the artifact - echo "Test result for $ID" > "./config/${ID}.result" - done - - - name: Upload test artifacts - uses: actions/upload-artifact@v3 - with: - name: TESTDATA - path: './config/*.result' - if-no-files-found: error - - gradle: - needs: test - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download test artifacts - uses: actions/download-artifact@v3 - with: - name: TESTDATA - - - name: Generate Summary - run: | - echo "# Successful tests:" >> $GITHUB_STEP_SUMMARY - echo "|ID|Command|Options|Status|Arch|" >> $GITHUB_STEP_SUMMARY - echo "|:---|:---|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY - DATA=$(cat $GITHUB_WORKSPACE/loaded_data.json) - for row in $(echo "${DATA}" | jq -r '.[] | @base64'); do - _jq() { - echo ${row} | base64 --decode | jq -r ${1} - } - ID=$(_jq '.id') - COMMAND=$(_jq '.command') - OPTIONS=$(_jq '.options') - STATUS=$(_jq '.status') - ARCH=$(_jq '.arch') - - echo "|$ID|$COMMAND|$OPTIONS|$STATUS|$ARCH|" >> $GITHUB_STEP_SUMMARY - done \ No newline at end of file + fi \ No newline at end of file From 20c0f6e23d56d53cf67c7fa864db30fcc3e4fa29 Mon Sep 17 00:00:00 2001 From: Tearran Date: Thu, 26 Dec 2024 19:58:26 +0000 Subject: [PATCH 20/20] revert --- .github/workflows/json-unit-testing.yml | 42 ------------------------- .github/workflows/unit-tests.yml | 2 +- 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 .github/workflows/json-unit-testing.yml diff --git a/.github/workflows/json-unit-testing.yml b/.github/workflows/json-unit-testing.yml deleted file mode 100644 index 6514aa77a..000000000 --- a/.github/workflows/json-unit-testing.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: "Validate JSON" - -on: - push: - branches: - - main - pull_request: - branches: - - main - workflow_dispatch: - -jobs: - validate-json: - name: "Validate JSON File" - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Verify JSON File Exists - id: verify-json - run: | - JSON_FILE_PATH="tools/json/config.temp.json" - if [ -f "$JSON_FILE_PATH" ]; then - echo "JSON file found at $JSON_FILE_PATH" - else - echo "Error: JSON file not found at $JSON_FILE_PATH" - exit 1 - fi - - - name: Validate JSON Format - id: validate-json - run: | - JSON_FILE_PATH="tools/json/config.temp.json" - jq '.' $JSON_FILE_PATH > /dev/null - if [ $? -eq 0 ]; then - echo "JSON format is valid" - else - echo "Error: Invalid JSON format in $JSON_FILE_PATH" - exit 1 - fi \ No newline at end of file diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ca6dbea45..9ca4cedcb 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -167,4 +167,4 @@ jobs: echo "# Succesful tests:" >> $GITHUB_STEP_SUMMARY echo "|Release|Command|Description|" >> $GITHUB_STEP_SUMMARY echo "|:---|:---|:---|" >> $GITHUB_STEP_SUMMARY - cat ./*.teststats | sed '$ s/.$//' >> $GITHUB_STEP_SUMMARY + cat ./*.teststats | sed '$ s/.$//' >> $GITHUB_STEP_SUMMARY \ No newline at end of file