ability to activate/deactivate each extra

This commit is contained in:
nachoparker 2017-03-23 18:45:54 +01:00
parent 770e4b3f67
commit fcda8f8643
5 changed files with 15 additions and 16 deletions

View File

@ -23,23 +23,17 @@ Use QEMU to automatically generate Raspbian Images with Nextcloud
* Fail2Ban protection against brute force attacks. ( NEW 02-24-2017 ) * Fail2Ban protection against brute force attacks. ( NEW 02-24-2017 )
* Dynamic DNS support for no-ip.org ( NEW 03-05-2017 ) * Dynamic DNS support for no-ip.org ( NEW 03-05-2017 )
* dnsmasq DNS server with DNS cache ( NEW 03-09-2017 ) * dnsmasq DNS server with DNS cache ( NEW 03-09-2017 )
* Automatic security updates, activated by default. ( NEW 03-21-2017 )
* ModSecurity Web Application Firewall ( NEW 03-23-2017 )
## Usage ## Usage
``` ```
git clone https://github.com/nachoparker/nextcloud-raspbian-generator.git git clone https://github.com/nachoparker/nextcloud-raspbian-generator.git
cd nextcloud-raspbian-generator cd nextcloud-raspbian-generator
./install-nextcloud.sh 192.168.0.145 # change to your QEMU raspbian IP ./batch.sh 192.168.0.145 # change to your QEMU raspbian IP
``` ```
If we also want extras in our image
```
./installer.sh extrascript.sh 192.168.0.145 NextCloudPi_03-13-17.img # change to your QEMU raspbian IP
```
Adjust for the image name generated in the first step.
Extras can be activated and configured using Extras can be activated and configured using
``` ```

View File

@ -21,7 +21,7 @@ NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh no-ip.sh $IP $( ls -1t
NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh dnsmasq.sh $IP $( ls -1t *.img | head -1 ) NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh dnsmasq.sh $IP $( ls -1t *.img | head -1 )
NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh letsencrypt.sh $IP $( ls -1t *.img | head -1 ) NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh letsencrypt.sh $IP $( ls -1t *.img | head -1 )
NO_CONFIG=1 ./installer.sh unattended-upgrades.sh $IP $( ls -1t *.img | head -1 ) NO_CONFIG=1 ./installer.sh unattended-upgrades.sh $IP $( ls -1t *.img | head -1 )
NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh modsecurity.sh $IP $( ls -1t *.img | head -1 ) NO_CONFIG=1 NO_CFG_STEP=1 ./installer.sh modsecurity.sh $IP $( ls -1t *.img | head -1 )
IMGOUT=$( ls -1t *.img | head -1 ) IMGOUT=$( ls -1t *.img | head -1 )
IMGFULL=$( basename "$IMGFILE" .img )_FULL.img IMGFULL=$( basename "$IMGFILE" .img )_FULL.img

View File

@ -14,6 +14,7 @@
# More at: https://ownyourbits.com/2017/03/09/dnsmasq-as-dns-cache-server-for-nextcloudpi-and-raspbian/ # More at: https://ownyourbits.com/2017/03/09/dnsmasq-as-dns-cache-server-for-nextcloudpi-and-raspbian/
# #
ACTIVE_=yes
DOMAIN_=mycloud.ownyourbits.com DOMAIN_=mycloud.ownyourbits.com
IP_=127.0.0.1 IP_=127.0.0.1
DNSSERVER_=8.8.8.8 DNSSERVER_=8.8.8.8
@ -29,6 +30,8 @@ install()
configure() configure()
{ {
[[ $ACTIVE_ == "no" ]] && { service dnsmasq stop; update-rc.d dnsmasq disable; return; }
cat > /etc/dnsmasq.conf <<EOF cat > /etc/dnsmasq.conf <<EOF
domain-needed # Never forward plain names (without a dot or domain part) domain-needed # Never forward plain names (without a dot or domain part)
bogus-priv # Never forward addresses in the non-routed address spaces. bogus-priv # Never forward addresses in the non-routed address spaces.
@ -39,13 +42,8 @@ server=$DNSSERVER_
address=/$DOMAIN_/$IP_ # This is optional if we add it to /etc/hosts address=/$DOMAIN_/$IP_ # This is optional if we add it to /etc/hosts
EOF EOF
cat >> /etc/hosts <<EOF sed 's|#\?IGNORE_RESOLVCONF=.*|IGNORE_RESOLVCONF=yes|' /etc/default/dnsmasq
$IP_ $DOMAIN_ # This is optional if we add it to dnsmasq.conf, but doesn't harm
EOF
cat >> /etc/default/dnsmasq <<EOF
IGNORE_RESOLVCONF=yes
EOF
update-rc.d dnsmasq defaults update-rc.d dnsmasq defaults
service dnsmasq restart service dnsmasq restart
cd /var/www/nextcloud cd /var/www/nextcloud

View File

@ -14,6 +14,8 @@
# More at: https://ownyourbits.com/2017/02/24/nextcloudpi-fail2ban-installer/ # More at: https://ownyourbits.com/2017/02/24/nextcloudpi-fail2ban-installer/
# #
ACTIVE_=yes
# location of Nextcloud logs # location of Nextcloud logs
NCLOG_=/var/www/nextcloud/data/nextcloud.log NCLOG_=/var/www/nextcloud/data/nextcloud.log
@ -37,6 +39,8 @@ install()
configure() configure()
{ {
[[ $ACTIVE_ == "no" ]] && { service fail2ban stop; update-rc.d fail2ban disable; return; }
touch /var/www/nextcloud/data/nextcloud.log touch /var/www/nextcloud/data/nextcloud.log
chown -R www-data /var/www/nextcloud/data chown -R www-data /var/www/nextcloud/data

View File

@ -15,6 +15,7 @@
# More at https://ownyourbits.com/2017/03/05/dynamic-dns-for-raspbian-with-no-ip-org-installer/ # More at https://ownyourbits.com/2017/03/05/dynamic-dns-for-raspbian-with-no-ip-org-installer/
# #
ACTIVE_=yes
USER_=my-noip-user@email.com USER_=my-noip-user@email.com
PASS_=noip-pass PASS_=noip-pass
TIME_=30 TIME_=30
@ -52,6 +53,8 @@ EOF
configure() configure()
{ {
[[ $ACTIVE_ == "no" ]] && { service noip2 stop; update-rc.d noip2 disable; return; }
/usr/local/bin/noip2 -C -c /usr/local/etc/no-ip2.conf -U $TIME_ -u $USER_ -p $PASS_ /usr/local/bin/noip2 -C -c /usr/local/etc/no-ip2.conf -U $TIME_ -u $USER_ -p $PASS_
update-rc.d noip2 defaults update-rc.d noip2 defaults
service noip2 restart service noip2 restart