20 Commits

Author SHA1 Message Date
nobohan
0cc04eae61 update README 2024-01-30 11:06:33 +01:00
d26aebd6f6 update submodule for #44 2024-01-23 11:22:13 +01:00
86a77bb488 Update vendor for Geonature for #44 (dashboard) 2024-01-18 10:46:06 +01:00
2cc6c185c7 update vendor for #44 2024-01-15 19:30:29 +01:00
8b33a050ed FIXED compilation of Dockerfile for Taxhub #54 2024-01-08 16:27:10 +01:00
nobohan
ea699549ac upd vendor: merge branch issue51 2023-12-01 14:43:48 +01:00
nobohan
da1b8d8253 #43 add confiance badge + update submodules 2023-10-03 20:36:36 +02:00
nobohan
69749c2539 #44 add demo graphs in QGIS project 2023-08-28 15:23:54 +02:00
nobohan
2f87bcfc48 update vendor submodule with fixes for user evaluation 2023-08-18 10:30:31 +02:00
nobohan
f3ad29d29f #42 update vendor submodule 2023-08-17 08:22:58 +02:00
nobohan
948f43b444 #43 add expert status to user: update vendor submodule 2023-08-16 11:16:30 +02:00
nobohan
044a4c0a68 FEATURE: send email to admins when a new user subscribe #41 2023-08-16 10:46:32 +02:00
nobohan
d5a55aa4c3 #47 update map layers 2023-08-14 16:27:55 +02:00
nobohan
8df8ecc4df update app #40: update vendor submodule 2023-07-19 09:41:56 +02:00
nobohan
d81aeb1f7f #40 fix pip dependency issue with fiona and utils-flask-sqla-geo using python3.8 2023-07-17 12:32:48 +02:00
nobohan
277fd3fe82 update app #40 add missing conf file 2023-07-17 11:40:55 +02:00
nobohan
864ebb2c57 delete obsolet README 2023-07-14 09:39:08 +02:00
nobohan
43e480daab update app #40: add missing media folder in Dockerfile-back 2023-07-13 17:49:19 +02:00
nobohan
78efb59f9f update app: use custom requirements and other docker-compose adaptations 2023-07-13 12:29:50 +02:00
nobohan
7036420059 update app: geo_api not used anymore (fix patch) 2023-07-13 12:28:04 +02:00
17 changed files with 9223 additions and 787 deletions

View File

@@ -1,5 +1,4 @@
FROM debian:buster-slim
# todo utiliser image python3 ?
FROM python:3.8-slim-buster
## install dependencies
RUN apt-get update && \
@@ -21,8 +20,7 @@ RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
COPY vendor/GeoNature-citizen/ /home/appuser/citizen/
# patches
#COPY patches/back/requirements.txt /home/appuser/citizen/backend/requirements.txt #use the requirements from the GnC repo
COPY patches/back/default_config.toml /home/appuser/citizen/config/default_config.toml
COPY patches/back/default_config.toml /home/appuser/citizen/config/config.toml
COPY patches/settings.ini /home/appuser/citizen/config/settings.ini
COPY patches/back/wsgi.py /home/appuser/citizen/backend/wsgi.py
COPY patches/back/server.py /home/appuser/citizen/backend/server.py
@@ -33,6 +31,8 @@ USER appuser
WORKDIR /home/appuser/citizen/backend/
RUN mkdir /home/appuser/citizen/media/
ENV VIRTUAL_ENV=/home/appuser/citizen/backend/venv2/
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

View File

@@ -39,6 +39,7 @@ RUN /bin/bash create_sys_dir.sh
# Install dependencies:
RUN pip install --upgrade pip setuptools wheel
RUN pip install -r requirements.txt
RUN cp static/app/constants.js.sample static/app/constants.js

104
README
View File

