Skip to content

Commit

Permalink
v6.22 (#2611)
Browse files Browse the repository at this point in the history
Beta v6.22.0
  • Loading branch information
MichaIng authored Mar 10, 2019
2 parents cec1f42 + dad12fc commit eb1bff6
Show file tree
Hide file tree
Showing 60 changed files with 2,754 additions and 2,852 deletions.
4 changes: 2 additions & 2 deletions .conf/dps_128/mpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ pid_file "/var/run/mpd/pid"
state_file "/mnt/dietpi_userdata/.mpd_cache/state"
sticker_file "/mnt/dietpi_userdata/.mpd_cache/sticker.sql"

user "mpd"
group "dietpi"
#user "mpd" #Set via service to allow for mpd user to use assigned groups "audio" and "dietpi"
#group "dietpi" #Set via service to allow for mpd user to use assigned groups "audio" and "dietpi"

bind_to_address "localhost"

Expand Down
42 changes: 24 additions & 18 deletions .conf/dps_6/xorg_xu4.conf
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
Section "Device"
# X.Org X server configuration file for xf86-video-armsoc-odroid

Identifier "Mali-Fbdev"
Section "Device"
Identifier "Mali-Fbdev"
Driver "armsoc"
Option "fbdev" "/dev/fb0"
Option "Debug" "false"
Option "fbdev" "/dev/fb0"
Option "Debug" "false"
Option "DPMS" "false"
Option "Fimg2DExa" "true"
Option "DRI2" "true"
Option "DRI2_PAGE_FLIP" "false"
# Option "Fimg2DExaSolid" "false"
# Option "Fimg2DExaCopy" "false"
Option "Fimg2DExaComposite" "true"
Option "SWcursorLCD" "false"

Option "NoFlip" "true"
Option "NoHardwareMouse" "true"
Option "NoG2D" "false"
EndSection

Section "Screen"

Identifier "Default Screen"
Device "Mali-Fbdev"
DefaultDepth 24

Identifier "Default Screen"
Device "Mali-Fbdev"
DefaultDepth 24
EndSection

Section "DRI"

Mode 0666
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS" "Off"
EndSection

## disable automatic HDMI turn off
Section "ServerLayout"
Identifier "DefaultLayout"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection
5 changes: 4 additions & 1 deletion .conf/dps_65/netdata.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
[Unit]
Description=Real time performance monitoring

# Pull in non-static network-online.target
Wants=network-online.target

# append here other services you want netdata to wait for them to start
After=network-online.target httpd.service squid.service nfs-server.service mysqld.service mysql.service named.service postfix.service chronyd.service
After=network-online.target httpd.service squid.service nfs-server.service mysqld.service mysql.service mariadb.service named.service postfix.service chronyd.service

[Service]
Type=simple
Expand Down
2 changes: 1 addition & 1 deletion .conf/dps_85/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ http {

charset utf-8;

# + Nginx - To avoid 2MB upload error: https://github.com/Fourdee/DietPi/issues/546
# + Nginx - To avoid 2MB upload error: https://github.com/MichaIng/DietPi/issues/546
client_max_body_size 2000M;

# Upstream to abstract back-end connection(s) for PHP
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ about: Suggest an idea for this project
#### Additional context
<!-- Add any other context or screenshots about the feature request here.-->
- ...

#### Vote for this feature on FeatHub: https://feathub.com/MichaIng/DietPi/
<!-- Optional: Add your request to our FeatHub page as well and replace the above link accordinly.-->
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/image_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ about: Suggest a new SBC to be added to the offial support and image list of Die
#### If not, are there install instructions for Debian available?
<!-- EG: https://github.com/drtyhlpr/rpi23-gen-image/https://github.com/Debian/raspi3-image-spec -->
- ...

#### Vote for this iamge on FeatHub: https://feathub.com/MichaIng/DietPi/
<!-- Optional: Add your request to our FeatHub page as well and replace the above link accordinly.-->
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/software_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ about: Suggest a software title to be added to DietPi-Software
#### Are you willing to help maintaining the software installation, e.g. in case of needed setup changes due to updates etc.? This is not needed, but could speed up our decision to implement it, as man power is always a topic :wink:.
<!-- EG: Yes, I could help out with this, e.g. if I experience issues. / Sorry, I am totally unexperienced in bash coding. -->
- ...

#### Vote for this software on FeatHub: https://feathub.com/MichaIng/DietPi/
<!-- Optional: Add your request to our FeatHub page as well and replace the above link accordinly.-->
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--
Before submitting a pull request:
- Please ensure the target branch is "dev" (active development): https://github.com/Fourdee/DietPi/tree/dev
- Please ensure the target branch is "dev" (active development): https://github.com/MichaIng/DietPi/tree/dev
- Please ensure changes have been tested and verified functional.
-->
**Status**: WIP | Testing | Ready | ?
- [ ] Example task 1

**Reference**: https://github.com/Fourdee/DietPi/issues/XXXX
**Reference**: https://github.com/MichaIng/DietPi/issues/XXXX

**Commit list/description**:
<!--
Expand Down
47 changes: 19 additions & 28 deletions .meta/dietpi-cloud-migration
Original file line number Diff line number Diff line change
@@ -1,79 +1,70 @@
#!/bin/bash

(( $UID )) && echo -e '[\e[31mFAILED\e[0m] Root privileges required. Please run the command with "sudo".\n' && exit 1
(( $UID )) && echo -e '[\e[31mFAILED\e[0m] Root privileges required. Please run the script with "sudo".\n' && exit 1
echo -e '[\e[32m OK \e[0m] Root privileges verified.'

apt-get install -y rsync
(( $? )) && echo -e '[\e[31mFAILED\e[0m] Installation of rsync failed. Please check your internet connection, proper apt-get function or try to install it manually: "apt-get install -y rsync"\n' && exit 1
! apt-get install -y rsync && echo -e '[\e[31mFAILED\e[0m] "rsync" install failed. Please check your internet connection, proper apt-get function or try to install it manually: "apt-get install -y rsync"\n' && exit 1
echo -e '[\e[32m OK \e[0m] Successfully installed rsync.'

run_backup(){

echo '[ INFO ] Enabling maintenance mode...'
sudo -u www-data php /var/www/$1/occ maintenance:mode --on
(( $? )) && echo -e '[\e[31mFAILED\e[0m] Could not enable maintenance mode, please check running state of your instance and PHP functionality.\n' && exit 1

fp_config="/var/www/$1/config/config.php"

echo "[ INFO ] Scanning $fp_config for necessary information..."
[[ ! -f $fp_config ]] && echo -e "[\e[31mFAILED\e[0m] File $fp_config not found, please check your installation.\n" && exit 1
echo '[ INFO ] Enabling maintenance mode...'
! sudo -u www-data php /var/www/$1/occ maintenance:mode --on && echo -e '[\e[31mFAILED\e[0m] Could not enable maintenance mode, please check running state of your instance and PHP functionality.\n' && exit 1

local fp_datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" $fp_config | mawk '{print $3}' | sed "s/[',]//g")
local dbname=$(grep -m1 "^[[:blank:]]*'dbname'" $fp_config | mawk '{print $3}' | sed "s/[',]//g")
local dbhost=$(grep -m1 "^[[:blank:]]*'dbhost'" $fp_config | mawk '{print $3}' | sed "s/[',]//g")
local dbuser=$(grep -m1 "^[[:blank:]]*'dbuser'" $fp_config | mawk '{print $3}' | sed "s/[',]//g")
local dbpass=$(grep -m1 "^[[:blank:]]*'dbpassword'" $fp_config | mawk '{print $3}' | sed "s/[',]//g")
echo "[ INFO ] Scanning $fp_config for necessary information..."
local fp_datadir=$(grep -m1 "^[[:blank:]]*'datadirectory'" $fp_config | cut -d \' -f 4)
local dbname=$(grep -m1 "^[[:blank:]]*'dbname'" $fp_config | cut -d \' -f 4)
local dbhost=$(grep -m1 "^[[:blank:]]*'dbhost'" $fp_config | cut -d \' -f 4)
local dbuser=$(grep -m1 "^[[:blank:]]*'dbuser'" $fp_config | cut -d \' -f 4)
local dbpass=$(grep -m1 "^[[:blank:]]*'dbpassword'" $fp_config | cut -d \' -f 4)
echo -e " - data directory: $fp_datadir
- database name: $dbname
- database hostname: $dbhost
- database username: $dbuser
- database password: $dbpass"

echo '[ INFO ] Backup database to data directory...'
mysqldump -u"$dbuser" -h"$dbhost" -p"$dbpass" "$dbname" > "$fp_datadir"/dietpi-$1-database-backup.sql
(( $? )) && echo -e '[\e[31mFAILED\e[0m] Database backup seems to have failed. Check state of your database server, check logs and in case repair table corruptions.\n' && exit 1
! mysqldump -u"$dbuser" -h"$dbhost" -p"$dbpass" "$dbname" > "$fp_datadir"/dietpi-$1-database-backup.sql && echo -e '[\e[31mFAILED\e[0m] Database backup failed, please check state of your database server, check logs and in case repair table corruptions.\n' && exit 1
echo -e "[\e[32m OK \e[0m] Successfully finished database backup to: $fp_datadir/dietpi-$1-database-backup.sql"

echo '[ INFO ] Backup installation folder to data directory...'
rsync -aHp --delete /var/www/$1/ "$fp_datadir"/dietpi-$1-installation-backup
(( $? )) && echo -e '[\e[31mFAILED\e[0m] Rsync failed, check for error reasons and try again.\n' && exit 1
! rsync -aHp --delete /var/www/$1/ "$fp_datadir"/dietpi-$1-installation-backup && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.\n' && exit 1
echo -e "[\e[32m OK \e[0m] Successfully finished installation backup to: $fp_datadir/dietpi-$1-installation-backup/"

if [[ $2 ]]; then

echo '[ INFO ] You provided an additional backup location. Moving data directory...'
[[ ! -d $2 ]] && echo -e "[\e[31mFAILED\e[0m] $2 is no directory, please check spelling and mount status of your desired backup location.\n" && exit 1
[[ ! -d $2 ]] && echo -e "[\e[31mFAILED\e[0m] $2 is no existing directory, please check spelling and mount status of your desired backup drive.\n" && exit 1

rsync -aHp --delete "$fp_datadir"/ "$2"
(( $? )) && echo -e '[\e[31mFAILED\e[0m] Rsync failed, check for error reasons and try again.\n' && exit 1
! rsync -aHp --delete "$fp_datadir"/ "$2" && echo -e '[\e[31mFAILED\e[0m] "rsync" failed, please check for error reasons and try again.\n' && exit 1
echo -e "[\e[32m OK \e[0m] Successfully synced data directory to: $2"

else

echo '[ INFO ] You did not provide an additional backup location. We assume your data directory is already on an external drive, ready for migration? If not, move it there or rerun this script, providing the external backup location as argument.'
echo '[ INFO ] You did not provide an additional backup location. We assume your data directory is already on an external drive, ready for migration? If not, move it there, or, rerun this script with the desired external backup path as argument.'

fi

echo -e "[\e[32m OK \e[0m] Backup successfully completed. On destination server, please move the whole data directory to the one, provided within /DietPi/dietpi.txt (default: \"/mnt/dietpi_userdata/$1_data\"), or create a symlink from there. On reinstallation, DietPi-Software will check this location for backups and in case automatically restore them."
echo -e "[\e[32m OK \e[0m] Backup successfully completed. On destination server, please move the whole data directory to the one, provided within /DietPi/dietpi.txt (default: \"/mnt/dietpi_userdata/$1_data\"), or create a symlink from there. On reinstall, DietPi-Software will check this location for backups and in case automatically restore them."

}

### MAIN ###

[[ ! -f /DietPi/dietpi/.installed ]] && echo -e '[\e[31mFAILED\e[0m] No proper DietPi installation found or DietPi-RamDisk is not running. Please ensure you are executing this script from a functional DietPi system and "dietpi-ramdisk" is up.\n' && exit 1

if grep -q 'aSOFTWARE_INSTALL_STATE\[47\]=2' /DietPi/dietpi/.installed; then
if [[ -f /var/www/owncloud/config/config.php ]]; then

echo '[ INFO ] ownCloud installation found, preparing backup...'
run_backup owncloud "$1"

fi

if grep -q 'aSOFTWARE_INSTALL_STATE\[114\]=2' /DietPi/dietpi/.installed; then
if [[ -f /var/www/nextcloud/config/config.php ]]; then

echo '[ INFO ] Nextcloud installation found, preparing backup...'
run_backup nextcloud "$1"

fi

[[ ! $fp_config ]] && echo -e "[\e[31mFAILED\e[0m] No ownCloud or Nextcloud installation found. Please verify that it was installed via dietpi-software, in case reinstall it, non of your existing data/settings will be overwritten.\n" && exit 1
[[ ! $fp_config ]] && echo -e '[\e[31mFAILED\e[0m] No ownCloud or Nextcloud instance found at /var/www/owncloud|nextcloud. Aborting...\n' && exit 1
52 changes: 16 additions & 36 deletions .meta/dietpi-fan_control
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS.
INPUT=0
if [[ $@ ]]; then

if G_CHECK_VALIDINT "$@"; then
if disable_error=1 G_CHECK_VALIDINT "$@"; then

INPUT=$@

Expand Down Expand Up @@ -97,7 +97,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS.

done
# - Remove leading white space
TRIP_TEMPS_CURRENT="${TRIP_TEMPS_CURRENT# }"
TRIP_TEMPS_CURRENT=${TRIP_TEMPS_CURRENT# }

# - Read current trip point fan speeds
TRIP_SPEEDS_CURRENT=''
Expand All @@ -109,7 +109,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS.

done
# - Remove leading white space
TRIP_SPEEDS_CURRENT="${TRIP_SPEEDS_CURRENT# }"
TRIP_SPEEDS_CURRENT=${TRIP_SPEEDS_CURRENT# }

# - Read current static fan speed
# - Convert 0-255 to 0-100%
Expand All @@ -122,11 +122,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS.
# - $TRIP_TEMPS='XX YY ZZ'; XX°C YY°C ZZ°C
# - $TRIP_SPEEDS='AAA BBB CCC DDD'; AAA*100/255 %...
# - $STATIC_SPEED=EEE; EEE*100/255 %
Read_Settings(){

. $FP_SETTINGS

}
Read_Settings(){ . $FP_SETTINGS; }

# Verify valid settings, before applying
Verify_Settings(){
Expand All @@ -153,7 +149,7 @@ dietpi-fan_control 1 => Non-interactively apply settings from $FP_SETTINGS.
elif (( ! $TEMP_CONTROLLED )); then

# - $STATIC_SPEED is expected to be an integer.
if ! G_CHECK_VALIDINT $STATIC_SPEED; then
if ! disable_error=1 G_CHECK_VALIDINT $STATIC_SPEED; then

G_DIETPI-NOTIFY 1 "Invalid setting: \$STATIC_SPEED=$STATIC_SPEED"
return 1
Expand Down Expand Up @@ -236,7 +232,7 @@ _EOF_

done
# - Remove leading white space
trip_speeds_target="${trip_speeds_target# }"
trip_speeds_target=${trip_speeds_target# }
echo "$trip_speeds_target" > $FP_TRIP_SPEEDS

else
Expand Down Expand Up @@ -266,49 +262,33 @@ _EOF_

Temps_Menu(){

G_WHIP_DEFAULT_ITEM="$TRIP_TEMPS"
G_WHIP_DEFAULT_ITEM=$TRIP_TEMPS
G_WHIP_INPUTBOX "Please enter $TRIP_POINT_COUNT space-separated temperature points in °C.
EG: To have trip points at 35°C, 50°C and 65°C, enter\n \"35 50 65\""
if (( ! $? )); then

TRIP_TEMPS="$G_WHIP_RETURNED_VALUE"

fi
EG: To have trip points at 35°C, 50°C and 65°C, enter\n \"35 50 65\"" && TRIP_TEMPS=$G_WHIP_RETURNED_VALUE

}

Speeds_Menu(){

G_WHIP_DEFAULT_ITEM="$TRIP_SPEEDS"
G_WHIP_DEFAULT_ITEM=$TRIP_SPEEDS
G_WHIP_INPUTBOX "Please enter $(( $TRIP_POINT_COUNT + 1 )) space-separated fan speeds in % (percent) of the maximum possible speed.
EG: To disable the fan below $(( $(<$FP_TRIP_TEMPS) / 1000 ))°C, run it at 45% above, 70% after reaching $(( $(<${FP_TRIP_TEMPS/0_temp/1_temp}) / 1000 ))°C and 95% above $(( $(<${FP_TRIP_TEMPS/0_temp/2_temp}) / 1000 ))°C, enter
\"0 45 70 95\""
if (( ! $? )); then

TRIP_SPEEDS="$G_WHIP_RETURNED_VALUE"

fi
\"0 45 70 95\"" && TRIP_SPEEDS=$G_WHIP_RETURNED_VALUE

}

Static_Speed_Menu(){

G_WHIP_DEFAULT_ITEM="$STATIC_SPEED"
G_WHIP_DEFAULT_ITEM=$STATIC_SPEED
G_WHIP_INPUTBOX "Please enter the desired static fan speeds in % (percent) of the maximum possible speed.
EG: To run the fan at 50%, enter\n \"60\""
if (( ! $? )); then

STATIC_SPEED="$G_WHIP_RETURNED_VALUE"

fi
EG: To run the fan at 50%, enter\n \"60\"" && STATIC_SPEED=$G_WHIP_RETURNED_VALUE

}

Reboot_Menu(){

G_WHIP_BUTTON_CANCEL_TEXT='Later'
G_WHIP_YESNO 'Reboot now?\n\nThe system default fan controls are automatically applied after next reboot. Do you want to reboot now?'
if (( ! $? )); then
if G_WHIP_YESNO 'Reboot now?\n\nThe system default fan controls are automatically applied after next reboot. Do you want to reboot now?'; then

reboot
exit 0
Expand Down Expand Up @@ -372,7 +352,7 @@ EG: To run the fan at 50%, enter\n \"60\""
if (( $TEMP_CONTROLLED )); then

# - Trip point temperature settings
TRIP_TEMPS="${TRIP_TEMPS:-$TRIP_TEMPS_CURRENT}"
TRIP_TEMPS=${TRIP_TEMPS:-$TRIP_TEMPS_CURRENT}
local trip_temps_text=''
for i in $TRIP_TEMPS
do
Expand All @@ -383,7 +363,7 @@ EG: To run the fan at 50%, enter\n \"60\""
G_WHIP_MENU_ARRAY+=( 'Temp points' "Selected: $trip_temps_text" )

# - Trip point speed settings
TRIP_SPEEDS="${TRIP_SPEEDS:-$TRIP_SPEEDS_CURRENT}"
TRIP_SPEEDS=${TRIP_SPEEDS:-$TRIP_SPEEDS_CURRENT}
local trip_speeds_text=''
for i in $TRIP_SPEEDS
do
Expand Down Expand Up @@ -482,7 +462,7 @@ EG: To run the fan at 50%, enter\n \"60\""
# Read settings file, to generate menu entries and use current settings as default.
[[ -f $FP_SETTINGS ]] && Read_Settings

while true
while :
do

Main_Menu
Expand Down
Loading

0 comments on commit eb1bff6

Please sign in to comment.