Skip to content

Commit

Permalink
v6.27
Browse files Browse the repository at this point in the history
+ DietPi-Software | Allo web GUI: Resolve access permission issues
  • Loading branch information
MichaIng authored Dec 17, 2019
1 parent 4b7e7ec commit 61ccd94
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it

aSOFTWARE_NAME[$software_id]='Allo'
aSOFTWARE_DESC[$software_id]='web interface'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
#aSOFTWARE_ONLINEDOC_URL[$software_id]
aSOFTWARE_REQUIRES_ALSA[$software_id]=1
aSOFTWARE_REQUIRES_WEBSERVER[$software_id]=1
Expand All @@ -744,8 +744,8 @@ DietPi-Software will decrypt and use it for software installs. You can change it

aSOFTWARE_NAME[$software_id]='Allo_update'
aSOFTWARE_DESC[$software_id]='quick reinstall/update web only'
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
aSOFTWARE_TYPE[$software_id]=-1
aSOFTWARE_CATEGORY_INDEX[$software_id]=2
#aSOFTWARE_ONLINEDOC_URL[$software_id]
#------------------
software_id=163
Expand Down Expand Up @@ -11822,22 +11822,24 @@ _EOF_
Banner_Configuration

# Create allo user for GUI
local usercmd='useradd -mU'
local usercmd='useradd -MU'
getent passwd allo &> /dev/null && usercmd='usermod -a'
$usercmd -G www-data -p 'allo' -s /bin/bash allo
# - Create home dir separately to avoid skeleton creation
mkdir -p /home/allo
# - Grant sudo permissions
echo 'allo ALL=NOPASSWD: ALL' > /etc/sudoers.d/allo

# Always Drop DB, and, recreate it, due to error issue with reinstall over the top.
mysqladmin drop allo_db -f &> /dev/null
mysql -e 'drop user allo_db@localhost' &> /dev/null

/DietPi/dietpi/func/create_mysql_db allo_db allo_db "$GLOBAL_PW"
/DietPi/dietpi/func/create_mysql_db allo_db allo_db dietpi
mysql allo_db < /var/www/allo_db.sql
[[ -f '/var/www/allo_db.sql' ]] && rm /var/www/allo_db.sql
rm /var/www/allo_db.sql

# Redirect to web interface by default:
rm -f /var/www/index.htm*
rm -f /var/www/index\.*
cat << _EOF_ > /var/www/index.php
<?php
/* Redirect to allo web interface */
Expand All @@ -11849,11 +11851,15 @@ exit;
?>
_EOF_

# Permissions
chown -R www-data:www-data /var/www/allo
chmod 770 -R /var/www/allo

# HW specific changes
# - SPARKY ONLY - Auto detect eth adapter
if (( $G_HW_MODEL == 70 )); then

# - Disable onboard ETH if adapter found
# Disable onboard ETH if adapter found
cat << _EOF_ > /etc/systemd/system/sparky_eth_controller.service
[Unit]
Description=Sparky auto detect and set onboard ETH/USB ETH (DietPi)
Expand Down Expand Up @@ -11893,7 +11899,7 @@ _EOF_

fi

# - Allow for quick updates with 160 reinstall
# Allow for quick updates with 160 reinstall
aSOFTWARE_INSTALL_STATE[160]=2

fi
Expand Down

0 comments on commit 61ccd94

Please sign in to comment.