@@ -1,104 +0,0 @@
TODO FUSION entre README & README.md
# gl-geonature
L'instance Geonature-Citizen de Champs-Libres.
# Installation développeur (docker-compose )
## Multiple containers
Get the code (using git-submodule) for : citizen & taxhub.
```
$ git submodule update --init --recursive
```
### DB init
Creation of the table `referentielsdb` that will be used for storing data.
```
$ docker-compose up -d db
$ docker-compose exec db createdb -U postgres referentielsdb
$ docker-compose exec db psql -U postgres -d referentielsdb -c "CREATE SCHEMA taxonomie"
$ docker-compose exec db psql -d -U postgres -d referentielsdb -c "CREATE EXTENSION postgis"
```
### Taxhub
```
$ docker-compose run taxhub bash install_db.sh
$ docker-compose up -d taxhub
```
#### CREATION / Compiation du JS de Taxhub
##### Mise à jour de nppm.
```
$ docker-compose exec -u root taxhub bash
taxhub $ npm install npm@latest -g # mise à jour de npm
```
#### Compilation du code
```
$ docker-compose exec taxhub bash
taxhub $ cd static
taxhub $ cp app/constants.js.sample app/constants.js
taxhub $ npm install
```
### Citizen-front
```
$ docker-compose run --rm citizen-front npm install
$ docker-compose run --rm citizen-front npm run build:i18n-ssr
$ docker-compose up -d citizen-front
```
### Citizen-back
```
docker-compose up -d citizen-front
```
### Apache
Redigie de 8080 vers autres services :
- 4000 (citizen-front)
- 5002 (citizen-back)
- 5000 (taxon)
## Single container (depreciated)
### Creation DB (pour single container)
docker-compose exec db createdb -U postgres citizen
docker-compose exec db psql -U postgres -d citizen -c "CREATE SCHEMA taxonomie"
ref_geo
docker-compose exec db psql -d -U postgres -d citizen -c "CREATE EXTENSION postgis"
$ git submodule update --init --recursive
$ docker-compose up -d
$ docker-compose exec citizen install/install_app.sh
note: les credentials pour accéder au backend se trouvent dans /home/appuser/citizen/config
### Remise en route du service
$ docker-compose up -d
$ docker-compose exec citizen sh install/restart.sh
# Documentation :
$ make doc

View File

