diff options
-rw-r--r-- | .homeinstall/README.md | 110 | ||||
-rwxr-xr-x | .homeinstall/hubzilla-setup.sh | 70 | ||||
-rw-r--r-- | Zotlabs/Daemon/Cron.php | 2 | ||||
-rw-r--r-- | Zotlabs/Daemon/CurlAuth.php | 6 | ||||
-rw-r--r-- | Zotlabs/Daemon/Master.php | 2 | ||||
-rw-r--r-- | Zotlabs/Daemon/Poller.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Directory.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Well_known.php | 12 | ||||
-rw-r--r-- | include/channel.php | 4 | ||||
-rw-r--r-- | include/markdown.php | 2 | ||||
-rwxr-xr-x | util/thumbrepair | 2 | ||||
-rw-r--r-- | view/js/main.js | 4 | ||||
-rwxr-xr-x | view/tpl/conv_item.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/conv_list.tpl | 2 | ||||
-rw-r--r-- | view/tpl/usermenu.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/xchan_vcard.tpl | 2 |
16 files changed, 131 insertions, 95 deletions
diff --git a/.homeinstall/README.md b/.homeinstall/README.md index d4613afce..1ed2e07d2 100644 --- a/.homeinstall/README.md +++ b/.homeinstall/README.md @@ -1,50 +1,10 @@ -# Hubzilla at Home next to your Router - -This readme will show you how to install and run Hubzilla (or Zap) at home. - -The installation is done by a script. - -What the script will do for you... - -+ install everything required by Hubzilla, basically a web server (Apache), PHP, a database (MySQL), certbot,... -+ create a database -+ run certbot to have everything for a secure connection (httpS) -+ create a script for daily maintenance - - backup to external disk (certificates, database, /var/www/) - - renew certfificate (letsencrypt) - - update of Hubzilla - - update of Debian - - restart -+ create cron jobs for - - DynDNS (selfHOST.de or freedns.afraid.org) every 5 minutes - - Master.php for Zap/Hubzilla every 10 minutes - - daily maintenance script every day at 05:30 - -The script is known to work without adjustments with - -+ Hardware - - Mini-PC with Debian 10 (stretch), or - - Rapberry 3 with Raspbian, Debian 10 -+ DynDNS - - selfHOST.de - - freedns.afraid.org - -The script can install both [Hubzilla](https://zotlabs.org/page/hubzilla/hubzilla-project) and [Zap](https://zotlabs.com/zap/). Make sure to use the correct GIT repositories. - -+ Hubzilla - - core: git clone https://framagit.org/hubzilla/core.git html (in this readme) - - addons: util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons (in hubzilla-setup.sh) -+ Zap - - core: git clone https://framagit.org/zot/zap.git html (in this readme) - - addons: util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons (in hubzilla-setup.sh) +# How to use ## Disclaimers - This script does work with Debian 10 only. - This script has to be used on a fresh debian install only (it does not take account for a possibly already installed and configured webserver or sql implementation). -# Step-by-Step Overwiew - ## Preconditions Hardware @@ -58,7 +18,7 @@ Software + Fresh installation of Debian 10 (Stretch) + Router with open ports 80 and 443 for your web server -## The basic steps (quick overview) +## How to run the script + Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS) + Log on to your fresh Debian @@ -76,31 +36,68 @@ Software - ... wait, wait, wait until the script is finised + Open your domain with a browser and step throught the initial configuration of hubzilla. -## Troubleshooting +## Optional - Set path to imagemagick -If the check of the mail address fails when you try to register the very first user in the browser. Do... +In Admin settings of hubzilla or via terminal cd /var/www/html - util/config system.do_not_check_dns 1 + util/config system.imagick_convert_path /usr/bin/convert -## Optional - Set path to imagemagick +## Optional - Switch verification of email on/off + +Do this just befor you register the user. In Admin settings of hubzilla or via terminal cd /var/www/html - util/config system.imagick_convert_path /usr/bin/convert -# Step-by-Step in Detail +Check the current setting + + util/config system verify_email + +Switch the verification on/off (1/0) + + util/config system verify_email 0 + +## What the script will do for you... + ++ install everything required by Hubzilla, basically a web server (Apache), PHP, a database (MySQL), certbot,... ++ create a database ++ run certbot to have everything for a secure connection (httpS) ++ create a script for daily maintenance + - backup to external disk (certificates, database, /var/www/) + - renew certfificate (letsencrypt) + - update of Hubzilla + - update of Debian + - restart ++ create cron jobs for + - DynDNS (selfHOST.de or freedns.afraid.org) every 5 minutes + - Master.php for Zap/Hubzilla every 10 minutes + - daily maintenance script every day at 05:30 + +The script is known to work without adjustments with + ++ Hardware + - Mini-PC with Debian 10 (stretch), or + - Rapberry 3 with Raspbian, Debian 10 ++ DynDNS + - selfHOST.de + - freedns.afraid.org + +The script can install both [Hubzilla](https://zotlabs.org/page/hubzilla/hubzilla-project) and [Zap](https://zotlabs.com/zap/). Make sure to use the correct GIT repositories. -## Preparations Software ++ Hubzilla + - core: git clone https://framagit.org/hubzilla/core.git html (in this readme) + - addons: util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons (in hubzilla-setup.sh) ++ Zap + - core: git clone https://framagit.org/zot/zap.git html (in this readme) + - addons: util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons (in hubzilla-setup.sh) -## Install Debian 9 -Provided you use a Raspberry Pi 3... -Download the OS Raspbian from https://www.raspberrypi.org/downloads/raspbian/ +# Step-by-Step - some Details -Follow the installation instruction there. +## Preparations ## Configure your Router @@ -146,12 +143,5 @@ to boot the Rapsi to the client console. DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI! -On a Raspian Stretch (Debian 10) the validation of the mail address fails for the very first user. -This used to happen on some *bsd distros but there was some work to fix that a year ago (2017). - -So if your system isn't registered in DNS or DNS isn't active do - - cd /var/www/html - util/config system.do_not_check_dns 1 diff --git a/.homeinstall/hubzilla-setup.sh b/.homeinstall/hubzilla-setup.sh index be190e389..1103bd5fd 100755 --- a/.homeinstall/hubzilla-setup.sh +++ b/.homeinstall/hubzilla-setup.sh @@ -28,14 +28,13 @@ # * php, # * mariadb - the database for hubzilla, # * adminer, -# * git to download and update hubzilla addon -# - download hubzilla core and addons +# * git to download and update addons # - configure cron # * "Master.php" for regular background prozesses of hubzilla # * "apt-get update" and "apt-get dist-upgrade" and "apt-get autoremove" to keep linux up-to-date # * run command to keep the IP up-to-date > DynDNS provided by selfHOST.de or freedns.afraid.org # * backup hubzillas database and files (rsync) -# - letsencrypt +# - run letsencrypt to create, register and use a certifacte for https # # # Discussion @@ -56,7 +55,7 @@ # - creates a daily cron that runs the hubzilla-daily.sh # # hubzilla-daily.sh makes a (daily) backup of all relevant files -# - /var/lib/mysql/ > hubzilla database +# - /var/lib/mysql/ > database # - /var/www/ > hubzilla/zap from github # - /etc/letsencrypt/ > certificates # @@ -223,6 +222,11 @@ function install_curl { nocheck_install "curl" } +function install_wget { + print_info "installing wget..." + nocheck_install "wget" +} + function install_sendmail { print_info "installing sendmail..." nocheck_install "sendmail sendmail-bin" @@ -269,7 +273,19 @@ function install_adminer { else print_info "file /etc/adminer/adminer.conf exists already" fi + + a2enmod rewrite + + if [ ! -f /etc/apache2/apache2.conf ] + then + die "could not find file /etc/apache2/apache2.conf" + fi + sed -i \ + "s/AllowOverride None/AllowOverride all/" \ + /etc/apache2/apache2.conf + a2enconf adminer + systemctl restart mariadb systemctl reload apache2 } @@ -407,10 +423,9 @@ function install_letsencrypt { then die "Failed to install let's encrypt: 'le_domain' is empty in $configfile" fi - # check if user gave mail address if [ -z "$le_email" ] then - die "Failed to install let's encrypt: 'le_domain' is empty in $configfile" + die "Failed to install let's encrypt: 'le_email' is empty in $configfile" fi nocheck_install "certbot python-certbot-apache" print_info "run certbot ..." @@ -431,12 +446,19 @@ function check_https { } function install_hubzilla { - print_info "installing hubzilla addons..." + print_info "installing addons..." cd /var/www/html/ - # if you install Hubzilla - # util/add_addon_repo https://framagit.org/hubzilla/addons hzaddons - # if you install ZAP - util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons + if git remote -v | grep -i "origin.*core.git" + then + print_info "hubzilla" + util/add_addon_repo https://framagit.org/hubzilla/addons hzaddons + elif git remote -v | grep -i "origin.*zap.git" + then + print_info "zap" + util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons + else + die "neither zap nor hubzilla repository > did not install addons or zap/hubzilla" + fi mkdir -p "store/[data]/smarty3" chmod -R 777 store touch .htconfig.php @@ -446,7 +468,7 @@ function install_hubzilla { chown root:www-data /var/www/html/ chown root:www-data /var/www/html/.htaccess chmod 0644 /var/www/html/.htaccess - print_info "installed hubzilla" + print_info "installed addons" } function install_rsync { @@ -585,6 +607,7 @@ check_config stop_hubzilla update_upgrade install_curl +install_wget install_sendmail install_apache install_imagemagick @@ -600,23 +623,34 @@ configure_cron_selfhost if [ "$le_domain" != "localhost" ] then - install_letsencrypt - check_https + install_letsencrypt + configure_apache_for_https + check_https else - print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https" + print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https" fi install_hubzilla +if [ "$le_domain" != "localhost" ] +then + rewrite_to_https + install_rsnapshot +else + print_info "is localhost - skipped rewrite to https and installation of rsnapshot" +fi + configure_cron_daily if [ "$le_domain" != "localhost" ] then - install_rsync - install_cryptosetup + install_cryptosetup + write_uninstall_script else - print_info "is localhost - skipped installation of cryptosetup" + print_info "is localhost - skipped installation of cryptosetup" fi + #set +x # stop debugging from here + diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index fe356bcbf..a08d2b7d2 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -215,7 +215,7 @@ class Cron { $restart = true; $generation = intval($argv[2]); if(! $generation) - killme(); + return; } reload_plugins(); diff --git a/Zotlabs/Daemon/CurlAuth.php b/Zotlabs/Daemon/CurlAuth.php index be12bc779..de41382e3 100644 --- a/Zotlabs/Daemon/CurlAuth.php +++ b/Zotlabs/Daemon/CurlAuth.php @@ -13,7 +13,7 @@ class CurlAuth { static public function run($argc,$argv) { if($argc != 2) - killme(); + return; \App::$session->start(); @@ -50,6 +50,6 @@ class CurlAuth { file_put_contents($c,$x); - killme(); + return; } -}
\ No newline at end of file +} diff --git a/Zotlabs/Daemon/Master.php b/Zotlabs/Daemon/Master.php index 67a3acc0a..8c3a7e570 100644 --- a/Zotlabs/Daemon/Master.php +++ b/Zotlabs/Daemon/Master.php @@ -9,7 +9,7 @@ if(array_search( __file__ , get_included_files()) === 0) { if($argc) Master::Release($argc,$argv); - killme(); + return; } diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php index 84bf7e923..ebc0584ba 100644 --- a/Zotlabs/Daemon/Poller.php +++ b/Zotlabs/Daemon/Poller.php @@ -47,7 +47,7 @@ class Poller { $restart = true; $generation = intval($argv[2]); if(! $generation) - killme(); + return; } if(($argc > 1) && intval($argv[1])) { diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php index 8f5db6635..dee22721d 100644 --- a/Zotlabs/Module/Directory.php +++ b/Zotlabs/Module/Directory.php @@ -345,7 +345,7 @@ class Directory extends \Zotlabs\Web\Controller { 'pdesc_label' => t('Description:'), 'marital' => $marital, 'homepage' => $homepage, - 'homepageurl' => linkify($homepageurl), + 'homepageurl' => linkify($homepageurl, true), 'hometown' => $hometown, 'hometown_label' => t('Hometown:'), 'about' => $about, diff --git a/Zotlabs/Module/Well_known.php b/Zotlabs/Module/Well_known.php index 09e743788..140ab260d 100644 --- a/Zotlabs/Module/Well_known.php +++ b/Zotlabs/Module/Well_known.php @@ -63,6 +63,18 @@ class Well_known extends \Zotlabs\Web\Controller { case 'dnt-policy.txt': echo file_get_contents('doc/dnt-policy.txt'); killme(); + + case 'caldav': + if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') { + http_status('301', 'moved permanently'); + goaway(z_root() . '/cdav'); + }; + + case 'carddav': + if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') { + http_status('301', 'moved permanently'); + goaway(z_root() . '/cdav'); + }; default: if(file_exists(\App::$cmd)) { diff --git a/include/channel.php b/include/channel.php index 7c0397e11..5d583e4f1 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1718,9 +1718,9 @@ function advanced_profile() { if(App::$profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), App::$profile['sexual'] ); - if(App::$profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify(App::$profile['homepage']) ); + if(App::$profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify(App::$profile['homepage'], true) ); - if(App::$profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify(App::$profile['hometown']) ); + if(App::$profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify(App::$profile['hometown'], true) ); if(App::$profile['politic']) $profile['politic'] = array( t('Political Views:'), App::$profile['politic']); diff --git a/include/markdown.php b/include/markdown.php index 0a8076799..213986867 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -266,7 +266,7 @@ function bb_to_markdown($Text, $options = []) { $Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text); // Remove unprocessed spoiler HTML tags - $Text = strip_tags(preg_replace("/(<\/div>)(>.+)$/im", "$1\n$2", $Text)); + $Text = preg_replace("/<div.+>([^<]+)<.+>(>.+)$/im", "$1\n$2", $Text); $Text = trim($Text); diff --git a/util/thumbrepair b/util/thumbrepair index acd453719..a37e978af 100755 --- a/util/thumbrepair +++ b/util/thumbrepair @@ -17,7 +17,7 @@ if($x) { $width = $xx['width']; $height = $xx['height']; - $n = q("SELECT * FROM photo WHERE resource_id = '%s' AND imgscale > 0", + $n = q("SELECT * FROM photo WHERE resource_id = '%s' AND imgscale > 0 ORDER BY imgscale", dbesc($xx['resource_id']) ); diff --git a/view/js/main.js b/view/js/main.js index 2eea7543d..bc1c48cf1 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1146,8 +1146,8 @@ function doreply(parent, ident, owner, hint) { var i = form.find('button[type=submit]'); var btn = i.html().replace(/<[^>]*>/g, '').trim(); i.html('<i class="fa fa-reply" ></i> ' + btn); - i.prop('title', hint); - form.find('textarea').val("@{" + owner + "} "); + var sel = 'wall-item-body-' + ident.toString(); + form.find('textarea').val("@{" + owner + "}" + (($(window.getSelection().anchorNode).closest("#" + sel).attr("id") != sel) ? " " : "\n[quote]" + window.getSelection().toString() + "[/quote]\n")); $('#comment-edit-text-' + parent.toString()).focus(); } diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 09a2e05e0..186551e2d 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -20,7 +20,7 @@ {{/if}} {{if $item.title && !$item.event}} <div class="p-2{{if $item.is_new}} bg-primary text-white{{/if}} wall-item-title h3{{if !$item.photo}} rounded-top{{/if}}" id="wall-item-title-{{$item.id}}"> - {{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}} + {{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})" rel="nofollow">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}} </div> {{if ! $item.is_new}} <hr class="m-0"> diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl index a0c2cf827..8c5b47bf3 100755 --- a/view/tpl/conv_list.tpl +++ b/view/tpl/conv_list.tpl @@ -20,7 +20,7 @@ {{/if}} {{if $item.title && !$item.event}} <div class="p-2{{if $item.is_new}} bg-primary text-white{{/if}} wall-item-title h3{{if !$item.photo}} rounded-top{{/if}}" id="wall-item-title-{{$item.id}}"> - {{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}} + {{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})" rel="nofollow">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}} </div> {{if ! $item.is_new}} <hr class="m-0"> diff --git a/view/tpl/usermenu.tpl b/view/tpl/usermenu.tpl index 8bbfedd07..535d5b5a8 100644 --- a/view/tpl/usermenu.tpl +++ b/view/tpl/usermenu.tpl @@ -8,7 +8,7 @@ <ul class="pmenu-body{{if $wrap || !$class}} nav nav-pills flex-column{{elseif !$wrap || $class}} {{$class}}{{/if}}"> {{foreach $items as $mitem }} <li id="pmenu-item-{{$mitem.mitem_id}}" class="nav-item pmenu-item{{if $mitem.submenu}} dropdown{{/if}}"> - <a href="{{if $mitem.submenu}}#{{else}}{{$mitem.mitem_link}}{{/if}}" class="nav-link {{if $mitem.submenu}} dropdown-toggle{{/if}}"{{if $mitem.submenu}} data-toggle="dropdown"{{/if}}{{if $mitem.newwin}}target="_blank"{{/if}}>{{$mitem.mitem_desc}}{{if $mitem.submenu}}<span class="caret"></span>{{/if}}</a> + <a href="{{if $mitem.submenu}}#{{else}}{{$mitem.mitem_link}}{{/if}}" class="nav-link {{if $mitem.submenu}} dropdown-toggle{{/if}}"{{if $mitem.submenu}} data-toggle="dropdown"{{/if}}{{if $mitem.newwin}}target="_blank"{{/if}} rel="nofollow noopener">{{$mitem.mitem_desc}}{{if $mitem.submenu}}<span class="caret"></span>{{/if}}</a> {{if $mitem.submenu}}{{$mitem.submenu}}{{/if}} </li> {{/foreach }} diff --git a/view/tpl/xchan_vcard.tpl b/view/tpl/xchan_vcard.tpl index ac796cd47..9c357bba8 100755 --- a/view/tpl/xchan_vcard.tpl +++ b/view/tpl/xchan_vcard.tpl @@ -1,7 +1,7 @@ <div id="vcard" class="vcard h-card"> <div id="profile-photo-wrapper"><a href="{{$link}}"><img class="vcard-photo photo u-photo" src="{{$photo}}" alt="{{$name}}" /></a></div> {{if $connect}} -<div class="connect-btn-wrapper"><a href="follow?f=&url={{$follow}}" class="btn btn-block btn-success btn-sm"><i class="fa fa-plus"></i> {{$connect}}</a></div> +<div class="connect-btn-wrapper"><a href="follow?f=&url={{$follow}}" class="btn btn-block btn-success btn-sm" rel="nofollow"><i class="fa fa-plus"></i> {{$connect}}</a></div> {{/if}} <div class="fn p-name">{{$name}}</div> </div> |