mirror of
https://github.com/YunoHost-Apps/petitesannonces_ynh.git
synced 2024-09-03 19:56:31 +02:00
commit
323e03d985
11 changed files with 86 additions and 89 deletions
19
README.md
19
README.md
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
|||
|
||||
# PetitesAnnonces for YunoHost
|
||||
|
||||
[![Integration level](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg)
|
||||
[![Integration level](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![Working status](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg)
|
||||
[![Install PetitesAnnonces with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petitesannonces)
|
||||
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
@ -19,28 +19,27 @@ Make your own classified advertising website easily
|
|||
|
||||
**Shipped version:** 0.1.0~ynh2
|
||||
|
||||
|
||||
|
||||
## Screenshots
|
||||
|
||||
![](./doc/screenshots/demo.png)
|
||||
![Screenshot of PetitesAnnonces](./doc/screenshots/demo.png)
|
||||
|
||||
## Documentation and resources
|
||||
|
||||
* Official app website: https://framagit.org/toitoinebzh/petitesannonces
|
||||
* Upstream app code repository: https://framagit.org/toitoinebzh/petitesannonces
|
||||
* YunoHost documentation for this app: https://yunohost.org/app_petitesannonces
|
||||
* Report a bug: https://github.com/YunoHost-Apps/petitesannonces_ynh/issues
|
||||
* Official app website: <https://framagit.org/toitoinebzh/petitesannonces>
|
||||
* Upstream app code repository: <https://framagit.org/toitoinebzh/petitesannonces>
|
||||
* YunoHost documentation for this app: <https://yunohost.org/app_petitesannonces>
|
||||
* Report a bug: <https://github.com/YunoHost-Apps/petitesannonces_ynh/issues>
|
||||
|
||||
## Developer info
|
||||
|
||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing).
|
||||
|
||||
To try the testing branch, please proceed like that.
|
||||
```
|
||||
|
||||
``` bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug
|
||||
or
|
||||
sudo yunohost app upgrade petitesannonces -u https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
||||
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||
|
|
25
README_fr.md
25
README_fr.md
|
@ -1,10 +1,14 @@
|
|||
<!--
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
# PetitesAnnonces pour YunoHost
|
||||
|
||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg)
|
||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/petitesannonces.svg)](https://dash.yunohost.org/appci/app/petitesannonces) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/petitesannonces.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/petitesannonces.maintain.svg)
|
||||
[![Installer PetitesAnnonces avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=petitesannonces)
|
||||
|
||||
*[Read this readme in english.](./README.md)*
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *Ce package vous permet d'installer PetitesAnnonces rapidement et simplement sur un serveur YunoHost.
|
||||
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||
|
@ -15,28 +19,27 @@ Créer simplement et rapidement votre site de Petites Annonces
|
|||
|
||||
**Version incluse :** 0.1.0~ynh2
|
||||
|
||||
|
||||
|
||||
## Captures d'écran
|
||||
|
||||
![](./doc/screenshots/demo.png)
|
||||
![Capture d'écran de PetitesAnnonces](./doc/screenshots/demo.png)
|
||||
|
||||
## Documentations et ressources
|
||||
|
||||
* Site officiel de l'app : https://framagit.org/toitoinebzh/petitesannonces
|
||||
* Dépôt de code officiel de l'app : https://framagit.org/toitoinebzh/petitesannonces
|
||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_petitesannonces
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/petitesannonces_ynh/issues
|
||||
* Site officiel de l'app : <https://framagit.org/toitoinebzh/petitesannonces>
|
||||
* Dépôt de code officiel de l'app : <https://framagit.org/toitoinebzh/petitesannonces>
|
||||
* Documentation YunoHost pour cette app : <https://yunohost.org/app_petitesannonces>
|
||||
* Signaler un bug : <https://github.com/YunoHost-Apps/petitesannonces_ynh/issues>
|
||||
|
||||
## Informations pour les développeurs
|
||||
|
||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing).
|
||||
|
||||
Pour essayer la branche testing, procédez comme suit.
|
||||
```
|
||||
|
||||
``` bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug
|
||||
ou
|
||||
sudo yunohost app upgrade petitesannonces -u https://github.com/YunoHost-Apps/petitesannonces_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
||||
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>
|
||||
|
|
21
conf/config.php
Normal file
21
conf/config.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
/* Réglages MySQL - Votre hébergeur doit vous fournir ces informations. */
|
||||
|
||||
|
||||
/* Adresse de l'hébergement MySQL. */
|
||||
define('DB_HOST', 'localhost');
|
||||
|
||||
/* Nom de la base de données de WordPress. */
|
||||
define('DB_NAME', '__DB_NAME__');
|
||||
//define('DB_NAME', 'bdd_test');
|
||||
|
||||
/* Utilisateur de la base de données MySQL. */
|
||||
define('DB_USER', '__DB_USER__');
|
||||
//define('DB_USER', 'antoine');
|
||||
|
||||
/* Mot de passe de la base de données MySQL. */
|
||||
define('DB_PASSWORD', '__DB_PWD__');
|
||||
//define('DB_PASSWORD', 'secret');
|
||||
|
||||
|
||||
?>
|
|
@ -4,16 +4,10 @@ location __PATH__/ {
|
|||
# Path to source
|
||||
alias __FINALPATH__/ ;
|
||||
|
||||
# Force usage of https
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
### Example PHP configuration (remove it if not used)
|
||||
index index.php;
|
||||
|
||||
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
||||
#client_max_body_size 50M;
|
||||
client_max_body_size 50M;
|
||||
|
||||
try_files $uri $uri/ index.php;
|
||||
location ~ [^/]\.php(/|$) {
|
||||
|
@ -26,7 +20,6 @@ location __PATH__/ {
|
|||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||
}
|
||||
### End of PHP configuration part
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
|
|
|
@ -419,8 +419,8 @@ chdir = __FINALPATH__
|
|||
;php_admin_value[memory_limit] = 32M
|
||||
|
||||
; Common values to change to increase file upload limit
|
||||
; php_admin_value[upload_max_filesize] = 50M
|
||||
; php_admin_value[post_max_size] = 50M
|
||||
php_admin_value[upload_max_filesize] = 50M
|
||||
php_admin_value[post_max_size] = 50M
|
||||
; php_admin_flag[mail.add_x_header] = Off
|
||||
|
||||
; Other common parameters
|
||||
|
|
|
@ -19,20 +19,19 @@
|
|||
"email": "antoine@miaou.org"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.2.4"
|
||||
"yunohost": ">= 4.3.0"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
"nginx",
|
||||
"php7.3-fpm",
|
||||
"php7.4-fpm",
|
||||
"mysql"
|
||||
],
|
||||
"arguments": {
|
||||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"example": "example.com"
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
YNH_PHP_VERSION="7.3"
|
||||
YNH_PHP_VERSION="7.4"
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
|
|
|
@ -79,6 +79,14 @@ chmod 750 "$final_path"
|
|||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -88,12 +96,14 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
|||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
# ADD A CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config
|
||||
ynh_add_config --template="../conf/config.php" --destination="$final_path/conf/config.php"
|
||||
|
||||
chmod 400 "$final_path/conf/config.php"
|
||||
chown $app:$app "$final_path/conf/config.php"
|
||||
|
||||
#=================================================
|
||||
# SETUP APPLICATION WITH CURL
|
||||
|
@ -107,10 +117,6 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# Installation with curl
|
||||
ynh_script_progression --message="Finalizing installation..." --weight=1
|
||||
|
||||
ynh_replace_string --match_string="votre_nom_de_bdd" --replace_string=$db_name --target_file="$final_path/conf/config.php"
|
||||
ynh_replace_string --match_string="votre_utilisateur_de_bdd" --replace_string=$db_user --target_file="$final_path/conf/config.php"
|
||||
ynh_replace_string --match_string="votre_mdp_de_bdd" --replace_string=$db_pwd --target_file="$final_path/conf/config.php"
|
||||
|
||||
ynh_local_curl "/install.php"
|
||||
|
||||
# Supprimer install.php
|
||||
|
@ -122,9 +128,11 @@ ynh_secure_remove --file=$final_path/install.php
|
|||
ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||
|
||||
# Make app public if necessary
|
||||
if [ $is_public -eq 0 ]
|
||||
if [ $is_public -eq 1 ]
|
||||
then
|
||||
ynh_permission_update --permission="main" --remove="visitors"
|
||||
# Everyone can access the app.
|
||||
# The "main" permission is automatically created before the install script.
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -23,17 +23,6 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
#=================================================
|
||||
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
||||
#=================================================
|
||||
|
||||
# Remove the service from the list of services known by Yunohost (added from `yunohost service add`)
|
||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||
then
|
||||
ynh_script_progression --message="Removing $app service..." --weight=1
|
||||
#yunohost service remove $app
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
@ -66,14 +55,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1
|
|||
# Remove the dedicated php-fpm config
|
||||
ynh_remove_fpm_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
|
||||
|
||||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
|
@ -40,19 +40,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
|
@ -75,9 +67,17 @@ chown -R $app:www-data "$final_path"
|
|||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
|
|
@ -77,21 +77,13 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
ynh_setup_source --dest_dir="$final_path" --keep="conf/config.php"
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -100,19 +92,20 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
|
|||
# Create a dedicated php-fpm config
|
||||
ynh_add_fpm_config
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
|
||||
# Supprimer install.php
|
||||
ynh_secure_remove --file="$final_path/install.php"
|
||||
# Restaurer config.php
|
||||
# ynh_restore_file $final_path/conf/config.php # pas autorisé dans upgrade
|
||||
|
||||
# autre piste
|
||||
ynh_replace_string --match_string="votre_nom_de_bdd" --replace_string=$db_name --target_file="$final_path/conf/config.php"
|
||||
ynh_replace_string --match_string="votre_utilisateur_de_bdd" --replace_string=$db_user --target_file="$final_path/conf/config.php"
|
||||
ynh_replace_string --match_string="votre_mdp_de_bdd" --replace_string=$db_pwd --target_file="$final_path/conf/config.php"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
Loading…
Reference in a new issue