From f27abba5111c86193cbbda8cab5d886c09eb027d Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Fri, 30 Dec 2022 16:42:46 +0100 Subject: [PATCH 1/5] General logo while waiting for a more personalized version --- public/logo.svg | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 public/logo.svg diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..013acc2 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 7d7e666bc77db013a0fe1b3b0f2d8e0a0fbd37ae Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Fri, 30 Dec 2022 16:46:05 +0100 Subject: [PATCH 2/5] Larger version --- public/logo.svg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/logo.svg b/public/logo.svg index 013acc2..a0b6c79 100644 --- a/public/logo.svg +++ b/public/logo.svg @@ -1,4 +1,5 @@ - - - - \ No newline at end of file + + + + + From c9f0d2502728da0b6eb61b655e465281c69f77f4 Mon Sep 17 00:00:00 2001 From: xgaia Date: Tue, 14 Mar 2023 17:18:10 +0100 Subject: [PATCH 3/5] feat: Add possibility to disable Organization --- Dockerfile | 1 + README.md | 8 +++++++- app.php | 9 ++++++++- config/config.ini.example | 3 ++- config/config.ini.tpl | 1 + templates/signature.html.php | 2 ++ 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9250b43..6644508 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ ENV UPLOAD_MAX_FILESIZE=24M ENV POST_MAX_SIZE=24M ENV MAX_FILE_UPLOADS=201 ENV PDF_STORAGE_PATH= +ENV DISABLE_ORGANIZATION=false RUN apt update && \ apt install -y gettext-base librsvg2-bin pdftk imagemagick potrace && \ diff --git a/README.md b/README.md index 932d3c4..a4eb5d9 100644 --- a/README.md +++ b/README.md @@ -96,10 +96,11 @@ Les variables suivantes permettent de configurer le déployement : |`POST_MAX_SIZE`|Taille maximum du fichier PDF à signer|48M|24M| |`MAX_FILE_UPLOADS`|Nombre de pages maximum du PDF, ici 200 pages + le PDF d'origine|401|201| |`PDF_STORAGE_PATH`|chemin vers lequel les fichiers pdf uploadés pourront être stockés|/data|| +|`DISABLE_ORGANIZATION`|Desactiver la route Organiser|true|false| ```bash docker run -d --name=signaturepdf -p 8080:80 -e SERVERNAME=pdf.example.org -e UPLOAD_MAX_FILESIZE=48M -e POST_MAX_SIZE=48M -e MAX_FILE_UPLOADS=401 -e PDF_STORAGE_PATH=/data signaturepdf -```` +``` ### Alpine @@ -237,6 +238,11 @@ Par exemple pour apache : chown www-data /path/to/folder/to/store/pdf ``` +### Desactivation du mode Organiser + +Pour desactiver le mode Organiser, ajouter `DISABLE_ORGANIZATION=true` dans le fichier +`config/config.ini`. + ## Mise à jour La dernière version stable est sur la branche `master`, pour la mise à jour il suffit de récupérer les dernières modifications : diff --git a/app.php b/app.php index 18cc252..2e9f7f9 100644 --- a/app.php +++ b/app.php @@ -16,6 +16,11 @@ if($f3->get('PDF_STORAGE_PATH') && !preg_match('|/$|', $f3->get('PDF_STORAGE_PAT $f3->set('PDF_STORAGE_PATH', $f3->get('PDF_STORAGE_PATH').'/'); } +$f3->set('disableOrganization', false); +if($f3->get('DISABLE_ORGANIZATION')) { + $f3->set('disableOrganization', $f3->get('DISABLE_ORGANIZATION')); +} + $f3->route('GET /', function($f3) { $f3->reroute('/signature'); @@ -294,6 +299,7 @@ $f3->route('GET /cron', function($f3) { } }); +if (!$f3->get('disableOrganization')) { $f3->route('GET /organization', function($f3) { $f3->set('maxSize', min(array(convertPHPSizeToBytes(ini_get('post_max_size')), convertPHPSizeToBytes(ini_get('upload_max_filesize'))))); @@ -319,7 +325,7 @@ $f3->route('POST /organize', $filenames[] = str_replace('.pdf', '', $fileBaseName); return basename($tmpfile).uniqid().".pdf"; - }); + }); if(!count($files)) { $f3->error(403); @@ -341,6 +347,7 @@ $f3->route('POST /organize', array_map('unlink', glob($tmpfile."*")); } ); +} function convertPHPSizeToBytes($sSize) { diff --git a/config/config.ini.example b/config/config.ini.example index f427cfb..0058a92 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -2,4 +2,5 @@ # 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=/path/to/folder \ No newline at end of file +PDF_STORAGE_PATH=/path/to/folder +DISABLE_ORGANIZATION=false diff --git a/config/config.ini.tpl b/config/config.ini.tpl index a4e92e8..158ca36 100644 --- a/config/config.ini.tpl +++ b/config/config.ini.tpl @@ -3,3 +3,4 @@ # 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=${PDF_STORAGE_PATH} +DISABLE_ORGANIZATION=${DISABLE_ORGANIZATION} diff --git a/templates/signature.html.php b/templates/signature.html.php index a92ba8b..0107509 100644 --- a/templates/signature.html.php +++ b/templates/signature.html.php @@ -17,6 +17,7 @@
+ +

Signer un PDF

Signer, parapher, tamponner, compléter un document

From 68be39ed233fe686935792098f1c6375bc621586 Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Sat, 18 Mar 2023 00:24:29 +0100 Subject: [PATCH 4/5] feat: Added option to remove or edit demo pdf link --- Dockerfile | 1 + README.md | 1 + app.php | 4 ++++ config/config.ini.example | 2 ++ config/config.ini.tpl | 1 + templates/organization.html.php | 4 +++- templates/signature.html.php | 4 +++- 7 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6644508..d126284 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,7 @@ ENV POST_MAX_SIZE=24M ENV MAX_FILE_UPLOADS=201 ENV PDF_STORAGE_PATH= ENV DISABLE_ORGANIZATION=false +ENV PDF_DEMO_LINK=true RUN apt update && \ apt install -y gettext-base librsvg2-bin pdftk imagemagick potrace && \ diff --git a/README.md b/README.md index a4eb5d9..8182be4 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ Les variables suivantes permettent de configurer le déployement : |`MAX_FILE_UPLOADS`|Nombre de pages maximum du PDF, ici 200 pages + le PDF d'origine|401|201| |`PDF_STORAGE_PATH`|chemin vers lequel les fichiers pdf uploadés pourront être stockés|/data|| |`DISABLE_ORGANIZATION`|Desactiver la route Organiser|true|false| +|`PDF_DEMO_LINK`|Afficher, retirer ou changer le lien de PDF de démo|false, `link` or `relative path`|true| ```bash docker run -d --name=signaturepdf -p 8080:80 -e SERVERNAME=pdf.example.org -e UPLOAD_MAX_FILESIZE=48M -e POST_MAX_SIZE=48M -e MAX_FILE_UPLOADS=401 -e PDF_STORAGE_PATH=/data signaturepdf diff --git a/app.php b/app.php index 2e9f7f9..454ea71 100644 --- a/app.php +++ b/app.php @@ -16,6 +16,10 @@ if($f3->get('PDF_STORAGE_PATH') && !preg_match('|/$|', $f3->get('PDF_STORAGE_PAT $f3->set('PDF_STORAGE_PATH', $f3->get('PDF_STORAGE_PATH').'/'); } +if(!$f3->get('PDF_DEMO_LINK') && $f3->get('PDF_DEMO_LINK') !== false) { + $f3->set('PDF_DEMO_LINK', 'https://raw.githubusercontent.com/24eme/signaturepdf/master/tests/files/document.pdf'); +} + $f3->set('disableOrganization', false); if($f3->get('DISABLE_ORGANIZATION')) { $f3->set('disableOrganization', $f3->get('DISABLE_ORGANIZATION')); diff --git a/config/config.ini.example b/config/config.ini.example index 0058a92..5a4000e 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -4,3 +4,5 @@ # To deactivate this mode, simply do not configure it or leave it empty PDF_STORAGE_PATH=/path/to/folder DISABLE_ORGANIZATION=false +; Manage demo link pdf : true (by default, show), false (hide), or custom link +;PDF_DEMO_LINK=true diff --git a/config/config.ini.tpl b/config/config.ini.tpl index 158ca36..895608f 100644 --- a/config/config.ini.tpl +++ b/config/config.ini.tpl @@ -4,3 +4,4 @@ # To deactivate this mode, simply do not configure it or leave it empty PDF_STORAGE_PATH=${PDF_STORAGE_PATH} DISABLE_ORGANIZATION=${DISABLE_ORGANIZATION} +PDF_DEMO_LINK=${PDF_DEMO_LINK} diff --git a/templates/organization.html.php b/templates/organization.html.php index fd9856f..e940a2c 100644 --- a/templates/organization.html.php +++ b/templates/organization.html.php @@ -35,7 +35,9 @@

Le PDF sera traité par le serveur sans être conservé ni stocké

- Tester avec un PDF de démo + + Tester avec un PDF de démo +
diff --git a/templates/signature.html.php b/templates/signature.html.php index 0107509..d49e967 100644 --- a/templates/signature.html.php +++ b/templates/signature.html.php @@ -35,7 +35,9 @@

Le PDF sera traité par le serveur sans être conservé ni stocké

- Tester avec un PDF de démo + + Tester avec un PDF de démo + From 9a63402a2ae3e2ffe5da25ec80fe77a886bda12c Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Sat, 18 Mar 2023 00:54:26 +0100 Subject: [PATCH 5/5] Documentation precision in the README and in the config.ini file and use of ";" instead of "#" for comments --- README.md | 5 +++++ config/config.ini.example | 9 ++++++--- config/config.ini.tpl | 8 ++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8182be4..35e5fd7 100644 --- a/README.md +++ b/README.md @@ -244,6 +244,11 @@ chown www-data /path/to/folder/to/store/pdf Pour desactiver le mode Organiser, ajouter `DISABLE_ORGANIZATION=true` dans le fichier `config/config.ini`. +### Cacher ou modifier le lien de PDF de démo + +Pour cacher le lien de pdf de démo, ajouter `PDF_DEMO_LINK=false` dans le fichier +`config/config.ini`. + ## Mise à jour La dernière version stable est sur la branche `master`, pour la mise à jour il suffit de récupérer les dernières modifications : diff --git a/config/config.ini.example b/config/config.ini.example index 5a4000e..ee6842a 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -1,8 +1,11 @@ [globals] -# 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 +; 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=/path/to/folder -DISABLE_ORGANIZATION=false + +; Disable organization tab and routes +;DISABLE_ORGANIZATION=false + ; Manage demo link pdf : true (by default, show), false (hide), or custom link ;PDF_DEMO_LINK=true diff --git a/config/config.ini.tpl b/config/config.ini.tpl index 895608f..d515b99 100644 --- a/config/config.ini.tpl +++ b/config/config.ini.tpl @@ -1,7 +1,11 @@ [globals] -# 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 +; 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=${PDF_STORAGE_PATH} + +; Disable organization tab and routes DISABLE_ORGANIZATION=${DISABLE_ORGANIZATION} + +; Manage demo link pdf : true (by default, show), false (hide), or custom link PDF_DEMO_LINK=${PDF_DEMO_LINK}