mirror of
https://github.com/YunoHost-Apps/webtrees_ynh.git
synced 2024-09-03 18:26:37 +02:00
Updated to version 1.7.13
This commit is contained in:
parent
385ba29ab5
commit
aa09fa11c9
13 changed files with 287 additions and 78 deletions
5
LICENSE
5
LICENSE
|
@ -1,7 +1,4 @@
|
||||||
License
|
Copyright (C) 2019 webtrees development team
|
||||||
|
|
||||||
webtrees: online genealogy
|
|
||||||
Copyright (C) 2017 webtrees development team
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
|
21
README.md
21
README.md
|
@ -1,13 +1,30 @@
|
||||||
# Webtrees for YunoHost
|
# Webtrees for YunoHost
|
||||||
[![Install Hubzilla with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=webtrees)<br><br>
|
[![Integration level](https://dash.yunohost.org/integration/webtrees.svg)](https://dash.yunohost.org/appci/app/webtrees)
|
||||||
|
[![Install webtrees with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=webtrees)
|
||||||
|
|
||||||
**VERY IMPORTANT: There is a security fix in nginx. Please update as soon as posible regarless of any version you are on.**
|
**VERY IMPORTANT: There is a security fix in nginx. Please update as soon as posible regarless of any version you are on.**
|
||||||
|
|
||||||
Leading on-line collaborative genealogy application https://www.webtrees.net<br>
|
Leading on-line collaborative genealogy application https://www.webtrees.net<br>
|
||||||
version: **1.7.12**,released **8 Dec 2018**<br>,<br>
|
version: **1.7.13**,released **9 March 2019**<br>,<br>
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
webtrees is the web's leading online collaborative genealogy application.
|
||||||
|
|
||||||
|
-It works from standard GEDCOM files, and is therefore compatible with every major desktop application.
|
||||||
|
-It aims to to be efficient and effective by using the right combination of third-party tools, design techniques and open standards.
|
||||||
|
|
||||||
|
webtrees allows you to view and edit your genealogy on your website. It has full editing capabilities, full privacy functions, and supports imedia such as photos and document images. As an online program, it fosters extended family participation and good ancestral recording habits, as it simplifies the process of collaborating with others working on your family lines. Your latest information is always on your web site and available for others to see, defined by viewing rules you set.
|
||||||
|
|
||||||
**Note:** Its better to upgrade from the Webtrees admin pannel when new version arrives. <br><br>
|
**Note:** Its better to upgrade from the Webtrees admin pannel when new version arrives. <br><br>
|
||||||
|
|
||||||
<b>Demo:</b>https://dev.webtrees.net/demo-dev/index.php?ctype=gedcom&ged=demo<br>
|
<b>Demo:</b>https://dev.webtrees.net/demo-dev/index.php?ctype=gedcom&ged=demo<br>
|
||||||
<br>
|
<br>
|
||||||
No LDAP configuration is there for Webtrees yet.
|
No LDAP configuration is there for Webtrees yet.
|
||||||
|
Multi-instance: **yes**
|
||||||
|
|
||||||
|
#### Supported architectures
|
||||||
|
|
||||||
|
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/webtrees%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/webtrees/)
|
||||||
|
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/webtrees%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/webtrees/)
|
||||||
|
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/webtrees%20%28Community%29.svg)](https://ci-stretch.nohost.me/ci/apps/webtrees/)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||||
|
|
||||||
# Move this file from check_process.default to check_process when you have filled it.
|
# Move this file from check_process.default to check_process when you have filled it.
|
||||||
|
|
||||||
;; Test complet
|
;; Test complet
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld" (DOMAIN)
|
||||||
|
@ -21,7 +22,7 @@
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=1
|
incorrect_path=1
|
||||||
port_already_use=0 (66)
|
port_already_use=0
|
||||||
change_url=0
|
change_url=0
|
||||||
;;; Levels
|
;;; Levels
|
||||||
Level 1=auto
|
Level 1=auto
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
Level 3=auto
|
Level 3=auto
|
||||||
# Level 4: If the app supports LDAP and SSOwat, turn level 4 to '1' and add a link to an issue or a part of your code to show it.
|
# Level 4: If the app supports LDAP and SSOwat, turn level 4 to '1' and add a link to an issue or a part of your code to show it.
|
||||||
# If the app does not use LDAP nor SSOwat, and can't use them, turn level 4 to 'na' and explain as well.
|
# If the app does not use LDAP nor SSOwat, and can't use them, turn level 4 to 'na' and explain as well.
|
||||||
Level 4=na # Not supported by the core app yet
|
Level 4=0 # Not supported by the core app yet
|
||||||
Level 5=auto
|
Level 5=auto
|
||||||
Level 6=auto
|
Level 6=auto
|
||||||
Level 7=auto
|
Level 7=auto
|
||||||
|
@ -38,4 +39,4 @@
|
||||||
Level 10=0
|
Level 10=0
|
||||||
;;; Options
|
;;; Options
|
||||||
Email=anmol@datamol.org
|
Email=anmol@datamol.org
|
||||||
Notification=yes
|
Notification=change
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://github.com/fisharebest/webtrees/releases/download/1.7.12/webtrees-1.7.12.zip
|
SOURCE_URL=https://github.com/fisharebest/webtrees/releases/download/1.7.13/webtrees-1.7.13.zip
|
||||||
SOURCE_SUM=570412bfb0af85356835497245b4abf5a4d21442e4ee9d885420476c7237fab2
|
SOURCE_SUM=553331245d696ab1c082ecdb7037f8d67a2c5e735fe2db06bd1f909c4dd3ab27
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=zip
|
SOURCE_FORMAT=zip
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -16,7 +16,7 @@ location __PATH__ {
|
||||||
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;
|
||||||
|
|
||||||
# Filename to be changed if dedicated php-fpm process is required
|
# Filename to be changed if dedicated php-fpm process is required
|
||||||
# This is to be used INSTEAD of line above
|
# This is to be used INSTEAD of line above
|
||||||
|
|
|
@ -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:
|
||||||
|
@ -96,7 +110,7 @@ pm = dynamic
|
||||||
; forget to tweak pm.* to fit your needs.
|
; forget to tweak pm.* to fit your needs.
|
||||||
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
|
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
|
||||||
; Note: This value is mandatory.
|
; Note: This value is mandatory.
|
||||||
pm.max_children = 10
|
pm.max_children = 5
|
||||||
|
|
||||||
; The number of child processes created on startup.
|
; The number of child processes created on startup.
|
||||||
; Note: Used only when pm is set to 'dynamic'
|
; Note: Used only when pm is set to 'dynamic'
|
||||||
|
@ -122,7 +136,7 @@ pm.max_spare_servers = 3
|
||||||
; This can be useful to work around memory leaks in 3rd party libraries. For
|
; This can be useful to work around memory leaks in 3rd party libraries. For
|
||||||
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
|
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
|
||||||
; Default Value: 0
|
; Default Value: 0
|
||||||
pm.max_requests = 500
|
;pm.max_requests = 500
|
||||||
|
|
||||||
; The URI to view the FPM status page. If this value is not set, no URI will be
|
; The URI to view the FPM status page. If this value is not set, no URI will be
|
||||||
; recognized as a status page. It shows the following informations:
|
; recognized as a status page. It shows the following informations:
|
||||||
|
@ -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"
|
||||||
|
@ -302,13 +320,13 @@ pm.max_requests = 500
|
||||||
; The log file for slow requests
|
; The log file for slow requests
|
||||||
; Default Value: not set
|
; Default Value: not set
|
||||||
; Note: slowlog is mandatory if request_slowlog_timeout is set
|
; Note: slowlog is mandatory if request_slowlog_timeout is set
|
||||||
slowlog = /var/log/nginx/__NAMETOCHANGE__.slow.log
|
;slowlog = log/$pool.log.slow
|
||||||
|
|
||||||
; The timeout for serving a single request after which a PHP backtrace will be
|
; The timeout for serving a single request after which a PHP backtrace will be
|
||||||
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
|
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
|
||||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
||||||
; Default Value: 0
|
; Default Value: 0
|
||||||
request_slowlog_timeout = 5s
|
;request_slowlog_timeout = 0
|
||||||
|
|
||||||
; The timeout for serving a single request after which the worker process will
|
; The timeout for serving a single request after which the worker process will
|
||||||
; be killed. This option should be used when the 'max_execution_time' ini option
|
; be killed. This option should be used when the 'max_execution_time' ini option
|
||||||
|
@ -347,15 +365,24 @@ chdir = __FINALPATH__
|
||||||
; Note: on highloaded environement, this can cause some delay in the page
|
; Note: on highloaded environement, this can cause some delay in the page
|
||||||
; process time (several ms).
|
; process time (several ms).
|
||||||
; 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] = 50M
|
||||||
|
; php_admin_value[post_max_size] = 50M
|
||||||
|
; php_admin_flag[mail.add_x_header] = Off
|
||||||
|
|
||||||
|
; Other common parameters
|
||||||
|
; php_admin_value[max_execution_time] = 600
|
||||||
|
; php_admin_value[max_input_time] = 300
|
||||||
|
; php_admin_value[memory_limit] = 256M
|
||||||
|
; php_admin_flag[short_open_tag] = On
|
||||||
|
|
|
@ -6,20 +6,20 @@
|
||||||
"en": "Webtrees is a free open source web-based genealogy application.",
|
"en": "Webtrees is a free open source web-based genealogy application.",
|
||||||
"fr": "Webtrees est un logiciel libre de généalogie en ligne."
|
"fr": "Webtrees est un logiciel libre de généalogie en ligne."
|
||||||
},
|
},
|
||||||
"version":"1.7.12",
|
"version":"1.7.13~ynh1",
|
||||||
"url": "https://www.webtrees.net",
|
"url": "https://www.webtrees.net",
|
||||||
"license": "free",
|
"license": "GNU",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "Anmol Sharma",
|
"name": "Anmol Sharma",
|
||||||
"email": "anmol@datamol.org"
|
"email": "anmol@datamol.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">> 2.7.14"
|
"yunohost": ">> 3.0.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
"nginx",
|
"nginx",
|
||||||
"php5-fpm",
|
"php7.0-fpm",
|
||||||
"mysql"
|
"mysql"
|
||||||
],
|
],
|
||||||
"arguments": {
|
"arguments": {
|
||||||
|
|
|
@ -12,6 +12,12 @@ ynh_delete_file_checksum () {
|
||||||
ynh_app_setting_delete $app $checksum_setting_name
|
ynh_app_setting_delete $app $checksum_setting_name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# COMMON VARIABLES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# dependencies used by the app
|
||||||
|
pkg_dependencies="php-gd php-xml mailutils "
|
||||||
|
|
||||||
# Send an email to inform the administrator
|
# Send an email to inform the administrator
|
||||||
#
|
#
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -36,24 +38,33 @@ db_pwd=$(ynh_app_setting_get $app mysqlpwd)
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up the main app directory..."
|
||||||
|
|
||||||
ynh_backup "$final_path"
|
ynh_backup "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up nginx web server configuration..."
|
||||||
|
|
||||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
# BACKUP THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up php-fpm configuration..."
|
||||||
|
|
||||||
ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
|
ynh_backup "/etc/php/7.0/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE MYSQL DATABASE
|
# BACKUP THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Backing up the MySQL database..."
|
||||||
|
|
||||||
ynh_mysql_dump_db "$db_name" > db.sql
|
ynh_mysql_dump_db "$db_name" > db.sql
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||||
|
|
|
@ -17,7 +17,6 @@ ynh_clean_setup () {
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
### Remove this function if there's nothing to clean before calling the remove script.
|
||||||
true
|
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
|
||||||
|
|
||||||
|
@ -47,25 +46,36 @@ admin_password=$(openssl passwd -1 -salt xyz $password)
|
||||||
### db names, ...
|
### db names, ...
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
### If it's a multi-instance app, meaning it can be installed several times independently
|
||||||
|
### The id of the app as stated in the manifest is available as $YNH_APP_ID
|
||||||
|
### The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...)
|
||||||
|
### The app instance name is available as $YNH_APP_INSTANCE_NAME
|
||||||
|
### - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample
|
||||||
|
### - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2
|
||||||
|
### - ynhexample__{N} for the subsequent installations, with N=3,4, ...
|
||||||
|
### The app instance name is probably what interests you most, since this is
|
||||||
|
### guaranteed to be unique. This is a good unique identifier to define installation path,
|
||||||
|
### db names, ...
|
||||||
|
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 "Validating installation parameters..."
|
||||||
|
|
||||||
### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app".
|
### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app".
|
||||||
### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app"
|
### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app"
|
||||||
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 "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 $domain $path_url
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# STORE SETTINGS FROM MANIFEST
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Storing installation settings..."
|
||||||
|
|
||||||
ynh_app_setting_set $app is_public $is_public
|
ynh_app_setting_set $app is_public $is_public
|
||||||
ynh_app_setting_set $app domain $domain
|
ynh_app_setting_set $app domain $domain
|
||||||
ynh_app_setting_set $app path $path_url
|
ynh_app_setting_set $app path $path_url
|
||||||
|
@ -74,6 +84,7 @@ ynh_app_setting_set $app path $path_url
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Setting up source files..."
|
||||||
|
|
||||||
### `ynh_setup_source` is used to install an app from a zip or tar.gz file,
|
### `ynh_setup_source` is used to install an app from a zip or tar.gz file,
|
||||||
### downloaded from an upstream source, like a git repository.
|
### downloaded from an upstream source, like a git repository.
|
||||||
|
@ -83,12 +94,25 @@ ynh_app_setting_set $app final_path $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 "$final_path"
|
||||||
|
|
||||||
# install dependencies
|
#=================================================
|
||||||
ynh_install_app_dependencies php-gd php-xml mailutils
|
# INSTALL DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Installing dependencies..."
|
||||||
|
|
||||||
|
### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package.
|
||||||
|
### Those deb packages will be installed as dependencies of this package.
|
||||||
|
### If you're not using this helper:
|
||||||
|
### - Remove the section "REMOVE DEPENDENCIES" in the remove script
|
||||||
|
### - Remove the variable "pkg_dependencies" in _common.sh
|
||||||
|
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
|
||||||
|
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
|
||||||
|
|
||||||
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A MYSQL DATABASE
|
# CREATE A MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Creating a MySQL database..."
|
||||||
|
|
||||||
### Use these lines if you need a database for the application.
|
### Use these lines if you need a database for the application.
|
||||||
### `ynh_mysql_setup_db` will create a database, an associated user and a ramdom password.
|
### `ynh_mysql_setup_db` will create a database, an associated user and a ramdom password.
|
||||||
|
@ -103,6 +127,13 @@ db_name=$(ynh_sanitize_dbid $app)
|
||||||
ynh_app_setting_set $app db_name $db_name
|
ynh_app_setting_set $app db_name $db_name
|
||||||
ynh_mysql_setup_db $db_name $db_name
|
ynh_mysql_setup_db $db_name $db_name
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# MODIFY A CONFIG FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
### `ynh_replace_string` is used to replace a string in a file.
|
||||||
|
### (It's compatible with sed regular expressions syntax)
|
||||||
|
|
||||||
# Adding the details of the database to the config file
|
# Adding the details of the database to the config file
|
||||||
ynh_replace_string "__dbuser__" "$db_name" "../conf/config.ini.php"
|
ynh_replace_string "__dbuser__" "$db_name" "../conf/config.ini.php"
|
||||||
ynh_replace_string "__dbpass__" "$db_pwd" "../conf/config.ini.php"
|
ynh_replace_string "__dbpass__" "$db_pwd" "../conf/config.ini.php"
|
||||||
|
@ -125,6 +156,7 @@ ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" < "../conf/sql/admin.sql"
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Configuring nginx web server..."
|
||||||
|
|
||||||
### `ynh_add_nginx_config` will use the file conf/nginx.conf
|
### `ynh_add_nginx_config` will use the file conf/nginx.conf
|
||||||
|
|
||||||
|
@ -134,6 +166,7 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Configuring system user..."
|
||||||
|
|
||||||
# Create a system user
|
# Create a system user
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
@ -141,6 +174,7 @@ ynh_system_user_create $app
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Configuring php-fpm..."
|
||||||
|
|
||||||
### `ynh_add_fpm_config` is used to set up a PHP config.
|
### `ynh_add_fpm_config` is used to set up a PHP config.
|
||||||
### You can remove it if your app doesn't use PHP.
|
### You can remove it if your app doesn't use PHP.
|
||||||
|
@ -163,9 +197,21 @@ ynh_add_fpm_config
|
||||||
chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
sudo chmod -R 700 $final_path/data
|
sudo chmod -R 700 $final_path/data
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
### `ynh_store_file_checksum` is used to store the checksum of a file.
|
||||||
|
### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`,
|
||||||
|
### you can make a backup of this file before modifying it again if the admin had modified it.
|
||||||
|
|
||||||
|
# Calculate and store the config file checksum into the app settings
|
||||||
|
ynh_store_file_checksum "$final_path/data/config.ini.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Configuring SSOwat..."
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
|
@ -177,9 +223,11 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Reloading nginx web server..."
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SEND A README FOR THE ADMIN
|
# SEND A README FOR THE ADMIN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -194,3 +242,11 @@ And the admin password is: $password
|
||||||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/Webtrees_ynh"
|
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/Webtrees_ynh"
|
||||||
|
|
||||||
ynh_send_readme_to_admin "$message"
|
ynh_send_readme_to_admin "$message"
|
||||||
|
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Installation of $app completed"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -21,9 +22,26 @@ db_name=$(ynh_app_setting_get $app db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
final_path=$(ynh_app_setting_get $app final_path)
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE THE MYSQL DATABASE
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Removing the MySQL database"
|
||||||
|
|
||||||
|
# Remove a database if it exists, along with the associated user
|
||||||
|
ynh_mysql_remove_db $db_user $db_name
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Removing dependencies"
|
||||||
|
|
||||||
|
# Remove metapackage and its dependencies
|
||||||
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Removing app main directory"
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove "$final_path"
|
ynh_secure_remove "$final_path"
|
||||||
|
@ -31,6 +49,7 @@ ynh_secure_remove "$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Removing nginx web server configuration"
|
||||||
|
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated nginx config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
@ -38,13 +57,23 @@ ynh_remove_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE PHP-FPM CONFIGURATION
|
# REMOVE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "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 THE MYSQL DATABASE
|
# GENERIC FINALIZATION
|
||||||
|
#=================================================
|
||||||
|
# REMOVE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Removing the dedicated system user"
|
||||||
|
|
||||||
|
# Delete a system user
|
||||||
|
ynh_system_user_delete $app
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove a database if it exists, along with the associated user
|
ynh_print_info "Removal of $app completed"
|
||||||
ynh_mysql_remove_db $db_user $db_name
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Loading settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -35,6 +37,7 @@ db_name=$(ynh_app_setting_get $app db_name)
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Validating restoration parameters..."
|
||||||
|
|
||||||
ynh_webpath_available $domain $path_url \
|
ynh_webpath_available $domain $path_url \
|
||||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||||
|
@ -52,18 +55,33 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Restoring the app main directory..."
|
||||||
|
|
||||||
ynh_restore_file "$final_path"
|
ynh_restore_file "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Recreating the dedicated system user..."
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
|
||||||
# install dependencies
|
#=================================================
|
||||||
ynh_install_app_dependencies php-gd php-xml mailutils
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC RESTORATION
|
||||||
|
#=================================================
|
||||||
|
# REINSTALL DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Reinstalling dependencies..."
|
||||||
|
|
||||||
|
# Define and install dependencies
|
||||||
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE USER RIGHTS
|
||||||
|
@ -77,22 +95,24 @@ sudo chmod -R 700 $final_path/data
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE MYSQL DATABASE
|
# RESTORE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Restoring the MySQL database..."
|
||||||
|
|
||||||
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
|
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
|
||||||
ynh_mysql_setup_db $db_name $db_name $db_pwd
|
ynh_mysql_setup_db $db_name $db_name $db_pwd
|
||||||
ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
|
ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND PHP-FPM
|
# RELOAD NGINX AND PHP-FPM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Reloading nginx web server and php-fpm..."
|
||||||
|
|
||||||
systemctl reload php5-fpm
|
systemctl reload php7.0-fpm
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Restoration completed for $app"
|
||||||
|
|
|
@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@ final_path=$(ynh_app_setting_get $app final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Ensuring downward compatibility..."
|
||||||
|
|
||||||
# Fix is_public as a boolean value
|
# Fix is_public as a boolean value
|
||||||
if [ "$is_public" = "Yes" ]; then
|
if [ "$is_public" = "Yes" ]; then
|
||||||
|
@ -47,9 +49,11 @@ if [ -z $final_path ]; then
|
||||||
ynh_app_setting_set $app final_path $final_path
|
ynh_app_setting_set $app final_path $final_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "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
|
||||||
|
@ -63,9 +67,9 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK THE PATH
|
# CHECK THE PATH
|
||||||
#=================================================
|
#=================================================
|
||||||
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
# Normalize the URL path syntax
|
#=================================================
|
||||||
path_url=$(ynh_normalize_url_path $path_url)
|
ynh_print_info "Upgrading source files..."
|
||||||
|
|
||||||
# Move old app dir
|
# Move old app dir
|
||||||
sudo mv ${final_path} ${final_path}.old
|
sudo mv ${final_path} ${final_path}.old
|
||||||
|
@ -79,15 +83,25 @@ sudo cp -a ${final_path}.old/data ${final_path}
|
||||||
# delete temp directory
|
# delete temp directory
|
||||||
sudo rm -Rf ${final_path}.old
|
sudo rm -Rf ${final_path}.old
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# NGINX CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Upgrading nginx web server configuration..."
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
# install dependencies
|
#=================================================
|
||||||
ynh_install_app_dependencies php-gd php-xml mailutils
|
# UPGRADE DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info "Upgrading dependencies..."
|
||||||
|
|
||||||
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Making sure dedicated system user exists..."
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create $app
|
ynh_system_user_create $app
|
||||||
|
@ -95,9 +109,21 @@ ynh_system_user_create $app
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "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 UPGRADE
|
||||||
|
#=================================================
|
||||||
|
# ...
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||||
|
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||||
|
ynh_backup_if_checksum_is_different "$final_path/data/config.ini.php"
|
||||||
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
|
ynh_store_file_checksum "$final_path/data/config.ini.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -112,6 +138,7 @@ sudo chmod -R 700 $final_path/data
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Upgrading SSOwat configuration..."
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
|
@ -123,5 +150,12 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_print_info "Reloading nginx web server..."
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# END OF SCRIPT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_print_info "Upgrade of $app completed"
|
||||||
|
|
Loading…
Reference in a new issue