1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/zeronet_ynh.git synced 2024-09-03 17:46:12 +02:00

Merge pull request #24 from YunoHost-Apps/Fix-linter

Fix linter
This commit is contained in:
Éric Gaspar 2021-11-20 08:38:14 +01:00 committed by GitHub
commit fa94c53fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 19 deletions

View file

@ -3,5 +3,4 @@ SOURCE_SUM=9286971422470cedb8ca5f6675863816bf3f05f0769842a1bdc12f85fc594938
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
SOURCE_EXTRACT=true SOURCE_EXTRACT=true

View file

@ -6,7 +6,7 @@
"en": "Decentralized websites using Bitcoin crypto and BitTorrent network", "en": "Decentralized websites using Bitcoin crypto and BitTorrent network",
"fr": "Sites Web décentralisés utilisant la crypto Bitcoin et le réseau BitTorrent" "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", "url": "https://zeronet.io",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"maintainer": { "maintainer": {
@ -14,7 +14,7 @@
"email": "whypsi@riseup.net" "email": "whypsi@riseup.net"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.1.7.3" "yunohost": ">= 4.3.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -24,22 +24,12 @@
"install" : [ "install" : [
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain"
"ask": {
"en": "Choose a sub domain name for ZeroNet",
"fr": "Choisissez un nom de domaine pour ZeroNet"
},
"example": "zeronet.domain.tld"
}, },
{ {
"name": "password", "name": "password",
"type": "password", "type": "password",
"optional": true, "optional": true
"ask": {
"en": "Set the password for the Zeronet.",
"fr": "Définissez le mot de passe pour votre Zeronet."
},
"example": "myreallystrengthpassword"
} }
] ]
} }

View file

@ -41,6 +41,7 @@ ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================

View file

@ -56,7 +56,7 @@ ynh_app_setting_set --app=$app --key=password --value=$password
#================================================= #=================================================
# FIND AND OPEN A PORT # FIND AND OPEN A PORT
#================================================= #=================================================
ynh_script_progression --message="Configuring firewall..." ynh_script_progression --message="Finding an available port..."
# Find an available port # Find an available port
port=$(ynh_find_port --port=43110) port=$(ynh_find_port --port=43110)

View file

@ -59,6 +59,17 @@ ynh_script_progression --message="Removing app main directory..."
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" 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 # REMOVE NGINX CONFIGURATION
#================================================= #=================================================

View file

@ -39,8 +39,6 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." 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 \ test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path " || ynh_die --message="There is already a directory: $final_path "
@ -98,9 +96,10 @@ popd
ynh_script_progression --message="Restoring various files..." ynh_script_progression --message="Restoring various files..."
# Restore permissions on app files # Restore permissions on app files
ynh_restore_file --origin_path="$datadir" ynh_restore_file --origin_path="$datadir" --not_mandatory
mkdir -p "$datadir" mkdir -p "$datadir"
chmod 750 "$datadir" chmod 750 "$datadir"
chmod -R o-rwx "$datadir" chmod -R o-rwx "$datadir"
chown -R $app:$app "$datadir" chown -R $app:$app "$datadir"