Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDaniel Hansson <github@techandme.se>2018-02-06 19:09:44 +0300
committerGitHub <noreply@github.com>2018-02-06 19:09:44 +0300
commit1eb49e670544334c3b39dc045b3eb023f4042c7f (patch)
treeff50f2dc9c00ce2ecc97286b7f2344265fad536e /apps
parent21fbd5087d526dfedfa289a6d5cc90e9cb4d64b7 (diff)
updates for NC13 (#439)
Diffstat (limited to 'apps')
-rw-r--r--apps/calendar.sh32
-rw-r--r--apps/collabora.sh15
-rw-r--r--apps/contacts.sh32
-rw-r--r--apps/fulltextsearch-files/readonlyrest-1.16.15_es6.1.1.zipbin0 -> 13932995 bytes
-rw-r--r--apps/fulltextsearch-files/readonlyrest-1.16.15_es6.1.1.zip.sha11
-rw-r--r--apps/fulltextsearch.sh140
-rw-r--r--apps/netdata.sh68
-rw-r--r--apps/onlyoffice.sh12
-rw-r--r--apps/passman.sh67
-rw-r--r--apps/previewgenerator.sh36
-rw-r--r--apps/spreedme.sh25
11 files changed, 230 insertions, 198 deletions
diff --git a/apps/calendar.sh b/apps/calendar.sh
deleted file mode 100644
index e8da416d..00000000
--- a/apps/calendar.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# Tech and Me © - 2018, https://www.techandme.se/
-
-# shellcheck disable=2034,2059
-true
-# shellcheck source=lib.sh
-CALENDAR_INSTALL=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
-unset CALENDAR_INSTALL
-
-# Check for errors + debug code and abort if something isn't right
-# 1 = ON
-# 0 = OFF
-DEBUG=0
-debug_mode
-
-# Download and install Calendar
-if [ ! -d "$NCPATH"/apps/calendar ]
-then
- echo "Installing calendar..."
- wget -q "$CALVER_REPO/v$CALVER/$CALVER_FILE" -P "$NCPATH/apps"
- tar -zxf "$NCPATH/apps/$CALVER_FILE" -C "$NCPATH/apps"
- cd "$NCPATH/apps"
- rm "$CALVER_FILE"
-fi
-
-# Enable Calendar
-if [ -d "$NCPATH"/apps/calendar ]
-then
- sudo -u www-data php "$NCPATH"/occ app:enable calendar
- chown -R www-data:www-data $NCPATH/apps
-fi
diff --git a/apps/collabora.sh b/apps/collabora.sh
index eb11e1fb..a3486338 100644
--- a/apps/collabora.sh
+++ b/apps/collabora.sh
@@ -129,7 +129,7 @@ fi
# Disable RichDocuments (Collabora App) if activated
if [ -d "$NCPATH"/apps/richdocuments ]
then
- sudo -u www-data php "$NCPATH"/occ app:disable richdocuments
+ occ_command "app:disable richdocuments"
rm -r "$NCPATH"/apps/richdocuments
fi
@@ -229,10 +229,7 @@ then
a2ensite "$SUBDOMAIN.conf"
service apache2 restart
# Install Collabora App
- check_command wget -q "$COLLVER_REPO/$COLLVER/$COLLVER_FILE" -P "$NCPATH/apps"
- check_command tar -zxf "$NCPATH/apps/$COLLVER_FILE" -C "$NCPATH/apps"
- cd "$NCPATH/apps" || exit 1
- rm "$COLLVER_FILE"
+ occ_command "app:install richdocuments"
else
printf "${ICyan}\nIt seems like no certs were generated, please report this issue here: $ISSUES\n"
any_key "Press any key to continue... "
@@ -240,13 +237,13 @@ else
fi
# Enable RichDocuments (Collabora App)
-if [ -d "$NCPATH"/apps/richdocuments ]
+if [ -d "$NC_APPS_PATH"/richdocuments ]
then
# Enable Collabora
- check_command sudo -u www-data php "$NCPATH"/occ app:enable richdocuments
- check_command sudo -u www-data "$NCPATH"/occ config:app:set richdocuments wopi_url --value="https://$SUBDOMAIN"
+ occ_command "app:enable richdocuments"
+ occ_command "config:app:set richdocuments wopi_url --value=https://$SUBDOMAIN"
chown -R www-data:www-data $NCPATH/apps
- check_command sudo -u www-data php "$NCPATH"/occ config:system:set trusted_domains 3 --value="$SUBDOMAIN"
+ occ_command "config:system:set trusted_domains 3 --value=$SUBDOMAIN"
# Add prune command
{
echo "#!/bin/bash"
diff --git a/apps/contacts.sh b/apps/contacts.sh
deleted file mode 100644
index f0f5159c..00000000
--- a/apps/contacts.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# Tech and Me © - 2018, https://www.techandme.se/
-
-# shellcheck disable=2034,2059
-true
-# shellcheck source=lib.sh
-CONTACTS_INSTALL=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
-unset CONTACTS_INSTALL
-
-# Check for errors + debug code and abort if something isn't right
-# 1 = ON
-# 0 = OFF
-DEBUG=0
-debug_mode
-
-# Download and install Contacts
-if [ ! -d "$NCPATH/apps/contacts" ]
-then
- echo "Installing contacts..."
- wget -q "$CONVER_REPO/v$CONVER/$CONVER_FILE" -P "$NCPATH/apps"
- tar -zxf "$NCPATH/apps/$CONVER_FILE" -C "$NCPATH/apps"
- cd "$NCPATH/apps"
- rm "$CONVER_FILE"
-fi
-
-# Enable Contacts
-if [ -d "$NCPATH"/apps/contacts ]
-then
- sudo -u www-data php "$NCPATH"/occ app:enable contacts
- chown -R www-data:www-data $NCPATH/apps
-fi
diff --git a/apps/fulltextsearch-files/readonlyrest-1.16.15_es6.1.1.zip b/apps/fulltextsearch-files/readonlyrest-1.16.15_es6.1.1.zip
new file mode 100644
index 00000000..d7f1f716
--- /dev/null
+++ b/apps/fulltextsearch-files/readonlyrest-1.16.15_es6.1.1.zip
Binary files differ
diff --git a/apps/fulltextsearch-files/readonlyrest-1.16.15_es6.1.1.zip.sha1 b/apps/fulltextsearch-files/readonlyrest-1.16.15_es6.1.1.zip.sha1
new file mode 100644
index 00000000..58ad6e4f
--- /dev/null
+++ b/apps/fulltextsearch-files/readonlyrest-1.16.15_es6.1.1.zip.sha1
@@ -0,0 +1 @@
+9d3dfe321788dfaa90fbf28a7c41f92486da22a9
diff --git a/apps/fulltextsearch.sh b/apps/fulltextsearch.sh
new file mode 100644
index 00000000..396ee53c
--- /dev/null
+++ b/apps/fulltextsearch.sh
@@ -0,0 +1,140 @@
+#!/bin/bash
+
+# Tech and Me © - 2018, https://www.techandme.se/
+
+######################## Change to MASTER before merge ###########################
+############################# Developed for NC 13 ################################
+
+# shellcheck disable=2034,2059
+true
+# shellcheck source=lib.sh
+ES_INSTALL=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/nc13-appinstall/lib.sh)
+unset ES_INSTALL
+
+ES_VERSION=6.1.1
+ES_DEB_VERSION="$(echo $ES_VERSION | head -c 1)"
+
+######### FOR TESTING ########
+GITHUB_REPO=https://raw.githubusercontent.com/nextcloud/vm/full-text-search
+APP=$GITHUB_REPO/apps
+##############################
+
+# Check for errors + debug code and abort if something isn't right
+# 1 = ON
+# 0 = OFF
+DEBUG=0
+debug_mode
+
+# Must be root
+if ! is_root
+then
+ msg_box "Must be root to run script, in Ubuntu type: sudo -i"
+ exit 1
+fi
+
+# Make sure there is an Nextcloud installation
+if ! [ "$(sudo -u www-data php $NCPATH/occ -V)" ]
+then
+ msg_box "It seems there is no Nextcloud server installed, please check your installation."
+ exit 1
+fi
+
+# Check if it's a clean install
+if [ -d /usr/share/elasticsearch ]
+then
+msg_box "It seems like /usr/share/elasticsearch already exists. Have you already run this script?
+If yes, revert all the settings and try again, it must be a clean install."
+ exit 1
+fi
+
+echo "Starting to setup Elastic Search & Full Text Search on Nextcloud..."
+apt update -q4 & spinner_loading
+
+# Disable and remove Nextant + Solr
+if [ -d "$NC_APPS_PATH"/nextant ]
+then
+ # Remove Nextant
+ msg_box "We will now remove Nextant + Solr and replace it with Full Text Search"
+ occ_command app:disbale nextant
+ rm -rf $NC_APPS_PATH/nextant
+
+ # Remove Solr
+ service solr stop
+ rm -rf /var/solr
+ rm -rf /opt/solr*
+ rm /etc/init.d/solr
+ deluser --remove-home solr
+ deluser --group solr
+fi
+
+# Installing requirements
+echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
+echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
+check_command apt install openjdk-8-jre -y
+check_command apt install apt-transport-https -y
+
+# Install Elastic
+check_command wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
+check_command echo "deb https://artifacts.elastic.co/packages/$ES_DEB_VERSION.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-"$ES_DEB_VERSION".x.list
+apt update -q4 & spinner_loading
+apt install elasticsearch=$ES_VERSION -y
+check_command /etc/init.d/elasticsearch start
+
+# Enable on bootup
+sudo systemctl enable elasticsearch.service
+
+# Install ingest-attachment plugin
+if [ -d /usr/share/elasticsearch ]
+then
+ cd /usr/share/elasticsearch/bin
+ check_command ./elasticsearch-plugin install ingest-attachment
+fi
+
+# Check that ingest-attachment is properly installed
+if ! [ "$(curl -s http://127.0.0.1:9300)" ]
+then
+msg_box "Installation failed!
+Please report this to $ISSUES"
+ exit 1
+fi
+
+# Install ReadOnlyREST
+# TODO Check with SHA
+if [ -d /usr/share/elasticsearch ]
+then
+ cd /usr/share/elasticsearch/bin
+ check_command ./elasticsearch-plugin install "$APP"/fulltextsearch-files/readonlyrest-1.16.15_es"$ES_VERSION".zip
+fi
+
+# Check that ReadOnlyREST is properly installed
+if ! [ "$(curl -s http://127.0.0.1:9300)" ]
+then
+msg_box "Installation failed!
+Please report this to $ISSUES"
+ exit 1
+fi
+
+# Create configuration YML
+# TODO: add password, user etc
+cat << YML_CREATE > /etc/elasticsearch/readonlyrest.yml
+readonlyrest:
+ access_control_rules:
+
+ - name: "Block 1 - Allowing anything from localhost"
+ hosts: [127.0.0.1]
+YML_CREATE
+
+# Restart Elastic Search
+check_command /etc/init.d/elasticsearch restart
+
+# Get Full Text Search app for nextcloud
+install_and_enable_app fulltextsearch
+install_and_enable_app fulltextsearch_elasticsearch
+install_and_enable_app files_fulltextsearch
+chown -R www-data:www-data $NC_APPS_PATH
+
+# Final setup
+# Add password and user values to FTS GUI TODO
+occ_command "config:app:set --value '1' fullnextsearch app_navigation"
+check_command occ_command "fulltextsearch:index"
+
diff --git a/apps/netdata.sh b/apps/netdata.sh
new file mode 100644
index 00000000..cd2bb4e0
--- /dev/null
+++ b/apps/netdata.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+# Tech and Me © - 2017, https://www.techandme.se/
+
+# shellcheck disable=2034,2059
+true
+# shellcheck source=lib.sh
+. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
+
+# Check for errors + debug code and abort if something isn't right
+# 1 = ON
+# 0 = OFF
+DEBUG=0
+debug_mode
+
+# Download and install Netdata
+if [ -d /etc/netdata ]
+then
+msg_box "Netdata seems to be installed.
+We will now remove Netdata and reinstall it with the latest master."
+ # Uninstall
+ echo yes | bash /usr/src/netdata.git/netdata-uninstaller.sh --force
+ userdel netdata
+ groupdel netdata
+ gpasswd -d netdata adm
+ gpasswd -d netdata proxy
+ # Install
+ is_process_running dpkg
+ is_process_running apt
+ apt update -q4 & spinner_loading
+ sudo -u "$UNIXUSER" "$(bash <(curl -Ss https://my-netdata.io/kickstart.sh) all --dont-wait)"
+else
+ # Install
+ is_process_running dpkg
+ is_process_running apt
+ apt update -q4 & spinner_loading
+ sudo -u "$UNIXUSER" "$(bash <(curl -Ss https://my-netdata.io/kickstart.sh) all --dont-wait)"
+fi
+
+# Check Netdata instructions after script is done
+any_key "Please check information above and press any key to continue..."
+
+# Installation done?
+if [ -d /etc/netdata ]
+then
+msg_box "Netdata is now installed and can be accessed from this address:
+
+http://$ADDRESS:19999
+
+If you want to reach it from the internet you need to open port 19999 in your firewall.
+If you don't know how to open ports, please follow this guide:
+https://www.techandme.se/open-port-80-443/
+
+After you have opened the correct port, then you can visit Netdata from your domain:
+
+http://$(hostname -f):19999 and or http://yourdomanin.com:19999
+
+You can find more configuration options in their WIKI:
+https://github.com/firehol/netdata/wiki/Configuration"
+
+# Cleanup
+rm -rf /tmp/netdata*
+fi
+clear
+
+exit
+
+
diff --git a/apps/onlyoffice.sh b/apps/onlyoffice.sh
index aaa80e80..de92fa4f 100644
--- a/apps/onlyoffice.sh
+++ b/apps/onlyoffice.sh
@@ -129,7 +129,7 @@ fi
# Disable Onlyoffice if activated
if [ -d "$NCPATH"/apps/onlyoffice ]
then
- sudo -u www-data php "$NCPATH"/occ app:disable onlyoffice
+ occ_command "app:disable onlyoffice"
rm -r "$NCPATH"/apps/onlyoffice
fi
@@ -218,7 +218,7 @@ then
a2ensite "$SUBDOMAIN.conf"
service apache2 restart
# Install Onlyoffice App
- cd $NCPATH/apps
+ cd "$NC_APPS_PATH"
check_command git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice
else
printf "${ICyan}\nIt seems like no certs were generated, please report this issue here: $ISSUES\n"
@@ -227,13 +227,13 @@ else
fi
# Enable Onlyoffice
-if [ -d "$NCPATH"/apps/onlyoffice ]
+if [ -d "$NC_APPS_PATH"/onlyoffice ]
then
# Enable OnlyOffice
- check_command sudo -u www-data php "$NCPATH"/occ app:enable onlyoffice
- check_command sudo -u www-data php "$NCPATH"/occ config:app:set onlyoffice DocumentServerUrl --value="https://$SUBDOMAIN/"
+ occ_command "app:enable onlyoffice"
+ occ_command "config:app:set onlyoffice DocumentServerUrl --value=https://$SUBDOMAIN/"
chown -R www-data:www-data $NCPATH/apps
- check_command sudo -u www-data php "$NCPATH"/occ config:system:set trusted_domains 3 --value="$SUBDOMAIN"
+ occ_command "config:system:set trusted_domains 3 --value=$SUBDOMAIN"
# Add prune command
{
echo "#!/bin/bash"
diff --git a/apps/passman.sh b/apps/passman.sh
deleted file mode 100644
index aacfe0da..00000000
--- a/apps/passman.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-# shellcheck disable=2034,2059
-true
-# shellcheck source=lib.sh
-PASSMAN_INSTALL=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
-unset PASSMAN_INSTALL
-
-# Tech and Me © - 2018, https://www.techandme.se/
-
-# Check for errors + debug code and abort if something isn't right
-# 1 = ON
-# 0 = OFF
-DEBUG=0
-debug_mode
-
-# Check if root
-if ! is_root
-then
- printf "\n${Red}Sorry, you are not root.\n${Color_Off}You must type: ${Cyan}sudo ${Color_Off}bash $SCRIPTS/passman.sh\n"
- exit 1
-fi
-
-# Check if file is downloadable
-echo "Checking latest released version on the Passman download server and if it's possible to download..."
-if wget -q -T 10 -t 2 "$PASSVER_REPO/$PASSVER_FILE" -O /dev/null
-then
- echo "Latest version is: $PASSVER"
-else
- echo "Failed! Download is not available at the moment, try again later."
- echo "Please report this issue here: $ISSUES"
- any_key "Press any key to continue..."
- exit 1
-fi
-
-# Test checksum
-mkdir -p $SHA256
-wget -q "$PASSVER_REPO/$PASSVER_FILE" -P "$SHA256"
-wget -q "$PASSVER_REPO/$PASSVER_FILE.sha256" -P "$SHA256"
-echo "Verifying integrity of $PASSVER_FILE..."
-cd "$SHA256" || exit 1
-CHECKSUM_STATE=$(echo -n "$(sha256sum -c "$PASSVER_FILE.sha256")" | tail -c 2)
-if [ "$CHECKSUM_STATE" != "OK" ]
-then
- echo "Warning! Checksum does not match!"
- rm $SHA256 -R
- exit 1
-else
- echo "SUCCESS! Checksum is OK!"
- rm $SHA256 -R
-fi
-
-# Download and install Passman
-if [ ! -d $NCPATH/apps/passman ]
-then
- wget -q "$PASSVER_REPO/$PASSVER_FILE" -P "$NCPATH/apps"
- tar -zxf "$NCPATH/apps/$PASSVER_FILE" -C "$NCPATH/apps"
- cd "$NCPATH/apps" || exit 1
- rm "$PASSVER_FILE"
-fi
-
-# Enable Passman
-if [ -d $NCPATH/apps/passman ]
-then
- check_command sudo -u www-data php $NCPATH/occ app:enable passman
- chown -R www-data:www-data $NCPATH/apps
- sleep 2
-fi
diff --git a/apps/previewgenerator.sh b/apps/previewgenerator.sh
deleted file mode 100644
index 08ba45cb..00000000
--- a/apps/previewgenerator.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-# Tech and Me © - 2018, https://www.techandme.se/
-
-# shellcheck disable=2034,2059
-true
-# shellcheck source=lib.sh
-PREVIEW_INSTALL=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
-unset PREVIEW_INSTALL
-
-# Check for errors + debug code and abort if something isn't right
-# 1 = ON
-# 0 = OFF
-DEBUG=0
-debug_mode
-
-# Download and install Preview Generator
-if [ ! -d "$NCPATH"/apps/previewgenerator ]
-then
- echo "Installing Preview Generator..."
- wget -q "$PREVER_REPO/v$PREVER/$PREVER_FILE" -P "$NCPATH/apps"
- tar -zxf "$NCPATH/apps/$PREVER_FILE" -C "$NCPATH/apps"
- cd "$NCPATH/apps"
- rm "$PREVER_FILE"
-fi
-
-# Enable Preview Generator
-if [ -d "$NCPATH"/apps/previewgenerator ]
-then
- sudo -u www-data php "$NCPATH"/occ app:enable previewgenerator
- chown -R www-data:www-data $NCPATH/apps
- crontab -u www-data -l | { cat; echo "@daily php -f $NCPATH/occ preview:pre-generate >> /var/log/previewgenerator.log"; } | crontab -u www-data -
- sudo -u www-data php "$NCPATH"/occ preview:generate-all
- touch /var/log/previewgenerator.log
- chown www-data:www-data /var/log/previewgenerator.log
-fi
diff --git a/apps/spreedme.sh b/apps/spreedme.sh
index de6dac9e..36ba7d17 100644
--- a/apps/spreedme.sh
+++ b/apps/spreedme.sh
@@ -27,8 +27,9 @@ then
exit
fi
-# Check if apache is installed
+# Install if missing
install_if_not apache2
+install_if_not snapd
# Install Nextcloud Spreedme Snap
if [ -d "$SNAPDIR" ]
@@ -42,27 +43,19 @@ else
fi
# Install and activate the SpreedMe app
-if [ -d "$NCPATH/apps/spreedme" ]
+if [ -d "$NC_APPS_PATH/spreedme" ]
then
# Remove
- sudo -u www-data php "$NCPATH/occ" app:disable spreedme
+ occ_command 'app:disable spreedme'
echo "SpreedMe app already seems to be installed and will now be re-installed..."
- rm -R "$NCPATH/apps/spreedme"
+ rm -R "NC_APPS_PATH/spreedme"
# Reinstall
- wget -q "$SPREEDME_REPO/$SPREEDME_FILE" -P "$NCPATH/apps"
- tar -zxf "$NCPATH/apps/$SPREEDME_FILE" -C "$NCPATH/apps"
- cd "$NCPATH/apps"
- rm "$SPREEDME_FILE"
- mv "nextcloud-spreedme-$SPREEDME_VER" spreedme
+ occ_command 'app:install spreedme'
else
- wget -q "$SPREEDME_REPO/$SPREEDME_FILE" -P "$NCPATH/apps"
- tar -zxf "$NCPATH/apps/$SPREEDME_FILE" -C "$NCPATH/apps"
- cd "$NCPATH/apps"
- rm "$SPREEDME_FILE"
- mv "nextcloud-spreedme-$SPREEDME_VER" spreedme
+ occ_command 'app:install spreedme'
fi
-check_command sudo -u www-data php "$NCPATH/occ" app:enable spreedme
-chown -R www-data:www-data $NCPATH/apps
+occ_command 'app:enable spreedme'
+chown -R www-data:www-data $NC_APPS_PATH
# Generate secret keys
SHAREDSECRET=$(openssl rand -hex 32)