diff --git a/conf/app.src b/conf/app.src index ffa1aa4..4070886 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,5 +3,4 @@ SOURCE_SUM=9286971422470cedb8ca5f6675863816bf3f05f0769842a1bdc12f85fc594938 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= SOURCE_EXTRACT=true diff --git a/manifest.json b/manifest.json index 69c1730..621c6ca 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Decentralized websites using Bitcoin crypto and BitTorrent network", "fr": "Sites Web décentralisés utilisant la crypto Bitcoin et le réseau BitTorrent" }, - "version": "2021-01-25~ynh1", + "version": "2021.01.25~ynh1", "url": "https://zeronet.io", "license": "AGPL-3.0", "maintainer": { @@ -14,7 +14,7 @@ "email": "whypsi@riseup.net" }, "requirements": { - "yunohost": ">= 4.1.7.3" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ @@ -24,22 +24,12 @@ "install" : [ { "name": "domain", - "type": "domain", - "ask": { - "en": "Choose a sub domain name for ZeroNet", - "fr": "Choisissez un nom de domaine pour ZeroNet" - }, - "example": "zeronet.domain.tld" + "type": "domain" }, { "name": "password", "type": "password", - "optional": true, - "ask": { - "en": "Set the password for the Zeronet.", - "fr": "Définissez le mot de passe pour votre Zeronet." - }, - "example": "myreallystrengthpassword" + "optional": true } ] } diff --git a/scripts/backup b/scripts/backup index e345ceb..9520570 100755 --- a/scripts/backup +++ b/scripts/backup @@ -41,6 +41,7 @@ ynh_print_info --message="Declaring files to be backed up..." #================================================= ynh_backup --src_path="$final_path" + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index c4f5a04..acb9f1c 100755 --- a/scripts/install +++ b/scripts/install @@ -56,7 +56,7 @@ ynh_app_setting_set --app=$app --key=password --value=$password #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find an available port port=$(ynh_find_port --port=43110) diff --git a/scripts/remove b/scripts/remove index d408e37..0146fdd 100755 --- a/scripts/remove +++ b/scripts/remove @@ -59,6 +59,17 @@ ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." --weight=1 + ynh_secure_remove --file="$datadir" +fi + #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 44dbae2..e043798 100755 --- a/scripts/restore +++ b/scripts/restore @@ -39,8 +39,6 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -98,9 +96,10 @@ popd ynh_script_progression --message="Restoring various files..." # Restore permissions on app files -ynh_restore_file --origin_path="$datadir" +ynh_restore_file --origin_path="$datadir" --not_mandatory mkdir -p "$datadir" + chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:$app "$datadir"