From 6ace375a6c50ece1642e6d393dbb99a22caef4b4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Oct 2020 22:05:10 +0200 Subject: [PATCH 01/18] Add dependency --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index f2efa95..4cb929b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # dependencies used by the app -pkg_dependencies="build-essential inotify-tools postgresql postgresql-client postgresql-contrib git curl gnupg openssl postgis make gcc libc-dev argon2 imagemagick webp gifsicle jpegoptim optipng pngquant cmake" +pkg_dependencies="build-essential inotify-tools postgresql postgresql-client postgresql-contrib git curl unzip gnupg openssl postgis make gcc libc-dev argon2 imagemagick webp gifsicle jpegoptim optipng pngquant cmake" extra_pkg_dependencies="elixir esl-erlang" NODEJS_VERSION=12 From 85deb71343be1a812a969f59ebf0777cd636a67d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Oct 2020 22:10:19 +0200 Subject: [PATCH 02/18] When it's done, don't forget to remove the setup_db.psql file. --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 4b73a61..a8a1c88 100644 --- a/scripts/install +++ b/scripts/install @@ -155,6 +155,7 @@ pushd $final_path/$app sudo -u "$app" MIX_ENV=prod mix deps.get sudo -u "$app" MIX_ENV=prod mix compile sudo -u "$app" MIX_ENV=prod mix mobilizon.instance gen --force --output $config --output-psql /tmp/setup_db.psql --domain $domain --instance-name $name --admin-email $admin_email --dbhost localhost --dbname $db_name --dbuser $db_user --dbpass $db_pwd --listen-port $port + ynh_secure_remove --file="/tmp/setup_db.psql" sudo -u "$app" MIX_ENV=prod mix ecto.migrate sudo -u "$app" MIX_ENV=prod mix mobilizon.users.new "$admin_email" --admin --password "$password" popd From 2d64c17ed7414741ac149870856100b4813c2b6d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Oct 2020 22:19:45 +0200 Subject: [PATCH 03/18] The nginx configuration has been changed with improvements and support for custom error pages. --- conf/nginx.conf | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f90d0fb..8a76cee 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,28 +4,46 @@ location / { rewrite ^ https://$server_name$request_uri? permanent; } - gzip off; - proxy_http_version 1.1; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + gzip on; + gzip_disable "msie6"; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml; - # For Websocket support + # the nginx default is 1m, not enough for large media uploads + client_max_body_size 16m; + + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; - - proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://localhost:__PORT__; - client_max_body_size 16m; - location ~* \.(css|js)$ { root __FINALPATH__/mobilizon/priv/static; etag off; - expires 1y; access_log off; - add_header Cache-Control public; + add_header Cache-Control "public, max-age=31536000, immutable"; + } + + location ~ ^/(media|proxy) { + etag off; + access_log off; + add_header Cache-Control "public, max-age=31536000, immutable"; + proxy_pass http://localhost:__PORT__; + } + + error_page 500 501 502 503 504 @error; + location @error { + root __FINALPATH__/mobilizon/priv/errors; + try_files /error.html 502; } # Include SSOWAT user panel. From eaffa4f2e291927ce871379ea0edb31ad1361592 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Oct 2020 22:22:16 +0200 Subject: [PATCH 04/18] Update README.md --- README.md | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/README.md b/README.md index ff7b1b7..b223be7 100644 --- a/README.md +++ b/README.md @@ -17,22 +17,7 @@ Mobilizon is a tool designed to create platforms for managing communities and ev ## Important points to read before installing -1. **Mobilizon** is in early development, like an Alpha, all functionalities are not available 1. **Mobilizon** require a dedicated **root domain**, eg. mobilizon.domain.tld -1. Even if requested during installation: admin, language and password variables are not used -1. Admin Dashboard is still not implemented -1. When your mobilizon instance is installed, you need to register. -1. When registered, to be admin you have to manually goes in PostgreSQL, database $app, table users, and change the role value to `administrator` instead of `user` (other role available: `moderator`) - -Example to manually put user with id=1 as administrator: -```bash -su -l postgres -psql -\c mobilizon -UPDATE public.users SET role='administrator' where id=1; -\q -exit -``` ## Screenshots From e27075e3c8b016e7159aee118ab7e901262b72ee Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Oct 2020 22:34:29 +0200 Subject: [PATCH 05/18] Apply last example_ynh --- issue_template.md | 33 +++++++++++++++++++++------------ manifest.json | 2 +- scripts/change_url | 8 ++------ scripts/install | 2 +- scripts/remove | 4 ++-- scripts/upgrade | 38 +++++++++++++++++++++++--------------- 6 files changed, 50 insertions(+), 37 deletions(-) diff --git a/issue_template.md b/issue_template.md index e7ad54a..4713927 100644 --- a/issue_template.md +++ b/issue_template.md @@ -1,22 +1,24 @@ --- name: Bug report -about: Create a report to help us debug, it would be nice to fill the template as much as you can to help us, help you and help us all. +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. --- **How to post a meaningful bug report** 1. *Read this whole template first.* -2. *Determine if you are on the right place:* +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 Mobilizon itself. Refer to its documentation or repository for help.* - - *If you have a doubt, post here, we will figure it out together.* -3. *Delete the italic comments as you write over them below, and remove this guide.* + - *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.* --- -**Describe the bug** +### Describe the bug + *A clear and concise description of what the bug is.* -**Versions** +### Context + - 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 | ...* @@ -25,8 +27,8 @@ about: Create a report to help us debug, it would be nice to fill the template a - 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`* -**To Reproduce** -*Steps to reproduce the behavior.* +### Steps to reproduce + - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh sudo yunohost app install mobilizon @@ -38,9 +40,16 @@ about: Create a report to help us debug, it would be nice to fill the template a 3. *Scroll down to '....'* 4. *See error* -**Expected behavior** +### Expected behavior + *A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* -**Logs** -*After a failed command, YunoHost makes the log available to you, but also to others, thanks to `yunohost log display [log name] --share`. The actual command, with the correct log name, is displayed at the end of the failed attempt in the CLI. Execute it and copy here the share link it outputs.* +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + *If applicable and useful, add screenshots to help explain your problem.* diff --git a/manifest.json b/manifest.json index 6bf5035..b5e3189 100644 --- a/manifest.json +++ b/manifest.json @@ -35,7 +35,7 @@ "type": "user", "ask": { "en": "Choose an admin user", - "fr": "Choisissez l’administrateur" + "fr": "Choisissez l'administrateur" }, "example": "johndoe" }, diff --git a/scripts/change_url b/scripts/change_url index ab619ce..8a9902b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -113,14 +113,10 @@ fi ynh_script_progression --message="Modifying a config file..." config="$final_path/$app/config/prod.secret.exs" +ynh_backup_if_checksum_is_different --file="$config" + ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="$config" -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= -ynh_script_progression --message="Storing the config file checksum..." - -ynh_backup_if_checksum_is_different --file="$config" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$config" diff --git a/scripts/install b/scripts/install index a8a1c88..74fbefd 100644 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - ynh_clean_check_starting + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/remove b/scripts/remove index 97cc9be..7a6b0af 100644 --- a/scripts/remove +++ b/scripts/remove @@ -31,7 +31,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Remove the service from the list of services known by Yunohost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service..." + ynh_script_progression --message="Removing $app service integration..." yunohost service remove $app fi @@ -49,7 +49,7 @@ ynh_remove_systemd_config ynh_script_progression --message="Removing the PostgreSQL database..." # Remove a database if it exists, along with the associated user -ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name" +ynh_psql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES diff --git a/scripts/upgrade b/scripts/upgrade index 491432a..c48cb70 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -171,23 +171,24 @@ ynh_script_progression --message="Making setup..." chown -R "$app":"$app" "$final_path" pushd $final_path/$app/js - ynh_use_nodejs - sudo -u $app env PATH=$PATH yarn install - sudo -u $app env PATH=$PATH yarn run build + ynh_use_nodejs + sudo -u $app env PATH=$PATH yarn install + sudo -u $app env PATH=$PATH yarn run build popd 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 #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= ynh_script_progression --message="Storing the config file checksum..." + # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$config" @@ -209,6 +210,20 @@ ynh_script_progression --message="Securing files and directories..." # Set permissions on app files chown -R "$app":"$app" "$final_path" +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $app --description "$app daemon for Mobilizon" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +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 #================================================= @@ -221,13 +236,6 @@ then ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" fi -#================================================= -# START SYSTEMD SERVICE -#================================================= -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" - #================================================= # RELOAD NGINX #================================================= From ea32d93e8e143fe172d45eedebe4830e75ba7eb7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Oct 2020 22:52:11 +0200 Subject: [PATCH 06/18] Implement LDAP --- conf/ldap.exs | 11 +++++++++++ scripts/install | 1 + scripts/upgrade | 17 +++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 conf/ldap.exs diff --git a/conf/ldap.exs b/conf/ldap.exs new file mode 100644 index 0000000..692720e --- /dev/null +++ b/conf/ldap.exs @@ -0,0 +1,11 @@ +config :mobilizon, Mobilizon.Service.Auth.Authenticator, Mobilizon.Service.Auth.LDAPAuthenticator +config :mobilizon, :ldap, + enabled: true, + host: "localhost", + port: 389, + ssl: false, + # sslopts: [], + tls: false, + # tlsopts: [], + base: "ou=users,dc=yunohost,dc=org", + uid: "uid" diff --git a/scripts/install b/scripts/install index 74fbefd..a691d98 100644 --- a/scripts/install +++ b/scripts/install @@ -155,6 +155,7 @@ pushd $final_path/$app sudo -u "$app" MIX_ENV=prod mix deps.get sudo -u "$app" MIX_ENV=prod mix compile sudo -u "$app" MIX_ENV=prod mix mobilizon.instance gen --force --output $config --output-psql /tmp/setup_db.psql --domain $domain --instance-name $name --admin-email $admin_email --dbhost localhost --dbname $db_name --dbuser $db_user --dbpass $db_pwd --listen-port $port + cat "../conf/ldap.exs" >> "$config" ynh_secure_remove --file="/tmp/setup_db.psql" sudo -u "$app" MIX_ENV=prod mix ecto.migrate sudo -u "$app" MIX_ENV=prod mix mobilizon.users.new "$admin_email" --admin --password "$password" diff --git a/scripts/upgrade b/scripts/upgrade index c48cb70..a1f7624 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -91,6 +91,23 @@ ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped" +#================================================= +# UPGRADE FROM PREVIOUS VERSION +#================================================= + +if ynh_version_gt "1.0.0-rc1~ynh1" "${previous_version}" ; then + ynh_script_progression --message="Upgrade configuration to 1.0.0-rc1~ynh1..." + + config="$final_path/$app/config/prod.secret.exs" + ynh_backup_if_checksum_is_different --file="$config" + + # Implement ldap + cat "../conf/ldap.exs" >> "$config" + + # Recalculate and store the checksum of the file for the next upgrade. + ynh_store_file_checksum --file="$config" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From 300150aa0c497a883c544b4dc23538e5c5ace3f3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 15 Oct 2020 03:21:30 +0200 Subject: [PATCH 07/18] [emerg] named location "@error" can be on the server level only --- conf/nginx.conf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 8a76cee..cff60cc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -41,11 +41,12 @@ location / { } error_page 500 501 502 503 504 @error; - location @error { - root __FINALPATH__/mobilizon/priv/errors; - try_files /error.html 502; - } # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } + +location @error { + root __FINALPATH__/mobilizon/priv/errors; + try_files /error.html 502; +} \ No newline at end of file From 95d2414c10788970437a1df00970ea0195df10de Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 15 Oct 2020 18:36:52 +0200 Subject: [PATCH 08/18] Fix cat: ../conf/ldap.exs: No such file or directory --- scripts/install | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index a691d98..d98fd3f 100644 --- a/scripts/install +++ b/scripts/install @@ -155,7 +155,11 @@ pushd $final_path/$app sudo -u "$app" MIX_ENV=prod mix deps.get sudo -u "$app" MIX_ENV=prod mix compile sudo -u "$app" MIX_ENV=prod mix mobilizon.instance gen --force --output $config --output-psql /tmp/setup_db.psql --domain $domain --instance-name $name --admin-email $admin_email --dbhost localhost --dbname $db_name --dbuser $db_user --dbpass $db_pwd --listen-port $port - cat "../conf/ldap.exs" >> "$config" +popd + +cat "../conf/ldap.exs" >> "$config" + +pushd $final_path/$app ynh_secure_remove --file="/tmp/setup_db.psql" sudo -u "$app" MIX_ENV=prod mix ecto.migrate sudo -u "$app" MIX_ENV=prod mix mobilizon.users.new "$admin_email" --admin --password "$password" From 19e4846c5a57dca7497712fb370cf883ac972d01 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 15 Oct 2020 20:31:49 +0200 Subject: [PATCH 09/18] Missing ynh_package_version --- scripts/upgrade | 1 + scripts/ynh_package_version | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 scripts/ynh_package_version diff --git a/scripts/upgrade b/scripts/upgrade index a1f7624..cbad65f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_package_version source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/ynh_package_version b/scripts/ynh_package_version new file mode 100644 index 0000000..d6cdc4d --- /dev/null +++ b/scripts/ynh_package_version @@ -0,0 +1,26 @@ +#!/bin/bash + +read_json () { + sudo python3 -c "import sys, json;print(json.load(open('$1'))['$2'])" +} + +read_manifest () { + if [ -f '../manifest.json' ] ; then + read_json '../manifest.json' "$1" + else + read_json '../settings/manifest.json' "$1" + fi +} +abort_if_up_to_date () { + version=$(read_json "/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" 'version' 2> /dev/null || echo '20160501-7') + last_version=$(read_manifest 'version') + if [ "${version}" = "${last_version}" ]; then + ynh_print_info "Up-to-date, nothing to do" + ynh_die "" 0 + fi +} + +ynh_version_gt () +{ + dpkg --compare-versions "$1" gt "$2" +} From 4a0dd4bc9aef2fe2ae56989fdfbabd4e845e31ff Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 20 Oct 2020 20:18:30 +0200 Subject: [PATCH 10/18] Upgrade 1.0.0-rc.2 --- README.md | 2 +- conf/app.src | 6 +++--- manifest.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ff7b1b7..7593ca0 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 designed to create platforms for managing communities and events. Its purpose is to help as many people as possible to free themselves from Facebook groups and events, from Meetup, etc. -**Shipped version:** 1.0.0-rc1 +**Shipped version:** 1.0.0-rc.2 ## Important points to read before installing diff --git a/conf/app.src b/conf/app.src index 38ed806..e4fa6f1 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.0.0-rc.1/mobilizon-1.0.0-rc.1.tar.gz -SOURCE_SUM=26042e61963382d02819ac75d031dbf40cec8135b34b897b8c400e6395dbd724 +SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.0.0-rc.2/mobilizon-1.0.0-rc.2.tar.gz +SOURCE_SUM=ba3815fbdf58c8fc26a893cb5a67bd5c834bd4c47c3eb8f828915d0773c0093f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mobilizon-1.0.0-rc.1.tar.gz +SOURCE_FILENAME=mobilizon-1.0.0-rc.2.tar.gz diff --git a/manifest.json b/manifest.json index 6bf5035..3252b55 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "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.0-rc1~ynh1", + "version": "1.0.0-rc.2~ynh1", "url": "https://joinmobilizon.org/", "license": "AGPL-3.0-or-later", "maintainer": { From 1cd402629403974bfd38901b3f5cc07c04427216 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 22 Oct 2020 20:34:05 +0200 Subject: [PATCH 11/18] Upgrade to 1.0.0-rc.4 --- README.md | 2 +- conf/app.src | 6 +++--- manifest.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7593ca0..2e7eeee 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 designed to create platforms for managing communities and events. Its purpose is to help as many people as possible to free themselves from Facebook groups and events, from Meetup, etc. -**Shipped version:** 1.0.0-rc.2 +**Shipped version:** 1.0.0-rc.4 ## Important points to read before installing diff --git a/conf/app.src b/conf/app.src index e4fa6f1..7a1c82e 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.0.0-rc.2/mobilizon-1.0.0-rc.2.tar.gz -SOURCE_SUM=ba3815fbdf58c8fc26a893cb5a67bd5c834bd4c47c3eb8f828915d0773c0093f +SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.0.0-rc.4/mobilizon-1.0.0-rc.4.tar.gz +SOURCE_SUM=54412680e10928a3d68a07d2201310eed548e51cccf19a0aaf8641af9a5ee8d0 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mobilizon-1.0.0-rc.2.tar.gz +SOURCE_FILENAME=mobilizon-1.0.0-rc.4.tar.gz diff --git a/manifest.json b/manifest.json index 3252b55..e52e012 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "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.0-rc.2~ynh1", + "version": "1.0.0-rc.4~ynh1", "url": "https://joinmobilizon.org/", "license": "AGPL-3.0-or-later", "maintainer": { From fbd3d330c52944d6fe3e7ee7e88a45fcba79c6c2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 24 Oct 2020 09:18:25 +0200 Subject: [PATCH 12/18] Fix upgrade --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 9a28706..3ff4849 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,6 +38,10 @@ ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) +abort_if_up_to_date +# previous function is what defines 'version', more precisely the 'previous version' +previous_version="${version}" + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= From 5c13c6bcd74eea3705e12a69562d4784dcdad7ec Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 26 Oct 2020 01:23:13 +0100 Subject: [PATCH 13/18] Fix permissions for config file + fix backup/restore of configuration during upgrade ? --- scripts/install | 3 ++- scripts/upgrade | 13 ++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 51ba7c7..15c071a 100644 --- a/scripts/install +++ b/scripts/install @@ -144,7 +144,7 @@ chown -R "$app":"$app" "$final_path" config="$final_path/$app/config/prod.secret.exs" pushd $final_path/$app/js - ynh_use_nodejs + ynh_use_nodejs sudo -u $app env PATH=$PATH yarn install sudo -u $app env PATH=$PATH NODE_BUILD_MEMORY=1024 yarn run build popd @@ -160,6 +160,7 @@ popd cat "../conf/ldap.exs" >> "$config" pushd $final_path/$app + chown o-rwx $config ynh_secure_remove --file="/tmp/setup_db.psql" sudo -u "$app" MIX_ENV=prod mix ecto.migrate sudo -u "$app" MIX_ENV=prod mix mobilizon.users.new "$admin_email" --admin --password "$password" diff --git a/scripts/upgrade b/scripts/upgrade index 3ff4849..5e9381d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -125,10 +125,7 @@ then tmpdir="$(mktemp -d)" # Backup the config file in the temp dir - if [ -s "$final_path/$app/config/prod.exs" ] - then - cp -a "$final_path/$app/config/prod.exs" "$tmpdir/prod.secret.exs" - fi + 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" @@ -137,10 +134,7 @@ then ynh_setup_source --dest_dir="$final_path/$app" #Copy the admin saved settings from tmp directory to final path - if [ -s "$tmpdir/prod.exs" ] - then - cp -a "$tmpdir/prod.exs" "$final_path/$app/config/prod.secret.exs" - fi + cp -a "$tmpdir/prod.secret.exs" "$final_path/$app/config/prod.secret.exs" # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" @@ -183,6 +177,7 @@ ynh_script_progression --message="Modifying a config file..." config="$final_path/$app/config/prod.secret.exs" ynh_backup_if_checksum_is_different --file="$config" +chown o-rwx $config #================================================= # MAKE SETUP @@ -193,7 +188,7 @@ chown -R "$app":"$app" "$final_path" pushd $final_path/$app/js ynh_script_progression --message="Building NodeJS..." - ynh_use_nodejs + ynh_use_nodejs sudo -u $app env PATH=$PATH yarn install sudo -u $app env PATH=$PATH yarn run build popd From eed8ecda7ca0aefb30076044f24328600097e00b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 26 Oct 2020 16:06:08 +0100 Subject: [PATCH 14/18] Bump to 1.0.0 --- README.md | 4 ++-- conf/app.src | 6 +++--- manifest.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7b335fa..3a60915 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 designed to create platforms for managing communities and events. Its purpose is to help as many people as possible to free themselves from Facebook groups and events, from Meetup, etc. -**Shipped version:** 1.0.0-rc.4 +**Shipped version:** 1.0.0 ## Important points to read before installing @@ -29,7 +29,7 @@ Mobilizon is a tool designed to create platforms for managing communities and ev ## YunoHost specific features -#### Supported architectures +#### Supported achitectures * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mobilizon%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mobilizon/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mobilizon%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mobilizon/) diff --git a/conf/app.src b/conf/app.src index 7a1c82e..6c7df20 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.0.0-rc.4/mobilizon-1.0.0-rc.4.tar.gz -SOURCE_SUM=54412680e10928a3d68a07d2201310eed548e51cccf19a0aaf8641af9a5ee8d0 +SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.0.0/mobilizon-1.0.0.tar.gz +SOURCE_SUM=a66712b859b923403945ad3e1e05f3ef537c7eb2a598f511dd99018ee4c06feb SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mobilizon-1.0.0-rc.4.tar.gz +SOURCE_FILENAME=mobilizon-1.0.0.tar.gz diff --git a/manifest.json b/manifest.json index 29baa21..16e338c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "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.0-rc.4~ynh1", + "version": "1.0.0~ynh1", "url": "https://joinmobilizon.org/", "license": "AGPL-3.0-or-later", "maintainer": { From 952f62c061333873ba165467060cad8bbd974e67 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 26 Oct 2020 17:06:47 +0100 Subject: [PATCH 15/18] Do not enable gzip --- conf/nginx.conf | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index cff60cc..56b0305 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,15 +4,6 @@ location / { rewrite ^ https://$server_name$request_uri? permanent; } - gzip on; - gzip_disable "msie6"; - gzip_vary on; - gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - gzip_http_version 1.1; - gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript application/activity+json application/atom+xml; - # the nginx default is 1m, not enough for large media uploads client_max_body_size 16m; @@ -49,4 +40,4 @@ location / { location @error { root __FINALPATH__/mobilizon/priv/errors; try_files /error.html 502; -} \ No newline at end of file +} From 02c7d136f60e04a9d1b4415c9135759505db08a9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 26 Oct 2020 17:17:17 +0100 Subject: [PATCH 16/18] add_header -> more_set_headers --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 56b0305..e21dafd 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -21,13 +21,13 @@ location / { root __FINALPATH__/mobilizon/priv/static; etag off; access_log off; - add_header Cache-Control "public, max-age=31536000, immutable"; + more_set_headers "Cache-Control: public, max-age=31536000, immutable"; } location ~ ^/(media|proxy) { etag off; access_log off; - add_header Cache-Control "public, max-age=31536000, immutable"; + more_set_headers "Cache-Control: public, max-age=31536000, immutable"; proxy_pass http://localhost:__PORT__; } From 2dda85301e2d9dca59247f07a5288bc09317424c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 26 Oct 2020 17:22:34 +0100 Subject: [PATCH 17/18] Fix version number for upgrade test --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5e9381d..bc5413d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,8 +100,8 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line # UPGRADE FROM PREVIOUS VERSION #================================================= -if ynh_version_gt "1.0.0-rc1~ynh1" "${previous_version}" ; then - ynh_script_progression --message="Upgrade configuration to 1.0.0-rc1~ynh1..." +if ynh_version_gt "0.1.1" "${previous_version}" ; then + ynh_script_progression --message="Upgrade configuration to 1.0.0..." config="$final_path/$app/config/prod.secret.exs" ynh_backup_if_checksum_is_different --file="$config" From 9ab0387d122b46c00ddb32d2a7750dd66c1b8cf5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 26 Oct 2020 17:23:02 +0100 Subject: [PATCH 18/18] Bump version number to 4.0 --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 16e338c..19fcdec 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "name": "yalh76" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 4.0" }, "multi_instance": true, "services": [