Allow hubzilla on onion only, no onion address for typical installs

This commit is contained in:
Bob Mottram 2016-02-19 18:35:18 +00:00
parent 220e62ccfa
commit 1a647c1a7a
1 changed files with 86 additions and 89 deletions

View File

@ -9059,10 +9059,6 @@ function install_hubzilla {
if [ ! $HUBZILLA_DOMAIN_NAME ]; then
return
fi
# For now it probably won't install as onion-only. This might change in future
if [[ $ONION_ONLY != "no" ]]; then
return
fi
# update to a new commit if needed
set_repo_commit /var/www/$HUBZILLA_DOMAIN_NAME/htdocs "Hubzilla commit" "$HUBZILLA_COMMIT" $HUBZILLA_REPO
@ -9242,9 +9238,7 @@ function install_hubzilla {
echo '}' >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
echo '' >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
else
echo -n '' > /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
fi
echo 'server {' >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
echo 'server {' > /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
echo " listen 127.0.0.1:${HUBZILLA_ONION_PORT} default_server;" >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
echo " root /var/www/$HUBZILLA_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
echo " server_name $HUBZILLA_DOMAIN_NAME;" >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
@ -9319,6 +9313,7 @@ function install_hubzilla {
echo ' deny all;' >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
echo ' }' >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
echo '}' >> /etc/nginx/sites-available/$HUBZILLA_DOMAIN_NAME
fi
configure_php
@ -9404,21 +9399,23 @@ function install_hubzilla {
nginx_ensite $HUBZILLA_DOMAIN_NAME
HUBZILLA_ONION_HOSTNAME=
if [[ $ONION_ONLY != "no" ]]; then
HUBZILLA_ONION_HOSTNAME=$(add_onion_service hubzilla 80 ${HUBZILLA_ONION_PORT})
systemctl restart php5-fpm
systemctl restart nginx
systemctl restart cron
if ! grep -q "Hubzilla onion domain" /home/$MY_USERNAME/README; then
echo "Hubzilla onion domain: ${HUBZILLA_ONION_HOSTNAME}" >> /home/$MY_USERNAME/README
echo '' >> /home/$MY_USERNAME/README
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
chmod 600 /home/$MY_USERNAME/README
fi
echo "Hubzilla onion domain:${HUBZILLA_ONION_HOSTNAME}" >> $COMPLETION_FILE
fi
systemctl restart php5-fpm
systemctl restart nginx
systemctl restart cron
echo "Hubzilla domain:${HUBZILLA_DOMAIN_NAME}" >> $COMPLETION_FILE
echo "Hubzilla onion domain:${HUBZILLA_ONION_HOSTNAME}" >> $COMPLETION_FILE
echo 'install_hubzilla' >> $COMPLETION_FILE
}