Skip to content

Commit

Permalink
Merge branch 'main' into load_timer
Browse files Browse the repository at this point in the history
  • Loading branch information
Tearran authored Feb 5, 2025
2 parents 3cc05d0 + 17e0aa9 commit 7056fa8
Show file tree
Hide file tree
Showing 17 changed files with 124 additions and 96 deletions.
61 changes: 31 additions & 30 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,17 @@ Outputs:
--cmd SWAG04 - SWAG purge with data folder
HomeAutomation - Home Automation for control home appliances
--cmd HAB001 - openHAB empowering the smart home
--cmd HAB002 - openHAB remove (http://10.1.0.35:8080)
--cmd HAB002 - openHAB remove (http://10.1.0.216:8080)
--cmd HAB003 - openHAB purge with data folder
--cmd HAS001 - Home Assistant open source home automation
--cmd HAS002 - Home Assistant remove (http://10.1.0.35:8123)
--cmd HAS002 - Home Assistant remove (http://10.1.0.216:8123)
--cmd HAS003 - Home Assistant purge with data folder
--cmd DOM001 - Domoticz open source home automation
--cmd DOM002 - Domoticz remove (http://10.1.0.35:8080)
--cmd DOM002 - Domoticz remove (http://10.1.0.216:8080)
--cmd DOM003 - Domoticz purge with data folder
DNS - Network-wide ad blockers servers
--cmd DNS001 - Pi-hole DNS ad blocker
--cmd DNS003 - Pi-hole remove (http://10.1.0.35:80)
--cmd DNS003 - Pi-hole remove (http://10.1.0.216:80)
--cmd DNS002 - Pi-hole change web admin password
--cmd DNS004 - Pi-hole purge with data folder
Music - Music servers and streamers
Expand All @@ -401,47 +401,47 @@ Outputs:
--cmd NAV003 - Navidrome purge with data folder
Downloaders - Download apps for movies, TV shows, music and subtitles
--cmd DOW001 - qBittorrent BitTorrent client
--cmd DOW002 - qBittorrent remove (http://10.1.0.35:8090)
--cmd DOW002 - qBittorrent remove (http://10.1.0.216:8090)
--cmd DOW003 - qBittorrent purge with data folder
--cmd DEL001 - Deluge BitTorrent client
--cmd DEL002 - Deluge remove (http://10.1.0.35:8112)
--cmd DEL002 - Deluge remove (http://10.1.0.216:8112)
--cmd DEL003 - Deluge purge with data folder
--cmd TRA001 - Transmission BitTorrent client
--cmd TRA002 - Transmission remove (http://10.1.0.35:9091)
--cmd TRA002 - Transmission remove (http://10.1.0.216:9091)
--cmd TRA003 - Transmission purge with data folder
--cmd SABN01 - SABnzbd newsgroup downloader
--cmd SABN02 - SABnzbd remove (http://10.1.0.35:8080)
--cmd SABN02 - SABnzbd remove (http://10.1.0.216:8080)
--cmd SABN03 - SABnzbd purge with data folder
--cmd MDS001 - Medusa automatic downloader for TV shows
--cmd MDS002 - Medusa TV shows downloader remove (http://10.1.0.35:8081)
--cmd MDS002 - Medusa TV shows downloader remove (http://10.1.0.216:8081)
--cmd MDS003 - Medusa TV shows downloader purge
--cmd SON001 - Sonarr automatic downloader for TV shows
--cmd SON002 - Sonarr remove (http://10.1.0.35:8989)
--cmd SON002 - Sonarr remove (http://10.1.0.216:8989)
--cmd SON003 - Sonarr purge with data folder
--cmd RAD001 - Radarr automatic downloader for movies
--cmd RAD002 - Radarr remove (http://10.1.0.35:7878)
--cmd RAD002 - Radarr remove (http://10.1.0.216:7878)
--cmd RAD003 - Radarr purge with data folder
--cmd BAZ001 - Bazarr automatic subtitles downloader for Sonarr and Radarr
--cmd BAZ002 - Bazarr remove (http://10.1.0.35:6767)
--cmd BAZ002 - Bazarr remove (http://10.1.0.216:6767)
--cmd BAZ003 - Bazarr purge with data folder
--cmd LID001 - Lidarr automatic music downloader
--cmd LID002 - Lidarr remove (http://10.1.0.35:8686)
--cmd LID002 - Lidarr remove (http://10.1.0.216:8686)
--cmd LID003 - Lidarr purge with data folder
--cmd RDR001 - Readarr automatic downloader for Ebooks
--cmd RDR002 - Readarr remove (http://10.1.0.35:8787)
--cmd RDR002 - Readarr remove (http://10.1.0.216:8787)
--cmd RDR003 - Readarr purge with data folder
--cmd DOW025 - Prowlarr index manager and proxy for PVR
--cmd DOW026 - Prowlarr remove (http://10.1.0.35:9696)
--cmd DOW026 - Prowlarr remove (http://10.1.0.216:9696)
--cmd DOW027 - Prowlarr purge with data folder
--cmd JEL001 - Jellyseerr Jellyfin/Emby/Plex integration install
--cmd JEL002 - Jellyseerr remove (http://10.1.0.35:5055)
--cmd JEL002 - Jellyseerr remove (http://10.1.0.216:5055)
--cmd JEL003 - Jellyseerr purge with data folder
Database - SQL database servers and web interface managers
--cmd DAT001 - Mariadb SQL database server
--cmd DAT002 - Mariadb remove (Server: 10.1.0.35)
--cmd DAT002 - Mariadb remove (Server: 10.1.0.216)
--cmd DAT003 - Mariadb purge with data folder
--cmd DAT005 - phpMyAdmin web interface manager
--cmd DAT006 - phpMyAdmin remove (http://10.1.0.35:8071)
--cmd DAT006 - phpMyAdmin remove (http://10.1.0.216:8071)
--cmd DAT007 - phpMyAdmin purge with data folder
DevTools - Applications and tools for development
--cmd DEV001 - Install tools for cloning and managing repositories (git)
Expand All @@ -452,40 +452,40 @@ Outputs:
--cmd CON003 - Docker remove
--cmd CON004 - Docker purge with all images, containers, and volumes
--cmd CON005 - Portainer container management platform
--cmd CON006 - Portainer remove (http://10.1.0.35:9000)
--cmd CON006 - Portainer remove (http://10.1.0.216:9000)
--cmd CON007 - Portainer purge with with data folder
Media - Media servers, organizers and editors
--cmd MED003 - Emby organizes video, music, live TV, and photos
--cmd MED004 - Emby server remove (http://10.1.0.35:8096)
--cmd MED004 - Emby server remove (http://10.1.0.216:8096)
--cmd MED005 - Emby server purge with data folder
--cmd MED010 - Stirling PDF tools for viewing and editing PDF files
--cmd MED011 - Stirling PDF remove (http://10.1.0.35:8077)
--cmd MED011 - Stirling PDF remove (http://10.1.0.216:8077)
--cmd MED012 - Stirling PDF purge with data folder
--cmd MED015 - Syncthing continuous file synchronization
--cmd MED016 - Syncthing remove (http://10.1.0.35:8884)
--cmd MED016 - Syncthing remove (http://10.1.0.216:8884)
--cmd MED017 - Syncthing purge with data folder
--cmd MED020 - Nextcloud content collaboration platform
--cmd MED021 - Nextcloud remove (https://10.1.0.35:443)
--cmd MED021 - Nextcloud remove (https://10.1.0.216:443)
--cmd MED022 - Nextcloud purge with data folder
--cmd MED025 - Owncloud share files and folders, easy and secure
--cmd MED026 - Owncloud remove (http://10.1.0.35:7787)
--cmd MED026 - Owncloud remove (http://10.1.0.216:7787)
--cmd MED027 - Owncloud purge with data folder
Monitoring - Real-time monitoring, collecting metrics, up-time status
--cmd MON001 - Uptime Kuma self-hosted monitoring tool
--cmd MON002 - Uptime Kuma remove (http://10.1.0.35:3001)
--cmd MON002 - Uptime Kuma remove (http://10.1.0.216:3001)
--cmd MON003 - Uptime Kuma purge with data folder
--cmd MON005 - Netdata - monitoring real-time metrics
--cmd MON006 - Netdata remove (http://10.1.0.35:19999)
--cmd MON006 - Netdata remove (http://10.1.0.216:19999)
--cmd MON007 - Netdata purge with data folder
--cmd GRA001 - Grafana data analytics
--cmd GRA002 - Grafana remove (http://10.1.0.35:3000)
--cmd GRA002 - Grafana remove (http://10.1.0.216:3000)
--cmd GRA003 - Grafana purge with data folder
Management - Remote Management tools
--cmd MAN001 - Cockpit web-based management tool (http://10.1.0.35:9090)
--cmd MAN001 - Cockpit web-based management tool (http://10.1.0.216:9090)
--cmd MAN005 - Webmin web-based management tool
Printing - Tools for printing and 3D printing
--cmd OCT001 - OctoPrint web-based 3D printers management tool
--cmd OCT002 - OctoPrint remove (http://10.1.0.35:7981)
--cmd OCT002 - OctoPrint remove (http://10.1.0.216:7981)
--cmd OCT003 - OctoPrint purge with data folder
Netconfig - Console network tools for measuring load and bandwidth
--cmd NET001 - nload -realtime console network usage monitor
Expand Down Expand Up @@ -863,6 +863,7 @@ These helper functions facilitate various operations related to job management,
| Toggle SSH lastlog | toggle_ssh_lastlog | @Tearran
| Generate this markdown table of all module_options | see_function_table_md | @Tearran
| Netplan wrapper | simple advanced type stations select store restore dhcp static help | @igorpecovnik
| Exit with error code 1, optionally printing a message to stderr | run_critical_function || die 'The world is about to end' | @dimitry-ishenko
| Webmin setup and service setting. | help install remove start stop enable disable status check | @Tearran
| Install HA supervised container | install remove purge status help | @igorpecovnik
| Display a menu from pipe | show_menu <<< armbianmonitor -h ; | @Tearran
Expand Down Expand Up @@ -898,7 +899,6 @@ These helper functions facilitate various operations related to job management,
| Install zfs filesystem support | install remove status kernel_max zfs_version zfs_installed_version help | @igorpecovnik
| Check if package is installed | pkg_installed mc | @dimitry-ishenko
| Update submenu descriptions based on conditions | update_submenu_data | @Tearran
| sanitize input cli | sanitize_input | @Tearran
| Install openssh-server container | install remove purge status help | @armbian
| Upgrade installed packages | pkg_upgrade | @dimitry-ishenko
| Install lidarr container | install remove purge status help | @armbian
Expand Down Expand Up @@ -957,6 +957,7 @@ These helper functions facilitate various operations related to job management,
| Install prowlarr container | install remove purge status help | @Prowlarr
| Install nfsd server | install remove manage add status clients servers help | @igorpecovnik
| Check the internet connection with fallback DNS | see_ping | @Tearran
| Make sure param contains only valid chars | sanitize 'foo_bar_42' | @Tearran
| Install docker from a repo using apt | install remove purge status help | @schwar3kat
| Upgrade to next stable or rolling release | release_upgrade stable verify | @igorpecovnik
| Update the /etc/skel files in users directories | update_skel | @igorpecovnik
Expand Down
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
<a href=https://github.com/armbian/configng/actions/workflows/debian.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/configng/debian.yml?logo=githubactions&label=Packaging&style=for-the-badge&branch=main"></a> <a href=https://github.com/armbian/configng/actions/workflows/unit-tests.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/configng/unit-tests.yml?logo=githubactions&label=Unit%20tests&style=for-the-badge&branch=main"></a> <a href=https://github.com/armbian/configng/actions/workflows/docs.yml><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/armbian/configng/docs.yml?logo=githubactions&label=Documentation&style=for-the-badge&branch=main"></a>
</p>

**armbian-config** provides configuration and installation routines for customizing and automating tasks within Armbian Linux environment. These utilties help streamline setup processes for various use cases.
**armbian-config** provides configuration and installation routines for customizing and automating tasks within Armbian Linux environment. These utilities help streamline setup processes for various use cases.

<a href=#><img src=.github/images/common.png></a>

## Key Advantages
- **Lightweight**: Minimal dependencies for optimal performance.
- **Flexible**: Supports JSON, TUI, CLI, and API interfaces.
- **Modern**: A fresh approach to configuration.
- **Low entropy**: Byte clean uninstall for most targets
- **Low entropy**: Byte clean uninstall for most targets.

## Features

- **System Configuration**:
- kernel manamenent, headers, hardware tweaks.
- Kernel management, headers, hardware tweaks.
- NFS and ZFS storage management.
- SSH user access tweaks.
- system updates, rolling / stable, containers update.
- System updates, rolling / stable, containers update.
- **Network Management**:
- fixed / dynamic IP configuration.
- connecting to wireless network.
- access point management.
- Fixed / dynamic IP configuration.
- Connecting to wireless network.
- Access point management.
- **Localization Settings**:
- Configure time zone.
- Set language and locales.
Expand Down Expand Up @@ -61,9 +61,13 @@ Add Armbian key + repository and install the tool:
```bash
wget -qO - https://apt.armbian.com/armbian.key | gpg --dearmor | \
sudo tee /usr/share/keyrings/armbian.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/armbian.gpg] \
https://github.armbian.com/configng stable main" | \
sudo tee /etc/apt/sources.list.d/armbian-config.list > /dev/null
cat << EOF | sudo tee /etc/apt/sources.list.d/armbian-config.sources > /dev/null
Types: deb
URIs: https://github.armbian.com/configng
Suites: stable
Components: main
Signed-By: /usr/share/keyrings/armbian.gpg
EOF
sudo apt update
sudo apt -y install armbian-config
```
Expand Down
4 changes: 1 addition & 3 deletions bin/armbian-config
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set_checkpoint start
set_checkpoint mark "Initializing script" true

[[ -d "$script_dir/../tools" ]] && tools_dir="$script_dir/../tools"
[[ ! -d "$script_dir/../lib" && -n "$tools_dir" ]] && echo -e "Please run\nbash "$tools_dir/config-assemble.sh" to build the lib directory\n" && exit 1
[[ ! -d "$script_dir/../lib" && -n "$tools_dir" ]] && die -e "Please run\nbash "$tools_dir/config-assemble.sh" to build the lib directory\n"

# 'whiptail' is a simple dialog box utility that works well with Bash. It doesn't have all the features of some other dialog box utilities, but it does everything we need for this script.
[[ -x "$(command -v whiptail)" ]] && DIALOG="whiptail"
Expand Down Expand Up @@ -70,8 +70,6 @@ set_checkpoint mark "Loaded Software helpers..." true
source "$lib_dir/config.runtime.sh"
echo "Loaded Runtime conditions..." true

clear

case "$1" in
"--help")
if [[ -n "$2" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion debian.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lib:/usr/
bin:/usr/
share:/usr/
tools/repository/armbian-config.list:/etc/apt/sources.list.d/
tools/repository/armbian-config.sources:/etc/apt/sources.list.d/
8 changes: 4 additions & 4 deletions tests/CON005.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ENABLED=true
RELEASE="bookworm:noble"

function testcase {
./bin/armbian-config --api module_portainer remove
testcase() {(
set -e
./bin/armbian-config --api module_portainer install
./bin/armbian-config --api module_portainer status
echo $?
}
)}
5 changes: 3 additions & 2 deletions tests/DAT001.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ENABLED=false

function testcase {
testcase() {(
set -e
./bin/armbian-config --api module_mariadb install
./bin/armbian-config --api module_mariadb status
docker container ls -a
}
)}
5 changes: 3 additions & 2 deletions tests/HAB001.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ENABLED=true
RELEASE="bookworm"

function testcase {
function testcase {(
set -e
./bin/armbian-config --api module_openhab install
systemctl is-active --quiet openhab.service
}
)}
6 changes: 4 additions & 2 deletions tests/HAS001.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ENABLED=false
RELEASE="bookworm"

function testcase {
testcase() {(
set -e
./bin/armbian-config --api module_haos install
}
./bin/armbian-config --api module_haos status
)}
10 changes: 5 additions & 5 deletions tests/MAN001.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ENABLED=true
RELEASE="bookworm:noble" # run on specific or leave empty to run on all

function testcase {
./bin/armbian-config --api module_cockpit remove
testcase() {(
set -e
./bin/armbian-config --api module_cockpit remove || true
./bin/armbian-config --api module_cockpit install
[ -f /usr/bin/cockpit-bridge ]
}

[[ -f /usr/bin/cockpit-bridge ]]
)}
9 changes: 5 additions & 4 deletions tests/MON001.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
ENABLED=true
RELEASE="bookworm:noble"

function testcase {
./bin/armbian-config --api module_uptimekuma remove
testcase() {(
set -e
./bin/armbian-config --api module_uptimekuma remove || true
./bin/armbian-config --api module_uptimekuma install
./bin/armbian-config --api module_uptimekuma status
./bin/armbian-config --api module_uptimekuma remove
./bin/armbian-config --api module_uptimekuma status
}
! ./bin/armbian-config --api module_uptimekuma status
)}
9 changes: 4 additions & 5 deletions tests/NAV001.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
ENABLED=true
RELEASE="bookworm:noble"

function testcase {
testcase() {(
set -e
./bin/armbian-config --api module_navidrome remove
./bin/armbian-config --api module_navidrome install
container=$(docker container ls -a | mawk '/navidrome?( |$)/{print $1}')
if [[ -z "${container}" ]]; then
exit 1
fi
}
[[ -n "$container" ]]
)}
27 changes: 22 additions & 5 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
# Unit tests

If function testcase returns 0, test is succesful. Put the code there.
If the function `testcase()` returns 0, the test is succesful. Put the code there.

- name of the the file is function ID.conf
- ENABLED=false|true
- RELEASE="bookworm:jammy:noble" run on specific or leave empty to run on all

Example:

```
```sh
ENABLED=true
RELEASE="bookworm:noble"

function testcase {
./bin/armbian-config --api module_cockpit install
[ -f /usr/bin/cockpit-bridge ]
testcase() {
./bin/armbian-config --api module_cockpit install
[ -f /usr/bin/cockpit-bridge ]
}
```

If you have multiple test conditions inside `testcase()` and you want the test
to exit on the first failed statement, you can use the following technique:

```sh
testcase() {(
set -e
./bin/armbian-config --api pkg_install neovim
./bin/armbian-config --api pkg_installed neovim
./bin/armbian-config --api pkg_remove neovim
! ./bin/armbian-config --api pkg_installed neovim
)}
```

Note the additional pair of `()` and the `set -e` command inside function body.
These will cause test conditions to run inside a subshell with the -e option
enabled (exit immediately if a pipeline returns non-zero status).
Loading

0 comments on commit 7056fa8

Please sign in to comment.