mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
feat: Added option to remove or edit demo pdf link
This commit is contained in:
parent
c9f0d25027
commit
68be39ed23
@ -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 && \
|
||||
|
@ -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
|
||||
|
4
app.php
4
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'));
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
|
@ -35,7 +35,9 @@
|
||||
<label class="form-label mt-3" for="input_pdf_upload">Choisir un PDF <small class="opacity-75" style="cursor: help" title="Le PDF ne doit pas dépasser <?php echo round($maxSize / 1024 / 1024) ?> Mo"><i class="bi bi-info-circle"></i></small></label>
|
||||
<input id="input_pdf_upload" placeholder="Choisir un PDF" class="form-control form-control-lg" type="file" accept=".pdf,application/pdf" />
|
||||
<p class="mt-2 small fw-light text-dark">Le PDF sera traité par le serveur sans être conservé ni stocké</p>
|
||||
<a class="btn btn-sm btn-link opacity-75" href="#https://raw.githubusercontent.com/24eme/signaturepdf/master/tests/files/document.pdf">Tester avec un PDF de démo</a>
|
||||
<?php if($PDF_DEMO_LINK): ?>
|
||||
<a class="btn btn-sm btn-link opacity-75" href="#<?php echo $PDF_DEMO_LINK ?>">Tester avec un PDF de démo</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -35,7 +35,9 @@
|
||||
<label class="form-label mt-3" for="input_pdf_upload">Choisir un PDF <small class="opacity-75" style="cursor: help" title="Le PDF ne doit pas dépasser <?php echo round($maxSize / 1024 / 1024) ?> Mo et <?php echo $maxPage ?> pages"><i class="bi bi-info-circle"></i></small></label>
|
||||
<input id="input_pdf_upload" placeholder="Choisir un PDF" class="form-control form-control-lg" type="file" accept=".pdf,application/pdf" />
|
||||
<p class="mt-2 small fw-light text-dark">Le PDF sera traité par le serveur sans être conservé ni stocké</p>
|
||||
<a class="btn btn-sm btn-link opacity-75" href="#https://raw.githubusercontent.com/24eme/signaturepdf/master/tests/files/document.pdf">Tester avec un PDF de démo</a>
|
||||
<?php if($PDF_DEMO_LINK): ?>
|
||||
<a class="btn btn-sm btn-link opacity-75" href="#<?php echo $PDF_DEMO_LINK ?>">Tester avec un PDF de démo</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user