mirror of
https://github.com/YunoHost-Apps/radicale_ynh.git
synced 2024-09-03 20:16:14 +02:00
Merge pull request #7 from YunoHost-Apps/testing
Upgrade package and update 1.1.6
This commit is contained in:
commit
fde5aef020
13 changed files with 1015 additions and 866 deletions
77
README.md
77
README.md
|
@ -1,29 +1,70 @@
|
|||
Radicale for YunoHost
|
||||
==================
|
||||
# Radicale for YunoHost
|
||||
|
||||
[Yunohost project](https://yunohost.org/#/)
|
||||
[![Integration level](https://dash.yunohost.org/integration/radicale.svg)](https://ci-apps.yunohost.org/jenkins/job/radicale%20%28Community%29/lastBuild/consoleFull)
|
||||
[![Install Radicale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=radicale)
|
||||
|
||||
Radicale est un serveur CalDAV (calendrier) et CardDAV (contact) complet.
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
http://radicale.org/
|
||||
> *This package allow you to install Radicale quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
||||
|
||||
==================
|
||||
## Overview
|
||||
|
||||
Radicale ne dispose d'aucune interface, sa configuration doit être faite à l'aide des fichiers de configurations dans '/etc/radicale/'
|
||||
Il est moins friendly-user que [baikal](https://github.com/julienmalik/baikal_ynh), mais il permet de partager des calendriers en lecture seule et en écriture avec d'autres utilisateurs, qu'ils soient sur le même serveur ou pas.
|
||||
La configuration des partages se fait à l'aide du fichier de configuration des droits '/etc/radicale/rights'.
|
||||
Radicale is a small but powerful CalDAV (calendars, todo-lists) and CardDAV (contacts) server.
|
||||
|
||||
==================
|
||||
**Shipped version:** 1.1.6
|
||||
**Shipped version of InfCloud:** 0.13.1
|
||||
|
||||
~~En l'état, radicale ne fonctionne pas avec [Agendav](https://github.com/julienmalik/agendav_ynh)~~. (*il semble lors de mes derniers essai que Agendav fonctionne sans problème à présent*). Ce package est donc proposé avec l'interface caldav/carddav [InfCloud](https://www.inf-it.com/open-source/clients/infcloud/)
|
||||
## Screenshots
|
||||
|
||||
Le script installe les paquets *libjansson4* *libldap2-dev* *libmatheval1* *libpgm-5.1-0* *libpython-dev* *libsasl2-dev* *libsodium13* *libzmq3* *python-chardet-whl* *python-colorama-whl* *python-dev* *python-distlib-whl* *python-html5lib-whl* *python-pip-whl* *python-requests-whl* *python-setuptools-whl* *python-six-whl* *python-urllib3-whl* *python-virtualenv* *python3-virtualenv* *uwsgi* *uwsgi-core* *uwsgi-plugin-python* *virtualenv*.
|
||||
## Configuration
|
||||
|
||||
**Mise à jour du package:**
|
||||
sudo yunohost app upgrade --verbose radicale -u https://github.com/YunoHost-Apps/radicale_ynh
|
||||
Use the file `/etc/radicale/config` to change the main configuration of radicale.
|
||||
The file `/etc/radicale/logging` to change the level of logging.
|
||||
And the file `/etc/radicale/rights` to edit the way the calendars will be sharing.
|
||||
|
||||
**Multi-utilisateur:** Oui, avec support ldap.
|
||||
InfCloud has its own config file, at /var/www/radicale/infcloud/config.js
|
||||
|
||||
**Voir l'état du package:**
|
||||
*[Dernier rapport hebdomadaire](https://forum.yunohost.org/t/rapport-hebdomadaire-dintegration-continue/2297)*
|
||||
*[Dernier test d'intégration continue](https://ci-apps.yunohost.org/jenkins/job/radicale%20%28Community%29/lastBuild/consoleFull)*
|
||||
## Documentation
|
||||
|
||||
* Official documentation: https://github.com/Kozea/Radicale/blob/website/pages/user_documentation.rst
|
||||
* YunoHost documentation: [app_radicale.md](./app_radicale.md)
|
||||
|
||||
## YunoHost specific features
|
||||
|
||||
* This package bring a web interface for radicale named InfCloud.
|
||||
|
||||
#### Multi-users support
|
||||
|
||||
Supported, with LDAP and SSO only with radicale, not for InfCloud.
|
||||
|
||||
#### Supported architectures
|
||||
|
||||
* Tested on x86_64
|
||||
|
||||
## Limitations
|
||||
|
||||
* The version 1.1.6 is relatively old. There's a version 2 of radicale, but this new version dos not support ldap yet.
|
||||
|
||||
## Additionnal informations
|
||||
|
||||
## Links
|
||||
|
||||
* Report a bug: https://github.com/YunoHost-Apps/radicale_ynh/issues
|
||||
* Radicale website: http://radicale.org/
|
||||
* InfCloud website: https://www.inf-it.com/open-source/clients/infcloud/
|
||||
* YunoHost website: https://yunohost.org/
|
||||
|
||||
---
|
||||
|
||||
Developers infos
|
||||
----------------
|
||||
|
||||
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/radicale_ynh/tree/testing).
|
||||
|
||||
To try the testing branch, please proceed like that.
|
||||
```
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/radicale_ynh/tree/testing --verbose
|
||||
or
|
||||
sudo yunohost app upgrade radicale -u https://github.com/YunoHost-Apps/radicale_ynh/tree/testing --verbose
|
||||
```
|
||||
|
|
70
README_fr.md
Normal file
70
README_fr.md
Normal file
|
@ -0,0 +1,70 @@
|
|||
# Radicale pour YunoHost
|
||||
|
||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/radicale.svg)](https://ci-apps.yunohost.org/jenkins/job/radicale%20%28Community%29/lastBuild/consoleFull)
|
||||
[![Installer Radicale avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=radicale)
|
||||
|
||||
*[Read this readme in english.](./README.md)*
|
||||
|
||||
> *Ce package vous permet d'installer Radicale rapidement et simplement sur un serveur YunoHost.
|
||||
Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/install_fr) pour savoir comment l'installer et en profiter.*
|
||||
|
||||
## Résumé
|
||||
|
||||
Radicale est un petit mais puissant serveur CalDAV (calendriers, listes de tâches) et CardDAV (contacts).
|
||||
|
||||
**Version embarquée:** 1.1.6
|
||||
**Version embarquée de InfCloud:** 0.13.1
|
||||
|
||||
## Captures d'écran
|
||||
|
||||
## Configuration
|
||||
|
||||
Utilisez le fichier `/etc/radicale/config` pour modifier la configuration principale de radicale.
|
||||
Le fichier `/etc/radicale/logging` pour changer le niveau de journalisation.
|
||||
Et le fichier `/etc/radicale/rights` pour éditer la façon dont les calendriers seront partagés.
|
||||
|
||||
InfCloud a son propre fichier de config, à /var/www/radicale/infcloud/config.js
|
||||
|
||||
## Documentation
|
||||
|
||||
* Official documentation: https://github.com/Kozea/Radicale/blob/website/pages/user_documentation.rst
|
||||
* Documentation YunoHost: [app_radicale_fr.md](./app_radicale_fr.md)
|
||||
|
||||
## Fonctionnalités spécifiques à YunoHost
|
||||
|
||||
* Ce package propose une interface web pour radicale nommée InfCloud.
|
||||
|
||||
#### Support multi-utilisateurs
|
||||
|
||||
Supportée, avec LDAP et SSO seulement avec radicale, pas pour InfCloud.
|
||||
|
||||
#### Architectures supportées.
|
||||
|
||||
* Testé sur x86_64
|
||||
|
||||
## Limitations
|
||||
|
||||
* La version 1.1.6 est relativement ancienne. Il existe une version 2 de radicale, mais cette nouvelle version ne supporte pas encore ldap.
|
||||
|
||||
## Informations additionnelles
|
||||
|
||||
## Liens
|
||||
|
||||
* Reporter un bug: https://github.com/YunoHost-Apps/radicale_ynh/issues
|
||||
* Site de Radicale: http://radicale.org/
|
||||
* Site de InfCloud: https://www.inf-it.com/open-source/clients/infcloud/
|
||||
* Site de YunoHost: https://yunohost.org/
|
||||
|
||||
---
|
||||
|
||||
Informations à l'intention des développeurs
|
||||
----------------
|
||||
|
||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/radicale_ynh/tree/testing).
|
||||
|
||||
Pour tester la branche testing, merci de procéder ainsi.
|
||||
```
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/radicale_ynh/tree/testing --verbose
|
||||
ou
|
||||
sudo yunohost app upgrade radicale -u https://github.com/YunoHost-Apps/radicale_ynh/tree/testing --verbose
|
||||
```
|
117
YEP.md
Normal file
117
YEP.md
Normal file
|
@ -0,0 +1,117 @@
|
|||
#### [Level 0](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-0)
|
||||
[YEP 1.1 - Nommer son app et son dépot](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
||||
`Validated`
|
||||
[YEP 1.2 - Inscrire l'app sur un "répertoire" connu](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-12)
|
||||
`Validated`
|
||||
|
||||
#### [Level 1](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-1)
|
||||
[YEP 2.2 - Utiliser bash pour les scripts principaux](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-22)
|
||||
`Validated`
|
||||
[YEP 2.5 - Copier correctement des fichiers](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-25)
|
||||
`Don't know`
|
||||
[YEP 2.7 - Donner des permissions suffisantes aux instructions bash](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-27)
|
||||
`Validated`
|
||||
[YEP 2.15 - Suivre les instructions d'installation de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-215)
|
||||
`Validated`
|
||||
|
||||
#### [Level 2](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-2)
|
||||
[YEP 1.5 - Mettre à jour régulièrement le statut de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
||||
`Validated`
|
||||
[YEP 2.18.2 - Gérer l'installation à la racine d’un nom de domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2182)
|
||||
`Validated` - *Automatically verified.*
|
||||
[YEP 2.18.3 - Gérer l'installation sur un sous-domaine](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2183)
|
||||
`Validated` - *Automatically verified.*
|
||||
[YEP 2.18.4 - Gérer l'installation sur un chemin /path](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2184)
|
||||
`Validated` - *Automatically verified.*
|
||||
[YEP 4.6 - Gère le multi-instance](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-11)
|
||||
`Not applicable` - *Automatically verified.*
|
||||
|
||||
#### [Level 3](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-3)
|
||||
[YEP 2.3 - Sauvegarder les réponses lors de l'installation](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-23)
|
||||
`Validated`
|
||||
|
||||
#### [Level 4](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-4)
|
||||
[YEP 4.1 - Lier au ldap](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-41)
|
||||
`Partially validated`
|
||||
[YEP 4.2 - Lier l'authentification au sso](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-42)
|
||||
`Partially validated`
|
||||
|
||||
#### [Level 5](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-5)
|
||||
[YEP 1.3 - Indiquer la licence associée au paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-13)
|
||||
`Validated`
|
||||
[YEP 2.1 - Respecter le format du manifeste](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-21)
|
||||
`Validated` - *Automatically verified.*
|
||||
[YEP 2.12 - Utiliser les commandes pratiques (helpers)](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-212)
|
||||
`Validated`
|
||||
[YEP 2.18.1 - Lancer le script d'installation d'une webapp correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2181)
|
||||
`Not applicable`
|
||||
|
||||
#### [Level 6](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-6)
|
||||
[YEP 1.4 - Informer sur l'intention de maintenir un paquet](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-14)
|
||||
`Validated`
|
||||
[YEP 1.6 - Se tenir informé sur l'évolution du packaging d'apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-16)
|
||||
`Validated`
|
||||
[YEP 1.7 - Ajouter l'app à l'organisation YunoHost-Apps](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-17)
|
||||
`Validated` - *Automatically verified.*
|
||||
[YEP 1.8 - Publier des demandes de test](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-18)
|
||||
`Validated`
|
||||
[YEP 1.9 - Documenter l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-19)
|
||||
`Validated`
|
||||
[YEP 1.10 - Garder un historique de version propre](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-110)
|
||||
`Don't know`
|
||||
[YEP 2.9 - Enlever toutes traces de l'app lors de la suppression](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-29)
|
||||
`Validated`
|
||||
[YEP 3.3 - Faciliter le contrôle de l'intégrité des sources](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-33)
|
||||
`Validated`
|
||||
[YEP 3.5 - Suivre les recommendations de la documentation de l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-35)
|
||||
`Validated`
|
||||
[YEP 3.6 - Mettre à jour les versions contenant des CVE](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-36)
|
||||
`Validated`
|
||||
[YEP 4.3 - Fournir un script de sauvegarde YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-43)
|
||||
`Validated` - *Automatically verified.*
|
||||
[YEP 4.4 - Fournir un script de restauration YunoHost fonctionnel](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-44)
|
||||
`Validated` - *Automatically verified.*
|
||||
|
||||
#### [Level 7](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-7)
|
||||
[YEP 2.6 - Annuler l'action si les valeurs d'entrées sont incorrectes](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-26)
|
||||
`Validated`
|
||||
[YEP 3.2 - Ouvrir un port correctement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-32)
|
||||
`Not applicable`
|
||||
|
||||
#### [Level 8](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-8)
|
||||
[YEP 2.4 - Détecter et gérer les erreurs](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-24)
|
||||
`Validated`
|
||||
[YEP 2.8 - Modifier correctement une configuration système](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-28)
|
||||
`Validated`
|
||||
[YEP 2.16 - Vérifier la disponibilité des dépendances sur ARM, x86 et x64](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-216)
|
||||
`Not yet validated` - *Automatically verified.*
|
||||
[YEP 2.18.5 - Gérer la tuile YunoHost pour faciliter la navigation entre les applications](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-2185)
|
||||
`Validated`
|
||||
[YEP 3.4 - Isoler l'app](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-34)
|
||||
`Partially validated`
|
||||
[YEP 4.5 - Utiliser les hooks](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-45)
|
||||
`Validated`
|
||||
|
||||
#### [Level 9](https://github.com/YunoHost/doc/blob/master/packaging_apps_levels_fr.md#niveau-9)
|
||||
[YEP 2.10 - Configurer les logs de l'application](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-210)
|
||||
`Validated`
|
||||
[YEP 2.11 - Utiliser une variable plutôt que l'app id directement](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-211)
|
||||
`Validated`
|
||||
[YEP 2.13 - Traduire le paquet en anglais](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-213)
|
||||
`Not yet validated`
|
||||
[YEP 2.14 - Remplir correctement un fichier de conf](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-214)
|
||||
`Not yet validated`
|
||||
[YEP 2.17 - Prendre en compte la version d'origine lors des mises à jour](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-217)
|
||||
`Validated`
|
||||
[YEP 4.2.1 - Déconnexion](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-421)
|
||||
`Don't know`
|
||||
|
||||
#### Other YEP
|
||||
[YEP 3.1 - Ne pas demander ou stocker de mot de passe LDAP](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-31)
|
||||
`Validated`
|
||||
[YEP 4.7 - Ajouter un module à la CLI](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-47)
|
||||
`Not applicable`
|
||||
[YEP 4.8 - Ajouter un module à l'admin web](https://github.com/YunoHost/doc/blob/master/packaging_apps_guidelines_fr.md#yep-48)
|
||||
`Not applicable`
|
||||
|
||||
State of each YEP can be one of these: `Validated`, `Partially validated`, `Not yet validated`, `Not applicable`, `Don't know`.
|
|
@ -1,5 +1,4 @@
|
|||
;; Test complet avec Infcloud
|
||||
auto_remove=1
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
|
@ -18,9 +17,9 @@
|
|||
multi_instance=0
|
||||
incorrect_path=1
|
||||
port_already_use=0
|
||||
# Because of the modification of the path for InfCloud, we can't try the change_url script here.
|
||||
change_url=0
|
||||
;; Test sans Infcloud
|
||||
auto_remove=1
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
|
@ -34,18 +33,18 @@
|
|||
setup_private=0
|
||||
setup_public=0
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=3be74eb1ebd9da9b13f9080fd7aa0e535ab09192
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
incorrect_path=0
|
||||
port_already_use=0
|
||||
change_url=0
|
||||
change_url=1
|
||||
;;; Levels
|
||||
Level 1=auto
|
||||
Level 2=auto
|
||||
Level 3=auto
|
||||
# Level 4: https://github.com/YunoHost-Apps/radicale_ynh/issues/2
|
||||
Level 4=0
|
||||
# Level 5: https://github.com/YunoHost-Apps/radicale_ynh/issues/6
|
||||
Level 5=auto
|
||||
Level 6=auto
|
||||
Level 7=auto
|
||||
|
@ -55,3 +54,7 @@
|
|||
;;; Options
|
||||
Email=
|
||||
Notification=down
|
||||
;;; Upgrade options
|
||||
; commit=3be74eb1ebd9da9b13f9080fd7aa0e535ab09192
|
||||
name=19 Mar 2017 3be74eb1ebd9da9b13f9080fd7aa0e535ab09192
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&infcloud=1&language=French&
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
"name": "Radicale",
|
||||
"id": "radicale",
|
||||
"packaging_format": 1,
|
||||
"requirements": {
|
||||
"yunohost": ">= 2.4"
|
||||
},
|
||||
"description": {
|
||||
"en": "CalDAV (calendar) and CardDAV (contact) synchronization server",
|
||||
"fr": "Serveur de synchronisation CalDAV et CardDAV"
|
||||
},
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.6~ynh1",
|
||||
"url": "http://radicale.org",
|
||||
"license": "GPL-3.0, AGPL-3.0",
|
||||
"license": "GPL-3.0,AGPL-3.0",
|
||||
"maintainer": {
|
||||
"name": "Maniack Crudelis",
|
||||
"email": "maniackc_dev@crudelis.fr"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 2.7.2"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
"nginx",
|
||||
|
|
1137
scripts/_common.sh
1137
scripts/_common.sh
File diff suppressed because it is too large
Load diff
4
scripts/_variables
Normal file
4
scripts/_variables
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Dependencies
|
||||
app_depencencies="python-pip python-virtualenv python-dev libldap2-dev libsasl2-dev libssl-dev uwsgi uwsgi-plugin-python"
|
|
@ -1,26 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# MANAGE FAILURE OF THE SCRIPT
|
||||
#=================================================
|
||||
|
||||
# Exit on command errors and treat unset variables as an error
|
||||
set -eu
|
||||
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
if [ ! -e _common.sh ]; then
|
||||
# Rapatrie le fichier de fonctions si il n'est pas dans le dossier courant
|
||||
sudo cp ../settings/scripts/_common.sh ./_common.sh
|
||||
sudo chmod a+rx _common.sh
|
||||
# Get the _common.sh file if it's not in the current directory
|
||||
cp ../settings/scripts/_common.sh ./_common.sh
|
||||
chmod a+rx _common.sh
|
||||
fi
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
|
@ -39,15 +39,15 @@ infcloud=$(ynh_app_setting_get $app infcloud)
|
|||
#=================================================
|
||||
|
||||
CHECK_SIZE "$final_path"
|
||||
ynh_backup "$final_path" "${YNH_APP_BACKUP_DIR}$final_path"
|
||||
ynh_backup "$final_path"
|
||||
CHECK_SIZE "/opt/yunohost/$app"
|
||||
ynh_backup "/opt/yunohost/$app" "${YNH_APP_BACKUP_DIR}/opt/yunohost/$app"
|
||||
ynh_backup "/opt/yunohost/$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP OF THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "${YNH_APP_BACKUP_DIR}/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# BACKUP OF THE PHP-FPM CONFIGURATION
|
||||
|
@ -55,8 +55,8 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "${YNH_APP_BACKUP_DIR}/etc/ng
|
|||
|
||||
if [ $infcloud -eq 1 ]
|
||||
then
|
||||
ynh_backup "/etc/php5/fpm/pool.d/$app.conf" "${YNH_APP_BACKUP_DIR}/etc/php5/fpm/pool.d/$app.conf"
|
||||
ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini" "${YNH_APP_BACKUP_DIR}/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
|
||||
ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -65,17 +65,17 @@ fi
|
|||
# BACKUP OF THE UWSGI CONFIG
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/uwsgi/apps-available/radicale.ini" "${YNH_APP_BACKUP_DIR}/etc/uwsgi/apps-available/radicale.ini"
|
||||
ynh_backup "/etc/uwsgi/apps-available/radicale.ini"
|
||||
|
||||
#=================================================
|
||||
# BACKUP OF THE RADICALE CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
CHECK_SIZE "/etc/$app"
|
||||
ynh_backup "/etc/$app" "${YNH_APP_BACKUP_DIR}/etc/$app"
|
||||
ynh_backup "/etc/$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP OF THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/logrotate.d/$app" "${YNH_APP_BACKUP_DIR}/etc/logrotate.d/$app"
|
||||
ynh_backup "/etc/logrotate.d/$app"
|
||||
|
|
137
scripts/change_url
Normal file
137
scripts/change_url
Normal file
|
@ -0,0 +1,137 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
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
|
||||
#=================================================
|
||||
|
||||
infcloud=$(ynh_app_setting_get $app infcloud)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
|
||||
#=================================================
|
||||
# CHECK THE SYNTAX OF THE PATHS
|
||||
#=================================================
|
||||
|
||||
# Remove /infcloud in old_path
|
||||
if [ $infcloud -eq 1 ]
|
||||
then
|
||||
old_path="${old_path%/infcloud}"
|
||||
fi
|
||||
|
||||
test -n "$old_path" || old_path="/"
|
||||
test -n "$new_path" || new_path="/"
|
||||
new_path=$(ynh_normalize_url_path $new_path)
|
||||
old_path=$(ynh_normalize_url_path $old_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
|
||||
|
||||
#=================================================
|
||||
# MANAGE FAILURE OF THE SCRIPT
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
# MODIFY URL IN NGINX CONF
|
||||
#=================================================
|
||||
|
||||
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 "$nginx_conf_path"
|
||||
|
||||
ynh_replace_string "location $old_path {" "location $new_path {" "$nginx_conf_path"
|
||||
ynh_replace_string "location ${old_path%/}/infcloud {" "location ${new_path%/}/infcloud {" "$nginx_conf_path"
|
||||
|
||||
# Calculate and store the nginx config file checksum
|
||||
ynh_store_file_checksum "$nginx_conf_path"
|
||||
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 "$nginx_conf_path"
|
||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||
|
||||
nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||
# Calculate and store the nginx config file checksum
|
||||
ynh_store_file_checksum "$nginx_conf_path"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC MODIFICATIONS
|
||||
#=================================================
|
||||
# MODIFY CONFIG FILES
|
||||
#=================================================
|
||||
|
||||
ynh_replace_string "^base_prefix = $old_path.*" "base_prefix = ${new_path%/}/" /etc/$app/config
|
||||
|
||||
if [ $infcloud -eq 1 ]; then
|
||||
ynh_replace_string "href: 'https://$old_domain$old_path'," "href: 'https://$new_domain${new_path%/}/'," "$final_path/infcloud/config.js"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# UPDATE SSOWAT
|
||||
#=================================================
|
||||
|
||||
if [ $infcloud -eq 1 ]
|
||||
then # /infcloud vient se rajouter à l'adresse de radicale pour y être associé sur le portail.
|
||||
echo "sudo yunohost --verbose app setting $app path -v \"${new_path%/}/infcloud\"; sudo yunohost app ssowatconf" | at now + 1 min >&2
|
||||
domain_regex=$(echo "$new_domain" | sed 's@-@.@g')
|
||||
ynh_app_setting_set $app skipped_regex "$domain_regex$new_path" # Radicale est accessible librement (pour l'accès distant aux ressources)
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RESTART UWSGI
|
||||
#=================================================
|
||||
|
||||
systemctl restart uwsgi
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
||||
systemctl reload nginx
|
117
scripts/install
117
scripts/install
|
@ -8,6 +8,8 @@
|
|||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
# Load common variables for all scripts.
|
||||
source _variables
|
||||
|
||||
#=================================================
|
||||
# MANAGE FAILURE OF THE SCRIPT
|
||||
|
@ -27,16 +29,22 @@ language=$YNH_APP_ARG_LANGUAGE
|
|||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
version=$(grep '\"version\": ' ../manifest.json | cut -d '"' -f 4) # Retrieve the version number in the manifest file.
|
||||
|
||||
version=$(grep '\"version\": ' ../manifest.json | cut -d '"' -f 4 | cut -d '~' -f 1) # Retrieve the version number in the manifest file.
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THIS ARGS
|
||||
#=================================================
|
||||
|
||||
path_url=$(ynh_normalize_url_path $path_url) # Vérifie et corrige la syntaxe du path.
|
||||
CHECK_DOMAINPATH # Vérifie la disponibilité du path et du domaine.
|
||||
CHECK_FINALPATH # Vérifie que le dossier de destination n'est pas déjà utilisé.
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
||||
|
||||
# Normalize the url path syntax
|
||||
path_url=$(ynh_normalize_url_path $path_url)
|
||||
|
||||
# Check web path availability
|
||||
ynh_webpath_available $domain $path_url
|
||||
# Register (book) web path
|
||||
ynh_webpath_register $app $domain $path_url
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
|
@ -54,13 +62,13 @@ ynh_app_setting_set $app version $version
|
|||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
ynh_install_app_dependencies python-pip python-virtualenv python-dev libldap2-dev libsasl2-dev libssl-dev uwsgi uwsgi-plugin-python
|
||||
ynh_install_app_dependencies $app_depencencies
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_nginx_config
|
||||
ynh_add_nginx_config
|
||||
if [ "$path_url" = "/" ]
|
||||
then
|
||||
ynh_replace_string "__PATH_NO_ROOT__" "" /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
@ -86,25 +94,25 @@ ynh_system_user_create $app # Créer un utilisateur système dédié à l'app
|
|||
#=================================================
|
||||
|
||||
# Init virtualenv
|
||||
sudo virtualenv /opt/yunohost/$app
|
||||
sudo /opt/yunohost/$app/bin/pip install radicale==$version python-ldap
|
||||
virtualenv /opt/yunohost/$app
|
||||
version=$(ynh_app_setting_get $app version $version)
|
||||
/opt/yunohost/$app/bin/pip install radicale==$version python-ldap
|
||||
|
||||
#=================================================
|
||||
# COPY FILES INTO $FINAL_PATH
|
||||
#=================================================
|
||||
|
||||
# Crée le repertoire de destination et stocke son emplacement.
|
||||
sudo mkdir "$final_path"
|
||||
mkdir "$final_path"
|
||||
ynh_app_setting_set $app final_path $final_path
|
||||
|
||||
# Copy files to the right place
|
||||
sudo mkdir -p $final_path/collections
|
||||
sudo cp ../conf/radicale.wsgi $final_path
|
||||
mkdir -p $final_path/collections
|
||||
cp ../conf/radicale.wsgi $final_path
|
||||
# Copie les fichiers additionnels ou modifiés.
|
||||
sudo cp -a ../sources/extra_files_radicale/. "$final_path"
|
||||
cp -a ../sources/extra_files_radicale/. "$final_path"
|
||||
# Le fichier regex.py est patché pour corrigé le commit destructeur e807c3d35bea9cfcfcacac83b1b17d748ea15a39 du 3/12/2015 qui arrête la lecture du fichier rights à la première occurence validée.
|
||||
sudo mv "$final_path/regex.py" /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.py
|
||||
ynh_secure_remove "/opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.pyc"
|
||||
mv "$final_path/regex.py" /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.py
|
||||
if [ $infcloud -eq 1 ]
|
||||
then #Instal InfCloud
|
||||
final_path_backup=$final_path # Sauvegarde le contenu de $final_path
|
||||
|
@ -117,11 +125,11 @@ fi
|
|||
# CONFIGURE RADICALE
|
||||
#=================================================
|
||||
|
||||
sudo mkdir -p /etc/$app
|
||||
sudo cp ../conf/config /etc/$app/
|
||||
sudo cp ../conf/logging /etc/$app/
|
||||
sudo cp ../conf/rights /etc/$app/
|
||||
ynh_replace_string "__PATH__" "$path_url" /etc/$app/config
|
||||
mkdir -p /etc/$app
|
||||
cp ../conf/config /etc/$app/
|
||||
cp ../conf/logging /etc/$app/
|
||||
cp ../conf/rights /etc/$app/
|
||||
ynh_replace_string "__PATH__" "${path_url%/}" /etc/$app/config
|
||||
ynh_replace_string "__FINALPATH__" "$final_path" /etc/$app/config
|
||||
ynh_store_file_checksum "/etc/$app/config" # Enregistre la somme de contrôle du fichier de config
|
||||
ynh_store_file_checksum "/etc/$app/logging" # Enregistre la somme de contrôle du fichier de config
|
||||
|
@ -161,9 +169,9 @@ then #Configuration InfCloud
|
|||
;;
|
||||
esac
|
||||
ynh_app_setting_set $app language $language
|
||||
sudo cp ../conf/config.js "$final_path/infcloud/"
|
||||
cp ../conf/config.js "$final_path/infcloud/"
|
||||
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__PATH__" "$path_url" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__PATH__" "${path_url%/}" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__LANG__" "$language" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__ADMIN__" "$admin" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__TIMEZONE__" "$(cat /etc/timezone)" "$final_path/infcloud/config.js"
|
||||
|
@ -174,29 +182,29 @@ fi
|
|||
# SET PERMISSIONS ON RADICALE'S DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# sudo useradd radicale -d /opt/yunohost/$app
|
||||
sudo chown radicale: -R /opt/yunohost/$app
|
||||
# useradd radicale -d /opt/yunohost/$app
|
||||
chown radicale: -R /opt/yunohost/$app
|
||||
|
||||
sudo chown -R radicale: $final_path
|
||||
sudo mkdir -p /var/log/$app
|
||||
sudo touch /var/log/$app/$app.log
|
||||
sudo chown radicale -R /var/log/$app
|
||||
chown -R radicale: $final_path
|
||||
mkdir -p /var/log/$app
|
||||
touch /var/log/$app/$app.log
|
||||
chown radicale -R /var/log/$app
|
||||
# Droit par défaut des dossiers de collections utilisateurs, tels qu'ils sont créés par radicale.
|
||||
sudo chmod 666 -R $final_path/default_collections
|
||||
sudo chmod 777 $final_path/default_collections $final_path/default_collections/USER
|
||||
chmod 666 -R $final_path/default_collections
|
||||
chmod 777 $final_path/default_collections $final_path/default_collections/USER
|
||||
|
||||
# Fix permission
|
||||
sudo chmod 755 /etc/$app/
|
||||
sudo find /opt/yunohost/$app/ -type d -exec chmod 2755 {} \;
|
||||
sudo find /opt/yunohost/$app/ -type f -exec chmod g+r,o+r {} \;
|
||||
sudo chmod 644 /etc/$app/*
|
||||
chmod 755 /etc/$app/
|
||||
find /opt/yunohost/$app/ -type d -exec chmod 2755 {} \;
|
||||
find /opt/yunohost/$app/ -type f -exec chmod g+r,o+r {} \;
|
||||
chmod 644 /etc/$app/*
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE UWSGI FOR RADICALE
|
||||
#=================================================
|
||||
|
||||
sudo cp ../conf/radicale.ini /etc/uwsgi/apps-available/
|
||||
sudo ln -s /etc/uwsgi/apps-available/radicale.ini /etc/uwsgi/apps-enabled/
|
||||
cp ../conf/radicale.ini /etc/uwsgi/apps-available/
|
||||
ln -s /etc/uwsgi/apps-available/radicale.ini /etc/uwsgi/apps-enabled/
|
||||
|
||||
#=================================================
|
||||
# GENERATE CALENDARS AND ADDRESS BOOKS FOR ALL USERS
|
||||
|
@ -205,18 +213,18 @@ sudo ln -s /etc/uwsgi/apps-available/radicale.ini /etc/uwsgi/apps-enabled/
|
|||
# Créer les calendriers et carnets d'adresses par défaut des utilisateurs.
|
||||
while read user #USER en majuscule est une variable système, à éviter.
|
||||
do
|
||||
sudo cp -a $final_path/default_collections/USER $final_path/collections/$user
|
||||
sudo cp -a $final_path/default_collections/USER.props $final_path/collections/$user.props
|
||||
done <<< "$(sudo yunohost user list | grep username | cut -d ":" -f 2 | cut -c 2-)" # Liste les utilisateurs et supprime l'espace après username:
|
||||
cp -a $final_path/default_collections/USER $final_path/collections/$user
|
||||
cp -a $final_path/default_collections/USER.props $final_path/collections/$user.props
|
||||
done <<< "$(yunohost user list | grep username | cut -d ":" -f 2 | cut -c 2-)" # Liste les utilisateurs et supprime l'espace après username:
|
||||
# Le triple chevron <<< permet de prendre la sortie de commande en entrée de boucle.
|
||||
|
||||
#=================================================
|
||||
# ENABLE UWSGI SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
sudo systemctl restart uwsgi
|
||||
systemctl restart uwsgi
|
||||
# Ajoute le service au monitoring de Yunohost.
|
||||
sudo yunohost service add uwsgi --log "/var/log/uwsgi/app/radicale.log"
|
||||
yunohost service add uwsgi --log "/var/log/uwsgi/app/radicale.log"
|
||||
|
||||
#=================================================
|
||||
# PREPARE THE HOOKS
|
||||
|
@ -234,7 +242,7 @@ ynh_replace_string "__FINALPATH__" "$final_path" ../hooks/post_user_delete
|
|||
|
||||
if [ $infcloud -eq 1 ]
|
||||
then # /infcloud vient se rajouter à l'adresse de radicale pour y être associé sur le portail.
|
||||
ynh_app_setting_set $app path $path_url/infcloud # Remplace radicale par InfCloud dans le portail Yunohost
|
||||
ynh_app_setting_set $app path ${path_url%/}/infcloud # Remplace radicale par InfCloud dans le portail Yunohost
|
||||
ynh_app_setting_set $app protected_uris "/" # Protège l'accès à infcloud
|
||||
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
||||
ynh_app_setting_set $app skipped_regex "$domain_regex$path_url" # Radicale est accessible librement (pour l'accès distant aux ressources)
|
||||
|
@ -254,11 +262,32 @@ ynh_use_logrotate
|
|||
|
||||
if [ $infcloud -eq 1 ]
|
||||
then
|
||||
ynh_fpm_config # Créer le fichier de configuration du pool php-fpm et le configure.
|
||||
ynh_add_fpm_config # Créer le fichier de configuration du pool php-fpm et le configure.
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
||||
sudo systemctl reload nginx
|
||||
systemctl reload nginx
|
||||
|
||||
#=================================================
|
||||
# SEND A README FOR THE ADMIN
|
||||
#=================================================
|
||||
|
||||
if [ $infcloud -eq 1 ]
|
||||
then
|
||||
infcloud_config="
|
||||
InfCloud has its own config file, at $final_path/infcloud/config.js
|
||||
"
|
||||
else
|
||||
infcloud_config=""
|
||||
fi
|
||||
|
||||
message="Use the file /etc/radicale/config to change the main configuration of radicale.
|
||||
The file /etc/radicale/logging to change the level of logging.
|
||||
And the file /etc/radicale/rights to edit the way the calendars will be sharing.
|
||||
$infcloud_config
|
||||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/radicale_ynh"
|
||||
|
||||
ynh_send_readme_to_admin "$message" "$admin"
|
||||
|
|
|
@ -24,7 +24,7 @@ domain=$(ynh_app_setting_get $app domain)
|
|||
#=================================================
|
||||
|
||||
# Suppression de la configuration uwsgi
|
||||
sudo systemctl stop uwsgi
|
||||
systemctl stop uwsgi
|
||||
if [ -h "/etc/uwsgi/apps-enabled/radicale.ini" ]; then
|
||||
echo "Delete uwsgi config"
|
||||
ynh_secure_remove "/etc/uwsgi/apps-enabled/radicale.ini"
|
||||
|
@ -77,12 +77,12 @@ ynh_secure_remove "/etc/$app" # Delete radicale config
|
|||
if [ -e /etc/init.d/uwsgi ]
|
||||
then
|
||||
# Redémarre le service uwsgi si il n'est pas désinstallé.
|
||||
sudo systemctl start uwsgi
|
||||
systemctl start uwsgi
|
||||
else
|
||||
if sudo yunohost service status | grep -q uwsgi # Test l'existence du service dans Yunohost
|
||||
if yunohost service status | grep -q uwsgi # Test l'existence du service dans Yunohost
|
||||
then
|
||||
echo "Remove uwsgi service"
|
||||
sudo yunohost service remove uwsgi
|
||||
ynh_print_info "Remove uwsgi service" >&2
|
||||
yunohost service remove uwsgi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# MANAGE FAILURE OF THE SCRIPT
|
||||
#=================================================
|
||||
|
||||
# Exit on command errors and treat unset variables as an error
|
||||
set -eu
|
||||
|
||||
# GENERIC START
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
if [ ! -e _common.sh ]; then
|
||||
# Rapatrie le fichier de fonctions si il n'est pas dans le dossier courant
|
||||
sudo cp ../settings/scripts/_common.sh ./_common.sh
|
||||
sudo chmod a+rx _common.sh
|
||||
# Get the _common.sh file if it's not in the current directory
|
||||
cp ../settings/scripts/_common.sh ./_common.sh
|
||||
chmod a+rx _common.sh
|
||||
fi
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
# Load common variables for all scripts.
|
||||
source ../settings/scripts/_variables
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
|
@ -31,12 +33,13 @@ final_path=$(ynh_app_setting_get $app final_path)
|
|||
domain=$(ynh_app_setting_get $app domain)
|
||||
infcloud=$(ynh_app_setting_get $app infcloud)
|
||||
path_url=$(ynh_app_setting_get $app path)
|
||||
admin=$(ynh_app_setting_get $app admin)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
|
||||
sudo yunohost app checkurl "${domain}${path_url}" -a "$app" \
|
||||
ynh_webpath_available $domain $path_url \
|
||||
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die "There is already a directory: $final_path "
|
||||
|
@ -55,14 +58,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
ynh_install_app_dependencies python-pip python-virtualenv python-dev libldap2-dev libsasl2-dev libssl-dev uwsgi uwsgi-plugin-python
|
||||
ynh_install_app_dependencies $app_depencencies
|
||||
|
||||
#=================================================
|
||||
# RESTORE OF THE MAIN DIR OF THE APP
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "$final_path"
|
||||
sudo mkdir -p /opt/yunohost
|
||||
mkdir -p /opt/yunohost
|
||||
ynh_restore_file "/opt/yunohost/$app"
|
||||
|
||||
#=================================================
|
||||
|
@ -79,7 +82,7 @@ if [ $infcloud -eq 1 ]
|
|||
then
|
||||
ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
|
||||
ynh_restore_file "/etc/php5/fpm/conf.d/20-$app.ini"
|
||||
sudo systemctl reload php5-fpm
|
||||
systemctl reload php5-fpm
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -88,19 +91,22 @@ fi
|
|||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
|
||||
sudo chown radicale: -R /opt/yunohost/$app
|
||||
chown radicale: -R /opt/yunohost/$app
|
||||
|
||||
sudo chown -R radicale: $final_path
|
||||
sudo mkdir -p /var/log/$app
|
||||
sudo touch /var/log/$app/$app.log
|
||||
sudo chown radicale -R /var/log/$app
|
||||
chown -R radicale: $final_path
|
||||
mkdir -p /var/log/$app
|
||||
touch /var/log/$app/$app.log
|
||||
chown radicale -R /var/log/$app
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE UWSGI CONFIG
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "/etc/uwsgi/apps-available/radicale.ini"
|
||||
sudo ln -s /etc/uwsgi/apps-available/radicale.ini /etc/uwsgi/apps-enabled/
|
||||
ln -s /etc/uwsgi/apps-available/radicale.ini /etc/uwsgi/apps-enabled/
|
||||
|
||||
# Ajoute le service au monitoring de Yunohost.
|
||||
yunohost service add uwsgi --log "/var/log/uwsgi/app/radicale.log"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE RADICALE CONFIGURATION
|
||||
|
@ -120,6 +126,26 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
|||
# RELOAD NGINX AND UWSGI
|
||||
#=================================================
|
||||
|
||||
sudo systemctl restart uwsgi
|
||||
sudo journalctl -xn
|
||||
sudo systemctl reload nginx
|
||||
systemctl restart uwsgi
|
||||
systemctl reload nginx
|
||||
|
||||
#=================================================
|
||||
# SEND A README FOR THE ADMIN
|
||||
#=================================================
|
||||
|
||||
if [ $infcloud -eq 1 ]
|
||||
then
|
||||
infcloud_config="
|
||||
InfCloud has its own config file, at $final_path/infcloud/config.js
|
||||
"
|
||||
else
|
||||
infcloud_config=""
|
||||
fi
|
||||
|
||||
message="Use the file /etc/radicale/config to change the main configuration of radicale.
|
||||
The file /etc/radicale/logging to change the level of logging.
|
||||
And the file /etc/radicale/rights to edit the way the calendars will be sharing.
|
||||
$infcloud_config
|
||||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/radicale_ynh"
|
||||
|
||||
ynh_send_readme_to_admin "$message" "$admin"
|
||||
|
|
|
@ -23,6 +23,12 @@ language=$(ynh_app_setting_get $app language)
|
|||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
version=$(ynh_app_setting_get $app version)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
||||
ynh_abort_if_up_to_date
|
||||
|
||||
#=================================================
|
||||
# FIX OLD THINGS
|
||||
#=================================================
|
||||
|
@ -31,13 +37,13 @@ ynh_app_setting_delete $app unprotected_regex
|
|||
|
||||
if [ -d /usr/local/radicale ]
|
||||
then
|
||||
sudo mkdir -p /opt/yunohost
|
||||
sudo mv /usr/local/radicale /opt/yunohost/
|
||||
mkdir -p /opt/yunohost
|
||||
mv /usr/local/radicale /opt/yunohost/
|
||||
fi
|
||||
|
||||
if [ -z "$version" ]
|
||||
then
|
||||
version=$(grep '\"version\": ' ../manifest.json | cut -d '"' -f 4) # Retrieve the version number in the manifest file.
|
||||
version=$(grep '\"version\": ' ../manifest.json | cut -d '"' -f 4 | cut -d '~' -f 1) # Retrieve the version number in the manifest file.
|
||||
ynh_app_setting_set $app version "$version"
|
||||
fi
|
||||
|
||||
|
@ -53,11 +59,14 @@ fi
|
|||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
||||
BACKUP_BEFORE_UPGRADE # Backup the current version of the app
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
BACKUP_FAIL_UPGRADE # restore it if the upgrade fails
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est détectée.
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CHECK THE PATH
|
||||
|
@ -75,7 +84,7 @@ path_url=$(ynh_normalize_url_path $path_url) # Vérifie et corrige la syntaxe du
|
|||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_nginx_config
|
||||
ynh_add_nginx_config
|
||||
if [ "$path_url" = "/" ]
|
||||
then
|
||||
ynh_replace_string "__PATH_NO_ROOT__" "" /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
@ -100,7 +109,7 @@ then
|
|||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_fpm_config # Créer le fichier de configuration du pool php-fpm et le configure.
|
||||
ynh_add_fpm_config # Créer le fichier de configuration du pool php-fpm et le configure.
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -111,21 +120,21 @@ fi
|
|||
|
||||
# Upgrade pip packages
|
||||
ynh_secure_remove /opt/yunohost/$app
|
||||
sudo virtualenv /opt/yunohost/$app
|
||||
sudo bash -c "source /opt/yunohost/radicale/bin/activate && pip install radicale==$version python-ldap"
|
||||
virtualenv /opt/yunohost/$app
|
||||
version=$(ynh_app_setting_get $app version $version)
|
||||
bash -c "source /opt/yunohost/radicale/bin/activate && pip install radicale==$version python-ldap"
|
||||
|
||||
#=================================================
|
||||
# COPY FILES INTO $FINAL_PATH
|
||||
#=================================================
|
||||
|
||||
# Copy files to the right place
|
||||
sudo mkdir -p $final_path/collections
|
||||
sudo cp ../conf/radicale.wsgi $final_path
|
||||
mkdir -p $final_path/collections
|
||||
cp ../conf/radicale.wsgi $final_path
|
||||
# Copie les fichiers additionnels ou modifiés.
|
||||
sudo cp -a ../sources/extra_files_radicale/. "$final_path"
|
||||
cp -a ../sources/extra_files_radicale/. "$final_path"
|
||||
# Le fichier regex.py est patché pour corrigé le commit destructeur e807c3d35bea9cfcfcacac83b1b17d748ea15a39 du 3/12/2015 qui arrête la lecture du fichier rights à la première occurence validée.
|
||||
sudo mv "$final_path/regex.py" /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.py
|
||||
ynh_secure_remove /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.pyc
|
||||
mv "$final_path/regex.py" /opt/yunohost/$app/lib/python*/site-packages/radicale/rights/regex.py
|
||||
if [ "$infcloud" = "1" ]
|
||||
then #Instal InfCloud
|
||||
final_path_backup=$final_path # Sauvegarde le contenu de $final_path
|
||||
|
@ -139,11 +148,11 @@ fi
|
|||
#=================================================
|
||||
|
||||
ynh_backup_if_checksum_is_different "/etc/$app/config" # Créé un backup du fichier de config si il a été modifié.
|
||||
sudo cp ../conf/config /etc/$app/
|
||||
cp ../conf/config /etc/$app/
|
||||
ynh_backup_if_checksum_is_different "/etc/$app/logging" # Créé un backup du fichier de config si il a été modifié.
|
||||
sudo cp ../conf/logging /etc/$app/
|
||||
cp ../conf/logging /etc/$app/
|
||||
ynh_store_file_checksum "/etc/$app/logging" # Réenregistre la somme de contrôle du fichier de config
|
||||
ynh_replace_string "__PATH__" "$path_url" /etc/$app/config
|
||||
ynh_replace_string "__PATH__" "${path_url%/}" /etc/$app/config
|
||||
ynh_replace_string "__FINALPATH__" "$final_path" /etc/$app/config
|
||||
ynh_store_file_checksum "/etc/$app/config" # Réenregistre la somme de contrôle du fichier de config
|
||||
if [ $infcloud -eq 1 ]
|
||||
|
@ -183,9 +192,9 @@ then #Configuration InfCloud
|
|||
esac
|
||||
ynh_app_setting_set $app language $language
|
||||
ynh_backup_if_checksum_is_different "$final_path/infcloud/config.js" # Créé un backup du fichier de config si il a été modifié.
|
||||
sudo cp ../conf/config.js "$final_path/infcloud/"
|
||||
cp ../conf/config.js "$final_path/infcloud/"
|
||||
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__PATH__" "$path_url" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__PATH__" "${path_url%/}" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__LANG__" "$language" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__ADMIN__" "$admin" "$final_path/infcloud/config.js"
|
||||
ynh_replace_string "__TIMEZONE__" "$(cat /etc/timezone)" "$final_path/infcloud/config.js"
|
||||
|
@ -196,32 +205,32 @@ fi
|
|||
# SET PERMISSIONS ON RADICALE'S DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
sudo chown radicale: -R /opt/yunohost/$app
|
||||
chown radicale: -R /opt/yunohost/$app
|
||||
|
||||
# Fix permission
|
||||
sudo chmod 755 /etc/$app/
|
||||
sudo find /opt/yunohost/$app/ -type d -exec chmod 2755 {} \;
|
||||
sudo find /opt/yunohost/$app/ -type f -exec chmod g+r,o+r {} \;
|
||||
sudo chmod 644 /etc/$app/*
|
||||
sudo chown -R radicale: $final_path
|
||||
sudo mkdir -p /var/log/$app
|
||||
sudo touch /var/log/$app/$app.log
|
||||
sudo chown radicale -R /var/log/$app
|
||||
chmod 755 /etc/$app/
|
||||
find /opt/yunohost/$app/ -type d -exec chmod 2755 {} \;
|
||||
find /opt/yunohost/$app/ -type f -exec chmod g+r,o+r {} \;
|
||||
chmod 644 /etc/$app/*
|
||||
chown -R radicale: $final_path
|
||||
mkdir -p /var/log/$app
|
||||
touch /var/log/$app/$app.log
|
||||
chown radicale -R /var/log/$app
|
||||
# Droit par défaut des dossiers de collections utilisateurs, tels qu'ils sont créés par radicale.
|
||||
sudo chmod 666 -R $final_path/default_collections
|
||||
sudo chmod 777 $final_path/default_collections $final_path/default_collections/USER
|
||||
chmod 666 -R $final_path/default_collections
|
||||
chmod 777 $final_path/default_collections $final_path/default_collections/USER
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE UWSGI FOR RADICALE
|
||||
#=================================================
|
||||
|
||||
sudo cp ../conf/radicale.ini /etc/uwsgi/apps-available/
|
||||
cp ../conf/radicale.ini /etc/uwsgi/apps-available/
|
||||
|
||||
#=================================================
|
||||
# RESTART UWSGI
|
||||
#=================================================
|
||||
|
||||
sudo systemctl restart uwsgi
|
||||
systemctl restart uwsgi
|
||||
|
||||
#=================================================
|
||||
# PREPARE THE HOOKS
|
||||
|
@ -239,7 +248,7 @@ ynh_replace_string "__FINALPATH__" "$final_path" ../hooks/post_user_delete
|
|||
|
||||
if [ $infcloud -eq 1 ]
|
||||
then # /infcloud vient se rajouter à l'adresse de radicale pour y être associé sur le portail.
|
||||
ynh_app_setting_set $app path $path_url/infcloud # Remplace radicale par InfCloud dans le portail Yunohost
|
||||
ynh_app_setting_set $app path ${path_url%/}/infcloud # Remplace radicale par InfCloud dans le portail Yunohost
|
||||
ynh_app_setting_set $app protected_uris "/" # Protège l'accès à infcloud
|
||||
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
||||
ynh_app_setting_set $app skipped_regex "$domain_regex$path_url" # Radicale est accessible librement (pour l'accès distant aux ressources)
|
||||
|
@ -251,4 +260,4 @@ fi
|
|||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
||||
sudo systemctl reload nginx
|
||||
systemctl reload nginx
|
||||
|
|
Loading…
Reference in a new issue