QuickBox Pro – v0.6.5

[vc_row][vc_column width=”1/6″][/vc_column][vc_column width=”2/3″][vc_column_text][alert title=”Release” style=”grey”]This is an archive article – There is a newer release[/alert] This is a very large update that has been a complete rewrite to the core application package system. There are many fixes and exciting adjustments that will help stage additional functionality to future versions.
IMPORTANT NOTICE ABOUT THIS UPDATE: This update contains a massive overhaul to the core application delivery method. It not only alters how the apps are built, it additionally consists of moving logs to the database. The System Response output is now fed through the database, thus making php timeouts a non-issue on installing applications. With this comes some pains it would seem. The updater may be blank during your update, give it about 2 minutes (just to be on the safe side) to be blank/update in the background, then do a refresh of your browser. You will see that you are now on the current version. Some users are experiencing issues wherein the System Response table is not being built, if you are one of those users, please follow the instructions below.

But first, the updater has been retooled. Let’s summarize all this into one easy solution.

In the command below, just copy and paste it in your shell as root. You can do sudo su to become root. Also, if your database is named something other than qbpro_db1, you’ll need to change that in the command below.
cd /root
wget https://lab.quickbox.io/QuickBox/Pro/raw/master/bin/updateQuickBox
chmod +x updateQuickBox

database=qbpro_db1

sudo mysql -sN ${database} <<<"UPDATE configuration SET config_value = 'v0.6.4' WHERE configuration.config_name = 'Version';"
Now wait for about 15 seconds and run the below command:
./updateQuickBox
 

The long end of things…

First, grab your database connection fields in /root/.quickbox/db_access_file The fields will be like the following:
dbuser=USERNAME
dbpass=PASSWORD
dbpasswd=PASSWORD
database=DATABASE
Then copy and paste the following, making sure to fill in the database fields, ex; dbuser= etc.
dbuser=
dbpass=
dbpasswd=
database=

db=${database};
  table=system_response;
  col=app_log;
  colrunner=$(mysql -N -s -u ${dbuser} -p${dbpass} ${db} <<<"select ${col} from ${table} where ${col}='1';");
  if [ "$colrunner" == 'app_log' ]; then
    echo "'System Response' Table exists! ..."
  else
    sudo mysql -sN -h localhost -u ${dbuser} -p${dbpass} ${database} <<<"CREATE TABLE ${table} ( ${col} VARCHAR(800) CHARACTER SET utf8 COLLATE utf8_general_ci NULL , PRIMARY KEY (${col}(800))) ENGINE = InnoDB;"
  fi
