1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/sogo_ynh.git synced 2024-09-03 20:26:07 +02:00

Fix Activesync and improve nginx config

This commit is contained in:
Josué Tille 2019-02-08 10:21:19 +01:00
parent 2dc33ec32e
commit 8c4f02cc20
No known key found for this signature in database
GPG key ID: D5E068C6DFA8681D
8 changed files with 41 additions and 6 deletions

View file

@ -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-2~ynh1", "version": "3.2.6-3~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"

View file

@ -71,16 +71,17 @@ location /Microsoft-Server-ActiveSync/ {
} }
" >> "$nginx_config_path" " >> "$nginx_config_path"
grep "/.well-known/caldav" $nginx_domain_path || echo "# For Caldav
grep "/.well-known/caldav" $nginx_domain_path || echo "location /.well-known/caldav { location /.well-known/caldav {
rewrite ^ https://\$server_name/SOGo/dav/; rewrite ^ https://\$server_name/SOGo/dav/;
} }
" >> "$nginx_config_path" " >> "$nginx_config_path"
grep "/.well-known/carddav" $nginx_domain_path || echo "location /.well-known/carddav { grep "/.well-known/carddav" $nginx_domain_path || echo "# For Carddav
location /.well-known/carddav {
rewrite ^ https://\$server_name/SOGo/dav/; rewrite ^ https://\$server_name/SOGo/dav/;
} }
" >> "$nginx_config_path" " >> "$nginx_config_path"
ynh_store_file_checksum "$nginx_config_path" ynh_store_file_checksum "$nginx_config_path"

16
scripts/add_sso_conf.py Normal file
View file

@ -0,0 +1,16 @@
#!/usr/bin/python3
import json
with open("/etc/ssowat/conf.json.persistent", "r", encoding='utf-8') as jsonFile:
try:
data = json.load(jsonFile)
except:
print("File /etc/ssowat/conf.json.persistent corrupt, make a new file")
data = {}
if not "skipped_urls" in data:
data["skipped_urls"] = []
data["skipped_urls"] = list(set(data["skipped_urls"]) | set(["/Microsoft-Server-ActiveSync", "/principals"]))
with open("/etc/ssowat/conf.json.persistent", "w", encoding='utf-8') as jsonFile:
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))

View file

@ -80,6 +80,7 @@ then # Retire l'accès public
else else
ynh_app_setting_set $app unprotected_uris "/" ynh_app_setting_set $app unprotected_uris "/"
fi fi
python3 add_sso_conf.py
# SETUP LOGROTATE # SETUP LOGROTATE
ynh_use_logrotate /var/log/$app/sogo.log --non-append ynh_use_logrotate /var/log/$app/sogo.log --non-append

View file

@ -39,5 +39,8 @@ ynh_secure_remove "/etc/$app"
# Remove stunnel config # Remove stunnel config
ynh_secure_remove "/etc/stunnel/$app.conf" ynh_secure_remove "/etc/stunnel/$app.conf"
# Remove custom SSO config
python3 remove_sso_conf.py
# Remove the app-specific logrotate config # Remove the app-specific logrotate config
ynh_remove_logrotate ynh_remove_logrotate

View file

@ -0,0 +1,11 @@
#!/usr/bin/python3
import json
with open("/etc/ssowat/conf.json.persistent", "r", encoding='utf-8') as jsonFile:
data = json.load(jsonFile)
data["skipped_urls"].remove("/Microsoft-Server-ActiveSync")
data["skipped_urls"].remove("/principals")
with open("/etc/ssowat/conf.json.persistent", "w", encoding='utf-8') as jsonFile:
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))

View file

@ -48,6 +48,8 @@ ynh_replace_string "ENABLED=0" "ENABLED=1" /etc/default/stunnel4
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
set_permission set_permission
python3 ../settings/scripts/add_sso_conf.py
# SETUP LOGROTATE # SETUP LOGROTATE
ynh_use_logrotate /var/log/$app/sogo.log --non-append ynh_use_logrotate /var/log/$app/sogo.log --non-append

View file

@ -103,6 +103,7 @@ then # Retire l'accès public
else else
ynh_app_setting_set $app unprotected_uris "/" ynh_app_setting_set $app unprotected_uris "/"
fi fi
python3 add_sso_conf.py
# SETUP LOGROTATE # SETUP LOGROTATE
ynh_use_logrotate /var/log/$app/sogo.log --non-append ynh_use_logrotate /var/log/$app/sogo.log --non-append