mirror of
https://github.com/YunoHost-Apps/collabora_ynh.git
synced 2024-09-03 18:16:25 +02:00
Fix installation and config handling ...
This commit is contained in:
parent
5fe67775bf
commit
ca1b291b49
5 changed files with 23 additions and 32 deletions
|
@ -1,3 +1,9 @@
|
|||
rewrite ^$ /;
|
||||
location ~ ^/$ {
|
||||
default_type text/plain;
|
||||
return 200 "This is where Collabora Online is installed. To actually be useful, this needs to be integrated in a front-end such as Nextcloud for example.";
|
||||
}
|
||||
|
||||
# static files
|
||||
location ^~ /loleaflet {
|
||||
proxy_pass http://localhost:__PORT__;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"email": "rafi59_dev@srvmaison.fr.nf"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.8.1"
|
||||
"yunohost": ">= 4.1.4.4"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
|
|
|
@ -60,6 +60,17 @@ port=$(ynh_find_port --port=9980)
|
|||
|
||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE ONLYOFFICE
|
||||
#=================================================
|
||||
|
||||
# Turns out we need to create/copy this file BEFORE the actual .deb install,
|
||||
# otherwise stupid collabora will expect to find a certificate file in its own
|
||||
# config directory which of course doesn't exists and we want to disable SSL
|
||||
# because we're in a reverse proxy context...
|
||||
mkdir -p /etc/loolwsd
|
||||
ynh_add_config ../conf/loolwsd.xml /etc/loolwsd/loolwsd.xml
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -79,23 +90,6 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
config="/etc/loolwsd/loolwsd.xml"
|
||||
|
||||
cp -f ../conf/loolwsd.xml $config
|
||||
|
||||
ynh_replace_string --match_string="__NEXTCLOUD_DOMAIN__" --replace_string="$nextcloud_domain" --target_file="$config"
|
||||
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$config"
|
||||
|
||||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
|
||||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum "/etc/loolwsd/loolwsd.xml"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -104,7 +98,8 @@ ynh_store_file_checksum "/etc/loolwsd/loolwsd.xml"
|
|||
ynh_script_progression --message="Starting a systemd service..."
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemd_action --service_name="loolwsd" --action="start" --log_path="systemd" --line_match="Started LibreOffice Online WebSocket Daemon"
|
||||
# NB. : we need a stupid *re*start because the service is in fact already started during the damn package install ... so it won't find a recent "Ready to accept connection" match ...
|
||||
ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections"
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
|
|
@ -68,7 +68,7 @@ ynh_restore_file --origin_path="/etc/loolwsd/loolwsd.xml"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..."
|
||||
|
||||
ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Started LibreOffice Online WebSocket Daemon"
|
||||
ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -89,17 +89,7 @@ ynh_install_extra_app_dependencies --repo="deb https://collaboraoffice.com/repos
|
|||
# UPGRADE CONFIG
|
||||
#=================================================
|
||||
|
||||
config="/etc/loolwsd/loolwsd.xml"
|
||||
|
||||
ynh_backup_if_checksum_is_different --file="$config"
|
||||
|
||||
cp -f ../conf/loolwsd.xml $config
|
||||
|
||||
ynh_replace_string "__NEXTCLOUD_DOMAIN__" "$nextcloud_domain" "$config"
|
||||
ynh_replace_string "__PASSWORD__" "$password" "$config"
|
||||
|
||||
# Recalculate and store the checksum of the file for the next upgrade.
|
||||
ynh_store_file_checksum --file="$config"
|
||||
ynh_add_config "../conf/loolwsd.xml" "/etc/loolwsd/loolwsd.xml"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
@ -117,7 +107,7 @@ ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..."
|
||||
|
||||
ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Started LibreOffice Online WebSocket Daemon"
|
||||
ynh_systemd_action --service_name="loolwsd" --action="restart" --log_path="systemd" --line_match="Ready to accept connections"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
Loading…
Reference in a new issue