1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/baikal_ynh.git synced 2024-09-03 18:16:11 +02:00
This commit is contained in:
Éric Gaspar 2023-08-20 10:59:40 +02:00
parent 9cb364ad51
commit 2b36def25b
5 changed files with 8 additions and 69 deletions

View file

@ -1,10 +0,0 @@
[reset_admin_password]
name = "Reset the admin password"
command = "/bin/bash scripts/actions/reset_admin_password"
accepted_return_codes = [0]
description = "Change the admin password of the app."
[reset_admin_password.arguments]
[reset_admin_password.arguments.password]
type = "password"
ask.en = "Set the password for the administration"
ask.fr = "Définissez le mot de passe pour l'administration"

View file

@ -13,6 +13,8 @@
upgrade=1
#0.7.1~ynh2
upgrade=1 from_commit=7c074c7b18322cde08c4eb57ffbc5ae174b7ae65
#0.9.3~ynh1
upgrade=1 from_commit=330692e457ef2b475046d1724d3f198f007d5512
backup_restore=1
multi_instance=0
port_already_use=0
@ -24,3 +26,7 @@ Notification=none
; commit=7c074c7b18322cde08c4eb57ffbc5ae174b7ae65
name=Testing #60
manifest_arg=domain=DOMAIN&path=PATH&password=mysecret&
; commit=330692e457ef2b475046d1724d3f198f007d5512
name=Testing #0.9.3~ynh1
manifest_arg=domain=DOMAIN&path=PATH&password=mysecret&

View file

@ -6,7 +6,7 @@
"en": "Lightweight CalDAV and CardDAV server",
"fr": "Serveur CalDAV et CardDAV léger"
},
"version": "0.9.3~ynh1",
"version": "0.9.3~ynh2",
"url": "https://sabre.io/baikal/",
"upstream": {
"license": "GPL-3.0",

View file

@ -7,7 +7,7 @@
#=================================================
# dependencies used by the app
YNH_PHP_VERSION=8.0
YNH_PHP_VERSION=8.2
php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap"

View file

@ -1,57 +0,0 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
# Get password
password=${YNH_ACTION_PASSWORD}
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# CHECK IF ARGUMENTS ARE CORRECT
#=================================================
#=================================================
# CHECK IF AN ACTION HAS TO BE DONE
#=================================================
password_hash_old=$(ynh_app_setting_get --app=$app --key=password_hash)
password_hash=$(echo -n admin:BaikalDAV:$password | sha256sum | cut -d ' ' -f 1)
if [ $password_hash == $password_hash_old ]
then
ynh_die "This is the same password." 0
fi
#=================================================
# SPECIFIC ACTION
#=================================================
# CHANGE THE PASSWORD
#=================================================
ynh_script_progression --message="Changing the password..." --weight=1
bk_conf="${final_path}/config/baikal.yaml"
ynh_backup_if_checksum_is_different --file="$final_path/config/baikal.yaml"
ynh_replace_string --match_string="${password_hash_old}" --replace_string="${password_hash}" --target_file="$final_path/config/baikal.yaml"
ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash
ynh_store_file_checksum --file="$final_path/config/baikal.yaml"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Execution completed" --last