mirror of
https://github.com/EV21/uberspace-helper.git
synced 2026-10-07 20:33:18 +02:00
Compare commits
3
Commits
f693a1517f
...
3e1292fb7a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e1292fb7a
|
||
|
|
95096f1507
|
||
|
|
459c736e9a
|
No files matched your search
+26
-4
@@ -1,12 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
APP_NAME=Nextcloud
|
||||
PHP_VERSION=8.2
|
||||
|
||||
PGP_KEY_FINGERPRINT='28806A878AE423A28372792ED75899B9A724937A'
|
||||
|
||||
function install_nextcloud
|
||||
{
|
||||
echo "Please set your Nextcloud login credentials."
|
||||
read -r -p "Nextcloud admin user: " NEXTCLOUD_ADMIN_USER
|
||||
read -r -p "Nextcloud admin password: " NEXTCLOUD_ADMIN_PASS
|
||||
ask_for_password
|
||||
trusted_domain="$USER.uber.space"
|
||||
setup_php
|
||||
# simply get the first password string from ~/.my.cnf
|
||||
@@ -28,7 +31,6 @@ function install_nextcloud
|
||||
curl --silent --remote-name https://download.nextcloud.com/server/releases/"$signature_file"
|
||||
curl --silent --remote-name https://nextcloud.com/nextcloud.asc
|
||||
gpg --import nextcloud.asc
|
||||
PGP_KEY_FINGERPRINT='28806A878AE423A28372792ED75899B9A724937A'
|
||||
#gpg --keyserver pgp.mit.edu --recv-keys $PGP_KEY_FINGERPRINT
|
||||
echo "$PGP_KEY_FINGERPRINT:6:" | gpg --import-ownertrust
|
||||
if ! gpg --verify "$signature_file" "$release_archive"
|
||||
@@ -105,12 +107,27 @@ function uninstall_nextcloud
|
||||
rm -r ~/html/* ~/html/.htaccess ~/html/.user.ini ~/_nextcloud_completion
|
||||
mysql --verbose --execute="DROP DATABASE ${USER}_nextcloud"
|
||||
rm ~/bin/ncc ~/bin/nextcloud-update
|
||||
sed --in-place '/_nextcloud_completion/d' ~/.bash_profile
|
||||
unlink ~/bin/notify_push
|
||||
unlink ~/logs/nextcloud.log
|
||||
unlink ~/logs/nextcloud-updater.log
|
||||
set_critical_section
|
||||
}
|
||||
|
||||
function ask_for_password
|
||||
{
|
||||
echo "Note: Your password input will not be visible."
|
||||
read -s -r -p "$APP_NAME admin password: " NEXTCLOUD_ADMIN_PASS
|
||||
echo
|
||||
read -s -r -p "$APP_NAME admin password confirmation: " ADMIN_PASS_CONFIRMATION
|
||||
echo
|
||||
while [ -z "$NEXTCLOUD_ADMIN_PASS" ] || [ "$NEXTCLOUD_ADMIN_PASS" != "$ADMIN_PASS_CONFIRMATION" ]
|
||||
do
|
||||
echo That was not correct, try again
|
||||
ask_for_password
|
||||
done
|
||||
}
|
||||
|
||||
function process_parameters
|
||||
{
|
||||
while test $# -gt 0
|
||||
@@ -148,7 +165,7 @@ function get_version_name
|
||||
function setup_php
|
||||
{
|
||||
echo "Applying relevant PHP settings for Nextcloud"
|
||||
uberspace tools version use php 8.1
|
||||
uberspace tools version use php $PHP_VERSION
|
||||
touch ~/etc/php.d/opcache.ini
|
||||
cat << end_of_content > ~/etc/php.d/opcache.ini
|
||||
opcache.enable=1
|
||||
@@ -223,7 +240,10 @@ end_of_content
|
||||
supervisorctl update
|
||||
supervisorctl status
|
||||
uberspace web backend set /push --http --port 7867
|
||||
uberspace web backend list
|
||||
local fail_counter=0
|
||||
while (uberspace web backend list | grep "/push http:7867 => NOT OK") && test $fail_counter -lt 5
|
||||
do echo 'wait another 5 seconds for notify service'; sleep 5; ((fail_counter++))
|
||||
done
|
||||
local trusted_proxy
|
||||
trusted_proxy=$(ip route |
|
||||
tail --lines 1 | ## filter last line
|
||||
@@ -272,6 +292,8 @@ ncc db:add-missing-indices --no-interaction
|
||||
ncc db:convert-filecache-bigint --no-interaction
|
||||
|
||||
ncc app:update --all
|
||||
## App updates may require additional steps to be done by the `upgrade` command
|
||||
ncc upgrade
|
||||
/usr/sbin/restorecon -R $APP_LOCATION
|
||||
|
||||
if test -f ~/etc/services.d/notify_push.ini
|
||||
|
||||
@@ -98,6 +98,8 @@ function do_update_procedure
|
||||
ncc db:add-missing-indices --no-interaction
|
||||
ncc db:convert-filecache-bigint --no-interaction
|
||||
ncc app:update --all
|
||||
## App updates may require additional steps to be done by the `upgrade` command
|
||||
ncc upgrade
|
||||
/usr/sbin/restorecon -R "$APP_LOCATION"
|
||||
if test -f ~/etc/services.d/notify_push.ini
|
||||
then supervisorctl restart notify_push
|
||||
|
||||
@@ -21,6 +21,8 @@ ncc db:add-missing-indices --no-interaction
|
||||
ncc db:convert-filecache-bigint --no-interaction
|
||||
|
||||
ncc app:update --all
|
||||
## App updates may require additional steps to be done by the `upgrade` command
|
||||
ncc upgrade
|
||||
/usr/sbin/restorecon -R $APP_LOCATION
|
||||
|
||||
if test -f ~/etc/services.d/notify_push.ini
|
||||
|
||||
Reference in new issue
Block a user