This should build the required table for the system response modal   There is an additional issue that some users are facing and it’s apps suddenly vanishing from the dashboard. This is once again due to the application delivery core rewrite. To solve this, simply copy and paste the following (replacing admin=USERNAME with your own username.
admin=USERNAME

app_array='btsync couchpotato emby flood headphones jackett lidarr medusa nextcloud novnc
  nzbget nzbhydra ombi plex pyload quassel radarr rapidleech sabnzbd sickgear sickrage sonarr
  subsonic syncthing tautulli transmission'
  for app in $app_array; do
    if [[ -f /install/.$app.lock ]]; then
      mv /install/.$app.lock /install/.$admin.$app.lock
    fi
  done

To update your sudoers file:

cat > /etc/sudoers.d/dashboard <<SUD
#secure_path="/bin/su:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin/quickbox/*:/etc/QuickBox/*"
#
#Defaults  env_keep -="HOME"

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias   CLEANMEM = /usr/local/bin/quickbox/system/clean_mem
Cmnd_Alias   CLEANLOG = /usr/local/bin/quickbox/system/clean_log
Cmnd_Alias   SYSCMNDS = /usr/local/bin/quickbox/system/*, /usr/local/bin/quickbox/system, /usr/local/bin/quickbox/system/theme/*, /usr/local/bin/quickbox/system/lang/*, /usr/local/bin/quickbox/system/updateQuickBox, /usr/local/bin/quickbox/system/updateNotice
Cmnd_Alias   PKGCMNDS = /usr/local/bin/quickbox/apps/*, /usr/local/bin/quickbox/apps
Cmnd_Alias   PLUGINCMNDS = /usr/local/bin/quickbox/apps/extras/rutorrent/plugins/install/installplugin-*, /usr/local/bin/quickbox/apps/extras/rutorrent/plugins/remove/removeplugin-*
Cmnd_Alias   GENERALCMNDS = /usr/sbin/repquota, /bin/systemctl, /root/acme.sh/acme.sh, /root/.my.cnf, /usr/sbin/service php7.2-fpm reload, /usr/sbin/service php7.2-fpm restart, /usr/bin/mysql, /sbin/ip route get 8.8.8.8

www-data     ALL = (ALL) NOPASSWD: CLEANMEM, CLEANLOG, SYSCMNDS, PKGCMNDS, PLUGINCMNDS, GENERALCMNDS

SUD
  
cat > /etc/sudoers.d/secure_path <<SSP
Defaults    secure_path = /bin/su:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin/quickbox/*:/usr/local/bin/quickbox/apps/*:/usr/local/bin/quickbox/system/*:/usr/local/bin/quickbox/apps/extras/rutorrent/plugins/install:/usr/local/bin/quickbox/apps/extras/rutorrent/plugins/remove

SSP
 

To update your dashboard:

QB_SETUP=/etc/QuickBox/setup/

local_setup=/etc/QuickBox/setup/
local_rtplugins=/usr/local/bin/quickbox/bin/apps/extras/rutorrent/plugins/
local_dashboard=/etc/QuickBox/dashboard/
local_themes=/etc/QuickBox/dashboard/themes/

quickbox=/srv/quickbox/
rutorrent=/srv/rutorrent/
usrbin=/usr/local/bin/

cd ${quickbox}
  rm -rf /srv/quickbox/db/.smoked.lock
  rm -rf /srv/quickbox/db/.defaulted.lock
  if [[ -f /srv/quickbox/db/.theme_smoked.lock ]]; then
    rm -rf /srv/quickbox/db/theme_defaulted.lock
    rsync -aP --exclude=branding-l.php --exclude=share.php --exclude=custom.menu.php --exclude=output.log --exclude=url.override.php --exclude=custom.css --exclude=constants.php --exclude=install --exclude=lib/nav ${local_dashboard}* ${quickbox}
    rsync -aP ${local_themes}smoked/* ${quickbox}
    \cp -fR  ${local_themes}smoked/js/plugins/ajaxDataCharts/* js/plugins/ajaxDataCharts
    \cp -fR  ${local_themes}smoked/js/plugins/gauge/* js/plugins/gauge
    sed -i -r 's/theme_defaulted.css/theme_smoked.css/g' /srv/quickbox/dash_header.php
    elif [[ -f /srv/quickbox/db/.theme_defaulted.lock ]]; then
    rm -rf /srv/quickbox/db/.theme_smoked.lock
    rsync -aP --exclude=branding-l.php --exclude=share.php --exclude=custom.menu.php --exclude=output.log --exclude=url.override.php --exclude=custom.css --exclude=constants.php --exclude=install --exclude=lib/nav ${local_dashboard}* ${quickbox}
    rsync -aP ${local_themes}defaulted/* ${quickbox}
    \cp -fR  ${local_themes}defaulted/js/plugins/ajaxDataCharts/* js/plugins/ajaxDataCharts
    \cp -fR  ${local_themes}defaulted/js/plugins/gauge/* js/plugins/gauge
    sed -i -r 's/theme_smoked.css/theme_defaulted.css/g' /srv/quickbox/dash_header.php
  fi

find /usr/local/bin/quickbox -type f -exec chmod 755 {} \;
  chmod +x $(find /usr/local/bin/quickbox -type f) >/dev/null 2>&1
  chown www-data:www-data -R /srv/quickbox
  chmod 755 /srv/quickbox
  chgrp -R www-data /srv/quickbox
  chmod -R g+rw /srv/quickbox
  find /srv/quickbox -type d -exec chmod 755 {} +
  find /srv/quickbox -type f -exec chmod 664 {} +
  sh -c 'find /srv/quickbox/* -type d -print0 | sudo xargs -0 chmod g+s'
[/vc_column_text][/vc_column][vc_column width=”1/6″][/vc_column][/vc_row][vc_row][vc_column width=”1/12″][/vc_column][vc_column width=”5/6″][vc_empty_space height=”30px”][vc_column_text][supsystic-tables id=4][/vc_column_text][vc_empty_space height=”30px”][/vc_column][vc_column width=”1/12″][/vc_column][/vc_row]