diff --git a/manifest.toml b/manifest.toml index 51f5b35..a8c8d2f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -3,7 +3,7 @@ id = "albumik" name = "Albumik" description.en = "Lightweight private photo album with folder permissions and guest uploads" description.pl = "Lekki prywatny album zdjęć z katalogami, gośćmi i akceptacją zdjęć" -version = "0.1.0~ynh1" +version = "0.1.1~ynh1" maintainers = ["Filip"] [upstream] diff --git a/scripts/backup b/scripts/backup index e21b91a..78fa71e 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail -source ./_common.sh +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/_common.sh" mkdir -p "$YNH_BACKUP_DIR" tar -C / -czf "$YNH_BACKUP_DIR/albumik-data.tar.gz" "${data_dir#/}" "${config_dir#/}" "${install_dir#/}" 2>/dev/null || true diff --git a/scripts/install b/scripts/install index 3f36b67..552a9b4 100755 --- a/scripts/install +++ b/scripts/install @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail -source ./_common.sh +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/_common.sh" # YunoHost install args # packaging v2 passes these variables to scripts. diff --git a/scripts/remove b/scripts/remove index 695509b..d2ccce4 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail -source ./_common.sh +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/_common.sh" domain=$(yunohost app setting "$app" domain 2>/dev/null || echo "") diff --git a/scripts/restore b/scripts/restore index ca9f57f..c686411 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail -source ./_common.sh +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/_common.sh" if [ -f "$YNH_BACKUP_DIR/albumik-data.tar.gz" ]; then tar -C / -xzf "$YNH_BACKUP_DIR/albumik-data.tar.gz" diff --git a/scripts/upgrade b/scripts/upgrade index 26043ba..b489783 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,13 +1,22 @@ #!/bin/bash set -euo pipefail -source ./_common.sh +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/_common.sh" + +app="${YNH_APP_INSTANCE_NAME:-albumik}" -systemctl stop "$app" 2>/dev/null || true mkdir -p "$install_dir" + rm -rf "$install_dir/backend" "$install_dir/web" "$install_dir/doc" -cp -a backend web doc "$install_dir"/ + +cp -a "$YNH_APP_BASEDIR/backend" "$YNH_APP_BASEDIR/web" "$YNH_APP_BASEDIR/doc" "$install_dir"/ + chown -R "$app:$app" "$install_dir" + systemctl daemon-reload -systemctl start "$app" -systemctl reload nginx || true +systemctl restart "$app" + +nginx -t +systemctl reload nginx + echo "Albumik upgraded"