1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/paheko_ynh.git synced 2024-09-03 19:56:22 +02:00

Merge pull request #52 from YunoHost-Apps/testing

Testing add a config.local.user.php file
This commit is contained in:
Robles Rodolphe 2024-01-05 18:43:07 +01:00 committed by GitHub
commit 40ed1e26b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 103 additions and 21 deletions

View file

@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Paheko (a word from the Māori language meaning "to cooperate", illustrating the purpose of the software: to improve together the daily management of an association) is software for associative management. It is the tool of choice for managing an association, a sports club, an NGO, etc. It is designed to meet the needs of a small to medium-sized structure: management of members, accounting, website, note-taking in meetings, archiving and sharing of the association's operating documents, discussion between members.
**Shipped version:** 1.3.5~ynh1
**Shipped version:** 1.3.5~ynh2
**Demo:** https://paheko.cloud/essai/

View file

@ -19,7 +19,7 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
Paheko (mot de la langue Māori qui signifie « coopérer », illustrant le but du logiciel : améliorer ensemble le quotidien de la gestion d'une association) est un logiciel de gestion associative. Il est l'outil de prédilection pour gérer une association, un club sportif, une ONG, etc. Il est conçu pour répondre aux besoins d'une structure de petite à moyenne taille : gestion des adhérents, comptabilité, site web, prise de notes en réunion, archivage et partage des documents de fonctionnement de l'association, discussion entre adhérents.
**Version incluse :** 1.3.5~ynh1
**Version incluse :** 1.3.5~ynh2
**Démo :** https://paheko.cloud/essai/

View file

@ -2,12 +2,13 @@
/**
* Ce fichier représente un exemple des constantes de configuration
* disponibles pour Paheko.
* disponibles pour Paheko. Il est bâti depuis une copie du fichier __INSTALL_DIR__/config.dist.php.
*
* NE PAS MODIFIER CE FICHIER!
*
* Pour configurer Paheko, copiez ce fichier en 'config.local.php'
* puis décommentez et modifiez ce dont vous avez besoin.
* Pour ajouter des configurations personnelles à votre instance,
* ajoutez les constantes commentées voulues dans le fichier __DATA_DIR__/data/config.local.user.php,
* éditez-les puis décommentez-les.
*/
// Nécessaire pour situer les constantes dans le bon namespace
@ -884,3 +885,9 @@ const MAIL_SENDER = '__APP__@__DOMAIN__';
* @var null|string
*/
//const ALERT_MESSAGE = 'Ceci est un compte de test.';
/**
* Chemin vers le fichier pour des configurations personnelles qui ne sera pas écraser
* lors des mises à jour. Cette ligne sera décommentée dès la première mise à jour.
*/
//require '__DATA_DIR__/data/config.local.user.php';

View file

@ -0,0 +1,12 @@
<?php
/**
* Ce fichier est ici pour ajouter des personnalisations à votre configuration.
*
* Modifiez ce fichier à votre guise, il ne sera pas modifié lors des prochaines mises à jour.
* Consultez le fichier __INSTALL_DIR__/config.local.php pour choisir des constantes à ajouter.
* Pour une nouvelle installation, ce fichier sera pris en compte après la première mise à jour.
*/
// Nécessaire pour situer les constantes dans le bon namespace
namespace Paheko;

View file

@ -1,3 +1,11 @@
If you wish, you can add custom configurations inside `__INSTALL_DIR__/config.local.php`.
If you wish, you can add custom configurations inside `__DATA_DIR__/data/config.local.user.php`.
Use the `__DATA_DIR__/data` folder if you want to store documents elsewhere than in the database. Example in `__DATA_DIR__/data/config.local.user.php` file
```
const FILE_STORAGE_BACKEND = 'FileSystem';
const FILE_STORAGE_CONFIG = DATA_ROOT . /files';
```
**Important**: for some reason, email does not work when installing on a subpath. You are encouraged to use a full, dedicated for this domain (with path set to /)

View file

@ -1,4 +1,12 @@
Vous pouvez si vous le souhaitez ajouter des configurations personnelles en éditant le fichier `__INSTALL_DIR__/config.local.php`.
Vous pouvez si vous le souhaitez ajouter des configurations personnelles en éditant le fichier `__DATA_DIR__/data/config.local.user.php`.
Privilégiez le dossier `__DATA_DIR__/data` si vous voulez conserver des documents ailleurs que dans la base de données. Example dans le fichier `__DATA_DIR__/data/config.local.user.php`
```
const FILE_STORAGE_BACKEND = 'FileSystem';
const FILE_STORAGE_CONFIG = DATA_ROOT . '/files';
```
**Important** : Pour une raison quelconque, le courriel ne fonctionne pas lors de linstallation sur une sous-instance. Nous vous encourageons à utiliser un nom de domaine complet dédié à ce domaine (avec le chemin défini sur /).

View file

@ -5,7 +5,7 @@ name = "Paheko"
description.en = "Association management software"
description.fr = "Logiciel de gestion d'association"
version = "1.3.5~ynh1"
version = "1.3.5~ynh2"
maintainers = ["rodinux"]

View file

@ -43,12 +43,12 @@ chmod 644 "/etc/cron.d/$app"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=5
ynh_script_progression --message="Adding a configuration files..." --weight=5
# Install configuration files
ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php"
chmod 650 "$install_dir/config.local.php"
chmod 440 "$install_dir/config.local.php"
chown $app:$app "$install_dir/config.local.php"
#=================================================

View file

@ -29,6 +29,34 @@ if [ -z "${secret_key:-}" ]; then
ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key
fi
#=================================================
# KEEP CONFIGS IF NEEDED
#=================================================
if [ -f "$install_dir/config.local.yunohost.php" ]
then
ynh_script_progression --message="cleaning conf files..." --weight=5
ynh_secure_remove "$install_dir/config.local.php"
mv "$install_dir/config.local.yunohost.php" "$install_dir/config.local.php"
chmod 440 "$install_dir/config.local.php"
chown $app:$app "$install_dir/config.local.php"
ynh_store_file_checksum --file="$install_dir/config.local.php"
fi
ynh_script_progression --message="removing old conf files if they exist..." --weight=5
if [ -f "$install_dir/config.local.user.php" ]; then
ynh_secure_remove "$install_dir/config.local.user.php"
fi
if [ -f "$install_dir/data/config.local.user.php" ]; then
ynh_secure_remove "$install_dir/data/config.local.user.php"
fi
if [ -d "$install_dir/data/data" ]; then
ynh_secure_remove "$install_dir/data/data"
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -37,16 +65,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=5
if [ ! -d "$data_dir/data" ]; then
ynh_print_warn "Migrating data directory to $data_dir..."
# remove old configuration files
ynh_secure_remove --file="$install_dir/data/config.local.user.php"
ynh_secure_remove --file="$install_dir/config.local.yunohost.php"
mv "$install_dir/data" "$data_dir"
fi
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="config.local.php data/plugins"
fi
@ -79,9 +97,38 @@ ynh_script_progression --message="Updating a configuration file..." --weight=5
# Install configuration files
ynh_add_config --template="config.local.php" --destination="$install_dir/config.local.php"
chmod 650 "$install_dir/config.local.php"
chmod 440 "$install_dir/config.local.php"
chown $app:$app "$install_dir/config.local.php"
ynh_replace_string --match_string="//require '$data_dir/data/config.local.user.php';" --replace_string="require '$data_dir/data/config.local.user.php';" --target_file="$install_dir/config.local.php"
#=================================================
# ADD A CONFIG FILE
#=================================================
if [ ! -d "$data_dir/data" ]; then
ynh_script_progression --message="Adding a configuration directory..." --weight=5
mkdir "$data_dir/data"
chmod 770 "$data_dir/data"
chown -R $app:www-data "$data_dir/data"
else
chown -R $app:www-data "$data_dir/data/cache"
chown $app:www-data "$data_dir/data/index.html"
fi
if [ ! -f "$data_dir/data/config.local.user.php" ]; then
ynh_script_progression --message="Adding a configuration file..." --weight=5
ynh_add_config --template="config.local.user.php" --destination="$data_dir/data/config.local.user.php"
chmod 640 "$data_dir/data/config.local.user.php"
chown $app:$app "$data_dir/data/config.local.user.php"
fi
if [ -f "$install_dir/data/association.sqlite" ]; then
ynh_script_progression --message="Moving db files..." --weight=5
mv $install_dir/data/association.* $data_dir/data/
ynh_secure_remove "$install_dir/data/association.*"
fi
#=================================================
# END OF SCRIPT
#=================================================