mirror of
https://github.com/YunoHost-Apps/facilmap_ynh.git
synced 2024-09-03 18:36:07 +02:00
commit
3d5efe6f7d
19 changed files with 136 additions and 279 deletions
|
@ -8,7 +8,7 @@ about: When creating a bug report, please use the following template to provide
|
||||||
1. *Read this whole template first.*
|
1. *Read this whole template first.*
|
||||||
2. *Determine if you are on the right place:*
|
2. *Determine if you are on the right place:*
|
||||||
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
|
- *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
|
||||||
- *Otherwise, the issue may be due to facilmap itself. Refer to its documentation or repository for help.*
|
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
|
||||||
- *When in doubt, post here and we will figure it out together.*
|
- *When in doubt, post here and we will figure it out together.*
|
||||||
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
||||||
---
|
---
|
||||||
|
@ -31,7 +31,7 @@ about: When creating a bug report, please use the following template to provide
|
||||||
|
|
||||||
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
||||||
```sh
|
```sh
|
||||||
sudo yunohost app install facilmap
|
sudo yunohost app install the_app
|
||||||
```
|
```
|
||||||
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
||||||
- *If the error occurs in your browser, explain what you did:*
|
- *If the error occurs in your browser, explain what you did:*
|
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
## Problem
|
||||||
|
|
||||||
|
- *Description of why you made this PR*
|
||||||
|
|
||||||
|
## Solution
|
||||||
|
|
||||||
|
- *And how do you fix that problem*
|
||||||
|
|
||||||
|
## PR Status
|
||||||
|
|
||||||
|
- [ ] Code finished and ready to be reviewed/tested
|
||||||
|
- [ ] The fix/enhancement were manually tested (if applicable)
|
||||||
|
|
||||||
|
## Automatic tests
|
||||||
|
|
||||||
|
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
|
60
README.md
60
README.md
|
@ -1,61 +1,41 @@
|
||||||
# FacilMap for YunoHost
|
<!--
|
||||||
|
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||||
|
It shall NOT be edited by hand.
|
||||||
|
-->
|
||||||
|
|
||||||
|
# Facilmap for YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/facilmap)  
|
[](https://dash.yunohost.org/appci/app/facilmap)  
|
||||||
[](https://install-app.yunohost.org/?app=facilmap)
|
[](https://install-app.yunohost.org/?app=facilmap)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
|
||||||
> *This package allows you to install FacilMap quickly and simply on a YunoHost server.
|
> *This package allows you to install Facilmap 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.*
|
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
|
||||||
|
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
[FacilMap](https://github.com/FacilMap/facilmap) is a privacy-friendly, open-source versatile online map that combines different services based on OpenStreetMap and makes it easy to find places, plan routes and create custom maps full of markers, lines and routes, allowing live collaboration. Think of it like [Etherpad](https://etherpad.org/), just for maps.
|
Collaborative maps and routing with a straightforward interface
|
||||||
|
|
||||||
**Shipped version:** 3.1.0
|
**Shipped version:** 3.3.0~ynh1
|
||||||
|
|
||||||
|
**Demo:** https://facilmap.org/
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Documentation and resources
|
||||||
|
|
||||||
## Demo
|
* Official app website: https://facilmap.org/
|
||||||
|
* Official user documentation: https://docs.facilmap.org/users/
|
||||||
* [Official demo](https://facilmap.org/)
|
* Official admin documentation: https://docs.facilmap.org/developers/
|
||||||
|
* Upstream app code repository: https://github.com/FacilMap/facilmap
|
||||||
|
* YunoHost documentation for this app: https://yunohost.org/app_facilmap
|
||||||
## Documentation
|
* Report a bug: https://github.com/YunoHost-Apps/facilmap_ynh/issues
|
||||||
|
|
||||||
* Official documentation: https://docs.facilmap.org/
|
|
||||||
|
|
||||||
|
|
||||||
## YunoHost specific features
|
|
||||||
|
|
||||||
#### Multi-user support
|
|
||||||
|
|
||||||
The app doesn't require any login, anyone can use it, unless you install it privately.
|
|
||||||
|
|
||||||
#### Supported architectures
|
|
||||||
|
|
||||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/facilmap/)
|
|
||||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/facilmap/)
|
|
||||||
|
|
||||||
|
|
||||||
## Links
|
|
||||||
|
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/facilmap_ynh/issues
|
|
||||||
* App website: https://facilmap.org
|
|
||||||
* Upstream app repository: https://github.com/FacilMap/facilmap
|
|
||||||
* YunoHost website: https://yunohost.org/
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## Developer info
|
## Developer info
|
||||||
|
|
||||||
**Only if you want to use a testing branch for coding, instead of merging directly into master.**
|
|
||||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/facilmap_ynh/tree/testing).
|
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/facilmap_ynh/tree/testing).
|
||||||
|
|
||||||
To try the testing branch, please proceed like that.
|
To try the testing branch, please proceed like that.
|
||||||
|
@ -64,3 +44,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/facilmap_ynh/tree/tes
|
||||||
or
|
or
|
||||||
sudo yunohost app upgrade facilmap -u https://github.com/YunoHost-Apps/facilmap_ynh/tree/testing --debug
|
sudo yunohost app upgrade facilmap -u https://github.com/YunoHost-Apps/facilmap_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
58
README_fr.md
58
README_fr.md
|
@ -1,61 +1,37 @@
|
||||||
# FacilMap pour YunoHost
|
# Facilmap pour YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/facilmap)  
|
[](https://dash.yunohost.org/appci/app/facilmap)  
|
||||||
[](https://install-app.yunohost.org/?app=facilmap)
|
[](https://install-app.yunohost.org/?app=facilmap)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
|
||||||
> *Ce package vous permet d'installer facilmap rapidement et simplement sur un serveur YunoHost.
|
> *Ce package vous permet d'installer Facilmap rapidement et simplement sur un serveur YunoHost.
|
||||||
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
|
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
|
||||||
|
|
||||||
[FacilMap](https://github.com/FacilMap/facilmap) est une carte interactive polyvalente, libre et respectueuse de la vie privée qui regroupe des nombreux services basés sur les données libres de OpenStreetMap. FacilMap permet de naviguer, chercher et dessiner facilement des trajets, créer des cartes collaboratives qui peuvent être éditées par plusieurs personnes simultanément, similairement à ce qu'[Etherpad](http://etherpad.org/) propose pour l'édition collaborative de texte.
|
Carte collaborative avec une interface simple et pratique
|
||||||
|
|
||||||
**Version incluse :** 3.1.0
|
**Version incluse :** 3.3.0~ynh1
|
||||||
|
|
||||||
|
**Démo :** https://facilmap.org/
|
||||||
|
|
||||||
## Captures d'écran
|
## Captures d'écran
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Documentations et ressources
|
||||||
|
|
||||||
## Démo
|
* Site officiel de l'app : https://facilmap.org/
|
||||||
|
* Documentation officielle utilisateur : https://docs.facilmap.org/users/
|
||||||
* [Démo officielle](https://facilmap.org/)
|
* Documentation officielle de l'admin : https://docs.facilmap.org/developers/
|
||||||
|
* Dépôt de code officiel de l'app : https://github.com/FacilMap/facilmap
|
||||||
|
* Documentation YunoHost pour cette app : https://yunohost.org/app_facilmap
|
||||||
## Documentation
|
* Signaler un bug : https://github.com/YunoHost-Apps/facilmap_ynh/issues
|
||||||
|
|
||||||
* Documentation officielle (en Anglais) : https://docs.facilmap.org/
|
|
||||||
|
|
||||||
|
|
||||||
## Caractéristiques spécifiques YunoHost
|
|
||||||
|
|
||||||
#### Support multi-utilisateur
|
|
||||||
|
|
||||||
Aucun login ou compte n'est nécessaire pour utiliser l'application, elle est utilisable par n'importe qui, à moins de l'installer de manière privée.
|
|
||||||
|
|
||||||
#### Architectures supportées
|
|
||||||
|
|
||||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/facilmap/)
|
|
||||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/facilmap/)
|
|
||||||
|
|
||||||
|
|
||||||
## Liens
|
|
||||||
|
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/facilmap_ynh/issues
|
|
||||||
* Site de l'application : https://facilmap.org
|
|
||||||
* Dépôt de l'application principale : https://github.com/FacilMap/facilmap
|
|
||||||
* Site web YunoHost : https://yunohost.org/
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
## Informations pour les développeurs
|
## Informations pour les développeurs
|
||||||
|
|
||||||
**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.**
|
|
||||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/facilmap_ynh/tree/testing).
|
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/facilmap_ynh/tree/testing).
|
||||||
|
|
||||||
Pour essayer la branche testing, procédez comme suit.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
|
@ -64,3 +40,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/facilmap_ynh/tree/tes
|
||||||
ou
|
ou
|
||||||
sudo yunohost app upgrade facilmap -u https://github.com/YunoHost-Apps/facilmap_ynh/tree/testing --debug
|
sudo yunohost app upgrade facilmap -u https://github.com/YunoHost-Apps/facilmap_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
|
@ -1,6 +1,3 @@
|
||||||
# See here for more information
|
|
||||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
|
||||||
|
|
||||||
;; Test complet
|
;; Test complet
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld"
|
domain="domain.tld"
|
||||||
|
@ -8,7 +5,6 @@
|
||||||
is_public=1
|
is_public=1
|
||||||
ors_token="test"
|
ors_token="test"
|
||||||
mapbox_token="test"
|
mapbox_token="test"
|
||||||
mapzen_token="test"
|
|
||||||
maxmind_user_id=""
|
maxmind_user_id=""
|
||||||
maxmind_license_key=""
|
maxmind_license_key=""
|
||||||
user_agent="FacilMap (https://facilmap.org/, webmaster@example.org)"
|
user_agent="FacilMap (https://facilmap.org/, webmaster@example.org)"
|
||||||
|
@ -22,7 +18,6 @@
|
||||||
upgrade=1
|
upgrade=1
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
port_already_use=0
|
|
||||||
change_url=1
|
change_url=1
|
||||||
;;; Options
|
;;; Options
|
||||||
Email=squeak@eauchat.org
|
Email=squeak@eauchat.org
|
||||||
|
|
|
@ -24,7 +24,7 @@ MAPBOX_TOKEN=__MAPBOX_TOKEN__
|
||||||
|
|
||||||
# MapZen is used for getting elevation information
|
# MapZen is used for getting elevation information
|
||||||
# Get an API key on https://mapzen.com/developers/sign_up
|
# Get an API key on https://mapzen.com/developers/sign_up
|
||||||
MAPZEN_TOKEN=__MAPZEN_TOKEN__
|
#MAPZEN_TOKEN=
|
||||||
|
|
||||||
# Maxmind configuration. If specified, the maxmind GeoLite2 database will be downloaded
|
# Maxmind configuration. If specified, the maxmind GeoLite2 database will be downloaded
|
||||||
# for Geo IP lookup (to show the initial map state) and kept in memory.
|
# for Geo IP lookup (to show the initial map state) and kept in memory.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
location __PATH__/ {
|
location __PATH__/ {
|
||||||
|
|
||||||
# Force usage of https
|
# Force usage of https
|
||||||
|
@ -23,5 +24,4 @@ location __PATH__/ {
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
more_clear_input_headers 'Accept-Encoding';
|
more_clear_input_headers 'Accept-Encoding';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Facilmap: collaborative maps with a straightforward interface
|
Description=Facilmap: collaborative maps
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
Environment=NODE_ENV=production
|
|
||||||
Environment=DOTENV_CONFIG_PATH=__FINALPATH__/etc/facilmap.env
|
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
|
Environment=NODE_ENV=production
|
||||||
|
Environment=DOTENV_CONFIG_PATH=__FINALPATH__/etc/facilmap.env
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
ExecStart=__FINALPATH__/bin/facilmap-server
|
ExecStart=__FINALPATH__/bin/facilmap-server
|
||||||
WorkingDirectory=__FINALPATH__
|
WorkingDirectory=__FINALPATH__
|
||||||
|
|
0
doc/DISLAIMER.md
Normal file
0
doc/DISLAIMER.md
Normal file
BIN
doc/screenshots/screenshot.png
Normal file
BIN
doc/screenshots/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 MiB |
|
@ -6,8 +6,16 @@
|
||||||
"en": "Collaborative maps and routing with a straightforward interface",
|
"en": "Collaborative maps and routing with a straightforward interface",
|
||||||
"fr": "Carte collaborative avec une interface simple et pratique"
|
"fr": "Carte collaborative avec une interface simple et pratique"
|
||||||
},
|
},
|
||||||
"version": "3.1.0~ynh1",
|
"version": "3.3.0~ynh1",
|
||||||
"url": "https://github.com/FacilMap/facilmap",
|
"url": "https://github.com/FacilMap/facilmap",
|
||||||
|
"upstream": {
|
||||||
|
"license": "AGPL-3.0",
|
||||||
|
"website": "https://facilmap.org/",
|
||||||
|
"demo": "https://facilmap.org/",
|
||||||
|
"admindoc": "https://docs.facilmap.org/developers/",
|
||||||
|
"userdoc": "https://docs.facilmap.org/users/",
|
||||||
|
"code": "https://github.com/FacilMap/facilmap"
|
||||||
|
},
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "Squeak",
|
"name": "Squeak",
|
||||||
|
@ -15,7 +23,7 @@
|
||||||
"url": "https://squeak.eauchat.org"
|
"url": "https://squeak.eauchat.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 4.1.3"
|
"yunohost": ">= 4.2.4"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -52,8 +60,8 @@
|
||||||
"name": "ors_token",
|
"name": "ors_token",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"help": {
|
"help": {
|
||||||
"en": "OpenRouteService is used for calculating routes with advanced settings. You can get a token on https://go.openrouteservice.org/",
|
"en": "OpenRouteService is used for calculating routes with advanced settings. You can get a token on https://openrouteservice.org/",
|
||||||
"fr": "OpenRouteService est utilisé pour calculer les routes complexes. Vous pouvez obtenir un token ici: https://go.openrouteservice.org/"
|
"fr": "OpenRouteService est utilisé pour calculer les routes complexes. Vous pouvez obtenir un token ici: https://openrouteservice.org/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -61,24 +69,15 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"help": {
|
"help": {
|
||||||
"en": "MapBox is used for calculating routes with simple settings. You can get an API key on https://www.mapbox.com/signup/",
|
"en": "MapBox is used for calculating routes with simple settings. You can get an API key on https://www.mapbox.com/signup/",
|
||||||
"fr": "MapBox est utilisé pour calcluer les routes simples. Vous pouvez obtenir une clé API ici: https://www.mapbox.com/signup/"
|
"fr": "MapBox est utilisé pour calcluer les routes simples. Vous pouvez obtenir une clé API ici : https://www.mapbox.com/signup/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "mapzen_token",
|
|
||||||
"type": "string",
|
|
||||||
"help": {
|
|
||||||
"en": "MapZen is used for getting elevation information. You can get an API key on https://mapzen.com/developers/sign_up",
|
|
||||||
"fr": "MapZen est utilisé pour obtenir les informations d'élévation. Vous pouvez obtenir une clé API ici: https://mapzen.com/developers/sign_up"
|
|
||||||
},
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "maxmind_user_id",
|
"name": "maxmind_user_id",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"help": {
|
"help": {
|
||||||
"en": "Maxmind configuration. If specified, the maxmind GeoLite2 database will be downloaded for Geo IP lookup (to show the initial map state) and kept in memory. Sign up here: https://www.maxmind.com/en/geolite2/signup",
|
"en": "Maxmind configuration. If specified, the maxmind GeoLite2 database will be downloaded for Geo IP lookup (to show the initial map state) and kept in memory. Sign up here: https://www.maxmind.com/en/geolite2/signup",
|
||||||
"fr": "Configuration maxmind. Si vous spécifiez ce champ et le prochain, la base de donnée maxmind GeoLite2 sera téléchargée puis gardée en mémoire, pour localiser les addresse IP (afin que le chargement de la carte se fasse centré là où l'utilisateur est). Vous pouvez créer un compte ici: https://www.maxmind.com/en/geolite2/signup"
|
"fr": "Configuration maxmind. Si vous spécifiez ce champ et le prochain, la base de donnée maxmind GeoLite2 sera téléchargée puis gardée en mémoire, pour localiser les addresse IP (afin que le chargement de la carte se fasse centré là où l'utilisateur est). Vous pouvez créer un compte ici : https://www.maxmind.com/en/geolite2/signup"
|
||||||
},
|
},
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
@ -86,7 +85,7 @@
|
||||||
"name": "maxmind_license_key",
|
"name": "maxmind_license_key",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"help": {
|
"help": {
|
||||||
"en": "License key associated to the maxmind user id you specified.",
|
"en": "License key associated to the maxmind user ID you specified.",
|
||||||
"fr": "La clé de license associée à l'utilisateur maxmind que vous avez spécifié."
|
"fr": "La clé de license associée à l'utilisateur maxmind que vous avez spécifié."
|
||||||
},
|
},
|
||||||
"optional": true
|
"optional": true
|
||||||
|
@ -95,8 +94,8 @@
|
||||||
"name": "user_agent",
|
"name": "user_agent",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"help": {
|
"help": {
|
||||||
"en": "HTTP requests made by the backend will send this User-Agent header. Fill here the url facilmap will have and your e-mail address.",
|
"en": "HTTP requests made by the backend will send this User-Agent header. Fill here the URL facilmap will have and your e-mail address.",
|
||||||
"fr": "Les requêtes faites par le serveur enveront cette entête User-agent. Remplissez ici l'url de votre instance facilmap et votre adresse email."
|
"fr": "Les requêtes faites par le serveur enveront cette entête User-agent. Remplissez ici l'URL de votre instance facilmap et votre adresse email."
|
||||||
},
|
},
|
||||||
"example": "FacilMap (https://facilmap.org/, webmaster@example.org)"
|
"example": "FacilMap (https://facilmap.org/, webmaster@example.org)"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
## Problem
|
|
||||||
- *Description of why you made this PR*
|
|
||||||
|
|
||||||
## Solution
|
|
||||||
- *And how do you fix that problem*
|
|
||||||
|
|
||||||
## PR Status
|
|
||||||
- [ ] Code finished.
|
|
||||||
- [ ] Tested with Package_check.
|
|
||||||
- [ ] Fix or enhancement tested.
|
|
||||||
- [ ] Upgrade from last version tested.
|
|
||||||
- [ ] Can be reviewed and tested.
|
|
||||||
|
|
||||||
## Package_check results
|
|
||||||
---
|
|
||||||
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
|
|
|
@ -8,7 +8,8 @@
|
||||||
pkg_dependencies=""
|
pkg_dependencies=""
|
||||||
|
|
||||||
nodejs_version=14
|
nodejs_version=14
|
||||||
facilmap_version=3.1.0
|
|
||||||
|
facilmap_version=3.3.0
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
|
|
@ -37,11 +37,6 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Declaring files to be backed up..."
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs
|
|
||||||
### to be backuped and not an actual copy of any file. The actual backup that
|
|
||||||
### creates and fill the archive with the files happens in the core after this
|
|
||||||
### script is called. Hence ynh_backups calls takes basically 0 seconds to run.
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -73,9 +68,6 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Backing up the MySQL database..."
|
ynh_print_info --message="Backing up the MySQL database..."
|
||||||
|
|
||||||
### (However, things like MySQL dumps *do* take some time to run, though the
|
|
||||||
### copy of the generated dump to the archive still happens later)
|
|
||||||
|
|
||||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -28,12 +28,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
# Add settings here as needed by your application
|
|
||||||
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
|
||||||
#db_user=$db_name
|
|
||||||
#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
|
||||||
|
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -107,12 +101,6 @@ then
|
||||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC MODIFICATIONS
|
|
||||||
#=================================================
|
|
||||||
# ...
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -33,7 +33,6 @@ user_agent="$YNH_APP_ARG_USER_AGENT"
|
||||||
# APIS TOKENS
|
# APIS TOKENS
|
||||||
ors_token="$YNH_APP_ARG_ORS_TOKEN"
|
ors_token="$YNH_APP_ARG_ORS_TOKEN"
|
||||||
mapbox_token="$YNH_APP_ARG_MAPBOX_TOKEN"
|
mapbox_token="$YNH_APP_ARG_MAPBOX_TOKEN"
|
||||||
mapzen_token="$YNH_APP_ARG_MAPZEN_TOKEN"
|
|
||||||
maxmind_user_id="$YNH_APP_ARG_MAXMIND_USER_ID"
|
maxmind_user_id="$YNH_APP_ARG_MAXMIND_USER_ID"
|
||||||
maxmind_license_key="$YNH_APP_ARG_MAXMIND_LICENSE_KEY"
|
maxmind_license_key="$YNH_APP_ARG_MAXMIND_LICENSE_KEY"
|
||||||
|
|
||||||
|
@ -60,7 +59,6 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||||
ynh_app_setting_set --app=$app --key=user_agent --value=$user_agent
|
ynh_app_setting_set --app=$app --key=user_agent --value=$user_agent
|
||||||
ynh_app_setting_set --app=$app --key=ors_token --value=$ors_token
|
ynh_app_setting_set --app=$app --key=ors_token --value=$ors_token
|
||||||
ynh_app_setting_set --app=$app --key=mapbox_token --value=$mapbox_token
|
ynh_app_setting_set --app=$app --key=mapbox_token --value=$mapbox_token
|
||||||
ynh_app_setting_set --app=$app --key=mapzen_token --value=$mapzen_token
|
|
||||||
ynh_app_setting_set --app=$app --key=maxmind_user_id --value=$maxmind_user_id
|
ynh_app_setting_set --app=$app --key=maxmind_user_id --value=$maxmind_user_id
|
||||||
ynh_app_setting_set --app=$app --key=maxmind_license_key --value=$maxmind_license_key
|
ynh_app_setting_set --app=$app --key=maxmind_license_key --value=$maxmind_license_key
|
||||||
|
|
||||||
|
@ -80,21 +78,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing dependencies..." --weight=6
|
ynh_script_progression --message="Installing dependencies..." --weight=6
|
||||||
|
|
||||||
### `ynh_install_app_dependencies` allows you to add any "apt" dependencies to the package.
|
|
||||||
### Those deb packages will be installed as dependencies of this package.
|
|
||||||
### If you're not using this helper:
|
|
||||||
### - Remove the section "REMOVE DEPENDENCIES" in the remove script
|
|
||||||
### - Remove the variable "pkg_dependencies" in _common.sh
|
|
||||||
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
|
|
||||||
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INSTALL NODEJS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing NodeJS..." --weight=30
|
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -104,20 +88,25 @@ ynh_script_progression --message="Creating a MySQL database..." --weight=2
|
||||||
|
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd= # Will be set by facilmap_create_db
|
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
facilmap_create_db
|
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
||||||
|
echo "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" | ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CREATE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring system user..." --weight=1
|
||||||
|
|
||||||
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
#ynh_script_progression --message="Setting up source files..." --weight=100
|
ynh_script_progression --message="Setting up source files..." --weight=100
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
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"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -126,14 +115,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring system user..." --weight=1
|
|
||||||
|
|
||||||
# Create a system user
|
|
||||||
facilmap_create_user
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -141,7 +122,16 @@ facilmap_create_user
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Building node dependencies..." --weight=200
|
ynh_script_progression --message="Building node dependencies..." --weight=200
|
||||||
|
|
||||||
facilmap_install_app
|
mkdir -p $final_path
|
||||||
|
chown -R $app $final_path
|
||||||
|
|
||||||
|
pushd $final_path
|
||||||
|
ynh_exec_as $app "$ynh_node_load_PATH" $ynh_npm install --prefix "$final_path" -g facilmap-server@"$facilmap_version" 2>/dev/null
|
||||||
|
popd
|
||||||
|
|
||||||
|
chmod 750 "$final_path"
|
||||||
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -149,24 +139,15 @@ facilmap_install_app
|
||||||
ynh_script_progression --message="Configuring a systemd service..." --weight=2
|
ynh_script_progression --message="Configuring a systemd service..." --weight=2
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config --others_var="ynh_node_load_PATH"
|
ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding configuration..." --weight=2
|
ynh_script_progression --message="Adding configuration..." --weight=2
|
||||||
|
|
||||||
facilmap_add_config
|
mkdir -p $final_path/etc
|
||||||
|
ynh_add_config --template="../conf/config.env" --destination="$final_path/etc/facilmap.env"
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# SECURE FILES AND DIRECTORIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Setting app files permissions.." --weight=2
|
|
||||||
|
|
||||||
# Set permissions on app files
|
|
||||||
facilmap_set_permissions
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
|
@ -181,7 +162,7 @@ ynh_use_logrotate
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
yunohost service add $app --description="Collaborative maps and routing with a straightforward interface" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Collaborative maps and routing" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
@ -199,22 +180,9 @@ ynh_script_progression --message="Configuring app permissions..." --weight=2
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
# Everyone can access the app.
|
|
||||||
# The "main" permission is automatically created before the install script.
|
|
||||||
ynh_permission_update --permission="main" --add="visitors"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ### N.B. : the following extra permissions only make sense if your app
|
|
||||||
# ### does have for example an admin interface or an api.
|
|
||||||
#
|
|
||||||
# # Only the admin can access the admin panel of the app (if the app has an admin panel)
|
|
||||||
# ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin
|
|
||||||
#
|
|
||||||
# # Everyone can access to the api part
|
|
||||||
# # We don't want to display the tile in the sso so we put --show_tile="false"
|
|
||||||
# # And we don't want that the YunoHost Admin can remove visitors group to this permission, so we put --protected="true"
|
|
||||||
# ynh_permission_create --permission="api" --url "/api" --allowed="visitors" --show_tile="false" --protected="true"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -58,12 +58,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=3
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
# Remove metapackage and its dependencies
|
||||||
ynh_remove_app_dependencies
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE NODEJS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing NodeJS version for facilmap..." --weight=4
|
|
||||||
|
|
||||||
ynh_remove_nodejs
|
ynh_remove_nodejs
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -90,16 +84,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC REMOVE
|
|
||||||
#=================================================
|
|
||||||
# REMOVE VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing log files..." --weight=1
|
|
||||||
|
|
||||||
# Remove the log files
|
|
||||||
ynh_secure_remove --file="/var/log/$app/"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -109,7 +93,6 @@ ynh_script_progression --message="Removing the dedicated system user..." --weigh
|
||||||
|
|
||||||
# Delete a system user
|
# Delete a system user
|
||||||
ynh_system_user_delete --username=$app
|
ynh_system_user_delete --username=$app
|
||||||
ynh_secure_remove --file="/home/$app/"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -51,13 +51,6 @@ test ! -d $final_path \
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE APP MAIN DIR
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the app main directory..." --weight=2
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -67,13 +60,15 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei
|
||||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the app main directory..." --weight=2
|
||||||
|
|
||||||
# Restore permissions on app files
|
ynh_restore_file --origin_path="$final_path"
|
||||||
chown -R root:root $final_path
|
|
||||||
mkdir -p "$final_path/lib/node_modules/facilmap-server/cache"
|
chmod 750 "$final_path"
|
||||||
chown -R facilmap:facilmap "$final_path/lib/node_modules/facilmap-server/cache"
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
|
@ -84,12 +79,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=10
|
||||||
|
|
||||||
# Define and install dependencies
|
# Define and install dependencies
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REINSTALL NODEJS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing NodeJS..." --weight=30
|
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -98,8 +87,8 @@ ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
ynh_script_progression --message="Restoring the MySQL database..." --weight=5
|
ynh_script_progression --message="Restoring the MySQL database..." --weight=5
|
||||||
|
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
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
|
||||||
facilmap_create_db
|
echo "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"
|
||||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -115,7 +104,7 @@ systemctl enable $app.service --quiet
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
yunohost service add $app --description="Collaborative maps and routing with a straightforward interface" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Collaborative maps and routing" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
@ -124,14 +113,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=5
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server started"
|
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Server started"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#ynh_restore_file --origin_path="/etc/cron.d/$app"
|
|
||||||
|
|
||||||
#ynh_restore_file --origin_path="/etc/$app/"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
# RESTORE THE LOGROTATE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -28,7 +28,6 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
user_agent=$(ynh_app_setting_get --app=$app --key=user_agent)
|
user_agent=$(ynh_app_setting_get --app=$app --key=user_agent)
|
||||||
ors_token=$(ynh_app_setting_get --app=$app --key=ors_token)
|
ors_token=$(ynh_app_setting_get --app=$app --key=ors_token)
|
||||||
mapbox_token=$(ynh_app_setting_get --app=$app --key=mapbox_token)
|
mapbox_token=$(ynh_app_setting_get --app=$app --key=mapbox_token)
|
||||||
mapzen_token=$(ynh_app_setting_get --app=$app --key=mapzen_token)
|
|
||||||
maxmind_user_id=$(ynh_app_setting_get --app=$app --key=maxmind_user_id)
|
maxmind_user_id=$(ynh_app_setting_get --app=$app --key=maxmind_user_id)
|
||||||
maxmind_license_key=$(ynh_app_setting_get --app=$app --key=maxmind_license_key)
|
maxmind_license_key=$(ynh_app_setting_get --app=$app --key=maxmind_license_key)
|
||||||
|
|
||||||
|
@ -62,16 +61,12 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
||||||
|
|
||||||
#if [ "$upgrade_type" == "UPGRADE_APP" ]
|
# Create a dedicated user (if not existing)
|
||||||
#then
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
# ynh_script_progression --message="Upgrading source files..." --weight=5
|
|
||||||
#
|
|
||||||
# # Download, check integrity, uncompress and patch the source from app.src
|
|
||||||
# ynh_setup_source --dest_dir="$final_path"
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
|
@ -87,30 +82,22 @@ ynh_add_nginx_config
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=10
|
ynh_script_progression --message="Upgrading dependencies..." --weight=10
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE NODEJS
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing NodeJS..." --weight=40
|
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
|
||||||
facilmap_create_user
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD NODE DEPENDENCIES
|
# BUILD NODE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Building node dependencies..." --weight=70
|
ynh_script_progression --message="Install $app..." --weight=20
|
||||||
|
|
||||||
facilmap_install_app
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
|
then
|
||||||
|
chown -R $app $final_path
|
||||||
|
pushd $final_path
|
||||||
|
ynh_exec_as $app "$ynh_node_load_PATH" $ynh_npm install --prefix "$final_path" -g facilmap-server@"$facilmap_version" 2>/dev/null
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
@ -118,14 +105,15 @@ facilmap_install_app
|
||||||
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config --others_var="ynh_node_load_PATH"
|
ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating config files..." --weight=2
|
ynh_script_progression --message="Updating config files..." --weight=2
|
||||||
|
|
||||||
facilmap_add_config
|
mkdir -p "$final_path/etc"
|
||||||
|
ynh_add_config --template="../conf/config.env" --destination="$final_path/etc/facilmap.env"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -135,7 +123,9 @@ facilmap_add_config
|
||||||
ynh_script_progression --message="Setting files permissions..." --weight=1
|
ynh_script_progression --message="Setting files permissions..." --weight=1
|
||||||
|
|
||||||
# Set permissions on app files
|
# Set permissions on app files
|
||||||
facilmap_set_permissions
|
chmod 750 "$final_path"
|
||||||
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
|
@ -150,7 +140,7 @@ ynh_use_logrotate --non-append
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
yunohost service add $app --description="Collaborative maps and routing with a straightforward interface" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Collaborative maps and routing" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
|
Loading…
Add table
Reference in a new issue