diff --git a/README.md b/README.md index 140c5a2..ccc77a4 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,36 @@ -# Pepettes app for YunoHost + + +# 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) -[![Install pepettes with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pepettes) +[![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)* -> *This package allows you to install pepettes quickly and simply on a YunoHost server. +> *This package allows you to install Pepettes quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -Pepettes is a donation form based on Stripe. -**Shipped version:** 1.0 +A simple donation form with stripe -## Screenshots +**Shipped version:** 1.0.1~ynh1 -(none yet) +**Demo:** https://donate.yunohost.org -## Demo +## Disclaimers / important information -* [Official demo](https://donate.yunohost.org) +This app may be configured through the `settings.py` after installation. -## Configuration +## Documentation and resources -How to configure this app: During the installation, or in `settings.py` after installation. - -## Documentation - - * Official documentation: https://github.com/YunoHost/pepettes/blob/main/README.md - * YunoHost documentation: - - -## YunoHost specific features - -#### Multi-user support - -Are LDAP and HTTP auth supported? n/a -Can the app be used by multiple users? yes - -#### Supported architectures - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/pepettes%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/pepettes/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/pepettes%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/pepettes/) - -## Limitations - -(none) - -## Additional information - -(none) - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/pepettes_ynh/issues - * Upstream app repository: https://github.com/YunoHost/pepettes/ - * YunoHost website: https://yunohost.org/ - ---- +* 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 ## Developer info @@ -68,3 +42,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/pepettes_ynh/tree/tes 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 diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..5eb64dd --- /dev/null +++ b/README_fr.md @@ -0,0 +1,42 @@ +# 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) +[![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.* + +## Vue d'ensemble + +Un simple formulaire de don avec stripe + +**Version incluse :** 1.0.1~ynh1 + +**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 + +## 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. +``` +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 diff --git a/check_process b/check_process index 3c806e3..4da3498 100644 --- a/check_process +++ b/check_process @@ -1,8 +1,8 @@ ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + is_public=1 project_name="YunoHost" contact_url="https://forum.yunohost.org/t/donate-to-yunohost/9211" logo="https://yunohost.org/user/images/logo.png" diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..54cd697 --- /dev/null +++ b/doc/DISCLAIMER.md @@ -0,0 +1 @@ +This app may be configured through the `settings.py` after installation. diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/manifest.json b/manifest.json index 6d5d8ac..b8a8d8c 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,12 @@ }, "version": "1.0.1~ynh1", "url": "https://github.com/YunoHost/pepettes/", + "upstream": { + "license": "MIT", + "demo": "https://donate.yunohost.org", + "admindoc": "https://github.com/YunoHost/pepettes/blob/main/README.md", + "code": "https://github.com/YunoHost/pepettes/" + }, "license": "MIT", "maintainer": { "name": "ljf", @@ -15,7 +21,7 @@ "url": "http://reflexlibre.net" }, "requirements": { - "yunohost": ">= 4.1.2" + "yunohost": ">= 4.1.3" }, "multi_instance": true, "services": [ @@ -26,19 +32,11 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for pepettes", - "fr": "Choisissez un nom de domaine pour pepettes" - }, "example": "example.com" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": true }, { diff --git a/scripts/install b/scripts/install index cdcd2d7..059dcff 100755 --- a/scripts/install +++ b/scripts/install @@ -84,6 +84,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=1 + +# Create a system user +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -93,6 +101,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -101,14 +113,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # SPECIFIC SETUP #================================================= @@ -132,17 +136,9 @@ EOF popd #================================================= -# SETUP SYSTEMD +# ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Adding 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" @@ -156,6 +152,14 @@ done ynh_store_file_checksum --file="$final_path/settings.py" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." --weight=1 + +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # GENERIC FINALIZATION #================================================= @@ -172,7 +176,7 @@ chmod o=--- $final_path #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A simple donation form" --log_type="systemd" +yunohost service add $app --description="A simple donation form" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index 6f48eb9..5ac7fdd 100755 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -50,6 +50,14 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -57,13 +65,9 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # SPECIFIC RESTORATION @@ -111,7 +115,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A simple donation form" --log_type="systemd" +yunohost service add $app --description="A simple donation form" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 2428f02..91c7a70 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,11 +38,6 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -66,6 +61,14 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped" +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -78,6 +81,10 @@ then ynh_setup_source --dest_dir="$final_path" fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -93,14 +100,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # SPECIFIC UPGRADE #================================================= @@ -124,17 +123,9 @@ EOF popd #================================================= -# SETUP SYSTEMD +# UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# MODIFY A CONFIG FILE -#================================================= -ynh_script_progression --message="Modifying 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" @@ -148,6 +139,14 @@ done ynh_store_file_checksum --file="$final_path/settings.py" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 + +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # GENERIC FINALIZATION #================================================= @@ -164,7 +163,7 @@ chmod o=--- $final_path #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="A simple donation form" --log_type="systemd" +yunohost service add $app --description="A simple donation form" #================================================= # START SYSTEMD SERVICE