mirror of
https://github.com/YunoHost-Apps/privatebin_ynh.git
synced 2024-09-03 20:15:56 +02:00
parent
774eef21cd
commit
8b95e6704d
2 changed files with 20 additions and 15 deletions
|
@ -6,7 +6,7 @@
|
|||
"en": "Minimalist pastebin where the server has zero knowledge of pasted data",
|
||||
"fr": "Pastebin minimaliste où le serveur n'a aucune connaissance des données copiées"
|
||||
},
|
||||
"version": "1.3.4~ynh2",
|
||||
"version": "1.3.4~ynh3",
|
||||
"url": "https://github.com/PrivateBin/PrivateBin",
|
||||
"license": "Zlib",
|
||||
"maintainer": {
|
||||
|
@ -14,7 +14,7 @@
|
|||
"email": "julien.malik@paraiso.me"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.0.0"
|
||||
"yunohost": ">= 4.1.7"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -26,29 +26,17 @@
|
|||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for PrivateBin",
|
||||
"fr": "Choisissez un domaine pour PrivateBin"
|
||||
},
|
||||
"example": "domain.org"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"ask": {
|
||||
"en": "Choose a path for PrivateBin",
|
||||
"fr": "Choisissez un chemin pour PrivateBin"
|
||||
},
|
||||
"example": "/privatebin",
|
||||
"default": "/privatebin"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Is it a public site?",
|
||||
"fr": "Est-ce un site public ?"
|
||||
},
|
||||
"help": {
|
||||
"en": "If private, only YunoHost users can create a paste, but everyone can read it.",
|
||||
"fr": "Si privé, seul les utilisateurs YunoHost peuvent créer un paste, mais tout le monde peut lire."
|
||||
|
|
|
@ -30,6 +30,23 @@ ynh_script_progression --message="Loading installation settings..."
|
|||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||
|
||||
# Restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
||||
#=================================================
|
||||
|
@ -80,7 +97,7 @@ fi
|
|||
#=================================================
|
||||
# UPDATE SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reconfiguring SSOwat..."
|
||||
ynh_script_progression --message="Reconfiguring permissions..."
|
||||
|
||||
if [ $is_public -eq 0 ]
|
||||
then
|
||||
|
|
Loading…
Reference in a new issue