Skip to content
Snippets Groups Projects
Commit c73c3c35 authored by Pierre Ecarlat's avatar Pierre Ecarlat
Browse files
parents ba1f9da9 7d518537
Branches
No related tags found
No related merge requests found
Pipeline #110145 passed
......@@ -21,7 +21,6 @@ The only public routes are :
We check the terms acceptation in the **splash screen** while the application is initializing, if there is no consent (first connection), or the consent is outdated (update of terms), the user will be redirected to the terms acceptation page.
For the full terms acceptation process, the user has to check the two checkboxes (one for Data share consent, and one for CGU and Legal Notice) to unlock the terms acceptation button. Once he has accepted it, a new term doctype is created with the value *accepted* to true. So he can access now the entire application.
We store in user's profile a boolean *showConsentModal* that allows the app to know about the consent status.
If the user is not subscribed to the newsletter, a third facultative checkbox is displayed. If the user checks it, he will be subscribed to the newsletter.
......
......@@ -14,7 +14,7 @@ Here is an example of service declaration in the ecolyo manifest:
![Manifest.webapp](/img/services/monthly-service.png)
File location is determined after the build, see [here](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/tree/build/services/monthlyReport).
File location is determined after the build, see [/build/services](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/ecolyo/-/tree/build/services/monthlyReportNotification).
:::note Cron
See the cron definition at [cozy-stack](https://docs.cozy.io/en/cozy-stack/jobs/#cron-syntax).
......
......@@ -44,7 +44,7 @@ Here are the available doctypes:
| Field | Type | Description |
| ------ | ------ | ----------------------------------------------------------------- |
| load | number | load (in kWh or L) |
| minute | number | minute of the date<br/>*set to 0 except for minute serie* |
| minute | number | minute of the date<br/>*set to 0 except for minute series* |
| hour | number | hour of the date<br/>*set to 0 except for minute and hour series* |
| day | number | day of the date<br/>*set to 1 for month and year series* |
| month | number | month of the date<br/>*set to 1 for year series* |
......@@ -86,12 +86,10 @@ This doctype is used to store all information about the user.
| isFirstConnection | boolean | Boolean used to inform if the user connects for the first time |
| lastConnectionDate | DateTime | Date of the last user connection |
| haveSeenLastAnalysis | boolean | Boolean used to inform if user has seen the last analysis |
| haveSeenOldFluidModal | Datetime or boolean | Used to inform if user has seen the modal display when his data are too old. Its value is false or a DateTime when he saw it |
| sendAnalysisNotification | boolean | Boolean used to inform if user has seen the analysis notification |
| monthlyAnalysisDate | DateTime | Date of the last monthly analysis |
| profileType | ProfileType | User consumption profile |
| isProfileTypeCompleted | boolean | Check if a user has completed his consumption profile |
| showConsentModal | boolean | Boolean used to show the terms acceptation page, and to protect the app private routes if last terms are not accepted or outdated |
**Example:**
......@@ -102,33 +100,13 @@ This doctype is used to store all information about the user.
"duelHash": "48371ffabb2853b0503b882f11e1fa8e730bac76",
"ecogestureHash": "9798a0aaccb47cff906fc4931a2eff5f9371dd8b",
"haveSeenLastAnalysis": true,
"haveSeenOldFluidModal": false,
"isFirstConnection": false,
"lastConnectionDate": "2021-03-08T17:33:18.727Z",
"monthlyAnalysisDate": "2021-01-03T00:00:00.000+01:00",
"quizHash": "11372a56c03edef1d6656f8a76d5ec457174f2c1",
"explorationHash": "cdbc7a84d041318253a10b3cc0c02f9020c78c0b",
"sendAnalysisNotification": false,
"profileType": {
"area": "123",
"coldWater": "individual",
"constructionYear": "between_1948_and_1974",
"cookingFluid": 0,
"floor": "not_applicable",
"hasInstalledVentilation": "yes",
"hasReplacedHeater": "yes",
"heating": "individual",
"hotWater": "individual",
"hotWaterEquipment": "solar",
"hotWaterFluid": 0,
"housingType": "individual_house",
"individualInsulationWork": ["roof_insulation"],
"occupantsNumber": 1,
"outsideFacingWalls": "2",
"warmingFluid": 0
},
"isProfileTypeCompleted": true,
"showConsentModal": true
}
```
......
......@@ -103,7 +103,7 @@ We need different versions for our projects so we will have to install a node ve
#### NVM
For our projects you will need to have a version manager for node such as [**n**](https://www.npmjs.com/package/n), [**fnm**](https://github.com/Schniz/fnm), [**nvm**](https://github.com/nvm-sh/nvm) and [**nvm-windows**](https://github.com/coreybutler/nvm-windows). Install both at least version **16**.
For our projects you will need a version manager for node such as [**n**](https://www.npmjs.com/package/n), [**fnm**](https://github.com/Schniz/fnm), [**nvm**](https://github.com/nvm-sh/nvm) and [**nvm-windows**](https://github.com/coreybutler/nvm-windows). Most of our projects contains a `.node-version` file indicating the desired version.
You can then check the current version of node used
......@@ -156,3 +156,5 @@ We use different softwares/tools to help use share ressources. Ask a team member
- Figma
- Postman
- Udemy
- Whimsical
- Mattermost
# Monitoring
All logs printed by the Proxy are read and translated into statistics on a grafana dashboard.
All logs printed by the Cozy stack can be displayed on a Grafana dashboard for easier sorting.
:::info Grafana
[scaleway monitoring](https://grafana.self-data.alpha.grandlyon.com/)
To start the monitoring system, connect to alpha and type the following command:
[production address](https://oauth-logs.cozycloud.cc/d/xSRhz8fMk/cozy-oauth-proxy?orgId=1&refresh=5s)
```bash
docker compose -f /root/monitoring/logs-monitoring/docker-compose.yaml up -d
```
Then, you can access it [here](https://grafana.self-data.alpha.grandlyon.com/)
:::info Login
Ask for credentials to a team member
:::
This monitoring system allow the team to parse more easily the cozy-stack logs when something goes wrong. For instance, test konnector or check from the proxy if an issue was coming from Enedis or Grdf.
Learn more about how it works [here](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/logs-monitoring).
Learn more about how it works [in the project readme](https://forge.grandlyon.com/web-et-numerique/factory/llle_project/logs-monitoring).
:::tip Debug logs
Enabling debug logs will print more logs and can be helpful. You can do so by running scripts :
```bash
./set_instance_debug_true.sh <instance>
./set_instance_debug_false.sh <instance>
```
:::
:::warning High volume
The service parses a very high amount of logs, most of all when debugging an instance. To limit our disk usage we tend to stop the service when not needed.
Just type docker-compose down to stop it in monitoring/logs-monitoring. The docker volume will be persisted.
The service parses a very high amount of logs, most of all when debugging an instance. To limit our disk usage we tend to stop the service when not needed. To do so, type the following command:
```bash
docker compose -f /root/monitoring/logs-monitoring/docker-compose.yaml down
```
The docker volume will be persisted.
:::
To easily plug loki on a specific instance:
Some dashboards are already available, [ecolyodemo](https://grafana.self-data.alpha.grandlyon.com/d/f9685577-861d-4d44-883f-a9651dee147e/ecolyodemo?orgId=1) for example
To connect a specific instance logs to Grafana:
- Click on configuration and data sources
- Add data sources
- Find Loki and type the loki url http://loki:3100
- In the query builder select the container "easy-cozy" then add |= "domain=[specific-instance]"
- Create a new dashboard
- Select `Loki` as the data source
- In the label filters select the `container_name` to be `cozy-stack-1`
- add a `line contains` filter and type `domain=[specific-instance]`
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment