Compare commits

..
4 Commits
Author SHA1 Message Date
EV21 c38a5ce166 minor: refactorings 2024-09-03 13:02:33 +02:00
EV21 6541a32fb9 feat(Gitea): update mailer config 2023-08-17 11:05:21 +02:00
EV21 ee5d32045c minor: add backend command to uninstaller 2023-06-09 12:53:11 +02:00
EV21 6ff8b2edef feat(Nextcloud): add file tree output 2023-06-09 12:37:20 +02:00
4 changed files with 43 additions and 12 deletions

No files matched your search

+2 -2
View File
@@ -203,7 +203,7 @@ NO_REPLY_ADDRESS = noreply.${USER}.uber.space
[mailer] [mailer]
ENABLED = true ENABLED = true
MAILER_TYPE = sendmail PROTOCOL = sendmail
FROM = ${USER}@uber.space FROM = ${USER}@uber.space
[other] [other]
@@ -339,7 +339,7 @@ function verify_file
fi fi
} }
# version_lower_than A B # is_version_lower_than A B
# returns whether A < B # returns whether A < B
function is_version_lower_than function is_version_lower_than
{ {
+1 -1
View File
@@ -68,7 +68,7 @@ function verify_file
fi fi
} }
# version_lower_than A B # is_version_lower_than A B
# returns whether A < B # returns whether A < B
function is_version_lower_than function is_version_lower_than
{ {
+16 -8
View File
@@ -6,7 +6,8 @@ LOCAL_VERSION=$(jq --raw-output .version ~/hedgedoc/package.json)
LATEST_VERSION=$(curl --silent https://api.github.com/repos/$ORG/$REPO/releases/latest | LATEST_VERSION=$(curl --silent https://api.github.com/repos/$ORG/$REPO/releases/latest |
jq --raw-output .tag_name) jq --raw-output .tag_name)
function do_upgrade() { function do_upgrade
{
supervisorctl stop hedgedoc supervisorctl stop hedgedoc
echo "waiting 1 minute until all processes are stopped" echo "waiting 1 minute until all processes are stopped"
sleep 1m sleep 1m
@@ -26,7 +27,7 @@ function do_upgrade() {
rm --recursive ~/hedgedoc_"$LOCAL_VERSION" rm --recursive ~/hedgedoc_"$LOCAL_VERSION"
} }
function yes-no_question function yes_no_question
{ {
local question=$1 local question=$1
while true while true
@@ -45,9 +46,9 @@ function yes-no_question
done done
} }
## version_lower_than A B # is_version_lower_than A B
# returns whether A < B # returns whether A < B
function version_lower_than function is_version_lower_than
{ {
test "$(echo "$@" | test "$(echo "$@" |
tr " " "\n" | tr " " "\n" |
@@ -55,11 +56,17 @@ function version_lower_than
head --lines=1)" != "$1" head --lines=1)" != "$1"
} }
function is_update_available
{
if is_version_lower_than "$LOCAL_VERSION" "$LATEST_VERSION"
then return 0
else return 1
fi
}
function main function main
{ {
if [ "$LOCAL_VERSION" = "$LATEST_VERSION" ] if is_update_available
then echo "Your HedgeDoc is already up to date."
elif version_lower_than "$LOCAL_VERSION" "$LATEST_VERSION"
then then
echo "There is a new Version available of $APP_NAME" echo "There is a new Version available of $APP_NAME"
echo "The latest Version is $LATEST_VERSION" echo "The latest Version is $LATEST_VERSION"
@@ -68,9 +75,10 @@ function main
echo "Please read the release notes." echo "Please read the release notes."
echo "Also check if the upgrade instructions have changed." echo "Also check if the upgrade instructions have changed."
echo "Your instance might break." echo "Your instance might break."
if yes-no_question "Do you wish to proceed with the upgrade?" if yes_no_question "Do you wish to proceed with the upgrade?"
then do_upgrade then do_upgrade
fi fi
else echo "Your HedgeDoc is already up to date."
fi fi
} }
+24 -1
View File
@@ -91,6 +91,7 @@ function uninstall_nextcloud
fi fi
if test -f ~/etc/services.d/notify_push.ini if test -f ~/etc/services.d/notify_push.ini
then then
uberspace web backend del /push
supervisorctl stop notify_push supervisorctl stop notify_push
rm ~/etc/services.d/notify_push.ini rm ~/etc/services.d/notify_push.ini
supervisorctl reread supervisorctl reread
@@ -321,6 +322,27 @@ function yes_no_question
done done
} }
function echo_tree
{
cat << end_of_content
/home/$USER
├── _nextcloud_completion
├── bin
│ ├── ncc (wrapper shortcut for ~/html/occ)
│ ├── nextcloud-update
│ └── notify_push -> /home/$USER/html/apps/notify_push/bin/x86_64/notify_push
├── nextcloud_data
│ └── >> user files, etc. <<
├── html -> /var/www/virtual/$USER/html
│ └── >> Nextcloud installation <<
├── logs
│ ├── nextcloud-cron.log
│ ├── nextcloud-updater.log -> /home/$USER/nextcloud_data/updater.log
│ └── nextcloud.log -> /home/$USER/nextcloud_data/nextcloud.log
└── ...
end_of_content
}
function set_critical_section { set -o pipefail -o errexit; } function set_critical_section { set -o pipefail -o errexit; }
function unset_critical_section { set +o pipefail +o errexit; } function unset_critical_section { set +o pipefail +o errexit; }
@@ -338,8 +360,9 @@ function main
echo "This script installs the latest release of $APP_NAME" echo "This script installs the latest release of $APP_NAME"
echo "and assumes a newly created Uberspace with default settings." echo "and assumes a newly created Uberspace with default settings."
fi fi
echo 'This will be the basic file structure'
echo_tree
echo "Do not run this script if you already use your Uberspace for other apps!" echo "Do not run this script if you already use your Uberspace for other apps!"
if yes_no_question "Do you want to execute this installer for $APP_NAME?" if yes_no_question "Do you want to execute this installer for $APP_NAME?"
then install_nextcloud then install_nextcloud
fi fi