diff --git a/README.md b/README.md index 9f65e3b..1f139fa 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Pepettes for YunoHost -[![Integration level](https://dash.yunohost.org/integration/pepettes.svg)](https://dash.yunohost.org/appci/app/pepettes) ![](https://ci-apps.yunohost.org/ci/badges/pepettes.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pepettes.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/pepettes.svg)](https://dash.yunohost.org/appci/app/pepettes) ![Working status](https://ci-apps.yunohost.org/ci/badges/pepettes.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/pepettes.maintain.svg) [![Install Pepettes with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pepettes) *[Lire ce readme en français.](./README_fr.md)* @@ -17,30 +17,30 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in A simple donation form with stripe -**Shipped version:** 1.0.1~ynh2 +**Shipped version:** 1.0.1~ynh3 **Demo:** https://donate.yunohost.org - ## Disclaimers / important information This app may be configured through the `settings.py` after installation. ## Documentation and resources -* Official admin documentation: https://github.com/YunoHost/pepettes/blob/main/README.md -* Upstream app code repository: https://github.com/YunoHost/pepettes/ -* YunoHost documentation for this app: https://yunohost.org/app_pepettes -* Report a bug: https://github.com/YunoHost-Apps/pepettes_ynh/issues +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/pepettes_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/pepettes_ynh/tree/testing --debug or sudo yunohost app upgrade pepettes -u https://github.com/YunoHost-Apps/pepettes_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index fef229a..2f14d75 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # Pepettes pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/pepettes.svg)](https://dash.yunohost.org/appci/app/pepettes) ![](https://ci-apps.yunohost.org/ci/badges/pepettes.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pepettes.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/pepettes.svg)](https://dash.yunohost.org/appci/app/pepettes) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/pepettes.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/pepettes.maintain.svg) [![Installer Pepettes avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pepettes) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer Pepettes 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.* @@ -13,30 +17,30 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Un simple formulaire de don avec stripe -**Version incluse :** 1.0.1~ynh2 +**Version incluse :** 1.0.1~ynh3 **Démo :** https://donate.yunohost.org - ## Avertissements / informations importantes This app may be configured through the `settings.py` after installation. ## Documentations et ressources -* Documentation officielle de l'admin : https://github.com/YunoHost/pepettes/blob/main/README.md -* Dépôt de code officiel de l'app : https://github.com/YunoHost/pepettes/ -* Documentation YunoHost pour cette app : https://yunohost.org/app_pepettes -* Signaler un bug : https://github.com/YunoHost-Apps/pepettes_ynh/issues +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/pepettes_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/pepettes_ynh/tree/testing --debug ou sudo yunohost app upgrade pepettes -u https://github.com/YunoHost-Apps/pepettes_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** diff --git a/manifest.json b/manifest.json index 7130ec5..c5a5dd2 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A simple donation form with stripe", "fr": "Un simple formulaire de don avec stripe" }, - "version": "1.0.1~ynh2", + "version": "1.0.1~ynh3", "url": "https://github.com/YunoHost/pepettes/", "upstream": { "license": "MIT", diff --git a/scripts/change_url b/scripts/change_url index cf801f6..e49ddfb 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,10 +29,17 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +project_name=$(ynh_app_setting_get --app=$app --key=project_name) +contact_url=$(ynh_app_setting_get --app=$app --key=contact_url) +logo=$(ynh_app_setting_get --app=$app --key=logo) +favicon=$(ynh_app_setting_get --app=$app --key=favicon) +publishable_key=$(ynh_app_setting_get --app=$app --key=publishable_key) +secret_key=$(ynh_app_setting_get --app=$app --key=secret_key) +prices=$(ynh_app_setting_get --app=$app --key=prices) +secret=$(ynh_app_setting_get --app=$app --key=secret) +csrf_key=$(ynh_app_setting_get --app=$app --key=csrf_key) +port=$(ynh_app_setting_get --app=$app --key=port) +domain=$new_domain #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -108,8 +115,25 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -# ... +# UPDATE A CONFIG FILE #================================================= +ynh_script_progression --message="Updating a configuration file..." + +ynh_add_config --template="../conf/gunicorn.py" --destination="$final_path/gunicorn.py" +ynh_add_config --template="../conf/settings.py" --destination="$final_path/settings.py" + +for price in $(echo $prices | sed "s/,/ /"); do + frequency=$(echo $price | cut -d/ -f1) + currency=$(echo $price | cut -d/ -f2) + price_id=$(echo $price | cut -d/ -f3) + echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$final_path/settings.py" +done + +ynh_store_file_checksum --file="$final_path/settings.py" + +# Set permissions to app files +chown -R $app:www-data $final_path +chmod o=--- $final_path #================================================= # GENERIC FINALISATION