Skip to content

Commit

Permalink
Documentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrimault committed Jul 22, 2017
1 parent 7da832e commit ce19c28
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ La synchronisation de ces données peut être faite par le réseau (wifi ou 3G)
![GeoNature schema general](https://github.com/PnEcrins/GeoNature/raw/master/docs/images/schema-geonature-environnement.jpg)

## License
© Makina Corpus / Parc national des Ecrins 2012 - 2015
© Makina Corpus / Parc national des Ecrins 2012 - 2017
28 changes: 14 additions & 14 deletions docs/installation-en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*Faune Webapi*

Initial documentation to install GeoNature-mobile-webapi (2013).
Initial documentation to install GeoNature-mobile-webapi (2013).

=====
SETUP
Expand All @@ -20,8 +20,8 @@ Copy settings_local.py.sample to settings_local.py and modify informations :

::

'NAME': 'appli_faune',
'USER': 'dbuser',
'NAME': 'db_name',
'USER': 'db_user',
'PASSWORD': 'xxxx',
'HOST': 'localhost',
'PORT': '5432',
Expand All @@ -47,7 +47,7 @@ Once the OS is installed (basic installation, with OpenSSH server), with the fol
Warning: the package build-essentials has been renamed build-essential in the latest debian versions

Warning Debian 8 : in order to properly compile, 2 other packages need to be installed

sudo apt-get install libpq-dev postgresql-server-dev-9.4


Expand All @@ -56,7 +56,7 @@ Install the webapi :
::

cd /path_to_webapi/

make install

BDD
Expand All @@ -72,20 +72,20 @@ Copy the virtual host example :

::

sudo cp faune/apache.vhost.sample /etc/apache2/sites-available/faune
sudo cp main/apache.vhost.sample /etc/apache2/sites-available/synchronomade.conf

Warning : starting with apache 2.4 the virtual host file need to have a .conf extension

Edit it and replace /path_to_webapi/faune/ by the correct path.
Edit it and replace /path_to_webapi/main/ by the correct path.


Activate it and restart apache :

sudo a2ensite faune
sudo a2ensite synchronomade
sudo apache2ctl restart


Web API is now available on http://server/faune/.
Web API is now available on http://server/synchronomade/.


=====
Expand All @@ -94,17 +94,17 @@ USAGE

Export data:

http://server/faune/export/sqlite
http://server/faune/export/unity_geojson
http://server/synchronomade/export/sqlite
http://server/synchronomade/export/unity_geojson
or
http://server/faune/export/unity_polygons
http://server/synchronomade/export/unity_polygons

POST parameter (defined in settings.py) :
token

Import data:

http://localhost/faune/import_data
http://localhost/synchronomade/import_data

POST parameter:
token
Expand Down
48 changes: 24 additions & 24 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pré-requis
=========
* Pré-tuilage des fonds raster au format .mbtiles : [``tuilage_raster_mbtiles.pdf``](https://github.com/PnEcrins/GeoNature-mobile/blob/master/docs/tuilage_raster_mbtiles-2017-01.pdf)

* Environnement serveur :
* Environnement serveur :

Voir le chapitre sur l'installation du serveur de l'application web GeoNature ([http://geonature.readthedocs.org/fr/latest/server.html](http://geonature.readthedocs.org/fr/latest/server.html))

Expand All @@ -19,11 +19,11 @@ Voir le chapitre sur l'installation du serveur de l'application web GeoNature ([
* Se loguer sur le serveur avec l'utilisateur ``synthese`` ou tout autre utilisateur linux faisant partie du groupe www-data.

* Installer les paquets suivants :

sudo apt-get install -y python-virtualenv libapache2-mod-wsgi python-dev build-essential

Attention sur Debian 8, 2 autres paquets sont nécessaires pour compiler correctement :

sudo apt-get install libpq-dev postgresql-server-dev-9.4

Sur debian 9 un autre paquet est nécessaire pour compiler correctement :
Expand All @@ -33,9 +33,9 @@ Voir le chapitre sur l'installation du serveur de l'application web GeoNature ([

Installation
------------

* Récupérer le zip de l’application sur le Github du projet (`X.Y.Z à remplacer par le numéro de version souhaitée` [https://github.com/PnEcrins/GeoNature-mobile-webapi/releases](https://github.com/PnEcrins/GeoNature-mobile-webapi/releases)), dézippez le dans le répertoire de l'utilisateur linux du serveur puis copiez le dans le répertoire de l’utilisateur linux :

cd /home/synthese
wget https://github.com/PnEcrins/GeoNature-mobile-webapi/archive/X.Y.Z.zip
unzip X.Y.Z.zip
Expand All @@ -44,8 +44,8 @@ Installation
* Copier et renommer le contenu du fichier settings_local.py.sample en ``settings_local.py``

cd synchronomade
cp webapi/faune/settings_local.py.sample webapi/faune/settings_local.py
cp webapi/main/settings_local.py.sample webapi/main/settings_local.py

* Adapter le contenu du fichier ``settings_local.py`` à votre contexte en modifiant les informations :
[https://github.com/PnEcrins/GeoNature-mobile-sync](https://github.com/PnEcrins/GeoNature-mobile-sync)

Expand All @@ -70,7 +70,7 @@ Les valeurs de ``MOBILE_SOFT_PATH`` et ``MOBILE_FILE_PATH`` doivent être rensei

* Créer les répertoires ``apk`` et ``datas`` puis récupérer les fichiers d'installation (apk) et de settintgs (json) des applications depuis le Github de GeoNature-mobile : https://github.com/PnEcrins/GeoNature-mobile
(`X.Y.Z à remplacer par le numéro de version souhaitée <https://github.com/PnEcrins/GeoNature-mobile/releases>)

cd synchronomade/webapi
mkdir apk
cd apk
Expand All @@ -94,32 +94,32 @@ Les valeurs de ``MOBILE_SOFT_PATH`` et ``MOBILE_FILE_PATH`` doivent être rensei


* Installer la webapi :

make install


Adaptation de la BDD
---
Exécuter le script sql/reject_tables.sql sur votre BDD GeoNature (``geonaturedb``) avec l'utilisateur ``geonatuser``.
* Executer le script SQL suivant :

export PGPASSWORD=monpassachanger; sudo psql -h geonatdbhost -U geonatuser -d geonaturedb -f sql/reject_tables.sql


Configuration d'Apache vhost
------------

Copier l'exemple de virtual-host Apache

sudo cp faune/apache.vhost.sample /etc/apache2/sites-available/synchronomade.conf
sudo cp main/apache.vhost.sample /etc/apache2/sites-available/synchronomade.conf

ATTENTION : Depuis la version 2.4 d'Apache, le fichier du virtual-host doit avoir une extension ``.conf`` ainsi que la clause ``Require all granted``

Editer-le en adaptant les chemins à votre contexte et avec les paramètres suivants :

WSGIScriptAlias /synchronomade /home/synthese/synchronomade/webapi/faune/wsgi.py
WSGIScriptAlias /synchronomade /home/synthese/synchronomade/webapi/main/wsgi.py
WSGIPythonPath /home/synthese/synchronomade/webapi/lib/python2.7/site-packages
<Directory /home/synthese/synchronomade/webapi/faune/>
<Directory /home/synthese/synchronomade/webapi/main/>
<Files wsgi.py>
Order allow,deny
Allow from all
Expand Down Expand Up @@ -162,15 +162,15 @@ Prérequis
* Activer le mode développeur et le debogage USB :

Paramètres -> A propos du téléphone : cliquer 6 ou 7 fois sur le numéro de build pour activer le mode développeur
Paramètres -> Options pour les développeurs : Activer le debogage USB
Paramètres -> Options pour les développeurs : Activer le debogage USB

* Connecter le terminal à l'ordinateur en tant que périphérique multimédia (MTP).
* Lancer la synchronistation à l'aide de l'utilitaire desktop installé précedemment.

ATTENTION sur Android 5 : Il est nécessaire de redémarer le terminal pour que le contenu de la mémoire soit rafraîchi afin de voir le dossier ``com.makina.ecrins`` dans l'explorateur de fichier de l'ordinateur.

* Une fois l'installation terminée se rendre dans la mémoire de la carte SD de l'appareil puis dans : ``Android/data`` et creer un nouveau répertoire ``com.makina.ecrins``
* Ajouter dans ce dernier un nouveau dossier ``databases``
* Ajouter dans ce dernier un nouveau dossier ``databases``
* Y copier depuis l'ordinateur les 3 fichiers .mbtiles nécessaire au fonctionnement des applications (les rasters : scan, ortho et unities).

ATTENTION sur Android 5 : Sur Android 4 le dossier ``com.makina.ecrins`` est installé aussi sur la mémoire interne de l'appareil. Il faut donc le créer à nouveau sur la carte SD comme expliqué ci-dessus.
Expand All @@ -185,17 +185,17 @@ USAGE

Export data:

http://server/faune/export/sqlite
http://server/faune/export/unity_geojson
http://server/synchronomade/export/sqlite
http://server/synchronomade/export/unity_geojson
or
http://server/faune/export/unity_polygons
http://server/synchronomade/export/unity_polygons

POST parameter (defined in settings.py) :
token

Import data:

http://localhost/faune/import_data
http://localhost/synchronomade/import_data

POST parameter:
token
Expand Down
4 changes: 0 additions & 4 deletions webapi/main/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import os
import sys

#sys.path.append('/home/sbe/projects/geobi-ecrins-faune/faune/')

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")


Expand All @@ -27,5 +25,3 @@
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)


0 comments on commit ce19c28

Please sign in to comment.