Merge pull request #949 from einervonvielen/dev-fix-homeinstall
Dev fix homeinstall
This commit is contained in:
commit
67dd9c2930
@ -28,23 +28,23 @@ Hardware
|
|||||||
|
|
||||||
Software
|
Software
|
||||||
|
|
||||||
+ Fresh installation of Debian 9 (Stretch) on your mini-pc
|
+ Fresh installation of Debian 9 (Stretch)
|
||||||
+ Router with open ports 80 and 443 for your Debian
|
+ Router with open ports 80 and 443 for your Hub
|
||||||
|
|
||||||
## The basic steps (quick overview)
|
## The basic steps (quick overview)
|
||||||
|
|
||||||
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
|
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
|
||||||
+ Install Debian 9
|
|
||||||
+ On your router: Open the ports 80 and 443
|
|
||||||
+ Log on to your fresh Debian
|
+ Log on to your fresh Debian
|
||||||
- apt-get install git
|
- apt-get install git
|
||||||
- mkdir -p /var/www
|
- mkdir -p /var/www
|
||||||
- cd /var/www
|
- cd /var/www
|
||||||
- git clone https://github.com/redmatrix/hubzilla.git html
|
- git clone https://github.com/redmatrix/hubzilla.git html
|
||||||
- cp .homeinstall/hubzilla-config.txt.template .homeinstall/hubzilla-config.txt
|
- cd /html/.homeinstall
|
||||||
- nano .homeinstall/hubzilla-config.txt
|
- cp hubzilla-config.txt.template hubzilla-config.txt
|
||||||
|
- nano hubzilla-config.txt
|
||||||
- Read the comments carefully
|
- Read the comments carefully
|
||||||
- Enter your values: db pass, domain, values for dyn DNS
|
- Enter your values: db pass, domain, values for dyn DNS
|
||||||
|
- Make sure your external drive (for backups) is mounted
|
||||||
- hubzilla-setup.sh as root
|
- hubzilla-setup.sh as root
|
||||||
- ... wait, wait, wait until the script is finised
|
- ... wait, wait, wait until the script is finised
|
||||||
- reboot
|
- reboot
|
||||||
@ -58,24 +58,27 @@ Software
|
|||||||
|
|
||||||
### Recommended: USB Drive for Backups
|
### Recommended: USB Drive for Backups
|
||||||
|
|
||||||
The installation will create a daily backup.
|
The installation will create a daily backup written to an external drive.
|
||||||
|
|
||||||
If the backup process does not find an external device than the backup goes to
|
|
||||||
the internal disk.
|
|
||||||
|
|
||||||
The USB drive must be compatible with the filesystems
|
The USB drive must be compatible with the filesystems
|
||||||
|
|
||||||
- ext4 (if you do not want to encrypt the USB)
|
- ext4 (if you do not want to encrypt the USB)
|
||||||
- LUKS + ext4 (if you want to encrypt the USB)
|
- LUKS + ext4 (if you want to encrypt the USB)
|
||||||
|
|
||||||
|
The backup includes
|
||||||
|
|
||||||
|
- Hubzilla DB
|
||||||
|
- Hubzilla installation /var/www/html
|
||||||
|
- Certificates for letsencrypt
|
||||||
|
|
||||||
## Preparations Software
|
## Preparations Software
|
||||||
|
|
||||||
### Install Debian Linux on the Mini-PC
|
### Install Debian Linux on the Mini-PC
|
||||||
|
|
||||||
Download the stable Debian 9 at https://www.debian.org/
|
Download the stable Debian at https://www.debian.org/
|
||||||
(Debian 8 is no longer supported.)
|
(Debian 8 is no longer supported.)
|
||||||
|
|
||||||
Create bootable USB drive with Debian on it. You could use
|
Create bootable USB drive with Debian on it.You could use
|
||||||
|
|
||||||
- unetbootin, https://en.wikipedia.org/wiki/UNetbootin
|
- unetbootin, https://en.wikipedia.org/wiki/UNetbootin
|
||||||
- or simply the linux command "dd"
|
- or simply the linux command "dd"
|
||||||
@ -109,12 +112,9 @@ You can use subdomains as well
|
|||||||
|
|
||||||
my.cooldomain.org
|
my.cooldomain.org
|
||||||
|
|
||||||
There are two ways to get a domain
|
There are two ways to get a domain...
|
||||||
|
|
||||||
- buy a domain, or
|
### Method 1: Buy a Domain
|
||||||
- register a free subdomain
|
|
||||||
|
|
||||||
### Method 1: Buy an own Domain
|
|
||||||
|
|
||||||
...for example buy at selfHOST.de
|
...for example buy at selfHOST.de
|
||||||
|
|
||||||
@ -122,14 +122,14 @@ The cost are around 10,- € once and 1,50 € per month (2017).
|
|||||||
|
|
||||||
### Method 2 Register a (free) Subdomain
|
### Method 2 Register a (free) Subdomain
|
||||||
|
|
||||||
...for example register at freeDNS
|
...for example register at freedns.afraid.org
|
||||||
|
|
||||||
Follow the instructions in .homeinstall/hubzilla-config.txt.
|
Follow the instructions in .homeinstall/hubzilla-config.txt.
|
||||||
|
|
||||||
|
|
||||||
## Install Hubzilla on your Debian
|
## Install Hubzilla on your Debian
|
||||||
|
|
||||||
Login to your Debian
|
Login to your debian
|
||||||
(Provided your username is "you" and the name of the mini pc is "debian". You
|
(Provided your username is "you" and the name of the mini pc is "debian". You
|
||||||
could take the IP address instead of "debian")
|
could take the IP address instead of "debian")
|
||||||
|
|
||||||
@ -164,6 +164,8 @@ Modify the file "hubzilla-config.txt". Read the instructions there carefully and
|
|||||||
|
|
||||||
nano hubzilla-config.txt
|
nano hubzilla-config.txt
|
||||||
|
|
||||||
|
Make sure your external drive (for backups) is plugged in and can be mounted as configured in "hubzilla-config.txt". Otherwise the daily backups will not work.
|
||||||
|
|
||||||
Run the script
|
Run the script
|
||||||
|
|
||||||
./hubzilla-setup.sh
|
./hubzilla-setup.sh
|
||||||
@ -187,11 +189,16 @@ Leave db type "MySQL" untouched.
|
|||||||
|
|
||||||
Follow the instructions in the next pages.
|
Follow the instructions in the next pages.
|
||||||
|
|
||||||
|
After the daily script was executed at 05:30 (am)
|
||||||
|
|
||||||
|
- look at var/www/html/hubzilla-daily.log
|
||||||
|
- check your backup on the external drive
|
||||||
|
- optionally view the daily log under yourdomain.org/admin/logs/
|
||||||
|
- set the logfile to var/www/html/hubzilla-daily.log
|
||||||
|
|
||||||
## Note for the Rasperry
|
## Note for the Rasperry
|
||||||
|
|
||||||
The script was tested with a Raspberry 3 under Raspian (Debian 9.3, 2017-11-29-raspbian-stretch.img).
|
The script was tested with an Raspberry 3 under Raspian (Debian 9.3, 2017-11-29-raspbian-stretch.img).
|
||||||
|
|
||||||
Be patient when a page is loaded by your Raspi-Hub for the very first time. Especially the config pages after the install will load very slowly.
|
|
||||||
|
|
||||||
It is recommended to deinstall these programms to avoid endless updates. Use...
|
It is recommended to deinstall these programms to avoid endless updates. Use...
|
||||||
|
|
||||||
@ -202,8 +209,8 @@ It is recommended to run the Raspi without graphical frontend (X-Server). Use...
|
|||||||
|
|
||||||
sudo raspi-config
|
sudo raspi-config
|
||||||
|
|
||||||
There choose "3 Boot Options" > "31 Desktop / CLI" > "B1 Console". Reboot.
|
to boot the Rapsi to the client console.
|
||||||
|
|
||||||
**DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!**
|
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@ db_pass=
|
|||||||
# This script automates installation of an SSL certificate from
|
# This script automates installation of an SSL certificate from
|
||||||
# Let's Encrypt (https://letsencrypt.org)
|
# Let's Encrypt (https://letsencrypt.org)
|
||||||
#
|
#
|
||||||
# Please give the domain name of your hub. Examples:
|
# Please give the domain name of your hub
|
||||||
#
|
#
|
||||||
# le_domain=my.cooldomain.org
|
# Example: my.cooldomain.org
|
||||||
# le_domain=cooldomain.org
|
# Example: cooldomain.org
|
||||||
#
|
#
|
||||||
# Email is optional
|
# Email is optional
|
||||||
#
|
#
|
||||||
@ -25,7 +25,7 @@ le_domain=
|
|||||||
le_email=
|
le_email=
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
### OPTIONAL - dynamic IP address - selfHOST ##
|
### OPTIONAL - selfHOST - dynamic IP address ##
|
||||||
#
|
#
|
||||||
# 1. Register a domain at selfhost.de
|
# 1. Register a domain at selfhost.de
|
||||||
# - choose offer "DOMAIN dynamisch" 1,50€/mon at 08.01.2016
|
# - choose offer "DOMAIN dynamisch" 1,50€/mon at 08.01.2016
|
||||||
@ -42,7 +42,7 @@ selfhost_user=
|
|||||||
selfhost_pass=
|
selfhost_pass=
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
### OPTIONAL - dynamic IP address - FreeDNS ###
|
### OPTIONAL - FreeDNS - dynamic IP address ###
|
||||||
#
|
#
|
||||||
# Please give the alpha-numeric-key of freedns
|
# Please give the alpha-numeric-key of freedns
|
||||||
#
|
#
|
||||||
|
@ -459,11 +459,6 @@ function configure_cron_selfhost {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_git {
|
|
||||||
print_info "installing git..."
|
|
||||||
nocheck_install "git"
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_letsencrypt {
|
function install_letsencrypt {
|
||||||
print_info "installing let's encrypt ..."
|
print_info "installing let's encrypt ..."
|
||||||
# check if user gave domain
|
# check if user gave domain
|
||||||
@ -570,20 +565,13 @@ function check_https {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function install_hubzilla {
|
function install_hubzilla {
|
||||||
print_info "installing hubzilla..."
|
print_info "installing hubzilla addons..."
|
||||||
# rm -R /var/www/html/ # for "stand alone" usage
|
cd /var/www/html/
|
||||||
cd /var/www/
|
util/add_addon_repo https://github.com/redmatrix/hubzilla-addons.git hzaddons
|
||||||
# git clone https://github.com/redmatrix/hubzilla html # for "stand alone" usage
|
|
||||||
cd html/
|
|
||||||
git clone https://github.com/redmatrix/hubzilla-addons addon
|
|
||||||
mkdir -p "store/[data]/smarty3"
|
mkdir -p "store/[data]/smarty3"
|
||||||
chmod -R 777 store
|
chmod -R 777 store
|
||||||
touch .htconfig.php
|
touch .htconfig.php
|
||||||
chmod ou+w .htconfig.php
|
chmod ou+w .htconfig.php
|
||||||
# uncomment the last function call "install_hubzilla_plugins"
|
|
||||||
# - if you want to install addons and themes that are not officially supported
|
|
||||||
# - and read the comments in function "install_hubzilla_plugins" how do do it
|
|
||||||
# install_hubzilla_plugins
|
|
||||||
cd /var/www/
|
cd /var/www/
|
||||||
chown -R www-data:www-data html
|
chown -R www-data:www-data html
|
||||||
chown root:www-data /var/www/html/
|
chown root:www-data /var/www/html/
|
||||||
@ -598,72 +586,6 @@ function install_hubzilla {
|
|||||||
print_info "installed hubzilla"
|
print_info "installed hubzilla"
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_hubzilla_plugins {
|
|
||||||
print_info "installing hubzilla plugins..."
|
|
||||||
cd /var/www/html
|
|
||||||
plugin_install=.homeinstall/plugin_install.txt
|
|
||||||
theme_install=.homeinstall/theme_install.txt
|
|
||||||
# overwrite script to update the plugin and themes
|
|
||||||
rm -f $plugins_update
|
|
||||||
echo "cd /var/www/html" >> $plugins_update
|
|
||||||
###################
|
|
||||||
# write plugin file
|
|
||||||
if [ ! -f "$plugin_install" ]
|
|
||||||
then
|
|
||||||
echo "# To install a plugin" >> $plugin_install
|
|
||||||
echo "# 1. add the plugin in a new line and run" >> $plugin_install
|
|
||||||
echo "# 2. run" >> $plugin_install
|
|
||||||
echo "# cd /var/www/html/.homeinstall" >> $plugin_install
|
|
||||||
echo "# ./hubzilla-setup.sh" >> $plugin_install
|
|
||||||
echo "https://gitlab.com/zot/ownmapp.git ownMapp" >> $plugin_install
|
|
||||||
fi
|
|
||||||
# install plugins
|
|
||||||
while read -r line; do
|
|
||||||
[[ "$line" =~ ^#.*$ ]] && continue
|
|
||||||
p_url=$(echo $line | awk -F' ' '{print $1}')
|
|
||||||
p_name=$(echo $line | awk -F' ' '{print $2}')
|
|
||||||
# basic check of format
|
|
||||||
if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ]
|
|
||||||
then
|
|
||||||
# install addon
|
|
||||||
util/add_addon_repo $line
|
|
||||||
util/update_addon_repo $p_name # not sure if this line is neccessary
|
|
||||||
echo "util/update_addon_repo $p_name" >> $plugins_update
|
|
||||||
else
|
|
||||||
print_info "skipping installation of a plugin from file $plugin_install - something wrong with format in line: $line"
|
|
||||||
fi
|
|
||||||
done < "$plugin_install"
|
|
||||||
###################
|
|
||||||
# write theme file
|
|
||||||
if [ ! -f "$theme_install" ]
|
|
||||||
then
|
|
||||||
echo "# To install a theme" >> $theme_install
|
|
||||||
echo "# 1. add the theme in a new line and run" >> $theme_install
|
|
||||||
echo "# 2. run" >> $theme_install
|
|
||||||
echo "# cd /var/www/html/.homeinstall" >> $theme_install
|
|
||||||
echo "# ./hubzilla-setup.sh" >> $theme_install
|
|
||||||
echo "https://github.com/DeadSuperHero/hubzilla-themes.git DeadSuperHeroThemes" >> $theme_install
|
|
||||||
|
|
||||||
fi
|
|
||||||
# install plugins
|
|
||||||
while read -r line; do
|
|
||||||
[[ "$line" =~ ^#.*$ ]] && continue
|
|
||||||
p_url=$(echo $line | awk -F' ' '{print $1}')
|
|
||||||
p_name=$(echo $line | awk -F' ' '{print $2}')
|
|
||||||
# basic check of format
|
|
||||||
if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ]
|
|
||||||
then
|
|
||||||
# install addon
|
|
||||||
util/add_theme_repo $line
|
|
||||||
util/update_theme_repo $p_name # not sure if this line is neccessary
|
|
||||||
echo "util/update_theme_repo $p_name" >> $plugins_update
|
|
||||||
else
|
|
||||||
print_info "skipping installation of a theme from file $theme_install - something wrong with format in line: $line"
|
|
||||||
fi
|
|
||||||
done < "$theme_install"
|
|
||||||
print_info "installed hubzilla plugins and themes"
|
|
||||||
}
|
|
||||||
|
|
||||||
function rewrite_to_https {
|
function rewrite_to_https {
|
||||||
print_info "configuring apache to redirect http to httpS ..."
|
print_info "configuring apache to redirect http to httpS ..."
|
||||||
htaccessfile=/var/www/html/.htaccess
|
htaccessfile=/var/www/html/.htaccess
|
||||||
@ -788,12 +710,11 @@ echo " fi" >> /var/www/$hubzilladaily
|
|||||||
echo "fi" >> /var/www/$hubzilladaily
|
echo "fi" >> /var/www/$hubzilladaily
|
||||||
echo "if [ \$device_mounted == 0 ]" >> /var/www/$hubzilladaily
|
echo "if [ \$device_mounted == 0 ]" >> /var/www/$hubzilladaily
|
||||||
echo "then" >> /var/www/$hubzilladaily
|
echo "then" >> /var/www/$hubzilladaily
|
||||||
echo " echo \"device could not be mounted $backup_device_name. Using internal disk for backup...\"" >> /var/www/$hubzilladaily
|
echo " echo \"device could not be mounted $backup_device_name. No backup written.\"" >> /var/www/$hubzilladaily
|
||||||
echo " rsnapshot -c $snapshotconfig alpha" >> /var/www/$hubzilladaily
|
|
||||||
echo "fi" >> /var/www/$hubzilladaily
|
echo "fi" >> /var/www/$hubzilladaily
|
||||||
echo "#" >> /var/www/$hubzilladaily
|
echo "#" >> /var/www/$hubzilladaily
|
||||||
echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
|
echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
|
||||||
echo "du -h /var/cache/rsnapshot/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
|
echo "du -h /var/lib/mysql/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
|
||||||
echo "#" >> /var/www/$hubzilladaily
|
echo "#" >> /var/www/$hubzilladaily
|
||||||
echo "# update" >> /var/www/$hubzilladaily
|
echo "# update" >> /var/www/$hubzilladaily
|
||||||
echo "echo \"\$(date) - updating dehydrated...\"" >> /var/www/$hubzilladaily
|
echo "echo \"\$(date) - updating dehydrated...\"" >> /var/www/$hubzilladaily
|
||||||
|
Reference in New Issue
Block a user