@@ -51,25 +51,6 @@ $ docker-compose run taxhub bash install_db.sh
$ docker-compose up -d taxhub
```
#### Compilation du JS de Taxhub
This is probably not needed as we don't use Taxhub.
##### Mise à jour de npm
```
$ docker-compose exec -u root taxhub bash
taxhub $ npm install npm@latest -g
```
#### Compilation du code
```
$ docker-compose exec taxhub bash
taxhub $ cd static
taxhub $ cp app/constants.js.sample app/constants.js
taxhub $ npm install
```
### nginx
Redirige de 8080 vers autres services :
@@ -110,7 +91,7 @@ In order to interactively edit the js code, the frontend folder is mounted into
```bash
docker-compose exec citizen-front bash
root@9c0fea7720a0:/home/appuser/citizen/frontend# npm run ng serve -- --host 0.0.0.0 --port 4200 --configuration=fr --poll 2000
root@9c0fea7720a0:/home/appuser/citizen/frontend# npm run ng serve -- --host 0.0.0.0 --port 4200 --configuration=fr --poll 2000 --sourceMap=false
```
The app must be looked at **http://localhost:4200/**.
@@ -127,7 +108,14 @@ or `npm run build:fr` for speeding up.
### Back-end development
When developing the app and serving it with `docker-compose up`, the changes are automatically loaded (meaning, the app is watching the changes). However, it is more practical to change the command of the backend container from `command: bash start_gunicorn.sh` to `command: python wsgi.py` in order to have some logs.
When developing the app and serving it with `docker-compose up`, the changes should be automatically loaded (meaning, the app is watching the changes) (Note that this is not the case anymore). However, it is more practical to change the command of the backend container from `command: bash start_gunicorn.sh` to `command: python wsgi.py` in order to have some logs.
You can access a flask shell terminal with the following:
```bash
docker-compose exec citizen-back bash
appuser@5d4fc6b169b2:~/citizen/backend$ flask shell
```
## Deploiement sur un serveur distant

View File

@@ -4,7 +4,7 @@ services:
db:
image: postgis/postgis:12-3.1-alpine
ports:
- "5432:5432"
- "5434:5432"
volumes:
- "pg-data:/var/lib/postgresql/data"
environment:
@@ -41,13 +41,14 @@ services:
- ./vendor/GeoNature-citizen/backend/var/log/:/home/appuser/citizen/backend/var/log/
- ./patches/settings.ini:/home/appuser/citizen/config/settings.ini
- ./patches/settings.ini:/home/appuser/citizen/backend/config/settings.ini
- ./patches/back/default_config.toml:/home/appuser/citizen/config/default_config.toml
- ./patches/back/default_config.toml:/home/appuser/citizen/config/config.toml
- ./patches/back/start_gunicorn.sh:/home/appuser/citizen/backend/start_gunicorn.sh
- ./patches/back/wsgi.py:/home/appuser/citizen/backend/wsgi.py
- ./patches/back/server.py:/home/appuser/citizen/backend/server.py
ports:
- "5002:5002"
command: bash start_gunicorn.sh
#command: bash start_gunicorn.sh
command: python wsgi.py
taxhub:
build:
dockerfile: ./Dockerfile-taxhub

View File

@@ -17,7 +17,7 @@ DEBUG = false
SQLALCHEMY_DEBUG_LEVEL = 'WARNING'
# URL_APPLICATION = "http://mydomain.org" # Replace mydomain.org by your domain
URL_APPLICATION = "http://taxhub:5000"
URL_APPLICATION = "https://localhost:8080/"
API_TAXHUB = "http://taxhub:5000/api/"
# API_TAXHUB = "http://mytaxhub.org/api/" # Replace mytaxhub.org by your TaxHub url
@@ -48,7 +48,7 @@ REWARDS_ENABLED = false
USE_CONFIRM_EMAIL = true
SUBJECT = "Activez votre compte"
FROM = '"Biommap" <contact@geonature-citizen.fr>'
HTML_TEMPLATE = '''<p> Bonjour,</p><br /><p>Nous vous confirmons que votre compte a bien été créé.</p>
HTML_TEMPLATE = '''<p> Bonjour,</p><br /><p>Nous vous confirmons que votre compte Biommap a bien été créé.</p>
<p> Afin d'activer votre compte veuillez <a href="{activate_url}">cliquer ici.</a>
<p>Nous vous souhaitons la bienvenue sur notre site.</p><br />
<p>Bien à vous.</p>
@@ -61,10 +61,15 @@ REWARDS_ENABLED = false
[MAIL]
MAIL_USE_SSL = false
MAIL_STARTTLS = true
MAIL_HOST = 'smtpd host'
MAIL_PORT = 493 # mandatory SSL port
MAIL_AUTH_LOGIN = 'smtpd/relay host username'
MAIL_AUTH_PASSWD = 'smtpd/relay host password'
MAIL_HOST = 'mail.easter-eggs.com'
MAIL_PORT = 587 # mandatory SSL port
MAIL_AUTH_LOGIN = 'julien.minet@champs-libres.coop'
MAIL_AUTH_PASSWD = 'Bomel2164'
ADMIN_MESSAGE = '''<p>Bonjour administrateur,</p><br />
<p>Un nouvel utilisateur de Biommap avec le nom d'utilisateur "{newuser_username}" a été créé!</p>
<p>Vous pouvez gérer cet utilisateur dans l'espace d'administration.</p><br />
<p>Bonne journée</p>
'''
# API flasgger main config

View File

@@ -1,35 +0,0 @@
certifi==2019.6.16
chardet==3.0.4
Click==7.0
colorlog==4.0.2
flasgger==0.9.3
Flask==1.1.1
Flask-Admin==1.5.3
Flask-CKEditor==0.4.3
Flask-Cors==3.0.8
Flask-JWT-Extended==3.21.0
Flask-SQLAlchemy==2.4.0
GeoAlchemy2==0.6.3
geojson==2.5.0
gunicorn==20.0.4
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10.1
jsonschema==2.6.0
MarkupSafe==1.1.1
mistune==0.8.4
passlib==1.7.1
psycopg2-binary==2.8.3
PyJWT==1.7.1
PyYAML==5.1.2
requests==2.22.0
Shapely==1.7.1
six==1.12.0
SQLAlchemy==1.3.7
toml==0.10.0
urllib3==1.25.3
Werkzeug==0.15.5
WTForms==2.2.1
gunicorn==20.0.4
httplib2==0.19.0
xlwt==1.3.0

View File

@@ -96,7 +96,7 @@ def get_app(config, _app=None, with_external_mods=True, url_prefix="/api"):
from gncitizen.core.users.routes import users_api
from gncitizen.core.commons.routes import commons_api
from gncitizen.core.observations.routes import obstax_api
from gncitizen.core.ref_geo.routes import geo_api
#from gncitizen.core.ref_geo.routes import geo_api
from gncitizen.core.badges.routes import badges_api
from gncitizen.core.taxonomy.routes import taxo_api
from gncitizen.core.sites.routes import sites_api
@@ -104,7 +104,7 @@ def get_app(config, _app=None, with_external_mods=True, url_prefix="/api"):
app.register_blueprint(users_api, url_prefix=url_prefix)
app.register_blueprint(commons_api, url_prefix=url_prefix)
app.register_blueprint(obstax_api, url_prefix=url_prefix)
app.register_blueprint(geo_api, url_prefix=url_prefix)
#app.register_blueprint(geo_api, url_prefix=url_prefix)
app.register_blueprint(badges_api, url_prefix=url_prefix)
app.register_blueprint(taxo_api, url_prefix=url_prefix)
app.register_blueprint(sites_api, url_prefix=url_prefix + "/sites")

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="800px"
height="800px"
viewBox="0 0 24 24"
fill="none"
version="1.1"
id="svg4"
sodipodi:docname="check-circle-svgrepo-com-green.svg"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2506"
inkscape:window-height="1403"
id="namedview6"
showgrid="false"
inkscape:zoom="0.834386"
inkscape:cx="448.21459"
inkscape:cy="381.26471"
inkscape:window-x="54"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM16.0303 8.96967C16.3232 9.26256 16.3232 9.73744 16.0303 10.0303L11.0303 15.0303C10.7374 15.3232 10.2626 15.3232 9.96967 15.0303L7.96967 13.0303C7.67678 12.7374 7.67678 12.2626 7.96967 11.9697C8.26256 11.6768 8.73744 11.6768 9.03033 11.9697L10.5 13.4393L12.7348 11.2045L14.9697 8.96967C15.2626 8.67678 15.7374 8.67678 16.0303 8.96967Z"
fill="#1C274C"
id="path2"
style="fill:#60b15c" />
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,109 @@
import { AppConfig } from './app.config';
import { MAP_CONFIG as MapConfig } from './map.config';
export const DefaulConfig = {
// Default MainConfig
appName: 'GeoNature-citizen',
API_ENDPOINT: 'http://localhost:5002/api',
API_TAXHUB: 'http://localhost:5000/api',
API_CITY: 'https://nominatim.openstreetmap.org/reverse',
HCAPTCHA_SITE_KEY: null,
FRONTEND: {
PROD_MOD: true,
MULTILINGUAL: false,
DISPLAY_FOOTER: true,
DISPLAY_TOPBAR: true,
DISPLAY_SIDEBAR: true,
DISPLAY_STATS: true,
DISPLAY_BADGES: true,
NEW_OBS_FORM_MODAL_VERSION: true,
},
META: {
keywords: 'biodiversite enquetes participatif observations',
},
about: true,
URL_APPLICATION: 'http://127.0.0.1:4200',
REWARDS: true,
termsOfUse: {
fr: 'assets/cgu.pdf',
en: 'assets/termsOfUse.pdf',
},
signup: 'optional', // never|optional|always
email_contact: false,
platform_intro: {
fr: 'Bienvenue<br /> sur GeoNature Citizen',
en: 'Welcome<br /> on GeoNature Citizen',
},
platform_teaser: {
fr: 'Hae duae provinciae bello quondam piratico catervis mixtae praedonum a Servilio pro consule missae sub iugum factae sunt vectigales. et hae quidem regiones velut in prominenti terrarum lingua positae ob orbe eoo monte Amano disparantur.',
en: 'Hae duae provinciae bello quondam piratico catervis mixtae praedonum a Servilio pro consule missae sub iugum factae sunt vectigales. et hae quidem regiones velut in prominenti terrarum lingua positae ob orbe eoo monte Amano disparantur.',
},
platform_participate: {
fr: 'PARTICIPER AU PROGRAMME',
en: 'PARTICIPATE',
},
programs_label: {
fr: 'Programmes',
en: 'Surveys',
},
program_label: {
fr: 'Le programme',
en: 'Survey',
},
program_share_an_observation: {
fr: 'PARTAGER UNE OBSERVATION',
en: 'SHARE AN OBSERVATION',
},
program_add_an_observation: {
fr: 'AJOUTER UNE OBSERVATION',
en: 'CONTRIBUTE AN OBSERVATION',
},
program_allow_email_contact: {
fr: "J'accepte que mon adresse e-mail puisse être utilisée pour recontacter à propos de mon observation",
en: 'I agree that my e-mail address can be used to recontact about my observation',
},
taxonDisplayImageWhenUnique: true,
taxonSelectInputThreshold: 7,
taxonAutocompleteInputThreshold: 12,
taxonAutocompleteFields: [
'nom_complet',
'nom_vern',
'nom_vern_eng',
'cd_nom',
],
taxonDisplaySciName: true,
program_list_observers_names: true,
program_list_sort: '-timestamp_create',
details_espece_url: '<url_inpn_or_atlas>/cd_nom/', // !! gardez bien le cd_nom/ dans l'url
registration_message: 'Vous inscrire vous permet de gérer vos observations',
imageUpload: {
maxHeight: 1440,
maxWidth: 1440,
quality: 0.9,
},
// Default MapConfig
DEFAULT_PROVIDER: 'OpenStreetMapOrg',
BASEMAPS: [
{
name: 'OpenStreetMapOrg',
maxZoom: 19,
layer: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: 'abc',
attribution:
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Tiles style by <a href="https://www.hotosm.org/" target="_blank">Humanitarian OpenStreetMap Team</a> hosted by <a href="https://openstreetmap.fr/" target="_blank">OpenStreetMap France</a>',
},
],
CENTER: [46.52863469527167, 2.43896484375],
ZOOM_LEVEL: 6,
ZOOM_LEVEL_RELEVE: 15,
NEW_OBS_POINTER: 'assets/pointer-blue2.png',
OBS_POINTER: 'assets/pointer-green.png',
LOCATE_CONTROL_TITLE: {
fr: 'Me localiser',
en: 'Show me where i am',
},
};
export const MainConfig = { ...DefaulConfig, ...AppConfig, ...MapConfig };
export default MainConfig;

View File

@@ -20,7 +20,7 @@ export const MAP_CONFIG = {
{
name: "Hydrographie",
maxZoom: 20,
layer: "//geoservices.wallonie.be/arcgis/services/EAU/RHW/MapServer/WMSServer?",
layer: "//geoservices.wallonie.be/arcgis/services/EAU/RHW_SIMPLE/MapServer/WMSServer?",
layers: ['1', '2', '3', '4', '5','6'],
wms: true,
attribution: '&copy; SPW'
@@ -44,7 +44,7 @@ export const MAP_CONFIG = {
{
name: "Pentes (relief)",
maxZoom: 20,
layer: "//geoservices.wallonie.be/arcgis/services/RELIEF/WALLONIE_MNP_CLASSE_2013_2014/MapServer/WMSServer?",
layer: "//geoservices.wallonie.be/arcgis/services/RELIEF/WALLONIE_MNP_2013_2014__CLASSES/MapServer/WMSServer?",
layers: '0',
wms: true,
attribution: '&copy; SPW'
@@ -83,9 +83,9 @@ export const MAP_CONFIG = {
attribution: '&copy; SPW'
},
{
name: "Parcellaire agricole anonyme 2019",
name: "Parcellaire agricole anonyme 2020",
maxZoom: 20,
layer: "//geoservices.wallonie.be/arcgis/services/AGRICULTURE/SIGEC_PARC_AGRI_ANON__2019/MapServer/WMSServer?",
layer: "//geoservices.wallonie.be/arcgis/services/AGRICULTURE/SIGEC_PARC_AGRI_ANON__2020/MapServer/WMSServer?",
layers: '0',
wms: true,
attribution: '&copy; SPW'
@@ -177,8 +177,8 @@ export const MAP_CONFIG = {
{
name: "Limites administratives",
maxZoom: 20,
layer: "//ccff02.minfin.fgov.be/geoservices/arcgis/services/INSPIRE/AU_wms/MapServer/WMSServer?",
layers: ['1', '2', '3', '4'],
layer: "//ccff02.minfin.fgov.be/geoservices/arcgis/services/WMS/Cadastral_Layers/MapServer/WMSServer?",
layers: ['Region', 'Province', 'Municipality'],
wms: true,
attribution: '&copy; CadGIS'
},

File diff suppressed because it is too large Load Diff

5200
qgis/lecture-biommap.qgs~ Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.