From d0390934bd674cf82f2220fe132ac7959d653509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 7 Feb 2018 23:49:32 +0100 Subject: [PATCH] Add checkprocess --- check_process | 38 ++++++++++++++++++++++++++++++++++++++ manifest.json | 2 +- scripts/_common.sh | 5 +++-- scripts/backup | 7 +++---- scripts/install | 2 +- scripts/restore | 4 ++-- 6 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 check_process diff --git a/check_process b/check_process new file mode 100644 index 0000000..d81eef7 --- /dev/null +++ b/check_process @@ -0,0 +1,38 @@ +;; General + ; Manifest + domain="domain.tld" (DOMAIN) + path="/path" (PATH) + admin="john" (USER) + is_public=1 (PUBLIC|public=1|private=0) + ; Checks + pkg_linter=1 + setup_sub_dir=1 + setup_root=1 + setup_nourl=0 + setup_private=1 + setup_public=1 + upgrade=1 + # upgrade=1 from_commit=a62bce7dbc6bc0e1f1b4e872286ff124747ea009 + # upgrade=1 from_commit=f050f88fbfe7bad1bf74d4584ec62ffcf28248e7 + backup_restore=1 + multi_instance=1 + incorrect_path=0 + port_already_use=1 (8448) + change_url=0 +;;; Levels + Level 1=auto + Level 2=auto + Level 3=auto + # https://github.com/YunoHost-Apps/gogs_ynh/blob/master/conf/login_source.sql + Level 4=1 + Level 5=auto + Level 6=auto + Level 7=auto + Level 8=0 + Level 9=0 + Level 10=0 +;;; Upgrade options +# ; commit=a62bce7dbc6bc0e1f1b4e872286ff124747ea009 +# name=Before multi_instance +# ; commit=f050f88fbfe7bad1bf74d4584ec62ffcf28248e7 +# name=Old version package diff --git a/manifest.json b/manifest.json index cc8ef10..a96d342 100644 --- a/manifest.json +++ b/manifest.json @@ -53,7 +53,7 @@ "example": "johndoe" }, { - "name": "public_site", + "name": "is_public", "type": "boolean", "ask": { "en": "Is it a public site ?", diff --git a/scripts/_common.sh b/scripts/_common.sh index 4184db4..df985f2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,8 +5,9 @@ app=$YNH_APP_INSTANCE_NAME final_path="/opt/$app" dbname=$app dbuser=$app -REPO_PATH="/home/$app/repositories" -DATA_PATH="/home/$app/data" +DATADIR="/home/$app" +REPO_PATH="$DATADIR/repositories" +DATA_PATH="$DATADIR/data" # Detect the system architecture to download the right tarball # NOTE: `uname -m` is more accurate and universal than `arch` diff --git a/scripts/backup b/scripts/backup index de8be5f..4c5e533 100644 --- a/scripts/backup +++ b/scripts/backup @@ -7,17 +7,16 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ./experimental_helper.sh -source ./_common.sh +source ../settings/scripts/experimental_helper.sh +source ../settings/scripts/_common.sh # Retrieve app settings domain=$(ynh_app_setting_get "$app" domain) # Copy the app source files -ynh_backup "$DESTDIR" +ynh_backup "$final_path" # Copy the data files -DATADIR="/home/$app" ynh_backup "$DATADIR" # Copy the conf files diff --git a/scripts/install b/scripts/install index 5437d2f..8e099fb 100644 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,7 @@ source ./_common.sh domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN -is_public=$YNH_APP_ARG_PUBLIC_SITE +is_public=$YNH_APP_ARG_IS_PUBLIC # Check domain/path availability ynh_webpath_available $domain $path_url || ynh_die "$domain is not available as domain, please use an other domain." diff --git a/scripts/restore b/scripts/restore index 2381e32..e71df8b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -7,8 +7,8 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ./experimental_helper.sh -source ./_common.sh +source ../settings/scripts/experimental_helper.sh +source ../settings/scripts/_common.sh # Set app specific variables app=${APPNAME:-gogs}