diff --git a/README.md b/README.md index 5bd8682..9736192 100644 --- a/README.md +++ b/README.md @@ -1,85 +1,48 @@ -# Packaging an app, starting from this example - -* Copy this app before working on it, using the ['Use this template'](https://github.com/YunoHost/example_ynh/generate) button on the Github repo. -* Edit the `manifest.json` with app specific info. -* Edit the `install`, `upgrade`, `remove`, `backup` and `restore` scripts, and any relevant conf files in `conf/`. - * Using the [script helpers documentation.](https://yunohost.org/packaging_apps_helpers) -* Edit the `change_url` and `config` scripts too, or remove them if you have no use of them -* Add a `LICENSE` file for the package. NB: this LICENSE file is not meant to necessarily be the LICENSE of the upstream app - it is only the LICENSE you want this package's code to published with ;). We recommend to use [the AGPL-3](https://www.gnu.org/licenses/agpl-3.0.txt). -* Edit `doc/DISCLAIMER*.md` -* The `README.md` files are to be automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator - ---- -# Example app for YunoHost +# 13ft for YunoHost -[![Integration level](https://dash.yunohost.org/integration/example.svg)](https://dash.yunohost.org/appci/app/example) ![Working status](https://ci-apps.yunohost.org/ci/badges/example.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/example.maintain.svg) -[![Install Example app with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=example) +[![Integration level](https://dash.yunohost.org/integration/13ft.svg)](https://dash.yunohost.org/appci/app/13ft) ![Working status](https://ci-apps.yunohost.org/ci/badges/13ft.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/13ft.maintain.svg) +[![Install 13ft with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=13ft) *[Lire ce readme en français.](./README_fr.md)* -> *This package allows you to install Example app quickly and simply on a YunoHost server. +> *This package allows you to install 13ft 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 -Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +13ft is an [12ft ladder](https://12ft.io) selfhosted alternative that allows you to bypass some paywalls and read the article content anyway. +https://github.com/wasi-master/13ft ### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." +- Provide *some* web articles that are normally protected by paywalls. -**Shipped version:** 1.0~ynh1 - -**Demo:** https://demo.example.com - -## Screenshots - -![Screenshot of Example app](./doc/screenshots/example.jpg) - +**Shipped version:** 0.1.1~ynh2 ## Disclaimers / important information -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * requiring a full dedicated domain ? - * architectures not supported ? - * not-working single-sign on or LDAP integration ? - * the app requires an important amount of RAM / disk / .. to install or to work properly - * etc... -* Other infos that people should be aware of, such as: - * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) - * how to configure / administrate the application if it ain't obvious - * upgrade process / specificities / things to be aware of ? - * security considerations ? ## Documentation and resources -* Official app website: -* Official user documentation: -* Official admin documentation: -* Upstream app code repository: -* YunoHost documentation for this app: -* Report a bug: +* Official app website: +* YunoHost documentation for this app: +* Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/example_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/13ft_ynh/tree/testing). To try the testing branch, please proceed like that. ``` bash -sudo yunohost app install https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/13ft_ynh/tree/testing --debug or -sudo yunohost app upgrade example -u https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +sudo yunohost app upgrade 13ft -u https://github.com/YunoHost-Apps/13ft_ynh/tree/testing --debug ``` **More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 4da6fb7..852331c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -3,71 +3,46 @@ N.B.: This README was automatically generated by https://github.com/YunoHost/app It shall NOT be edited by hand. --> -# Exemple d'app pour YunoHost +# 13ft pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/example.svg)](https://dash.yunohost.org/appci/app/example) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/example.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/example.maintain.svg) -[![Installer Example app avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=example) +[![Niveau d'intégration](https://dash.yunohost.org/integration/13ft.svg)](https://dash.yunohost.org/appci/app/13ft) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/13ft.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/13ft.maintain.svg) +[![Installer 13ft avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=13ft) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Example app rapidement et simplement sur un serveur YunoHost. +> *Ce package vous permet d'installer 13ft 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 -Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +13ft is an [12ft ladder](https://12ft.io) selfhosted alternative that allows you to bypass some paywalls and read the article content anyway. +https://github.com/wasi-master/13ft ### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." +- Provide *some* web articles that are normally protected by paywalls. -**Version incluse :** 1.0~ynh1 - -**Démo :** https://demo.example.com - -## Captures d'écran - -![Capture d'écran de Example app](./doc/screenshots/example.jpg) - +**Version incluse :** 0.1.1~ynh2 ## Avertissements / informations importantes -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * requiring a full dedicated domain ? - * architectures not supported ? - * not-working single-sign on or LDAP integration ? - * the app requires an important amount of RAM / disk / .. to install or to work properly - * etc... -* Other infos that people should be aware of, such as: - * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) - * how to configure / administrate the application if it ain't obvious - * upgrade process / specificities / things to be aware of ? - * security considerations ? ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle utilisateur : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : -* Documentation YunoHost pour cette app : -* Signaler un bug : +* Site 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/example_ynh/tree/testing). +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/13ft_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. ``` bash -sudo yunohost app install https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +sudo yunohost app install https://github.com/YunoHost-Apps/13ft_ynh/tree/testing --debug ou -sudo yunohost app upgrade example -u https://github.com/YunoHost-Apps/example_ynh/tree/testing --debug +sudo yunohost app upgrade 13ft -u https://github.com/YunoHost-Apps/13ft_ynh/tree/testing --debug ``` **Plus d'infos sur le packaging d'applications :** diff --git a/conf/app.src b/conf/app.src index 783b43f..ff8c567 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,7 +1,5 @@ -SOURCE_URL=https://github.com/wasi-master/13ft/releases/download/v0.1.1/portable.py -SOURCE_SUM=7efb48e5a2fe4a68c66619d7d6275d53cfeac1b4ff19079369e182bcabd82eb4 +SOURCE_URL=https://github.com/wasi-master/13ft/archive/refs/tags/v0.1.1.tar.gz +SOURCE_SUM=166685beb4aa1f924ef9d1b52d478702858b478a9e02cf49c1dab28e79d03601 SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT= -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= SOURCE_EXTRACT=true +SOURCE_IN_SUBDIR=true diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 0685205..9c97e54 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,9 +1,5 @@ -Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +13ft is an [12ft ladder](https://12ft.io) selfhosted alternative that allows you to bypass some paywalls and read the article content anyway. +https://github.com/wasi-master/13ft ### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." +- Provide *some* web articles that are normally protected by paywalls. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index aded581..8b13789 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,12 +1 @@ -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * requiring a full dedicated domain ? - * architectures not supported ? - * not-working single-sign on or LDAP integration ? - * the app requires an important amount of RAM / disk / .. to install or to work properly - * etc... -* Other infos that people should be aware of, such as: - * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) - * how to configure / administrate the application if it ain't obvious - * upgrade process / specificities / things to be aware of ? - * security considerations ? diff --git a/doc/screenshots/.gitkeep b/doc/screenshots/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/doc/screenshots/example.jpg b/doc/screenshots/example.jpg deleted file mode 100644 index a1efa1a..0000000 Binary files a/doc/screenshots/example.jpg and /dev/null differ diff --git a/manifest.json b/manifest.json index 889bdbd..3dcdb4d 100644 --- a/manifest.json +++ b/manifest.json @@ -3,18 +3,18 @@ "id": "13ft", "packaging_format": 1, "description": { - "en": "Selfhosted 12ft equivalent : bypass paywall by acting as GoogleBot", - "fr": "Un équivalent de 12ft autohébergé : contourner les paywall en vous faisant passer pour GoogleBot" + "en": "Selfhosted 12ft equivalent - bypass paywall by acting as GoogleBot", + "fr": "Un équivalent de 12ft autohébergé - contourner les paywall en vous faisant passer pour GoogleBot" }, - "version": "0.1.1~ynh1", + "version": "0.1.1~ynh2", "url": "https://github.com/wasi-master/13ft", "upstream": { "license": "MIT", - "website": "https://github.com/wasi-master/13ft", + "website": "https://github.com/wasi-master/13ft" }, - "license": "free", + "license": "AGPL-3", "maintainer": { - "name": "Lapineige", + "name": "Lapineige" }, "requirements": { "yunohost": ">= 11.0.0" @@ -39,7 +39,6 @@ "name": "is_public", "type": "boolean", "default": true - }, } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 9763934..3dc22d9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,7 @@ # COMMON VARIABLES # dependencies used by the app (must be on a single line) -#pkg_dependencies="deb1 deb2 $php_dependencies" -# How to install python flask ? +pkg_dependencies="python3-venv" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index f99225d..0b037b0 100755 --- a/scripts/backup +++ b/scripts/backup @@ -30,9 +30,6 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -50,63 +47,20 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" -#================================================= -# BACKUP THE DATA DIR -#================================================= - -ynh_backup --src_path="$datadir" --is_big - #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -#================================================= -# BACKUP FAIL2BAN CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" - #================================================= # SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - -ynh_backup --src_path="/etc/logrotate.d/$app" - #================================================= # BACKUP SYSTEMD #================================================= ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="/etc/cron.d/$app" - -ynh_backup --src_path="/etc/$app/" - -#================================================= -# BACKUP THE MYSQL DATABASE -#================================================= -ynh_print_info --message="Backing up the MySQL database..." - -### (However, things like MySQL dumps *do* take some time to run, though the -### copy of the generated dump to the archive still happens later) - -ynh_mysql_dump_db --database="$db_name" > db.sql - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index e90d8c6..8335f22 100755 --- a/scripts/install +++ b/scripts/install @@ -68,7 +68,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # STANDARD MODIFICATIONS @@ -94,26 +93,6 @@ ynh_script_progression --message="Finding an available port..." --weight=1 # ynh_script_progression --message="Configuring firewall..." --weight=1 # ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing python dependencies..." --weight=1 - -### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package. -### Those deb packages will be installed as dependencies of this package. -### If you're not using this helper: -### - Remove the section "REMOVE DEPENDENCIES" in the remove script -### - Remove the variable "pkg_dependencies" in _common.sh -### - As well as the section "REINSTALL DEPENDENCIES" in the restore script -### - And the section "UPGRADE DEPENDENCIES" in the upgrade script - -# ynh_install_app_dependencies $pkg_dependencies - -pushd $final_path - python3 -m venv venv - venv/bin/pip install --upgrade pip - venv/bin/pip install -r requirements.txt # should only be flask for now, but just in case - #================================================= # CREATE DEDICATED USER #================================================= @@ -145,6 +124,25 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# INSTALL APT DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing apt dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + +#================================================= +# INSTALL PYTHON DEPENDENCIES +#================================================= + +ynh_script_progression --message="Installing python dependencies..." --weight=1 + +pushd $final_path + python3 -m venv venv + venv/bin/pip install --upgrade pip + venv/bin/pip install -r requirements.txt # should only be flask for now, but just in case +popd + #================================================= # NGINX CONFIGURATION #================================================= @@ -179,7 +177,7 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 ### - And the section "SETUP SYSTEMD" in the upgrade script # Create a dedicated systemd config -# ynh_add_systemd_config +ynh_add_systemd_config #================================================= diff --git a/scripts/remove b/scripts/remove index 4716407..29a6535 100755 --- a/scripts/remove +++ b/scripts/remove @@ -60,10 +60,14 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 +ynh_script_progression --message="Removing apt dependencies..." --weight=1 # Remove metapackage and its dependencies -venv/bin/pip uninstall flask +ynh_remove_app_dependencies + +# ynh_script_progression --message="Removing python dependencies..." --weight=1 +# Remove metapackage and its dependencies +# venv/bin/pip uninstall flask # useless, managed by previous helper ? #================================================= diff --git a/scripts/restore b/scripts/restore index 1be949b..4d3ea70 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,10 +31,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -71,50 +67,26 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Restoring the data directory..." --weight=1 - -ynh_restore_file --origin_path="$datadir" --not_mandatory - -mkdir -p $datadir - -# FIXME: this should be managed by the core in the future -# Here, as a packager, you may have to tweak the ownerhsip/permissions -# such that the appropriate users (e.g. maybe www-data) can access -# files in some cases. -# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - -# this will be treated as a security issue. -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - -#================================================= -# RESTORE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" -ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" -ynh_systemd_action --action=restart --service_name=fail2ban - #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +ynh_script_progression --message="Reinstalling apt dependencies..." --weight=1 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies #================================================= -# RESTORE THE PHP-FPM CONFIGURATION +# INSTALL PYTHON DEPENDENCIES #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --time --weight=1 +ynh_script_progression --message="Reinstalling Python dependencies..." --weight=1 -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +pushd $final_path + python3 -m venv venv + venv/bin/pip install --upgrade pip + venv/bin/pip install -r requirements.txt # should only be flask for now, but just in case +popd #================================================= # RESTORE THE NGINX CONFIGURATION @@ -123,24 +95,6 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=1 - -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - -#================================================= -# RESTORE VARIOUS FILES -#================================================= -ynh_script_progression --message="Restoring various files..." --weight=1 - -ynh_restore_file --origin_path="/etc/cron.d/$app" - -ynh_restore_file --origin_path="/etc/$app/" - #================================================= # RESTORE SYSTEMD #================================================= @@ -149,13 +103,6 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -175,9 +122,8 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f38c139..7a46271 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,14 +138,6 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_install_app_dependencies $pkg_dependencies -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config - #================================================= # NGINX CONFIGURATION #================================================= @@ -157,33 +149,6 @@ ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE #================================================= -# ... -#================================================= - -#================================================= -# UPDATE A CONFIG FILE -#================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 - -### Same as during install -### -### The file will automatically be backed-up if it's found to be manually modified (because -### ynh_add_config keeps track of the file's checksum) - -ynh_add_config --template="some_config_file" --destination="$final_path/some_config_file" - -# FIXME: this should be handled by the core in the future -# You may need to use chmod 600 instead of 400, -# for example if the app is expected to be able to modify its own config -chmod 400 "$final_path/some_config_file" -chown $app:$app "$final_path/some_config_file" - -### For more complex cases where you want to replace stuff using regexes, -### you shoud rely on ynh_replace_string (which is basically a wrapper for sed) -### When doing so, you also need to manually call ynh_store_file_checksum -### -### ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/some_config_file" -### ynh_store_file_checksum --file="$final_path/some_config_file" #================================================= # SETUP SYSTEMD @@ -217,14 +182,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" -#================================================= -# UPGRADE FAIL2BAN -#================================================= -ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=1 - -# Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" - #================================================= # RELOAD NGINX #=================================================