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

Merge pull request #6 from YunoHost-Apps/testing

apply example_ynh
This commit is contained in:
yalh76 2020-04-22 00:14:45 +02:00 committed by GitHub
commit bce0ad1582
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 374 additions and 219 deletions

View file

@ -1,26 +1,44 @@
Jeedom for YunoHost Jeedom for YunoHost
======== ========
[![Integration level](https://dash.yunohost.org/integration/jeedom.svg)](https://dash.yunohost.org/appci/app/jeedom) ![](https://ci-apps.yunohost.org/ci/badges/jeedom.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/jeedom.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/REPLACEBYYOURAPP.svg)](https://dash.yunohost.org/appci/app/REPLACEBYYOURAPP)
[![Install REPLACEBYYOURAPP with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=REPLACEBYYOURAPP)
> *This package allow you to install REPLACEBYYOURAPP quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
## Overview
Jeedom is an home automation software. Jeedom is an home automation software.
**Shipped version:** 3.3.45
## Screenshots
![Jeedom](https://www.jeedom.com/site/img/01-Appli-jeedom.png) ![Jeedom](https://www.jeedom.com/site/img/01-Appli-jeedom.png)
## YunoHost specific features
This application is installing Jeedom on a [YunoHost server](https://yunohost.org/#/). #### Multi-users support
**Main features of jeedom_ynh**: - LDAP login: your YunoHost users also become Jeedom users
## Links
- Automatic installation and upgrade of Jeedom * Report a bug: https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/issues
- SSO login: your YunoHost users also become Jeedom users * App website: https://www.jeedom.com/
- Backup and restore scripts * Upstream app repository: https://github.com/jeedom/core
* YunoHost website: https://yunohost.org/
---
**Current version**: [See in the app.src](conf/app.src) Developers info
----------------
More information about Jeedom : https://www.jeedom.com/ **Only if you want to use a testing branch for coding, instead of merging directly into master.**
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing).
More information about Yunohost : https://yunohost.org/#/ To try the testing branch, please proceed like that.
```
Thanks @Lunarok for the hard work! sudo yunohost app install https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug
or
sudo yunohost app upgrade REPLACEBYYOURAPP -u https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug
```

View file

@ -14,7 +14,6 @@
setup_public=0 setup_public=0
upgrade=1 upgrade=1
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=0
incorrect_path=1
port_already_use=0 port_already_use=0
change_url=0 change_url=0

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/jeedom/core/archive/3.1.tar.gz SOURCE_URL=https://github.com/jeedom/core/archive/6d050fc167ad7845d174a9b0b9d82009d92439b3.tar.gz
SOURCE_SUM=9f3eafb76402f43fe9d4d459276ec7b267d0a0495c499f073c2da1737d238cd9 SOURCE_SUM=44cf984b8375a5e4cd05d9bcc17ceff97690790b909f20951274a69443e4f06c
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,29 +1,23 @@
location __PATH__ { #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/ ; alias __FINALPATH__/ ;
# Force usage of https
if ($scheme = http) { if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }
# Example PHP configuration (remove if not used)
index index.php; index index.php;
# Common parameter to increase upload size limit in conjuction with dedicated php-fpm file # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
#client_max_body_size 50M; #client_max_body_size 50M;
try_files $uri $uri/ index.php; try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
# If you don't use a dedicated fpm config for your app,
# use a general fpm pool.
# This is to be used INSTEAD of line above
# Don't forget to adjust scripts install/upgrade/remove/backup accordingly
#
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;
@ -35,7 +29,6 @@ location __PATH__ {
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_FILENAME $request_filename;
} }
# PHP configuration end
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;

View file

@ -1,10 +1,11 @@
; Start a new pool named 'www'. ; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the ; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here) ; pool name ('www' here)
[__NAMETOCHANGE__] [__NAMETOCHANGE__]
; Per pool prefix ; Per pool prefix
; It only applies on the following directives: ; It only applies on the following directives:
; - 'access.log'
; - 'slowlog' ; - 'slowlog'
; - 'listen' (unixsocket) ; - 'listen' (unixsocket)
; - 'chroot' ; - 'chroot'
@ -24,17 +25,19 @@ group = __USER__
; The address on which to accept FastCGI requests. ; The address on which to accept FastCGI requests.
; Valid syntaxes are: ; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port; ; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; specific port; ; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket. ; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory. ; Note: This value is mandatory.
listen = /var/run/php5-fpm-__NAMETOCHANGE__.sock listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock
; Set listen(2) backlog. A value of '-1' means unlimited. ; Set listen(2) backlog.
; Default Value: 128 (-1 on FreeBSD and OpenBSD) ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 128 ;listen.backlog = 511
; Set permissions for unix socket, if one is used. In Linux, read/write ; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many ; permissions must be set in order to allow connections from a web server. Many
@ -44,8 +47,13 @@ listen = /var/run/php5-fpm-__NAMETOCHANGE__.sock
listen.owner = www-data listen.owner = www-data
listen.group = www-data listen.group = www-data
;listen.mode = 0660 ;listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =
; List of ipv4 addresses of FastCGI clients which are allowed to connect. ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be ; must be separated by a comma. If this value is left blank, connections will be
@ -59,7 +67,13 @@ listen.group = www-data
; - The pool processes will inherit the master process priority ; - The pool processes will inherit the master process priority
; unless it specified otherwise ; unless it specified otherwise
; Default Value: no set ; Default Value: no set
; priority = -19 ; process.priority = -19
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
; or group is differrent than the master process user. It allows to create process
; core dump and ptrace the process for the pool user.
; Default Value: no
; process.dumpable = yes
; Choose how the process manager will control the number of child processes. ; Choose how the process manager will control the number of child processes.
; Possible Values: ; Possible Values:
@ -215,7 +229,7 @@ pm.max_requests = 500
; last request memory: 0 ; last request memory: 0
; ;
; Note: There is a real-time FPM status monitoring sample web page available ; Note: There is a real-time FPM status monitoring sample web page available
; It's available in: ${prefix}/share/fpm/status.html ; It's available in: /usr/share/php/7.0/fpm/status.html
; ;
; Note: The value must start with a leading slash (/). The value can be ; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it ; anything, but it may not be a good idea to use the .php extension or it
@ -275,7 +289,7 @@ pm.max_requests = 500
; - %{megabytes}M ; - %{megabytes}M
; - %{mega}M ; - %{mega}M
; %n: pool name ; %n: pool name
; %o: ouput header ; %o: output header
; it must be associated with embraces to specify the name of the header: ; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o ; - %{Content-Type}o
; - %{X-Powered-By}o ; - %{X-Powered-By}o
@ -291,9 +305,13 @@ pm.max_requests = 500
; %t: server time the request was received ; %t: server time the request was received
; it can accept a strftime(3) format: ; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default) ; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %T: time the log has been written (the request has finished) ; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format: ; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default) ; %d/%b/%Y:%H:%M:%S %z (default)
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
; %u: remote user ; %u: remote user
; ;
; Default: "%R - %u %t \"%m %r\" %s" ; Default: "%R - %u %t \"%m %r\" %s"
@ -349,13 +367,22 @@ chdir = __FINALPATH__
; Default Value: no ; Default Value: no
catch_workers_output = yes catch_workers_output = yes
; Clear environment in FPM workers
; Prevents arbitrary environment variables from reaching FPM worker processes
; by clearing the environment in workers before env vars specified in this
; pool configuration are added.
; Setting to "no" will make all environment variables available to PHP code
; via getenv(), $_ENV and $_SERVER.
; Default Value: yes
;clear_env = no
; Limits the extensions of the main script FPM will allow to parse. This can ; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit ; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to ; FPM to .php extensions to prevent malicious users to use other extensions to
; exectute php code. ; execute php code.
; Note: set an empty value to allow all extensions. ; Note: set an empty value to allow all extensions.
; Default Value: .php ; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5 ;security.limit_extensions = .php .php3 .php4 .php5 .php7
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment. ; the current environment.
@ -390,3 +417,14 @@ catch_workers_output = yes
;php_admin_value[error_log] = /var/log/fpm-php.www.log ;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on ;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M ;php_admin_value[memory_limit] = 32M
; Common values to change to increase file upload limit
php_admin_value[upload_max_filesize] = 1G
php_admin_value[post_max_size] = 1G
; php_admin_flag[mail.add_x_header] = Off
; Other common parameters
php_admin_value[max_execution_time] = 300
; php_admin_value[max_input_time] = 300
; php_admin_value[memory_limit] = 256M
; php_admin_flag[short_open_tag] = On

View file

@ -1,6 +0,0 @@
max_execution_time = 300
upload_max_filesize = 1G
post_max_size = 1G
expose_php = Off
opcache.enable=1
opcache.enable_cli=1

View file

@ -6,7 +6,7 @@
"en": "Jeedom is a home automation application", "en": "Jeedom is a home automation application",
"fr": "Jeedom est une application de domotique" "fr": "Jeedom est une application de domotique"
}, },
"version": "1.0", "version": "3.3.45~ynh1",
"url": "http://www.jeedom.fr/", "url": "http://www.jeedom.fr/",
"license": "free", "license": "free",
"maintainer": { "maintainer": {
@ -14,12 +14,12 @@
"url": "https://github.com/scith" "url": "https://github.com/scith"
}, },
"requirements": { "requirements": {
"yunohost": ">= 2.7.2" "yunohost": ">= 3.5"
}, },
"multi_instance": false, "multi_instance": false,
"services": [ "services": [
"nginx", "nginx",
"php5-fpm", "php7.0-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {
@ -35,6 +35,7 @@
}, },
{ {
"name": "path", "name": "path",
"type": "path",
"ask": { "ask": {
"en": "Choose a path for Jeedom", "en": "Choose a path for Jeedom",
"fr": "Choisissez un chemin pour Jeedom" "fr": "Choisissez un chemin pour Jeedom"

View file

@ -1,2 +1,21 @@
#!/bin/bash #!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
# dependencies used by the app
pkg_dependencies="php-curl php-gd php-imap php-xml php-opcache php-soap php-xmlrpc php-common php-dev php-zip php-ssh2 php-mbstring php-ldap"
# ntp usb-modeswitch python-serial
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -6,65 +6,71 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
if [ ! -e _common.sh ]; then #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
# Get the _common.sh file if it's not in the current directory source ../settings/scripts/_common.sh
cp ../settings/scripts/_common.sh ./_common.sh
chmod a+rx _common.sh
fi
source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () {
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
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get $app db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_print_info --message="Backing up the main app directory..."
ynh_backup "$final_path" ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Backing up nginx web server configuration..."
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# BACKUP THE PHP-FPM CONFIGURATION # BACKUP THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Backing up php-fpm configuration..."
ynh_backup "/etc/php5/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf"
ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
#================================================= #=================================================
# BACKUP THE MYSQL DATABASE # BACKUP THE MYSQL DATABASE
#================================================= #=================================================
ynh_print_info --message="Backing up the MySQL database..."
ynh_mysql_dump_db "$db_name" > db.sql ynh_mysql_dump_db --database="$db_name" > db.sql
#================================================= #=================================================
# BACKUP LOGROTATE
#================================================= #=================================================
# BACKUP CRON FILES
#=================================================
ynh_print_info --message="Backing up cron files..."
ynh_backup "/etc/logrotate.d/$app" ynh_backup --src_path="/etc/cron.d/${app}"
ynh_backup --src_path="/etc/cron.d/${app}_watchdog"
#================================================= #=================================================
# BACKUP THE CRON FILES # END OF SCRIPT
#================================================= #=================================================
ynh_backup "/etc/cron.d/${app}" ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
ynh_backup "/etc/cron.d/${app}_watchdog"

View file

@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# RETRIEVE ARGUMENTS # RETRIEVE ARGUMENTS
#================================================= #=================================================
ynh_print_info --message="Retrieve arguments from the manifest"
old_domain=$YNH_APP_OLD_DOMAIN old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH old_path=$YNH_APP_OLD_PATH
@ -22,13 +23,34 @@ new_path=$YNH_APP_NEW_PATH
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# CHECK THE SYNTAX OF THE PATHS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info --message="Loading installation settings..."
test -n "$old_path" || old_path="/" # Needed for helper "ynh_add_nginx_config"
test -n "$new_path" || new_path="/" final_path=$(ynh_app_setting_get --app=$app --key=final_path)
new_path=$(ynh_normalize_url_path $new_path)
old_path=$(ynh_normalize_url_path $old_path) # Add settings here as needed by your application
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#db_user=$db_name
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_print_info --message="Backing up the app before changing its url (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED # CHECK WHICH PARTS SHOULD BE CHANGED
@ -51,31 +73,30 @@ fi
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_print_info --message="Updating nginx web server configuration..."
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
# Change the path in the nginx config file # Change the path in the nginx config file
if [ $change_path -eq 1 ] if [ $change_path -eq 1 ]
then then
# Make a backup of the original nginx config file if modified # Make a backup of the original nginx config file if modified
ynh_backup_if_checksum_is_different "$nginx_conf_path" ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
# Replace locations starting with old_path # Set global variables for nginx helper
# Look for every location possible patterns (see https://nginx.org/en/docs/http/ngx_http_core_module.html#location) domain="$old_domain"
ynh_replace_string "location\( \(=\|~\|~\*\|\^~\)\)\? $old_path" "location\1 $new_path" "$nginx_conf_path" path_url="$new_path"
# Replace path in "return" directives # Create a dedicated nginx config
ynh_replace_string "return \([[:digit:]]\{3\}\) $old_path" "return \1 $new_path" "$nginx_conf_path" ynh_add_nginx_config
# Calculate and store the nginx config file checksum
ynh_store_file_checksum "$nginx_conf_path"
fi fi
# Change the domain for nginx # Change the domain for nginx
if [ $change_domain -eq 1 ] if [ $change_domain -eq 1 ]
then then
# Delete file checksum for the old conf file location # Delete file checksum for the old conf file location
ynh_delete_file_checksum "$nginx_conf_path" ynh_delete_file_checksum --file="$nginx_conf_path"
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
# Store file checksum for the new config file location # Store file checksum for the new config file location
ynh_store_file_checksum "/etc/nginx/conf.d/$new_domain.d/$app.conf" ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi fi
#================================================= #=================================================
@ -83,6 +104,12 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_print_info --message="Reloading nginx web server..."
systemctl reload nginx ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Change of URL completed for $app"

View file

@ -12,13 +12,18 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () {
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
#================================================= #=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
ynh_print_info --message="Retrieving arguments from the manifest..."
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
@ -30,52 +35,54 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#================================================= #=================================================
ynh_print_info --message="Validating installation parameters..."
final_path=/var/www/$app final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder" test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Normalize the url path syntax
path_url=$(ynh_normalize_url_path $path_url)
# Check web path availability
ynh_webpath_available $domain $path_url
# Register (book) web path # Register (book) web path
ynh_webpath_register $app $domain $path_url ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_print_info --message="Storing installation settings..."
ynh_app_setting_set $app domain $domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set $app path $path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set $app admin $admin ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set --app=$app --key=sudo --value=$sudo
ynh_app_setting_set $app sudo $sudo
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_print_info --message="Installing dependencies..."
#ynh_install_app_dependencies ntp usb-modeswitch python-serial ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# CREATE A MYSQL DATABASE # CREATE A MYSQL DATABASE
#================================================= #=================================================
ynh_print_info --message="Creating a MySQL database..."
db_name=$(ynh_sanitize_dbid $app) db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set $app db_name $db_name db_user=$db_name
ynh_mysql_setup_db $db_name $db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_print_info --message="Setting up source files..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path" ynh_setup_source --dest_dir="$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Configuring nginx web server..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -83,6 +90,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_print_info --message="Configuring system user..."
# Create a system user # Create a system user
ynh_system_user_create $app ynh_system_user_create $app
@ -109,6 +117,7 @@ ynh_system_user_create $app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Configuring php-fpm..."
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config ynh_add_fpm_config
@ -116,6 +125,9 @@ ynh_add_fpm_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# INSTALL JEEDOM
#=================================================
ynh_print_info --message="Installing Jeedom..."
# Configure Jeedom database and initialize app # Configure Jeedom database and initialize app
ynh_replace_string "#DBNAME#" "$db_name" ../conf/common.config.php ynh_replace_string "#DBNAME#" "$db_name" ../conf/common.config.php
@ -142,9 +154,20 @@ sudo chown root /etc/cron.d/${app}_watchdog
# Check # Check
#sudo php $final_path/install/sick.php #sudo php $final_path/install/sick.php
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
ynh_print_info --message="Storing the config file checksum..."
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/core/config/common.config.php"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
ynh_print_info --message="Securing files and directories..."
# Set permissions to app files # Set permissions to app files
chown -R $app: $final_path chown -R $app: $final_path
@ -154,26 +177,27 @@ chmod 775 -R $final_path
mkdir -p /tmp/jeedom mkdir -p /tmp/jeedom
chmod 777 -R /tmp/jeedom chmod 777 -R /tmp/jeedom
#=================================================
# SETUP LOGROTATE
#=================================================
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_print_info --message="Configuring SSOwat..."
# Remove the public access # Remove the public access
ynh_app_setting_delete $app skipped_uris ynh_app_setting_delete --app=$app --key=skipped_uris
# Access to API without SSO # Access to API without SSO
ynh_app_setting_set "$app" unprotected_uris "/core/api/jeeApi.php" ynh_app_setting_set --app=$app --key=unprotected_uris --value="/core/api/jeeApi.php"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_print_info --message="Reloading nginx web server..."
systemctl reload nginx ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Installation of $app completed"

View file

@ -12,48 +12,46 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
port=$(ynh_app_setting_get $app port) domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get $app db_name)
db_pwd=$(ynh_app_setting_get $app db_pwd) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
final_path=$(ynh_app_setting_get $app final_path) db_user=$db_name
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#================================================= #=================================================
# REMOVE SERVICE FROM ADMIN PANEL # STANDARD REMOVE
#================================================= #=================================================
# REMOVE THE MYSQL DATABASE
#=================================================
ynh_print_info --message="Removing the MySQL database..."
if yunohost service status | grep -q $app # Remove a database if it exists, along with the associated user
then ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
echo "Remove $app service"
yunohost service remove $app
fi
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
ynh_print_info --message="Removing dependencies..."
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
#ynh_remove_app_dependencies ynh_remove_app_dependencies
#=================================================
# REMOVE THE MYSQL DATABASE
#=================================================
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db $db_name $db_name
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_print_info --message="Removing app main directory..."
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove "$final_path" ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Removing nginx web server configuration..."
# Remove the dedicated nginx config # Remove the dedicated nginx config
ynh_remove_nginx_config ynh_remove_nginx_config
@ -61,35 +59,32 @@ ynh_remove_nginx_config
#================================================= #=================================================
# REMOVE PHP-FPM CONFIGURATION # REMOVE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Removing php-fpm configuration..."
# Remove the dedicated php-fpm config # Remove the dedicated php-fpm config
ynh_remove_fpm_config ynh_remove_fpm_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
# Remove the app-specific logrotate config
ynh_remove_logrotate
#================================================= #=================================================
# REMOVE THE CRON FILE # REMOVE THE CRON FILE
#================================================= #=================================================
ynh_print_info --message="Removing the cron file..."
# Remove cron files # Remove cron files
ynh_secure_remove "/etc/cron.d/${app}" ynh_secure_remove --file="/etc/cron.d/${app}"
ynh_secure_remove "/etc/cron.d/${app}_watchdog" ynh_secure_remove --file="/etc/cron.d/${app}_watchdog"
# Remove the log files
ynh_secure_remove "/var/log/$app/"
# Remove the tmp files
ynh_secure_remove "/tmp/jeedom/"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# REMOVE DEDICATED USER # REMOVE DEDICATED USER
#================================================= #=================================================
ynh_print_info --message="Removing the dedicated system user..."
# Delete a system user # Delete a system user
ynh_system_user_delete $app ynh_system_user_delete --username=$app
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Removal of $app completed"

View file

@ -6,68 +6,66 @@
# IMPORT GENERIC HELPERS # IMPORT GENERIC HELPERS
#================================================= #=================================================
if [ ! -e _common.sh ]; then #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
# Get the _common.sh file if it's not in the current directory source ../settings/scripts/_common.sh
cp ../settings/scripts/_common.sh ./_common.sh
chmod a+rx _common.sh
fi
source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () {
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
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info --message="Loading settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get $app path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get $app db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
sudo=$(ynh_app_setting_get $app sudo) db_user=$db_name
sudo=$(ynh_app_setting_get --app=$app --key=sudo)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_print_info --message="Validating restoration parameters..."
ynh_webpath_available $domain $path_url \ ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die "Path not available: ${domain}${path_url}" || ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \ test ! -d $final_path \
|| ynh_die "There is already a directory: $final_path " || ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Restoring the nginx configuration..."
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_restore_file "$final_path" ynh_restore_file --origin_path="$final_path"
#=================================================
# RESTORE THE MYSQL DATABASE
#=================================================
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
ynh_mysql_setup_db $db_name $db_name $db_pwd
ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create $app ynh_system_user_create --username=$app
# For nginx user to be able to communicate with home automation devices # For nginx user to be able to communicate with home automation devices
if [ $(getent group dialout) ]; then if [ $(getent group dialout) ]; then
@ -91,6 +89,7 @@ ynh_system_user_create $app
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
ynh_print_info --message="Restoring user rights..."
# Restore permissions on app files # Restore permissions on app files
chown -R $app: $final_path chown -R $app: $final_path
@ -103,40 +102,49 @@ chmod 777 -R /tmp/jeedom
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Restoring PHP-FPM configuration..."
ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf"
ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini"
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
# Define and install dependencies # Define and install dependencies
#ynh_install_app_dependencies ntp usb-modeswitch python-serial ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
ynh_print_info --message="Restoring the MySQL database..."
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
yunohost service add $app --log "/var/log/$app/APP.log"
#================================================= #=================================================
# RESTORE THE CRON FILES # RESTORE THE CRON FILES
#================================================= #=================================================
ynh_print_info --message="Restoring cron files..."
ynh_restore_file "/etc/cron.d/${app}" ynh_restore_file --origin_path="/etc/cron.d/${app}"
ynh_restore_file "/etc/cron.d/${app}_watchdog" ynh_restore_file --origin_path="/etc/cron.d/${app}_watchdog"
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # GENERIC FINALIZATION
#=================================================
ynh_restore_file "/etc/logrotate.d/$app"
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_print_info --message="Reloading nginx web server and php-fpm..."
systemctl reload php5-fpm ynh_systemd_action --service_name=php7.0-fpm --action=reload
systemctl reload nginx ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Restoration completed for $app"

View file

@ -12,49 +12,58 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get $app path) path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get $app admin) admin=$(ynh_app_setting_get --app=$app --key=admin)
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get $app port) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_name=$(ynh_app_setting_get $app db_name) sudo=$(ynh_app_setting_get --app=$app --key=sudo)
sudo=$(ynh_app_setting_get $app sudo)
#=================================================
# CHECK VERSION
#=================================================
ynh_print_info --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_print_info --message="Ensuring downward compatibility..."
# Fix is_public as a boolean value # Fix is_public as a boolean value
if [ "$sudo" = "Yes" ]; then if [ "$sudo" = "Yes" ]; then
ynh_app_setting_set $app sudo 1 ynh_app_setting_set --app=$app --key=sudo --value=1
sudo=1 sudo=1
# Removes sudo to www-data # Removes sudo to www-data
if [ $(sudo grep "www-data ALL=(ALL) NOPASSWD: ALL" /etc/sudoers | wc -l) -eq 0 ];then if [ $(sudo grep "www-data ALL=(ALL) NOPASSWD: ALL" /etc/sudoers | wc -l) -eq 0 ];then
sudo sed -i "/www-data ALL=(ALL) NOPASSWD: ALL/d" /etc/sudoers sudo sed -i "/www-data ALL=(ALL) NOPASSWD: ALL/d" /etc/sudoers
fi fi
elif [ "$sudo" = "No" ]; then elif [ "$sudo" = "No" ]; then
ynh_app_setting_set $app sudo 0 ynh_app_setting_set --app=$app --key=sudo --value=0
sudo=0 sudo=0
fi fi
# If db_name doesn't exist, create it # If db_name doesn't exist, create it
if [ -z $db_name ]; then if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid $app) db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set $app db_name $db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name
fi fi
# If final_path doesn't exist, create it # If final_path doesn't exist, create it
if [ -z $final_path ]; then if [ -z "$final_path" ]; then
final_path=/var/www/$app final_path=/var/www/$app
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_print_info --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -72,26 +81,42 @@ ynh_abort_if_errors
# Normalize the URL path syntax # Normalize the URL path syntax
path_url=$(ynh_normalize_url_path $path_url) path_url=$(ynh_normalize_url_path $path_url)
#=================================================
# STANDARD UPGRADE STEPS
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
# Download, check integrity, uncompress and patch the source from app.src if [ "$upgrade_type" == "UPGRADE_APP" ]
ynh_setup_source "$final_path" then
ynh_print_info --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Upgrading nginx web server configuration..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_print_info --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_print_info --message="Making sure dedicated system user exists..."
# Create a system user # Create a dedicated user (if not existing)
ynh_system_user_create $app ynh_system_user_create --username=$app
# For nginx user to be able to communicate with home automation devices # For nginx user to be able to communicate with home automation devices
if [ $(getent group dialout) ]; then if [ $(getent group dialout) ]; then
@ -115,13 +140,17 @@ ynh_system_user_create $app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Upgrading php-fpm configuration..."
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config ynh_add_fpm_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC UPGRADE
#================================================= #=================================================
# UPGRADE JEEDOM
#=================================================
ynh_print_info --message="Upgrading Jeedom..."
# Upgrade Jeedom # Upgrade Jeedom
sudo php $final_path/install/install.php mode=force sudo php $final_path/install/install.php mode=force
@ -138,9 +167,12 @@ sudo chown root /etc/cron.d/${app}_watchdog
# Check # Check
#sudo php $final_path/install/sick.php #sudo php $final_path/install/sick.php
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
ynh_print_info --message="Securing files and directories..."
# Set permissions to app files # Set permissions to app files
chown -R $app: $final_path chown -R $app: $final_path
@ -150,27 +182,28 @@ chmod 775 -R $final_path
mkdir -p /tmp/jeedom mkdir -p /tmp/jeedom
chmod 777 -R /tmp/jeedom chmod 777 -R /tmp/jeedom
#=================================================
# SETUP LOGROTATE
#=================================================
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_print_info --message="Upgrading SSOwat configuration..."
# Remove the public access # Remove the public access
ynh_app_setting_delete $app skipped_uris ynh_app_setting_delete --app=$app --key=skipped_uris
# Access to API without SSO # Access to API without SSO
ynh_app_setting_set "$app" unprotected_uris "/core/api/jeeApi.php" ynh_app_setting_set --app="$app" --key=unprotected_uris --value="/core/api/jeeApi.php"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_print_info --message="Reloading nginx web server..."
systemctl reload nginx ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Upgrade of $app completed"