Skip to content

Commit

Permalink
Merge pull request #23 from nextcloud/master
Browse files Browse the repository at this point in the history
From VM #2
  • Loading branch information
Daniel Hansson authored Jan 30, 2017
2 parents 60c5abe + 8f083ee commit 824f642
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## Maintainers
* [Daniel Hanson](https://github.com/enoch85) @ [Tech and Me](https://www.techandme.se)
* [Ezra Holm](https://github.com/ezraholm50) @ [Tech and Me](https://www.techandme.se)
* [Ark74](https://github.com/Ark74)
* [Luis Guzman](https://github.com/Ark74) @ [SwITNet](https://switnet.net)
* You? :)

## Image
Expand Down
6 changes: 3 additions & 3 deletions lets-encrypt/activate-ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
NCPATH=/var/www/nextcloud
ADDRESS=$(hostname -I | cut -d ' ' -f 1)
dir_before_letsencrypt=/etc
letsencryptpath=/etc/letsencrypt
letsencryptpath=$dir_before_letsencrypt/letsencrypt
certfiles=$letsencryptpath/live
SCRIPTS=/var/scripts

Expand Down Expand Up @@ -103,11 +103,11 @@ fi
# Install git
git --version 2>&1 >/dev/null
GIT_IS_AVAILABLE=$?
# ...
if [ $GIT_IS_AVAILABLE -eq 1 ]
if [ $GIT_IS_AVAILABLE -eq 0 ]
then
sleep 1
else
apt update -q2
apt install git -y -q
fi

Expand Down
24 changes: 24 additions & 0 deletions nextcloud-startup-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,31 @@ dpkg-reconfigure openssh-server
# Generate new MySQL password
echo
bash $SCRIPTS/change_mysql_pass.sh
if [ $? -eq 0 ]
then
rm $SCRIPTS/change_mysql_pass.sh
echo "[mysqld]" >> /root/.my.cnf
echo "innodb_large_prefix=on" >> /root/.my.cnf
echo "innodb_file_format=barracuda" >> /root/.my.cnf
echo "innodb_file_per_table=1" >> /root/.my.cnf
sleep 3
fi

# Enable UTF8mb4 (4-byte support)
NCDB=nextcloud_db
PW_FILE=/var/mysql_password.txt
echo
echo "Enabling UTF8mb4 support on $NCDB...."
sudo /etc/init.d/mysql restart
RESULT=`mysqlshow --user=root --password=$(cat $PW_FILE) $NCDB| grep -v Wildcard | grep -o $NCDB`
if [ "$RESULT" == "$NCDB" ]; then
mysql -u root -e "ALTER DATABASE $NCDB CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
fi
if [ $? -eq 0 ]
then
sudo -u www-data $NCPATH/occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -u www-data $NCPATH/occ maintenance:repair
fi

# Install phpMyadmin
echo
Expand Down
9 changes: 7 additions & 2 deletions nextcloud_install_production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ apt install -y \
php-smbclient

# Enable SMB client
echo '# This enables php-smbclient' >> /etc/php/7.0/apache2/php.ini
echo 'extension="smbclient.so"' >> /etc/php/7.0/apache2/php.ini
# echo '# This enables php-smbclient' >> /etc/php/7.0/apache2/php.ini
# echo 'extension="smbclient.so"' >> /etc/php/7.0/apache2/php.ini

# Download and validate Nextcloud package
wget -q $NCREPO/$STABLEVERSION.zip -P $HTML
Expand Down Expand Up @@ -671,6 +671,11 @@ then
rm /root/*.sh
fi

# Install virtual kernels
apt install linux-tools-virtual-hwe-16.04-edge linux-cloud-tools-virtual-hwe-16.04-edge -y
apt install linux-image-virtual-hwe-16.04-edge -y
apt install linux-virtual-hwe-16.04-edge -y

# Set secure permissions final (./data/.htaccess has wrong permissions otherwise)
bash $SCRIPTS/setup_secure_permissions_nextcloud.sh

Expand Down
3 changes: 1 addition & 2 deletions static/change_mysql_pass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ then
password='$NEWMYSQLPASS'
LOGIN
chmod 0600 $MYCNF
exit 1
exit 0
else
echo "Changing MySQL root password failed."
echo "Your old password is: $OLDMYSQL"
Expand All @@ -31,4 +31,3 @@ LOGIN
chmod 0600 $MYCNF
exit 1
fi

8 changes: 7 additions & 1 deletion static/collabora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ calc_wt_size() {
# Notification
whiptail --msgbox "Please before you start make sure port 443 is directly forwarded to this machine or open!" "$WT_HEIGHT" "$WT_WIDTH"

# Get the latest packages
apt update -q2

# Check if 443 is open using nmap, if not notify the user
if [ $(dpkg-query -W -f='${Status}' nmap 2>/dev/null | grep -c "ok installed") -eq 1 ]
then
Expand Down Expand Up @@ -84,7 +87,10 @@ else
apt install docker.io -y
fi

if [ $(dpkg-query -W -f='${Status}' git 2>/dev/null | grep -c "ok installed") -eq 1 ]
# Check if Git is installed
git --version 2>&1 >/dev/null
GIT_IS_AVAILABLE=$?
if [ $GIT_IS_AVAILABLE -eq 0 ]
then
sleep 1
else
Expand Down
2 changes: 1 addition & 1 deletion static/ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ iface lo inet loopback
# The primary network interface
iface $IFACE inet static
# If you are expeireing issues with loading web frontend, you should
# If you are experiencing issues with loading web frontend, you should
# enable this by removing the hash infront of 'mtu 1400'.
# Fixes https://github.com/nextcloud/vm/issues/92
# mtu 1400
Expand Down
4 changes: 2 additions & 2 deletions static/setup_secure_permissions_nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ NCDATA='/var/ncdata'

printf "Creating possible missing Directories\n"
mkdir -p $ncpath/data
mkdir -p $ncpath/assets
mkdir -p $ncpath/updater
mkdir -p $NCDATA

printf "chmod Files and Directories\n"
Expand All @@ -20,7 +20,7 @@ chown -R ${htuser}:${htgroup} ${ncpath}/apps/
chown -R ${htuser}:${htgroup} ${ncpath}/config/
chown -R ${htuser}:${htgroup} ${NCDATA}/
chown -R ${htuser}:${htgroup} ${ncpath}/themes/
chown -R ${htuser}:${htgroup} ${ncpath}/assets/
chown -R ${htuser}:${htgroup} ${ncpath}/updater/

chmod +x ${ncpath}/occ

Expand Down

0 comments on commit 824f642

Please sign in to comment.