Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

questions udated readme #30

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

187 changes: 118 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,77 +7,126 @@
<a href="https://www.codefactor.io/repository/github/tearran/configng"><img src="https://www.codefactor.io/repository/github/tearran/configng/badge" alt="CodeFactor" /></a>
</p>

# Table of Contents
- [User guide](#user-guide)
- [Quick start](#quick-start)
- [Installation Options](#installation-options)
- [Using Options](#using-options)

# User guide
## Quick start
Run the following commands:

### Installation Options
Our applications support two Run styles

## Limitations
Foundation adhering to confirmed best practices in Bash scripting.
<!-- For guidance on these best practices, refer to [insert relevant resources or links]. -->

- functionaly may or may not work when requering administration privileges
- establsh a roll or funtions resposability
- armbian-configng does not requier adnistation access.
- administraation access
- advanced use
- non administrations access
- basic use



1. **Run from GitHub repository:**

` sudo apt update && sudo apt install git `

```bash

cd ~/
git clone https://github.com/armbian/configng.git
cd configng
./bin/armbian-configng --dev
```

To uninstall:

```bash
cd ~/
# rm -rf configng
```

3. **Install from a .deb package:**
[Disclamer](#disclaimer): Not recomened

<!-- generated readme allowed for dynamic links to be use with safer option of wget" -->

```bash
{
latest_release=$(curl -s https://api.github.com/repos/armbian/configng/releases/latest)
deb_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith(".deb")) | .browser_download_url')
curl -LO "$deb_url"
deb_file=$(echo "$deb_url" | awk -F"/" '{print $NF}')
sudo dpkg -i "$deb_file"
sudo dpkg --configure -a
sudo apt --fix-broken install
}
```

To uninstall:

```bash
sudo dpkg -r armbian-configng
```
or
```bash
sudo apt remove armbian-configng
```
4. **Install from the Armbian repository(Coming Soon):**

```bash
echo "deb [signed-by=/usr/share/keyrings/armbian.gpg] https://armbian.github.io/configng stable main" \
| sudo tee /etc/apt/sources.list.d/armbian-development.list > /dev/null

armbian-configng --dev

If all goes well you should see the Text-Based User Inerface (TUI)

### To see a list of all functions and their descriptions, run the following command:
~~~
armbian-configng -h
~~~
## Coding Style
follow the following coding style:
~~~
# @description A short description of the function.
#
# @exitcode 0 If successful.
#
# @options A description if there are options.
function group::string() {s
echo "hello world"
return 0
}
~~~
## Codestyle can be used to auto generate
- [Markdown](share/armbian-configng/readme.md)
- [JSON](share/armbian-configng/data/armbian-configng.json)
- [CSV](share/armbian-configng/data/armbian-configng.csv)
- [HTML](share/armbian-configng/armbian-configng-table.html)
- [github.io](//tearran/github.io/armbian-configng/index.html)
## Functions list as of 2023-12-06
## network
System and Security

### set_wifi.sh

- **Group Name:** network
- **Action Name:** NMTUI
- **Options:** none.
- **Description:** Network Manager.

## system
Network Wired wireless Bluetooth access point

### armbian_install.sh

- **Group Name:** system
- **Action Name:** Install
- **Options:** none
- **Description:** Armbian installer.

### hello_world.sh

- **Group Name:** system
- **Action Name:** Hello
- **Options:** none
- **Description:** Hello System.

### see_monitor.sh

- **Group Name:** monitor
- **Action Name:** Bencharking
- **Options:**
- **Description:** Armbian Monitor and Bencharking.


# Inclueded projects
- [Bash Utility](https://labbots.github.io/bash-utility)
- [Armbian config](https://github.com/armbian/config.git)
sudo apt update
sudo apt install armbian-configng
```

To uninstall:

```bash
{ sudo apt remove armbian-configng
# sudo rm /etc/apt/sources.list.d/armbian-development.list
sudo apt update }
```

### Using Options

Our applications support two styles of options:

1. **C-style commands:** The `help` command provides a message with examples of how of use.
2. These option bypass user interations
3. Limitations
a. small sample size
- error handeling
b. migration of legacy
- A sugested astabliment of responsibilty
- configng does not requier super user priveges to run
- a default requierment of sudo for every option needed or ad/hoc
- armbian-configng does not requer it
- safe and best practie sugest
1. /sbin for admin and /bin for others
2.

```bash
./bin/armbian-configng help
```

5. **Script-style options:** These are passed as `-option` or `--option`. For example, to request help, you would use `-h` or `--help`.

```bash
./bin/armbian-configng -h
./bin/armbian-configng --help
```

## Disclaimer

This guide includes the use of `curl` command to download files from the internet. While we strive to provide safe and reliable instructions, we cannot guarantee the safety of any files downloaded using `curl`.

Please ensure that you trust the source of the files you are downloading. Be aware that downloading files from the internet always carries a risk, and you should only download files from trusted sources.

Always review the scripts and commands you run in your terminal. If you don't understand what a command or script does, take the time to learn about it before running it. This can help prevent unexpected behavior or damage to your system.
4 changes: 3 additions & 1 deletion bin/armbian-configng
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ filename="${file_name%.*}"
libpath=$(cd "$directory/lib/$filename/" && pwd)
#sharepath=$(cd "$directory/share/${filename%-dev}/" && pwd)


requirements=("nmtui" "armbian-config")
echo "${requirements[@]}" | grep -o "nmtui"
#

# Consept Distribution Compatibility checks
check_distro() {

Expand Down
1 change: 0 additions & 1 deletion debian.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
share:/usr/
lib:/usr/
bin:/usr/
22 changes: 12 additions & 10 deletions lib/armbian-configng/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,31 @@ generate_tui() {
categories_array["$i"]="$category_name"
description_array["$i"]="$category_description"
options+=("$i" "$(printf '%-7s - %-8s' "${categories_array[$i]}" "${description_array[$i]}")")
#options+=("$i" "${categories_array[$i]} - ${description_array[$i]}")
((++i))
done
options+=("$i" "$(printf '%-7s - %-8s' "Legacy" "Run Legacy configuration")")

#options+=("$i" "Legacy - Run Legacy configuration")
((++i))
# Check if armbian-config is installed before adding the Legacy option
if which armbian-config > /dev/null; then
options+=("$i" "$(printf '%-7s - %-8s' "Legacy" "Run Legacy configuration")")
((++i))
fi

options+=("$i" "$(printf '%-7s - %-8s' "Help" "Documentation, support, sources")")
#options+=("$i" "Help - Documentation, support, sources" )
((++i))

local choice

choice=$($dialogue --menu "Select a category:" 0 0 9 "${options[@]}" 3>&1 1>&2 2>&3)

if [[ -n $choice ]]; then

if [[ -n $choice ]]; then
if ((choice == "$i - 1")); then
generate_help | armbian-interface -o
exit ;
elif ((choice == "$i - 2")); then
armbian-config
exit ;
# Check again before running armbian-config
if which armbian-config > /dev/null; then
armbian-config
exit ;
fi
else
generate_sub_tui "${categories_array[$choice]}"
fi
Expand Down
2 changes: 0 additions & 2 deletions lib/armbian-configng/network/set_wifi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
# License version 2. This program is licensed "as is" without any
# warranty of any kind, whether express or implied.



# @description Network Manager.
#
# @exitcode 0 If successful.
Expand Down
95 changes: 95 additions & 0 deletions lib/armbian-configng/runtime.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@

SUBSYSTEM=="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="15c1", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}"
SUBSYSTEM=="net", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="15c1", NAME="lte0"
SUBSYSTEM=="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1c25", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}"
SUBSYSTEM=="net", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1c25", NAME="umts0"
SUBSYSTEM=="tty", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="251d", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}"
SUBSYSTEM=="tty", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1e1d", SYMLINK+="ttyWWAN%E{.ID_PORT}"
SUBSYSTEM=="tty", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="819b", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}"
SUBSYSTEM=="tty", ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9001", SYMLINK+="ttyWWAN%E{ID_USB_INTERFACE_NUM}"
SUBSYSTEM=="net", ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="9001", NAME="lte0"
dflag=
vflag=
cflag=
table="\Z2Application Protocol Port\n
HOSTNAMEFQDN=$(\
MYSQL_PASS=$(< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c16)
i=0
j=1
IFS=" "
skupaj=${#PACKETS[@]}
IFS=" "
HOSTNAMESHORT="$1"
SMBUSER=$(whiptail --inputbox "What is your samba username?" 8 78 $SMBUSER --title "$SECTION" 3>&1 1>&2 2>&3)
exitstatus=$?; if [ $exitstatus = 1 ]; then exit 1; fi
SMBPASS=$(whiptail --inputbox "What is your samba password?" 8 78 $SMBPASS --title "$SECTION" 3>&1 1>&2 2>&3)
exitstatus=$?; if [ $exitstatus = 1 ]; then exit 1; fi
SMBGROUP=$(whiptail --inputbox "What is your samba group?" 8 78 $SMBGROUP --title "$SECTION" 3>&1 1>&2 2>&3)
exitstatus=$?; if [ $exitstatus = 1 ]; then exit 1; fi
wgeturl="https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install"
PREFIX="https://hndl.urbackup.org/Server/latest/"
URL="https://hndl.urbackup.org/Server/latest/"$(wget -q $PREFIX -O - | html2text -width 120 | grep deb | awk ' { print $3 }' | grep $arch)
rmem_recommended=4194304
wmem_recommended=1048576
rmem_actual=$(sysctl net.core.rmem_max | awk -F" " '{print $3}')
wmem_actual=$(sysctl net.core.wmem_max | awk -F" " '{print $3}')
TEMP_DIR=$(mktemp -d || exit 1)
jdkBin=$(find /opt/jdk/*/bin ... -print -quit)
jdkLib=$(find /opt/jdk/*/lib ... -print -quit)
wgeturl=$(curl -s "https://api.github.com/repos/Radarr/Radarr/releases" | grep 'linux.tar.gz' | grep 'browser_download_url' | head -1 | cut -d \" -f 4)
Description=Radarr Daemon
After=network.target
User=root
Type=simple
ExecStart=/usr/bin/mono --debug /opt/Radarr/Radarr.exe -nobrowser
WantedBy=multi-user.target
Description=Sonarr (NzbDrone) Daemon
After=network.target
User=root
Type=simple
ExecStart=/usr/bin/mono --debug /opt/NzbDrone/NzbDrone.exe -nobrowser
WantedBy=multi-user.target
PREFIX="https://www.softether-download.com/files/softether/"
URL=$(wget -q $PREFIX -O - | html2text | grep rtm | awk ' { print $(NF) }' | tail -1)
SUFIX="${URL/-tree/}"
DLURL=$PREFIX$URL"/Linux/SoftEther_VPN_Server/32bit_-_ARM_EABI/softether-vpnserver-$SUFIX-linux-arm_eabi-32bit.tar.gz"
DLURL=$PREFIX$URL"/Linux/SoftEther_VPN_Server/32bit_-_Intel_x86/softether-vpnserver-$SUFIX-linux-x86-32bit.tar.gz"
Description=VPN service
Type=oneshot
ExecStart=/usr/local/vpnserver/vpnserver start
ExecStop=/usr/local/vpnserver/vpnserver stop
RemainAfterExit=yes
WantedBy=multi-user.target
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/vpnserver
PREFIX="https://www.softether-download.com/files/softether/"
URL=$(wget -q $PREFIX -O - | html2text | grep rtm | awk ' { print $(NF) }' | tail -1)
SUFIX="${URL/-tree/}"
SECURE_MYSQL=$(expect -c "
packets="amavisd-new spamassassin clamav clamav-daemon unzip bzip2 arj p7zip unrar-free rpm nomarch lzop \
WWW_RECONFIG=$(expect -c "
TEMP_DIR=$(mktemp -d || exit 1)
i=0
TTY_X=$(($(stty size | awk '{print $2}')-6)) # determine terminal width
TTY_Y=$(($(stty size | awk '{print $1}')-6)) # determine terminal height
distribution=$(lsb_release -cs)
family=$(lsb_release -is)
DEFAULT_ADAPTER=$(ip -4 route ls | grep default | tail -1 | grep -Po '(?<=dev )(\S+)')
serverIP=$(ip -4 addr show dev $DEFAULT_ADAPTER | awk '/inet/ {print $2}' | cut -d'/' -f1)
SUBNET="$1.$2.$3."
hostnamefqdn=$(hostname -f)
mysql_pass=""
BACKTITLE="Softy - Armbian post deployment scripts, https://www.armbian.com"
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIALOG_CANCEL=1
DIALOG_ESC=255
DATE=`date +%F`
DBBACKUPNAME="mysql-"$DATE
WEBBACKUPNAME="website-"$DATE
FILEBACKUPNAME="website-"$DATE
COPY_TO=/root/temp/$DATE
COPY_FROM=/var/www/clients
USER=
PASSWORD=
HOST=localhost
REMOTE=
5 changes: 0 additions & 5 deletions share/doc/armbian-configng/armbian-configng.csv

This file was deleted.

Loading