From 272ffe6983b19cd000e775f443f9e77406a657a9 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sat, 20 Feb 2016 14:04:11 -0500 Subject: Renamed homeinstall config file and added check for required config parameters. Spelling corrections. --- .homeinstall/hubzilla-config.txt | 175 ----------------------------- .homeinstall/hubzilla-config.txt.template | 177 ++++++++++++++++++++++++++++++ .homeinstall/hubzilla-setup.sh | 16 ++- 3 files changed, 190 insertions(+), 178 deletions(-) delete mode 100644 .homeinstall/hubzilla-config.txt create mode 100644 .homeinstall/hubzilla-config.txt.template (limited to '.homeinstall') diff --git a/.homeinstall/hubzilla-config.txt b/.homeinstall/hubzilla-config.txt deleted file mode 100644 index 23d188945..000000000 --- a/.homeinstall/hubzilla-config.txt +++ /dev/null @@ -1,175 +0,0 @@ -############################################### -### MANDATORY - database password ############# -# -# Please give your database password -# Example: db_pass=pass_word_with_no_blanks_in_it -# Example: db_pass="this password has blanks in it" -db_pass= - -############################################### -### MANDATORY - let's encrypt ################# -# -# Hubilla does not allow ecrypted communication, httpS. -# -# Please give the domain name of your hub -# -# Example: my.cooldomain.org -# Example: cooldomain.org -# -# Email is optional -# -# -le_domain= -le_email= - -############################################### -### OPTIONAL - selfHOST - dynamic IP address ## -# -# 1. Register a domain at selfhost.de -# - choose offer "DOMAIN dynamisch" 1,50€/mon at 08.01.2016 -# 2. Get your configuration for dynamic IP update -# - Log in at selfhost.de -# - go to "DynDNS Accounte" -# - klick "Details" of your (freshly) registered domain -# - You will find the configuration there -# - Benutzername (user name) > use this for "selfhost_user=" -# - Passwort (pass word) > use this for "selfhost_pass=" -# -# -selfhost_user= -selfhost_pass= - -############################################### -### OPTIONAL - FreeDNS - dynamic IP address ### -# -# Please give the alpha-numeric-key of freedns -# -# Get a free subdomain from freedns and use it for your dynamic ip address -# Documentation under http://www.techjawab.com/2013/06/setup-dynamic-dns-dyndns-for-free-on.html -# -# - Register for a Free domain at http://freedns.afraid.org/signup/ -# - WATCH THIS: Make sure you choose a domain with as less subdomains as -# possible. Why? Let's encrpyt issues a limited count of certificates each -# day. Possible other users of this domain will try to issue a certificate -# at the same day. -# - Logon to FreeDNS (where you just registered) -# - Goto http://freedns.afraid.org/dynamic/ -# - Right click on "Direct Link" and copy the URL and paste it somewhere. -# - You should notice a large and unique alpha-numeric key in the URL -# -# http://freedns.afraid.org/dynamic/update.php?alpha-numeric-key -# -# Provided your url from freedns is -# -# http://freedns.afraid.org/dynamic/update.php?U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5 -# -# Then you have to provide -# -# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5 -# -# -#freedns_key= - - -############################################### -### OPTIONAL - Backup to external device ###### -# -# The script can use an external device for the daily backup. -# The file system of the device (USB stick for example) must be compatible -# with encrypted LUKS + ext4 -# -# You should test to mount the device befor you run the script -# (hubzilla-setup.sh). -# How to find your (pluged-in) devices? -# -# fdisk -l -# -# Provided your device was listed as is /dev/sdb1. You could check with: -# -# blkid | grep /dev/sdb1 -# -# Try to decrypt -# (You might install cryptsetup befor using apt-get install. -# -# apt-get install cryptsetup -# cryptsetup luksOpen /dev/sdb1 cryptobackup -# -# Try to mount -# You might create the directory /media/hubzilla_backup it it does not exist -# using mkdir. -# -# mkdir /media/hubzilla_backup -# mount /dev/mapper/cryptobackup /media/hubzilla_backup -# -# Unmounting device goes like this -# -# umount /media/hubzilla_backup -# cryptsetup luksClose cryptobackup -# -# To check if still mounted -# -# lsof /media/hubzilla_backup -# -# If you leave the following parameters -# - "backup_device_name" and -# - "backup_device_pass" -# empty the script will create daily backups on the internal disk (which could -# save you as well). -# -# Example: backup_device_name=/dev/sdc1 -# -backup_device_name= -backup_device_pass= - - -############################################### -### OPTIONAL - Owncloud - deprecated ########## -# -# To install owncloud: owncloud=y -# Leave empty if you don't want to install owncloud -# -#owncloud= - - - -############################################### -### OPTIONAL - do not mess with things below ## -# (...if you are not certain) -# -# Usally you are done here -# All what comes below is OPTIONAL -# -############################################### -# -# Database for huzilla -hubzilla_db_name=hubzilla -hubzilla_db_user=hubzilla -hubzilla_db_pass=$db_pass -# -# -# Password for package mysql-server -# Example: mysqlpass=aberhallo -# Example: mysqlpass="aber hallo has blanks in it" -# -mysqlpass=$db_pass - -# Password for package phpmyadmin -# Example: phpmyadminpass=aberhallo -# Example: phpmyadminpass="aber hallo has blanks in it" -phpmyadminpass=$db_pass - -# TODO Prepare hubzilla for programmers -# - install eclipse and plugins -# - install xdebug to debug the php with eclipse -# - weaken permissions on /var/www/html -# - manual steps after this script -# * in eclipse: install plugins for php git hub -# * in eclipse: configure firefox (chrome,...) as browser to run with the php debuger -# * in eclipse: switch php debugger from zend to xdebug -# * in eclipse: add local hubzilla github repository -# -# Wich user will use eclipse? -# Leave this empty if you do not want to prepare hubzilla for debugging -# -#developer_name= - diff --git a/.homeinstall/hubzilla-config.txt.template b/.homeinstall/hubzilla-config.txt.template new file mode 100644 index 000000000..040b0f2f4 --- /dev/null +++ b/.homeinstall/hubzilla-config.txt.template @@ -0,0 +1,177 @@ +############################################### +### MANDATORY - database password ############# +# +# Please give your database password +# Example: db_pass=pass_word_with_no_blanks_in_it +# Example: db_pass="this password has blanks in it" +db_pass= + +############################################### +### MANDATORY - let's encrypt ################# +# +# Hubilla requires encrypted communication via secure HTTP (HTTPS). +# This script automates installation of an SSL certificate from +# Let's Encrypt (https://letsencrypt.org) +# +# Please give the domain name of your hub +# +# Example: my.cooldomain.org +# Example: cooldomain.org +# +# Email is optional +# +# +le_domain= +le_email= + +############################################### +### OPTIONAL - selfHOST - dynamic IP address ## +# +# 1. Register a domain at selfhost.de +# - choose offer "DOMAIN dynamisch" 1,50€/mon at 08.01.2016 +# 2. Get your configuration for dynamic IP update +# - Log in at selfhost.de +# - go to "DynDNS Accounte" +# - klick "Details" of your (freshly) registered domain +# - You will find the configuration there +# - Benutzername (user name) > use this for "selfhost_user=" +# - Passwort (pass word) > use this for "selfhost_pass=" +# +# +selfhost_user= +selfhost_pass= + +############################################### +### OPTIONAL - FreeDNS - dynamic IP address ### +# +# Please give the alpha-numeric-key of freedns +# +# Get a free subdomain from freedns and use it for your dynamic ip address +# Documentation under http://www.techjawab.com/2013/06/setup-dynamic-dns-dyndns-for-free-on.html +# +# - Register for a Free domain at http://freedns.afraid.org/signup/ +# - WATCH THIS: Make sure you choose a domain with as less subdomains as +# possible. Why? Let's encrpyt issues a limited count of certificates each +# day. Possible other users of this domain will try to issue a certificate +# at the same day. +# - Logon to FreeDNS (where you just registered) +# - Goto http://freedns.afraid.org/dynamic/ +# - Right click on "Direct Link" and copy the URL and paste it somewhere. +# - You should notice a large and unique alpha-numeric key in the URL +# +# http://freedns.afraid.org/dynamic/update.php?alpha-numeric-key +# +# Provided your url from freedns is +# +# http://freedns.afraid.org/dynamic/update.php?U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5 +# +# Then you have to provide +# +# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5 +# +# +#freedns_key= + + +############################################### +### OPTIONAL - Backup to external device ###### +# +# The script can use an external device for the daily backup. +# The file system of the device (USB stick for example) must be compatible +# with encrypted LUKS + ext4 +# +# You should test to mount the device befor you run the script +# (hubzilla-setup.sh). +# How to find your (pluged-in) devices? +# +# fdisk -l +# +# Provided your device was listed as is /dev/sdb1. You could check with: +# +# blkid | grep /dev/sdb1 +# +# Try to decrypt +# (You might install cryptsetup befor using apt-get install. +# +# apt-get install cryptsetup +# cryptsetup luksOpen /dev/sdb1 cryptobackup +# +# Try to mount +# You might create the directory /media/hubzilla_backup it it does not exist +# using mkdir. +# +# mkdir /media/hubzilla_backup +# mount /dev/mapper/cryptobackup /media/hubzilla_backup +# +# Unmounting device goes like this +# +# umount /media/hubzilla_backup +# cryptsetup luksClose cryptobackup +# +# To check if still mounted +# +# lsof /media/hubzilla_backup +# +# If you leave the following parameters +# - "backup_device_name" and +# - "backup_device_pass" +# empty the script will create daily backups on the internal disk (which could +# save you as well). +# +# Example: backup_device_name=/dev/sdc1 +# +backup_device_name= +backup_device_pass= + + +############################################### +### OPTIONAL - Owncloud - deprecated ########## +# +# To install owncloud: owncloud=y +# Leave empty if you don't want to install owncloud +# +#owncloud= + + + +############################################### +### OPTIONAL - do not mess with things below ## +# (...if you are not certain) +# +# Usually you are done here +# Everything below is OPTIONAL +# +############################################### +# +# Database for hubzilla +hubzilla_db_name=hubzilla +hubzilla_db_user=hubzilla +hubzilla_db_pass=$db_pass +# +# +# Password for package mysql-server +# Example: mysqlpass=aberhallo +# Example: mysqlpass="aber hallo has blanks in it" +# +mysqlpass=$db_pass + +# Password for package phpmyadmin +# Example: phpmyadminpass=aberhallo +# Example: phpmyadminpass="aber hallo has blanks in it" +phpmyadminpass=$db_pass + +# TODO Prepare hubzilla for programmers +# - install eclipse and plugins +# - install xdebug to debug the php with eclipse +# - weaken permissions on /var/www/html +# - manual steps after this script +# * in eclipse: install plugins for php git hub +# * in eclipse: configure firefox (chrome,...) as browser to run with the php debuger +# * in eclipse: switch php debugger from zend to xdebug +# * in eclipse: add local hubzilla github repository +# +# Which user will use eclipse? +# Leave this empty if you do not want to prepare hubzilla for debugging +# +#developer_name= + diff --git a/.homeinstall/hubzilla-setup.sh b/.homeinstall/hubzilla-setup.sh index caa46950c..670844b83 100755 --- a/.homeinstall/hubzilla-setup.sh +++ b/.homeinstall/hubzilla-setup.sh @@ -5,7 +5,7 @@ # # This file automates the installation of hubzilla under Debian Linux # -# 1) Edit the file "hubzilla-config.txt" +# 1) Copy the file "hubzilla-config.txt.template" to "hubzilla-config.txt" # Follow the instuctions there # # 2) Switch to user "root" by typing "su -" @@ -92,12 +92,12 @@ # Credits # ------- # -# The srcipt is based on Thomas Willinghams script "debian-setup.sh" +# The script is based on Thomas Willinghams script "debian-setup.sh" # which he used to install the red#matrix. # # The script uses another script from https://github.com/lukas2511/letsencrypt.sh # -# The documentation of bash is here +# The documentation for bash is here # https://www.gnu.org/software/bash/manual/bash.html # function check_sanity { @@ -120,6 +120,15 @@ function check_sanity { function check_config { print_info "config check..." + # Check for required parameters + if [ -z "$db_pass" ] + then + die "db_pass not set in $configfile" + fi + if [ -z "$le_domain" ] + then + die "le_domain not set in $configfile" + fi # backup is important and should be checked if [ -n "$backup_device_name" ] then @@ -814,6 +823,7 @@ check_sanity # Read config file edited by user configfile=hubzilla-config.txt source $configfile + selfhostdir=/etc/selfhost selfhostscript=selfhost-updater.sh hubzilladaily=hubzilla-daily.sh -- cgit v1.2.3