From 82c83df3fcbd892fa08d1773807a1f71a62935c8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 28 Jun 2021 14:07:56 +0200 Subject: [PATCH 1/8] Fix --- conf/fr.src | 7 +++++++ scripts/install | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 conf/fr.src diff --git a/conf/fr.src b/conf/fr.src new file mode 100644 index 0000000..37cdc12 --- /dev/null +++ b/conf/fr.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://github.com/qiaeru/phpbb-language-fr/archive/refs/tags/v4.4.0.zip +SOURCE_SUM=c3a655a36ca7ce97ccae927850c2b4f1e1d2734558f2e08ca94bbf05e50aaafb +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=phpbb-language-fr-4.4.0.zip +SOURCE_EXTRACT=true diff --git a/scripts/install b/scripts/install index 395554a..ea318d7 100644 --- a/scripts/install +++ b/scripts/install @@ -90,6 +90,19 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# DOWNLOAD, CHECK AND UNPACK LANGUAGE PACK +#================================================= + +tmpdir="$(mktemp -d)" + +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$tmpdir" --source_id=fr +cp -a "$tmpdir/language/fr" "$final_path/language/fr" +cp -a "$tmpdir/styles/prosilver/theme/fr" "$final_path/styles/prosilver/theme/fr" +# Remove the tmp directory securely +ynh_secure_remove --file="$tmpdir" + #================================================= # NGINX CONFIGURATION #================================================= From fefc2305a6cd07d2440becc54a435f0d5199d193 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 28 Jun 2021 18:52:19 +0200 Subject: [PATCH 2/8] Update manifest.json --- manifest.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manifest.json b/manifest.json index f054c08..a9eff1d 100644 --- a/manifest.json +++ b/manifest.json @@ -48,6 +48,16 @@ "type": "boolean", "default": true }, + { + "name": "language", + "type": "string", + "ask": { + "en": "Choose the application language", + "fr": "Choisissez la langue de l'application" + }, + "choices": ["fr", "en"], + "default": "fr" + }, { "name": "admin", "type": "user", From 01082120f93c4d79ab873e2cb185ac8f348c6b35 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 28 Jun 2021 18:52:55 +0200 Subject: [PATCH 3/8] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index ea318d7..f84cc19 100644 --- a/scripts/install +++ b/scripts/install @@ -25,6 +25,7 @@ admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD email=$(ynh_user_get_info --username=$admin --key=mail) +language=$YNH_APP_ARG_LANGUAGE app=$YNH_APP_INSTANCE_NAME @@ -47,6 +48,7 @@ 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=admin --value=$admin +ynh_app_setting_set --app=$app --key=language --value=$language #================================================= # STANDARD MODIFICATIONS From a6bc33d5dcb945c8d7884a14713406d48abe3ea3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 28 Jun 2021 18:55:47 +0200 Subject: [PATCH 4/8] Add language --- check_process | 1 + conf/config.php.default | 21 ------------ conf/install-config.yml.default | 2 +- scripts/_common.sh | 57 --------------------------------- scripts/install | 11 ------- scripts/upgrade | 1 + 6 files changed, 3 insertions(+), 90 deletions(-) delete mode 100644 conf/config.php.default diff --git a/check_process b/check_process index 8c4f6f9..67b94f7 100644 --- a/check_process +++ b/check_process @@ -3,6 +3,7 @@ domain="domain.tld" path="/path" admin="john" + language="fr" is_public=1 password="super_password" ; Checks diff --git a/conf/config.php.default b/conf/config.php.default deleted file mode 100644 index b87413e..0000000 --- a/conf/config.php.default +++ /dev/null @@ -1,21 +0,0 @@ - diff --git a/conf/install-config.yml.default b/conf/install-config.yml.default index 5359d66..52824d4 100644 --- a/conf/install-config.yml.default +++ b/conf/install-config.yml.default @@ -5,7 +5,7 @@ installer: email: __EMAIL__ board: - lang: en + lang: __LANGUAGE__ name: My Board description: My amazing new phpBB board diff --git a/scripts/_common.sh b/scripts/_common.sh index cfe3028..862e440 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -19,60 +19,3 @@ extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-fpm #================================================= # FUTURE OFFICIAL HELPERS #================================================= - -# Send an email to inform the administrator -# -# usage: ynh_send_readme_to_admin app_message [recipients] -# | arg: app_message - The message to send to the administrator. -# | arg: recipients - The recipients of this email. Use spaces to separate multiples recipients. - default: root -# example: "root admin@domain" -# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you -# example: "root admin@domain user1 user2" -ynh_send_readme_to_admin() { - local app_message="${1:-...No specific information...}" - local recipients="${2:-root}" - - # Retrieve the email of users - find_mails () { - local list_mails="$1" - local mail - local recipients=" " - # Read each mail in argument - for mail in $list_mails - do - # Keep root or a real email address as it is - if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@" - then - recipients="$recipients $mail" - else - # But replace an user name without a domain after by its email - if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null) - then - recipients="$recipients $mail" - fi - fi - done - echo "$recipients" - } - recipients=$(find_mails "$recipients") - - local mail_subject="☁️🆈🅽🅷☁️: \`$app\` has important message for you" - - local mail_message="This is an automated message from your beloved YunoHost server. -Specific information for the application $app. -$app_message ---- -Automatic diagnosis data from YunoHost -$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" - - # Define binary to use for mail command - if [ -e /usr/bin/bsd-mailx ] - then - local mail_bin=/usr/bin/bsd-mailx - else - local mail_bin=/usr/bin/mail.mailutils - fi - - # Send the email to the recipients - echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" -} diff --git a/scripts/install b/scripts/install index ae8aeea..2608e64 100644 --- a/scripts/install +++ b/scripts/install @@ -172,17 +172,6 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload -#================================================= -# SEND A README FOR THE ADMIN -#================================================= -ynh_script_progression --message="Sending a readme for the admin..." - -message="phpBB was successfully installed :) - -If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/phpbb_ynh/issues" - -ynh_send_readme_to_admin "$message" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4bc02a1..d42f8ce 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +language=$(ynh_app_setting_get --app=$app --key=language) #================================================= # CHECK VERSION From 8be33f647f3abb2a60906ed762e3b0ff6fd102b0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 28 Jun 2021 23:06:22 +0200 Subject: [PATCH 5/8] Update install-config.yml.default --- conf/install-config.yml.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/install-config.yml.default b/conf/install-config.yml.default index 52824d4..91951b3 100644 --- a/conf/install-config.yml.default +++ b/conf/install-config.yml.default @@ -32,7 +32,7 @@ installer: server_protocol: https:// force_server_vars: false server_name: __DOMAIN__ - server_port: 80 + server_port: 443 script_path: __PATH_URL__ extensions: ['phpbb/viglink'] \ No newline at end of file From 47430e055d170da0d70fd672a9f03957276836c1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 28 Jun 2021 23:16:46 +0200 Subject: [PATCH 6/8] Create update-config.yml.default --- conf/update-config.yml.default | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 conf/update-config.yml.default diff --git a/conf/update-config.yml.default b/conf/update-config.yml.default new file mode 100644 index 0000000..caa1a9e --- /dev/null +++ b/conf/update-config.yml.default @@ -0,0 +1,3 @@ +updater: + type: all + extensions: ['phpbb/viglink'] From 486fcd65a2fb563b42285b2582a8db7a4d3c37f7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 28 Jun 2021 23:23:21 +0200 Subject: [PATCH 7/8] Update nginx.conf --- conf/nginx.conf | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 556b622..449c8be 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,12 +9,13 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } - index index.php; + # phpBB uses index.htm + index index.php index.html index.htm; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file #client_max_body_size 50M; - try_files $uri $uri/ index.php; + try_files $uri $uri/ @rewriteapp; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; @@ -26,6 +27,18 @@ location __PATH__/ { fastcgi_param SCRIPT_FILENAME $request_filename; } + # Deny access to internal phpbb files. + location ~ __PATH__/(config\.php|common\.php|cache|files|images/avatars/upload|includes|(? Date: Tue, 29 Jun 2021 00:00:12 +0200 Subject: [PATCH 8/8] Update install-config.yml.default --- conf/install-config.yml.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/install-config.yml.default b/conf/install-config.yml.default index 91951b3..98f6865 100644 --- a/conf/install-config.yml.default +++ b/conf/install-config.yml.default @@ -30,7 +30,7 @@ installer: server: cookie_secure: true server_protocol: https:// - force_server_vars: false + force_server_vars: true server_name: __DOMAIN__ server_port: 443 script_path: __PATH_URL__