Improve upgrades

So that commit changes are checked
This commit is contained in:
Bob Mottram 2017-06-12 22:59:25 +01:00
parent 8809a82ea2
commit 18c7ca866a
15 changed files with 86 additions and 11 deletions

View File

@ -302,6 +302,11 @@ function reconfigure_etherpad {
}
function upgrade_etherpad {
CURR_ETHERPAD_COMMIT=$(get_completion_param "etherpad commit")
if [[ "$CURR_ETHERPAD_COMMIT" == "$ETHERPAD_COMMIT" ]]; then
return
fi
read_config_param "ETHERPAD_DOMAIN_NAME"
function_check set_repo_commit

View File

@ -213,6 +213,11 @@ function reconfigure_friendica {
}
function upgrade_friendica {
CURR_FRIENDICA_COMMIT=$(get_completion_param "friendica commit")
if [[ "$CURR_FRIENDICA_COMMIT" == "$FRIENDICA_COMMIT" ]]; then
return
fi
FRIENDICA_PATH=/var/www/$FRIENDICA_DOMAIN_NAME/htdocs
function_check set_repo_commit

View File

@ -192,6 +192,11 @@ function reconfigure_htmly {
}
function upgrade_htmly {
CURR_HTMLY_COMMIT=$(get_completion_param "htmly commit")
if [[ "$CURR_HTMLY_COMMIT" == "$HTMLY_COMMIT" ]]; then
return
fi
read_config_param "HTMLY_DOMAIN_NAME"
function_check set_repo_commit

View File

@ -196,6 +196,11 @@ function reconfigure_hubzilla {
}
function upgrade_hubzilla {
CURR_HUBZILLA_COMMIT=$(get_completion_param "hubzilla commit")
if [[ "$CURR_HUBZILLA_COMMIT" == "$HUBZILLA_COMMIT" ]]; then
return
fi
HUBZILLA_PATH=/var/www/$HUBZILLA_DOMAIN_NAME/htdocs
function_check set_repo_commit

View File

@ -58,6 +58,11 @@ function reconfigure_ipfs {
}
function upgrade_ipfs_go {
CURR_IPFS_COMMIT=$(get_completion_param "ipfs commit")
if [[ "$CURR_IPFS_COMMIT" == "$IPFS_COMMIT" ]]; then
return
fi
if [[ $(app_is_installed ipfs_go) == "0" ]]; then
return
fi

View File

@ -55,6 +55,11 @@ function reconfigure_librevault {
}
function upgrade_librevault {
CURR_LIBREVAULT_COMMIT=$(get_completion_param "librevault commit")
if [[ "$CURR_LIBREVAULT_COMMIT" == "$LIBREVAULT_COMMIT" ]]; then
return
fi
function_check set_repo_commit
if [ -d $INSTALL_DIR/protobuf ]; then
@ -71,8 +76,8 @@ function upgrade_librevault {
fi
if [ -d $INSTALL_DIR/librevault/build ]; then
if ! grep -q "Librevault commit:$LIBREVAULT_COMMIT" $COMPLETION_FILE; then
set_repo_commit $INSTALL_DIR/librevault "Librevault commit" "$LIBREVAULT_COMMIT" $LIBREVAULT_REPO
if ! grep -q "librevault commit:$LIBREVAULT_COMMIT" $COMPLETION_FILE; then
set_repo_commit $INSTALL_DIR/librevault "librevault commit" "$LIBREVAULT_COMMIT" $LIBREVAULT_REPO
cd $INSTALL_DIR/librevault
git submodule update --init --recursive
cd $INSTALL_DIR/librevault/build
@ -262,7 +267,7 @@ function install_librevault {
cmake --build .
make install
set_completion_param "Librevault commit" "$LIBREVAULT_COMMIT"
set_completion_param "librevault commit" "$LIBREVAULT_COMMIT"
LIBREVAULT_DAEMON=/etc/systemd/system/librevault-daemon.service
echo '[Unit]' > $LIBREVAULT_DAEMON

View File

@ -123,6 +123,11 @@ function reconfigure_lychee {
}
function upgrade_lychee {
CURR_LYCHEE_COMMIT=$(get_completion_param "lychee commit")
if [[ "$CURR_LYCHEE_COMMIT" == "$LYCHEE_COMMIT" ]]; then
return
fi
read_config_param "LYCHEE_DOMAIN_NAME"
function_check set_repo_commit

View File

@ -83,24 +83,21 @@ function reconfigure_mailpile {
function upgrade_mailpile {
read_config_param "MAILPILE_DOMAIN_NAME"
upgrade_mp=
CURR_COMMIT=$MAILPILE_COMMIT
if grep -q "mailpile commit" $COMPLETION_FILE; then
CURR_COMMIT=$(get_completion_param "mailpile commit")
fi
if [[ "$CURR_COMMIT" != "$MAILPILE_COMMIT" ]]; then
upgrade_mp=1
if [[ "$CURR_COMMIT" == "$MAILPILE_COMMIT" ]]; then
return
fi
function_check set_repo_commit
set_repo_commit /var/www/$MAILPILE_DOMAIN_NAME/mail "mailpile commit" "$MAILPILE_COMMIT" $MAILPILE_REPO
if [ $upgrade_mp ]; then
cd /var/www/$MAILPILE_DOMAIN_NAME/mail
pip install -r requirements.txt
cd /var/www/$MAILPILE_DOMAIN_NAME/mail
pip install -r requirements.txt
chown -R mailpile:mailpile /var/www/$MAILPILE_DOMAIN_NAME/mail
fi
chown -R mailpile:mailpile /var/www/$MAILPILE_DOMAIN_NAME/mail
}
function backup_local_mailpile {

View File

@ -329,6 +329,12 @@ function upgrade_matrix {
if [ ! -d /etc/matrix ]; then
return
fi
CURR_MATRIX_COMMIT=$(get_completion_param "matrix commit")
if [[ "$CURR_MATRIX_COMMIT" == "$MATRIX_COMMIT" ]]; then
return
fi
systemctl stop turn
systemctl stop matrix

View File

@ -152,6 +152,11 @@ function reconfigure_movim {
}
function upgrade_movim {
CURR_MOVIM_COMMIT=$(get_completion_param "movim commit")
if [[ "$CURR_MOVIM_COMMIT" == "$MOVIM_COMMIT" ]]; then
return
fi
if grep -q "movim domain" $COMPLETION_FILE; then
MOVIM_DOMAIN_NAME=$(get_completion_param "movim domain")
fi

View File

@ -178,6 +178,18 @@ function configure_interactive_nextcloud {
}
function upgrade_nextcloud {
CURR_NEXTCLOUD_COMMIT=$(get_completion_param "nextcloud commit")
if [[ "$CURR_NEXTCLOUD_COMMIT" == "$NEXTCLOUD_COMMIT" ]]; then
chown -R www-data:www-data /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs
chown -R www-data:www-data /var/www/$NEXTCLOUD_DOMAIN_NAME/data
cd /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs
sudo -u www-data ./occ maintenance:repair
sudo -u www-data ./occ files:cleanup
sudo -u www-data ./occ files:scan --all
sudo -u www-data ./occ maintenance:mode --off
return
fi
if grep -q "nextcloud domain" $COMPLETION_FILE; then
NEXTCLOUD_DOMAIN_NAME=$(get_completion_param "nextcloud domain")
fi

View File

@ -278,6 +278,11 @@ function reconfigure_pihole {
}
function upgrade_pihole {
CURR_PIHOLE_COMMIT=$(get_completion_param "pihole commit")
if [[ "$CURR_PIHOLE_COMMIT" == "$PIHOLE_COMMIT" ]]; then
return
fi
function_check set_repo_commit
set_repo_commit $INSTALL_DIR/pihole "pihole commit" "$PIHOLE_COMMIT" $PIHOLE_REPO

View File

@ -96,6 +96,11 @@ function reconfigure_rss {
}
function upgrade_rss {
CURR_RSS_READER_COMMIT=$(get_completion_param "rss reader commit")
if [[ "$CURR_RSS_READER_COMMIT" == "$RSS_READER_COMMIT" ]]; then
return
fi
RSS_MOBILE_READER_PATH=/etc/share/ttrss-mobile
if [[ $(app_is_installed rss) == "1" ]]; then

View File

@ -737,6 +737,11 @@ function create_searx_config {
}
function upgrade_searx {
CURR_SEARX_COMMIT=$(get_completion_param "searx commit")
if [[ "$CURR_SEARX_COMMIT" == "$SEARX_COMMIT" ]]; then
return
fi
settings_file=${SEARX_PATH}/searx/searx/settings.yml
background_image=/etc/searx/searx/static/themes/courgette/img/bg-body-index.jpg

View File

@ -186,6 +186,11 @@ function reconfigure_turtl {
}
function upgrade_turtl {
CURR_TURTL_COMMIT=$(get_completion_param "turtl commit")
if [[ "$CURR_TURTL_COMMIT" == "$TURTL_COMMIT" ]]; then
return
fi
read_config_param "TURTL_DOMAIN_NAME"
function_check set_repo_commit