diff --git a/README.md b/README.md index a03b7cd..37c86c4 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ It shall NOT be edited by hand. Free web software for signing a PDF. -**Shipped version:** 1.7.0~ynh1 +**Shipped version:** 1.7.0~ynh2 **Demo:** diff --git a/README_es.md b/README_es.md index 5ba5e2b..d21a8f4 100644 --- a/README_es.md +++ b/README_es.md @@ -18,7 +18,7 @@ No se debe editar a mano. Free web software for signing a PDF. -**Versión actual:** 1.7.0~ynh1 +**Versión actual:** 1.7.0~ynh2 **Demo:** diff --git a/README_eu.md b/README_eu.md index a59544c..fbceff8 100644 --- a/README_eu.md +++ b/README_eu.md @@ -18,7 +18,7 @@ EZ editatu eskuz. Free web software for signing a PDF. -**Paketatutako bertsioa:** 1.7.0~ynh1 +**Paketatutako bertsioa:** 1.7.0~ynh2 **Demoa:** diff --git a/README_fr.md b/README_fr.md index fd47a16..2a3d282 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main. Logiciel web libre permettant de signer un PDF. -**Version incluse :** 1.7.0~ynh1 +**Version incluse :** 1.7.0~ynh2 **Démo :** diff --git a/README_gl.md b/README_gl.md index 919af73..ce04ba4 100644 --- a/README_gl.md +++ b/README_gl.md @@ -18,7 +18,7 @@ NON debe editarse manualmente. Free web software for signing a PDF. -**Versión proporcionada:** 1.7.0~ynh1 +**Versión proporcionada:** 1.7.0~ynh2 **Demo:** diff --git a/README_id.md b/README_id.md index cf50d4f..9923071 100644 --- a/README_id.md +++ b/README_id.md @@ -18,7 +18,7 @@ Ini TIDAK boleh diedit dengan tangan. Free web software for signing a PDF. -**Versi terkirim:** 1.7.0~ynh1 +**Versi terkirim:** 1.7.0~ynh2 **Demo:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 340c3d5..81917ce 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -18,7 +18,7 @@ Free web software for signing a PDF. -**分发版本:** 1.7.0~ynh1 +**分发版本:** 1.7.0~ynh2 **演示:** diff --git a/conf/config.ini b/conf/config.ini index fa5bf2b..de5b00c 100644 --- a/conf/config.ini +++ b/conf/config.ini @@ -3,3 +3,8 @@ # Path to which stored pdf to activate the mode of sharing a signature to several. # To deactivate this mode, simply do not configure it or leave it empty PDF_STORAGE_PATH=__DATA_DIR__ + +# Digital signature configuration +NSS3_DIRECTORY=__DATA_DIR__/nss/ +NSS3_PASSWORD=__NSS3_PASSWORD__ +NSS3_NICK=__NSS3_NICK__ diff --git a/config_panel.toml b/config_panel.toml new file mode 100644 index 0000000..035e0b8 --- /dev/null +++ b/config_panel.toml @@ -0,0 +1,21 @@ +version = "1.0" + +[main] +name = "SignaturePDF configuration" + + [main.digital_signature] + name = "Set up digital signature" + + [main.digital_signature.warning] + type = "alert" + style = "info" + ask.en = "Changing 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" + ask.fr = "Choisissez un surnom pour la signature numérique" + type = "string" + pattern.regexp = '^[^\.]+$' + pattern.error = "The nickname cannot contain a dot" + bind = ":__INSTALL_DIR__/config/config.ini" diff --git a/manifest.toml b/manifest.toml index 6bed153..01f4512 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Signaturepdf" description.en = "Sign, stamp, and reorganize PDF files" description.fr = "Signez, tamponnez, et réorganisez des fichiers PDF" -version = "1.7.0~ynh1" +version = "1.7.0~ynh2" maintainers = [] @@ -37,6 +37,14 @@ ram.runtime = "50M" type = "group" default = "visitors" + [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" + default = "SignaturePDF" + [resources] [resources.sources.main] url = "https://github.com/24eme/signaturepdf/archive/refs/tags/v1.7.0.tar.gz" @@ -49,9 +57,10 @@ ram.runtime = "50M" group = "www-data:r-x" [resources.data_dir] + subdirs = ["nss"] [resources.permissions] main.url = "/" [resources.apt] - packages ="php8.3-fpm, librsvg2-bin, pdftk, imagemagick, potrace" + packages ="php8.3-fpm, librsvg2-bin, pdftk, imagemagick, potrace, poppler-utils, libnss3-tools" diff --git a/scripts/install b/scripts/install index 640bfba..2508e33 100755 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,9 @@ ynh_config_add_phpfpm #================================================= ynh_script_progression "Adding $app's configuration..." +nss3_password=$(ynh_string_random) +ynh_app_setting_set --app=$app --key=nss3_password --value=$nss3_password + ynh_config_add --template="config.ini" --destination="$install_dir/config/config.ini" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ad05694..886d8aa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -5,6 +5,27 @@ source /usr/share/yunohost/helpers ynh_app_setting_set_default --key=php_upload_max_filesize --value=256M +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +if ynh_compare_current_package_version --comparison lt --version 1.7.0~ynh2 +then + nss3_nick="SignaturePDF" + ynh_app_setting_set --app=$app --key=nss3_nick --value=$nss3_nick + nss3_password=$(ynh_string_random) + ynh_app_setting_set --app=$app --key=nss3_password --value=$nss3_password + + echo " +# Digital signature configuration +NSS3_DIRECTORY=$data_dir/nss/ +NSS3_PASSWORD=$nss3_password +NSS3_NICK=$nss3_nick +" >> $install_dir/config/config.ini +ynh_store_file_checksum --file="$install_dir/config/config.ini" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================