-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:24eme/signaturepdf
- Loading branch information
Showing
10 changed files
with
301 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# signaturepdf default Apache configuration | ||
|
||
Alias /signaturepdf /usr/share/signaturepdf/public | ||
|
||
DocumentRoot /usr/share/signaturepdf/public | ||
|
||
<Directory /usr/share/signaturepdf/public> | ||
Options SymLinksIfOwnerMatch | ||
DirectoryIndex index.php | ||
AllowOverride All | ||
</Directory> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
# postinstall script for signature pdf | ||
|
||
set -e | ||
|
||
# Droits sur les fichiers | ||
chgrp -R www-data /usr/share/signaturepdf/data | ||
chgrp -R www-data /usr/share/signaturepdf/pdf | ||
|
||
chmod -R g+rwx /usr/share/signaturepdf/data | ||
chmod -R g+rwx /usr/share/signaturepdf/pdf | ||
|
||
# Activation de la conf apache2 | ||
mkdir -p /etc/apache2/conf-available | ||
ln -sf ../../signaturepdf/apache.conf /etc/apache2/conf-available/signaturepdf.conf | ||
|
||
a2enconf signaturepdf | ||
systemctl reload apache2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build debian package (.deb) | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: install git | ||
run: sudo apt install git | ||
|
||
- name: Copie des fichiers dans le dossier debian | ||
run: | | ||
mkdir -p .debian/usr/share/signaturepdf | ||
git clone . .debian/usr/share/signaturepdf | ||
rm -rf .debian/usr/share/signaturepdf/.git | ||
mkdir -p .debian/etc/signaturepdf | ||
cp .debian/apache.conf .debian/etc/signaturepdf | ||
- name: Set date / time | ||
run: | | ||
echo "RELEASE_DATE=$(date +%Y%m%d-%H%M)" >> $GITHUB_ENV | ||
- name: build-deb-action | ||
uses: jiro4989/build-deb-action@v3 | ||
with: | ||
package: signaturepdf | ||
package_root: .debian | ||
maintainer: 24ème <[email protected]> | ||
version: ${{ env.RELEASE_DATE }} | ||
depends: php, pdftk, librsvg2-bin, imagemagick, potrace, ghostscript, locales | ||
arch: all | ||
desc: Outils de signature PDF en ligne libre et open-source | ||
|
||
- name: Upload package | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: signaturepdf-${{ env.RELEASE_DATE }}-${{ github.ref_name }}.deb | ||
path: ./*.deb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
class Compression | ||
{ | ||
public static function isgsInstalled() { | ||
$output = null; | ||
$returnCode = null; | ||
|
||
exec('gs --version', $output, $returnCode); | ||
|
||
if (!$output) { | ||
return array(false); | ||
} | ||
return $output; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
class Image2SVG | ||
{ | ||
public static function isimageMagickInstalled() { | ||
$output = null; | ||
$returnCode = null; | ||
|
||
exec('convert --version', $output, $returnCode); | ||
|
||
if (!$output) { | ||
return array(false); | ||
} | ||
return $output; | ||
} | ||
|
||
public static function ispotraceInstalled() { | ||
$output = null; | ||
$returnCode = null; | ||
|
||
exec('potrace --version', $output, $returnCode); | ||
|
||
if (!$output) { | ||
return array(false); | ||
} | ||
return $output; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<!doctype html> | ||
<html lang="<?php echo $TRANSLATION_LANGUAGE ?>" dir="<?php echo $DIRECTION_LANGUAGE ?>" style="direction: <?php echo $DIRECTION_LANGUAGE ?>;" class="<?php echo $DIRECTION_LANGUAGE ?>"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="description" content="Logiciel libre de signature de PDF en ligne"> | ||
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap.<?php echo $DIRECTION_LANGUAGE ?>.min.css?5.1.1" rel="stylesheet"> | ||
<link href="<?php echo $REVERSE_PROXY_URL; ?>/vendor/bootstrap-icons.css?1.11.1" rel="stylesheet"> | ||
<link href="<?php echo $REVERSE_PROXY_URL; ?>/css/app.css?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/css/app.css") ?>" rel="stylesheet"> | ||
<title><?php echo _("Administration panel"); ?></title> | ||
</head> | ||
<body> | ||
<?php include('components/navtab.html.php'); ?> | ||
<div class="row"> | ||
<div class="col-2"></div> | ||
<div class="col-8"> | ||
<h1 class="px-4 py-4 display-5 fw-bold mb-0 mt-3 text-center"><i class="bi bi-wrench-adjustable"></i> <?php echo _("Configuration"); ?></h1> | ||
<h2 class="my-4"><?php echo _("Server installation"); ?></h2> | ||
|
||
<table class="table"> | ||
<tbody> | ||
<tr> | ||
<th class="align-top">PHP</th> | ||
<td class="text-muted"><?php echo 'PHP version ' . phpversion(); ?></td> | ||
<td> | ||
<?php if (version_compare(phpversion(), "5.6.0", ">=")): ?> | ||
<i class="bi bi-check-square text-success" title="<?php echo _("Minimal version required : 5.6.0"); ?>"></i> | ||
<?php else: ?> | ||
<span class="text-danger"> | ||
<i class="bi bi-exclamation-octagon-fill"></i> (Minimal version required : 5.6.0) | ||
</span> | ||
<?php endif; ?> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th class="align-top">rsvg-convert</th> | ||
<?php $rsvgConvert = implode(PDFSignature::isrsvgConvertInstalled()); ?> | ||
<td class="text-muted"><?php echo $rsvgConvert; ?></td> | ||
<td> | ||
<?php if ($rsvgConvert): ?> | ||
<i class="bi bi-check-square text-success"></i> | ||
<?php else: ?> | ||
<span class="text-danger"> | ||
<i class="bi bi-exclamation-octagon-fill"></i> (<?php echo _("Package librsvg2-bin required"); ?>) | ||
</span> | ||
<?php endif; ?> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th class="align-top">pdftk</th> | ||
<?php $pdftk = implode(PDFSignature::ispdftkInstalled()); ?> | ||
<td class="text-muted"><?php if ($pdftk) { echo substr($pdftk, 0, 24); }; ?></td> | ||
<td> | ||
<?php if ($pdftk): ?> | ||
<i class="bi bi-check-square text-success"></i> | ||
<?php else: ?> | ||
<span class="text-danger"> | ||
<i class="bi bi-exclamation-octagon-fill"></i> (<?php echo _("Package pdftk required"); ?>) | ||
</span> | ||
<?php endif; ?> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th class="align-top">image magick</th> | ||
<?php $imageMagick = implode(Image2SVG::isimageMagickInstalled()); ?> | ||
<td class="text-muted"><?php if ($imageMagick) { echo substr($imageMagick, 9, 21); }; ?></td> | ||
<td> | ||
<?php if ($imageMagick): ?> | ||
<i class="bi bi-check-square text-success"></i> | ||
<?php else: ?> | ||
<span class="text-danger"> | ||
<i class="bi bi-exclamation-octagon-fill"></i> (<?php echo _("Package imagemagick required"); ?>) | ||
</span> | ||
<?php endif; ?> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th class="align-top">potrace</th> | ||
<?php $potrace = implode(Image2SVG::ispotraceInstalled()); ?> | ||
<td class="text-muted"><?php if ($potrace) { echo substr($potrace, 0, 12); } ?></td> | ||
<td> | ||
<?php if ($potrace): ?> | ||
<i class="bi bi-check-square text-success"></i> | ||
<?php else: ?> | ||
<span class="text-danger"> | ||
<i class="bi bi-exclamation-octagon-fill"></i> (<?php echo _("Package potrace required"); ?>) | ||
</span> | ||
<?php endif; ?> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th class="align-top">ghostscript</th> | ||
<?php $ghostscript = implode(Compression::isgsInstalled()); ?> | ||
<td class="text-muted"><?php if ($ghostscript) { echo 'Ghostscript version ' . $ghostscript; } ?></td> | ||
<td> | ||
<?php if ($ghostscript): ?> | ||
<i class="bi bi-check-square text-success"></i> | ||
<?php else: ?> | ||
<span class="text-danger"> | ||
<i class="bi bi-exclamation-octagon-fill"></i> (<?php echo _("Package ghostscript required"); ?>) | ||
</span> | ||
<?php endif; ?> | ||
</td> | ||
</tr> | ||
<tr> | ||
<th class="align-top">gpg</th> | ||
<?php $gpg = implode(GPGCryptography::isGpgInstalled()); ?> | ||
<td class="text-muted"><?php if ($gpg) { echo substr($gpg, 0, 18); } ?></td> | ||
<td> | ||
<?php if ($gpg): ?> | ||
<i class="bi bi-check-square text-success"></i> | ||
<?php else: ?> | ||
<span class="text-warning"> | ||
<i class="bi bi-exclamation-octagon-fill"></i> (<?php echo _("Package gpg missing"); ?>) | ||
</span> | ||
<?php endif; ?> | ||
</td> | ||
</tr> | ||
|
||
|
||
|
||
</tbody> | ||
</table> | ||
<h5 class="py-2"><?php echo _("List of authorized IP for debugging purposes : "); ?></h4> | ||
<p> | ||
<?php foreach ($AUTHORIZED_IP as $ip): ?> | ||
<?php echo $ip . ' '; ?> | ||
<?php endforeach; ?> | ||
</p> | ||
|
||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters