mirror of
https://github.com/YunoHost-Apps/sogo_ynh.git
synced 2024-09-03 20:26:07 +02:00
Merge branch 'testing'
This commit is contained in:
commit
971118dcc7
8 changed files with 105 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
SOGo for Yunohost
|
SOGo for Yunohost
|
||||||
=================
|
=================
|
||||||
|
|
||||||
[![Integration level](https://dash.yunohost.org/integration/sogo.svg)](https://ci-apps.yunohost.org/ci/apps/sogo%20%28Community%29/lastBuild/consoleFull)
|
[![Integration level](https://dash.yunohost.org/integration/sogo.svg)](https://dash.yunohost.org/appci/app/sogo) ![](https://ci-apps.yunohost.org/ci/badges/sogo.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/sogo.maintain.svg)
|
||||||
[![Install sogo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=sogo)
|
[![Install sogo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=sogo)
|
||||||
|
|
||||||
> *This package allow you to install sogo quickly and simply on a YunoHost server.
|
> *This package allow you to install sogo quickly and simply on a YunoHost server.
|
||||||
|
@ -62,7 +62,7 @@ LDAP and HTTP auth are supported.
|
||||||
|
|
||||||
### Supported architectures
|
### Supported architectures
|
||||||
|
|
||||||
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/sog%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/sogo/)
|
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/sogo%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/sogo/)
|
||||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/sogo%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/sogo/)
|
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/sogo%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/sogo/)
|
||||||
|
|
||||||
<!--Limitations
|
<!--Limitations
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
SOGoSentFolderName = Sent;
|
SOGoSentFolderName = Sent;
|
||||||
SOGoTrashFolderName = Trash;
|
SOGoTrashFolderName = Trash;
|
||||||
SOGoDraftsFolderName = Drafts;
|
SOGoDraftsFolderName = Drafts;
|
||||||
SOGoIMAPServer = "imaps://localhost:993/";
|
SOGoIMAPServer = "imap://localhost:143";
|
||||||
SOGoIMAPAclConformsToIMAPExt = YES;
|
SOGoIMAPAclConformsToIMAPExt = YES;
|
||||||
SOGoVacationEnabled = YES;
|
SOGoVacationEnabled = YES;
|
||||||
SOGoForwardEnabled = YES;
|
SOGoForwardEnabled = YES;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"license": "LGPL-2.1,GPL-2.0",
|
"license": "LGPL-2.1,GPL-2.0",
|
||||||
"url": "https://sogo.nu/",
|
"url": "https://sogo.nu/",
|
||||||
"version": "3.2.6-3~ynh1",
|
"version": "4.0.7-1~ynh1",
|
||||||
"description": {
|
"description": {
|
||||||
"en": "Sogo is an opensource groupware for E-Mail, Contacts and Calender.",
|
"en": "Sogo is an opensource groupware for E-Mail, Contacts and Calender.",
|
||||||
"fr": "Sogo est un groupware opensource pour les e-mail, contacts et calendrier"
|
"fr": "Sogo est un groupware opensource pour les e-mail, contacts et calendrier"
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
"mysql"
|
"mysql"
|
||||||
],
|
],
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.5.2.2"
|
"yunohost": ">= 4.0"
|
||||||
},
|
},
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"install" : [
|
"install" : [
|
||||||
|
|
|
@ -94,6 +94,9 @@ python3 add_sso_conf.py
|
||||||
ynh_script_progression --message="Configuring log rotation..."
|
ynh_script_progression --message="Configuring log rotation..."
|
||||||
ynh_use_logrotate --logfile /var/log/$app/sogo.log --nonappend
|
ynh_use_logrotate --logfile /var/log/$app/sogo.log --nonappend
|
||||||
|
|
||||||
|
# Register service
|
||||||
|
yunohost service add $app --log "/var/log/$app/sogo.log"
|
||||||
|
|
||||||
# Restart services
|
# Restart services
|
||||||
ynh_script_progression --message="Starting sogo services..." --weight=3
|
ynh_script_progression --message="Starting sogo services..." --weight=3
|
||||||
systemctl restart sogo
|
systemctl restart sogo
|
||||||
|
|
76
scripts/migrations/3.2-4.0.sh
Normal file
76
scripts/migrations/3.2-4.0.sh
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script comme from the debian package in /usr/share/doc/sogo/sql-update-3.2.10_to_4.0.0-mysql.sh
|
||||||
|
# Some monor modification was made to improve the automation of this script
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# This script only works with MySQL - it does:
|
||||||
|
#
|
||||||
|
# 1- updates c_defaults and c_settings to longtext in the sogo_user_profile table
|
||||||
|
# to avoid truncation of data at 64k
|
||||||
|
# 2- increase the c_mail column to text to contact quick table
|
||||||
|
# 3- add the c_hascertificate column to contact quick table
|
||||||
|
|
||||||
|
defaultusername=$USER
|
||||||
|
defaulthostname=127.0.0.1
|
||||||
|
defaultdatabase=sogo
|
||||||
|
indextable=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSFolderInfoURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||||
|
if [ -z "$indextable" ]; then
|
||||||
|
echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||||
|
|
||||||
|
username="__DBUSER__"
|
||||||
|
hostname=127.0.0.1
|
||||||
|
database="__APP__"
|
||||||
|
dbpasswd="__DBPASS__"
|
||||||
|
|
||||||
|
sqlscript=""
|
||||||
|
|
||||||
|
function growUserProfile() {
|
||||||
|
oldIFS="$IFS"
|
||||||
|
IFS=" "
|
||||||
|
part="`echo -e \"ALTER TABLE sogo_user_profile MODIFY c_defaults LONGTEXT;\\n\"`";
|
||||||
|
sqlscript="$sqlscript$part"
|
||||||
|
part="`echo -e \"ALTER TABLE sogo_user_profile MODIFY c_settings LONGTEXT;\\n\"`";
|
||||||
|
sqlscript="$sqlscript$part"
|
||||||
|
IFS="$oldIFS"
|
||||||
|
}
|
||||||
|
|
||||||
|
function growMailInContactsQuick() {
|
||||||
|
oldIFS="$IFS"
|
||||||
|
IFS=" "
|
||||||
|
part="`echo -e \"ALTER TABLE $table MODIFY c_mail text;\\n\"`";
|
||||||
|
sqlscript="$sqlscript$part"
|
||||||
|
IFS="$oldIFS"
|
||||||
|
}
|
||||||
|
|
||||||
|
function addCertificateInContactsQuick() {
|
||||||
|
oldIFS="$IFS"
|
||||||
|
IFS=" "
|
||||||
|
part="`echo -e \"ALTER TABLE $table ADD c_hascertificate INT4 DEFAULT 0;\\n\"`";
|
||||||
|
sqlscript="$sqlscript$part"
|
||||||
|
IFS="$oldIFS"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
echo "This script will ask for the database password twice" >&2
|
||||||
|
echo "Converting c_content from TEXT to LONGTEXT in the sogo_user_profile table" >&2
|
||||||
|
growUserProfile
|
||||||
|
|
||||||
|
echo "Converting c_mail from VARCHAR(255) to TEXT in Contacts quick tables" >&2
|
||||||
|
if [ -z "$storeurl" ]; then
|
||||||
|
tables=`mysql -p"$dbpasswd" -s -u $username -h $hostname $database -e "select SUBSTRING_INDEX(c_quick_location, '/', -1) from $indextable where c_path3 = 'Contacts';"`
|
||||||
|
else
|
||||||
|
tables="sogo_quick_contact"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for table in $tables;
|
||||||
|
do
|
||||||
|
growMailInContactsQuick
|
||||||
|
addCertificateInContactsQuick
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "$sqlscript" | mysql -p"$dbpasswd" -f -s -u $username -h $hostname $database
|
|
@ -51,6 +51,9 @@ ynh_secure_remove --file="/etc/stunnel/$app.conf"
|
||||||
# Remove custom SSO config
|
# Remove custom SSO config
|
||||||
python3 remove_sso_conf.py
|
python3 remove_sso_conf.py
|
||||||
|
|
||||||
|
# Remove service
|
||||||
|
yunohost service remove $app
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,9 @@ python3 ../settings/scripts/add_sso_conf.py
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
ynh_use_logrotate --logfile /var/log/$app/sogo.log --nonappend
|
ynh_use_logrotate --logfile /var/log/$app/sogo.log --nonappend
|
||||||
|
|
||||||
|
# Register service
|
||||||
|
yunohost service add $app --log "/var/log/$app/sogo.log"
|
||||||
|
|
||||||
# Restart services
|
# Restart services
|
||||||
ynh_script_progression --message="Starting SOGo services..." --weight=3
|
ynh_script_progression --message="Starting SOGo services..." --weight=3
|
||||||
systemctl restart sogo
|
systemctl restart sogo
|
||||||
|
|
|
@ -74,6 +74,18 @@ then
|
||||||
ynh_app_setting_set --app $app --key db_user --value $db_user
|
ynh_app_setting_set --app $app --key db_user --value $db_user
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Manage migration form SOGo 3.x to SOGo 4.x (Debian stretch -> Buster)
|
||||||
|
ynh_script_progression --message="Migrating database if needed..."
|
||||||
|
|
||||||
|
# FIXME use the new way to manage version when available on the core
|
||||||
|
app_previous_version="$(jq -r .version /etc/yunohost/apps/$app/manifest.json | cut -d~ -f1)"
|
||||||
|
if [[ "$app_previous_version" == 3.2.* ]]; then
|
||||||
|
ynh_replace_string --match_string __APP__ --replace_string $app --target_file migrations/3.2-4.0.sh
|
||||||
|
ynh_replace_string --match_string __DBUSER__ --replace_string $db_user --target_file migrations/3.2-4.0.sh
|
||||||
|
ynh_replace_string --match_string __DBPASS__ --replace_string $db_pwd --target_file migrations/3.2-4.0.sh
|
||||||
|
bash migrations/3.2-4.0.sh
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -118,6 +130,9 @@ python3 add_sso_conf.py
|
||||||
ynh_script_progression --message="Configuring log rotation..."
|
ynh_script_progression --message="Configuring log rotation..."
|
||||||
ynh_use_logrotate --logfile /var/log/$app/sogo.log --nonappend
|
ynh_use_logrotate --logfile /var/log/$app/sogo.log --nonappend
|
||||||
|
|
||||||
|
# Register service
|
||||||
|
yunohost service add $app --log "/var/log/$app/sogo.log"
|
||||||
|
|
||||||
# Restart services
|
# Restart services
|
||||||
ynh_script_progression --message="Starting SOGo services..." --weight=3
|
ynh_script_progression --message="Starting SOGo services..." --weight=3
|
||||||
systemctl restart sogo
|
systemctl restart sogo
|
||||||
|
|
Loading…
Reference in a new issue