initial commit
This commit is contained in:
commit
5ebc506921
975 changed files with 154341 additions and 0 deletions
141
build/debian/config.debian.php
Normal file
141
build/debian/config.debian.php
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
<?php
|
||||
|
||||
namespace Paheko;
|
||||
|
||||
const SQLITE_JOURNAL_MODE = 'WAL';
|
||||
const ENABLE_UPGRADES = false;
|
||||
|
||||
if (shell_exec('which pdftotext')) {
|
||||
define('Paheko\PDFTOTEXT_COMMAND', 'pdftotext');
|
||||
}
|
||||
|
||||
if (shell_exec('which ssconvert')) {
|
||||
define('Paheko\CALC_CONVERT_COMMAND', 'ssconvert');
|
||||
}
|
||||
elseif (shell_exec('which unoconv')) {
|
||||
define('Paheko\CALC_CONVERT_COMMAND', 'unoconv');
|
||||
}
|
||||
|
||||
if (!empty($_ENV['PAHEKO_STANDALONE']))
|
||||
{
|
||||
$home = $_ENV['HOME'];
|
||||
|
||||
// Config directory
|
||||
if (empty($_ENV['XDG_CONFIG_HOME']))
|
||||
{
|
||||
$_ENV['XDG_CONFIG_HOME'] = $home . '/.config';
|
||||
}
|
||||
|
||||
// Rename Garradin to Paheko
|
||||
if (file_exists($_ENV['XDG_CONFIG_HOME'] . '/garradin')) {
|
||||
rename($_ENV['XDG_CONFIG_HOME'] . '/garradin', $_ENV['XDG_CONFIG_HOME'] . '/paheko');
|
||||
}
|
||||
|
||||
if (!file_exists($_ENV['XDG_CONFIG_HOME'] . '/paheko'))
|
||||
{
|
||||
mkdir($_ENV['XDG_CONFIG_HOME'] . '/paheko', 0700, true);
|
||||
}
|
||||
|
||||
if (file_exists($_ENV['XDG_CONFIG_HOME'] . '/paheko/config.local.php')) {
|
||||
require_once $_ENV['XDG_CONFIG_HOME'] . '/paheko/config.local.php';
|
||||
}
|
||||
|
||||
// Data directory: where the data will go
|
||||
if (empty($_ENV['XDG_DATA_HOME']))
|
||||
{
|
||||
$_ENV['XDG_DATA_HOME'] = $home . '/.local/share';
|
||||
}
|
||||
|
||||
if (file_exists($_ENV['XDG_DATA_HOME'] . '/garradin')) {
|
||||
rename($_ENV['XDG_DATA_HOME'] . '/garradin', $_ENV['XDG_DATA_HOME'] . '/paheko');
|
||||
}
|
||||
|
||||
if (!file_exists($_ENV['XDG_DATA_HOME'] . '/paheko')) {
|
||||
mkdir($_ENV['XDG_DATA_HOME'] . '/paheko', 0700, true);
|
||||
}
|
||||
|
||||
if (!defined('Paheko\DATA_ROOT')) {
|
||||
define('Paheko\DATA_ROOT', $_ENV['XDG_DATA_HOME'] . '/paheko');
|
||||
}
|
||||
|
||||
// Cache directory: temporary stuff
|
||||
if (empty($_ENV['XDG_CACHE_HOME']))
|
||||
{
|
||||
$_ENV['XDG_CACHE_HOME'] = $home . '/.cache';
|
||||
}
|
||||
|
||||
if (file_exists($_ENV['XDG_CACHE_HOME'] . '/garradin')) {
|
||||
rename($_ENV['XDG_CACHE_HOME'] . '/garradin', $_ENV['XDG_CACHE_HOME'] . '/paheko');
|
||||
}
|
||||
|
||||
if (!file_exists($_ENV['XDG_CACHE_HOME'] . '/paheko'))
|
||||
{
|
||||
mkdir($_ENV['XDG_CACHE_HOME'] . '/paheko', 0700, true);
|
||||
}
|
||||
|
||||
if (!defined('Paheko\CACHE_ROOT')) {
|
||||
define('Paheko\CACHE_ROOT', $_ENV['XDG_CACHE_HOME'] . '/paheko');
|
||||
}
|
||||
|
||||
if (!defined('Paheko\DB_FILE')) {
|
||||
$last_file = $_ENV['XDG_CONFIG_HOME'] . '/paheko/last';
|
||||
|
||||
if ($_ENV['PAHEKO_STANDALONE'] != 1)
|
||||
{
|
||||
$last_sqlite = trim($_ENV['PAHEKO_STANDALONE']);
|
||||
}
|
||||
else if (file_exists($last_file))
|
||||
{
|
||||
$last_sqlite = trim(file_get_contents($last_file));
|
||||
$last_sqlite = str_replace('.local/share/garradin', '.local/share/paheko', $last_sqlite);
|
||||
}
|
||||
else
|
||||
{
|
||||
$last_sqlite = $_ENV['XDG_DATA_HOME'] . '/paheko/association.sqlite';
|
||||
}
|
||||
|
||||
file_put_contents($last_file, $last_sqlite);
|
||||
|
||||
define('Paheko\DB_FILE', $last_sqlite);
|
||||
}
|
||||
|
||||
if (!defined('Paheko\LOCAL_LOGIN')) {
|
||||
define('Paheko\LOCAL_LOGIN', -1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (file_exists('/etc/paheko/config.php')) {
|
||||
require_once '/etc/paheko/config.php';
|
||||
}
|
||||
|
||||
if (!defined('Paheko\DATA_ROOT')) {
|
||||
define('Paheko\DATA_ROOT', '/var/lib/paheko');
|
||||
}
|
||||
|
||||
if (!defined('Paheko\CACHE_ROOT')) {
|
||||
define('Paheko\CACHE_ROOT', '/var/cache/paheko');
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists(DATA_ROOT . '/plugins')) {
|
||||
define('Paheko\PLUGINS_ROOT', DATA_ROOT . '/plugins');
|
||||
}
|
||||
else {
|
||||
define('Paheko\PLUGINS_ROOT', __DIR__ . '/plugins');
|
||||
}
|
||||
|
||||
if (!defined('Paheko\SECRET_KEY')) {
|
||||
if (file_exists(CACHE_ROOT . '/key')) {
|
||||
define('Paheko\SECRET_KEY', trim(file_get_contents(CACHE_ROOT . '/key')));
|
||||
}
|
||||
else {
|
||||
define('Paheko\SECRET_KEY', base64_encode(random_bytes(64)));
|
||||
file_put_contents(CACHE_ROOT . '/key', SECRET_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
// Disable PDF for CLI server
|
||||
if (PHP_SAPI == 'cli-server' && !defined('Paheko\PDF_COMMAND') && !file_exists(PLUGINS_ROOT . '/dompdf')) {
|
||||
define('Paheko\PDF_COMMAND', null);
|
||||
}
|
||||
|
||||
174
build/debian/makedeb.sh
Executable file
174
build/debian/makedeb.sh
Executable file
|
|
@ -0,0 +1,174 @@
|
|||
#!/bin/bash
|
||||
# Ripped from fossil makdedeb.sh
|
||||
|
||||
DEB_REV=${1-1} # .deb package build/revision number.
|
||||
PACKAGE_DEBNAME=paheko
|
||||
THISDIR=${PWD}
|
||||
|
||||
DEB_ARCH_NAME=all
|
||||
|
||||
PACKAGE_VERSION=`cat ../../src/VERSION`
|
||||
|
||||
[ ! -f ../paheko-${PACKAGE_VERSION}.tar.gz ] && (cd ../../src; make release)
|
||||
|
||||
tar xzvf ../paheko-${PACKAGE_VERSION}.tar.gz -C /tmp
|
||||
|
||||
SRCDIR="/tmp/paheko-${PACKAGE_VERSION}"
|
||||
|
||||
test -e ${SRCDIR} || {
|
||||
echo "This script must be run from a BUILT copy of the source tree."
|
||||
exit 1
|
||||
}
|
||||
|
||||
DEBROOT=$PWD/deb.tmp
|
||||
test -d ${DEBROOT} && rm -fr ${DEBROOT}
|
||||
|
||||
DEBLOCALPREFIX=${DEBROOT}/usr
|
||||
BINDIR=${DEBLOCALPREFIX}/bin
|
||||
mkdir -p ${BINDIR}
|
||||
mkdir -p ${DEBLOCALPREFIX}/share/doc/${PACKAGE_DEBNAME}
|
||||
cp ${THISDIR}/paheko ${BINDIR}
|
||||
|
||||
mkdir -p "${DEBLOCALPREFIX}/share/menu"
|
||||
cp ${THISDIR}/paheko.menu "${DEBLOCALPREFIX}/share/menu/paheko"
|
||||
mkdir -p "${DEBLOCALPREFIX}/share/applications"
|
||||
cp ${THISDIR}/paheko.desktop "${DEBLOCALPREFIX}/share/applications/"
|
||||
|
||||
CODEDIR=${DEBLOCALPREFIX}/share/${PACKAGE_DEBNAME}
|
||||
mkdir -p ${CODEDIR}
|
||||
cp -r ${SRCDIR}/* ${CODEDIR}
|
||||
cp ${THISDIR}/config.debian.php ${CODEDIR}/config.local.php
|
||||
mv ${CODEDIR}/data/plugins ${CODEDIR}/plugins
|
||||
rm -rf ${CODEDIR}/*.sqlite ${CODEDIR}/data
|
||||
cp ${THISDIR}/paheko.png "${CODEDIR}"
|
||||
|
||||
mkdir -p "${DEBROOT}/var/lib/${PACKAGE_DEBNAME}"
|
||||
mkdir -p "${DEBROOT}/var/cache/${PACKAGE_DEBNAME}"
|
||||
mkdir -p "${DEBROOT}/etc/${PACKAGE_DEBNAME}"
|
||||
|
||||
# Cleaning files that will be copied to /usr/share/doc
|
||||
#rm -f ${CODEDIR}/../{README.md,COPYING}
|
||||
|
||||
cd $DEBROOT || {
|
||||
echo "Debian dest dir [$DEBROOT] not found. :("
|
||||
exit 2
|
||||
}
|
||||
|
||||
rm -fr DEBIAN
|
||||
mkdir DEBIAN
|
||||
|
||||
PACKAGE_DEB_VERSION=${PACKAGE_VERSION}
|
||||
DEBFILE=${THISDIR}/${PACKAGE_DEBNAME}-${PACKAGE_DEB_VERSION}.deb
|
||||
PACKAGE_TIME=$(/bin/date)
|
||||
|
||||
rm -f ${DEBFILE}
|
||||
echo "Creating .deb package [${DEBFILE}]..."
|
||||
|
||||
echo "Generating md5 sums..."
|
||||
find ${DEBLOCALPREFIX} -type f -exec md5sum {} \; > DEBIAN/md5sums
|
||||
|
||||
true && {
|
||||
echo "Generating Debian-specific files..."
|
||||
cp ${THISDIR}/../../COPYING ${DEBLOCALPREFIX}/share/doc/${PACKAGE_DEBNAME}/copyright
|
||||
} || {
|
||||
echo "Fail."
|
||||
exit 1
|
||||
}
|
||||
|
||||
true && {
|
||||
cat <<EOF > DEBIAN/postinst
|
||||
#!/bin/sh
|
||||
|
||||
chown www-data:www-data /var/lib/paheko /var/cache/paheko
|
||||
chown root:www-data /etc/paheko
|
||||
chmod g=rX,o= /etc/paheko
|
||||
chmod ug=rwX,o= /var/lib/paheko /var/cache/paheko
|
||||
EOF
|
||||
|
||||
chmod +x DEBIAN/postinst
|
||||
|
||||
}
|
||||
|
||||
true && {
|
||||
CHANGELOG=${DEBLOCALPREFIX}/share/doc/${PACKAGE_DEBNAME}/changelog.gz
|
||||
cat <<EOF | gzip -c > ${CHANGELOG}
|
||||
${PACKAGE_DEBNAME} ${PACKAGE_DEB_VERSION}; urgency=low
|
||||
|
||||
This release has no changes over the core source distribution. It has
|
||||
simply been Debianized.
|
||||
|
||||
Packaged by ${USER} <http://dev.kd2.org/paheko/> on
|
||||
${PACKAGE_TIME}.
|
||||
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
# doc.
|
||||
DOCDIR=${DEBLOCALPREFIX}/share/doc/${PACKAGE_DEBNAME}
|
||||
|
||||
true && {
|
||||
echo "Generating doc..."
|
||||
cp ${THISDIR}/../../README.md ${DOCDIR}
|
||||
a2x --doctype manpage --format manpage ${THISDIR}/manpage.txt
|
||||
mkdir -p ${DEBLOCALPREFIX}/share/man/man1
|
||||
gzip -c ${THISDIR}/paheko.1 > ${DEBLOCALPREFIX}/share/man/man1/${PACKAGE_DEBNAME}.1.gz
|
||||
rm -f ${THISDIR}/paheko.1
|
||||
} || {
|
||||
echo "Fail."
|
||||
exit 1
|
||||
}
|
||||
|
||||
true && {
|
||||
CONTROL=DEBIAN/control
|
||||
echo "Generating ${CONTROL}..."
|
||||
cat <<EOF > ${CONTROL}
|
||||
Package: ${PACKAGE_DEBNAME}
|
||||
Section: web
|
||||
Priority: optional
|
||||
Maintainer: Paheko <paheko@paheko.eu>
|
||||
Architecture: ${DEB_ARCH_NAME}
|
||||
Depends: dash | bash, php-cli (>=7.4), php-sqlite3, php-intl, php-mbstring, sensible-utils
|
||||
Version: ${PACKAGE_DEB_VERSION}
|
||||
Suggests: php-imagick
|
||||
Replaces: garradin (<< 1.2.3~)
|
||||
Breaks: garradin (<< 1.2.3~)
|
||||
Homepage: https://fossil.kd2.org/paheko/
|
||||
Description: Paheko is a tool to manage non-profit organizations.
|
||||
It's only available in french.
|
||||
Description-fr: Gestionnaire d'association en interface web ou CLI.
|
||||
Paheko est un gestionnaire d'association à but non lucratif.
|
||||
Il permet de gérer les membres, leur adhésion et leurs contributions financières.
|
||||
Les membres peuvent se connecter eux-même et modifier leurs informations
|
||||
ou communiquer entre eux par e-mail. Une gestion précise des droits et
|
||||
autorisations est possible. Il est également possible de faire des
|
||||
envois de mails en groupe.
|
||||
.
|
||||
Un module de comptabilité à double entrée assure une gestion financière
|
||||
complète digne d'un vrai logiciel de comptabilité : suivi des opérations,
|
||||
graphiques, bilan annuel, compte de résultat, exercices, etc.
|
||||
.
|
||||
Il y a également la possibilité de publier un site web simple,
|
||||
et un gestionnaire de documents permettant de gérer les fichiers de
|
||||
l'association.
|
||||
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
|
||||
true && {
|
||||
fakeroot dpkg-deb -b ${DEBROOT} ${DEBFILE}
|
||||
echo "Package file created:"
|
||||
ls -la ${DEBFILE}
|
||||
dpkg-deb --info ${DEBFILE}
|
||||
}
|
||||
|
||||
cd - >/dev/null
|
||||
true && {
|
||||
echo "Cleaning up..."
|
||||
rm -fr ${DEBROOT}
|
||||
rm -rf ${SRCDIR}
|
||||
}
|
||||
|
||||
echo "Done :)"
|
||||
106
build/debian/manpage.txt
Normal file
106
build/debian/manpage.txt
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
PAHEKO(1)
|
||||
=========
|
||||
:doctype: manpage
|
||||
|
||||
|
||||
NAME
|
||||
----
|
||||
paheko - Gestionnaire d'association à but non lucratif
|
||||
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
*paheko* ['OPTIONS'] ['COMMANDE'] ['BASE']
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
Lancer paheko(1) sans argument lance le serveur web intégré sur
|
||||
l'adresse localhost:8081 et le navigateur web par défaut.
|
||||
|
||||
*BASE* défini le chemin de la base de données (fichier .sqlite) à
|
||||
utiliser. Par défaut, si aucune base n'est spécifiée, c'est le fichier
|
||||
'association.sqlite' situé dans le répertoire des données qui est
|
||||
utilisé.
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
*-p, --port*='PORT'::
|
||||
Défini le port utilisé par le serveur web.
|
||||
Par défaut c'est le port 8081 qui est utilisé.
|
||||
|
||||
*-b, --bind*='IP'::
|
||||
Adresse IP où sera exposé le serveur web.
|
||||
Par défaut c'est 127.0.0.1 qui est utilisé.
|
||||
|
||||
Utiliser 0.0.0.0 pour que le serveur web soit accessible d'autres
|
||||
machines. (Attention cela peut présenter un risque de sécurité.)
|
||||
|
||||
*-v, --verbose*::
|
||||
Affiche les messages du serveur web.
|
||||
|
||||
*-h, --help*::
|
||||
Affiche un message d'aide sur l'utilisation de la commande.
|
||||
|
||||
COMMANDES
|
||||
---------
|
||||
*server*::
|
||||
Lance le serveur web autonome de Paheko sans lancer de navigateur
|
||||
web.
|
||||
|
||||
*ui*::
|
||||
Lance le serveur web autonome et le navigateur par défaut.
|
||||
|
||||
EXIT STATUS
|
||||
-----------
|
||||
*0*::
|
||||
Succès
|
||||
|
||||
*1*::
|
||||
Erreur
|
||||
|
||||
EMPLACEMENTS DE STOCKAGE
|
||||
------------------------
|
||||
Les données sont stockées dans $XDG_DATA_HOME/paheko.
|
||||
Généralement c'est ~/.local/share/paheko
|
||||
|
||||
CONFIGURATION
|
||||
-------------
|
||||
Il est possible de créer un fichier de configuration dans
|
||||
$XDG_CONFIG_HOME/paheko/config.local.php
|
||||
|
||||
Voir la documentation pour plus de détails sur les constantes
|
||||
de configuration acceptées.
|
||||
|
||||
INSTALLATION SERVEUR WEB
|
||||
------------------------
|
||||
Il est possible d'utiliser ce package avec Apache pour héberger
|
||||
une instance Paheko.
|
||||
|
||||
La procédure est détaillée ici :
|
||||
https://fossil.kd2.org/paheko/wiki?name=Installation%20sous%20Debian-Ubuntu
|
||||
|
||||
Les données et plugins seront stockés dans le répertoire
|
||||
/var/lib/paheko
|
||||
|
||||
BUGS
|
||||
----
|
||||
Voir https://fossil.kd2.org/paheko/ pour un accès au bugtracker.
|
||||
|
||||
|
||||
AUTEUR
|
||||
------
|
||||
Paheko est développé par bohwaz et d'autres contributeurs.
|
||||
|
||||
|
||||
RESSOURCES
|
||||
----------
|
||||
|
||||
Site principal : <https://fossil.kd2.org/paheko/>
|
||||
|
||||
|
||||
COPYING
|
||||
-------
|
||||
Copyright \(C) 2011-2023 BohwaZ. Free use of this software is
|
||||
granted under the terms of the GNU Affero General Public License v3
|
||||
(AGPL).
|
||||
123
build/debian/paheko
Executable file
123
build/debian/paheko
Executable file
|
|
@ -0,0 +1,123 @@
|
|||
#!/bin/sh
|
||||
|
||||
ROOT=/usr/share/paheko/www
|
||||
#ROOT=~/fossil/paheko/src/www
|
||||
ROUTER=${ROOT}/_route.php
|
||||
PORT=8081
|
||||
ADDRESS="127.0.0.1"
|
||||
VERBOSE=0
|
||||
PID_FILE="${XDG_RUNTIME_DIR}/paheko/pid"
|
||||
|
||||
[ ! -d `dirname $PID_FILE` ] && mkdir -p `dirname $PID_FILE`
|
||||
|
||||
# Execute getopt
|
||||
ARGS=`getopt -o "pb:vh" -l "port:,bind:,verbose,help" -n "paheko" -- "$@"`
|
||||
|
||||
# Bad arguments
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# A little magic
|
||||
eval set -- "$ARGS"
|
||||
|
||||
# Now go through all the options
|
||||
while true;
|
||||
do
|
||||
case "$1" in
|
||||
-p|--port)
|
||||
PORT=$2
|
||||
shift;;
|
||||
|
||||
-b|--bind)
|
||||
ADDRESS=$2
|
||||
shift;;
|
||||
|
||||
-v|--verbose)
|
||||
VERBOSE=1
|
||||
shift;;
|
||||
|
||||
-h|--help)
|
||||
cat <<EOF
|
||||
Usage : $0 [COMMANDE] [PROJET]
|
||||
|
||||
Où COMMANDE peut être :
|
||||
|
||||
server [-p|--port PORT] [-b|--bind IP]
|
||||
Démarre un serveur web Paheko sur le port spécifié
|
||||
(8081 par défaut) et l'IP spécifiée (127.0.0.1 par défaut)
|
||||
|
||||
ui [-p|--port PORT] [-b|--bind IP]
|
||||
Idem que 'server' mais démarre ensuite le navigateur web par défaut
|
||||
et connecte automatiquement avec le premier administrateur
|
||||
de l'association.
|
||||
|
||||
Si aucune COMMANDE n'est donnée, Paheko utilisera 'ui' par défaut.
|
||||
|
||||
PROJET est le chemin menant à un projet Paheko précis
|
||||
(fichier .sqlite). Si aucun projet n'est indiqué, le
|
||||
dernier projet ouvert sera rouvert. Si aucun projet n'a jamais été
|
||||
ouvert un nouveau projet sera créé.
|
||||
|
||||
Options :
|
||||
|
||||
-p|--port PORT
|
||||
Spécifie le port pour le mode ui ou le mode serveur.
|
||||
|
||||
-b|--bind IP
|
||||
Spécifie l'adresse IP du serveur web.
|
||||
|
||||
-v|--verbose
|
||||
Affiche les requêtes reçues sur le serveur web.
|
||||
|
||||
-h|--help
|
||||
Affiche ce message.
|
||||
EOF
|
||||
exit
|
||||
shift;;
|
||||
|
||||
--)
|
||||
shift
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
CMD="$1"
|
||||
|
||||
[ "$CMD" = "" ] && {
|
||||
CMD="ui"
|
||||
}
|
||||
|
||||
PROJECT="$2"
|
||||
|
||||
[ "$PROJECT" = "" ] && PROJECT="1"
|
||||
|
||||
export PAHEKO_STANDALONE="$PROJECT"
|
||||
|
||||
[ -f $PID_FILE ] && kill `cat $PID_FILE` > /dev/null 2>&1 && rm -f $PID_FILE
|
||||
|
||||
PHP_CLI_SERVER_WORKER=2
|
||||
|
||||
[ $VERBOSE = 1 ] && {
|
||||
php -S ${ADDRESS}:${PORT} -t ${ROOT} -d variables_order=EGPCS ${ROUTER} &
|
||||
} || {
|
||||
php -S ${ADDRESS}:${PORT} -t ${ROOT} -d variables_order=EGPCS ${ROUTER} > /dev/null 2>&1 &
|
||||
}
|
||||
|
||||
php_pid=$!
|
||||
|
||||
echo $php_pid > $PID_FILE
|
||||
|
||||
sleep .5
|
||||
|
||||
[ "$CMD" = "ui" ] && {
|
||||
URL="http://${ADDRESS}:${PORT}/admin/"
|
||||
[ "$DISPLAY" != "" ] && {
|
||||
sensible-browser ${URL} &
|
||||
} || {
|
||||
www-browser ${URL} &
|
||||
}
|
||||
} || {
|
||||
wait $php_pid
|
||||
}
|
||||
6
build/debian/paheko.desktop
Normal file
6
build/debian/paheko.desktop
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[Desktop Entry]
|
||||
Name=Paheko
|
||||
Exec=paheko
|
||||
Icon=paheko
|
||||
Type=Application
|
||||
Categories=Office;Finance;Database
|
||||
3
build/debian/paheko.menu
Normal file
3
build/debian/paheko.menu
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
?package(paheko):needs="X11" section="Applications/Office"\
|
||||
title="Paheko" command="/usr/bin/paheko"\
|
||||
icon="/usr/share/paheko/paheko.png"
|
||||
BIN
build/debian/paheko.png
Normal file
BIN
build/debian/paheko.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
81
build/windows/Makefile
Normal file
81
build/windows/Makefile
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
.PHONY := php installer clean publish
|
||||
PHP_ARCHIVE := https://windows.php.net/downloads/releases/php-8.2.10-nts-Win32-vs16-x64.zip
|
||||
|
||||
all: installer
|
||||
|
||||
php.zip:
|
||||
wget ${PHP_ARCHIVE} -O php.zip
|
||||
|
||||
php: php.zip
|
||||
mkdir -p install_dir/php
|
||||
unzip -o php.zip -d install_dir/php > /dev/null
|
||||
|
||||
# Remove unused files
|
||||
@cd install_dir/php && rm -rf \
|
||||
phpdbg.exe \
|
||||
php8phpdbg.dll \
|
||||
php8embed.lib \
|
||||
php-cgi.exe \
|
||||
php.ini-* \
|
||||
dev \
|
||||
phar* \
|
||||
nghttp2.dll \
|
||||
libpq.dll \
|
||||
libenchant
|
||||
|
||||
# Remove unused extensions
|
||||
@cd install_dir/php/ext && rm -f \
|
||||
php_bz2.dll \
|
||||
php_com_dotnet.dll \
|
||||
php_curl.dll \
|
||||
php_dba.dll \
|
||||
php_dl_test.dll \
|
||||
php_enchant.dll \
|
||||
php_exif.dll \
|
||||
php_ffi.dll \
|
||||
php_ftp.dll \
|
||||
php_gmp.dll \
|
||||
php_imap.dll \
|
||||
php_ldap.dll \
|
||||
php_mysqli.dll \
|
||||
php_oci8_19.dll \
|
||||
php_odbc.dll \
|
||||
php_opcache.dll \
|
||||
php_pdo_firebird.dll \
|
||||
php_pdo_mysql.dll \
|
||||
php_pdo_oci.dll \
|
||||
php_pdo_odbc.dll \
|
||||
php_pdo_pgsql.dll \
|
||||
php_pdo_sqlite.dll \
|
||||
php_pgsql.dll \
|
||||
php_shmop.dll \
|
||||
php_snmp.dll \
|
||||
php_soap.dll \
|
||||
php_sysvshm.dll \
|
||||
php_xsl.dll \
|
||||
php_zend_test.dll
|
||||
|
||||
du -hs install_dir/php
|
||||
|
||||
installer: clean php
|
||||
$(eval VERSION=$(shell cat ../../src/VERSION))
|
||||
# NSIS only accepts numbers as version
|
||||
$(eval NSIS_VERSION=$(shell sed -E 's/-(alpha|beta|rc)[0-9]+//' ../../src/VERSION))
|
||||
mkdir -p install_dir
|
||||
cp ../paheko-${VERSION}.tar.gz install_dir/
|
||||
cd install_dir && tar xzf paheko-${VERSION}.tar.gz && mv paheko-${VERSION} paheko
|
||||
cp config.local.php install_dir/paheko/
|
||||
cp php.ini install_dir/php
|
||||
cp launch.bat install_dir
|
||||
cp paheko.ico install_dir
|
||||
rm -f install_dir/paheko-${VERSION}.tar.gz
|
||||
makensis -V3 -DNVERSION=${NSIS_VERSION} -DVERSION=${VERSION} paheko.nsis
|
||||
|
||||
clean:
|
||||
rm -rf install_dir
|
||||
|
||||
publish:
|
||||
$(eval VERSION=$(shell cat ../../src/VERSION))
|
||||
fossil uv ls | grep '^paheko-.*\.exe' | xargs fossil uv rm
|
||||
fossil uv add paheko-${VERSION}.exe
|
||||
fossil uv sync
|
||||
5
build/windows/README.md
Normal file
5
build/windows/README.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Paheko Windows build
|
||||
|
||||
## Requirements
|
||||
|
||||
NSIS: `apt install nsis`
|
||||
34
build/windows/config.local.php
Normal file
34
build/windows/config.local.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace Paheko;
|
||||
|
||||
if (!empty(getenv('LOCALAPPDATA'))) {
|
||||
// Store data in user AppData directory
|
||||
define('Paheko\DATA_ROOT', trim(getenv('LOCALAPPDATA'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'Paheko');
|
||||
|
||||
if (!file_exists(DATA_ROOT)) {
|
||||
@mkdir(DATA_ROOT, 0700, true);
|
||||
}
|
||||
}
|
||||
|
||||
define('Paheko\PLUGINS_ROOT', __DIR__ . '/data/plugins');
|
||||
|
||||
// Store secret key in user directory
|
||||
if (!defined('Paheko\SECRET_KEY')) {
|
||||
if (file_exists(DATA_ROOT . '/key')) {
|
||||
define('Paheko\SECRET_KEY', trim(file_get_contents(DATA_ROOT . '/key')));
|
||||
}
|
||||
else {
|
||||
define('Paheko\SECRET_KEY', base64_encode(random_bytes(16)));
|
||||
file_put_contents(DATA_ROOT . '/key', SECRET_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
// Always log in as admin user
|
||||
const LOCAL_LOGIN = -1;
|
||||
|
||||
// Disable PDF export
|
||||
const PDF_COMMAND = null;
|
||||
|
||||
// Disable e-mails as Windows is not able to send e-mails
|
||||
const DISABLE_EMAIL = true;
|
||||
15
build/windows/launch.bat
Normal file
15
build/windows/launch.bat
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
@start "" http://127.0.0.1:8082/
|
||||
|
||||
@echo =================================================
|
||||
@echo.
|
||||
@echo Demarrage du serveur PHP de Paheko.
|
||||
@echo.
|
||||
@echo Paheko est disponible a l'adresse suivante :
|
||||
@echo http://127.0.0.1:8082/
|
||||
@echo.
|
||||
@echo Fermer cette fenetre pour arreter le serveur.
|
||||
@echo.
|
||||
@echo =================================================
|
||||
@echo.
|
||||
|
||||
php\php.exe -S 127.0.0.1:8082 -t paheko/www paheko/www/_route.php 2> NUL
|
||||
BIN
build/windows/paheko.ico
Normal file
BIN
build/windows/paheko.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 122 KiB |
175
build/windows/paheko.nsis
Normal file
175
build/windows/paheko.nsis
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
# From https://www.conjur.org/blog/building-a-windows-installer-from-a-linux-ci-pipeline/
|
||||
!define APP_NAME "Paheko"
|
||||
!define COMP_NAME "Paheko.cloud"
|
||||
#!define WEB_SITE "https://paheko.cloud/"
|
||||
#!define VERSION "0.0.0.1"
|
||||
!define COPYRIGHT "Paheko"
|
||||
!define DESCRIPTION "Gestion d'association simple et efficace"
|
||||
!define INSTALLER_NAME "paheko-${VERSION}.exe"
|
||||
!define MAIN_APP_EXE "launch.bat"
|
||||
!define ICON "paheko.ico"
|
||||
#!define BANNER "[CHANGEME Installer Banner Filename .bmp]"
|
||||
#!define LICENSE_TXT "[CHANGEME License Text Document]"
|
||||
|
||||
!define INSTALL_DIR "$PROGRAMFILES64\${APP_NAME}"
|
||||
!define INSTALL_TYPE "SetShellVarContext all"
|
||||
!define REG_ROOT "HKLM"
|
||||
!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\${MAIN_APP_EXE}"
|
||||
!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
|
||||
!define REG_START_MENU "Start Menu Folder"
|
||||
|
||||
var SM_Folder
|
||||
|
||||
######################################################################
|
||||
|
||||
VIProductVersion "${NVERSION}.0"
|
||||
VIAddVersionKey "ProductName" "${APP_NAME}"
|
||||
VIAddVersionKey "CompanyName" "${COMP_NAME}"
|
||||
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
|
||||
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
|
||||
VIAddVersionKey "FileVersion" "${VERSION}"
|
||||
|
||||
######################################################################
|
||||
|
||||
SetCompressor /SOLID Lzma
|
||||
Name "${APP_NAME}"
|
||||
Caption "${APP_NAME}"
|
||||
OutFile "${INSTALLER_NAME}"
|
||||
BrandingText "${APP_NAME}"
|
||||
#InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
|
||||
InstallDir "${INSTALL_DIR}"
|
||||
|
||||
######################################################################
|
||||
|
||||
!define MUI_ICON "${ICON}"
|
||||
!define MUI_UNICON "${ICON}"
|
||||
Icon "${ICON}"
|
||||
|
||||
!ifdef BANNER
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "${BANNER}"
|
||||
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${BANNER}"
|
||||
!endif
|
||||
|
||||
######################################################################
|
||||
|
||||
!include "MUI2.nsh"
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_UNABORTWARNING
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
|
||||
!ifdef LICENSE_TXT
|
||||
!insertmacro MUI_PAGE_LICENSE "${LICENSE_TXT}"
|
||||
!endif
|
||||
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
|
||||
!ifdef REG_START_MENU
|
||||
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${APP_NAME}"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
|
||||
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
|
||||
!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
|
||||
!endif
|
||||
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
!insertmacro MUI_UNPAGE_FINISH
|
||||
|
||||
!insertmacro MUI_LANGUAGE "French"
|
||||
|
||||
######################################################################
|
||||
|
||||
Section -MainProgram
|
||||
${INSTALL_TYPE}
|
||||
|
||||
SetOverwrite ifnewer
|
||||
SetOutPath "$INSTDIR"
|
||||
File /r "install_dir\\"
|
||||
|
||||
SectionEnd
|
||||
|
||||
######################################################################
|
||||
|
||||
Section -Icons_Reg
|
||||
SetOutPath "$INSTDIR"
|
||||
WriteUninstaller "$INSTDIR\uninstall.exe"
|
||||
|
||||
!ifdef REG_START_MENU
|
||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||
CreateDirectory "$SMPROGRAMS\$SM_Folder"
|
||||
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" "" "$INSTDIR\paheko.ico"
|
||||
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" "" "$INSTDIR\paheko.ico"
|
||||
CreateShortCut "$SMPROGRAMS\$SM_Folder\Desinstaller ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
|
||||
|
||||
!ifdef WEB_SITE
|
||||
WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
|
||||
CreateShortCut "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url"
|
||||
!endif
|
||||
!insertmacro MUI_STARTMENU_WRITE_END
|
||||
!endif
|
||||
|
||||
!ifndef REG_START_MENU
|
||||
CreateDirectory "$SMPROGRAMS\${APP_NAME}"
|
||||
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" "" "$INSTDIR\paheko.ico"
|
||||
CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}" "" "$INSTDIR\paheko.ico"
|
||||
CreateShortCut "$SMPROGRAMS\${APP_NAME}\Desinstaller ${APP_NAME}.lnk" "$INSTDIR\uninstall.exe"
|
||||
|
||||
!ifdef WEB_SITE
|
||||
WriteIniStr "$INSTDIR\${APP_NAME} website.url" "InternetShortcut" "URL" "${WEB_SITE}"
|
||||
CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME} Website.lnk" "$INSTDIR\${APP_NAME} website.url"
|
||||
!endif
|
||||
!endif
|
||||
|
||||
WriteRegStr ${REG_ROOT} "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
|
||||
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "${APP_NAME}"
|
||||
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
|
||||
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayIcon" "$INSTDIR\paheko.ico"
|
||||
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "${VERSION}"
|
||||
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "${COMP_NAME}"
|
||||
|
||||
!ifdef WEB_SITE
|
||||
WriteRegStr ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "${WEB_SITE}"
|
||||
!endif
|
||||
SectionEnd
|
||||
|
||||
######################################################################
|
||||
|
||||
Section Uninstall
|
||||
${INSTALL_TYPE}
|
||||
|
||||
RmDir /r "$INSTDIR"
|
||||
|
||||
!ifdef REG_START_MENU
|
||||
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
|
||||
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk"
|
||||
Delete "$SMPROGRAMS\$SM_Folder\Desinstaller ${APP_NAME}.lnk"
|
||||
!ifdef WEB_SITE
|
||||
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk"
|
||||
!endif
|
||||
Delete "$DESKTOP\${APP_NAME}.lnk"
|
||||
|
||||
RmDir "$SMPROGRAMS\$SM_Folder"
|
||||
!endif
|
||||
|
||||
!ifndef REG_START_MENU
|
||||
Delete "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk"
|
||||
Delete "$SMPROGRAMS\${APP_NAME}\Desinstaller ${APP_NAME}.lnk"
|
||||
!ifdef WEB_SITE
|
||||
Delete "$SMPROGRAMS\${APP_NAME}\${APP_NAME} Website.lnk"
|
||||
!endif
|
||||
Delete "$DESKTOP\${APP_NAME}.lnk"
|
||||
|
||||
RmDir "$SMPROGRAMS\${APP_NAME}"
|
||||
!endif
|
||||
|
||||
DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
|
||||
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
|
||||
SectionEnd
|
||||
95
build/windows/php.ini
Normal file
95
build/windows/php.ini
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
[PHP]
|
||||
engine = On
|
||||
short_open_tag = Off
|
||||
precision = 14
|
||||
output_buffering = 4096
|
||||
zlib.output_compression = Off
|
||||
implicit_flush = Off
|
||||
unserialize_callback_func =
|
||||
serialize_precision = -1
|
||||
disable_functions =
|
||||
disable_classes =
|
||||
zend.enable_gc = On
|
||||
zend.exception_ignore_args = Off
|
||||
zend.exception_string_param_max_len = 15
|
||||
expose_php = On
|
||||
max_execution_time = 30
|
||||
max_input_time = 60
|
||||
memory_limit = 128M
|
||||
error_reporting = E_ALL
|
||||
display_errors = On
|
||||
display_startup_errors = On
|
||||
log_errors = On
|
||||
ignore_repeated_errors = Off
|
||||
ignore_repeated_source = Off
|
||||
report_memleaks = On
|
||||
variables_order = "GPCS"
|
||||
request_order = "GP"
|
||||
register_argc_argv = Off
|
||||
auto_globals_jit = On
|
||||
post_max_size = 256M
|
||||
auto_prepend_file =
|
||||
auto_append_file =
|
||||
default_mimetype = "text/html"
|
||||
default_charset = "UTF-8"
|
||||
doc_root =
|
||||
user_dir =
|
||||
extension_dir = "ext"
|
||||
enable_dl = Off
|
||||
file_uploads = On
|
||||
upload_max_filesize = 256M
|
||||
max_file_uploads = 20
|
||||
allow_url_fopen = On
|
||||
allow_url_include = Off
|
||||
default_socket_timeout = 60
|
||||
|
||||
extension=fileinfo
|
||||
extension=gd
|
||||
extension=gettext
|
||||
extension=intl
|
||||
extension=mbstring
|
||||
extension=openssl
|
||||
extension=sodium
|
||||
extension=sqlite3
|
||||
extension=tidy
|
||||
|
||||
[CLI Server]
|
||||
cli_server.color = On
|
||||
|
||||
[mail function]
|
||||
SMTP = localhost
|
||||
smtp_port = 25
|
||||
mail.add_x_header = Off
|
||||
|
||||
[bcmath]
|
||||
bcmath.scale = 0
|
||||
|
||||
[Session]
|
||||
session.save_handler = files
|
||||
session.use_strict_mode = 0
|
||||
session.use_cookies = 1
|
||||
session.use_only_cookies = 1
|
||||
session.name = PHPSESSID
|
||||
session.auto_start = 0
|
||||
session.cookie_lifetime = 0
|
||||
session.cookie_path = /
|
||||
session.cookie_domain =
|
||||
session.cookie_httponly =
|
||||
session.cookie_samesite =
|
||||
session.serialize_handler = php
|
||||
session.gc_probability = 1
|
||||
session.gc_divisor = 1000
|
||||
session.gc_maxlifetime = 1440
|
||||
session.referer_check =
|
||||
session.cache_limiter = nocache
|
||||
session.cache_expire = 180
|
||||
session.use_trans_sid = 0
|
||||
session.sid_length = 26
|
||||
session.trans_sid_tags = "a=href,area=href,frame=src,form="
|
||||
session.sid_bits_per_character = 5
|
||||
|
||||
[Assertion]
|
||||
zend.assertions = -1
|
||||
|
||||
[Tidy]
|
||||
tidy.clean_output = Off
|
||||
Loading…
Add table
Add a link
Reference in a new issue