From c24da0da3a53a2f99ae02c3fb3ae964457abdad3 Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:08:33 +0100 Subject: [PATCH 01/20] Update manifest.json --- manifest.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index ed7b85d..53cb7c7 100644 --- a/manifest.json +++ b/manifest.json @@ -32,8 +32,12 @@ { "name": "path", "type": "path", - "example": "/example", - "default": "/example" + "help": { + "en": "Choose the internal path for this app (We recommand to set it to the internal path of a Custom Webapp) (The final path will be: path + icecoder).", + "fr": "Choisissez le chemin interne de cette application (nous vous recommandons de le définir sur le chemin interne d'une Custom Webapp) (Le chemin final sera : chemin + icecoder)." + }, + "example": "/var/www/my_webapp", + "default": "/var/www/my_webapp" }, { "name": "is_public", From 5b40702ebc8653a0caea8cb14319c4eba19d77df Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:12:01 +0100 Subject: [PATCH 02/20] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 854f07f..6d156f8 100755 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url=$YNH_APP_ARG_PATH/icecoder is_public=$YNH_APP_ARG_IS_PUBLIC ### If it's a multi-instance app, meaning it can be installed several times independently @@ -51,7 +51,7 @@ ynh_script_progression --message="Validating installation parameters..." --weigh ### If the app uses NGINX as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app provides an internal web server (or uses another application server such as uWSGI), the final path should be "/opt/yunohost/$app" -final_path=/var/www/$app/icecoder +final_path=$path_url test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path From 9c41111eb90117b799d5fc12dae49d8b72cfd548 Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:17:58 +0100 Subject: [PATCH 03/20] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 53cb7c7..4fd1079 100644 --- a/manifest.json +++ b/manifest.json @@ -36,8 +36,8 @@ "en": "Choose the internal path for this app (We recommand to set it to the internal path of a Custom Webapp) (The final path will be: path + icecoder).", "fr": "Choisissez le chemin interne de cette application (nous vous recommandons de le définir sur le chemin interne d'une Custom Webapp) (Le chemin final sera : chemin + icecoder)." }, - "example": "/var/www/my_webapp", - "default": "/var/www/my_webapp" + "example": "/var/www/my_webapp/www", + "default": "/var/www/my_webapp/www" }, { "name": "is_public", From 91adc59fcb9f7b167ac57f4308d3d60e9bd6fce2 Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:30:54 +0100 Subject: [PATCH 04/20] Update install --- scripts/install | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/scripts/install b/scripts/install index 6d156f8..7ebde92 100755 --- a/scripts/install +++ b/scripts/install @@ -110,20 +110,20 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 ### `ynh_add_nginx_config` will use the file conf/nginx.conf # Create a dedicated NGINX config -ynh_add_nginx_config +#ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app +#ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 +#ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 ### `ynh_add_fpm_config` is used to set up a PHP config. ### You can remove it if your app doesn't use PHP. @@ -137,7 +137,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 ### - And the section "PHP-FPM CONFIGURATION" in the upgrade script # Create a dedicated PHP-FPM config -ynh_add_fpm_config +#ynh_add_fpm_config #================================================= # SPECIFIC SETUP @@ -148,7 +148,7 @@ ynh_add_fpm_config #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +#ynh_script_progression --message="Configuring a systemd service..." --weight=1 ### `ynh_systemd_config` is used to configure a systemd script for an app. ### It can be used for apps that use sysvinit (with adaptation) or systemd. @@ -162,28 +162,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 - -#================================================= -# SETUP APPLICATION WITH CURL -#================================================= - -### Use these lines only if the app installation needs to be finalized through -### web forms. We generally don't want to ask the final user, -### so we're going to use curl to automatically fill the fields and submit the -### forms. - -# Set the app as temporarily public for curl call -ynh_script_progression --message="Configuring SSOwat..." --weight=1 -# Making the app public for curl -ynh_permission_update --permission="main" --add="visitors" - -# Installation with curl -ynh_script_progression --message="Finalizing installation..." --weight=1 -ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" - -# Remove the public access -ynh_permission_update --permission="main" --remove="visitors" +#ynh_add_systemd_config #================================================= # ADD A CONFIGURATION @@ -263,14 +242,14 @@ ynh_permission_update --permission="main" --add="visitors" ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" # Configure internal permissions for ICEcoder -chown -R $app $final_path +sudo chown -R www-data.www-data $final_path #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From 8ab2c40bb341611fed926ac2601e1de6577450f7 Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:32:42 +0100 Subject: [PATCH 05/20] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 7ebde92..8fbbad9 100755 --- a/scripts/install +++ b/scripts/install @@ -242,7 +242,7 @@ ynh_permission_update --permission="main" --add="visitors" ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" # Configure internal permissions for ICEcoder -sudo chown -R www-data.www-data $final_path +chown -R www-data.www-data $final_path #================================================= # RELOAD NGINX From 6ade98cfd81431c48f8fe5436c213e3e58426bfb Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:37:16 +0100 Subject: [PATCH 06/20] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 8fbbad9..e3c5ffc 100755 --- a/scripts/install +++ b/scripts/install @@ -242,7 +242,7 @@ ynh_permission_update --permission="main" --add="visitors" ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" # Configure internal permissions for ICEcoder -chown -R www-data.www-data $final_path +chown -R www-data.www-data $YNH_APP_ARG_PATH #================================================= # RELOAD NGINX From 9da4ae4af4bfed4d93d441469e1d002edb720e99 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Mar 2021 18:41:10 +0100 Subject: [PATCH 07/20] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d49c581..52dc8c5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ICEcoder +# ICEcoder for YunoHost [![Integration level](https://dash.yunohost.org/integration/icecoder.svg)](https://dash.yunohost.org/appci/app/icecoder) ![](https://ci-apps.yunohost.org/ci/badges/icecoder.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/icecoder.maintain.svg) [![Install ICEcoder with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=icecoder) @@ -30,8 +30,8 @@ How to configure this app: From ICEcoder options screen. #### Multi-user support -Are LDAP and HTTP auth supported? No. -Can the app be used by multiple users? Yes (It is internal to the app). + * Are LDAP and HTTP auth supported? No. + * Can the app be used by multiple users? Yes (It is internal to the app). #### Supported architectures @@ -58,7 +58,6 @@ Can the app be used by multiple users? Yes (It is internal to the app). ## Developer info -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/icecoder_ynh/tree/testing). To try the testing branch, please proceed like that. From 86e85b2243506106e33274e2337e4d84c341609a Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:44:28 +0100 Subject: [PATCH 08/20] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index e3c5ffc..9811d62 100755 --- a/scripts/install +++ b/scripts/install @@ -230,7 +230,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 # Everyone can access the app. # The "main" permission is automatically created before the install script. -ynh_permission_update --permission="main" --add="visitors" +#ynh_permission_update --permission="main" --add="visitors" ### N.B. : the following extra permissions only make sense if your app ### does have for example an admin interface or an api. @@ -239,10 +239,10 @@ ynh_permission_update --permission="main" --add="visitors" # Everyone can access to the api part # We don't want to display the tile in the sso so we put --show_tile="false" # And we don't want that the YunoHost Admin can remove visitors group to this permission, so we put --protected="true" -ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" +#ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" # Configure internal permissions for ICEcoder -chown -R www-data.www-data $YNH_APP_ARG_PATH +chown -R www-data.www-data $final_path #================================================= # RELOAD NGINX From 21d7053a24a5b4b2967b817e70b65212683aed43 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Mar 2021 18:44:29 +0100 Subject: [PATCH 09/20] Update README_fr.md --- README_fr.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README_fr.md b/README_fr.md index 8750911..5825e27 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,4 +1,4 @@ -# ICEcoder +# ICEcoder pour YunoHost [![Niveau d'intégration](https://dash.yunohost.org/integration/icecoder.svg)](https://dash.yunohost.org/appci/app/icecoder) ![](https://ci-apps.yunohost.org/ci/badges/icecoder.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/icecoder.maintain.svg) [![Installer ICEcoder avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=icecoder) @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Vue d'ensemble Un éditeur de code dans votre navigateur. -**Version incluse:** last version +**Version incluse :** 8.0 ## Démo @@ -58,7 +58,6 @@ Comment configurer cette app: Depuis l'écran des options d'ICEcoder ## Informations pour les développeurs -**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. From 86241040647485bd74d417cfdfc87dd40aa7eaf6 Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:49:11 +0100 Subject: [PATCH 10/20] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9811d62..42faf9d 100755 --- a/scripts/install +++ b/scripts/install @@ -242,7 +242,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 #ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" # Configure internal permissions for ICEcoder -chown -R www-data.www-data $final_path +chown -R my_webapp $final_path #================================================= # RELOAD NGINX From d2857e9af3ce55e55113533484c4a8e678bdadbf Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:53:56 +0100 Subject: [PATCH 11/20] Update README_fr.md --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 5825e27..a4db942 100644 --- a/README_fr.md +++ b/README_fr.md @@ -58,7 +58,7 @@ Comment configurer cette app: Depuis l'écran des options d'ICEcoder ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing). +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/icecoder_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. ``` From 80220c6cad1f8644a420b2dd42b04c2c62d5cc5e Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:56:49 +0100 Subject: [PATCH 12/20] Update install --- scripts/install | 119 ------------------------------------------------ 1 file changed, 119 deletions(-) diff --git a/scripts/install b/scripts/install index 42faf9d..f9bc871 100755 --- a/scripts/install +++ b/scripts/install @@ -85,10 +85,6 @@ ynh_app_setting_set --app=$app --key=port --value=$port # (N.B.: you only need to do this if the app actually needs to expose the port publicly. # If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) -# Open the port -# ynh_script_progression --message="Configuring firewall..." --time --weight=1 -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -102,93 +98,6 @@ 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" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - -### `ynh_add_nginx_config` will use the file conf/nginx.conf - -# 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 - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -#ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 - -### `ynh_add_fpm_config` is used to set up a PHP config. -### You can remove it if your app doesn't use PHP. -### `ynh_add_fpm_config` will use the files conf/php-fpm.conf -### If you're not using these lines: -### - You can remove these files in conf/. -### - Remove the section "BACKUP THE PHP-FPM CONFIGURATION" in the backup script -### - Remove also the section "REMOVE PHP-FPM CONFIGURATION" in the remove script -### - As well as the section "RESTORE THE PHP-FPM CONFIGURATION" in the restore script -### with the reload at the end of the script. -### - And the section "PHP-FPM CONFIGURATION" in the upgrade script - -# Create a dedicated PHP-FPM config -#ynh_add_fpm_config - -#================================================= -# SPECIFIC SETUP -#================================================= -# ... -#================================================= - -#================================================= -# SETUP SYSTEMD -#================================================= -#ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -### `ynh_systemd_config` is used to configure a systemd script for an app. -### It can be used for apps that use sysvinit (with adaptation) or systemd. -### Have a look at the app to be sure this app needs a systemd script. -### `ynh_systemd_config` will use the file conf/systemd.service -### If you're not using these lines: -### - You can remove those files in conf/. -### - Remove the section "BACKUP SYSTEMD" in the backup script -### - Remove also the section "STOP AND REMOVE SERVICE" in the remove script -### - As well as the section "RESTORE SYSTEMD" in the restore script -### - And the section "SETUP SYSTEMD" in the upgrade script - -# Create a dedicated systemd config -#ynh_add_systemd_config - -#================================================= -# ADD A CONFIGURATION -#================================================= - -### You can add specific configuration files. -### -### Typically, put your template conf file in ../conf/your_config_file -### The template may contain strings such as __FOO__ or __FOO_BAR__, -### which will automatically be replaced by the values of $foo and $foo_bar -### -### ynh_add_config will also keep track of the config file's checksum, -### which later during upgrade may allow to automatically backup the config file -### if it's found that the file was manually modified -### -### Check the documentation of `ynh_add_config` for more info. - -#ynh_add_config --template="some_config_file" --destination="$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" - #================================================= # GENERIC FINALIZATION #================================================= @@ -215,42 +124,14 @@ ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) ynh_use_logrotate -#================================================= -# SETUP FAIL2BAN -#================================================= -#ynh_script_progression --message="Configuring 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" - #================================================= # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring permissions..." --weight=1 -# Everyone can access the app. -# The "main" permission is automatically created before the install script. -#ynh_permission_update --permission="main" --add="visitors" - -### N.B. : the following extra permissions only make sense if your app -### does have for example an admin interface or an api. - - -# Everyone can access to the api part -# We don't want to display the tile in the sso so we put --show_tile="false" -# And we don't want that the YunoHost Admin can remove visitors group to this permission, so we put --protected="true" -#ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true" - # Configure internal permissions for ICEcoder chown -R my_webapp $final_path -#================================================= -# RELOAD NGINX -#================================================= -#ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From 3690e3fe62543c6492060e68e6cc5c67c8e62bbd Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 18:58:58 +0100 Subject: [PATCH 13/20] Update upgrade --- scripts/upgrade | 65 ------------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index eee92e2..a079094 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,10 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -language=$(ynh_app_setting_get --app=$app --key=language) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= # CHECK VERSION @@ -92,15 +89,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -113,48 +101,6 @@ then ynh_setup_source --dest_dir="$final_path" fi -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# 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 - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config - -#================================================= -# UPDATE A CONFIG FILE -#================================================= - -### 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" - -### 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" - #================================================= # GENERIC FINALIZATION #================================================= @@ -170,23 +116,12 @@ ynh_script_progression --message="Upgrading logrotate configuration..." --weight # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# 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" # Configure internal permissions for ICEcoder chown -R $app $final_path -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From b5e94e6bdcb7510de708b014d7fa28ec42ae54af Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:00:35 +0100 Subject: [PATCH 14/20] Update restore --- scripts/restore | 45 +-------------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/scripts/restore b/scripts/restore index 464b67a..311e2c9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -27,8 +27,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) #================================================= @@ -56,43 +54,12 @@ 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 - #================================================= # RESTORE USER RIGHTS #================================================= # Configure internal permissions for ICEcoder -chown -R www-data.www-data $final_path - -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -#================================================= -# RESTORE FAIL2BAN CONFIGURATION -#================================================= -#ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=1 - -#ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" -#ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" -#ynh_systemd_action --action=restart --service_name=fail2ban - -#================================================= -# RESTORE VARIOUS FILES -#================================================= - -ynh_restore_file --origin_path="/etc/cron.d/$app" - -ynh_restore_file --origin_path="/etc/$app/" +chown -R my_webapp $final_path #================================================= # RESTORE THE LOGROTATE CONFIGURATION @@ -100,16 +67,6 @@ ynh_restore_file --origin_path="/etc/$app/" ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 - -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From cb629b772697cf0f55db38934aabea2b328f4acd Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:01:34 +0100 Subject: [PATCH 15/20] Update remove --- scripts/remove | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/scripts/remove b/scripts/remove index b5d8951..97ad898 100755 --- a/scripts/remove +++ b/scripts/remove @@ -18,8 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -30,22 +28,6 @@ ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - -# Remove the dedicated NGINX config -ynh_remove_nginx_config - -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 - -# Remove the dedicated PHP-FPM config -ynh_remove_fpm_config - #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= @@ -64,39 +46,9 @@ then ynh_exec_warn_less yunohost firewall disallow TCP $port fi -#================================================= -# REMOVE FAIL2BAN CONFIGURATION -#================================================= -#ynh_script_progression --message="Removing Fail2ban configuration..." --time --weight=1 - -# Remove the dedicated Fail2Ban config -#ynh_remove_fail2ban_config - -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= - -# Remove a cron file -ynh_secure_remove --file="/etc/cron.d/$app" - -# Remove a directory securely -ynh_secure_remove --file="/etc/$app/" - # Remove the log files ynh_secure_remove --file="/var/log/$app/" -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= From 31d3056506e83235b4c65a41198a07e4a83a03db Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:02:35 +0100 Subject: [PATCH 16/20] Update change_url --- scripts/change_url | 54 ---------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 17802c4..0ee944a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -67,66 +67,12 @@ then change_path=1 fi -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" - -#================================================= -# MODIFY URL IN NGINX CONF -#================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 - -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi - #================================================= # SPECIFIC MODIFICATIONS #================================================= # ... #================================================= -#================================================= -# GENERIC FINALISATION -#================================================= -# START SYSTEMD SERVICE -#================================================= -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" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From 61ba54f53e1e00f6a6a3d46cd6a267d89eb1ebfb Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:03:24 +0100 Subject: [PATCH 17/20] Update change_url --- scripts/change_url | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 0ee944a..e55387a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -70,7 +70,7 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -# ... +# TODO: really automatize permissiosn system #================================================= #================================================= From e9051c2673dcbdda28278e63dae57f1e459fbe78 Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:04:03 +0100 Subject: [PATCH 18/20] Update backup --- scripts/backup | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/scripts/backup b/scripts/backup index ca62222..567b188 100755 --- a/scripts/backup +++ b/scripts/backup @@ -26,7 +26,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) #================================================= @@ -45,31 +44,6 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" -#================================================= -# 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" - -#================================================= -# BACKUP SYSTEMD -#================================================= - -ynh_backup --src_path="/etc/systemd/system/$app.service" - #================================================= # SPECIFIC BACKUP #================================================= @@ -78,14 +52,6 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/logrotate.d/$app" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="/etc/cron.d/$app" - -ynh_backup --src_path="/etc/$app/" - #================================================= # END OF SCRIPT #================================================= From f9b2182fd78a2a98987d2a081da7dca0cda3c069 Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:06:40 +0100 Subject: [PATCH 19/20] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 52dc8c5..3146515 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ How to configure this app: From ICEcoder options screen. * You will need to set youself the path to the website who you want edit. * You will need to configure others things like password **directly** in the app. +* If you change the URL of this app, you don't change the real URL but the internal path (the process is the same as installation). ## Links From 29970e067eda761170bf79870eba31713ccdc69a Mon Sep 17 00:00:00 2001 From: Stylix58 <63605602+Stylix58@users.noreply.github.com> Date: Sat, 20 Mar 2021 19:07:07 +0100 Subject: [PATCH 20/20] Update README_fr.md --- README_fr.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README_fr.md b/README_fr.md index a4db942..75ddc79 100644 --- a/README_fr.md +++ b/README_fr.md @@ -46,6 +46,7 @@ Comment configurer cette app: Depuis l'écran des options d'ICEcoder * Vous devrez définir vous-même le chemin vers le site web que vous voulez éditer. * Vous devrez configurer d'autres éléments comme le mot de passe **directement** dans l'application. +* Si vous changez l'URL de cette application, vous ne changez pas l'URL réelle mais le chemin interne (le processus est le même que pour l'installation). ## Liens