Commit 58d15be9 authored by BTCxZelko's avatar BTCxZelko
Browse files

Merge branch 'release/v1.13.1' into 'master'

release v1.13.1

See merge request ronindojo/RoninDojo!187
parents c43eaf1e 9679aa0a
RoninDojo v1.13.1 Change Log
- RoninUI 2.0 Prep
- Ronin Plug-n-Play finalization
- Bug Fixes
RoninDojo v1.13.0 Change Log
-Dojo 1.13.0
-Electrs 0.9.4
......@@ -114,4 +119,4 @@ RoninDojo v1.4 Change Log
- Changed to Manjaro ARM XFCE for long term support, Minimal is no longer supported
- Polished the system-setup script
- Ipv6 is now disabled during the system-setup script
- Cleaned up text output, sleep timers, and code spacing to improve readablilty
\ No newline at end of file
- Cleaned up text output, sleep timers, and code spacing to improve readablilty
#!/usr/bin/env python
import RP64.GPIO as GPIO
var_gpio_out = 15
GPIO.setwarnings(True)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(var_gpio_out, GPIO.OUT, initial=GPIO.LOW)
GPIO.cleanup([var_gpio_out])
#!/usr/bin/env python
import RP64.GPIO as GPIO
var_gpio_out = 15
GPIO.setwarnings(True)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(var_gpio_out, GPIO.OUT, initial=GPIO.HIGH)
GPIO.cleanup([var_gpio_out])
......@@ -600,6 +600,8 @@ EOF
_ronin_ui_install
_install_gpio
# Calculate swapfile size
_swap_size
......
......@@ -55,29 +55,35 @@ CHOICE_HEIGHT=16
TITLE="RoninDojo ${ronindojo_version}"
MENU="Choose one of the following menu options:"
# RoninDojo Menu Paths
ronin_applications_menu="$HOME/RoninDojo/Scripts/Menu/menu-applications.sh"
ronin_applications_manage_menu="$HOME/RoninDojo/Scripts/Menu/menu-applications-manage.sh"
ronin_credentials_menu="$HOME/RoninDojo/Scripts/Menu/menu-credentials.sh"
ronin_boltzmann_menu="$HOME/RoninDojo/Scripts/Menu/menu-boltzmann.sh"
ronin_dojo_menu="$HOME/RoninDojo/Scripts/Menu/menu-dojo.sh"
ronin_dojo_menu2="$HOME/RoninDojo/Scripts/Menu/menu-dojo2.sh"
ronin_electrs_menu="$HOME/RoninDojo/Scripts/Menu/menu-electrs.sh"
ronin_networking_menu="$HOME/RoninDojo/Scripts/Menu/menu-networking.sh"
ronin_ssh_menu="$HOME/RoninDojo/Scripts/Menu/menu-ssh.sh"
ronin_firewall_menu="$HOME/RoninDojo/Scripts/Menu/menu-firewall.sh"
ronin_firewall_menu2="$HOME/RoninDojo/Scripts/Menu/menu-firewall2.sh"
ronin_mempool_menu="$HOME/RoninDojo/Scripts/Menu/menu-mempool.sh"
ronin_specter_menu="$HOME/RoninDojo/Scripts/Menu/menu-specter.sh"
ronin_system_menu="$HOME/RoninDojo/Scripts/Menu/menu-system.sh"
ronin_system_menu2="$HOME/RoninDojo/Scripts/Menu/menu-system2.sh"
ronin_system_update="$HOME/RoninDojo/Scripts/Menu/menu-system-updates.sh"
ronin_system_storage="$HOME/RoninDojo/Scripts/Menu/menu-system-storage.sh"
ronin_ui_menu="$HOME/RoninDojo/Scripts/Menu/menu-ronin-ui.sh"
ronin_updates_menu="$HOME/RoninDojo/Scripts/Menu/menu-system-updates.sh"
ronin_whirlpool_menu="$HOME/RoninDojo/Scripts/Menu/menu-whirlpool.sh"
ronin_whirlpool_stat_menu="$HOME/RoninDojo/Scripts/Menu/menu-whirlpool-wst.sh"
ronin_samourai_toolkit_menu="$HOME/RoninDojo/Scripts/Menu/menu-samourai-toolkit.sh"
# RoninDojo Paths
ronin_dir="$HOME/RoninDojo"
ronin_gpio_dir="$ronin_dir/GPIO"
ronin_scripts_dir="$ronin_dir/Scripts"
ronin_menu_dir="$ronin_scripts_dir/Menu"
# RoninDojo menu Paths
ronin_applications_menu="$ronin_menu_dir/menu-applications.sh"
ronin_applications_manage_menu="$ronin_menu_dir/menu-applications-manage.sh"
ronin_credentials_menu="$ronin_menu_dir/menu-credentials.sh"
ronin_boltzmann_menu="$ronin_menu_dir/menu-boltzmann.sh"
ronin_dojo_menu="$ronin_menu_dir/menu-dojo.sh"
ronin_dojo_menu2="$ronin_menu_dir/menu-dojo2.sh"
ronin_electrs_menu="$ronin_menu_dir/menu-electrs.sh"
ronin_networking_menu="$ronin_menu_dir/menu-networking.sh"
ronin_ssh_menu="$ronin_menu_dir/menu-ssh.sh"
ronin_firewall_menu="$ronin_menu_dir/menu-firewall.sh"
ronin_firewall_menu2="$ronin_menu_dir/menu-firewall2.sh"
ronin_mempool_menu="$ronin_menu_dir/menu-mempool.sh"
ronin_specter_menu="$ronin_menu_dir/menu-specter.sh"
ronin_system_menu="$ronin_menu_dir/menu-system.sh"
ronin_system_menu2="$ronin_menu_dir/menu-system2.sh"
ronin_system_update="$ronin_menu_dir/menu-system-updates.sh"
ronin_system_storage="$ronin_menu_dir/menu-system-storage.sh"
ronin_ui_menu="$ronin_menu_dir/menu-ronin-ui.sh"
ronin_updates_menu="$ronin_menu_dir/menu-system-updates.sh"
ronin_whirlpool_menu="$ronin_menu_dir/menu-whirlpool.sh"
ronin_whirlpool_stat_menu="$ronin_menu_dir/menu-whirlpool-wst.sh"
ronin_samourai_toolkit_menu="$ronin_menu_dir/menu-samourai-toolkit.sh"
#
# Terminal Colors
......@@ -92,6 +98,7 @@ nc=$(tput sgr0) # No Color
dojo_path="$HOME/dojo"
dojo_path_my_dojo="${dojo_path}/docker/my-dojo"
ronin_data_dir="$HOME/.config/RoninDojo/data"
ronin_gpio_data_dir="$HOME/.config/RoninDojo/GPIO"
boltzmann_path="$HOME/boltzmann"
ronin_ui_path="$HOME/Ronin-UI"
......@@ -173,3 +180,10 @@ declare -a backup_dojo_data=(
indexer
bitcoind
)
# RoninUI defaults
roninui_version_staging=false
roninui_version_file="https://ronindojo.io/downloads/RoninUI/version.json"
if [ "$roninui_version_staging" = true ]; then
roninui_version_file="https://ronindojo.io/downloads/RoninUI/version-staging.json"
fi
......@@ -46,6 +46,7 @@ _main() {
test -f "$HOME"/.config/RoninDojo/data/updates/20-* || _update_20 # Revert some settings in docker-bitcoind.conf
test -f "$HOME"/.config/RoninDojo/data/updates/21-* || _update_21 # Perform System Update
test -f "$HOME"/.config/RoninDojo/data/updates/22-* || _update_22 # Remove any existing docker-mempool.conf in favor of new tpl for v2
_update_24 # Fix hosts file, rerun always in case OS update reverts it
# Create symbolic link for main ronin script
if [ ! -h /usr/local/bin/ronin ]; then
......@@ -566,7 +567,7 @@ EOF
cd "${ronin_ui_path}" || exit
# wget version.json
wget -q https://ronindojo.io/downloads/RoninUI/version.json -O /tmp/version.json 2>/dev/null
wget -q "${roninui_version_file}" -O /tmp/version.json 2>/dev/null
# get file
_file=$(jq -r .file /tmp/version.json)
......@@ -583,11 +584,13 @@ EOF
rm "$_file" /tmp/version.json
# Generate .env file
cat << EOF >.env
cat << EOF > .env
JWT_SECRET=$gui_jwt
NEXT_TELEMETRY_DISABLED=1
EOF
if [ "${roninui_version_staging}" = true ] ; then
echo -e "VERSION_CHECK=staging\n" >> .env
fi
cat <<EOF
${red}
***
......@@ -1433,10 +1436,10 @@ EOF
# Dojo Credentials Backup
#
_dojo_backup() {
test -d "${dojo_backup_dir}" || sudo mkdir -p "${dojo_backup_dir}"
test -d "${dojo_backup_dir}"/conf || sudo mkdir -p "${dojo_backup_dir}"
if [ -d "${dojo_path}" ]; then
sudo rsync -ac --delete-before --quiet "${dojo_path_my_dojo}"/conf "${dojo_backup_dir}"
if [ -d "${dojo_path}"/conf ]; then
sudo rsync -ac --delete-before --quiet "${dojo_path_my_dojo}"/conf/*.conf "${dojo_backup_dir}"/conf
return 0
fi
......@@ -1448,7 +1451,7 @@ _dojo_backup() {
#
_dojo_restore() {
if "${dojo_conf_backup}"; then
sudo rsync -ac --quiet --delete-before "${dojo_backup_dir}"/conf "${dojo_path_my_dojo}"
sudo rsync -ac --quiet --delete-before "${dojo_backup_dir}"/conf/*.conf "${dojo_path_my_dojo}"/conf
# Apply bitcoind_db_cache_total tweak if needed
. "$HOME"/RoninDojo/Scripts/update.sh
......@@ -2923,3 +2926,72 @@ _nvme_check() {
return 1
}
#
# returns true/false on whether the host has a gpio system
#
_is_gpio_sytem() {
if [ -d /sys/class/gpio ]; then
return 0;
else
return 1;
fi
}
#
# deletes and repopulates the GPIO dir
#
_prepare_GPIO_DIR() {
if [ -d "${ronin_gpio_data_dir}" ]; then
rm -rf "${ronin_gpio_data_dir}"
fi
git clone https://github.com/Angoosh/RockPro64-RP64.GPIO.git "${ronin_gpio_data_dir}"
cp "${ronin_gpio_dir}/turn.LED.off.py" "${ronin_gpio_data_dir}"
cp "${ronin_gpio_dir}/turn.LED.on.py" "${ronin_gpio_data_dir}"
}
#
# installs the gpio service file for systemd
#
_install_gpio_service() {
_load_user_conf
if [ -f /etc/systemd/system/ronin.gpio.service ]; then
exit;
fi
sudo bash -c "cat <<EOF > /etc/systemd/system/ronin.gpio.service
[Unit]
Description=GPIO
After=multi-user.target
[Service]
User=root
Type=simple
ExecStart=/bin/python ${ronin_gpio_data_dir}/turn.LED.on.py
WorkingDirectory=${ronin_gpio_data_dir}
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target
EOF
"
sudo systemctl daemon-reload
sudo systemctl enable --now --quiet ronin.gpio
}
#
# installs the whole gpio setup
#
_install_gpio() {
if [ ! _is_gpio_sytem ]; then
exit
fi
_prepare_GPIO_DIR
_install_gpio_service
}
......@@ -461,4 +461,29 @@ _update_23() {
# Finalize
touch "$HOME"/.config/RoninDojo/data/updates/23-"$(date +%m-%d-%Y)"
fi
}
\ No newline at end of file
}
# Fix hosts file
_update_24() {
hostsfile="/etc/hosts"
#test if there's a hostsfile, create if there isn't
if test ! -f "${hostsfile}"; then
if test -e "${hostsfile}"; then
>&2 echo "${hostsfile} is present but not a regular file"
exit 1
fi
sudo touch "${hostsfile}"
fi
#test if there's a 127.0.0.1 entry, edit when necessary
if grep -q -E "^\s*127\.0\.0\.1(\s+\w+)+$" "${hostsfile}"; then
if ! grep -q -E "^\s*127\.0\.0\.1(\s+\w+)*(\s+localhost)(\s+\w+)*$" "${hostsfile}"; then
#edit existing entry, appending the "localhost" alias
sudo sed -i -E 's/(\s*127\.0\.0\.1\s.*$)/\1 localhost/g' "${hostsfile}"
fi
else
#append the missing entry
echo $'\n127.0.0.1 localhost' | sudo tee -a "${hostsfile}"
fi
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment