mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 14:42:01 -03:30
improved virtual hosts (access just by ip or url). disable SSH by default
This commit is contained in:
parent
e3fca42473
commit
9f5a7b6f64
@ -46,13 +46,15 @@ while [[ $NUM_REBOOTS != -1 ]]; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
sleep 90
|
||||
sleep 120
|
||||
echo "Launching installation"
|
||||
cat install-nextcloud.sh | sshpass -praspberry $SSH pi@$IP
|
||||
wait
|
||||
NUM_REBOOTS=$(( NUM_REBOOTS-1 ))
|
||||
done
|
||||
echo "$IMGFILE generated successfully"
|
||||
echo "$IMGFILE generated successfully. Compressing"
|
||||
TARNAME=$( basename $IMGFILE ).tar.bz2
|
||||
test -f $TARNAME || tar -I pbzip2 -cvf $TARNAME $IMGFILE
|
||||
|
||||
# License
|
||||
#
|
||||
|
||||
@ -128,7 +128,6 @@ EOF
|
||||
a2enmod dir
|
||||
a2enmod mime
|
||||
a2enmod ssl
|
||||
a2ensite default-ssl
|
||||
|
||||
# INSTALL NEXTCLOUD
|
||||
##########################################
|
||||
@ -176,23 +175,35 @@ EOF
|
||||
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
|
||||
fi
|
||||
|
||||
cat > /etc/apache2/sites-available/nextcloud.conf <<EOF
|
||||
Alias /nextcloud "/var/www/nextcloud/"
|
||||
|
||||
CustomLog /var/log/nextcloud/access.log combined
|
||||
ErrorLog /var/log/nextcloud/error.log
|
||||
|
||||
<Directory /var/www/nextcloud/>
|
||||
Options +FollowSymlinks
|
||||
AllowOverride All
|
||||
|
||||
<IfModule mod_dav.c>
|
||||
Dav off
|
||||
cat > /etc/apache2/sites-available/000-default.conf <<'EOF'
|
||||
<VirtualHost _default_:80>
|
||||
DocumentRoot /var/www/nextcloud
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTPS} !=on
|
||||
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
|
||||
</IfModule>
|
||||
</VirtualHost>
|
||||
EOF
|
||||
|
||||
SetEnv HOME /var/www/nextcloud
|
||||
SetEnv HTTP_HOME /var/www/nextcloud
|
||||
</Directory>
|
||||
cat > /etc/apache2/sites-available/nextcloud.conf <<'EOF'
|
||||
<IfModule mod_ssl.c>
|
||||
<VirtualHost _default_:443>
|
||||
DocumentRoot /var/www/nextcloud
|
||||
CustomLog /var/log/nextcloud/access.log combined
|
||||
ErrorLog /var/log/nextcloud/error.log
|
||||
SSLEngine on
|
||||
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
|
||||
</VirtualHost>
|
||||
<Directory /var/www/nextcloud/>
|
||||
Options +FollowSymlinks
|
||||
AllowOverride All
|
||||
<IfModule mod_dav.c>
|
||||
Dav off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
</IfModule>
|
||||
EOF
|
||||
a2ensite nextcloud
|
||||
|
||||
@ -220,14 +231,6 @@ EOF
|
||||
sed -i "s/post_max_size=.*/post_max_size=$MAX_FILESIZE/" /var/www/nextcloud/.htaccess
|
||||
sed -i "s/post_max_size=.*/upload_max_filesize=$MAX_FILESIZE/" /var/www/nextcloud/.htaccess
|
||||
|
||||
cat >> /var/www/nextcloud/.htaccess <<EOF
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTPS} !=on
|
||||
RewriteRule ^/?(.*) https://%{SERVER_NAME}/nextcloud/$1 [R,L]
|
||||
</IfModule>
|
||||
EOF
|
||||
|
||||
echo "*/15 * * * * php -f /var/www/nextcloud/cron.php" > /tmp/crontab_http
|
||||
crontab -u www-data /tmp/crontab_http
|
||||
rm /tmp/crontab_http
|
||||
@ -262,6 +265,7 @@ EOF
|
||||
apt-get clean
|
||||
rm /var/lib/apt/lists/* -r
|
||||
|
||||
systemctl disable ssh
|
||||
rm $STATE_FILE
|
||||
halt
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user