1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mobilizon_ynh.git synced 2024-09-03 19:46:19 +02:00

Upgrade to 1.2.1

This commit is contained in:
yalh76 2021-06-29 22:56:39 +02:00
parent ca8f3ab279
commit b45351b7a0
12 changed files with 69 additions and 55 deletions

View file

@ -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. 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.1.4 **Shipped version:** 1.2.1
## Important points to read before installing ## Important points to read before installing

View file

@ -1,9 +1,9 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
admin="john" (USER) admin="john"
language="fr" language="fr"
is_public=1 (PUBLIC|public=1|private=0) is_public=1
password="password" password="password"
name="My_Mobilizon" name="My_Mobilizon"
; Checks ; Checks
@ -16,6 +16,8 @@
upgrade=1 upgrade=1
# 1.1.3~ynh1 # 1.1.3~ynh1
upgrade=1 from_commit=87d34001dd0b77aed4fa7be2911bc04f58b069ee upgrade=1 from_commit=87d34001dd0b77aed4fa7be2911bc04f58b069ee
# 1.1.4~ynh1
upgrade=1 from_commit=ca8f3ab279d550cb6be44d0fec4c7f36fcae8798
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
port_already_use=0 port_already_use=0
@ -26,3 +28,5 @@ Notification=all
;;; Upgrade options ;;; Upgrade options
; commit=87d34001dd0b77aed4fa7be2911bc04f58b069ee ; commit=87d34001dd0b77aed4fa7be2911bc04f58b069ee
name=1.1.3~ynh1 name=1.1.3~ynh1
; commit=ca8f3ab279d550cb6be44d0fec4c7f36fcae8798
name=1.1.4~ynh1

View file

@ -1,7 +1,7 @@
SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.1.4/mobilizon-1.1.4.tar.gz SOURCE_URL=https://framagit.org/framasoft/mobilizon/-/archive/1.2.1/mobilizon-1.2.1.tar.gz
SOURCE_SUM=0d778d1ab390e0525bb3bb7383298011ea19d89075955622cf23e61e2899acd2 SOURCE_SUM=b35f63b56e5ad3275b0d1d4459a8fd88bc671a422d7414d31d32f71069decced
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=mobilizon-1.1.4.tar.gz SOURCE_FILENAME=mobilizon-1.2.1.tar.gz
SOURCE_EXTRACT=true SOURCE_EXTRACT=true

0
doc/.gitkeep Normal file
View file

8
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,8 @@
* Any known limitations, constrains or stuff not working, such as (but not limited to):
* **Mobilizon** require a dedicated **root domain**, eg. mobilizon.domain.tld
* To connect as **Mobilizon** administrator, use the email address and password of the user you choose during install
* By default registrations are closed
* All YunoHost users are allowed to connect
* Other infos that people should be aware of, such as:
* Configuration can be made in the Mobilizon administration panel.

0
doc/screenshots/.gitkeep Normal file
View file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View file

@ -6,8 +6,15 @@
"en": "A decentralized and federated platform to organize events", "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" "fr": "Une plateforme décentralisée et fédérée pour organiser des événements"
}, },
"version": "1.1.4~ynh1", "version": "1.2.1~ynh1",
"url": "https://joinmobilizon.org/", "url": "https://joinmobilizon.org/",
"upstream": {
"license": "AGPL-3.0-or-later",
"website": "https://joinmobilizon.org/",
"demo": "https://demo.mobilizon.org",
"userdoc": "https://docs.joinmobilizon.org",
"code": "https://framagit.org/framasoft/mobilizon/"
},
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"maintainer": { "maintainer": {
"name": "yalh76" "name": "yalh76"

View file

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
@ -43,6 +43,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$datadir" --is_big
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
@ -57,12 +63,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="$datadir" --is_big
#================================================= #=================================================
# BACKUP THE POSTGRESQL DATABASE # BACKUP THE POSTGRESQL DATABASE
#================================================= #=================================================

View file

@ -88,7 +88,7 @@ ynh_install_extra_app_dependencies --repo="deb http://packages.erlang-solutions.
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir=$final_path
yunohost user create ${app}_notifs --firstname "Mobilizon" --lastname "Notifications" --mail ${app}_notifs@$domain --password "$ynh_user_password" -q 0 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 update ${app}_notifs --add-mailalias $app@$domain --add-mailforward $admin_email
@ -134,17 +134,14 @@ ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# CREATE THE DATA DIRECTORY # CREATE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Creating the data directory..." ynh_script_progression --message="Creating a data directory..."
# Define app's data directory datadir=/home/yunohost.app/$app
datadir="/home/yunohost.app/${app}" ynh_app_setting_set --app=$app --key=datadir --value=$datadir
ynh_app_setting_set --app=$app --key=datadir --value="$datadir" mkdir -p $datadir
# Create app folders
mkdir -p "$datadir/"
mkdir -p "$datadir/uploads/" mkdir -p "$datadir/uploads/"
chmod 750 "$datadir" chmod 750 "$datadir"

View file

@ -63,7 +63,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Recreating the dedicated system user..." ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir=$final_path
yunohost user create ${app}_notifs --firstname "Mobilizon" --lastname "Notifications" --mail ${app}_notifs@$domain --password "$ynh_user_password" -q 0 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 update ${app}_notifs --add-mailalias $app@$domain --add-mailforward $admin_email
@ -80,23 +80,21 @@ chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#================================================= #=================================================
# SPECIFIC RESTORATION # RESTORE THE DATA DIRECTORY
#================================================= #=================================================
# RECREATE THE DATA DIRECTORY ynh_script_progression --message="Restoring the data directory..."
#=================================================
ynh_script_progression --message="Recreating the data directory..."
# Use --not_mandatory for the data directory, because if the backup has been made with BACKUP_CORE_ONLY, there's no data into the backup.
ynh_restore_file --origin_path="$datadir" --not_mandatory ynh_restore_file --origin_path="$datadir" --not_mandatory
# Create app folders mkdir -p $datadir
mkdir -p "$datadir/"
mkdir -p "$datadir/uploads/" mkdir -p "$datadir/uploads/"
chmod 750 "$datadir" chmod 750 "$datadir"
chmod -R o-rwx "$datadir" chmod -R o-rwx "$datadir"
chown -R $app:$app "$datadir" chown -R $app:$app "$datadir"
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================

View file

@ -41,27 +41,6 @@ abort_if_up_to_date
# previous function is what defines 'version', more precisely the 'previous version' # previous function is what defines 'version', more precisely the 'previous version'
previous_version="${version}" previous_version="${version}"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
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"
ynh_secure_remove --file="/usr/share/GeoIP"
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -86,6 +65,27 @@ ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped" ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
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"
ynh_secure_remove --file="/usr/share/GeoIP"
#================================================= #=================================================
# UPGRADE FROM PREVIOUS VERSION # UPGRADE FROM PREVIOUS VERSION
#================================================= #=================================================
@ -125,7 +125,7 @@ fi
ynh_script_progression --message="Making sure dedicated system user exists..." ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# CREATE DATADIR FOLDER # CREATE DATADIR FOLDER
@ -259,7 +259,7 @@ fi
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating a config file..." ynh_script_progression --message="Updating a configuration file..."
config="$final_path/$app/config/prod.secret.exs" config="$final_path/$app/config/prod.secret.exs"