diff --git a/README.md b/README.md index 839f9880..70594c13 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@ # YunoHost App for Hubzilla Hub ## Hubzilla -[Hubzilla](http://hubzilla.org) is a powerful platform for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology. +[Hubzilla](http://hubzilla.org) is a powerful platform for creating interconnected websites featuring a decentralized identity, commuhubzilla_test1nications, and permissions framework built using common webserver technology. -Current snapshot in *sources*: +Current snapshot in *sources*: -* https://github.com/redmatrix/hubzilla: 2.0 (commit c2830c4a98cf3c9983b3c4b61024d52a6d7187df) -* https://github.com/redmatrix/hubzilla-addons: 2.0 (commit 7cdd80991a517f318207223e0d5622f5535f476c) +* https://github.com/redmatrix/hubzilla: 2.4.2 (commit 8896ebf7cbf20c242399c3821be5881e6068175a) +* https://github.com/redmatrix/hubzilla-addons: 2.4.2 (commit 30f3104ebe2121a433d174bb3bcb703bb9787bd3) ## Important Notes -Before installing, read the [Hubzilla installation instructions](https://github.com/redmatrix/hubzilla/blob/master/install/INSTALL.txt) for important information about +Before installing, read the [Hubzilla installation instructions](https://github.com/redmatrix/hubzilla/blob/master/install/INSTALL.txt) for important information about - SSL certificate validation requirement (now with support for [Let's Encrypt!](https://letsencrypt.org)). See Installation section below. - Dedicated domain (must install under web root like **https://hub.example.com/** not **https://example.com/hub/** ) - Required packages (all of these are not yet installed by this YunoHost installer package). This YunoHost package installs the following additional packages: - - php5-cli - - php5-imagick - - php5-gd - - php5-mcrypt + - php5-cli + - php5-imagick + - php5-gd + - php5-mcrypt - This package requires a **system-wide change to php.ini** that enables the `exec()` perimission. [See the PHP manual for more information](php.net/manual/function.exec.php). @@ -31,10 +31,10 @@ Hubzilla requires a dedicated domain, so obtain one and add it using the [YunoHo Hubzilla requires browser-approved SSL certificates. If you have certificates not issued by [Let's Encrypt](https://letsencrypt.org/), install them manually as usual. -#### YunoHost >= 2.5 : +#### YunoHost >= 2.5 : Once the dedicated domain has been added to YunoHost, go again to the admin panel, go to domains then select your domain and click on "Install Let's Encrypt certificate". -#### Yunohost < 2.5 : +#### Yunohost < 2.5 : For older versions of YunoHost, once you have added the new domain, SSH into your YunoHost server and perform the following steps: 1. Install [certbot](https://certbot.eff.org/) to make installing free SSL certificates from Let's Encrypt simple. @@ -42,20 +42,20 @@ For older versions of YunoHost, once you have added the new domain, SSH into you 1. Stop nginx service nginx stop - + 1. Run the **certbot** utility with the **certonly** option certbot certonly 1. Copy the generated certificate and key into the appropriate location for YunoHost to use - cp /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem /etc/yunohost/certs/YOUR_DOMAIN/crt.pem - cp /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem /etc/yunohost/certs/YOUR_DOMAIN/key.pem + cp /etc/letsencrypt/live/YOUR_DOMAIN/fullchain.pem /etc/yunohost/certs/YOUR_DOMAIN/crt.pem + cp /etc/letsencrypt/live/YOUR_DOMAIN/privkey.pem /etc/yunohost/certs/YOUR_DOMAIN/key.pem 1. Restart nginx - + service nginx start - + ### Install the Hubzilla application Use the [YunoHost admin](https://reticu.li/yunohost/admin) panel to install Hubzilla by entering the GitHub repo address in the custom app URL @@ -64,3 +64,5 @@ Use the [YunoHost admin](https://reticu.li/yunohost/admin) panel to install Hubz Make sure to select your domain from the previous section as the application domain. Also set the application to Public. When installation is complete, you will need to visit your new hub and register a new account using the email address you specified in the app installation form. You should then be able to log in and create your first channel. +If above method do not work for you then you have give an account administrator access through phpMYAdmin by +adding 4096 to the account_roles for that account in the database. diff --git a/conf/ldap_conf.php b/conf/ldap_conf.php new file mode 100644 index 00000000..a4688d69 --- /dev/null +++ b/conf/ldap_conf.php @@ -0,0 +1,7 @@ +App::$config['system']['addon'] = 'ldapauth'; + +App::$config['ldapauth']['ldap_server'] = 'localhost'; +App::$config['ldapauth']['ldap_searchdn'] = 'ou=users,dc=yunohost,dc=org'; +App::$config['ldapauth']['ldap_userattr'] = 'uid'; +App::$config['ldapauth']['ldap_autocreateaccount_emailattribute'] = 'mail'; +App::$config['ldapauth']['create_account'] = '1'; diff --git a/scripts/install b/scripts/install index b34d6b57..143b5781 100755 --- a/scripts/install +++ b/scripts/install @@ -85,7 +85,9 @@ sudo sed -i "s/mysqlusername/$db_user/g" $final_path/.htconfig.php sudo sed -i "s/mysqldatabasename/$db_user/g" $final_path/.htconfig.php sudo sed -i "s/mysite.example/$domain/g" $final_path/.htconfig.php sudo sed -i "s/if the auto install failed, put a unique random string here/$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)/g" $final_path/.htconfig.php -sudo sed -i "s/ADMIN_EMAIL_REPLACE/$email/g" $final_path/.htconfig.php +sudo sed -i "s/\['admin_email'\] = '';/\['admin_email'\] = '$email';/g" $final_path/.htconfig.php +# addon ldap config +sudo su -c "cat ../conf/ldap_conf.php >> $final_path/.htconfig.php" # Set www-data to owner sudo chown -R www-data:www-data $final_path @@ -132,4 +134,3 @@ sudo service php5-fpm reload || true sudo service nginx reload || true sudo yunohost app ssowatconf - diff --git a/scripts/remove b/scripts/remove index 5204e8ca..911e96a5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -21,7 +21,7 @@ REMOVE_NGINX_CONF # Suppression de la configuration nginx REMOVE_FPM_CONF # Suppression de la configuration du pool php-fpm # Remove poller cron job -sudo rm -f /etc/cron.d/poller-cron +sudo rm -f /etc/cron.d/$app # Restore php.ini as it was before installing hubzilla if [ "$run_exec" = "Yes" ]; diff --git a/scripts/upgrade b/scripts/upgrade index 3c2c061f..98a24899 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,11 @@ run_exec=$(ynh_app_setting_get $app run_exec) CHECK_PATH # Vérifie et corrige la syntaxe du path. +# Make backup of old app folder and create again the app folder +sudo mv ${final_path} ${final_path}.old +sudo mkdir -p $final_path + + # We download the sources and check the md5sum # 1 - hubzilla hubzilla_file=`sudo cat ../sources/hubzilla/source_file`; @@ -28,6 +33,9 @@ sudo wget -nv -i ../sources/hubzilla/source_url -O ${hubzilla_file}.zip sudo md5sum -c ../sources/hubzilla/source_md5 --status || (echo "Corrupt source" >&2 && false) sudo unzip -q ${hubzilla_file}.zip -d ../sources/hubzilla/ sudo cp -r ../sources/hubzilla/${hubzilla_file}/. $final_path +sudo cp -a ${final_path}.old/store ${final_path} +sudo cp -a ${final_path}.old/.htconfig.php ${final_path} +sudo rm -Rf ${final_path}.old # 2 - Addons addons_file=`sudo cat ../sources/hubzilla-addons/source_file`; @@ -38,20 +46,9 @@ sudo mkdir $final_path/addon sudo cp -r ../sources/hubzilla-addons/${addons_file}/. $final_path/addon # 3 - some extra folders -sudo mkdir -p "${final_path}/store/[data]/smarty3" sudo chmod -R 777 $final_path/store -# Copy the template install/htconfig.sample.php to .htconfig.php -sudo cp $final_path/install/htconfig.sample.php $final_path/.htconfig.php -# Use sed to add the database information to .htconfig.php -sudo sed -i "s/your.mysqlhost.com/localhost/g" $final_path/.htconfig.php -sudo sed -i "s/mysqlpassword/$db_pwd/g" $final_path/.htconfig.php -sudo sed -i "s/mysqlusername/$db_user/g" $final_path/.htconfig.php -sudo sed -i "s/mysqldatabasename/$db_user/g" $final_path/.htconfig.php -sudo sed -i "s/mysite.example/$domain/g" $final_path/.htconfig.php -sudo sed -i "s/if the auto install failed, put a unique random string here/$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)/g" $final_path/.htconfig.php -sudo sed -i "s/ADMIN_EMAIL_REPLACE/$email/g" $final_path/.htconfig.php # Set www-data to owner sudo chown -R www-data:www-data $final_path @@ -95,4 +92,3 @@ fi sudo service php5-fpm reload || true sudo service nginx reload || true sudo yunohost app ssowatconf - diff --git a/sources/hubzilla-addons/source_file b/sources/hubzilla-addons/source_file index 767af75b..23752f9f 100644 --- a/sources/hubzilla-addons/source_file +++ b/sources/hubzilla-addons/source_file @@ -1 +1 @@ -hubzilla-addons-2.0 +hubzilla-addons-2.4.2 diff --git a/sources/hubzilla-addons/source_md5 b/sources/hubzilla-addons/source_md5 index 586c2939..0eb78dad 100644 --- a/sources/hubzilla-addons/source_md5 +++ b/sources/hubzilla-addons/source_md5 @@ -1 +1 @@ -09278c5123db1bbb5546c659177ecce5 hubzilla-addons-2.0.zip +24cde04ec71c61864e0ce904a27ad432 hubzilla-addons-2.4.2.zip diff --git a/sources/hubzilla-addons/source_url b/sources/hubzilla-addons/source_url index f250a766..8b6bf9e7 100644 --- a/sources/hubzilla-addons/source_url +++ b/sources/hubzilla-addons/source_url @@ -1 +1 @@ -https://github.com/redmatrix/hubzilla-addons/archive/2.0.zip +https://github.com/redmatrix/hubzilla-addons/archive/2.4.2.zip diff --git a/sources/hubzilla/source_file b/sources/hubzilla/source_file index 5a20ecf0..5e314aa8 100644 --- a/sources/hubzilla/source_file +++ b/sources/hubzilla/source_file @@ -1 +1 @@ -hubzilla-2.0 +hubzilla-2.4.2 diff --git a/sources/hubzilla/source_md5 b/sources/hubzilla/source_md5 index 322f7085..e00d8623 100644 --- a/sources/hubzilla/source_md5 +++ b/sources/hubzilla/source_md5 @@ -1 +1 @@ -eb60bc48b04451af692af5ec4770066f hubzilla-2.0.zip +779d29162c3e7635bc1c93707c3da67f hubzilla-2.4.2.zip diff --git a/sources/hubzilla/source_url b/sources/hubzilla/source_url index fedff4e5..26bf4c60 100644 --- a/sources/hubzilla/source_url +++ b/sources/hubzilla/source_url @@ -1 +1 @@ -https://github.com/redmatrix/hubzilla/archive/2.0.zip +https://github.com/redmatrix/hubzilla/archive/2.4.2.zip