mirror of
https://github.com/YunoHost-Apps/signaturepdf_ynh.git
synced 2024-09-03 20:25:57 +02:00
No need to ask for the digital signature password
This commit is contained in:
parent
69633498c1
commit
7a719abc2b
5 changed files with 9 additions and 18 deletions
|
@ -9,8 +9,8 @@ name = "SignaturePDF configuration"
|
|||
[main.digital_signature.warning]
|
||||
type = "alert"
|
||||
style = "info"
|
||||
ask.en = "Changing either the nickname or the password will delete the current certificate and generate a new one"
|
||||
ask.fr = "Changer le surnom ou le mot de passe supprimera le certificat actuel et en génèrera un nouveau"
|
||||
ask.en = "Changing either the nickname will delete the current certificate and generate a new one"
|
||||
ask.fr = "Changer le surnom supprimera le certificat actuel et en génèrera un nouveau"
|
||||
|
||||
[main.digital_signature.nss3_nick]
|
||||
ask.en = "Choose a nickname for the digital signature"
|
||||
|
@ -19,10 +19,3 @@ name = "SignaturePDF configuration"
|
|||
pattern.regexp = '^[^\.]+$'
|
||||
pattern.error = "The nickname cannot contain a dot"
|
||||
bind = ":__INSTALL_DIR__/config/config.ini"
|
||||
|
||||
[main.digital_signature.nss3_password]
|
||||
type = "password"
|
||||
ask.en = "Choose a password for the digital signature"
|
||||
ask.fr = "Choisissez un mot de passe pour la signature numérique"
|
||||
redact = true
|
||||
bind = ":__INSTALL_DIR__/config/config.ini"
|
||||
|
|
|
@ -36,18 +36,13 @@ ram.runtime = "50M"
|
|||
type = "group"
|
||||
default = "visitors"
|
||||
|
||||
[install.nss_nick]
|
||||
[install.nss3_nick]
|
||||
type = "string"
|
||||
ask.en = "Choose a nickname for the digital signature"
|
||||
ask.fr = "Choisissez un surnom pour la signature numérique"
|
||||
pattern.regexp = '[^\.]+'
|
||||
pattern.error = "The nickname cannot contain a dot"
|
||||
|
||||
[install.nss_password]
|
||||
type = "password"
|
||||
ask.en = "Choose a password for the digital signature"
|
||||
ask.fr = "Choisissez un mot de passe pour la signature numérique"
|
||||
|
||||
[resources]
|
||||
[resources.sources.main]
|
||||
url = "https://github.com/24eme/signaturepdf/archive/refs/tags/v1.7.0.tar.gz"
|
||||
|
|
|
@ -8,7 +8,7 @@ ynh_abort_if_errors
|
|||
ynh_app_config_validate() {
|
||||
_ynh_app_config_validate
|
||||
|
||||
if [ "${changed[nss3_nick]}" == "true" ] || [ "${changed[nss3_password]}" == "true" ] ]; then
|
||||
if [ "${changed[nss3_nick]}" == "true" ]; then
|
||||
ynh_secure_remove --file="$data_dir/nss"
|
||||
ynh_exec_as $app mkdir -p "$data_dir/nss"
|
||||
ynh_exec_as $app bash "$install_dir/tools/create_nss_certs.sh" $data_dir/nss/ $nss3_password $nss3_nick https://$domain$path
|
||||
|
|
|
@ -36,6 +36,9 @@ ynh_add_fpm_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
nss3_password=$(ynh_string_random)
|
||||
ynh_app_setting_set --app=$app --key=nss3_password --value=$nss3_password
|
||||
|
||||
ynh_add_config --template="config.ini" --destination="$install_dir/config/config.ini"
|
||||
|
||||
chmod 400 "$install_dir/config/config.ini"
|
||||
|
|
|
@ -20,8 +20,8 @@ if [ -z ${nss3_nick:-} ]; then
|
|||
fi
|
||||
|
||||
if [ -z ${nss3_password:-} ]; then
|
||||
nss3_password=""
|
||||
ynh_app_setting_set --app=$app --key=nss3_password --value=""
|
||||
nss3_password=$(ynh_string_random)
|
||||
ynh_app_setting_set --app=$app --key=nss3_password --value=$nss3_password
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue