From 9aa0569d46a0667851a72b038d8596ea81880ae1 Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Thu, 1 Aug 2024 16:31:45 +0200 Subject: [PATCH] Encryption is disable by default --- Dockerfile | 2 +- app.php | 6 +++++- config/config.ini.example | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8e3437e..624a246 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ENV MAX_FILE_UPLOADS=201 ENV PDF_STORAGE_PATH=/data ENV DISABLE_ORGANIZATION=false ENV DEFAULT_LANGUAGE=fr_FR.UTF-8 -ENV PDF_STORAGE_ENCRYPTION=true +ENV PDF_STORAGE_ENCRYPTION=false RUN apt update && \ apt install -y vim locales gettext-base librsvg2-bin pdftk imagemagick potrace ghostscript gpg && \ diff --git a/app.php b/app.php index e0a4269..ab303d9 100644 --- a/app.php +++ b/app.php @@ -66,7 +66,11 @@ if ($f3->get('GET.lang')) { } if (!$f3->exists('PDF_STORAGE_ENCRYPTION')) { - $f3->set('PDF_STORAGE_ENCRYPTION', GPGCryptography::isGpgInstalled()); + $f3->set('PDF_STORAGE_ENCRYPTION', false); +} + +if($f3->get('PDF_STORAGE_ENCRYPTION') && !GPGCryptography::isGpgInstalled()) { + $f3->set('PDF_STORAGE_ENCRYPTION', false); } if ($f3->exists('NSS3_DIRECTORY') && $f3->exists('NSS3_PASSWORD') && $f3->exists('NSS3_NICK')) { diff --git a/config/config.ini.example b/config/config.ini.example index 2074632..dff71c6 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -16,8 +16,8 @@ PDF_STORAGE_PATH=/path/to/folder ;Declare your public domain here if you can't handle location rewriting through your reverse proxy. ;REVERSE_PROXY_URL=http://127.0.0.1:8080 -; Encryption activation (default activation if GPG is installed) -;PDF_STORAGE_ENCRYPTION=true +; Encryption activation (need GPG is installed) +;PDF_STORAGE_ENCRYPTION=false ;NSS3 configuration (used to sign pdf with pdfsig) ;NSS3_DIRECTORY=/path/to/nss3