From 884836b15da86e8504d327219ba93dc6fab5c4b3 Mon Sep 17 00:00:00 2001 From: JMSolo Date: Wed, 19 Apr 2017 13:06:26 -0500 Subject: [PATCH 01/16] start utilizing themes/ directory for better Dashboard theme switching Option to select theme of choice will now be available on install. --- setup/quickbox-setup | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/setup/quickbox-setup b/setup/quickbox-setup index d1e36463..b7e15b73 100644 --- a/setup/quickbox-setup +++ b/setup/quickbox-setup @@ -47,8 +47,7 @@ function _intro() { echo echo " ${title} Heads Up! ${normal} " echo " ${message_title} QuickBox works with the following ${normal} " - echo " ${message_title} Ubuntu 15.10 | 16.04 | 16.10 ${normal} " - echo " ${message_title} Debian 8 ${normal} " + echo " ${message_title} Ubuntu 15.10 | 16.04 ${normal} " echo echo echo "${green}Checking distribution ...${normal}" @@ -238,6 +237,20 @@ function _askservices() { echo } +# ask what rtorrent version (8) +function _askdashtheme() { + echo -e "1) QuickBox - ${green}smoked${normal} :: Dark theme" + echo -e "2) QuickBox - ${green}defaulted${normal} :: Light theme" + echo -ne "${bold}${yellow}Pick your QuickBox Dashboard Theme${normal} (Default ${green}1${normal}): "; read version + case $version in + 1 | "") dash_theme=smoked ;; + 2) dash_theme=defaulted ;; + *) dash_theme=smoked ;; + esac + echo "We will be using QuickBox Theme : ${green}$dash_theme${normal}" + echo +} + # ask what rtorrent version (8) function _askrtorrent() { echo -e "1) rtorrent ${green}0.9.6${normal}" @@ -253,6 +266,7 @@ function _askrtorrent() { echo "We will be using rtorrent-${green}$RTVERSION${normal}/libtorrent-${green}$LTORRENT${normal}" echo } + # ask deluge version (if wanted) (8.1) function _askdeluge() { echo -e "1) Deluge ${green}repo${normal} (fastest)" @@ -321,6 +335,7 @@ function _denyhosts() { [nN] | [nN][Oo] ) echo "[ ${green}+ Allowing public trackers +${normal} ]" ;; esac + echo } # package and repo addition (silently add php7) _add respo sources_ (12) @@ -725,11 +740,12 @@ function _rutorrent-plugins() { # function to install dashboard (23) function _dashboard() { cd && mkdir -p /srv/rutorrent/home - cp -r ${local_dashboard}/. /srv/rutorrent/home + cp -r ${local_dashboard}/${dash_theme}. /srv/rutorrent/home touch /srv/rutorrent/home/db/output.log + touch /srv/rutorrent/home/db/.${dash_theme}.lock } -# function to install dashboard (23) +# function to install _h5ai file indexer (24x) function _fileindexer() { cd /srv/rutorrent/home wget --quiet https://release.larsjung.de/h5ai/h5ai-0.29.0.zip >>"${OUTTO}" 2>&1 @@ -1128,7 +1144,7 @@ local_packages=/etc/QuickBox/packages/ local_rutorrent=/etc/QuickBox/rutorrent/ local_rplugins=/etc/QuickBox/rtplugins/ local_themes=/etc/QuickBox/themes/ -local_dashboard=/etc/QuickBox/dashboard/ +local_dashboard=/etc/QuickBox/themes/ IFACE=$(ip link show|grep -i broadcast|grep -m1 UP|cut -d: -f 2|cut -d@ -f 1|sed -e 's/ //g'); HOSTNAME1=$(hostname -s); From 21cd75077116b67ac20f20295180335d0d424ec3 Mon Sep 17 00:00:00 2001 From: JMSolo Date: Wed, 19 Apr 2017 13:13:50 -0500 Subject: [PATCH 02/16] add the _askdashtheme function --- setup/quickbox-setup | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/quickbox-setup b/setup/quickbox-setup index b7e15b73..b76d450d 100644 --- a/setup/quickbox-setup +++ b/setup/quickbox-setup @@ -156,6 +156,7 @@ function _ask10g() { [nN] | [nN][Oo] | "" ) echo "${cyan}Who can afford that stuff anyway?${normal}" ;; *) echo "${cyan}Who can afford that stuff anyway?${normal}" ;; esac + echo } # primary partition question @@ -1184,6 +1185,7 @@ _askpartition _ask10g _askrtorrent _askdeluge +_askdashtheme _adduser _askffmpeg _denyhosts From 0817a589b39ce066b4ec4b465cfad57414a605c3 Mon Sep 17 00:00:00 2001 From: JMSolo Date: Wed, 19 Apr 2017 13:19:24 -0500 Subject: [PATCH 03/16] update support chan links to chat on dashboards --- themes/defaulted/inc/panel.menu.php | 4 ++-- themes/smoked/inc/panel.menu.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/defaulted/inc/panel.menu.php b/themes/defaulted/inc/panel.menu.php index 33f488f2..14d0b130 100644 --- a/themes/defaulted/inc/panel.menu.php +++ b/themes/defaulted/inc/panel.menu.php @@ -37,10 +37,10 @@
  • host: chat.quickbox.io
    - chan: #QuickBox.io
    + chan: #QB-Support
  • - +
  • diff --git a/themes/smoked/inc/panel.menu.php b/themes/smoked/inc/panel.menu.php index 5ed36283..1353310f 100644 --- a/themes/smoked/inc/panel.menu.php +++ b/themes/smoked/inc/panel.menu.php @@ -46,10 +46,10 @@
  • host: chat.quickbox.io
    - chan: #QuickBox.io
    + chan: #QB-Support
  • - +
  • From 857dc39ccc5da90ea0d959fc472ef863b08ceda6 Mon Sep 17 00:00:00 2001 From: JMSolo Date: Wed, 19 Apr 2017 13:52:58 -0500 Subject: [PATCH 04/16] [wip] address issues on dashboard install paths --- setup/quickbox-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/quickbox-setup b/setup/quickbox-setup index b76d450d..eaec4ba6 100644 --- a/setup/quickbox-setup +++ b/setup/quickbox-setup @@ -1145,7 +1145,7 @@ local_packages=/etc/QuickBox/packages/ local_rutorrent=/etc/QuickBox/rutorrent/ local_rplugins=/etc/QuickBox/rtplugins/ local_themes=/etc/QuickBox/themes/ -local_dashboard=/etc/QuickBox/themes/ +local_dashboard=/etc/QuickBox/themes IFACE=$(ip link show|grep -i broadcast|grep -m1 UP|cut -d: -f 2|cut -d@ -f 1|sed -e 's/ //g'); HOSTNAME1=$(hostname -s); From 0a19d3cc7196dbdf93348bbf42fa8b96c9566a1a Mon Sep 17 00:00:00 2001 From: JMSolo Date: Wed, 19 Apr 2017 14:32:54 -0500 Subject: [PATCH 05/16] [fix] address bad copy on selected theme install --- setup/quickbox-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/quickbox-setup b/setup/quickbox-setup index ec026cd6..8a422d4e 100644 --- a/setup/quickbox-setup +++ b/setup/quickbox-setup @@ -741,7 +741,7 @@ function _rutorrent-plugins() { # function to install dashboard (23) function _dashboard() { cd && mkdir -p /srv/rutorrent/home - cp -r ${local_dashboard}/${dash_theme}. /srv/rutorrent/home + cp -r ${local_dashboard}/${dash_theme}/. /srv/rutorrent/home touch /srv/rutorrent/home/db/output.log touch /srv/rutorrent/home/db/.${dash_theme}.lock } From 6a35d449107eb1d6f9211067c84cc5da1e8cdc63 Mon Sep 17 00:00:00 2001 From: JMSolo Date: Wed, 19 Apr 2017 15:26:49 -0500 Subject: [PATCH 06/16] [wip] setup needed files/functions for dashboard theme swapping --- packages/system/theme/themeSelect-defaulted | 29 +++++++++++++++++++++ packages/system/theme/themeSelect-smoked | 29 +++++++++++++++++++++ setup/templates/sudoers.template | 2 +- themes/defaulted/inc/config.php | 1 + themes/defaulted/widgets/theme_select.php | 14 ++++++++++ themes/smoked/inc/config.php | 1 + themes/smoked/widgets/theme_select.php | 14 ++++++++++ 7 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 packages/system/theme/themeSelect-defaulted create mode 100644 packages/system/theme/themeSelect-smoked create mode 100644 themes/defaulted/widgets/theme_select.php create mode 100644 themes/smoked/widgets/theme_select.php diff --git a/packages/system/theme/themeSelect-defaulted b/packages/system/theme/themeSelect-defaulted new file mode 100644 index 00000000..eaa9155a --- /dev/null +++ b/packages/system/theme/themeSelect-defaulted @@ -0,0 +1,29 @@ +#!/bin/bash +# +# [Quick Box :: Set Defaulted Theme function] +# +# QuickLab REPOS +# QuickLab _ packages : https://github.com/QuickBox/quickbox_packages +# LOCAL REPOS +# Local _ packages : /etc/QuickBox/packages +# Author : QuickBox.IO | JMSolo +# URL : https://quickbox.io +# +# QuickBox Copyright (C) 2017 QuickBox.io +# Licensed under GNU General Public License v3.0 GPL-3 (in short) +# +# You may copy, distribute and modify the software as long as you track +# changes/dates in source files. Any modifications to our software +# including (via compiler) GPL-licensed code must also be made available +# under the GPL along with build & install instructions. +# + +local_dashboard=/etc/QuickBox/themes + +rm -rf /srv/rutorrent/home/db/.smoked.lock >/dev/null 2>&1 +cp -r ${local_dashboard}/defaulted/. /srv/rutorrent/home +printf "" > /srv/rutorrent/home/db/.defaulted.lock + +#box upgrade + +service apache2 reload diff --git a/packages/system/theme/themeSelect-smoked b/packages/system/theme/themeSelect-smoked new file mode 100644 index 00000000..48ec5757 --- /dev/null +++ b/packages/system/theme/themeSelect-smoked @@ -0,0 +1,29 @@ +#!/bin/bash +# +# [Quick Box :: Set Defaulted Theme function] +# +# QuickLab REPOS +# QuickLab _ packages : https://github.com/QuickBox/quickbox_packages +# LOCAL REPOS +# Local _ packages : /etc/QuickBox/packages +# Author : QuickBox.IO | JMSolo +# URL : https://quickbox.io +# +# QuickBox Copyright (C) 2017 QuickBox.io +# Licensed under GNU General Public License v3.0 GPL-3 (in short) +# +# You may copy, distribute and modify the software as long as you track +# changes/dates in source files. Any modifications to our software +# including (via compiler) GPL-licensed code must also be made available +# under the GPL along with build & install instructions. +# + +local_dashboard=/etc/QuickBox/themes + +rm -rf /srv/rutorrent/home/db/.defaulted.lock >/dev/null 2>&1 +cp -r ${local_dashboard}/smoked/. /srv/rutorrent/home +printf "" > /srv/rutorrent/home/db/.smoked.lock + +#box upgrade + +service apache2 reload diff --git a/setup/templates/sudoers.template b/setup/templates/sudoers.template index 920367cc..d5b54ba8 100644 --- a/setup/templates/sudoers.template +++ b/setup/templates/sudoers.template @@ -17,7 +17,7 @@ Defaults env_keep -="HOME" # Cmnd alias specification Cmnd_Alias CLEANMEM = /usr/local/bin/quickbox/system/clean_mem, /proc/sys/vm/drop_caches -Cmnd_Alias SYSCMNDS = /usr/local/bin/quickbox/system/clean_log, /usr/local/bin/quickbox/system/set_interface, /usr/local/bin/quickbox/system/setdisk, /usr/local/bin/quickbox/system/showspace, /usr/local/bin/quickbox/system/updateQuickBox, /usr/local/bin/quickbox/system/lang/langSelect-*, /usr/local/bin/quickbox/system/install_ffmpeg, /usr/local/bin/quickbox/system/quickVPN, /usr/local/bin/quickbox/system/box +Cmnd_Alias SYSCMNDS = /usr/local/bin/quickbox/system/clean_log, /usr/local/bin/quickbox/system/set_interface, /usr/local/bin/quickbox/system/setdisk, /usr/local/bin/quickbox/system/showspace, /usr/local/bin/quickbox/system/updateQuickBox, /usr/local/bin/quickbox/system/lang/langSelect-*, /usr/local/bin/quickbox/system/theme/themeSelect-*, /usr/local/bin/quickbox/system/install_ffmpeg, /usr/local/bin/quickbox/system/quickVPN, /usr/local/bin/quickbox/system/box Cmnd_Alias PLUGINCMNDS = /usr/local/bin/quickbox/plugin/install/installplugin-*, /usr/local/bin/quickbox/plugin/remove/removeplugin-* Cmnd_Alias PACKAGECMNDS = /usr/local/bin/quickbox/package/install/installpackage-*, /usr/local/bin/quickbox/package/remove/removepackage-* Cmnd_Alias GENERALCMNDS = /usr/bin/ifstat, /usr/bin/vnstat, /usr/sbin/repquota, /bin/grep, /usr/bin/awk, /usr/bin/reload, /etc/init.d/apache2 restart, /usr/bin/pkill, /usr/bin/killall, /bin/sed, /bin/systemctl diff --git a/themes/defaulted/inc/config.php b/themes/defaulted/inc/config.php index db0d8a52..3d2e94f7 100644 --- a/themes/defaulted/inc/config.php +++ b/themes/defaulted/inc/config.php @@ -407,6 +407,7 @@ function isEnabled($process, $username){ include ($_SERVER['DOCUMENT_ROOT'].'/widgets/plugin_data.php'); include ($_SERVER['DOCUMENT_ROOT'].'/widgets/package_data.php'); include ($_SERVER['DOCUMENT_ROOT'].'/widgets/sys_data.php'); +include ($_SERVER['DOCUMENT_ROOT'].'/widgets/theme_select.php'); $base = 1024; $location = "/home"; diff --git a/themes/defaulted/widgets/theme_select.php b/themes/defaulted/widgets/theme_select.php new file mode 100644 index 00000000..54c6bbe2 --- /dev/null +++ b/themes/defaulted/widgets/theme_select.php @@ -0,0 +1,14 @@ + diff --git a/themes/smoked/inc/config.php b/themes/smoked/inc/config.php index 92c3dcb3..359e76ac 100644 --- a/themes/smoked/inc/config.php +++ b/themes/smoked/inc/config.php @@ -407,6 +407,7 @@ function isEnabled($process, $username){ include ($_SERVER['DOCUMENT_ROOT'].'/widgets/plugin_data.php'); include ($_SERVER['DOCUMENT_ROOT'].'/widgets/package_data.php'); include ($_SERVER['DOCUMENT_ROOT'].'/widgets/sys_data.php'); +include ($_SERVER['DOCUMENT_ROOT'].'/widgets/theme_select.php'); $base = 1024; $location = "/home"; diff --git a/themes/smoked/widgets/theme_select.php b/themes/smoked/widgets/theme_select.php new file mode 100644 index 00000000..54c6bbe2 --- /dev/null +++ b/themes/smoked/widgets/theme_select.php @@ -0,0 +1,14 @@ + From d35c2bc9f9732f8a366632d9d3f5ccc60c63c5bf Mon Sep 17 00:00:00 2001 From: JMSolo Date: Wed, 19 Apr 2017 15:58:33 -0500 Subject: [PATCH 07/16] add theme switches to dashboard --- themes/defaulted/db/branding-m.php | 6 ++++++ themes/smoked/db/branding-m.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/themes/defaulted/db/branding-m.php b/themes/defaulted/db/branding-m.php index 349cf14b..978653bf 100644 --- a/themes/defaulted/db/branding-m.php +++ b/themes/defaulted/db/branding-m.php @@ -1,5 +1,11 @@