From ede5d11ee747f334361a2c233187da75d46777cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 16 Dec 2022 09:46:31 +0100 Subject: [PATCH 01/42] 0.9.3 --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index c419b03..36c0184 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/sabre-io/Baikal/releases/download/0.9.2/baikal-0.9.2.zip -SOURCE_SUM=5feb8488c74fe6b625680654f3d51cdb080dcc6180c1b558543cb25f18f38c65 +SOURCE_URL=https://github.com/sabre-io/Baikal/releases/download/0.9.3/baikal-0.9.3.zip +SOURCE_SUM=d36955ce2e60a03875cf33ad793ddcecfae52096af39de1f2bf709de9f16cb5e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index e44cbab..774f340 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Lightweight CalDAV and CardDAV server", "fr": "Serveur CalDAV et CardDAV léger" }, - "version": "0.9.2~ynh2", + "version": "0.9.3~ynh1", "url": "http://baikal-server.com/", "upstream": { "license": "GPL-3.0", From de2f93b443c92c12f3d50ef47d2a7795e4da9aba Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 16 Dec 2022 08:46:37 +0000 Subject: [PATCH 02/42] Auto-update README --- README.md | 3 +-- README_fr.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d8ce8c9..8349536 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. -**Shipped version:** 0.9.2~ynh2 - +**Shipped version:** 0.9.3~ynh1 **Demo:** https://demo.yunohost.org/baikal/admin/ diff --git a/README_fr.md b/README_fr.md index 790d012..f12cba1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,8 +19,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -**Version incluse :** 0.9.2~ynh2 - +**Version incluse :** 0.9.3~ynh1 **Démo :** https://demo.yunohost.org/baikal/admin/ From 1b86e7f75ba91bcd8158039ffee9b6536c212e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 24 Dec 2022 22:15:29 +0100 Subject: [PATCH 03/42] Update baikal.yaml --- conf/baikal.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/baikal.yaml b/conf/baikal.yaml index b6504a9..85ba73b 100644 --- a/conf/baikal.yaml +++ b/conf/baikal.yaml @@ -1,5 +1,5 @@ system: - configured_version: '0.9.2' + configured_version: '0.9.3' timezone: '__TIMEZONE__' card_enabled: true cal_enabled: true From 251f8362c03aa529ea0e3962477455c15e6c4d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 28 Dec 2022 09:05:28 +0100 Subject: [PATCH 04/42] Php (#74) * set php * Fix * Update upgrade --- conf/{php-fpm.conf => extra_php-fpm.conf} | 0 conf/nginx.conf | 2 ++ scripts/install | 9 ++++++++- scripts/upgrade | 23 ++++++++++++++++++++++- 4 files changed, 32 insertions(+), 2 deletions(-) rename conf/{php-fpm.conf => extra_php-fpm.conf} (100%) diff --git a/conf/php-fpm.conf b/conf/extra_php-fpm.conf similarity index 100% rename from conf/php-fpm.conf rename to conf/extra_php-fpm.conf diff --git a/conf/nginx.conf b/conf/nginx.conf index d29b7e1..ca51a82 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -14,6 +14,8 @@ location __PATH__/ { index index.php; + client_max_body_size 50M; + location ~ ^(.+\.php)(.*)$ { include fastcgi_params; fastcgi_split_path_info ^(.+\.php)(.*)$; diff --git a/scripts/install b/scripts/install index 39b34c0..803ea56 100644 --- a/scripts/install +++ b/scripts/install @@ -26,12 +26,16 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH password=$YNH_APP_ARG_PASSWORD +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME timezone=$(cat /etc/timezone) encrypt_key=$(ynh_string_random 24) password_hash=$(echo -n admin:BaikalDAV:$password | sha256sum | cut -d ' ' -f 1) +fpm_footprint="low" +fpm_free_footprint=0 +fpm_usage="low" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -59,6 +63,9 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=encrypt_key --value="$encrypt_key" ynh_app_setting_set --app=$app --key=password_hash --value="$password_hash" +ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint +ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint +ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage #================================================= # STANDARD MODIFICATIONS @@ -106,7 +113,7 @@ chown -R $app:www-data "$final_path" ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index fe9e335..e9e9f02 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,6 +26,10 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) password_hash=$(ynh_app_setting_get --app=$app --key=password_hash) encrypt_key=$(ynh_app_setting_get --app=$app --key=encrypt_key) +fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) +fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) + #================================================= # CHECK VERSION #================================================= @@ -73,6 +77,23 @@ if [ -z "$password_hash" ]; then ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash fi +# If fpm_footprint doesn't exist, create it +if [ -z "$fpm_footprint" ]; then + fpm_footprint=low + ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint +fi + +# If fpm_free_footprint doesn't exist, create it +if [ -z "$fpm_free_footprint" ]; then + fpm_free_footprint=0 + ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint +fi + +# If fpm_usage doesn't exist, create it +if [ -z "$fpm_usage" ]; then + fpm_usage=low + ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage +fi # Cleaning legacy permissions if ynh_legacy_permissions_exists; then @@ -123,7 +144,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint #================================================= # NGINX CONFIGURATION From 20502c6bc89fc0303d6b5a94993d780d711f4269 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 20 Aug 2023 06:27:56 +0000 Subject: [PATCH 05/42] Auto-update README --- README.md | 3 ++- README_fr.md | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8349536..dab87ee 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Baïkal for YunoHost -[![Integration level](https://dash.yunohost.org/integration/baikal.svg)](https://dash.yunohost.org/appci/app/baikal) ![Working status](https://ci-apps.yunohost.org/ci/badges/baikal.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/baikal.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/baikal.svg)](https://dash.yunohost.org/appci/app/baikal) ![Working status](https://ci-apps.yunohost.org/ci/badges/baikal.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/baikal.maintain.svg) + [![Install Baïkal with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=baikal) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index f12cba1..a31f55b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,16 @@ It shall NOT be edited by hand. # Baïkal pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/baikal.svg)](https://dash.yunohost.org/appci/app/baikal) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/baikal.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/baikal.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/baikal.svg)](https://dash.yunohost.org/appci/app/baikal) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/baikal.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/baikal.maintain.svg) + [![Installer Baïkal avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=baikal) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Baïkal rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Baïkal rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble [Baïkal](http://baikal-server.com/) est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. @@ -23,16 +24,16 @@ Baïkal permet d'accéder de manière transparente à vos contacts et calendrier **Démo :** https://demo.yunohost.org/baikal/admin/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de Baïkal](./doc/screenshots/baikal-in-use.png) +![Capture d’écran de Baïkal](./doc/screenshots/baikal-in-use.png) ## Documentations et ressources -* Site officiel de l'app : +* Site officiel de l’app : * Documentation officielle utilisateur : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -48,4 +49,4 @@ ou sudo yunohost app upgrade baikal -u https://github.com/YunoHost-Apps/baikal_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From a749fbee93c0ed635dfded3f7926b2205b85966c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 20 Aug 2023 08:35:32 +0200 Subject: [PATCH 06/42] cleaning --- conf/extra_php-fpm.conf | 432 +--------------------------------------- scripts/install | 2 +- 2 files changed, 4 insertions(+), 430 deletions(-) diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf index cc8c244..700c37c 100644 --- a/conf/extra_php-fpm.conf +++ b/conf/extra_php-fpm.conf @@ -1,430 +1,4 @@ -; Start a new pool named 'www'. -; the variable $pool can be used in any directive and will be replaced by the -; pool name ('www' here) -[__NAMETOCHANGE__] +; Additional php.ini defines, specific to this pool of workers. -; Per pool prefix -; It only applies on the following directives: -; - 'access.log' -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = __USER__ -group = __USER__ - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; 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. -; Note: This value is mandatory. -listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock - -; Set listen(2) backlog. -; Default Value: 511 (-1 on FreeBSD and OpenBSD) -;listen.backlog = 511 - -; 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 -; BSD-derived systems allow connections regardless of permissions. -; Default Values: user and group are set as the running user -; mode is set to 0660 -listen.owner = www-data -listen.group = www-data -;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 addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. -; 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 -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; 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. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 6 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 3 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 3 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 5 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; 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. -; Default Value: 0 -;pm.max_requests = 500 - -; 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: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; 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 -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; 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 -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: output header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %p: PID of the child that serviced the request -; %P: PID of the parent of the child that serviced the request -; %q: the query string -; %Q: the '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %t: server time the request was received -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}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) -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %u: remote user -; -; Default: "%R - %u %t \"%m %r\" %s" -;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - -; The log file for slow requests -; Default Value: not set -; Note: slowlog is mandatory if request_slowlog_timeout is set -;slowlog = log/$pool.log.slow - -; 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'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_slowlog_timeout = 0 - -; 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 -; does not stop script execution for some reason. A value of '0' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -request_terminate_timeout = 1d - -; Set open file descriptor rlimit. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -chdir = __FINALPATH__ - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;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 -; 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 -; execute php code. -; Note: set an empty value to allow all extensions. -; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 .php7 - -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - -; Additional php.ini defines, specific to this pool of workers. These settings -; overwrite the values previously defined in the php.ini. The directives are the -; same as the PHP SAPI: -; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. -; php_admin_value/php_admin_flag - these directives won't be overwritten by -; PHP call 'ini_set' -; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;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 +php_admin_value[upload_max_filesize] = 50M +php_admin_value[post_max_size] = 50M diff --git a/scripts/install b/scripts/install index 803ea56..21047c0 100644 --- a/scripts/install +++ b/scripts/install @@ -153,7 +153,7 @@ touch "$final_path/Specific/INSTALL_DISABLED" ynh_script_progression --message="Configuring permissions..." --weight=2 # Allow public access on / -ynh_permission_update --permission="main" --add="visitors" +ynh_permission_update --permission="main" --add="visitors" # But restrain on /admin ynh_permission_create --permission="admin" --url="/admin" --allowed="all_users" From 9ff2d6ea4adfabd2c3655d567f765fb85e55cd7d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 20 Aug 2023 08:37:48 +0200 Subject: [PATCH 07/42] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 774f340..bc6e2c5 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,7 @@ "url": "http://baikal-server.com/", "upstream": { "license": "GPL-3.0", - "website": "http://sabre.io/baikal/", + "website": "https://sabre.io/baikal/", "demo": "https://demo.yunohost.org/baikal/admin/", "admindoc": "https://sabre.io/dav/", "userdoc": "https://github.com/AlexandreMonroche/BaikalGuide", @@ -22,7 +22,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 11.0.9" + "yunohost": ">= 11.2" }, "multi_instance": false, "services": [ From b6631d729f873118ed935268f457fa70863bb420 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 20 Aug 2023 06:37:54 +0000 Subject: [PATCH 08/42] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dab87ee..20607e1 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Baïkal allows to seamlessly access your contacts and calendars from every devic ## Documentation and resources -* Official app website: +* Official app website: * Official user documentation: * Official admin documentation: * Upstream app code repository: diff --git a/README_fr.md b/README_fr.md index a31f55b..e916451 100644 --- a/README_fr.md +++ b/README_fr.md @@ -30,7 +30,7 @@ Baïkal permet d'accéder de manière transparente à vos contacts et calendrier ## Documentations et ressources -* Site officiel de l’app : +* Site officiel de l’app : * Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : From 501eec7d1a352c43142532c33efc3deba6b31e05 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 20 Aug 2023 08:39:33 +0200 Subject: [PATCH 09/42] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index bc6e2c5..dc780f1 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ "fr": "Serveur CalDAV et CardDAV léger" }, "version": "0.9.3~ynh1", - "url": "http://baikal-server.com/", + "url": "https://sabre.io/baikal/", "upstream": { "license": "GPL-3.0", "website": "https://sabre.io/baikal/", From 9606ac52b2246192a0bca0dbc50e0e2d635b1d95 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 20 Aug 2023 08:41:59 +0200 Subject: [PATCH 10/42] Update upgrade --- scripts/upgrade | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e9e9f02..b3df4b6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -162,16 +162,16 @@ ynh_add_nginx_config # We keep this to allow upgrade the config file in case it needs to be changed. -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading the configuration file..." --weight=2 +#if [ "$upgrade_type" == "UPGRADE_APP" ] +#then +# ynh_script_progression --message="Upgrading the configuration file..." --weight=2 - timezone=$(cat /etc/timezone) - path=${path_url%/} - ynh_add_config --template="../conf/baikal.yaml" --destination="$final_path/config/baikal.yaml" - chown $app: "$final_path/config/baikal.yaml" - chmod 640 "$final_path/config/baikal.yaml" -fi +# timezone=$(cat /etc/timezone) +# path=${path_url%/} +# ynh_add_config --template="../conf/baikal.yaml" --destination="$final_path/config/baikal.yaml" +# chown $app: "$final_path/config/baikal.yaml" +# chmod 640 "$final_path/config/baikal.yaml" +#fi #================================================= # GENERIC FINALIZATION From 51a8d482876c0818fd488b810e7f0bda0117fc70 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 20 Aug 2023 08:45:34 +0200 Subject: [PATCH 11/42] remove old link --- doc/DESCRIPTION.md | 2 +- doc/DESCRIPTION_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 22618a9..899704f 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,3 +1,3 @@ -[Baïkal](http://baikal-server.com/) is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. +Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 39a251e..007f96f 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,3 +1,3 @@ -[Baïkal](http://baikal-server.com/) est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. +Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. \ No newline at end of file From 61b1973d8a300278d7bc7f8027d3edbada427c9a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 20 Aug 2023 06:45:39 +0000 Subject: [PATCH 12/42] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 20607e1..a7278a5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -[Baïkal](http://baikal-server.com/) is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. +Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. diff --git a/README_fr.md b/README_fr.md index e916451..744dd29 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,7 +16,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -[Baïkal](http://baikal-server.com/) est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. +Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. From e990c81f39af9fbfd87113bf20b00cd1a11b9639 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 20 Aug 2023 08:46:00 +0200 Subject: [PATCH 13/42] Update nginx.conf --- conf/nginx.conf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index ca51a82..d2fe937 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -23,10 +23,6 @@ location __PATH__/ { fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; } - - #location ~ ^__PATH__/(\.|Core|Specific) { - # deny all; - #} location ~ ^__PATH__/(\.ht|Core|Specific|config) { deny all; From 9cb364ad51217c1eb0e7a620fac0ef2ab3532079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 20 Aug 2023 10:54:07 +0200 Subject: [PATCH 14/42] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b3df4b6..d6e9c34 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -124,7 +124,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="config/baikal.yaml" + ynh_setup_source --dest_dir="$final_path" --keep="Specific config" fi chmod 750 "$final_path" From 2b36def25bdac02ac6f8f00389e6bb0f3374afa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 20 Aug 2023 10:59:40 +0200 Subject: [PATCH 15/42] fix --- actions.toml | 10 ----- check_process | 6 +++ manifest.json | 2 +- scripts/_common.sh | 2 +- scripts/actions/reset_admin_password | 57 ---------------------------- 5 files changed, 8 insertions(+), 69 deletions(-) delete mode 100644 actions.toml delete mode 100644 scripts/actions/reset_admin_password diff --git a/actions.toml b/actions.toml deleted file mode 100644 index aa446e3..0000000 --- a/actions.toml +++ /dev/null @@ -1,10 +0,0 @@ -[reset_admin_password] -name = "Reset the admin password" -command = "/bin/bash scripts/actions/reset_admin_password" -accepted_return_codes = [0] -description = "Change the admin password of the app." - [reset_admin_password.arguments] - [reset_admin_password.arguments.password] - type = "password" - ask.en = "Set the password for the administration" - ask.fr = "Définissez le mot de passe pour l'administration" \ No newline at end of file diff --git a/check_process b/check_process index 9b1daae..2b928af 100644 --- a/check_process +++ b/check_process @@ -13,6 +13,8 @@ upgrade=1 #0.7.1~ynh2 upgrade=1 from_commit=7c074c7b18322cde08c4eb57ffbc5ae174b7ae65 + #0.9.3~ynh1 + upgrade=1 from_commit=330692e457ef2b475046d1724d3f198f007d5512 backup_restore=1 multi_instance=0 port_already_use=0 @@ -24,3 +26,7 @@ Notification=none ; commit=7c074c7b18322cde08c4eb57ffbc5ae174b7ae65 name=Testing #60 manifest_arg=domain=DOMAIN&path=PATH&password=mysecret& + ; commit=330692e457ef2b475046d1724d3f198f007d5512 + name=Testing #0.9.3~ynh1 + manifest_arg=domain=DOMAIN&path=PATH&password=mysecret& + diff --git a/manifest.json b/manifest.json index dc780f1..d1add2c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Lightweight CalDAV and CardDAV server", "fr": "Serveur CalDAV et CardDAV léger" }, - "version": "0.9.3~ynh1", + "version": "0.9.3~ynh2", "url": "https://sabre.io/baikal/", "upstream": { "license": "GPL-3.0", diff --git a/scripts/_common.sh b/scripts/_common.sh index 76bfd01..93474a7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,7 @@ #================================================= # dependencies used by the app -YNH_PHP_VERSION=8.0 +YNH_PHP_VERSION=8.2 php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap" diff --git a/scripts/actions/reset_admin_password b/scripts/actions/reset_admin_password deleted file mode 100644 index 9086523..0000000 --- a/scripts/actions/reset_admin_password +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source scripts/_common.sh -source /usr/share/yunohost/helpers - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -# Get password -password=${YNH_ACTION_PASSWORD} - -app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID} -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# CHECK IF ARGUMENTS ARE CORRECT -#================================================= - -#================================================= -# CHECK IF AN ACTION HAS TO BE DONE -#================================================= - -password_hash_old=$(ynh_app_setting_get --app=$app --key=password_hash) -password_hash=$(echo -n admin:BaikalDAV:$password | sha256sum | cut -d ' ' -f 1) -if [ $password_hash == $password_hash_old ] -then - ynh_die "This is the same password." 0 -fi - -#================================================= -# SPECIFIC ACTION -#================================================= -# CHANGE THE PASSWORD -#================================================= -ynh_script_progression --message="Changing the password..." --weight=1 - -bk_conf="${final_path}/config/baikal.yaml" - -ynh_backup_if_checksum_is_different --file="$final_path/config/baikal.yaml" - -ynh_replace_string --match_string="${password_hash_old}" --replace_string="${password_hash}" --target_file="$final_path/config/baikal.yaml" -ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash - -ynh_store_file_checksum --file="$final_path/config/baikal.yaml" - -#================================================= -# END OF SCRIPT -#================================================= - -ynh_script_progression --message="Execution completed" --last From 99f50752298c3fce005d44b774236d82b443a5ce Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 20 Aug 2023 08:59:45 +0000 Subject: [PATCH 16/42] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7278a5..7c7c71e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web inter Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. -**Shipped version:** 0.9.3~ynh1 +**Shipped version:** 0.9.3~ynh2 **Demo:** https://demo.yunohost.org/baikal/admin/ diff --git a/README_fr.md b/README_fr.md index 744dd29..bb1c327 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,7 @@ Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendu Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -**Version incluse :** 0.9.3~ynh1 +**Version incluse :** 0.9.3~ynh2 **Démo :** https://demo.yunohost.org/baikal/admin/ From f3bee5a27a468acff21ef1cffdcd4f8983bdd28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 20 Aug 2023 11:52:05 +0200 Subject: [PATCH 17/42] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index d6e9c34..a2fa9cc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -124,7 +124,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="Specific config" + ynh_setup_source --dest_dir="$final_path" --keep="Specific/ config/" fi chmod 750 "$final_path" From 780c4cd47dd48d71cc3f24ea293403c746a33871 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 25 Aug 2023 22:47:54 +0200 Subject: [PATCH 18/42] Update check_process --- check_process | 5 ----- 1 file changed, 5 deletions(-) diff --git a/check_process b/check_process index 2b928af..74ccb2a 100644 --- a/check_process +++ b/check_process @@ -11,8 +11,6 @@ setup_private=0 setup_public=0 upgrade=1 - #0.7.1~ynh2 - upgrade=1 from_commit=7c074c7b18322cde08c4eb57ffbc5ae174b7ae65 #0.9.3~ynh1 upgrade=1 from_commit=330692e457ef2b475046d1724d3f198f007d5512 backup_restore=1 @@ -23,9 +21,6 @@ Email= Notification=none ;;; Upgrade options - ; commit=7c074c7b18322cde08c4eb57ffbc5ae174b7ae65 - name=Testing #60 - manifest_arg=domain=DOMAIN&path=PATH&password=mysecret& ; commit=330692e457ef2b475046d1724d3f198f007d5512 name=Testing #0.9.3~ynh1 manifest_arg=domain=DOMAIN&path=PATH&password=mysecret& From bcf70064ca75ea9ca937994d6f1e60b0cd234f05 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 25 Aug 2023 22:48:07 +0200 Subject: [PATCH 19/42] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index d1add2c..61c824a 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Lightweight CalDAV and CardDAV server", "fr": "Serveur CalDAV et CardDAV léger" }, - "version": "0.9.3~ynh2", + "version": "0.9.3~ynh3", "url": "https://sabre.io/baikal/", "upstream": { "license": "GPL-3.0", From cd4a65314fbf20948c9ca75dd1649f35ea02941c Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 25 Aug 2023 20:48:15 +0000 Subject: [PATCH 20/42] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c7c71e..bb21e62 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web inter Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. -**Shipped version:** 0.9.3~ynh2 +**Shipped version:** 0.9.3~ynh3 **Demo:** https://demo.yunohost.org/baikal/admin/ diff --git a/README_fr.md b/README_fr.md index bb1c327..458c05c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -20,7 +20,7 @@ Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendu Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -**Version incluse :** 0.9.3~ynh2 +**Version incluse :** 0.9.3~ynh3 **Démo :** https://demo.yunohost.org/baikal/admin/ From 9965ee252de86877e3616628bdfb262393f80c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 1 Sep 2023 12:06:08 +0200 Subject: [PATCH 21/42] Update baikal.yaml --- conf/baikal.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/baikal.yaml b/conf/baikal.yaml index 85ba73b..ae18af5 100644 --- a/conf/baikal.yaml +++ b/conf/baikal.yaml @@ -21,7 +21,7 @@ system: dav_ldap_email_attr: 'mail' database: encryption_key: '__ENCRYPT_KEY__' - sqlite_file: "absolute/path/to/Specific/db/db.sqlite" + #sqlite_file: "absolute/path/to/Specific/db/db.sqlite" mysql: true mysql_host: 'localhost' mysql_dbname: '__DB_NAME__' From c37081f598260c2fbf64f886104cb2ffa4104aeb Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 1 Sep 2023 18:51:05 +0200 Subject: [PATCH 22/42] Update upgrade (#83) --- scripts/upgrade | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a2fa9cc..e9e9f02 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -124,7 +124,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="Specific/ config/" + ynh_setup_source --dest_dir="$final_path" --keep="config/baikal.yaml" fi chmod 750 "$final_path" @@ -162,16 +162,16 @@ ynh_add_nginx_config # We keep this to allow upgrade the config file in case it needs to be changed. -#if [ "$upgrade_type" == "UPGRADE_APP" ] -#then -# ynh_script_progression --message="Upgrading the configuration file..." --weight=2 +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading the configuration file..." --weight=2 -# timezone=$(cat /etc/timezone) -# path=${path_url%/} -# ynh_add_config --template="../conf/baikal.yaml" --destination="$final_path/config/baikal.yaml" -# chown $app: "$final_path/config/baikal.yaml" -# chmod 640 "$final_path/config/baikal.yaml" -#fi + timezone=$(cat /etc/timezone) + path=${path_url%/} + ynh_add_config --template="../conf/baikal.yaml" --destination="$final_path/config/baikal.yaml" + chown $app: "$final_path/config/baikal.yaml" + chmod 640 "$final_path/config/baikal.yaml" +fi #================================================= # GENERIC FINALIZATION From ce6d8a8eca9755a5cd7d0693aeda4c329af0998f Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 29 Sep 2023 08:54:00 +0200 Subject: [PATCH 23/42] Version 2 (#79) * v2 * v2 * fix * Update manifest.toml * fix * Auto-update README * fix * Auto-update README * Update manifest.toml * Update manifest.toml * Update manifest.toml * Update upgrade * cleaning * Update manifest.toml * Update upgrade * Auto-update README * Update manifest.toml * Auto-update README * Update install --------- Co-authored-by: yunohost-bot --- .github/workflows/updater.sh | 132 --------------------------------- README.md | 7 +- README_fr.md | 7 +- check_process | 26 ------- conf/app.src | 7 -- conf/nginx.conf | 2 +- doc/DESCRIPTION.md | 4 +- doc/DESCRIPTION_fr.md | 4 +- manifest.json | 51 ------------- manifest.toml | 66 +++++++++++++++++ scripts/_common.sh | 8 -- scripts/backup | 24 +----- scripts/change_url | 75 +------------------ scripts/install | 108 ++++----------------------- scripts/remove | 53 -------------- scripts/restore | 89 +++++----------------- scripts/upgrade | 138 ++--------------------------------- tests.toml | 9 +++ 18 files changed, 126 insertions(+), 684 deletions(-) delete mode 100755 .github/workflows/updater.sh delete mode 100644 check_process delete mode 100644 conf/app.src delete mode 100644 manifest.json create mode 100644 manifest.toml create mode 100644 tests.toml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100755 index fd14205..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash - -#================================================= -# PACKAGE UPDATING HELPER -#================================================= - -# This script is meant to be run by GitHub Actions -# The YunoHost-Apps organisation offers a template Action to run this script periodically -# Since each app is different, maintainers can adapt its contents so as to perform -# automatic actions when a new upstream release is detected. - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -# Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -echo "REPO=$repo" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 -fi - -# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) -echo "${#assets[@]} available asset(s)" - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -# Here we use the $assets variable to get the resources published in the upstream release. -# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. - -# Let's loop over the array of assets URLs -for asset_url in ${assets[@]}; do - - echo "Handling asset at $asset_url" - - # Assign the asset to a source file in conf/ directory - # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) - # Leave $src empty to ignore the asset - case $asset_url in - *"baikal-"*".zip") - src="app" - ;; - *) - src="" - ;; - esac - - # If $src is not empty, let's process the asset - if [ ! -z "$src" ]; then - - # Create the temporary directory - tempdir="$(mktemp -d)" - - # Download sources and calculate checksum - filename=${asset_url##*/} - curl --silent -4 -L $asset_url -o "$tempdir/$filename" - checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - - # Delete temporary directory - rm -rf $tempdir - - # Get extension - if [[ $filename == *.tar.gz ]]; then - extension=tar.gz - else - extension=${filename##*.} - fi - - # Rewrite source file - cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=$extension -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true -EOT - echo "... conf/$src.src updated" - - else - echo "... asset ignored" - fi - -done - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json - -# No need to update the README, yunohost-bot takes care of it - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/README.md b/README.md index bb21e62..83990e3 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,9 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. +Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. -Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. - -**Shipped version:** 0.9.3~ynh3 +**Shipped version:** 0.9.3~ynh2 **Demo:** https://demo.yunohost.org/baikal/admin/ @@ -34,7 +32,6 @@ Baïkal allows to seamlessly access your contacts and calendars from every devic * Official user documentation: * Official admin documentation: * Upstream app code repository: -* YunoHost documentation for this app: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 458c05c..ed7caf3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,11 +16,9 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. +Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. - -**Version incluse :** 0.9.3~ynh3 +**Version incluse :** 0.9.3~ynh2 **Démo :** https://demo.yunohost.org/baikal/admin/ @@ -34,7 +32,6 @@ Baïkal permet d'accéder de manière transparente à vos contacts et calendrier * Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : -* Documentation YunoHost pour cette app : * Signaler un bug : ## Informations pour les développeurs diff --git a/check_process b/check_process deleted file mode 100644 index 9f11c12..0000000 --- a/check_process +++ /dev/null @@ -1,26 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/path" - password="1Strong-Password" - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=0 - upgrade=1 - #0.9.3~ynh1 - upgrade=1 from_commit=330692e457ef2b475046d1724d3f198f007d5512 - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=1 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=330692e457ef2b475046d1724d3f198f007d5512 - name=Testing #0.9.3~ynh1 - manifest_arg=domain=DOMAIN&path=PATH&password=mysecret& diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 36c0184..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://github.com/sabre-io/Baikal/releases/download/0.9.3/baikal-0.9.3.zip -SOURCE_SUM=d36955ce2e60a03875cf33ad793ddcecfae52096af39de1f2bf709de9f16cb5e -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/conf/nginx.conf b/conf/nginx.conf index d2fe937..e9c351e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -10,7 +10,7 @@ location = /.well-known/caldav { location __PATH__/ { # Path to source - alias __FINALPATH__/html/; + alias __INSTALL_DIR__/html/; index index.php; diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 899704f..e267448 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,3 +1 @@ -Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. - -Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. \ No newline at end of file +Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 007f96f..6b40eab 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,3 +1 @@ -Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. - -Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. \ No newline at end of file +Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. \ No newline at end of file diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 61c824a..0000000 --- a/manifest.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "Baïkal", - "id": "baikal", - "packaging_format": 1, - "description": { - "en": "Lightweight CalDAV and CardDAV server", - "fr": "Serveur CalDAV et CardDAV léger" - }, - "version": "0.9.3~ynh3", - "url": "https://sabre.io/baikal/", - "upstream": { - "license": "GPL-3.0", - "website": "https://sabre.io/baikal/", - "demo": "https://demo.yunohost.org/baikal/admin/", - "admindoc": "https://sabre.io/dav/", - "userdoc": "https://github.com/AlexandreMonroche/BaikalGuide", - "code": "https://github.com/sabre-io/Baikal" - }, - "license": "GPL-3.0", - "maintainer": { - "name": "", - "email": "" - }, - "requirements": { - "yunohost": ">= 11.2" - }, - "multi_instance": false, - "services": [ - "nginx", - "php8.0-fpm", - "mysql" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/baikal", - "default": "/baikal" - }, - { - "name": "password", - "type": "password" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..6908d45 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,66 @@ +packaging_format = 2 + +id = "baikal" +name = "Baïkal" +description.en = "Lightweight CalDAV and CardDAV server" +description.fr = "Serveur CalDAV et CardDAV léger" + +version = "0.9.3~ynh2" + +maintainers = [] + +[upstream] +license = "GPL-3.0" +website = "https://sabre.io/baikal/" +demo = "https://demo.yunohost.org/baikal/admin/" +admindoc = "https://sabre.io/dav/" +userdoc = "https://github.com/AlexandreMonroche/BaikalGuide" +code = "https://github.com/sabre-io/Baikal" + +[integration] +yunohost = ">= 11.2" +architectures = "all" +multi_instance = false +ldap = true +sso = false +disk = "50M" +ram.build = "100M" +ram.runtime = "50M" + +[install] + [install.domain] + type = "domain" + + [install.path] + type = "path" + default = "/baikal" + + [install.init_main_permission] + type = "group" + default = "all_users" + + [install.password] + type = "password" + +[resources] + [resources.sources.main] + url = "https://github.com/sabre-io/Baikal/releases/download/0.9.3/baikal-0.9.3.zip" + sha256 = "d36955ce2e60a03875cf33ad793ddcecfae52096af39de1f2bf709de9f16cb5e" + autoupdate.strategy = "latest_github_tag" + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" + main.auth_header = false + admin.url = "/admin" + admin.allowed= "admins" + admin.show_tile = false + + [resources.apt] + packages = "mariadb-server, php8.2-xml, php8.2-mbstring, php8.2-mysql, php8.2-ldap" + + [resources.database] + type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 93474a7..f74169b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,14 +6,6 @@ # PHP APP SPECIFIC #================================================= -# dependencies used by the app -YNH_PHP_VERSION=8.2 - -php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap" - -# dependencies used by the app (must be on a single line) -pkg_dependencies="$php_dependencies" - #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 86cad22..214b288 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,28 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading installation settings..." - -app=$YNH_APP_INSTANCE_NAME - -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -41,7 +19,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index bb5917c..2ad973b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,42 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 - -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # CHECK IF THE APP CAN BE MOVED WITH THESE ARGS #================================================= @@ -65,29 +29,7 @@ fi #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi +ynh_change_url_nginx_config #================================================= # SPECIFIC MODIFICATIONS @@ -96,20 +38,11 @@ fi #================================================= ynh_script_progression --message="Updating $app configuration..." --weight=2 -ynh_backup_if_checksum_is_different --file="$final_path/config/baikal.yaml" +ynh_backup_if_checksum_is_different --file="$install_dir/config/baikal.yaml" -ynh_replace_string --match_string="base_uri: '$old_path'" --replace_string="base_uri: '$new_path'" --target_file="$final_path/config/baikal.yaml" +ynh_replace_string --match_string="base_uri: '$old_path'" --replace_string="base_uri: '$new_path'" --target_file="$install_dir/config/baikal.yaml" -ynh_store_file_checksum --file="$final_path/config/baikal.yaml" - -#================================================= -# GENERIC FINALISATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload +ynh_store_file_checksum --file="$install_dir/config/baikal.yaml" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 21047c0..e04ad5d 100644 --- a/scripts/install +++ b/scripts/install @@ -9,45 +9,19 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -password=$YNH_APP_ARG_PASSWORD -phpversion=$YNH_PHP_VERSION - -app=$YNH_APP_INSTANCE_NAME - timezone=$(cat /etc/timezone) encrypt_key=$(ynh_string_random 24) password_hash=$(echo -n admin:BaikalDAV:$password | sha256sum | cut -d ' ' -f 1) -fpm_footprint="low" -fpm_free_footprint=0 -fpm_usage="low" #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - # Check if .well-known is available for this domain. if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then @@ -59,67 +33,27 @@ fi #================================================= ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=encrypt_key --value="$encrypt_key" ynh_app_setting_set --app=$app --key=password_hash --value="$password_hash" -ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint -ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint -ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=5 - -ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -ynh_script_progression --message="Creating a MySQL database..." --weight=2 - -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$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 #================================================= ynh_script_progression --message="Setting up source files..." --weight=8 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 +ynh_add_fpm_config --usage=low --footprint=low # Create a dedicated NGINX config ynh_add_nginx_config @@ -131,38 +65,22 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring $app..." --weight=3 -ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name < "$final_path/Core/Resources/Db/MySQL/db.sql" +ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name < "$install_dir/Core/Resources/Db/MySQL/db.sql" #================================================= # CONFIGURE BAIKAL #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -path=${path_url%/} +path=${path%/} -ynh_add_config --template="../conf/baikal.yaml" --destination="$final_path/config/baikal.yaml" -chown $app: "$final_path/config/baikal.yaml" -chmod 640 "$final_path/config/baikal.yaml" +ynh_add_config --template="../conf/baikal.yaml" --destination="$install_dir/config/baikal.yaml" + +chown $app: "$install_dir/config/baikal.yaml" +chmod 640 "$install_dir/config/baikal.yaml" # Disable installation -touch "$final_path/Specific/INSTALL_DISABLED" - -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." --weight=2 - -# Allow public access on / -ynh_permission_update --permission="main" --add="visitors" -# But restrain on /admin -ynh_permission_create --permission="admin" --url="/admin" --allowed="all_users" - -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload +touch "$install_dir/Specific/INSTALL_DISABLED" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index cefdd0b..61db822 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,36 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -#================================================= -# STANDARD REMOVE -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Removing the MySQL database..." --weight=1 - -# Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." --weight=3 - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -47,32 +17,9 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=3 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 17e7a91..8f4c828 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,108 +10,55 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " - # Check if .well-known is available for this domain. if is_url_handled --domain="$domain" --path="/.well-known/caldav" || is_url_handled --domain="$domain" --path="/.well-known/carddav" then ynh_die --message="Another app already uses the domain $domain to serve a calDAV/cardDAV feature. Please use another domain." fi -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=3 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" # Set permissions -chown $app: "$final_path/config/baikal.yaml" -chmod 640 "$final_path/config/baikal.yaml" - -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=5 - -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +chown $app: "$install_dir/config/baikal.yaml" +chmod 640 "$install_dir/config/baikal.yaml" #================================================= # RESTORE THE MYSQL DATABASE #================================================= ynh_script_progression --message="Restoring the MySQL database..." --weight=2 -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 +#================================================= +# RESTORE SYSTEM CONFIGURATIONS +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX AND PHP-FPM +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index e9e9f02..d5c6305 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,112 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=2 - -app=$YNH_APP_INSTANCE_NAME - -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) -password_hash=$(ynh_app_setting_get --app=$app --key=password_hash) -encrypt_key=$(ynh_app_setting_get --app=$app --key=encrypt_key) - -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=4 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path -fi - -# If db_name doesn't exist, create it -if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name -fi - -# If password_hash doesn't exist, create it -if [ -z "$password_hash" ]; then - password=$(ynh_app_setting_get --app=$app --key=password) - password_hash=$(echo -n admin:BaikalDAV:$password | md5sum | cut -d ' ' -f 1) - ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash -fi - -# If fpm_footprint doesn't exist, create it -if [ -z "$fpm_footprint" ]; then - fpm_footprint=low - ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint -fi - -# If fpm_free_footprint doesn't exist, create it -if [ -z "$fpm_free_footprint" ]; then - fpm_free_footprint=0 - ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint -fi - -# If fpm_usage doesn't exist, create it -if [ -z "$fpm_usage" ]; then - fpm_usage=low - ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -fi - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - -if ! ynh_permission_exists --permission="admin"; then - # Create the required permissions - ynh_permission_create --permission="admin" --url="/admin" --allowed="all_users" -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -124,19 +24,11 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="config/baikal.yaml" + ynh_setup_source --dest_dir="$install_dir" --keep="config/baikal.yaml" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=5 - -ynh_install_app_dependencies $pkg_dependencies +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION @@ -144,12 +36,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +ynh_add_fpm_config --usage=low --footprint=low # Create a dedicated NGINX config ynh_add_nginx_config @@ -167,21 +54,12 @@ then ynh_script_progression --message="Upgrading the configuration file..." --weight=2 timezone=$(cat /etc/timezone) - path=${path_url%/} - ynh_add_config --template="../conf/baikal.yaml" --destination="$final_path/config/baikal.yaml" - chown $app: "$final_path/config/baikal.yaml" - chmod 640 "$final_path/config/baikal.yaml" + path=${path%/} + ynh_add_config --template="../conf/baikal.yaml" --destination="$install_dir/config/baikal.yaml" + chown $app: "$install_dir/config/baikal.yaml" + chmod 640 "$install_dir/config/baikal.yaml" fi -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..d809718 --- /dev/null +++ b/tests.toml @@ -0,0 +1,9 @@ +test_format = 1.0 + +[default] + + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + test_upgrade_from.330692e457ef2b475046d1724d3f198f007d5512.name = "Upgrade from 0.9.3~ynh1" \ No newline at end of file From 808409a6fb738033bcbe3bc2f5f3b7b7a61bfe5a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 1 Oct 2023 07:40:16 +0200 Subject: [PATCH 24/42] cleaning --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index e04ad5d..cb8c8a9 100644 --- a/scripts/install +++ b/scripts/install @@ -53,7 +53,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config diff --git a/scripts/upgrade b/scripts/upgrade index d5c6305..4be4cb8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -36,7 +36,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config From 61baa66264a474e12fe25ff97631cead302bbbb5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 1 Oct 2023 05:40:22 +0000 Subject: [PATCH 25/42] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9df75ec..83990e3 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. -**Shipped version:** 0.9.3~ynh3 +**Shipped version:** 0.9.3~ynh2 **Demo:** https://demo.yunohost.org/baikal/admin/ diff --git a/README_fr.md b/README_fr.md index 89d2ce0..ed7caf3 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -**Version incluse :** 0.9.3~ynh3 +**Version incluse :** 0.9.3~ynh2 **Démo :** https://demo.yunohost.org/baikal/admin/ From 442b2eec84c1962d98554ba91f95c8e47c2e4e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:27:28 +0200 Subject: [PATCH 26/42] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 6908d45..731a4fc 100644 --- a/manifest.toml +++ b/manifest.toml @@ -60,7 +60,7 @@ ram.runtime = "50M" admin.show_tile = false [resources.apt] - packages = "mariadb-server, php8.2-xml, php8.2-mbstring, php8.2-mysql, php8.2-ldap" + packages = "mariadb-server, php8.1-xml, php8.1-mbstring, php8.1-mysql, php8.1-ldap" [resources.database] type = "mysql" From c1a26fb221d760c35698a0c99b944d9c253e0bf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:28:40 +0200 Subject: [PATCH 27/42] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 731a4fc..ae1ff2d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Baïkal" description.en = "Lightweight CalDAV and CardDAV server" description.fr = "Serveur CalDAV et CardDAV léger" -version = "0.9.3~ynh2" +version = "0.9.3~ynh4" maintainers = [] From ed67e802a822c39c6e620023d0a840ccde2accdc Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 3 Oct 2023 07:28:44 +0000 Subject: [PATCH 28/42] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 83990e3..a29d03c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. -**Shipped version:** 0.9.3~ynh2 +**Shipped version:** 0.9.3~ynh4 **Demo:** https://demo.yunohost.org/baikal/admin/ diff --git a/README_fr.md b/README_fr.md index ed7caf3..6466b18 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -**Version incluse :** 0.9.3~ynh2 +**Version incluse :** 0.9.3~ynh4 **Démo :** https://demo.yunohost.org/baikal/admin/ From 812990b640a78593471e151054acbff958bc8ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Oct 2023 22:48:52 +0200 Subject: [PATCH 29/42] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index ae1ff2d..bb68223 100644 --- a/manifest.toml +++ b/manifest.toml @@ -60,7 +60,7 @@ ram.runtime = "50M" admin.show_tile = false [resources.apt] - packages = "mariadb-server, php8.1-xml, php8.1-mbstring, php8.1-mysql, php8.1-ldap" + packages = "mariadb-server, php8.0-xml, php8.0-mbstring, php8.0-mysql, php8.0-ldap" [resources.database] type = "mysql" From 461b2e9cde52f1def62a03b0847ca112dd6a0584 Mon Sep 17 00:00:00 2001 From: Toromtomtom Date: Tue, 14 Nov 2023 14:21:30 +0000 Subject: [PATCH 30/42] rename 'app' -> 'main' (#89) 'main' is the new default source_id. This re-enables the extra sources and the patch, which in turn re-enables the LDAP authentication. --- .../Core/Frameworks/Baikal/Core/AbstractExternalAuth.php | 0 .../Core/Frameworks/Baikal/Core/LDAPUserBindAuth.php | 0 sources/extra_files/{app => main}/bin/upgrade.sh | 0 .../patches/{app-add-ldap-auth.patch => main-add-ldap-auth.patch} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename sources/extra_files/{app => main}/Core/Frameworks/Baikal/Core/AbstractExternalAuth.php (100%) rename sources/extra_files/{app => main}/Core/Frameworks/Baikal/Core/LDAPUserBindAuth.php (100%) rename sources/extra_files/{app => main}/bin/upgrade.sh (100%) rename sources/patches/{app-add-ldap-auth.patch => main-add-ldap-auth.patch} (100%) diff --git a/sources/extra_files/app/Core/Frameworks/Baikal/Core/AbstractExternalAuth.php b/sources/extra_files/main/Core/Frameworks/Baikal/Core/AbstractExternalAuth.php similarity index 100% rename from sources/extra_files/app/Core/Frameworks/Baikal/Core/AbstractExternalAuth.php rename to sources/extra_files/main/Core/Frameworks/Baikal/Core/AbstractExternalAuth.php diff --git a/sources/extra_files/app/Core/Frameworks/Baikal/Core/LDAPUserBindAuth.php b/sources/extra_files/main/Core/Frameworks/Baikal/Core/LDAPUserBindAuth.php similarity index 100% rename from sources/extra_files/app/Core/Frameworks/Baikal/Core/LDAPUserBindAuth.php rename to sources/extra_files/main/Core/Frameworks/Baikal/Core/LDAPUserBindAuth.php diff --git a/sources/extra_files/app/bin/upgrade.sh b/sources/extra_files/main/bin/upgrade.sh similarity index 100% rename from sources/extra_files/app/bin/upgrade.sh rename to sources/extra_files/main/bin/upgrade.sh diff --git a/sources/patches/app-add-ldap-auth.patch b/sources/patches/main-add-ldap-auth.patch similarity index 100% rename from sources/patches/app-add-ldap-auth.patch rename to sources/patches/main-add-ldap-auth.patch From 7190fd530efbed9a2be543e0a01d59e1e8b0c104 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 14 Nov 2023 14:21:35 +0000 Subject: [PATCH 31/42] Auto-update README --- README.md | 1 + README_fr.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index a29d03c..4f66521 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web inter * Official user documentation: * Official admin documentation: * Upstream app code repository: +* YunoHost Store: * Report a bug: ## Developer info diff --git a/README_fr.md b/README_fr.md index 6466b18..c6e3cfa 100644 --- a/README_fr.md +++ b/README_fr.md @@ -32,6 +32,7 @@ Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendu * Documentation officielle utilisateur : * Documentation officielle de l’admin : * Dépôt de code officiel de l’app : +* YunoHost Store: * Signaler un bug : ## Informations pour les développeurs From ca514550a4abb25d0c19f5f6f5c9e0540b4dc858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Nov 2023 15:22:26 +0100 Subject: [PATCH 32/42] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index bb68223..9108602 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Baïkal" description.en = "Lightweight CalDAV and CardDAV server" description.fr = "Serveur CalDAV et CardDAV léger" -version = "0.9.3~ynh4" +version = "0.9.3~ynh5" maintainers = [] From 03601e58ad63dec7060d754cf2a3800890c6196e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 14 Nov 2023 14:22:31 +0000 Subject: [PATCH 33/42] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f66521..4a1e36b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. -**Shipped version:** 0.9.3~ynh4 +**Shipped version:** 0.9.3~ynh5 **Demo:** https://demo.yunohost.org/baikal/admin/ diff --git a/README_fr.md b/README_fr.md index c6e3cfa..59e0983 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -**Version incluse :** 0.9.3~ynh4 +**Version incluse :** 0.9.3~ynh5 **Démo :** https://demo.yunohost.org/baikal/admin/ From d777d75a6434b9094ebc43f6354a23ac0ada13a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Nov 2023 23:25:25 +0100 Subject: [PATCH 34/42] Update manifest.toml --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index 9108602..86706a0 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Baïkal" description.en = "Lightweight CalDAV and CardDAV server" description.fr = "Serveur CalDAV et CardDAV léger" -version = "0.9.3~ynh5" +version = "0.9.4~ynh1" maintainers = [] @@ -44,8 +44,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/sabre-io/Baikal/releases/download/0.9.3/baikal-0.9.3.zip" - sha256 = "d36955ce2e60a03875cf33ad793ddcecfae52096af39de1f2bf709de9f16cb5e" + url = "https://github.com/sabre-io/Baikal/releases/download/0.9.4/baikal-0.9.4.zip" + sha256 = "47a23aa06bc82504e0f216ea81328d9fa00c9c9d9f178d5487ce8960e941e58e" autoupdate.strategy = "latest_github_tag" [resources.system_user] From acb157c5478aad877e6d9259befb016c76f059a3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 15 Nov 2023 22:25:30 +0000 Subject: [PATCH 35/42] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a1e36b..06b644d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. -**Shipped version:** 0.9.3~ynh5 +**Shipped version:** 0.9.4~ynh1 **Demo:** https://demo.yunohost.org/baikal/admin/ diff --git a/README_fr.md b/README_fr.md index 59e0983..7ef7513 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -**Version incluse :** 0.9.3~ynh5 +**Version incluse :** 0.9.4~ynh1 **Démo :** https://demo.yunohost.org/baikal/admin/ From 5794b5a64c3f1a7fae3567f237c01c9c6404038b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 13 Jan 2024 13:44:05 +0100 Subject: [PATCH 36/42] cleaning --- conf/baikal.yaml | 2 +- manifest.toml | 3 +++ scripts/install | 5 +---- scripts/remove | 2 -- scripts/upgrade | 5 +---- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/conf/baikal.yaml b/conf/baikal.yaml index ae18af5..726399c 100644 --- a/conf/baikal.yaml +++ b/conf/baikal.yaml @@ -1,5 +1,5 @@ system: - configured_version: '0.9.3' + configured_version: '0.9.4' timezone: '__TIMEZONE__' card_enabled: true cal_enabled: true diff --git a/manifest.toml b/manifest.toml index 86706a0..4a3139d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -21,8 +21,11 @@ code = "https://github.com/sabre-io/Baikal" yunohost = ">= 11.2" architectures = "all" multi_instance = false + ldap = true + sso = false + disk = "50M" ram.build = "100M" ram.runtime = "50M" diff --git a/scripts/install b/scripts/install index cb8c8a9..2827025 100644 --- a/scripts/install +++ b/scripts/install @@ -41,7 +41,6 @@ ynh_app_setting_set --app=$app --key=password_hash --value="$password_hash" #================================================= ynh_script_progression --message="Setting up source files..." --weight=8 -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" @@ -52,10 +51,8 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 -# Create a dedicated PHP-FPM config ynh_add_fpm_config -# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -74,7 +71,7 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 path=${path%/} -ynh_add_config --template="../conf/baikal.yaml" --destination="$install_dir/config/baikal.yaml" +ynh_add_config --template="baikal.yaml" --destination="$install_dir/config/baikal.yaml" chown $app: "$install_dir/config/baikal.yaml" chmod 640 "$install_dir/config/baikal.yaml" diff --git a/scripts/remove b/scripts/remove index 61db822..ac762c0 100644 --- a/scripts/remove +++ b/scripts/remove @@ -14,10 +14,8 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 -# Remove the dedicated NGINX config ynh_remove_nginx_config -# Remove the dedicated PHP-FPM config ynh_remove_fpm_config #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4be4cb8..e9957e8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,7 +23,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=3 - # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --keep="config/baikal.yaml" fi @@ -35,10 +34,8 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 -# Create a dedicated PHP-FPM config ynh_add_fpm_config -# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -55,7 +52,7 @@ then timezone=$(cat /etc/timezone) path=${path%/} - ynh_add_config --template="../conf/baikal.yaml" --destination="$install_dir/config/baikal.yaml" + ynh_add_config --template="baikal.yaml" --destination="$install_dir/config/baikal.yaml" chown $app: "$install_dir/config/baikal.yaml" chmod 640 "$install_dir/config/baikal.yaml" fi From 9da9eb03e13a2123f84c85848f7d38e4805d665d Mon Sep 17 00:00:00 2001 From: Toromtomtom Date: Sat, 13 Jan 2024 14:15:15 +0100 Subject: [PATCH 37/42] Add fail2ban (#92) * fail2ban for LDAP authentication errors * fix log file path * fix regex * cleaning --------- Co-authored-by: ericgaspar --- scripts/backup | 7 +++++++ scripts/install | 11 +++++++++++ scripts/remove | 2 ++ scripts/restore | 6 ++++-- scripts/upgrade | 8 +++++++- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/scripts/backup b/scripts/backup index 214b288..04eed75 100644 --- a/scripts/backup +++ b/scripts/backup @@ -33,6 +33,13 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# BACKUP FAIL2BAN CONFIGURATION +#================================================= + +ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" +ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" + #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index 2827025..e4d676d 100644 --- a/scripts/install +++ b/scripts/install @@ -55,6 +55,17 @@ ynh_add_fpm_config ynh_add_nginx_config +#================================================= +# SETUP FAIL2BAN +#================================================= +ynh_script_progression --message="Configuring fail2ban..." --weight=1 + +# Create the logfile, required before configuring fail2ban +touch "/var/log/${domain}-error.log" + +# Create a dedicated fail2ban config +ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex='"PHP message: user \(name stripped-out\) authentication failure for Baikal" while reading response header from upstream, client: ' + #================================================= # SPECIFIC SETUP #================================================= diff --git a/scripts/remove b/scripts/remove index ac762c0..8d28c8c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,6 +18,8 @@ ynh_remove_nginx_config ynh_remove_fpm_config +ynh_remove_fail2ban_config + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 8f4c828..77daf9b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -45,14 +45,16 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" +ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" +ynh_systemd_action --action=restart --service_name=fail2ban + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index e9957e8..8ad1c75 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,7 +30,7 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 @@ -38,6 +38,12 @@ ynh_add_fpm_config ynh_add_nginx_config +# Create the logfile, required before configuring fail2ban +touch "/var/log/${domain}-error.log" + +# Create a dedicated fail2ban config +ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex='"PHP message: user \(name stripped-out\) authentication failure for Baikal" while reading response header from upstream, client: ' + #================================================= # SPECIFIC UPGRADE #================================================= From 79a02d0544ce2986bcf7d282d45808c0809b5adf Mon Sep 17 00:00:00 2001 From: Tom Warnke Date: Sat, 23 Dec 2023 14:02:30 +0100 Subject: [PATCH 38/42] Add explaining help text So far it is not obvious that the app needs to be set to public for CalDAV/CardDAV clients to work. --- manifest.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.toml b/manifest.toml index 4a3139d..a847e43 100644 --- a/manifest.toml +++ b/manifest.toml @@ -41,6 +41,7 @@ ram.runtime = "50M" [install.init_main_permission] type = "group" default = "all_users" + help.en = "If you want to access Baikal with CalDAV or CardDAV clients, you need to allow access for visitors." [install.password] type = "password" From 87f6ddb74c3903db677b7676e94ad8ac389133f1 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 14 Jan 2024 22:49:05 +0100 Subject: [PATCH 39/42] Update install: typo... --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index e4d676d..d9ba7fc 100644 --- a/scripts/install +++ b/scripts/install @@ -61,7 +61,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring fail2ban..." --weight=1 # Create the logfile, required before configuring fail2ban -touch "/var/log/${domain}-error.log" +touch "/var/log/nginx/${domain}-error.log" # Create a dedicated fail2ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex='"PHP message: user \(name stripped-out\) authentication failure for Baikal" while reading response header from upstream, client: ' From 0fffb7306771ac61c168fe4f31de4f3d9d3ac3ba Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 14 Jan 2024 22:49:26 +0100 Subject: [PATCH 40/42] Update upgrade: typo again --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8ad1c75..b3ea522 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,7 +39,7 @@ ynh_add_fpm_config ynh_add_nginx_config # Create the logfile, required before configuring fail2ban -touch "/var/log/${domain}-error.log" +touch "/var/log/nginx/${domain}-error.log" # Create a dedicated fail2ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex='"PHP message: user \(name stripped-out\) authentication failure for Baikal" while reading response header from upstream, client: ' From b9d16d12d43c72951eb5908115ea986dd293986e Mon Sep 17 00:00:00 2001 From: Toromtomtom Date: Sun, 4 Feb 2024 08:55:09 +0000 Subject: [PATCH 41/42] enable anonymous access by default (#95) --- manifest.toml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index a847e43..5d8237c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -38,11 +38,6 @@ ram.runtime = "50M" type = "path" default = "/baikal" - [install.init_main_permission] - type = "group" - default = "all_users" - help.en = "If you want to access Baikal with CalDAV or CardDAV clients, you need to allow access for visitors." - [install.password] type = "password" @@ -58,9 +53,10 @@ ram.runtime = "50M" [resources.permissions] main.url = "/" + main.allowed = "visitors" main.auth_header = false admin.url = "/admin" - admin.allowed= "admins" + admin.allowed = "admins" admin.show_tile = false [resources.apt] From c623ede487bf7156626d4fec2d63f81e1b69c38d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 2 Apr 2024 12:59:39 +0000 Subject: [PATCH 42/42] Auto-update READMEs --- ALL_README.md | 5 +++++ README.md | 28 ++++++++++++++-------------- README_eu.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 34 +++++++++++++++++----------------- 4 files changed, 86 insertions(+), 31 deletions(-) create mode 100644 ALL_README.md create mode 100644 README_eu.md diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..3eeb161 --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,5 @@ +# All available README files by language + +- [Read the README in English](README.md) +- [Irakurri README euskaraz](README_eu.md) +- [Lire le README en français](README_fr.md) diff --git a/README.md b/README.md index 06b644d..db96675 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -9,10 +9,10 @@ It shall NOT be edited by hand. [![Install Baïkal with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=baikal) -*[Lire ce readme en français.](./README_fr.md)* +*[Read this README in other languages.](./ALL_README.md)* -> *This package allows you to install Baïkal quickly and simply on a YunoHost server. -If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* +> *This package allows you to install Baïkal quickly and simply on a YunoHost server.* +> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview @@ -20,7 +20,7 @@ Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web inter **Shipped version:** 0.9.4~ynh1 -**Demo:** https://demo.yunohost.org/baikal/admin/ +**Demo:** ## Screenshots @@ -28,20 +28,20 @@ Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web inter ## Documentation and resources -* Official app website: -* Official user documentation: -* Official admin documentation: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Official app website: +- Official user documentation: +- Official admin documentation: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/baikal_ynh/tree/testing). +Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/baikal_ynh/tree/testing). -To try the testing branch, please proceed like that. +To try the `testing` branch, please proceed like that: -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/baikal_ynh/tree/testing --debug or sudo yunohost app upgrade baikal -u https://github.com/YunoHost-Apps/baikal_ynh/tree/testing --debug diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..bfa14b1 --- /dev/null +++ b/README_eu.md @@ -0,0 +1,50 @@ + + +# Baïkal YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/baikal.svg)](https://dash.yunohost.org/appci/app/baikal) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/baikal.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/baikal.maintain.svg) + +[![Instalatu Baïkal YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=baikal) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Baïkal YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +Baïkal is a lightweight CalDAV+CardDAV server. It offers an extensive web interface with easy management of users, address books and calendars. It is fast and simple to install and only needs a basic PHP capable server. The data are stored in a MySQL database. Baïkal allows to seamlessly access your contacts and calendars from every device. It is compatible with iOS, macOS, DAVx5 on Android, Mozilla Thunderbird and every other CalDAV and CardDAV capable application. Protect your privacy by hosting calendars and contacts yourself with Baïkal. + +**Paketatutako bertsioa:** 0.9.4~ynh1 + +**Demoa:** + +## Pantaila-argazkiak + +![Baïkal(r)en pantaila-argazkia](./doc/screenshots/baikal-in-use.png) + +## Dokumentazioa eta baliabideak + +- Aplikazioaren webgune ofiziala: +- Erabiltzaileen dokumentazio ofiziala: +- Administratzaileen dokumentazio ofiziala: +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/baikal_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/baikal_ynh/tree/testing --debug +edo +sudo yunohost app upgrade baikal -u https://github.com/YunoHost-Apps/baikal_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 7ef7513..b412c57 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Baïkal pour YunoHost @@ -9,18 +9,18 @@ It shall NOT be edited by hand. [![Installer Baïkal avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=baikal) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *Ce package vous permet d’installer Baïkal rapidement et simplement sur un serveur YunoHost. -Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* +> *Ce package vous permet d’installer Baïkal rapidement et simplement sur un serveur YunoHost.* +> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* ## Vue d’ensemble Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendue avec une gestion facile des utilisateurs, des carnets d'adresses et des calendriers. Il est rapide et simple à installer et ne nécessite qu'un serveur de base. Les données sont stockées dans une base de données MySQL. Baïkal permet d'accéder de manière transparente à vos contacts et calendriers depuis n'importe quel appareil. Il est compatible avec iOS, macOS, DAVx5 sur Android, Mozilla Thunderbird et toutes les autres applications compatibles CalDAV et CardDAV. Protégez votre vie privée en hébergeant vous-même des calendriers et contacts avec Baïkal. -**Version incluse :** 0.9.4~ynh1 +**Version incluse :** 0.9.4~ynh1 -**Démo :** https://demo.yunohost.org/baikal/admin/ +**Démo :** ## Captures d’écran @@ -28,23 +28,23 @@ Baïkal est un serveur léger CalDAV+CardDAV. Il offre une interface Web étendu ## Documentations et ressources -* Site officiel de l’app : -* Documentation officielle utilisateur : -* Documentation officielle de l’admin : -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Site officiel de l’app : +- Documentation officielle utilisateur : +- Documentation officielle de l’admin : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/baikal_ynh/tree/testing). +Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/baikal_ynh/tree/testing). -Pour essayer la branche testing, procédez comme suit. +Pour essayer la branche `testing`, procédez comme suit : -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/baikal_ynh/tree/testing --debug ou sudo yunohost app upgrade baikal -u https://github.com/YunoHost-Apps/baikal_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :**