diff --git a/README.md b/README.md index 1c5ad8d..6f97757 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Mobilizon aims to solve existing platform's problems to organize events in a dec Mobilizon is a tool that helps you find, create and organise events. You can also create a page for your group where the members will be able to organise together. -**Shipped version:** 1.0.3 +**Shipped version:** 1.0.6-2021-02-23 ## Important points to read before installing @@ -58,8 +58,7 @@ LDAP is supported but HTTP auth is not supported? --- -Developer info ----------------- +## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/mobilizon_ynh/tree/testing). diff --git a/check_process b/check_process index 4a80164..f9f05d7 100644 --- a/check_process +++ b/check_process @@ -15,20 +15,17 @@ setup_public=1 upgrade=1 # 0.1.0-2019-05-15~ynh1 - upgrade=1 from_commit=185cc16e516076e340cca149e8e9140a8762e22e + # upgrade=1 from_commit=185cc16e516076e340cca149e8e9140a8762e22e # 0.1.0-2019-12-28~ynh1 - upgrade=1 from_commit=6b77f268d4e7e2cd525e11e11f3ed5a5162d0bd2 + # upgrade=1 from_commit=6b77f268d4e7e2cd525e11e11f3ed5a5162d0bd2 # 1.0.0~ynh1 - upgrade=1 from_commit=ac87692da6eaff71f40e3069c7bc6129eddba5e6 + # upgrade=1 from_commit=ac87692da6eaff71f40e3069c7bc6129eddba5e6 + # 1.0.3~ynh1 + # upgrade=1 from_commit=8413ab8bd3aca3e2f6c431153dd9dfab37860956 backup_restore=1 multi_instance=1 - # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. - # incorrect_path=1 port_already_use=0 change_url=0 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=yalh@yahoo.com Notification=all @@ -39,3 +36,5 @@ Notification=all name=0.1.0-2019-12-28~ynh1 ; commit=ac87692da6eaff71f40e3069c7bc6129eddba5e6 name=1.0.0~ynh1 + ; commit=8413ab8bd3aca3e2f6c431153dd9dfab37860956 + name=1.0.3~ynh1 diff --git a/conf/app.src b/conf/app.src index 6bbab02..21b19d1 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,7 @@ -SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.0.3/mobilizon-1.0.3.tar.gz -SOURCE_SUM=5fe588f3567a90c82be8ac1289f836ee2b98b446033c1ca8f9293fd2145441c5 +SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/82a3995a0de502367150667507e64111bcde6af8/mobilizon-82a3995a0de502367150667507e64111bcde6af8.tar.gz +SOURCE_SUM=c83d124d76079949b33328ea9b1bf51d5b4b8d72d3f8517ba9da702af970cc20 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mobilizon-1.0.3.tar.gz +SOURCE_FILENAME=mobilizon-1.0.6-2021-02-23.tar.gz +SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index e21dafd..e0eeb1e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,11 @@ -location / { +location __PATH__/ { # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - # the nginx default is 1m, not enough for large media uploads - client_max_body_size 16m; + # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file + client_max_body_size 50M; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; diff --git a/issue_template.md b/issue_template.md index 4713927..cb56297 100644 --- a/issue_template.md +++ b/issue_template.md @@ -6,11 +6,11 @@ about: When creating a bug report, please use the following template to provide **How to post a meaningful bug report** 1. *Read this whole template first.* -2. *Make sure you are on the right place:* - - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change url...), you are on the right place!* - - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* - - *In doubt, ask here and we will figure it out together.* -3. *Delete these italic comments as you write over them below, and remove this guide.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to Mobilizon itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* --- ### Describe the bug @@ -22,7 +22,7 @@ about: When creating a bug report, please use the following template to provide - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* - YunoHost version: x.x.x - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* -- Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: *no / yes* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* - If yes, please explain: - Using, or trying to install package version/branch: - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* @@ -36,8 +36,8 @@ about: When creating a bug report, please use the following template to provide - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* 1. *Go to '...'* - 2. *Click on '....'* - 3. *Scroll down to '....'* + 2. *Click on '...'* + 3. *Scroll down to '...'* 4. *See error* ### Expected behavior diff --git a/manifest.json b/manifest.json index 52aafdb..363bb48 100644 --- a/manifest.json +++ b/manifest.json @@ -6,14 +6,14 @@ "en": "A decentralized and federated platform to organize events", "fr": "Une plateforme décentralisée et fédérée pour organiser des événements" }, - "version": "1.0.3~ynh1", + "version": "1.0.6-2021-02-23~ynh1", "url": "https://joinmobilizon.org/", "license": "AGPL-3.0-or-later", "maintainer": { "name": "yalh76" }, "requirements": { - "yunohost": ">= 4.0" + "yunohost": ">= 4.1.3" }, "multi_instance": true, "services": [ diff --git a/pull_request_template.md b/pull_request_template.md index 6e38f27..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -13,6 +13,4 @@ ## Package_check results --- -*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* - -[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/mobilizon_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/mobilizon_ynh%20PR-NUM-%20(USERNAME)/) +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/install b/scripts/install index 5458eda..4105def 100644 --- a/scripts/install +++ b/scripts/install @@ -53,7 +53,6 @@ ynh_script_progression --message="Storing installation settings..." 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=is_public --value=$is_public ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=admin_email --value=$admin_email ynh_app_setting_set --app=$app --key=ynh_user_password --value=$ynh_user_password @@ -223,13 +222,14 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." # Make app public if necessary if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/restore b/scripts/restore index 5358caa..27f2602 100644 --- a/scripts/restore +++ b/scripts/restore @@ -117,7 +117,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -138,7 +138,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --lin #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index bda742f..2e3ad57 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,7 +20,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) admin=$(ynh_app_setting_get --app=$app --key=admin) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) 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) @@ -46,25 +45,9 @@ previous_version="${version}" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name -fi - -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +if ! ynh_permission_exists --permission="admin"; then + # Create the required permissions + ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin fi ynh_secure_remove --file="$final_path/$app/priv/data/GeoLite2-City.mmdb" @@ -100,18 +83,18 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line #================================================= if ynh_version_gt "1.0.0~ynh1" "${previous_version}" ; then - ynh_script_progression --message="Upgrade configuration to 1.0.0..." + ynh_script_progression --message="Upgrade configuration to 1.0.0..." - ynh_user_password=$(ynh_string_random --length=30) - ynh_app_setting_set --app=$app --key=ynh_user_password --value=$ynh_user_password + ynh_user_password=$(ynh_string_random --length=30) + ynh_app_setting_set --app=$app --key=ynh_user_password --value=$ynh_user_password - yunohost user create ${app}_notifs --firstname "Mobilizon" --lastname "Notifications" --mail ${app}_notifs@$domain --password "$ynh_user_password" -q 0 - yunohost user update ${app}_notifs --add-mailalias $app@$domain --add-mailforward $admin_email + yunohost user create ${app}_notifs --firstname "Mobilizon" --lastname "Notifications" --mail ${app}_notifs@$domain --password "$ynh_user_password" -q 0 + yunohost user update ${app}_notifs --add-mailalias $app@$domain --add-mailforward $admin_email # Manage previous .env file ynh_backup_if_checksum_is_different --file="$final_path/$app/.env" - ynh_delete_file_checksum --file="$final_path/$app/.env" - ynh_secure_remove --file="$final_path/$app/.env" + ynh_delete_file_checksum --file="$final_path/$app/.env" + ynh_secure_remove --file="$final_path/$app/.env" # Configure Mobilizon config="$final_path/$app/config/prod.secret.exs" @@ -129,8 +112,8 @@ if ynh_version_gt "1.0.0~ynh1" "${previous_version}" ; then cat "../conf/ldap.exs" >> "$config" cat "../conf/mail.exs" >> "$config" - ynh_replace_string --match_string="__YNH_USER__" --replace_string="${app}_notifs" --target_file="$config" - ynh_replace_string --match_string="__YNH_USER_PASSWORD__" --replace_string="${ynh_user_password}" --target_file="$config" + ynh_replace_string --match_string="__YNH_USER__" --replace_string="${app}_notifs" --target_file="$config" + ynh_replace_string --match_string="__YNH_USER_PASSWORD__" --replace_string="${ynh_user_password}" --target_file="$config" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$config" @@ -148,7 +131,7 @@ then tmpdir="$(mktemp -d)" # Backup the config file in the temp dir - cp -a "$final_path/$app/config/prod.secret.exs" "$tmpdir/prod.secret.exs" + cp -a "$final_path/$app/config/prod.secret.exs" "$tmpdir/prod.secret.exs" # Remove the app directory securely ynh_secure_remove --file="$final_path/$app" @@ -157,7 +140,7 @@ then ynh_setup_source --dest_dir="$final_path/$app" #Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/prod.secret.exs" "$final_path/$app/config/prod.secret.exs" + cp -a "$tmpdir/prod.secret.exs" "$final_path/$app/config/prod.secret.exs" # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" @@ -215,20 +198,20 @@ chmod o-rwx $config chown -R "$app":"$app" "$final_path" pushd $final_path/$app/js - ynh_use_nodejs - ynh_script_progression --message="Installing NodeJS dependencies (this is going to take a while...)" - sudo -u $app env PATH=$PATH yarn install - ynh_script_progression --message="Building NodeJS application (this is going to take a while...)" - sudo -u $app env PATH=$PATH NODE_BUILD_MEMORY=1024 yarn run build + ynh_use_nodejs + ynh_script_progression --message="Installing NodeJS dependencies (this is going to take a while...)" + sudo -u $app env PATH=$PATH yarn install + ynh_script_progression --message="Building NodeJS application (this is going to take a while...)" + sudo -u $app env PATH=$PATH NODE_BUILD_MEMORY=1024 yarn run build popd ynh_script_progression --message="Building Elixir application (this is going to take a while...)" pushd $final_path/$app - sudo -u "$app" MIX_ENV=prod mix local.hex --force - sudo -u "$app" MIX_ENV=prod mix local.rebar --force - sudo -u "$app" MIX_ENV=prod mix deps.get - sudo -u "$app" MIX_ENV=prod mix compile - sudo -u "$app" MIX_ENV=prod mix ecto.migrate + sudo -u "$app" MIX_ENV=prod mix local.hex --force + sudo -u "$app" MIX_ENV=prod mix local.rebar --force + sudo -u "$app" MIX_ENV=prod mix deps.get + sudo -u "$app" MIX_ENV=prod mix compile + sudo -u "$app" MIX_ENV=prod mix ecto.migrate popd #================================================= @@ -236,10 +219,10 @@ popd #================================================= if ynh_version_gt "1.0.3~ynh1" "${previous_version}" ; then - ynh_script_progression --message="Mobilizon v1.0.3: Refresh remote profiles to save avatars locally" - pushd $final_path/$app - sudo -u "$app" MIX_ENV=prod mix mobilizon.actors.refresh --all - popd + ynh_script_progression --message="Mobilizon v1.0.3: Refresh remote profiles to save avatars locally" + pushd $final_path/$app + sudo -u "$app" MIX_ENV=prod mix mobilizon.actors.refresh --all + popd fi #================================================= @@ -282,18 +265,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Access Mobilizon.Web.Endpoint at" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # RELOAD NGINX #=================================================