From 88efc08a08c2414570dca43b6f0c41bec1cd5d50 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 13 Oct 2017 15:04:43 +0200 Subject: [PATCH 01/43] WORK IN PROCESS: Move PHP settings from webserver to PHP config files ...as e.g. enabling caching for CLI has no effect inside webserver config, which is not asked by CLI requests, e.g. by cron. We just leave the critical opcache size inside webserver config, in case hard coding 128M, so this will not allow other web services to full the cache and cause swapping. --- dietpi/dietpi-software | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7dfd68eb28..7b527b78d1 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8591,8 +8591,19 @@ _EOF_ phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif fi - - #Create Nextcloud specific webserver + PHP config. + + # APCu configuration: To prevent cli (cron.php) producing Nextcloud log [info] entry. + grep -q 'apc.enable_cli=' $FP_PHP_BASE_DIR/mods-available/apcu.ini && sed -i '/apc.enable_cli=/c\apc.enable_cli=1' $FP_PHP_BASE_DIR/mods-available/apcu.ini || echo 'apc.enable_cli=1' >> $FP_PHP_BASE_DIR/mods-available/apcu.ini + + # OPCache configuration: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html?highlight=opcache#enable-php-opcache + grep -q 'opcache.enable=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.enable=/c\opcache.enable=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.enable=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.enable_cli=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.enable_cli=/c\opcache.enable_cli=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.enable_cli=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.interned_strings_buffer=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.interned_strings_buffer=/c\opcache.interned_strings_buffer=8' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.interned_strings_buffer=8' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.max_accelerated_files=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.max_accelerated_files=/c\opcache.max_accelerated_files=10000' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.max_accelerated_files=10000' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.save_comments=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.save_comments=/c\opcache.save_comments=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.save_comments=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + grep -q 'opcache.revalidate_freq=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.revalidate_freq=/c\opcache.revalidate_freq=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.revalidate_freq=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini + + #Create Nextcloud specific webserver config. #Apache: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then @@ -8611,31 +8622,9 @@ Alias /nextcloud "/var/www/nextcloud/" SetEnv HOME /var/www/nextcloud SetEnv HTTP_HOME /var/www/nextcloud - # OPCache configuration: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html?highlight=opcache#enable-php-opcache - #php_admin_value opcache.enable 1 defaults anyway and isn't possible here: http://php.net/manual/en/opcache.configuration.php#ini.opcache.enable - php_admin_value opcache.enable_cli 1 - php_admin_value opcache.interned_strings_buffer 8 - php_admin_value opcache.max_accelerated_files 10000 - php_admin_value opcache.memory_consumption $(( $RAM_TOTAL / 10 )) - php_admin_value opcache.save_comments 1 - php_admin_value opcache.revalidate_freq 1 - - # MySQL/MariaDB configuration: https://docs.nextcloud.com/server/12/admin_manual/configuration_database/linux_database_configuration.html#configuring-a-mysql-or-mariadb-database - php_admin_value mysql.allow_local_infile 1 - php_admin_value mysql.allow_persistent 1 - php_admin_value mysql.cache_size 2000 - php_admin_value mysql.max_persistent -1 - php_admin_value mysql.max_links -1 - php_admin_value mysql.default_port 0 - php_admin_value mysql.default_socket /var/run/mysqld/mysqld.sock - #php_admin_value mysql.default_host - #php_admin_value mysql.default_user - #php_admin_value mysql.default_password - php_admin_value mysql.connect_timeout 60 - php_admin_value mysql.trace_mode 0 - # APCu configuration: To prevent cron.php produce Nextcloud log [info] entry. - php_admin_value apc.enable_cli 1 + #Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. + php_admin_value opcache.memory_consumption 128 _EOF_ From 62f37a95f61c574aff57621284fecd9cfde01ede Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 13 Oct 2017 16:07:24 +0200 Subject: [PATCH 02/43] Adjust also for Nginx --- dietpi/dietpi-software | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7b527b78d1..7a4fab420c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8622,8 +8622,7 @@ Alias /nextcloud "/var/www/nextcloud/" SetEnv HOME /var/www/nextcloud SetEnv HTTP_HOME /var/www/nextcloud - - #Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. + # Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. php_admin_value opcache.memory_consumption 128 @@ -8677,7 +8676,7 @@ location ^~ /nextcloud { fastcgi_param REMOTE_USER \$remote_user; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_intercept_errors on; - # Disable because Jessie Nginx does not support that parameter + # Disable because Jessie Nginx does not support that parameter #fastcgi_request_buffering off; } @@ -8707,17 +8706,8 @@ location ^~ /nextcloud { access_log off; } - # Setting PHP values by using this method: http://php.net/manual/en/install.fpm.configuration.php Example #2 - # OPCache configuration: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html?highlight=opcache#enable-php-opcache - # APCu configuration: To prevent cron.php produce Nextcloud log [info] entry. - #"opcache.enable=1" defaults anyway and isn't possible here: http://php.net/manual/en/opcache.configuration.php#ini.opcache.enable - fastcgi_param PHP_ADMIN_VALUE "opcache.enable_cli=1 - opcache.interned_strings_buffer=8 - opcache.max_accelerated_files=10000 - opcache.memory_consumption=$(( $RAM_TOTAL / 10 )) - opcache.save_comments=1 - opcache.revalidate_freq=1 - apc.enable_cli=1"; + # Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. + fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128" } _EOF_ From 919602fe24f6de332415410ce599cda719f5b3d4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 13 Oct 2017 16:15:38 +0200 Subject: [PATCH 03/43] small Nginx conf fix ";" at end of directive --- dietpi/dietpi-software | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7a4fab420c..0d39b56f79 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8582,10 +8582,10 @@ _EOF_ INSTALLING_INDEX=114 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - #Install/Enable necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + # Install/Enable necessary PHP modules: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation AGI "$PHP_APT_PACKAGE_NAME"-intl ${PHP_APT_PACKAGE_NAME}enmod curl gd intl json pdo_mysql opcache apcu - #Solve: https://github.com/Fourdee/DietPi/issues/1067#issuecomment-335200352 + # Solve: https://github.com/Fourdee/DietPi/issues/1067#issuecomment-335200352 if (( $DISTRO >= 4 )); then phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif @@ -8603,8 +8603,8 @@ _EOF_ grep -q 'opcache.save_comments=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.save_comments=/c\opcache.save_comments=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.save_comments=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini grep -q 'opcache.revalidate_freq=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.revalidate_freq=/c\opcache.revalidate_freq=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.revalidate_freq=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini - #Create Nextcloud specific webserver config. - #Apache: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration + # Create Nextcloud specific webserver config. + # Apache: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then a2enmod rewrite headers env dir mime @@ -8632,7 +8632,7 @@ _EOF_ fi - #Nginx: https://docs.nextcloud.com/server/12/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx + # Nginx: https://docs.nextcloud.com/server/12/admin_manual/installation/nginx.html#nextcloud-in-a-subdir-of-nginx if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then cat << _EOF_ > /etc/nginx/sites-dietpi/nextcloud.config @@ -8671,7 +8671,7 @@ location ^~ /nextcloud { fastcgi_param SCRIPT_FILENAME \$request_filename; fastcgi_param PATH_INFO \$fastcgi_path_info; fastcgi_param HTTPS on; - #Avoid sending the security headers twice + # Avoid sending the security headers twice fastcgi_param modHeadersAvailable true; fastcgi_param REMOTE_USER \$remote_user; fastcgi_pass unix:/var/run/php5-fpm.sock; @@ -8707,7 +8707,7 @@ location ^~ /nextcloud { } # Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. - fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128" + fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128"; } _EOF_ From 28d2915b74fb1914532c95ad2c329ff2edffcd40 Mon Sep 17 00:00:00 2001 From: techdabbler Date: Tue, 17 Oct 2017 19:59:07 -0700 Subject: [PATCH 04/43] Diet-Pi | Add Gitea --- dietpi/dietpi-process_tool | 1 + dietpi/dietpi-services | 1 + dietpi/dietpi-software | 94 +++++++++++++++++++++++++++++++++++++- 3 files changed, 95 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 8703d01c89..6b82455b8b 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -219,6 +219,7 @@ aNAME[$index]='Emby Server';aPROCESS_NAME[$index]='emby-server';((index++)) aNAME[$index]='EmonHUB';aPROCESS_NAME[$index]='emonhub';((index++)) aNAME[$index]='FuguHub';aPROCESS_NAME[$index]='bdd';((index++)) + aNAME[$index]='Gitea';aPROCESS_NAME[$index]='gitea';((index++)) aNAME[$index]='Gogs';aPROCESS_NAME[$index]='gogs';((index++)) aNAME[$index]='Gmediarender';aPROCESS_NAME[$index]='gmediarender';((index++)) aNAME[$index]='Home Assistant';aPROCESS_NAME[$index]='hass';((index++)) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index ecc37dbfcd..887dc9b1e4 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -109,6 +109,7 @@ 'minio' 'gmrender' 'nukkit' + 'gitea' ) # - User: read custom services file diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 426e6a54bf..257b3ed522 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -308,7 +308,7 @@ _EOF_ # - Software #NB: All software has a unique index that must not be changed (eg: DESKTOP_LXDE = 23) TOTAL_SOFTWARE_INDEXS=0 - TOTAL_SOFTWARE_INDEXS_HARDLIMIT=165 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init + TOTAL_SOFTWARE_INDEXS_HARDLIMIT=166 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init INSTALLING_INDEX=0 #Which software index is currently being installed? @@ -1303,6 +1303,20 @@ _EOF_ # - ARMv8 aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + #------------------ + index_current=165 + + aSOFTWARE_WHIP_NAME[$index_current]='Gitea' + aSOFTWARE_WHIP_DESC[$index_current]='Git with a cup of tea' + aSOFTWARE_CATEGORY_INDEX[$index_current]=4 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_REQUIRES_GIT[$index_current]=1 + aSOFTWARE_REQUIRES_MYSQL[$index_current]=1 + aSOFTWARE_ONLINEDOC_URL[$index_current]='' + + # - ARMv8 + aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + #Emulation / Gaming #-------------------------------------------------------------------------------- @@ -7201,6 +7215,56 @@ _EOF_ fi fi + #GITEA + INSTALLING_INDEX=165 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + + INSTALL_URL_ADDRESS='https://dl.gitea.io/gitea/1.2/gitea-1.2-' + + #armv6 + if (( $HW_ARCH == 1 )); then + + INSTALL_URL_ADDRESS+='linux-arm-6' + + #armv7+ + elif (( $HW_ARCH == 2 )); then + + INSTALL_URL_ADDRESS+='linux-arm-7' + + #x86_64 + elif (( $HW_ARCH == 10 )); then + + INSTALL_URL_ADDRESS+='linux-amd64' + fi + + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + + #Install + if (( $? == 0 )); then + + #create user + adduser --system --group git + sleep 2 + mkdir /home/git/gitea + wget -O /home/git/gitea/gitea "$INSTALL_URL_ADDRESS" + chmod +x /home/git/gitea/gitea + chown -R git:git /home/git/gitea + + # Download systemd file + wget -O /etc/systemd/system/gitea.service https://github.com/go-gitea/gitea/raw/master/contrib/systemd/gitea.service + + + else + + Error_NoConnection_NoInstall + + fi + + fi + + #Allo Web Interface INSTALLING_INDEX=159 #160 for quick reinstall if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 || @@ -8056,6 +8120,9 @@ EOF # - FuguHub chown -R bd:bd "$FP_DIETPI_USERDATA_DIRECTORY"/fuguhub-data/ + # - Gitea + chown -R git:git "$FP_DIETPI_USERDATA_DIRECTORY"/gitea-repositories/ + } #///////////////////////////////////////////////////////////////////////////////////// @@ -12034,6 +12101,18 @@ _EOF_ fi + #GITEA Config + INSTALLING_INDEX=165 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + # - Data storage / user data + mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/gitea-repositories + + # - sqldb + /DietPi/dietpi/func/create_mysql_db gitea "$GLOBAL_PW" root "$GLOBAL_PW" + + fi + + #Allo Config INSTALLING_INDEX=159 #160 for quick reinstall/update if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 || @@ -13055,6 +13134,19 @@ _EOF_ rm -R /srv/homeassistant userdel -r -f homeassistant + elif (( $1 == 165)); then + + # Delete the user / executible + userdel -r -f git + # Delete systemd files + rm /etc/systemd/system/gitea.service + # Delete data + rm -r "$FP_DIETPI_USERDATA_DIRECTORY"/gitea-repositories + + # drop/delete database + systemctl start mysql + mysqladmin -u root -p"$GLOBAL_PW" drop gitea -f + elif (( $1 == 158 )); then # Remove service systemctl stop minio.service From b5509d83e66a2790e8be1e470effe1ffb0d41a6c Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 19 Oct 2017 17:13:30 +0100 Subject: [PATCH 05/43] v158 + Version codes --- CHANGELOG.txt | 11 +++++++++++ dietpi/.version | 2 +- dietpi/patch_file | 5 +++++ dietpi/server_version | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 63b4e72fcf..235887eb8e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,14 @@ +v158 +(xx/10/17) + +Changes / Improvements / Optimizations: + +Bug Fixes: + +Allo Web Interface Changes: + +----------------------------------------------------------------------------------------------------------- + v157 (19/10/17) diff --git a/dietpi/.version b/dietpi/.version index 2bab4226fc..147ea53ba1 100644 --- a/dietpi/.version +++ b/dietpi/.version @@ -1 +1 @@ -157 \ No newline at end of file +158 \ No newline at end of file diff --git a/dietpi/patch_file b/dietpi/patch_file index 130fe81a5b..1e8f06c5fe 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2794,6 +2794,11 @@ _EOF_ fi #------------------------------------------------------------------------------- + elif (( $VERSION_CURRENT == 157 )); then + #------------------------------------------------------------------------------- + echo 0 + #------------------------------------------------------------------------------- + fi #------------------------------------------------------------------------------- diff --git a/dietpi/server_version b/dietpi/server_version index 0c3b883213..f9f1a244d2 100644 --- a/dietpi/server_version +++ b/dietpi/server_version @@ -1,2 +1,2 @@ -157 +158 5 From 355eebe065cbdedbc7dc6bfc1b001061b2b14200 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 19 Oct 2017 17:16:59 +0100 Subject: [PATCH 06/43] v158 + DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 235887eb8e..ddac3e1c76 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v158 (xx/10/17) Changes / Improvements / Optimizations: +DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 Bug Fixes: From 8722073317b2e3400fa07aaa3b9366e5dbd72edf Mon Sep 17 00:00:00 2001 From: jon Date: Fri, 20 Oct 2017 14:44:56 -0700 Subject: [PATCH 07/43] Update Home Assistant to use python 3.6.3 as this is now required. Using PYENV as the installation approach so existing python installations are not impacted and all changes and further updates are isolated. To update users can uninstall and reinstall HA, configuration files are not touched. --- dietpi/dietpi-software | 87 +++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 581a554350..0124cc587e 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7900,28 +7900,56 @@ _EOF_ INSTALLING_INDEX=157 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - Banner_Installing - - AGI python3 python3-pip libssl-dev cmake libc-ares-dev uuid-dev daemon curl libgnutls28-dev libgnutlsxx28 nmap net-tools sudo libglib2.0-dev cython3 libudev-dev python3-sphinx python3-setuptools libmysqlclient-dev swig libssl-dev python-dev libusb-1.0-0 gcc python3-dev libssl-dev libffi-dev - - pip3 install --upgrade virtualenv + Banner_Installing + + HA_USER="homeassistant" + HA_USERROOT="/home/$HA_USER" + HA_SRVROOT="/srv/homeassistant" + HA_PYENV_ACTIVATION="export PATH=\"$HA_USERROOT/.pyenv/bin:\$PATH\"; eval \"\$(pyenv init -)\"; eval \"\$(pyenv virtualenv-init -)\"" + HA_PYTHON_VERSION="3.6.3" + + /DietPi/dietpi/func/dietpi-notify 2 "HA_USER: $HA_USER" + /DietPi/dietpi/func/dietpi-notify 2 "HA_USERROOT: $HA_USERROOT" + /DietPi/dietpi/func/dietpi-notify 2 "HA_SRVROOT: $HA_SRVROOT" + /DietPi/dietpi/func/dietpi-notify 2 "HA_PYENV_ACTIVATION: $HA_PYENV_ACTIVATION" + /DietPi/dietpi/func/dietpi-notify 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" + + # Install needed libraries + AGI libssl-dev git cmake libc-ares-dev uuid-dev daemon curl libgnutls28-dev libgnutlsxx28 nmap net-tools sudo libglib2.0-dev libudev-dev libmysqlclient-dev swig libssl-dev libusb-1.0-0 gcc libssl-dev libffi-dev libbz2-dev zlib1g-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev + + # Setup the user account information + adduser --system $HA_USER + addgroup $HA_USER + usermod -G dialout -a $HA_USER + # this allows the dietpi user to edit the files along with HA. + usermod -G dietpi -a $HA_USER + mkdir $HA_SRVROOT + chown $HA_USER:$HA_USER $HA_SRVROOT + + # Install pyenv + su --shell /bin/bash --command "cd $HA_USERROOT; curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash" $HA_USER + + # Install Python which is needed for HA. + su --shell /bin/bash --command "cd $HA_USERROOT; $HA_PYENV_ACTIVATION; pyenv install $HA_PYTHON_VERSION" $HA_USER + + # Make the virtual environment. + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv virtualenv $HA_PYTHON_VERSION homeassistant-$HA_PYTHON_VERSION" $HA_USER + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv local homeassistant-$HA_PYTHON_VERSION" $HA_USER + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv local" $HA_USER + + # Install Home Assistant and extra modules. + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv activate homeassistant-$HA_PYTHON_VERSION; pip3 install colorlog PyMySQL mysqlclient" $HA_USER + su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv activate homeassistant-$HA_PYTHON_VERSION; pip3 install --upgrade homeassistant" $HA_USER + + # Generate the scripts to launch HA using pyenv. + echo '#!/bin/bash' > $HA_SRVROOT/homeassistant-start.sh + echo "cd $HA_SRVROOT" >> $HA_SRVROOT/homeassistant-start.sh + echo "$HA_PYENV_ACTIVATION" >> $HA_SRVROOT/homeassistant-start.sh + echo "pyenv activate homeassistant-$HA_PYTHON_VERSION" >> $HA_SRVROOT/homeassistant-start.sh + echo "hass -c \"$HA_USERROOT/.homeassistant\"" >> $HA_SRVROOT/homeassistant-start.sh + #su --shell /bin/bash --command "/srv/homeassistant/homeassistant-start.sh" homeassistant + chmod +x /srv/homeassistant/homeassistant-start.sh - adduser --system homeassistant - addgroup homeassistant - usermod -G dialout -a homeassistant - # this allows the dietpi user to edit the files along with HA. - usermod -G dietpi -a homeassistant - mkdir /srv/homeassistant - chown homeassistant:homeassistant /srv/homeassistant - - su -s /bin/bash homeassistant < /etc/systemd/system/home-assistant.service + cat << _EOF_ > /etc/systemd/system/home-assistant.service [Unit] Description=Home Assistant After=network.target [Service] Type=simple -User=%i -ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant" +User=homeassistant +ExecStart=/srv/homeassistant/homeassistant-start.sh [Install] WantedBy=multi-user.target @@ -12980,8 +13008,15 @@ _EOF_ elif (( $1 == 157)); then - rm -R /srv/homeassistant - userdel -r -f homeassistant + # Remove installationof HA. + rm -R /srv/homeassistant + + # Remove the user and all files. This removed pyenv for this user as well. + userdel -r -f homeassistant + groupdel homeassistant + + # Remove the service. + rm /etc/systemd/system/home-assistant.service elif (( $1 == 165)); then From a1fdce4b79f80ccdb40c7bbf165d76aa839d5b66 Mon Sep 17 00:00:00 2001 From: jon Date: Sat, 21 Oct 2017 09:32:12 -0700 Subject: [PATCH 08/43] Switch to Mariadb client package is stretch. --- dietpi/dietpi-software | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0124cc587e..baf9d78df5 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7915,7 +7915,13 @@ _EOF_ /DietPi/dietpi/func/dietpi-notify 2 "HA_PYTHON_VERSION: $HA_PYTHON_VERSION" # Install needed libraries - AGI libssl-dev git cmake libc-ares-dev uuid-dev daemon curl libgnutls28-dev libgnutlsxx28 nmap net-tools sudo libglib2.0-dev libudev-dev libmysqlclient-dev swig libssl-dev libusb-1.0-0 gcc libssl-dev libffi-dev libbz2-dev zlib1g-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev + AGI libssl-dev git cmake libc-ares-dev uuid-dev daemon curl libgnutls28-dev libgnutlsxx28 nmap net-tools sudo libglib2.0-dev libudev-dev swig libssl-dev libusb-1.0-0 gcc libssl-dev libffi-dev libbz2-dev zlib1g-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev + if (( $DISTRO == 3 )); then + AGI libmysqlclient-dev + fi + if (( $DISTRO == 4 )); then + AGI libmariadbclient-dev + fi # Setup the user account information adduser --system $HA_USER From 11651d6fa1b6b3af59bdddea7152d268cf175529 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 21 Oct 2017 22:54:33 +0200 Subject: [PATCH 09/43] [CertBot] Add Stretch Apache package and installation code cleanup --- dietpi/dietpi-software | 50 +++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 581a554350..7ca380a0c0 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5437,35 +5437,45 @@ _EOF_ Banner_Installing + if (( $DISTRO >= 4 )); then + + AGI certbot + + if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then - INSTALL_URL_ADDRESS='https://github.com/certbot/certbot/archive/master.zip' - /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + AGI python-certbot-apache + + fi + + if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then - #Install - if (( $? == 0 )); then + AGI python-certbot-nginx + + fi - if (( $DISTRO == 4 )); then + else + + INSTALL_URL_ADDRESS='https://github.com/certbot/certbot/archive/master.zip' + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - AGI certbot python-certbot-nginx + #Install + if (( $? == 0 )); then + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip -d /root + rm package.zip + mv certbot* /etc/certbot_scripts - else + # - Install packages + cd /etc/certbot_scripts + ./certbot-auto -n --os-packages-only + cd ~/ - wget "$INSTALL_URL_ADDRESS" -O package.zip - unzip -o package.zip -d /root - rm package.zip - mv certbot* /etc/certbot_scripts + else - # - Install packages - cd /etc/certbot_scripts - ./certbot-auto -n --os-packages-only - cd ~/ + Error_NoConnection_NoInstall fi - - else - - Error_NoConnection_NoInstall - + fi fi From a5636a338a5a2a683cefed67dd22fe0acd0e18d2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 21 Oct 2017 23:11:12 +0200 Subject: [PATCH 10/43] [CertBot] Add Apache auto installation to dietpi-letsencrypt ...and increase rsa key size to 4096 bit. It is slower yes, but also significantly stronger and necessary for a good ssllabs.com rating. Benchmarks and discussion: https://certsimple.com/blog/measuring-ssl-rsa-keys --- dietpi/dietpi-letsencrypt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index cae85ebd43..1c1dadf183 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -63,7 +63,7 @@ LETSENCRYPT_EMAIL="myemail@email.com" LETSENCRYPT_REDIRECT=0 LETSENCRYPT_AUTORENEW=0 - LETSENCRYPT_KEYSIZE=2048 + LETSENCRYPT_KEYSIZE=4096 Run_Lets_Encrypt(){ @@ -150,7 +150,7 @@ fi #Cert me up Apache2 - ./certbot-auto --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + certbot --apache --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN #------------------------------------------------------------------------------------------------------ #Lighttpd From 8373149e3c8e6c8be4214ebe9c0946f4d684f719 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 25 Oct 2017 18:27:16 +0100 Subject: [PATCH 11/43] v158 Allo Web Interface Changes: Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. Squeezelite | Now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 --- CHANGELOG.txt | 3 ++ dietpi/conf/squeezelite.service | 2 +- dietpi/patch_file | 56 +++++++++++---------------------- 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ddac3e1c76..137faed818 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,10 +3,13 @@ v158 Changes / Improvements / Optimizations: DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 +DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 Bug Fixes: Allo Web Interface Changes: +Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. +Squeezelite | Now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 ----------------------------------------------------------------------------------------------------------- diff --git a/dietpi/conf/squeezelite.service b/dietpi/conf/squeezelite.service index e4fc683d62..ce29911a5d 100644 --- a/dietpi/conf/squeezelite.service +++ b/dietpi/conf/squeezelite.service @@ -3,7 +3,7 @@ Description=squeezelite [Service] Type=simple -ExecStart=/usr/bin/squeezelite -a 4096:1024:16:0 -C 5 -n 'DietPi-Squeezelite' -f /var/log/squeezelite.log +ExecStart=/usr/bin/squeezelite -D -a 4096:1024:16:0 -C 5 -n 'DietPi-Squeezelite' -f /var/log/squeezelite.log [Install] WantedBy=multi-user.target diff --git a/dietpi/patch_file b/dietpi/patch_file index 1e8f06c5fe..e0f3e23341 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -33,6 +33,13 @@ DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) + ALLO_GUI_IMAGE=0 + if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[159\]=2') )); then + + ALLO_GUI_IMAGE=1 + + fi + AUTOINSTALL_ENABLED=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Install_Enable=' | sed 's/.*=//') USER_INPUTS=1 if (( $AUTOINSTALL_ENABLED == 1 && $(cat /DietPi/dietpi/.install_stage) <= 0 )); then #Automated @@ -2739,42 +2746,6 @@ _EOF_ #Set Ondemand as default CPU gov: https://github.com/Fourdee/DietPi/issues/1141 sed -i "/cpu_governor=/c\cpu_governor=ondemand" /DietPi/dietpi.txt #------------------------------------------------------------------------------- - #Reinstalls Allo Web interface Only - if (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[159\]=2') )); then - - #Update V2 images - if [ -f /etc/dietpi/.allo_web_image_version ] && (( $(cat /etc/dietpi/.allo_web_image_version) == 2 )); then - - #Update period size change for Squeezelite: - cp /DietPi/dietpi/conf/squeezelite.service /etc/systemd/system/squeezelite.service - systemctl daemon-reload - - #Update V1 images - else - - # - Add quick reinstall entry if does not exist - if (( ! $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[160\]=2') )); then - - echo -e "aSOFTWARE_INSTALL_STATE[160]=2" >> /DietPi/dietpi/.installed - - fi - - # - Quick update - #/DietPi/dietpi/dietpi-software reinstall 160 - - # - Full update (including pre-req reinstalls) - /DietPi/dietpi/dietpi-software reinstall 159 - - fi - - #Reinstalls Everything else - else - - # Squeezelite/Shairport-sync - /DietPi/dietpi/dietpi-software reinstall 36 37 - - fi - #------------------------------------------------------------------------------- #RPi update DietPi kernel: if (( $HW_MODEL < 10 )); then @@ -2796,7 +2767,18 @@ _EOF_ elif (( $VERSION_CURRENT == 157 )); then #------------------------------------------------------------------------------- - echo 0 + #Allo GUI: + if (( $ALLO_GUI_IMAGE )); then + + #Regenerate unique Roon ID's: https://community.roonlabs.com/t/roon-core-will-not-recognize-two-dietpi-allo-gui-roon-bridges-simultaneously/32563/18?u=dan_knight + rm /mnt/dietpi_userdata/roon/RoonBridge/Settings/unique_id + rm /mnt/dietpi_userdata/roon/RAATServer/Settings/unique_id + + fi + #------------------------------------------------------------------------------- + #Reinstalls + # Squeezelite / Shairport-sync / Allo GUI (full) + /DietPi/dietpi/dietpi-software reinstall 36 37 159 #------------------------------------------------------------------------------- fi From 8a34bd36a058683cadea56a77e74efdca7c5ee4a Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Wed, 25 Oct 2017 18:59:29 +0100 Subject: [PATCH 12/43] v158 + DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. --- CHANGELOG.txt | 1 + dietpi/func/dietpi-set_hardware | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 137faed818..486da5cb04 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ DietPi-Software | Gitea: Now available for installation. Many thanks to @techdab DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 Bug Fixes: +DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. Allo Web Interface Changes: Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index aae1f5408a..889ebc8ebb 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1840,6 +1840,9 @@ _EOF_ /DietPi/dietpi/func/dietpi-notify 1 "Unable to find a USB-DAC on system." EXIT_CODE=1 + # - Reset + sed -i "/^soundcard=/c\soundcard=none" /DietPi/dietpi.txt + fi SOUNDCARD_TARGET_DEVICE=0 From 1bcb91b8b36b6dbf89957d76cb5461431417eaa4 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 26 Oct 2017 17:12:32 +0100 Subject: [PATCH 13/43] v158 + https://github.com/Fourdee/DietPi/issues/1212 --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 486da5cb04..f2de3eb114 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, t Allo Web Interface Changes: Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. Squeezelite | Now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 +General | Added ability to set S24_3 bit depth modes for Shairport-sync and Squeezelite. Required by some DACs ----------------------------------------------------------------------------------------------------------- From 66f982d9f9dcc6a2971ca7f90791eb330cde4ec0 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 26 Oct 2017 17:51:24 +0100 Subject: [PATCH 14/43] v158 + DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 6 +++--- dietpi/func/dietpi-set_smbclient | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f2de3eb114..4a74ec9bf1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ DietPi-Software | Gitea: Now available for installation. Many thanks to @techdab DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 Bug Fixes: +DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. Allo Web Interface Changes: diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 57c32c056d..40b7c18aea 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4754,9 +4754,9 @@ _EOF_ if (( $(df -h | grep -ci -m1 '/mnt/samba') == 1 )); then #Get stats - sambaclient_mounted_size=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $2 }') - sambaclient_mounted_used=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $3 }') - sambaclient_mounted_free=$(df -h | grep -m1 '/mnt/samba' | awk '{ print $4 }') + sambaclient_mounted_size=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-4)}') + sambaclient_mounted_used=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-3)}') + sambaclient_mounted_free=$(df -h | grep -m1 '/mnt/samba' | awk '{print $(NF-2)}') sambaclient_status="/mnt/samba | Size $sambaclient_mounted_size | Used $sambaclient_mounted_used | Free $sambaclient_mounted_free" fi diff --git a/dietpi/func/dietpi-set_smbclient b/dietpi/func/dietpi-set_smbclient index fc20c5a258..775c658324 100644 --- a/dietpi/func/dietpi-set_smbclient +++ b/dietpi/func/dietpi-set_smbclient @@ -42,8 +42,11 @@ Apply_And_Mount(){ + #NB: Convert spaces into '\040': https://github.com/Fourdee/DietPi/issues/1201#issuecomment-339720271 + local space_to_040=$(echo -e "$samba_clientshare" | sed 's/ /\\\\040/g') + #Apply to fstab - sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$samba_clientshare \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nofail 0 0" /etc/fstab + sed -i "/\/mnt\/samba/c\\/\/$samba_clientname\/$space_to_040 \/mnt\/samba cifs username=$samba_clientusename,password=$samba_clientpassword,iocharset=utf8,sec=ntlm,nofail 0 0" /etc/fstab #Mount up mount -a From 4255c057bf0ec7112be170e9e92b5fa47c165cd3 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 26 Oct 2017 19:08:20 +0100 Subject: [PATCH 15/43] v158 + DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4a74ec9bf1..0278ce5505 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ DietPi-Software | Gitea: Now available for installation. Many thanks to @techdab DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 Bug Fixes: +DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 40b7c18aea..da86dd2a14 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1292,7 +1292,7 @@ MIN_VALUE=0 MAX_VALUE=2000 - OPTION=$(whiptail --inputbox "This will set the size of your swap file in MB:\n\nSwapfile has a swapiness setting of 1. Swapfile is used only to prevent out of memory errors.\n\n - Recommended value = 1 (auto)\n - 0 = Disable swapfile\n - 1 = Auto size swapfile (1GB - RAM = size)\n - 2 - $MAX_VALUE = Manual size" 16 75 "$swap_size" --title "SwapFile Size (MB)" 3>&1 1>&2 2>&3) + OPTION=$(whiptail --inputbox "This will set the size of your swap file in MB:\n\nSwapfile has a swapiness setting of 1. Swapfile is used only to prevent out of memory errors.\n\n - Recommended value = 1 (auto)\n - 0 = Disable swapfile\n - 1 = Auto size swapfile (2GB - RAM = size)\n - 2 - $MAX_VALUE = Manual size" 16 75 "$swap_size" --title "SwapFile Size (MB)" 3>&1 1>&2 2>&3) CHOICE=$? if (( $CHOICE == 0 )); then @@ -1910,19 +1910,20 @@ local Description="Change CPU Governor:" local whiptail_menu_array=() - if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'interactive') == 1 )); then - - whiptail_menu_array+=("interactive" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.") - Description+="\nInteractive | Dynamic CPU frequency based on usage (recommended)" - - fi # - C1 | disable ondemand: https://github.com/Fourdee/DietPi/issues/248 if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'ondemand') == 1 )) && (( $HW_MODEL != 10 )); then whiptail_menu_array+=("ondemand" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.") - Description+="\nOndemand | Dynamic CPU frequency based on usage." + Description+="\nOndemand | Dynamic CPU frequency based on usage (recommended)." + + fi + + if (( $(cat "$FP_CPU_SCALING_GOV" | grep -ci -m1 'interactive') == 1 )); then + + whiptail_menu_array+=("interactive" "Scales CPU frequency between $frequency_min_cpu_governor MHz and $frequency_max_cpu_governor MHz.") + Description+="\nInteractive | Dynamic CPU frequency based on usage." fi From 1a0b9d763777e4cbc46d05163b0417a2ce109b4f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 26 Oct 2017 21:43:32 +0200 Subject: [PATCH 16/43] Only create cronjob, if not auto created by stretch certbot apt package Cronjob is already created by new certbot package on Stretch: https://packages.debian.org/stretch/all/certbot/filelist --- dietpi/dietpi-letsencrypt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 1c1dadf183..175f1f131a 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -49,7 +49,7 @@ DP_WEBSERVER_INDEX=0 #0=apache2 1=lighttpd 2=nginx 3=minio LETSENCRYPT_INSTALLED=0 - if [[ $DISTRO == 4 ]]; then + if (( $DISTRO >= 4 )); then if [ -f "$DP_LETSENCRYPT_BINARY" ]; then LETSENCRYPT_INSTALLED=1 fi @@ -69,7 +69,7 @@ /DietPi/dietpi/func/dietpi-notify 3 "$PROGRAM_NAME" "Running cert" - if [[ ! $DISTRO == 4 ]]; then + if (( $DISTRO < 4 )); then cd "$DP_LETSENCRYPT_SCRIPTS" @@ -274,7 +274,7 @@ _EOF_ #------------------------------------------------------------------------------------------------------ #ALL | Create cron job - if (( $LETSENCRYPT_AUTORENEW )); then + if (( $LETSENCRYPT_AUTORENEW && $DISTRO < 4 )); then cat << _EOF_ > "$DP_MONTHLY_CRON" #!/bin/bash From d88f7decb3a508378cf765b8535c2bf0aaad2f8f Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 28 Oct 2017 22:05:58 +0100 Subject: [PATCH 17/43] v158 + DietPi-Sotware | AudioPhonics Pi-SPC: Now available for installation. Power control module which lets you physically power off system using a button: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9359#p9359 https://github.com/Fourdee/DietPi/issues/1215 --- CHANGELOG.txt | 2 +- dietpi/dietpi-process_tool | 1 + dietpi/dietpi-services | 1 + dietpi/dietpi-software | 427 +++++++++++++++++++++++-------------- 4 files changed, 270 insertions(+), 161 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0278ce5505..869698a0cc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,7 +4,7 @@ v158 Changes / Improvements / Optimizations: DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 - +DietPi-Sotware | AudioPhonics Pi-SPC: Now available for installation. Power control module which lets you physically power off system using a button: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9359#p9359 Bug Fixes: DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 6b82455b8b..d75370ddc4 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -247,6 +247,7 @@ aNAME[$index]='Open Media Vault';aPROCESS_NAME[$index]='omv-engined';((index++)) aNAME[$index]='OpenSSH Server';aPROCESS_NAME[$index]='sshd';((index++)) aNAME[$index]='OpenVPN Server';aPROCESS_NAME[$index]='openvpn';((index++)) + aNAME[$index]='Pi-SPC';aPROCESS_NAME[$index]='sds.sh';((index++)) aNAME[$index]='Pi-hole';aPROCESS_NAME[$index]='dnsmasq';((index++)) aNAME[$index]='Pi-hole FTL';aPROCESS_NAME[$index]='pihole-FTL';((index++)) aNAME[$index]='ProFTP';aPROCESS_NAME[$index]='proftpd';((index++)) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 887dc9b1e4..236ea944fd 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -110,6 +110,7 @@ 'gmrender' 'nukkit' 'gitea' + 'pi-spc' ) # - User: read custom services file diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2c88225095..bc4245289a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -308,7 +308,7 @@ _EOF_ # - Software #NB: All software has a unique index that must not be changed (eg: DESKTOP_LXDE = 23) TOTAL_SOFTWARE_INDEXS=0 - TOTAL_SOFTWARE_INDEXS_HARDLIMIT=166 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init + TOTAL_SOFTWARE_INDEXS_HARDLIMIT=167 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init INSTALLING_INDEX=0 #Which software index is currently being installed? @@ -1816,6 +1816,24 @@ _EOF_ aSOFTWARE_REQUIRES_NODEJS[$index_current]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$index_current]=1 + #------------------ + index_current=166 + + aSOFTWARE_WHIP_NAME[$index_current]='PI-SPC' + aSOFTWARE_WHIP_DESC[$index_current]='audiophonics pi-spc power control module' + aSOFTWARE_CATEGORY_INDEX[$index_current]=11 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9359#p9359' + + # - Disabled for All non-rpi + for ((i=10; i<=$MAX_HW_MODEL; i++)) + do + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + + done + + #System security #-------------------------------------------------------------------------------- index_current=73 @@ -2585,8 +2603,156 @@ _EOF_ /DietPi/dietpi/func/dietpi-notify 3 DietPi-Software "Checking for prerequisite software" - #WEBSERVER - Manual stack install - # - Define extra DietPi install flags for WEBSERVER_STACKS + #------------------------------------------------------------------------- + #Pre-req software, for items that do not have their own array aSOFTWARE_REQUIRES_SOFTWARENAME + local index=0 + + #Additional software that requires WiringPi + # AudioPhonics Pi-SPC + if (( ${aSOFTWARE_INSTALL_STATE[166]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[70]=1 + + fi + + #Additional Software required by Allo Web Interface + if (( ${aSOFTWARE_INSTALL_STATE[159]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite + aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync + + if (( $HW_MODEL == 70 )); then + + aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot + + fi + + aSOFTWARE_INSTALL_STATE[65]=1 # Netdata + aSOFTWARE_INSTALL_STATE[96]=1 # Samba + + #aSOFTWARE_INSTALL_STATE[80]=1 # LLMP + aSOFTWARE_INSTALL_STATE[121]=1 # Roon Bridge + aSOFTWARE_INSTALL_STATE[124]=1 # NAA Daemon + #aSOFTWARE_INSTALL_STATE[128]=1 # MPD + aSOFTWARE_INSTALL_STATE[129]=1 # O!MPD + #aSOFTWARE_INSTALL_STATE[152]=1 # Avahi (pulled in by O!MPD) + aSOFTWARE_INSTALL_STATE[163]=1 # Gmrender + + fi + + #Software that requires Avahi-Daemon + index=152 + if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || + ${aSOFTWARE_INSTALL_STATE[37]} == 1 || + ${aSOFTWARE_INSTALL_STATE[128]} == 1 || + ${aSOFTWARE_INSTALL_STATE[138]} == 1 || + ${aSOFTWARE_INSTALL_STATE[163]} == 1)); then + + if (( ${aSOFTWARE_INSTALL_STATE[$index]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[$index]=1 + + #aSOFTWARE_WHIP_NAME + /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$index]} will be installed" + + fi + + fi + + #Software that requires Mono + if (( ${aSOFTWARE_INSTALL_STATE[41]} == 1 || + ${aSOFTWARE_INSTALL_STATE[144]} == 1 || + ${aSOFTWARE_INSTALL_STATE[145]} == 1 || + ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[150]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[150]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "Mono runtime libary will be installed" + + fi + + fi + + #Software that requires SDL2: + if (( ${aSOFTWARE_INSTALL_STATE[108]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[140]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[140]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "SDL2 will be installed" + + fi + + fi + + #Software that requires Python-Pip: https://github.com/Fourdee/DietPi/issues/784 + if (( ${aSOFTWARE_INSTALL_STATE[58]} == 1 || + ${aSOFTWARE_INSTALL_STATE[99]} == 1 || + ${aSOFTWARE_INSTALL_STATE[118]} == 1 || + ${aSOFTWARE_INSTALL_STATE[136]} == 1 || + ${aSOFTWARE_INSTALL_STATE[139]} == 1 || + ${aSOFTWARE_INSTALL_STATE[142]} == 1 || + ${aSOFTWARE_INSTALL_STATE[153]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[130]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[130]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "Python-Pip will be installed" + + fi + + fi + + #Software that requires MPD + # YMPD + # Cava + # OMPD + if (( ${aSOFTWARE_INSTALL_STATE[32]} == 1 || + ${aSOFTWARE_INSTALL_STATE[119]} == 1 || + ${aSOFTWARE_INSTALL_STATE[129]} == 1 )); then + + if (( ${aSOFTWARE_INSTALL_STATE[128]} == 0 )); then + + # - Flag for install + aSOFTWARE_INSTALL_STATE[128]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "MPD will be installed" + + fi + + fi + + #OMV (requires Samba, Proftpd) + if (( ${aSOFTWARE_INSTALL_STATE[126]} == 1 )); then + + #Proftpd + if (( ${aSOFTWARE_INSTALL_STATE[94]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[94]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "ProFTP will be installed" + + fi + + #Samba + if (( ${aSOFTWARE_INSTALL_STATE[96]} == 0 )); then + + aSOFTWARE_INSTALL_STATE[96]=1 + + /DietPi/dietpi/func/dietpi-notify 2 "Samba Server will be installed" + + fi + + fi + + #------------------------------------------------------------------------- + #Pre-req software, for items that do DO have their own array aSOFTWARE_REQUIRES_SOFTWARENAME + # WEBSERVER - Manual stack install + # - Define extra DietPi install flags for WEBSERVER_STACKS #LLAP if (( ${aSOFTWARE_INSTALL_STATE[82]} == 1 )); then aSOFTWARE_INSTALL_STATE[84]=1 @@ -3017,144 +3183,6 @@ _EOF_ done - #------------ - #Specials - local index=0 - - #Additional Software required by Allo Web Interface - if (( ${aSOFTWARE_INSTALL_STATE[159]} == 1 )); then - - aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite - aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync - - if (( $HW_MODEL == 70 )); then - - aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot - - fi - - aSOFTWARE_INSTALL_STATE[65]=1 # Netdata - aSOFTWARE_INSTALL_STATE[96]=1 # Samba - - #aSOFTWARE_INSTALL_STATE[80]=1 # LLMP - aSOFTWARE_INSTALL_STATE[121]=1 # Roon Bridge - aSOFTWARE_INSTALL_STATE[124]=1 # NAA Daemon - #aSOFTWARE_INSTALL_STATE[128]=1 # MPD - aSOFTWARE_INSTALL_STATE[129]=1 # O!MPD - #aSOFTWARE_INSTALL_STATE[152]=1 # Avahi (pulled in by O!MPD) - aSOFTWARE_INSTALL_STATE[163]=1 # Gmrender - - fi - - #Software that requires Avahi-Daemon - index=152 - if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || - ${aSOFTWARE_INSTALL_STATE[37]} == 1 || - ${aSOFTWARE_INSTALL_STATE[128]} == 1 || - ${aSOFTWARE_INSTALL_STATE[138]} == 1 || - ${aSOFTWARE_INSTALL_STATE[163]} == 1)); then - - if (( ${aSOFTWARE_INSTALL_STATE[$index]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[$index]=1 - - #aSOFTWARE_WHIP_NAME - /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[$index]} will be installed" - - fi - - fi - - #Software that requires Mono - if (( ${aSOFTWARE_INSTALL_STATE[41]} == 1 || - ${aSOFTWARE_INSTALL_STATE[144]} == 1 || - ${aSOFTWARE_INSTALL_STATE[145]} == 1 || - ${aSOFTWARE_INSTALL_STATE[147]} == 1 )); then - - if (( ${aSOFTWARE_INSTALL_STATE[150]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[150]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "Mono runtime libary will be installed" - - fi - - fi - - #Software that requires SDL2: - if (( ${aSOFTWARE_INSTALL_STATE[108]} == 1 )); then - - if (( ${aSOFTWARE_INSTALL_STATE[140]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[140]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "SDL2 will be installed" - - fi - - fi - - #Software that requires Python-Pip: https://github.com/Fourdee/DietPi/issues/784 - if (( ${aSOFTWARE_INSTALL_STATE[58]} == 1 || - ${aSOFTWARE_INSTALL_STATE[99]} == 1 || - ${aSOFTWARE_INSTALL_STATE[118]} == 1 || - ${aSOFTWARE_INSTALL_STATE[136]} == 1 || - ${aSOFTWARE_INSTALL_STATE[139]} == 1 || - ${aSOFTWARE_INSTALL_STATE[142]} == 1 || - ${aSOFTWARE_INSTALL_STATE[153]} == 1 )); then - - if (( ${aSOFTWARE_INSTALL_STATE[130]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[130]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "Python-Pip will be installed" - - fi - - fi - - #Software that requires MPD - # HiFi - # Cava - # OMPD - if (( ${aSOFTWARE_INSTALL_STATE[32]} == 1 || - ${aSOFTWARE_INSTALL_STATE[119]} == 1 || - ${aSOFTWARE_INSTALL_STATE[129]} == 1 )); then - - if (( ${aSOFTWARE_INSTALL_STATE[128]} == 0 )); then - - # - Flag for install - aSOFTWARE_INSTALL_STATE[128]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "MPD will be installed" - - fi - - fi - - #OMV (requires Samba, Proftpd) - if (( ${aSOFTWARE_INSTALL_STATE[126]} == 1 )); then - - #Proftpd - if (( ${aSOFTWARE_INSTALL_STATE[94]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[94]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "ProFTP will be installed" - - fi - - #Samba - if (( ${aSOFTWARE_INSTALL_STATE[96]} == 0 )); then - - aSOFTWARE_INSTALL_STATE[96]=1 - - /DietPi/dietpi/func/dietpi-notify 2 "Samba Server will be installed" - - fi - - fi - } Create_Desktop_Shared_Items(){ @@ -7340,6 +7368,16 @@ _EOF_ fi + #AudioPhonics Pi-SPC + INSTALLING_INDEX=166 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + + #NB: Please see configuration section + + fi + } Install_Linux_Software(){ @@ -7927,10 +7965,10 @@ _EOF_ # Install needed libraries AGI libssl-dev git cmake libc-ares-dev uuid-dev daemon curl libgnutls28-dev libgnutlsxx28 nmap net-tools sudo libglib2.0-dev libudev-dev swig libssl-dev libusb-1.0-0 gcc libssl-dev libffi-dev libbz2-dev zlib1g-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev if (( $DISTRO == 3 )); then - AGI libmysqlclient-dev + AGI libmysqlclient-dev fi if (( $DISTRO == 4 )); then - AGI libmariadbclient-dev + AGI libmariadbclient-dev fi # Setup the user account information @@ -7945,19 +7983,19 @@ _EOF_ # Install pyenv su --shell /bin/bash --command "cd $HA_USERROOT; curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash" $HA_USER - # Install Python which is needed for HA. + # Install Python which is needed for HA. su --shell /bin/bash --command "cd $HA_USERROOT; $HA_PYENV_ACTIVATION; pyenv install $HA_PYTHON_VERSION" $HA_USER - # Make the virtual environment. + # Make the virtual environment. su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv virtualenv $HA_PYTHON_VERSION homeassistant-$HA_PYTHON_VERSION" $HA_USER su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv local homeassistant-$HA_PYTHON_VERSION" $HA_USER su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv local" $HA_USER - - # Install Home Assistant and extra modules. + + # Install Home Assistant and extra modules. su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv activate homeassistant-$HA_PYTHON_VERSION; pip3 install colorlog PyMySQL mysqlclient" $HA_USER su --shell /bin/bash --command "cd $HA_SRVROOT; $HA_PYENV_ACTIVATION; pyenv activate homeassistant-$HA_PYTHON_VERSION; pip3 install --upgrade homeassistant" $HA_USER - # Generate the scripts to launch HA using pyenv. + # Generate the scripts to launch HA using pyenv. echo '#!/bin/bash' > $HA_SRVROOT/homeassistant-start.sh echo "cd $HA_SRVROOT" >> $HA_SRVROOT/homeassistant-start.sh echo "$HA_PYENV_ACTIVATION" >> $HA_SRVROOT/homeassistant-start.sh @@ -8731,7 +8769,7 @@ _EOF_ phpenmod ctype dom fileinfo iconv mbstring posix simplexml xmlwriter xmlreader zip exif fi - + # APCu configuration: To prevent cli (cron.php) producing Nextcloud log [info] entry. grep -q 'apc.enable_cli=' $FP_PHP_BASE_DIR/mods-available/apcu.ini && sed -i '/apc.enable_cli=/c\apc.enable_cli=1' $FP_PHP_BASE_DIR/mods-available/apcu.ini || echo 'apc.enable_cli=1' >> $FP_PHP_BASE_DIR/mods-available/apcu.ini @@ -8742,7 +8780,7 @@ _EOF_ grep -q 'opcache.max_accelerated_files=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.max_accelerated_files=/c\opcache.max_accelerated_files=10000' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.max_accelerated_files=10000' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini grep -q 'opcache.save_comments=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.save_comments=/c\opcache.save_comments=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.save_comments=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini grep -q 'opcache.revalidate_freq=' $FP_PHP_BASE_DIR/mods-available/opcache.ini && sed -i '/opcache.revalidate_freq=/c\opcache.revalidate_freq=1' $FP_PHP_BASE_DIR/mods-available/opcache.ini || echo 'opcache.revalidate_freq=1' >> $FP_PHP_BASE_DIR/mods-available/opcache.ini - + # Create Nextcloud specific webserver config. # Apache: https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#apache-web-server-configuration if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then @@ -12084,13 +12122,13 @@ _EOF_ fi #GITEA Config - INSTALLING_INDEX=165 - if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then - # - Data storage / user data - mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/gitea-repositories + INSTALLING_INDEX=165 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + # - Data storage / user data + mkdir -p "$FP_DIETPI_USERDATA_DIRECTORY"/gitea-repositories - # - sqldb - /DietPi/dietpi/func/create_mysql_db gitea "$GLOBAL_PW" root "$GLOBAL_PW" + # - sqldb + /DietPi/dietpi/func/create_mysql_db gitea "$GLOBAL_PW" root "$GLOBAL_PW" fi @@ -12178,6 +12216,70 @@ _EOF_ fi + #AudioPhonics Pi-SPC + INSTALLING_INDEX=166 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + mkdir -p /etc/dietpi/audiophonics/pi-spc + + cat << _EOF_ > /etc/dietpi/audiophonics/pi-spc/sds.sh +#!/bin/bash +#DietPi version +PATH=/usr/bin:/home/pi/wiringPi/gpio:/usr/local/bin + +TICKRATE=0.25 + +echo -e "Audiophonics Shutdown script starting..." +echo -e "Asserting pins : " +echo -e "ShutDown : GPIO17=in, Low" +echo -e "BootOK : GPIO22=out, High" +echo -e "SoftSD : GPIO04=out, Low" + +gpio -g mode 04 out +gpio -g write 04 0 +gpio -g mode 17 in +gpio -g write 17 0 +gpio -g mode 22 out +gpio -g write 22 1 + +while true +do + + if (( \$(gpio -g read 17) == 1 )); then + + /DietPi/dietpi/func/dietpi-notify 0 "AudioPhonics Pi-SPC: Power off requested. Shutting down system." + sudo poweroff + #sudo shutdown -h -P now + break + + fi + + sleep \$TICKRATE + +done + +exit 0 +_EOF_ + + chmod +x /etc/dietpi/audiophonics/pi-spc/sds.sh + + cat << _EOF_ > /etc/systemd/system/pi-spc.service +[Unit] +Description=AudioPhonics Pi-SPC + +[Service] +Type=simple +StandardOutput=tty +User=root + +ExecStart=/bin/bash -c '/etc/dietpi/audiophonics/pi-spc/sds.sh' + +[Install] +WantedBy=multi-user.target +_EOF_ + + fi + } Install_Apply_GPU_Settings(){ @@ -13101,17 +13203,17 @@ _EOF_ elif (( $1 == 157)); then - # Remove installationof HA. + # Remove installationof HA. rm -R /srv/homeassistant - # Remove the user and all files. This removed pyenv for this user as well. + # Remove the user and all files. This removed pyenv for this user as well. userdel -r -f homeassistant groupdel homeassistant - # Remove the service. + # Remove the service. rm /etc/systemd/system/home-assistant.service - elif (( $1 == 165)); then + elif (( $1 == 165 )); then # Delete the user / executible userdel -r -f git @@ -13124,6 +13226,11 @@ _EOF_ systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop gitea -f + elif (( $1 == 166 )); then + + rm /etc/systemd/system/pi-spc.service + rm -R /etc/dietpi/audiophonics/pi-spc + elif (( $1 == 158 )); then # Remove service systemctl stop minio.service From eac3e7c05a08ab924c2a429dde960e407c7e32e5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 29 Oct 2017 13:19:28 +0100 Subject: [PATCH 18/43] [CertBot] Remove certbot stretch packages on deinstallation --- dietpi/dietpi-software | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bc4245289a..cc55a1e31f 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -12518,9 +12518,9 @@ _EOF_ systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop nextcloud -f rm -R /var/www/nextcloud - a2dissite nextcloud 2>/dev/null - rm /etc/apache2/sites-available/nextcloud.conf 2>/dev/null - rm /etc/nginx/sites-dietpi/nextcloud.config 2>/dev/null + a2dissite nextcloud &>/dev/null + rm /etc/apache2/sites-available/nextcloud.conf &>/dev/null + rm /etc/nginx/sites-dietpi/nextcloud.config &>/dev/null elif (( $1 == 115 )); then @@ -12944,14 +12944,15 @@ _EOF_ elif (( $1 == 92 )); then - rm -R /etc/letsencrypt_scripts - rm -R /etc/certbot_scripts + if (( $DISTRO >= 4 )); then - if (( $DISTRO == 4 )); then + AGP python-certbot-apache python-certbot-nginx certbot - AGP certbot fi + rm -R /etc/letsencrypt_scripts &>/dev/null + rm -R /etc/certbot_scripts &>/dev/null + elif (( $1 == 69 )); then AGP python-rpi.gpio python3-rpi.gpio From daec76205666862064dfbe26d7fe3ba0cc58e29d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 29 Oct 2017 15:08:57 +0100 Subject: [PATCH 19/43] [CertBot] Choose correct binary, depending on $DISTRO --- dietpi/dietpi-letsencrypt | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 175f1f131a..cc5b790d41 100644 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -45,20 +45,15 @@ DP_LOGFILE="/var/log/dietpi-letsencrypt.log" DP_MONTHLY_CRON="/etc/cron.monthly/dietpi-letsencrypt" DP_LETSENCRYPT_BINARY="/usr/bin/certbot" - DP_LETSENCRYPT_SCRIPTS="/etc/certbot_scripts" + if (( $DISTRO < 4 )); then + DP_LETSENCRYPT_BINARY="/etc/certbot_scripts/certbot-auto" + fi DP_WEBSERVER_INDEX=0 #0=apache2 1=lighttpd 2=nginx 3=minio LETSENCRYPT_INSTALLED=0 - if (( $DISTRO >= 4 )); then - if [ -f "$DP_LETSENCRYPT_BINARY" ]; then - LETSENCRYPT_INSTALLED=1 - fi - else - if [ -d "$DP_LETSENCRYPT_SCRIPTS" ]; then - LETSENCRYPT_INSTALLED=1 - fi + if [ -f "$DP_LETSENCRYPT_BINARY" ]; then + LETSENCRYPT_INSTALLED=1 fi - LETSENCRYPT_DOMAIN="mydomain.com" LETSENCRYPT_EMAIL="myemail@email.com" LETSENCRYPT_REDIRECT=0 @@ -69,12 +64,6 @@ /DietPi/dietpi/func/dietpi-notify 3 "$PROGRAM_NAME" "Running cert" - if (( $DISTRO < 4 )); then - - cd "$DP_LETSENCRYPT_SCRIPTS" - - fi - #Conditions that must be met before allowing run local run_conditions_met=1 @@ -85,6 +74,9 @@ DP_WEBSERVER_INDEX=0 /DietPi/dietpi/func/dietpi-notify 0 "Apache2 webserver detected" + if (( $DISTRO >= 4 )); then + DP_LETSENCRYPT_BINARY="$DP_LETSENCRYPT_BINARY --apache" + fi elif (( $(ps aux | grep -ci -m1 '[l]ighttpd') )); then @@ -95,6 +87,9 @@ DP_WEBSERVER_INDEX=2 /DietPi/dietpi/func/dietpi-notify 0 "Nginx webserver detected" + if (( $DISTRO >= 4 )); then + DP_LETSENCRYPT_BINARY="$DP_LETSENCRYPT_BINARY --nginx" + fi elif (( $(ps aux | grep -ci -m1 '[m]inio') )); then @@ -150,7 +145,7 @@ fi #Cert me up Apache2 - certbot --apache --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + $DP_LETSENCRYPT_BINARY --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN #------------------------------------------------------------------------------------------------------ #Lighttpd @@ -159,7 +154,7 @@ # - Cert me up /DietPi/dietpi/dietpi-services stop - ./certbot-auto certonly --standalone --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + $DP_LETSENCRYPT_BINARY certonly --standalone --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN # - Create combined key cd /etc/letsencrypt/live/"$LETSENCRYPT_DOMAIN" @@ -219,7 +214,7 @@ _EOF_ fi #Cert me up Nginx - certbot --nginx --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + $DP_LETSENCRYPT_BINARY --duplicate --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN #------------------------------------------------------------------------------------------------------ @@ -228,7 +223,7 @@ _EOF_ # - Cert me up /DietPi/dietpi/dietpi-services stop - ./certbot-auto certonly --standalone --preferred-challenges tls-sni --staple-ocsp --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN + $DP_LETSENCRYPT_BINARY certonly --standalone --preferred-challenges tls-sni --staple-ocsp --agree-tos $cli_redirect --rsa-key-size $LETSENCRYPT_KEYSIZE --email $LETSENCRYPT_EMAIL -d $LETSENCRYPT_DOMAIN # Locate them correctly (THIS didn't work as symlinks) cp /etc/letsencrypt/live/$LETSENCRYPT_DOMAIN/fullchain.pem /home/minio-user/.minio/certs/public.crt @@ -483,13 +478,13 @@ _EOF_ #Menu if (( $INPUT == 0 )); then - /DietPi/dietpi/func/dietpi-notify 1 "Certbot scripts not found ( $DP_LETSENCRYPT_SCRIPTS )" + /DietPi/dietpi/func/dietpi-notify 1 "Certbot binary not found ( $DP_LETSENCRYPT_BINARY )" /DietPi/dietpi/func/dietpi-notify 2 "Please install Certbot with DietPi-Software before running this program." read -p "Press any key to continue....." else - echo -e "Error: Lets encrypt scripts not installed ( $DP_LETSENCRYPT_SCRIPTS )." >> "$DP_LOGFILE" + echo -e "Error: Letsencrypt binary not installed ( $DP_LETSENCRYPT_BINARY )." >> "$DP_LOGFILE" fi From ce5b23f06a6d60b1bfcd56200c85c9c9a9456ae2 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 29 Oct 2017 15:18:19 +0000 Subject: [PATCH 20/43] v158 + DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion package, shared with Motioneye, thanks @vilhelmp: https://github.com/Fourdee/DietPi/issues/1194 --- CHANGELOG.txt | 2 ++ dietpi/dietpi-software | 17 ++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 869698a0cc..8951f79150 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,10 +5,12 @@ Changes / Improvements / Optimizations: DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 DietPi-Sotware | AudioPhonics Pi-SPC: Now available for installation. Power control module which lets you physically power off system using a button: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9359#p9359 + Bug Fixes: DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. +DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion package, shared with Motioneye, thanks @vilhelmp: https://github.com/Fourdee/DietPi/issues/1194 Allo Web Interface Changes: Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index bc4245289a..a517e27a5b 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5466,23 +5466,23 @@ _EOF_ Banner_Installing if (( $DISTRO >= 4 )); then - + AGI certbot - + if (( ${aSOFTWARE_INSTALL_STATE[83]} >= 1 )); then AGI python-certbot-apache - + fi - + if (( ${aSOFTWARE_INSTALL_STATE[85]} >= 1 )); then AGI python-certbot-nginx - + fi else - + INSTALL_URL_ADDRESS='https://github.com/certbot/certbot/archive/master.zip' /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" @@ -5503,7 +5503,7 @@ _EOF_ Error_NoConnection_NoInstall fi - + fi fi @@ -12772,13 +12772,12 @@ _EOF_ elif (( $1 == 59 )); then - AGP gpac motion + AGP gpac rm -R /var/www/dietpicam rm /opt/vc/bin/raspimjpeg rm /usr/bin/raspimjpeg rm /etc/dietpi/dietpi-software/services/raspimjpeg.service rm /etc/raspimjpeg - rm /etc/motion/motion.conf elif (( $1 == 45 )); then From d5ed5d7da83a4683520b796706d0532a1a418c60 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 29 Oct 2017 16:12:29 +0000 Subject: [PATCH 21/43] v158 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + DietPi-Software | Raspotify: Now available for installation. Spotify Connect client for the Raspberry Pi (and other ARMv6/v7 devices) that Just Worksâ„¢: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9368#p9368 https://github.com/Fourdee/DietPi/issues/1189 --- CHANGELOG.txt | 1 + dietpi/dietpi-process_tool | 1 + dietpi/dietpi-services | 1 + dietpi/dietpi-software | 47 +++++++++++++++++++++++++++++++++++++- 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8951f79150..7d540222e1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Changes / Improvements / Optimizations: DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 DietPi-Sotware | AudioPhonics Pi-SPC: Now available for installation. Power control module which lets you physically power off system using a button: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9359#p9359 +DietPi-Software | Raspotify: Now available for installation. Spotify Connect client for the Raspberry Pi (and other ARMv6/v7 devices) that Just Worksâ„¢: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9368#p9368 Bug Fixes: DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index d75370ddc4..c4604e0ae3 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -253,6 +253,7 @@ aNAME[$index]='ProFTP';aPROCESS_NAME[$index]='proftpd';((index++)) aNAME[$index]='qBitTorrent';aPROCESS_NAME[$index]='qbittorrent-nox';((index++)) aNAME[$index]='Radarr';aPROCESS_NAME[$index]='Radarr.exe';((index++)) + aNAME[$index]='Raspotify';aPROCESS_NAME[$index]='librespot';((index++)) aNAME[$index]='RoonBridge';aPROCESS_NAME[$index]='RoonBridge';((index++)) aNAME[$index]='RoonBridge (Helper)';aPROCESS_NAME[$index]='RoonBridgeHelper';((index++)) aNAME[$index]='RoonBridge/Server (RAATServer)';aPROCESS_NAME[$index]='RAATServer';((index++)) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 236ea944fd..69334ff8c0 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -111,6 +111,7 @@ 'nukkit' 'gitea' 'pi-spc' + 'raspotify' ) # - User: read custom services file diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a517e27a5b..06803c9165 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -308,7 +308,7 @@ _EOF_ # - Software #NB: All software has a unique index that must not be changed (eg: DESKTOP_LXDE = 23) TOTAL_SOFTWARE_INDEXS=0 - TOTAL_SOFTWARE_INDEXS_HARDLIMIT=167 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init + TOTAL_SOFTWARE_INDEXS_HARDLIMIT=168 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init INSTALLING_INDEX=0 #Which software index is currently being installed? @@ -1071,6 +1071,21 @@ _EOF_ aSOFTWARE_REQUIRES_ALSA[$index_current]=1 aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9012#p9012' + #------------------ + index_current=167 + + aSOFTWARE_WHIP_NAME[$index_current]='Raspotify' + aSOFTWARE_WHIP_DESC[$index_current]='spotify connect client' + aSOFTWARE_CATEGORY_INDEX[$index_current]=2 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_REQUIRES_ALSA[$index_current]=1 + aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9368#p9368' + + #disable ARMv8: + aSOFTWARE_AVAIL_HW_ARCH[$index_current,3]=0 + + #disable x86_64: + aSOFTWARE_AVAIL_HW_ARCH[$index_current,10]=0 #BitTorrent #-------------------------------------------------------------------------------- @@ -7378,6 +7393,30 @@ _EOF_ fi + #Raspotify + INSTALLING_INDEX=167 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + + INSTALL_URL_ADDRESS='https://dtcooper.github.io/raspotify/key.asc' + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + if (( $? == 0 )); then + + wget -O - "$INSTALL_URL_ADDRESS" | apt-key add - + echo -e "deb https://dtcooper.github.io/raspotify jessie main" > /etc/apt/sources.list.d/raspotify.list + apt-get update + + AGI raspotify + + else + + Error_NoConnection_NoInstall + + fi + + fi + } Install_Linux_Software(){ @@ -13230,6 +13269,12 @@ _EOF_ rm /etc/systemd/system/pi-spc.service rm -R /etc/dietpi/audiophonics/pi-spc + elif (( $1 == 167 )); then + + AGP raspotify + rm /etc/apt/sources.list.d/raspotify.list + apt-get update + elif (( $1 == 158 )); then # Remove service systemctl stop minio.service From 530043069ebf583731bbd5bfe78d0048cce5f565 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 29 Oct 2017 17:28:20 +0000 Subject: [PATCH 22/43] v158 + DietPi-Software | Resolved an issue with Emby server (ARMv7/ARMv8) failing to install, due to missing packages not available in Debian repo: https://github.com/Fourdee/DietPi/issues/1150 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 40 ++++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7d540222e1..bd0edec7d0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion package, shared with Motioneye, thanks @vilhelmp: https://github.com/Fourdee/DietPi/issues/1194 +DietPi-Software | Resolved an issue with Emby server (ARMv7/ARMv8) failing to install, due to missing packages not available in Debian repo: https://github.com/Fourdee/DietPi/issues/1150 Allo Web Interface Changes: Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 06803c9165..d246998fe0 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5982,17 +5982,6 @@ _EOF_ Banner_Installing - #ARMv8, requires libjpeg from unofficial port in SID :(, all links provide 404... - # if (( $HW_ARCH == 3 )); then - - # INSTALL_URL_ADDRESS='http://ftp.de.debian.org/debian-ports//pool-arm64/main/libj/libjpeg8/libjpeg8_8d1-2_arm64.deb' - # /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" - # wget "$INSTALL_URL_ADDRESS" -O package.deb - # dpkg -i package.deb - # rm package.deb - - # fi - #ARM packages only available in 14.04 repo: https://github.com/Fourdee/DietPi/issues/1059#issuecomment-313661959 INSTALL_URL_ADDRESS='http://download.opensuse.org/repositories/home:/emby/xUbuntu_14.04/' @@ -6025,13 +6014,40 @@ _EOF_ rm Release.key apt-get update - #ARMv7, Grab Libjpeg8 from Wheezy: https://github.com/Fourdee/DietPi/issues/1128#issuecomment-326743471 + #ARMv7, Grab required pre-reqs from various sources: https://github.com/Fourdee/DietPi/issues/1128#issuecomment-326743471 / https://github.com/Fourdee/DietPi/issues/1150#issuecomment-330291298 if (( $HW_ARCH == 2 )); then wget http://ftp.us.debian.org/debian/pool/main/libj/libjpeg8/libjpeg8_8d-1+deb7u1_armhf.deb -O package.deb dpkg -i package.deb rm package.deb + wget http://ftp.us.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u3_armhf.deb -O package.deb + dpkg -i package.deb + rm package.deb + + wget http://ftp.us.debian.org/debian/pool/main/libw/libwebp/libwebp5_0.4.1-1.2+b2_armhf.deb -O package.deb + dpkg -i package.deb + rm package.deb + + #ARMv8 + elif (( $HW_ARCH == 3 )); then + + wget http://ftp.us.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u3_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb + + wget http://ftp.us.debian.org/debian/pool/main/libw/libwebp/libwebp5_0.4.1-1.2+b2_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb + + wget https://mirror.i-novus.ru/ubuntu-ports/pool/main/libj/libjpeg-turbo/libjpeg-turbo8_1.3.0-0ubuntu2_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb + + wget http://turul.canonical.com/pool/main/libj/libjpeg8-empty/libjpeg8_8c-2ubuntu8_arm64.deb -O package.deb + dpkg -i package.deb + rm package.deb + fi AGI emby-server embymagick From 75fd6f2caa1508ef592e7950d303de935d56d532 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 29 Oct 2017 18:22:16 +0000 Subject: [PATCH 23/43] v158 + DietPi-Config | Rock64: Resolved an issue with incorrect card/device indexs for HDMI/3.5mm, thanks @BryanSmithDev : https://github.com/Fourdee/DietPi/issues/1102 --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 6 +++--- dietpi/func/dietpi-set_hardware | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index bd0edec7d0..c0816f7d7d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -10,6 +10,7 @@ DietPi-Software | Raspotify: Now available for installation. Spotify Connect cli Bug Fixes: DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 +DietPi-Config | Rock64: Resolved an issue with incorrect card/device indexs for HDMI/3.5mm, thanks @BryanSmithDev : https://github.com/Fourdee/DietPi/issues/1102 DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion package, shared with Motioneye, thanks @vilhelmp: https://github.com/Fourdee/DietPi/issues/1194 DietPi-Software | Resolved an issue with Emby server (ARMv7/ARMv8) failing to install, due to missing packages not available in Debian repo: https://github.com/Fourdee/DietPi/issues/1150 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index da86dd2a14..cb4671e4c0 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4416,8 +4416,8 @@ _EOF_ whiptail_menu_array+=("none" "Disables HDMI + 3.5mm Analogue") - # NanoPi M2/M3, BPi Pro, OPi Zero, Rock64 - elif (( $HW_MODEL == 32 || $HW_MODEL == 43 || $HW_MODEL == 51 || $HW_MODEL == 61 || $HW_MODEL == 62 )); then + # NanoPi M2/M3, BPi Pro, OPi Zero + elif (( $HW_MODEL == 32 || $HW_MODEL == 51 || $HW_MODEL == 61 || $HW_MODEL == 62 )); then whiptail_menu_array+=("default" "3.5mm Analogue") @@ -4504,7 +4504,7 @@ _EOF_ # - Rock64 elif (( $HW_MODEL == 43 )); then - whiptail_menu_array+=("rock64-hdmi" "HDMI") + whiptail_menu_array+=("rock64-analogue" "3.5MM") # NanoPi M2/M3 elif (( $HW_MODEL == 61 || $HW_MODEL == 62 )); then diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 889ebc8ebb..e550eb498b 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -2101,7 +2101,7 @@ _EOF_ ;; #Rock64 ------------------------------------------------------------------------------- - rock64-hdmi) + rock64-analogue) SOUNDCARD_TARGET_CARD=1 From 80cf80c06cfdf55674f51c52feddbb09721081cf Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 29 Oct 2017 19:02:48 +0000 Subject: [PATCH 24/43] v158 + DietPi-Software | Sabnzbd: Updated to 2.3.1 for new installations only. Thanks @Invictaz : https://github.com/Fourdee/DietPi/issues/865#issuecomment-340282019 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c0816f7d7d..dd8ddadf83 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ DietPi-Software | Gitea: Now available for installation. Many thanks to @techdab DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 DietPi-Sotware | AudioPhonics Pi-SPC: Now available for installation. Power control module which lets you physically power off system using a button: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9359#p9359 DietPi-Software | Raspotify: Now available for installation. Spotify Connect client for the Raspberry Pi (and other ARMv6/v7 devices) that Just Worksâ„¢: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9368#p9368 +DietPi-Software | Sabnzbd: Updated to 2.3.1 for new installations only. Thanks @Invictaz : https://github.com/Fourdee/DietPi/issues/865#issuecomment-340282019 Bug Fixes: DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d246998fe0..feba9e63f2 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6758,7 +6758,7 @@ _EOF_ Banner_Installing - local version='2.3.0' + local version='2.3.1' INSTALL_URL_ADDRESS="https://github.com/sabnzbd/sabnzbd/archive/$version.zip" From ed5b0ad0ade153b6eb36edee5403c24d05c96d89 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 5 Nov 2017 18:44:15 +0100 Subject: [PATCH 25/43] [Nextcloud] Fix database creation - Database was created with wrong privileges for user "root", thus user "oc_admin" is not able to access. - On top, "occ maintenance:install" creates the database and user automatically, thus if "create_mysql_db" is used to create database with correct user oc_admin (_$username), Nextcloud will create "oc_admin1" as user via "occ maintenance:install" and use it. => Remove "create_mysql_db" works fine for me, Nextcloud is accessible. --- dietpi/dietpi-software | 3 --- 1 file changed, 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a4f0c4a525..1195736e6c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8967,9 +8967,6 @@ _EOF_ fi - # - Create DB v11: https://github.com/Fourdee/DietPi/issues/647#issuecomment-267019815 - /DietPi/dietpi/func/create_mysql_db nextcloud "$GLOBAL_PW" root "$GLOBAL_PW" - sudo -u www-data php /var/www/nextcloud/occ maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA_DIRECTORY/nextcloud_data" #Disable trusted_domains. From fbee7c70a41d2f1d40711deee562e41d22a0ea97 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 5 Nov 2017 23:45:07 +0100 Subject: [PATCH 26/43] Fix Nginx config - Put "fastcgi_param PHP_ADMIN_VALUE ..." into \.php location, where is works. - Add X-Headers to the location base, so they are active for the whole location and prevent Nextcloud admin panel warnings. - Comment out "fastcgi_param HTTPS on;" to prevent auto redirect to https:// on non-ssl environments => Uncommenting on SSL activation needs to be added. - Uncommenting "fastcgi_request_buffering off;" on Stretch. Tested on Jessie and Stretch VM. --- dietpi/dietpi-software | 46 +++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1195736e6c..5d824348bd 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8871,6 +8871,12 @@ _EOF_ cat << _EOF_ > /etc/nginx/sites-dietpi/nextcloud.config location ^~ /nextcloud { + add_header X-Content-Type-Options nosniff; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + add_header X-Download-Options noopen; + add_header X-Permitted-Cross-Domain-Policies none; + # set max upload size client_max_body_size $(( $(php -r 'print(PHP_INT_MAX);') / 1024 / 1024))M; fastcgi_buffers 64 4K; @@ -8894,27 +8900,31 @@ location ^~ /nextcloud { location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)/ { deny all; } + location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } location ~ ^/nextcloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) { - include fastcgi_params; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_param SCRIPT_FILENAME \$request_filename; - fastcgi_param PATH_INFO \$fastcgi_path_info; - fastcgi_param HTTPS on; - # Avoid sending the security headers twice - fastcgi_param modHeadersAvailable true; - fastcgi_param REMOTE_USER \$remote_user; - fastcgi_pass unix:/var/run/php5-fpm.sock; - fastcgi_intercept_errors on; - # Disable because Jessie Nginx does not support that parameter - #fastcgi_request_buffering off; + include fastcgi_params; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_param SCRIPT_FILENAME \$request_filename; + fastcgi_param PATH_INFO \$fastcgi_path_info; + # HTTPS forces redirection from http://, thus has to be enabled only on active HTTPS environment. + #fastcgi_param HTTPS on; + # Avoid sending the security headers twice + fastcgi_param modHeadersAvailable true; + fastcgi_param REMOTE_USER \$remote_user; + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_intercept_errors on; + # Disable because Jessie Nginx does not support that parameter + #fastcgi_request_buffering off; + # Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. + fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128"; } location ~ ^/nextcloud/(?:updater|ocs-provider)(?:$|/) { - try_files \$uri/ =404; + try_files \$uri/ =404; index index.php; } @@ -8922,9 +8932,9 @@ location ^~ /nextcloud { # Make sure it is BELOW the PHP block location ~ \.(?:css|js|woff|svg|gif)$ { try_files \$uri /nextcloud/index.php\$uri\$is_args\$args; - add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; + add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; add_header Cache-Control "public, max-age=15778463"; - add_header X-Content-Type-Options nosniff; + add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; add_header X-Download-Options noopen; @@ -8939,16 +8949,14 @@ location ^~ /nextcloud { access_log off; } - # Hard coding 128M OPCache size, only for /nextcloud, to suppress warning on nextcloud admin panel. - fastcgi_param PHP_ADMIN_VALUE "opcache.memory_consumption=128"; - } _EOF_ - # - Stretch, set php7.0 + # - Stretch, set php7.0 and set fastcgi_request_buffering off; if (( $DISTRO >= 4 )); then sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" /etc/nginx/sites-dietpi/nextcloud.config + sed -i "s#\#fastcgi_request_buffering off;#fastcgi_request_buffering off;#g" /etc/nginx/sites-dietpi/nextcloud.config fi From 0e9806dff2628a41e652a9dc7d11a618b8142aa9 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Tue, 7 Nov 2017 18:27:42 +0000 Subject: [PATCH 27/43] v158 + DietPi-Software | moOde: Initial pass adding into DietPi: https://github.com/Fourdee/DietPi/issues/1223 + DietPi-Set_Software | Improved useradd/userdel functions. Please see sourcecode for details. + General | Sparky SBC: Applied latest kernel (USB + ETH) stability patches, which will resolve loss of connection, audio device and URB errors. Thanks @Sudeep. + General | Fixed kill-ssh-user-sessions-before-network.service, to prevent it always generating an error. + DietPi-Set_Software | DietPi User: Resolved an issue where /etc/sudoers was being incorrectly written with additional \. --- CHANGELOG.txt | 5 + PREP_SYSTEM_FOR_DIETPI.sh | 3 +- dietpi/dietpi-obtain_hw_model | 6 + dietpi/dietpi-process_tool | 1 + dietpi/dietpi-services | 1 + dietpi/dietpi-software | 390 +++++++++++++++++++++++++++++++- dietpi/finalise | 2 +- dietpi/func/dietpi-set_hardware | 1 + dietpi/func/dietpi-set_software | 115 ++++++---- dietpi/patch_file | 34 ++- 10 files changed, 503 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dd8ddadf83..fd11f20f0c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,17 +2,22 @@ v158 (xx/10/17) Changes / Improvements / Optimizations: +DietPi-Software | moOde: Initial pass adding into DietPi: https://github.com/Fourdee/DietPi/issues/1223 DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 DietPi-Sotware | AudioPhonics Pi-SPC: Now available for installation. Power control module which lets you physically power off system using a button: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9359#p9359 DietPi-Software | Raspotify: Now available for installation. Spotify Connect client for the Raspberry Pi (and other ARMv6/v7 devices) that Just Worksâ„¢: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9368#p9368 DietPi-Software | Sabnzbd: Updated to 2.3.1 for new installations only. Thanks @Invictaz : https://github.com/Fourdee/DietPi/issues/865#issuecomment-340282019 +DietPi-Set_Software | Improved useradd/userdel functions. Please see sourcecode for details. Bug Fixes: +General | Sparky SBC: Applied latest kernel (USB + ETH) stability patches, which will resolve loss of connection, audio device and URB errors. Thanks @Sudeep. +General | Fixed kill-ssh-user-sessions-before-network.service, to prevent it always generating an error. DietPi-Config | Corrected descriptions for Auto swapfile size, and, Ondemand as recommended CPU gov. Thanks @k-plan : https://github.com/Fourdee/DietPi/issues/1205 DietPi-Config | NAS: Resolved an issue where samba client share names, which contained spaces, would cause the mount the fail: https://github.com/Fourdee/DietPi/issues/1201 DietPi-Config | Rock64: Resolved an issue with incorrect card/device indexs for HDMI/3.5mm, thanks @BryanSmithDev : https://github.com/Fourdee/DietPi/issues/1102 DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, the soundcard will be reset to 'none'. +DietPi-Set_Software | DietPi User: Resolved an issue where /etc/sudoers was being incorrectly written with additional \. DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion package, shared with Motioneye, thanks @vilhelmp: https://github.com/Fourdee/DietPi/issues/1194 DietPi-Software | Resolved an issue with Emby server (ARMv7/ARMv8) failing to install, due to missing packages not available in Debian repo: https://github.com/Fourdee/DietPi/issues/1150 diff --git a/PREP_SYSTEM_FOR_DIETPI.sh b/PREP_SYSTEM_FOR_DIETPI.sh index ed7d53813e..b6efabd0cd 100644 --- a/PREP_SYSTEM_FOR_DIETPI.sh +++ b/PREP_SYSTEM_FOR_DIETPI.sh @@ -287,7 +287,7 @@ Before=network.target shutdown.target [Service] Type=oneshot -ExecStart=/usr/bin/killall sshd && /usr/bin/killall dropbear +ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' [Install] WantedBy=poweroff.target halt.target reboot.target @@ -438,6 +438,7 @@ sed -i "/FORCE=/c\FORCE=force" /etc/default/fake-hwclock # echo -e "options 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf # echo -e "options 8189es rtw_power_mgnt=0" > /etc/modprobe.d/8189es.conf + #Set swapfile size echo -e "CONF_SWAPSIZE=0" > /etc/dphys-swapfile diff --git a/dietpi/dietpi-obtain_hw_model b/dietpi/dietpi-obtain_hw_model index b956a0a953..81729255ca 100644 --- a/dietpi/dietpi-obtain_hw_model +++ b/dietpi/dietpi-obtain_hw_model @@ -20,6 +20,7 @@ # HW_MODEL 100 Asus Tinker Board # HW_MODEL 90 A20-OLinuXino-MICRO # HW_MODEL 80 Cubieboard 3 + # HW_MODEL 71 Beagle Bone Black # HW_MODEL 70 Sparky SBC # HW_MODEL 66 NanoPi M1 Plus # HW_MODEL 65 NanoPi NEO 2 @@ -397,6 +398,11 @@ HW_MODEL_DESCRIPTION='Cubieboard 3' IMAGE_ADDITIONAL_CREDITS='ARMbian' + #Beagle Bone Black + elif (( $HW_MODEL == 71 )); then + + HW_MODEL_DESCRIPTION='BBB' + #Sparky SBC elif (( $HW_MODEL == 70 )); then diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index c4604e0ae3..4f49850b42 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -232,6 +232,7 @@ aNAME[$index]='Jconvolver';aPROCESS_NAME[$index]='jconvolver';((index++)) aNAME[$index]='Minio';aPROCESS_NAME[$index]='minio';((index++)) aNAME[$index]='MiniDLNA';aPROCESS_NAME[$index]='minidlna';((index++)) + #aNAME[$index]='moOde (worker.php)';aPROCESS_NAME[$index]='worker.php';((index++)) aNAME[$index]='Mopidy';aPROCESS_NAME[$index]='mopidy';((index++)) aNAME[$index]='Mosquitto';aPROCESS_NAME[$index]='mosquitto';((index++)) aNAME[$index]='MotionEye';aPROCESS_NAME[$index]='motioneye';((index++)) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 69334ff8c0..a9c81fb970 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -112,6 +112,7 @@ 'gitea' 'pi-spc' 'raspotify' + #'moode-worker' ) # - User: read custom services file diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a4f0c4a525..42947e89b6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -308,7 +308,7 @@ _EOF_ # - Software #NB: All software has a unique index that must not be changed (eg: DESKTOP_LXDE = 23) TOTAL_SOFTWARE_INDEXS=0 - TOTAL_SOFTWARE_INDEXS_HARDLIMIT=168 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init + TOTAL_SOFTWARE_INDEXS_HARDLIMIT=169 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init INSTALLING_INDEX=0 #Which software index is currently being installed? @@ -1087,7 +1087,21 @@ _EOF_ #disable x86_64: aSOFTWARE_AVAIL_HW_ARCH[$index_current,10]=0 - #BitTorrent + #------------------ + index_current=168 + + aSOFTWARE_WHIP_NAME[$index_current]='moOde' + aSOFTWARE_WHIP_DESC[$index_current]='audiophile-quality music playback' + aSOFTWARE_CATEGORY_INDEX[$index_current]=2 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_REQUIRES_WEBSERVER[$index_current]=1 + aSOFTWARE_REQUIRES_SQLITE[$index_current]=1 + aSOFTWARE_REQUIRES_BUILDESSENTIAL[$index_current]=1 + aSOFTWARE_REQUIRES_GIT[$index_current]=1 + aSOFTWARE_REQUIRES_ALSA[$index_current]=1 + aSOFTWARE_ONLINEDOC_URL[$index_current]='xxxxxxxxxxxxxxxxx' + + #BitTorrent #-------------------------------------------------------------------------------- index_current=44 @@ -2655,13 +2669,33 @@ _EOF_ fi + #Additional Software required by moOde + if (( ${aSOFTWARE_INSTALL_STATE[168]} == 1 )); then + + #aSOFTWARE_INSTALL_STATE[36]=1 # Squeezelite # Disabled/optional + #aSOFTWARE_INSTALL_STATE[37]=1 # Shairport Sync # Disabled/optional + #aSOFTWARE_INSTALL_STATE[128]=1 # MPD # Compiled during install, as per moOde docs + #aSOFTWARE_INSTALL_STATE[60]=1 # WiFi Hotspot # Installed as per moOde docs + + /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[78]} will be installed" + aSOFTWARE_INSTALL_STATE[78]=1 # LESP, override user choice for now. + + /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[1]} will be installed" + aSOFTWARE_INSTALL_STATE[1]=1 # Samba Client + + /DietPi/dietpi/func/dietpi-notify 2 "${aSOFTWARE_WHIP_NAME[96]} will be installed" + aSOFTWARE_INSTALL_STATE[96]=1 # Samba Server + + fi + #Software that requires Avahi-Daemon index=152 if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || ${aSOFTWARE_INSTALL_STATE[37]} == 1 || ${aSOFTWARE_INSTALL_STATE[128]} == 1 || ${aSOFTWARE_INSTALL_STATE[138]} == 1 || - ${aSOFTWARE_INSTALL_STATE[163]} == 1)); then + ${aSOFTWARE_INSTALL_STATE[163]} == 1 || + ${aSOFTWARE_INSTALL_STATE[168]} == 1 )); then if (( ${aSOFTWARE_INSTALL_STATE[$index]} == 0 )); then @@ -7433,6 +7467,155 @@ _EOF_ fi + #moOde + INSTALLING_INDEX=168 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + + INSTALL_URL_ADDRESS='http://moodeaudio.org/downloads/beta/r40b7/rel-stretch.zip' + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + if (( $? == 0 )); then + + cd "$HOME" + wget "$INSTALL_URL_ADDRESS" -O package.zip + unzip -o package.zip + + #Pre-Reqs ----------------------------------------------------------------------- + # Core packages + AGI rpi-update mpc memcached $PHP_APT_PACKAGE_NAME-memcache \ +bs2b-ladspa libbs2b0 libasound2-plugin-equal telnet automake sysstat tcpdump shellinabox \ +udisks-glue exfat-fuse inotify-tools libav-tools + +#php5-memcached + + # WiFi Hotspot + AGI dnsmasq hostapd + + # BT + AGI bluez bluez-firmware \ +dh-autoreconf expect libortp-dev libbluetooth-dev libasound2-dev \ +libusb-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libsbc1 libsbc-dev + + if (( $HW_MODEL < 10 )); then + + AGI pi-bluetooth + + fi + + # MPD dev libs for compile + AGI libmad0-dev libmpg123-dev libid3tag0-dev \ +libflac-dev libvorbis-dev libfaad-dev \ +libwavpack-dev \ +libavcodec-dev libavformat-dev \ +libmp3lame-dev \ +libsoxr-dev \ +libcdio-paranoia-dev libiso9660-dev \ +libcurl4-gnutls-dev \ +libasound2-dev \ +libshout3-dev libyajl-dev \ +libmpdclient-dev \ +libavahi-client-dev \ +libsystemd-dev \ +libwrap0-dev \ +libboost-dev \ +libicu-dev \ +libglib2.0-dev + + #Disable Shell in box -------------------------------------------------------------------- + systemctl stop shellinabox + systemctl disable shellinabox + + #HostAPD/BT ------------------------------------------------------------------------------- + systemctl disable hostapd + systemctl disable dnsmasq + + cd "$HOME" + git clone https://github.com/Arkq/bluez-alsa.git --depth=1 + cd bluez-alsa + autoreconf --install + mkdir build + cd build + ../configure --disable-hcitop --with-alsaplugindir=/usr/lib/arm-linux-gnueabihf/alsa-lib + make -j $(nproc --all) + make install + cd "$HOME" + rm -rf bluez-alsa + + systemctl daemon-reload + systemctl disable bluetooth.service + systemctl disable bluealsa.service + systemctl disable hciuart.service + + mkdir -p /var/run/bluealsa + + #Wiring Pi ------------------------------------------------------------------------------- + #??? Use/test with DietPi WP install + cd "$HOME" + cp ./rel-stretch/other/wiringpi/wiringPi-*.tar.gz ./ + tar xfz ./wiringPi-*.tar.gz + cd wiringPi-96344ff + ./build + cd "$HOME" + rm -rf ./wiringPi-* + + #Rotary encoder driver -------------------------------------------------------------------- + cp ./rel-stretch/other/rotenc/rotenc.c ./ + gcc -std=c99 rotenc.c -orotenc -lwiringPi + cp ./rotenc /usr/local/bin + rm ./rotenc* + + #Compile and install MPD ------------------------------------------------------------------ + #??? Use DietPi's MPD install in future? + # ENV + useradd mpd + mkdir /var/lib/mpd + mkdir /var/lib/mpd/music + mkdir /var/lib/mpd/playlists + touch /var/lib/mpd/state + chown -R mpd:audio /var/lib/mpd + mkdir /var/log/mpd + touch /var/log/mpd/mpd.log + chmod 644 /var/log/mpd/mpd.log + chown -R mpd:audio /var/log/mpd + cp ./rel-stretch/mpd/mpd.conf.default /etc/mpd.conf + chown mpd:audio /etc/mpd.conf + chmod 0666 /etc/mpd.conf + mkdir -p /var/run/mpd + + # Download/compile + cd "$HOME" + wget http://www.musicpd.org/download/mpd/0.20/mpd-0.20.10.tar.xz + tar xf mpd-*.tar.xz + cd mpd-0.20.10 + ./autogen.sh + + ./configure --enable-database --enable-libmpdclient --enable-alsa \ +--enable-curl --enable-dsd --enable-ffmpeg --enable-flac \ +--enable-id3 --enable-soundcloud --enable-lame-encoder --enable-mad \ +--enable-mpg123 --enable-pipe-output --enable-recorder-output --enable-shout \ +--enable-vorbis --enable-wave-encoder --enable-wavpack --enable-httpd-output \ +--enable-soxr --with-zeroconf=avahi \ +--disable-bzip2 --disable-zzip --disable-fluidsynth --disable-gme \ +--disable-wildmidi --disable-sqlite --disable-jack --disable-ao --disable-oss \ +--disable-ipv6 --disable-pulse --disable-nfs --disable-smbclient \ +--disable-upnp --disable-expat --disable-lsr \ +--disable-sndfile --disable-audiofile --disable-sidplay + + make -j $(nproc --all) + make install + strip --strip-unneeded /usr/local/bin/mpd + cd "$HOME" + rm -R mpd-* + + else + + Error_NoConnection_NoInstall + + fi + + fi + } Install_Linux_Software(){ @@ -12335,6 +12518,207 @@ _EOF_ fi + #moOde Configuration + INSTALLING_INDEX=168 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + #Create moOde runtime environment --------------------------------------------------------- + # Create Pi user, does not exist on DietPi systems. + # - Required for some moOde bash scripts which live in /home/pi + /DietPi/dietpi/func/dietpi-set_software useradd pi + + # Priv + #echo -e 'pi\tALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers # Completed with /DietPi/dietpi/func/dietpi-set_software useradd pi + echo -e 'www-data\tALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + + # Dirs + mkdir -p /var/local/www/commandw + mkdir -p /var/local/www/cssw + mkdir -p /var/local/www/jsw + mkdir -p /var/local/www/imagesw + mkdir -p /var/local/www/imagesw/toggle + mkdir -p /var/local/www/db + mkdir -p /var/local/www/templatesw + chmod -R 0755 /var/local/www + + mkdir -p /var/lib/mpd/music/RADIO + mkdir -p /mnt/NAS + mkdir -p /mnt/SDCARD + mkdir -p /mnt/UPNP + mkdir /media + + # Symlinks + ln -s /mnt/NAS /var/lib/mpd/music/NAS + ln -s /mnt/SDCARD /var/lib/mpd/music/SDCARD + ln -s /media /var/lib/mpd/music/USB + ln -s /var/lib/mpd/music /var/www/mpdmusic + + # Logs + touch /var/log/moode.log + chmod 0666 /var/log/moode.log + touch /var/log/php_errors.log + chmod 0666 /var/log/php_errors.log + + # Files + cp ./rel-stretch/mpd/sticker.sql /var/lib/mpd + cp -r "./rel-stretch/other/sdcard/Stereo Test/" /var/lib/mpd/music/SDCARD + #cp ./rel-stretch/network/interfaces.default /etc/network/interfaces #Disabled as overwrites DietPi network conf. As DietPi does not use/set /etc/dhcpcd.conf, this will render no connection after reboot. + cp ./rel-stretch/network/wpa_supplicant.conf.default /etc/wpa_supplicant/wpa_supplicant.conf + cp ./rel-stretch/network/dhcpcd.conf.default /etc/dhcpcd.conf + cp ./rel-stretch/network/hostapd.conf.default /etc/hostapd/hostapd.conf + cp ./rel-stretch/var/local/www/db/moode-sqlite3.db.default /var/local/www/db/moode-sqlite3.db + + # Permissions + chmod 0777 /var/lib/mpd/music/RADIO + chmod -R 0777 /var/local/www/db + + # Deletes + rm /etc/update-motd.d/10-uname + + #Install moOde sources and configs --------------------------------------------------------- + # Application sources and configs + rm /var/lib/mpd/music/RADIO/* + rm /var/www/images/radio-logos/* + + cp ./rel-stretch/mpd/RADIO/* /var/lib/mpd/music/RADIO + cp ./rel-stretch/mpd/playlists/* /var/lib/mpd/playlists + cp -r ./rel-stretch/etc/* /etc/ + cp -r ./rel-stretch/home/* /home/pi/ + cp -r ./rel-stretch/home/.dircolors /home/pi/ + cp -r ./rel-stretch/lib/* /lib/ + cp -r ./rel-stretch/usr/* /usr/ + cp -r ./rel-stretch/var/* /var/ + cp -r ./rel-stretch/www/* /var/www/ + + # Prep SQL DB + chmod 0755 /var/www/command/* + /var/www/command/util.sh "emerald" "2ecc71" "27ae60" + sqlite3 /var/local/www/db/moode-sqlite3.db "update cfg_system set value='Emerald' where param='themecolor'" + + # Permissions for service files + # - MPD + chmod 0755 /etc/init.d/mpd + chmod 0644 /lib/systemd/system/mpd.service + chmod 0644 /lib/systemd/system/mpd.socket + + # - Bluetooth + chmod 0666 /etc/bluealsaaplay.conf + chmod 0644 /etc/systemd/system/bluealsa-aplay@.service + chmod 0644 /etc/systemd/system/bluealsa.service + chmod 0644 /lib/systemd/system/bluetooth.service + chmod 0755 /usr/local/bin/a2dp-autoconnect + + # - Rotenc + chmod 0644 /lib/systemd/system/rotenc.service + + # - Udev + chmod 0644 /etc/udev/rules.d/* + + # Services are started by moOde Worker so lets disable them here. + systemctl daemon-reload + #systemctl disable mpd.service #dietpi-services + systemctl disable mpd.socket + systemctl disable rotenc.service + + # Following binaries will not have been installed yet, but let's disable the services here + chmod 0644 /lib/systemd/system/squeezelite-armv6l.service + chmod 0644 /lib/systemd/system/squeezelite-armv7l.service + systemctl disable squeezelite-armv6l + systemctl disable squeezelite-armv7l + chmod 0644 /lib/systemd/system/upmpdcli.service + systemctl disable upmpdcli.service + + # Initial permissions for certain files. These also get set during moOde Worker startup. + chmod 0777 /var/local/www/playhistory.log + chmod 0777 /var/local/www/currentsong.txt + touch /var/local/www/libcache.json + chmod 0777 /var/local/www/libcache.json + + #ALSAEQ ------------------------------------------------------------------------------------ + #alsamixer -D alsaequal # Disabled, need to automate alsaequal.bin generation. + chmod 0755 /usr/local/bin/alsaequal.bin + chown mpd:audio /usr/local/bin/alsaequal.bin + rm /usr/share/alsa/alsa.conf.d/equal.conf + + mpc enable only 1 + + #DietPi - Post steps START ----------------------------------------------------------------- + # PHP-FPM set to v5 if Jessie + # /etc/nginx/nginx.conf + # fastcgi_pass unix:/run/php5-fpm.sock; + + # Link /mnt/dietpi_userdata/Music to MPD/moOde defaults + ln -sf /mnt/dietpi_userdata/Music /var/lib/mpd/music/DietPi_UserData_Music + + # ??? Support for all webserver types with global site conf? (eg: lighttpd/nginx/apache2) + # Need to also look at fastcgi_parms in /etc/nginx + # ln -sf /var/local/www/cssw /var/www/cssw + # ln -sf /var/local/www/imagesw /var/www/imagesw + # ln -sf /var/local/www/jsw /var/www/jsw + # ln -sf /var/local/www/templatesw /var/www/templatesw + # chown -R www-data:www-data /var/local/www + + #Remove default .html site + rm /var/www/index.h* + + # Combined /etc/rc.local + cat << _EOF_ > /etc/rc.local +#!/bin/bash +#Precaution: Wait for DietPi Ramdisk to finish +while [ ! -f /DietPi/.ramdisk ] +do + + /DietPi/dietpi/func/dietpi-notify 2 "Waiting for DietPi-RAMDISK to finish mounting DietPi to RAM..." + sleep 1 + +done + +echo -e "\$(cat /proc/uptime | awk '{print \$1}') Seconds" > /var/log/boottime +if (( \$(cat /DietPi/dietpi/.install_stage) == 1 )); then + + /DietPi/dietpi/dietpi-services start + +fi +/DietPi/dietpi/dietpi-banner 0 +echo -e " Default Login:\n Username = root\n Password = dietpi\n" + +#moOde additions +SQLDB=/var/local/www/db/moode-sqlite3.db + +# set cpu govenor +RESULT=\$(sqlite3 \$SQLDB "select value from cfg_system where param='cpugov'") +echo "\$RESULT" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor + +/usr/bin/udisks-glue > /dev/null 2>&1 +/var/www/command/worker.php > /dev/null 2>&1 + +exit 0 +_EOF_ + + # moOde worker service + # ??? Hangs on /bin/systemd-tty-ask-password-agent --watch + # cat << _EOF_ > /etc/systemd/system/moode-worker.service +# [Unit] +# Description=moOde worker.php service +# After=php7.0-fpm.service php5-fpm.service apache2.service lighttpd.service nginx.service + +# [Service] +# Type=forking +# StandardOutput=tty +# StandardInput=tty +# User=root +# ExecStart=/bin/bash -c '/var/www/command/worker.php' + +# [Install] +# WantedBy=multi-user.target +# _EOF_ + + Download_Test_Media + + #DietPi - Post steps END ------------------------------------------------------------------- + + fi + } Install_Apply_GPU_Settings(){ diff --git a/dietpi/finalise b/dietpi/finalise index 44039e47e4..1a189de078 100644 --- a/dietpi/finalise +++ b/dietpi/finalise @@ -303,7 +303,7 @@ _EOF_ #//////////////////////////////////// #Create DietPi user: https://github.com/Fourdee/DietPi/issues/796 - /DietPi/dietpi/func/dietpi-set_software useradd_dietpi 1 + /DietPi/dietpi/func/dietpi-set_software useradd dietpi #//////////////////////////////////// # Reset DietPi generated files diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index e550eb498b..8e5e2af59b 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1360,6 +1360,7 @@ _EOF_ echo -e "options 8188eu rtw_power_mgnt=0" > /etc/modprobe.d/8188eu.conf echo -e "options 8189es rtw_power_mgnt=0" > /etc/modprobe.d/8189es.conf #OPi Plus echo -e "options 8723bs rtw_power_mgnt=0" > /etc/modprobe.d/8723bs.conf #PineA64 + echo -e "options wlan_8192eu rtw_power_mgnt=0" > /etc/modprobe.d/wlan_8192eu.conf # Sparky/Allo WiFi #cfg80211 first for ((i=0; i<${#aWIFI_MODULES[@]}; i++)) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index d23e52ac30..f95c41429b 100644 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -12,7 +12,8 @@ # Usage: # # - /DietPi/dietpi/func/dietpi-set_software allo eth_dhcp / eth_static - # - /DietPi/dietpi/func/dietpi-set_software useradd_dietpi 0=delete / 1=create + # - /DietPi/dietpi/func/dietpi-set_software useradd X=create user with name X and default permissions, using global DietPi password (dietpi) + # - /DietPi/dietpi/func/dietpi-set_software userdel X=delete user with name X # - /DietPi/dietpi/func/dietpi-set_software apt-mirror url/default # - /DietPi/dietpi/func/dietpi-set_software ntpd-mirror url/default #//////////////////////////////////// @@ -207,72 +208,84 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - # Add DietPi user + # Users #///////////////////////////////////////////////////////////////////////////////////// - Useradd_DietPi_Main(){ + Useradd_Main(){ if [ -n "$INPUT_MODE_VALUE" ]; then - # - Delete - if [ "$INPUT_MODE_VALUE" = "disable" ]; then + # - Create $INPUT_MODE_VALUE - userdel -f dietpi - rm -R /home/dietpi + mkdir -p /home + useradd -m -s /bin/bash "$INPUT_MODE_VALUE" + chpasswd <<< "$INPUT_MODE_VALUE:$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//')" - # - Create - elif [ "$INPUT_MODE_VALUE" = "enable" ]; then + # Copy existing profile/bashrc + cp /root/.profile /home/$INPUT_MODE_VALUE/ + cp /root/.bashrc /home/$INPUT_MODE_VALUE/ - mkdir -p /home - useradd -m -s /bin/bash dietpi - chpasswd <<< "dietpi:$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//')" + # Sudo up dietpi login script + sed -i '/^\/DietPi\/dietpi\/login/c\sudo \/DietPi\/dietpi\/login' /home/$INPUT_MODE_VALUE/.bashrc - # Copy existing profile/bashrc - cp /root/.profile /home/dietpi/ - cp /root/.bashrc /home/dietpi/ + chown -R $INPUT_MODE_VALUE:$INPUT_MODE_VALUE /home/$INPUT_MODE_VALUE - # Sudo up dietpi login script - sed -i '/^\/DietPi\/dietpi\/login/c\sudo \/DietPi\/dietpi\/login' /home/dietpi/.bashrc + # Allow sudo without pw + if (( ! $(cat /etc/sudoers | grep -ci -m1 "^$INPUT_MODE_VALUE[[:space:]]") )); then - chown -R dietpi:dietpi /home/dietpi + cat << _EOF_ >> /etc/sudoers +$INPUT_MODE_VALUE ALL=NOPASSWD: ALL +_EOF_ - # Allow sudo without pw - if (( ! $(cat /etc/sudoers | grep -ci -m1 '^dietpi') )); then + fi - echo -e "\dietpi ALL=NOPASSWD: ALL\n" >> /etc/sudoers + # Same groups as user pi + local group_array=() + group_array+=('input') + group_array+=('netdev') + group_array+=('spi') + group_array+=('i2c') + group_array+=('gpio') + group_array+=('tty') + group_array+=('users') + group_array+=('games') + group_array+=('plugdev') + group_array+=('video') + group_array+=('audio') + group_array+=('sudo') + group_array+=('cdrom') + group_array+=('dialout') + group_array+=('adm') + + # + allow access to www-data + group_array+=('www-data') + + for ((i=0; i<${#group_array[@]}; i++)) + do - fi + usermod -a -G ${group_array[$i]} $INPUT_MODE_VALUE + + done + + unset group_array + + else - # Same groups as user pi - local group_array=() - group_array+=('input') - group_array+=('netdev') - group_array+=('spi') - group_array+=('i2c') - group_array+=('gpio') - group_array+=('tty') - group_array+=('users') - group_array+=('games') - group_array+=('plugdev') - group_array+=('video') - group_array+=('audio') - group_array+=('sudo') - group_array+=('cdrom') - group_array+=('dialout') - group_array+=('adm') + Unknown_Input_Mode - # + allow access to www-data - group_array+=('www-data') + fi - for ((i=0; i<${#group_array[@]}; i++)) - do + } - usermod -a -G ${group_array[$i]} dietpi + Userdel_Main(){ - done + if [ -n "$INPUT_MODE_VALUE" ]; then - unset group_array + # - Delete $INPUT_MODE_VALUE + userdel -f $INPUT_MODE_VALUE + rm -R /home/$INPUT_MODE_VALUE - fi + # - Remove from sudoers + sed -i "/^$INPUT_MODE_VALUE[[:space:]]/d" /etc/sudoers else @@ -295,9 +308,13 @@ _EOF_ AptMirror_Main - elif [ "$INPUT_MODE_NAME" = "useradd_dietpi" ]; then + elif [ "$INPUT_MODE_NAME" = "useradd" ]; then + + Useradd_Main + + elif [ "$INPUT_MODE_NAME" = "userdel" ]; then - Useradd_DietPi_Main + Userdel_Main elif [ "$INPUT_MODE_NAME" = "ntpd-mirror" ]; then diff --git a/dietpi/patch_file b/dietpi/patch_file index e0f3e23341..300253ea4b 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2422,7 +2422,7 @@ _EOF_ chmod 4755 /usr/bin/sudo #------------------------------------------------------------------------------- #Create DietPi user: https://github.com/Fourdee/DietPi/issues/796 - /DietPi/dietpi/func/dietpi-set_software useradd_dietpi 1 + /DietPi/dietpi/func/dietpi-set_software useradd dietpi #------------------------------------------------------------------------------- #DietPi-Config + display rotation options: https://github.com/Fourdee/DietPi/issues/859 if (( $HW_MODEL < 10 )); then @@ -2780,6 +2780,38 @@ _EOF_ # Squeezelite / Shairport-sync / Allo GUI (full) /DietPi/dietpi/dietpi-software reinstall 36 37 159 #------------------------------------------------------------------------------- + #WiFi module disable powersave addition: + echo -e "options wlan_8192eu rtw_power_mgnt=0" > /etc/modprobe.d/wlan_8192eu.conf + #------------------------------------------------------------------------------- + #Update of SSH kill on shutdown (due to dropbear/sshd not terminating during shutdown, before network is dropped) + cat << _EOF_ > /etc/systemd/system/kill-ssh-user-sessions-before-network.service +[Unit] +Description=Shutdown all ssh sessions before network +DefaultDependencies=no +Before=network.target shutdown.target + +[Service] +Type=oneshot +ExecStart=/bin/bash -c 'killall sshd &> /dev/null; killall dropbear &> /dev/null' + +[Install] +WantedBy=poweroff.target halt.target reboot.target +_EOF_ + systemctl daemon-reload + systemctl enable kill-ssh-user-sessions-before-network + #------------------------------------------------------------------------------- + #Sparky SBC USB/ETH stability patches + if (( $HW_MODEL == 70 )); then + + wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/urb_fix_71117/uImage -O /boot/uImage + wget https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/urb_fix_71117/ethernet.ko -O /lib/modules/$(uname -r)/kernel/drivers/net/ethernet/acts/ethernet.ko + + fi + #------------------------------------------------------------------------------- + #config.txt missing newline on older images, and uploaded/shared confs (<145) + echo -e "\n" >> /DietPi/config.txt + #------------------------------------------------------------------------------- + fi From 7691558bde5eb16d00ff7be6d00ae6ae0764b0c7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 7 Nov 2017 22:20:51 +0100 Subject: [PATCH 28/43] [Nextcloud] HSTS for /nextcloud subfolder + Fix CLI URL CLI URL also needs to be switched to HTTPS on SSL environments --- dietpi/dietpi-software | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 5d824348bd..cfadb0c1e6 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3752,7 +3752,7 @@ _EOF_ # + stretch extras if (( $DISTRO >= 4 )); then - AGI "$PHP_APT_PACKAGE_NAME"-opcache "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml + AGI "$PHP_APT_PACKAGE_NAME"-mbstring "$PHP_APT_PACKAGE_NAME"-zip "$PHP_APT_PACKAGE_NAME"-xml fi @@ -8871,6 +8871,8 @@ _EOF_ cat << _EOF_ > /etc/nginx/sites-dietpi/nextcloud.config location ^~ /nextcloud { + # Security headers + add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; @@ -8977,14 +8979,17 @@ _EOF_ sudo -u www-data php /var/www/nextcloud/occ maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA_DIRECTORY/nextcloud_data" - #Disable trusted_domains. + # Disable trusted_domains. if (( ! $(cat /var/www/nextcloud/config/config.php | grep -ci -m1 "1 => '*'") )); then sed -i "/0 => 'localhost'/a 1 => '*'," /var/www/nextcloud/config/config.php fi + + # Set CLI URL to Nextcloud sub directory: + sed -i "s#'http://localhost'#'http://localhost/nextcloud'#g" - #Owncloud/Nextcloud ignores system wide php.ini settings. Use their own config. + # Owncloud/Nextcloud ignores system wide php.ini settings. Use their own config. # - max upload size local php_max_upload_size="$(( $(php -r 'print(PHP_INT_MAX);') / 1024 / 1024))M" From af386dd4ff7ecadf67ee985f43e2a85a1cd40b9e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 8 Nov 2017 23:40:33 +0100 Subject: [PATCH 29/43] [Nextcloud | Nginx] Set HTTPS on, if SSL connection is available --- dietpi/dietpi-software | 60 ++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 26 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cfadb0c1e6..e92a4bdd9c 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -17,10 +17,10 @@ # Usage: # - dietpi-software # - /DietPi/dietpi/dietpi-software install iUNIQUEID (OR) sINDEX_{SSHSERVER,FILESERVER,LOGGING,WEBSERVER}_TARGET=-int - # - /DietPi/dietpi/dietpi-software reinstall Same as installed, however, only reinstalls if state =2. Does not uninstall due to package removal danger (eg: xserver removes kodi), simply flags to be installed (=1). - # - /DietPi/dietpi/dietpi-software uninstall iUNIQUEID - # - /DietPi/dietpi/dietpi-software list #Lists UNIQUEIDs for software - # - /DietPi/dietpi/dietpi-software setpermissions #Sets shared permissions for /var/www and userdata folders + # - /DietPi/dietpi/dietpi-software reinstall #Same as installed, however, only reinstalls if state =2. Does not uninstall due to package removal danger (eg: xserver removes kodi), simply flags to be installed (=1). + # - /DietPi/dietpi/dietpi-software uninstall iUNIQUEID + # - /DietPi/dietpi/dietpi-software list #Lists UNIQUEIDs for software. + # - /DietPi/dietpi/dietpi-software setpermissions #Sets shared permissions for /var/www and userdata folders. #//////////////////////////////////// #Force en_GB Locale for whole script. Prevents incorrect parsing with non-english locales. @@ -264,7 +264,7 @@ _EOF_ #PHP5/7 specific directories, apt package-, module- and command names FP_PHP_BASE_DIR='/etc/php/7.0' PHP_APT_PACKAGE_NAME='php' - if (( $DISTRO == 3 )); then + if (( $DISTRO < 4 )); then FP_PHP_BASE_DIR='/etc/php5' PHP_APT_PACKAGE_NAME='php5' @@ -310,15 +310,15 @@ _EOF_ TOTAL_SOFTWARE_INDEXS=0 TOTAL_SOFTWARE_INDEXS_HARDLIMIT=168 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init - INSTALLING_INDEX=0 #Which software index is currently being installed? + INSTALLING_INDEX=0 #Which software index is currently being installed? - aSOFTWARE_CATEGORY_INDEX=0 #Category index - aSOFTWARE_TYPE=0 #0=DietPi 1=Linux | -1=Hidden from install menu, visible in uninstall menu | -2 Hidden from all menus + aSOFTWARE_CATEGORY_INDEX=0 #Category index + aSOFTWARE_TYPE=0 #0=DietPi 1=Linux | -1=Hidden from install menu, visible in uninstall menu | -2 Hidden from all menus - aSOFTWARE_INSTALL_STATE=0 #0=not / 1=tobe, or not tobe that is the... / 2=installed + aSOFTWARE_INSTALL_STATE=0 #0=not / 1=tobe, or not tobe that is the... / 2=installed - aSOFTWARE_WHIP_NAME=0 #Item name eg: Kodi - aSOFTWARE_WHIP_DESC=0 #Blah blah + aSOFTWARE_WHIP_NAME=0 #Item name eg: Kodi + aSOFTWARE_WHIP_DESC=0 #Blah blah FP_ONLINEDOC_URL='http://dietpi.com/phpbb/viewtopic.php?' aSOFTWARE_ONLINEDOC_URL=0 @@ -357,11 +357,11 @@ _EOF_ # Adding Software to the Install List: # ------------------------------------ # - index_current: - # This is the next number in the sequence, each software install has a unique number + # This is the next number in the sequence. Each software install has a unique number, # so it can be referenced in all arrays. This has to be the same for install, uninstall # and setting up the service. Run "dietpi-software list | grep 'index Current'" to - # get the next number in the sequence. Ensure you are running a testing build as - # release may be behind the testing branch and avaliable software packages + # get the next number in the sequence. Ensure that you are running a testing build, as + # release may be behind the testing branch and avaliable software packages. # # - aSOFTWARE_WHIP_NAME: # This is the name to display in the UI. @@ -370,27 +370,27 @@ _EOF_ # This is the description to place next to the name in the UI. # # - aSOFTWARE_CATEGORY_INDEX: - # If you are adding a new peice of software first choose the category it goes under - # (aSOFTWARE_CATEGORIES_DIETPI or aSOFTWARE_CATEGORIES_LINUX) this will give you - # the aSOFTWARE_CATEGORY_INDEX to set, in the example belo this is 0. + # If you are adding a new peice of software, first choose the category it belongs to + # (see aSOFTWARE_CATEGORIES_DIETPI and aSOFTWARE_CATEGORIES_LINUX below), which will + # give you the aSOFTWARE_CATEGORY_INDEX to set. In the example below this is 0. # # - aSOFTWARE_TYPE: - # If this is aSOFTWARE_CATEGORIES_DIETPI then aSOFTWARE_TYPE = 0 if it is + # If this is aSOFTWARE_CATEGORIES_DIETPI then aSOFTWARE_TYPE=0, if it is # aSOFTWARE_CATEGORIES_LINUX then it is 1. In the example it is 0. # # - aSOFTWARE_ONLINEDOC_URL: # This is appeneded to FP_ONLINEDOC_URL to make a URL for help on this software. # # Specifying other software as dependencies: - # If you need other software to be avaliable for you look under the 'Requires software + # If your software needs other software to be available, look under the 'Requires software # to be installed' heading and then add that to the section you create. In the example - # below ALSA and XSERVERXORG are needed. The system will check to see if they are - # installed and if not will install them for you. + # below ALSA and XSERVERXORG are needed. The system will check their presence + # and install as needed. # # Dealing with Hardware types: - # If you have hardware requirements like must not/only be installed on a pi then you need - # to add something like the following, look for other examples in the existing software - # installations. Full list of models can be found in 'dietpi-obtain_hw_model' + # If you have hardware requirements, like must not/only be installed on a Pi, then you need + # to add something like below. Look for other examples in the existing software + # installations. Full list of models can be found in 'dietpi-obtain_hw_model'. # # # - Disabled for All non-rpi # for ((i=10; i<=$MAX_HW_MODEL; i++)) @@ -8825,7 +8825,7 @@ _EOF_ fi - # APCu configuration: To prevent cli (cron.php) producing Nextcloud log [info] entry. + # APCu configuration: To prevent cli (cron.php) producing Nextcloud log [info] entries. grep -q 'apc.enable_cli=' $FP_PHP_BASE_DIR/mods-available/apcu.ini && sed -i '/apc.enable_cli=/c\apc.enable_cli=1' $FP_PHP_BASE_DIR/mods-available/apcu.ini || echo 'apc.enable_cli=1' >> $FP_PHP_BASE_DIR/mods-available/apcu.ini # OPCache configuration: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/server_tuning.html?highlight=opcache#enable-php-opcache @@ -8954,13 +8954,21 @@ location ^~ /nextcloud { } _EOF_ - # - Stretch, set php7.0 and set fastcgi_request_buffering off; + # - Stretch, set php7.0 and fastcgi_request_buffering off; if (( $DISTRO >= 4 )); then sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" /etc/nginx/sites-dietpi/nextcloud.config sed -i "s#\#fastcgi_request_buffering off;#fastcgi_request_buffering off;#g" /etc/nginx/sites-dietpi/nextcloud.config fi + + # Set HTTPS on, if SSL connection is available. + DietPi/dietpi/func/check_connection https://localhost &> /dev/null + if (( $? == 0 )); then + + sed -i "s#\#fastcgi_param HTTPS on;#fastcgi_param HTTPS on;#g" /etc/nginx/sites-dietpi/nextcloud.config + + fi fi From 180497e45c873d16eea43c9d6020b29d2743eb15 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 9 Nov 2017 02:10:24 +0100 Subject: [PATCH 30/43] [Nextcloud | Nginx] Ignore SSL verification errors on SSL check --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e92a4bdd9c..331ac04bca 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8962,9 +8962,9 @@ _EOF_ fi - # Set HTTPS on, if SSL connection is available. + # Set HTTPS on, if SSL connection is available, even with self-signed/untrusted certificate. DietPi/dietpi/func/check_connection https://localhost &> /dev/null - if (( $? == 0 )); then + if (( $? == 0 || $? == 5)); then sed -i "s#\#fastcgi_param HTTPS on;#fastcgi_param HTTPS on;#g" /etc/nginx/sites-dietpi/nextcloud.config From a9065044a5c015806cb9bf7eeaf016d17c4c6408 Mon Sep 17 00:00:00 2001 From: k-plan Date: Thu, 9 Nov 2017 17:43:43 +0100 Subject: [PATCH 31/43] Update README.md Added johnvick, same as in master branch. --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1a76aec496..2b936b668f 100644 --- a/README.md +++ b/README.md @@ -28,24 +28,26 @@ Creator, programmer and project lead of DietPi. * Daniel Knight (Fourdee) Current contributors: -* K-Plan - Joined 01/01/2016 +* JohnVick - Joined 08/06/2016 - +DietPi forum co-administrator, including managment, support, testing and valuable feedback +* K-Plan - Joined 01/01/2016 - Contributions to the DietPi in general, including In-depth testing, bug finding and valuable feedback. Forum moderator. -* ZombieVirus - Joined 20/03/2016 +* ZombieVirus - Joined 20/03/2016 - DietPi forum moderator and version history maintainer on forums. Collaborations: -* DietPi + AmiBerry 02/09/2016 +* DietPi + AmiBerry 02/09/2016 - Joint venture to bring you the ultimate Amiga experience on your SBC, running lightweight and optmized DietPi at its core. https://github.com/Fourdee/DietPi/issues/474 Previous/inactive contributors: -* Rhkean - Joined 01/03/2016 +* Rhkean - Joined 01/03/2016 - Contributions to the DietPi in general, including sourcecode, testing, new devices. Forum moderator. -* Pilovali - Joined 10/10/2015 +* Pilovali - Joined 10/10/2015 - Provided DietPi.com web hosting for 1 year until April 17th 2016, forum moderator, testing, bug reporting. -* xenfomation - Joined 01/04/2016 +* xenfomation - Joined 01/04/2016 - Contributions to the DietPi in general, including sourcecode, virtualBox image creation/conversion. -* AWL29 - Joined 01/10/2016 +* AWL29 - Joined 01/10/2016 - Created the DietPi image for NanoPi M3/T3. Honourable mentions/thanks: From c5567497e62081c43ba1645f243f7776cb6fe983 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Thu, 9 Nov 2017 19:52:44 +0000 Subject: [PATCH 32/43] v158 + DietPi-Software | Resolved an issue with 404 and Owncloud: https://github.com/Fourdee/DietPi/issues/1225 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fd11f20f0c..73d76e5dd1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -20,6 +20,7 @@ DietPi-Set_Hardware | Soundcard: When setting USB-DAC, and it fails detection, t DietPi-Set_Software | DietPi User: Resolved an issue where /etc/sudoers was being incorrectly written with additional \. DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion package, shared with Motioneye, thanks @vilhelmp: https://github.com/Fourdee/DietPi/issues/1194 DietPi-Software | Resolved an issue with Emby server (ARMv7/ARMv8) failing to install, due to missing packages not available in Debian repo: https://github.com/Fourdee/DietPi/issues/1150 +DietPi-Software | Resolved an issue with 404 and Owncloud: https://github.com/Fourdee/DietPi/issues/1225 Allo Web Interface Changes: Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 42947e89b6..88c7f60133 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -5235,6 +5235,13 @@ _EOF_ #Stop service service logitechmediaserver stop + #Stretch + # Compile pre-req CPAN modules??? + # if (( $DISTRO >= 4 )); then + + # AGI yasm git build-essential automake cpanminus nasm libxml-parser-perl libexpat1-dev libgif-dev zlib1g-dev libjpeg-dev libpng-dev + + # + ARMv6 cpan if (( $HW_ARCH == 1 )); then @@ -8944,12 +8951,16 @@ _EOF_ INSTALLING_INDEX=47 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + #Symlink /usr/share/owncloud to /var/www/owncloud: https://github.com/Fourdee/DietPi/issues/1225#issuecomment-343263082 + rm -R /var/www/owncloud &> /dev/null + ln -fs /usr/share/owncloud /var/www/owncloud + #Setup Data directory local target_data_dir="$FP_DIETPI_USERDATA_DIRECTORY/owncloud_data" mkdir -p "$target_data_dir" - #Create symlink from default /var/www/owncloud/data to FP_DIETPI_USERDATA_DIRECTORY - local target_data_symlink="/var/www/owncloud/data" + #Create symlink from default owncloud/data to FP_DIETPI_USERDATA_DIRECTORY + local target_data_symlink="/usr/share/owncloud/data" mkdir -p "$target_data_symlink" &> /dev/null # - Copy existing data to our data location From 35caed1e03769365aff6d542610516049311c3ae Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 10 Nov 2017 03:12:14 +0100 Subject: [PATCH 33/43] [Nextcloud] Remove obsolete database user - occ maintenance:install also creates obsolete 'oc_admin'@'%' mysql user, which can directly be removed. - The effort to get user and host is actually a bid high, as we exactly know the defaults that Nextcloud creates. - But at least on removal we do not know, if user changed something, for whatever reason. --- dietpi/dietpi-software | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 331ac04bca..24e1fb4421 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8987,6 +8987,9 @@ _EOF_ sudo -u www-data php /var/www/nextcloud/occ maintenance:install --no-interaction --database "mysql" --database-name "nextcloud" --database-user "root" --database-pass "$GLOBAL_PW" --admin-user "$username" --admin-pass "$GLOBAL_PW" --data-dir "$FP_DIETPI_USERDATA_DIRECTORY/nextcloud_data" + # Remove obsolete 'oc_admin'@'%' MySQL user: + mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" + # Disable trusted_domains. if (( ! $(cat /var/www/nextcloud/config/config.php | grep -ci -m1 "1 => '*'") )); then @@ -12590,6 +12593,7 @@ _EOF_ systemctl start mysql mysqladmin -u root -p"$GLOBAL_PW" drop nextcloud -f + mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")@$(grep -m1 "'dbhost'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" rm -R /var/www/nextcloud a2dissite nextcloud &>/dev/null rm /etc/apache2/sites-available/nextcloud.conf &>/dev/null From a6c67f7b239eac820fa7d4b3fd50280511364b82 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 10 Nov 2017 03:40:46 +0100 Subject: [PATCH 34/43] [Nextcloud] Remove obsolete MySQL user on update - Tiny database cleanup :wink: - Needed to add $GLOBAL_PW for this, copied from dietpi-software. --- dietpi/patch_file | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index e0f3e23341..dd6a900724 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -32,6 +32,14 @@ HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) + + #Global Password: Exception to AUTO first run init. + GLOBAL_PW=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//') + if [ ! -n "$GLOBAL_PW" ]; then + + GLOBAL_PW='dietpi' + + fi ALLO_GUI_IMAGE=0 if [ -f /DietPi/dietpi/.installed ] && (( $(cat /DietPi/dietpi/.installed | grep -ci -m1 '^aSOFTWARE_INSTALL_STATE\[159\]=2') )); then @@ -2780,7 +2788,12 @@ _EOF_ # Squeezelite / Shairport-sync / Allo GUI (full) /DietPi/dietpi/dietpi-software reinstall 36 37 159 #------------------------------------------------------------------------------- - + #Nextcloud: Remove obsolete MySQL user + if ! [ "$(grep -m1 "'dbhost'" /var/www/nextcloud/config/config.php 2> /dev/null | awk '{print $3}' | sed "s/,//")" == "''" ]; then + mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" &> /dev/null + fi + #------------------------------------------------------------------------------- + fi #------------------------------------------------------------------------------- From bd3ba788516f4e9ec94ebd2e325b69828ddeaf2e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 10 Nov 2017 15:03:51 +0000 Subject: [PATCH 35/43] v158 + DietPi-Services | status: Improved this command to highlight working and detail failed services. Failed services will also be listed. 'dietpi-services status': https://github.com/Fourdee/DietPi/issues/1230 --- CHANGELOG.txt | 1 + dietpi/dietpi-services | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 73d76e5dd1..ac1d14e20c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v158 (xx/10/17) Changes / Improvements / Optimizations: +DietPi-Services | status: Improved this command to highlight working and detail failed services. Failed services will also be listed. 'dietpi-services status': https://github.com/Fourdee/DietPi/issues/1230 DietPi-Software | moOde: Initial pass adding into DietPi: https://github.com/Fourdee/DietPi/issues/1223 DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index a9c81fb970..dae0eb028b 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -234,7 +234,18 @@ #Apply if (( ${aSERVICE_AVAILABLE[$i]} == 1 )); then - echo -e "${aSERVICE_NAME[$i]}\t$(systemctl status "${aSERVICE_NAME[$i]}" | grep Active | cut -c12-)" + STATUS="${aSERVICE_NAME[$i]}\t$(systemctl status ${aSERVICE_NAME[$i]} | grep -m1 'Active' | cut -c12-)" + + if [[ "$STATUS" =~ .*'failed'.* ]]; then + + /DietPi/dietpi/func/dietpi-notify 1 "$STATUS" + systemctl status "${aSERVICE_NAME[$i]}" -l --no-pager + + else + + /DietPi/dietpi/func/dietpi-notify 0 "$STATUS" + + fi fi From 73b93e318541b3826cdc3914fbd76ebbc92a2784 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 10 Nov 2017 15:05:42 +0000 Subject: [PATCH 36/43] v158 + include in bug reports: https://github.com/Fourdee/DietPi/issues/1230#issuecomment-343495075 --- dietpi/dietpi-bugreport | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/dietpi-bugreport b/dietpi/dietpi-bugreport index 4a57fd2566..51378c59ca 100644 --- a/dietpi/dietpi-bugreport +++ b/dietpi/dietpi-bugreport @@ -176,6 +176,7 @@ _EOF_ "lsmod" "systemctl status *.service -l" "systemctl status *.mount -l" + "/DietPi/dietpi/dietpi-services status" ) From aad1afe88070f2f941d60b988749f990b76de886 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 10 Nov 2017 15:24:57 +0000 Subject: [PATCH 37/43] v158 + avoid grep: /var/www/nextcloud/config/config.php: No such file or directory during patch: https://github.com/Fourdee/DietPi/issues/1067 https://github.com/Fourdee/DietPi/pull/1226 --- dietpi/patch_file | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dietpi/patch_file b/dietpi/patch_file index eceb77534d..3b02798d67 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -32,7 +32,7 @@ HW_MODEL_DESCRIPTION=$(sed -n 2p /DietPi/dietpi/.hw_model) DISTRO=$(sed -n 3p /DietPi/dietpi/.hw_model) HW_ARCH=$(sed -n 6p /DietPi/dietpi/.hw_model) - + #Global Password: Exception to AUTO first run init. GLOBAL_PW=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//') if [ ! -n "$GLOBAL_PW" ]; then @@ -2789,8 +2789,12 @@ _EOF_ /DietPi/dietpi/dietpi-software reinstall 36 37 159 #------------------------------------------------------------------------------- #Nextcloud: Remove obsolete MySQL user - if ! [ "$(grep -m1 "'dbhost'" /var/www/nextcloud/config/config.php 2> /dev/null | awk '{print $3}' | sed "s/,//")" == "''" ]; then - mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" &> /dev/null + if [ -f /var/www/nextcloud/config/config.php ]; then + + if ! [ "$(grep -m1 "'dbhost'" /var/www/nextcloud/config/config.php 2> /dev/null | awk '{print $3}' | sed "s/,//")" == "''" ]; then + mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" &> /dev/null + fi + fi #------------------------------------------------------------------------------- #WiFi module disable powersave addition: From 4e5ed35c8b292aefde972c857f6153a1c695cadd Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 10 Nov 2017 15:57:16 +0000 Subject: [PATCH 38/43] v158 + Allo GUI v3: https://github.com/Fourdee/DietPi/issues/1231 --- CHANGELOG.txt | 2 +- dietpi/dietpi-software | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ac1d14e20c..591663db23 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -23,7 +23,7 @@ DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion pack DietPi-Software | Resolved an issue with Emby server (ARMv7/ARMv8) failing to install, due to missing packages not available in Debian repo: https://github.com/Fourdee/DietPi/issues/1150 DietPi-Software | Resolved an issue with 404 and Owncloud: https://github.com/Fourdee/DietPi/issues/1225 -Allo Web Interface Changes: +Allo Web Interface v3: Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. Squeezelite | Now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 General | Added ability to set S24_3 bit depth modes for Shairport-sync and Squeezelite. Required by some DACs diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 936c41a8ea..dc876a0936 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7382,7 +7382,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface.7z' + INSTALL_URL_ADDRESS='http://dietpi.com/downloads/binaries/all/allo_web_interface_v3.7z' /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -9148,14 +9148,14 @@ location ^~ /nextcloud { } _EOF_ - # - Stretch, set php7.0 and fastcgi_request_buffering off; + # - Stretch, set php7.0 and fastcgi_request_buffering off; if (( $DISTRO >= 4 )); then sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" /etc/nginx/sites-dietpi/nextcloud.config sed -i "s#\#fastcgi_request_buffering off;#fastcgi_request_buffering off;#g" /etc/nginx/sites-dietpi/nextcloud.config fi - + # Set HTTPS on, if SSL connection is available, even with self-signed/untrusted certificate. DietPi/dietpi/func/check_connection https://localhost &> /dev/null if (( $? == 0 || $? == 5)); then @@ -9190,7 +9190,7 @@ _EOF_ sed -i "/0 => 'localhost'/a 1 => '*'," /var/www/nextcloud/config/config.php fi - + # Set CLI URL to Nextcloud sub directory: sed -i "s#'http://localhost'#'http://localhost/nextcloud'#g" From 2435f1b0e2cbebcaa2002cc85ab032162f157342 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Fri, 10 Nov 2017 16:52:58 +0000 Subject: [PATCH 39/43] v158 + DietPi-Software | Resolved an issue with Home Assistant on Native PC failing. Many thanks to @sytone : https://github.com/Fourdee/DietPi/issues/1145 + moOde beta 8 testing: https://github.com/Fourdee/DietPi/issues/1223 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 13 ++++++++++--- dietpi/patch_file | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 591663db23..43c5ad5d2a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,7 @@ DietPi-Set_Software | DietPi User: Resolved an issue where /etc/sudoers was bein DietPi-Software | Uninstalling DietPi-Cam, will no longer remove the motion package, shared with Motioneye, thanks @vilhelmp: https://github.com/Fourdee/DietPi/issues/1194 DietPi-Software | Resolved an issue with Emby server (ARMv7/ARMv8) failing to install, due to missing packages not available in Debian repo: https://github.com/Fourdee/DietPi/issues/1150 DietPi-Software | Resolved an issue with 404 and Owncloud: https://github.com/Fourdee/DietPi/issues/1225 +DietPi-Software | Resolved an issue with Home Assistant on Native PC failing. Many thanks to @sytone : https://github.com/Fourdee/DietPi/issues/1145 Allo Web Interface v3: Roon | Resolved an issue where Roon was not generating unique IDs, resulting in multiple devices on the same network, having issues with Roon Core detection. diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index dc876a0936..638f4646a9 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1093,7 +1093,7 @@ _EOF_ aSOFTWARE_WHIP_NAME[$index_current]='moOde' aSOFTWARE_WHIP_DESC[$index_current]='audiophile-quality music playback' aSOFTWARE_CATEGORY_INDEX[$index_current]=2 - aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_TYPE[$index_current]=-1 aSOFTWARE_REQUIRES_WEBSERVER[$index_current]=1 aSOFTWARE_REQUIRES_SQLITE[$index_current]=1 aSOFTWARE_REQUIRES_BUILDESSENTIAL[$index_current]=1 @@ -1101,6 +1101,14 @@ _EOF_ aSOFTWARE_REQUIRES_ALSA[$index_current]=1 aSOFTWARE_ONLINEDOC_URL[$index_current]='xxxxxxxxxxxxxxxxx' + # - Disabled for All non-rpi + for ((i=10; i<=$MAX_HW_MODEL; i++)) + do + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + + done + #BitTorrent #-------------------------------------------------------------------------------- index_current=44 @@ -7480,7 +7488,7 @@ _EOF_ Banner_Installing - INSTALL_URL_ADDRESS='http://moodeaudio.org/downloads/beta/r40b7/rel-stretch.zip' + INSTALL_URL_ADDRESS='http://moodeaudio.org/downloads/beta/r40b8/rel-stretch.zip' /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" if (( $? == 0 )); then @@ -9356,7 +9364,6 @@ ExecStart=/usr/bin/mpd --no-daemon /etc/mpd.conf # allow MPD to use real-time priority 50 LimitRTPRIO=50 -LimitRTTIME=-1 [Install] WantedBy=multi-user.target diff --git a/dietpi/patch_file b/dietpi/patch_file index 3b02798d67..b5e872fe55 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -2792,7 +2792,7 @@ _EOF_ if [ -f /var/www/nextcloud/config/config.php ]; then if ! [ "$(grep -m1 "'dbhost'" /var/www/nextcloud/config/config.php 2> /dev/null | awk '{print $3}' | sed "s/,//")" == "''" ]; then - mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" &> /dev/null + mysql -uroot -p"$GLOBAL_PW" -e "drop user $(grep -m1 "'dbuser'" /var/www/nextcloud/config/config.php | awk '{print $3}' | sed "s/,//")" &> /dev/null fi fi From 521f611a69b9cc41ca7ac1f07ccc18182c5a4eb0 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 11 Nov 2017 20:27:32 +0000 Subject: [PATCH 40/43] v158 + DietPi-Software | Google AIY: Now available for installation: https://github.com/Fourdee/DietPi/issues/1065 --- CHANGELOG.txt | 1 + dietpi/dietpi-process_tool | 1 + dietpi/dietpi-services | 2 + dietpi/dietpi-software | 109 ++++++++++++++++++++++++++++++-- dietpi/func/dietpi-set_hardware | 52 ++++++++++++++- 5 files changed, 160 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 43c5ad5d2a..333170edfd 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v158 Changes / Improvements / Optimizations: DietPi-Services | status: Improved this command to highlight working and detail failed services. Failed services will also be listed. 'dietpi-services status': https://github.com/Fourdee/DietPi/issues/1230 +DietPi-Software | Google AIY: Now available for installation: https://github.com/Fourdee/DietPi/issues/1065 DietPi-Software | moOde: Initial pass adding into DietPi: https://github.com/Fourdee/DietPi/issues/1223 DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 diff --git a/dietpi/dietpi-process_tool b/dietpi/dietpi-process_tool index 4f49850b42..8650abac75 100644 --- a/dietpi/dietpi-process_tool +++ b/dietpi/dietpi-process_tool @@ -221,6 +221,7 @@ aNAME[$index]='FuguHub';aPROCESS_NAME[$index]='bdd';((index++)) aNAME[$index]='Gitea';aPROCESS_NAME[$index]='gitea';((index++)) aNAME[$index]='Gogs';aPROCESS_NAME[$index]='gogs';((index++)) + aNAME[$index]='Google AIY';aPROCESS_NAME[$index]='main.py';((index++)) aNAME[$index]='Gmediarender';aPROCESS_NAME[$index]='gmediarender';((index++)) aNAME[$index]='Home Assistant';aPROCESS_NAME[$index]='hass';((index++)) aNAME[$index]='HTPC Manager';aPROCESS_NAME[$index]='Htpc.py';((index++)) diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index dae0eb028b..628f0aa8ff 100644 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -113,6 +113,8 @@ 'pi-spc' 'raspotify' #'moode-worker' + 'voice-recognizer' + 'alsa-init' ) # - User: read custom services file diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 638f4646a9..3778d7042a 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -308,7 +308,7 @@ _EOF_ # - Software #NB: All software has a unique index that must not be changed (eg: DESKTOP_LXDE = 23) TOTAL_SOFTWARE_INDEXS=0 - TOTAL_SOFTWARE_INDEXS_HARDLIMIT=169 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init + TOTAL_SOFTWARE_INDEXS_HARDLIMIT=170 #Increase as needed. Must be higher than TOTAL_SOFTWARE_INDEXS once calculated in Software_Arrays_Init INSTALLING_INDEX=0 #Which software index is currently being installed? @@ -1870,6 +1870,24 @@ _EOF_ done + #------------------ + index_current=169 + + aSOFTWARE_WHIP_NAME[$index_current]='Google AIY' + aSOFTWARE_WHIP_DESC[$index_current]='voice kit' + aSOFTWARE_CATEGORY_INDEX[$index_current]=11 + aSOFTWARE_TYPE[$index_current]=0 + aSOFTWARE_REQUIRES_ALSA[$index_current]=1 + aSOFTWARE_REQUIRES_GIT[$index_current]=1 + aSOFTWARE_ONLINEDOC_URL[$index_current]='f=8&t=5&p=9486#p9486' + + # - Disabled for All non-rpi + for ((i=10; i<=$MAX_HW_MODEL; i++)) + do + + aSOFTWARE_AVAIL_HW_MODEL[$index_current,$i]=0 + + done #System security #-------------------------------------------------------------------------------- @@ -2696,6 +2714,14 @@ _EOF_ fi + #Additional Software required by Google AIY + if (( ${aSOFTWARE_INSTALL_STATE[169]} == 1 )); then + + aSOFTWARE_INSTALL_STATE[69]=1 # RPi.GPIO + #aSOFTWARE_INSTALL_STATE[130]=1 # python-pip, enabled in #Software that requires Python-Pip + + fi + #Software that requires Avahi-Daemon index=152 if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || @@ -2752,7 +2778,8 @@ _EOF_ ${aSOFTWARE_INSTALL_STATE[136]} == 1 || ${aSOFTWARE_INSTALL_STATE[139]} == 1 || ${aSOFTWARE_INSTALL_STATE[142]} == 1 || - ${aSOFTWARE_INSTALL_STATE[153]} == 1 )); then + ${aSOFTWARE_INSTALL_STATE[153]} == 1 || + ${aSOFTWARE_INSTALL_STATE[169]} == 1 )); then if (( ${aSOFTWARE_INSTALL_STATE[130]} == 0 )); then @@ -7631,6 +7658,56 @@ libglib2.0-dev fi + #Google AIY + INSTALLING_INDEX=169 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + Banner_Installing + + INSTALL_URL_ADDRESS='https://github.com/google/aiyprojects-raspbian.git' + /DietPi/dietpi/func/check_connection "$INSTALL_URL_ADDRESS" + if (( $? == 0 )); then + + git clone "$INSTALL_URL_ADDRESS" "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi + cd "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi + + pip3 install --upgrade pip virtualenv + virtualenv --system-site-packages -p python3 env + env/bin/pip install -r requirements.txt + + #??? ARMv7 only + if (( $HW_ARCH == 2 )); then + + env/bin/pip install google-assistant-library==0.0.3 + + fi + + # - Services + sed -i "s#/home/pi#$FP_DIETPI_USERDATA_DIRECTORY#g" systemd/voice-recognizer.service + sed -i "/^User=/c\User=root" systemd/voice-recognizer.service + + cp systemd/voice-recognizer.service /etc/systemd/system/ + cp systemd/alsa-init.service /etc/systemd/system/ + #cp systemd/ntpdate.service /etc/systemd/system/ + + source env/bin/activate + + # - Enable default app for service start + cp src/assistant_library_with_button_demo.py src/main.py + + # - Symlink userdata location for assistant.json + ln -sf /mnt/dietpi_userdata/voice-recognizer-raspi/assistant.json /root/assistant.json + + cd "$HOME" + + else + + Error_NoConnection_NoInstall + + fi + + fi + } Install_Linux_Software(){ @@ -8134,7 +8211,7 @@ _EOF_ python ./install.py rm install.py - AGI python-pip + AGI python-pip python3-pip else @@ -12754,10 +12831,22 @@ _EOF_ Download_Test_Media + #Flag compiled MPD as installed + aSOFTWARE_INSTALL_STATE[128]=2 + #DietPi - Post steps END ------------------------------------------------------------------- fi + #Google AIY + INSTALLING_INDEX=169 + if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + + #Setup soundcard + /DietPi/dietpi/func/dietpi-set_hardware soundcard googlevoicehat-soundcard + + fi + } Install_Apply_GPU_Settings(){ @@ -13050,7 +13139,7 @@ _EOF_ elif (( $1 == 130 )); then - AGP python-pip + AGP python-pip python3-pip elif (( $1 == 131 )); then @@ -13716,7 +13805,19 @@ _EOF_ rm /etc/apt/sources.list.d/raspotify.list apt-get update + elif (( $1 == 168 )); then + + echo -e "pending" + + elif (( $1 == 169 )); then + + rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi + rm /etc/systemd/system/voice-recognizer.service + rm /etc/systemd/system/alsa-init.service + rm -R "$HOME"/assistant.json + elif (( $1 == 158 )); then + # Remove service systemctl stop minio.service systemctl disable minio.service diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 8e5e2af59b..3e43946c04 100644 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1696,6 +1696,11 @@ _EOF_ sed -i '/dtoverlay=allo-/d' "$FP_RPI_CONFIG" sed -i '/dtoverlay=rpi-dac/d' "$FP_RPI_CONFIG" sed -i '/dtoverlay=i-sabre-k2m/d' "$FP_RPI_CONFIG" + sed -i '/dtoverlay=googlevoicehat-soundcard/d' "$FP_RPI_CONFIG" + + # - Disable i2s maps + sed -i '/dtoverlay=i2s-mmap/d' "$FP_RPI_CONFIG" + sed -i '/dtparam=i2s=/d' "$FP_RPI_CONFIG" # onboard blacklist module echo -e "blacklist snd-bcm2835" > /etc/modprobe.d/rpi-bcm2708.conf @@ -1909,6 +1914,18 @@ _EOF_ ;; + #googlevoicehat-soundcard + googlevoicehat-soundcard*) + + # - enable dtoverlay + cat << _EOF_ >> "$FP_RPI_CONFIG" +dtoverlay=$INPUT_DEVICE_VALUE +dtoverlay=i2s-mmap +dtparam=i2s=on +_EOF_ + + ;; + #JustBoom-dac: DAC HAT, Amp HAT, DAC Zero and Amp Zero #JustBoom-digi: Digi HAT and Digi Zero justboom-*) @@ -2126,7 +2143,40 @@ _EOF_ esac # - Apply asound.conf - if (( $ALSA_EQ_ENABLED )); then + if [[ "$INPUT_DEVICE_VALUE" = 'googlevoicehat-soundcard'* ]]; then + + cat << _EOF_ > /etc/asound.conf +pcm.softvol { + type softvol + slave.pcm dmix + control { + name Master + card 0 + } +} + +pcm.micboost { + type route + slave.pcm dsnoop + ttable { + 0.0 30.0 + 1.1 30.0 + } +} + +pcm.!default { + type asym + playback.pcm "plug:softvol" + capture.pcm "plug:micboost" +} + +ctl.!default { + type hw + card 0 +} +_EOF_ + + elif (( $ALSA_EQ_ENABLED )); then cat << _EOF_ > /etc/asound.conf ctl.eq { From b79639886605239270d797c2383650827f5d0567 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sat, 11 Nov 2017 20:32:19 +0000 Subject: [PATCH 41/43] v158 + Soundcard Google AIY: https://github.com/Fourdee/DietPi/issues/1065 --- dietpi/dietpi-config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index cb4671e4c0..be3bf9dddd 100644 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -4475,7 +4475,8 @@ _EOF_ whiptail_menu_array+=("allo-boss-dac-pcm512x-audio" "Allo Mini Boss DAC") whiptail_menu_array+=("allo-digione" "Allo DigiOne") whiptail_menu_array+=("allo-piano-dac-pcm512x-audio" "Allo Piano DAC") - whiptail_menu_array+=("allo-piano-dac-plus-pcm512x-audio" "Allo Piano DAC 2.1") + whiptail_menu_array+=("allo-piano-dac-pcm512x-audio" "Allo Piano DAC") + whiptail_menu_array+=("googlevoicehat-soundcard" "Google AIY voice kit") whiptail_menu_array+=("hifiberry-amp" "HifiBerry AMP / AMP+") whiptail_menu_array+=("hifiberry-dac" "HifiBerry DAC / MiniAMP") whiptail_menu_array+=("hifiberry-dacplus" "HifiBerry DAC+ / DAC+ Pro") From 3417426f86d5784723763d6994b96030dc0c2826 Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 12 Nov 2017 16:31:50 +0000 Subject: [PATCH 42/43] v158 + run as dietpi user : https://github.com/Fourdee/DietPi/issues/1065 --- CHANGELOG.txt | 2 +- dietpi/dietpi-software | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 333170edfd..fb7e685d35 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,7 +3,7 @@ v158 Changes / Improvements / Optimizations: DietPi-Services | status: Improved this command to highlight working and detail failed services. Failed services will also be listed. 'dietpi-services status': https://github.com/Fourdee/DietPi/issues/1230 -DietPi-Software | Google AIY: Now available for installation: https://github.com/Fourdee/DietPi/issues/1065 +DietPi-Software | Google AIY: Now available for installation: http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=9486#p9486 DietPi-Software | moOde: Initial pass adding into DietPi: https://github.com/Fourdee/DietPi/issues/1223 DietPi-Software | Gitea: Now available for installation. Many thanks to @techdabbler for contributing this addition: https://github.com/Fourdee/DietPi/issues/686 DietPi-Software | Squeezelite recompiled with -DDSD, now supports DSD and DoP audio playback: https://github.com/Fourdee/DietPi/issues/1210 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3778d7042a..7dd02d7220 100644 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3351,7 +3351,7 @@ _EOF_ fi #-qq can add a slight period of appearing nothing is happening, lets inform user - /DietPi/dietpi/func/dietpi-notify 2 "Apt-get is processing, please wait...\n" + /DietPi/dietpi/func/dietpi-notify 2 "APT is processing, please wait...\n" DEBIAN_FRONTEND=noninteractive $APT_BINARY install -y -qq $force_options $string 2>&1 | tee "$FP_APT_LOG" local result=${PIPESTATUS[0]} @@ -7684,7 +7684,7 @@ libglib2.0-dev # - Services sed -i "s#/home/pi#$FP_DIETPI_USERDATA_DIRECTORY#g" systemd/voice-recognizer.service - sed -i "/^User=/c\User=root" systemd/voice-recognizer.service + sed -i "/^User=/c\User=dietpi" systemd/voice-recognizer.service cp systemd/voice-recognizer.service /etc/systemd/system/ cp systemd/alsa-init.service /etc/systemd/system/ @@ -7695,9 +7695,6 @@ libglib2.0-dev # - Enable default app for service start cp src/assistant_library_with_button_demo.py src/main.py - # - Symlink userdata location for assistant.json - ln -sf /mnt/dietpi_userdata/voice-recognizer-raspi/assistant.json /root/assistant.json - cd "$HOME" else @@ -8501,6 +8498,7 @@ _EOF_ #Apply non-root permissions for files and folders in FP_DIETPI_USERDATA_DIRECTORY # - dietpi user + chown -R dietpi:dietpi /home/dietpi chown -R dietpi:dietpi "$FP_DIETPI_USERDATA_DIRECTORY" chmod -R 775 "$FP_DIETPI_USERDATA_DIRECTORY" @@ -12842,6 +12840,12 @@ _EOF_ INSTALLING_INDEX=169 if (( ${aSOFTWARE_INSTALL_STATE[$INSTALLING_INDEX]} == 1 )); then + # - Symlink userdata location for assistant.json + ln -sf /mnt/dietpi_userdata/voice-recognizer-raspi/assistant.json /home/dietpi/assistant.json + + # - Generate cache dir + mkdir -p /home/dietpi/.cache/voice-recognizer + #Setup soundcard /DietPi/dietpi/func/dietpi-set_hardware soundcard googlevoicehat-soundcard @@ -13814,7 +13818,7 @@ _EOF_ rm -R "$FP_DIETPI_USERDATA_DIRECTORY"/voice-recognizer-raspi rm /etc/systemd/system/voice-recognizer.service rm /etc/systemd/system/alsa-init.service - rm -R "$HOME"/assistant.json + rm -R /home/dietpi/assistant.json elif (( $1 == 158 )); then From a9b07c43f0d44efcfc5f682fb6f6f98dd79c2e2e Mon Sep 17 00:00:00 2001 From: "Daniel (Fourdee)" Date: Sun, 12 Nov 2017 16:56:13 +0000 Subject: [PATCH 43/43] v158 + RC --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fb7e685d35..b405fa3eab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,5 @@ v158 -(xx/10/17) +(12/11/17) Changes / Improvements / Optimizations: DietPi-Services | status: Improved this command to highlight working and detail failed services. Failed services will also be listed. 'dietpi-services status': https://github.com/Fourdee/DietPi/issues/1230