Newer
Older
# Environments
We have 2 environments available for this project:
- A **prod** environment hosted on Cozy and managed by Cozy
- A **dev** environment hosted on scaleway and managed by the dev team
## Dev environment aka alpha
You need to install an ssh tool like Putty or [MobaXterm](https://mobaxterm.mobatek.net/download.html) in order to connect to the server.
Connection to the server is made using ssh key, you need to generate your own and ask administrator to allow your ssh key.
Once done, you should be able to connect to the server using your private key.
To connect to the database from your local computer, you need to create an SSH tunnel and forward ports to your local machine :
```console
ssh root@51.158.104.84 -L 8082:localhost:5984
```
Then you can browse to [http://localhost:8082/\_utils/](http://localhost:8082/_utils/) and enter the credentials specified in the file `easy-cozy/docker-compose.yml`
#### Access data from an instance
The DB contains tables for each instance. They all are prefixed with a hash. To see instances hashes, search for `global/instances` you will find documents containing `domains` & `prefix`.
The **prefix** will allow you to search for specific tables among the instances.
:::note Example
`cozyc5eac7b18cb26075ac6aa8233748dfd2/com-grandlyon-ecolyo-profile`
:::
It is based on the easy-cozy project available on [Gitlab](https://forge.grandlyon.com/pocs/cozy/easy-cozy)
On the server, the .env file has been initialize with the good secrets (see the .env.template) and also initialize to create instance with Ecolyo and the 3 needed konnectors by default.
- the cozy stack
- the couch db
To run the project please refer to the documentation on the Gitlab project.
Once the project is up and running, we are able to create, update and delete instances.
Let's see more details in the [dedicated section](/docs/easycozy/scripts.md).
Konnector for Ecolyo need proxy for the Oauth dance. The proxy is also mounted on the same instance as the Cozy stack and based on the project available on Gitlab: https://forge.grandlyon.com/pocs/cozy/cozy-oauth-proxy
The proxy is written in Go language. The "main.go" file contains all the source code and also the default variables.
Default variables are the one used for the dev environment but we will overwrite them for the production.
To Launch the proxy, just pull the project and use the docker-compose file with following commands:
git pull https://forge.grandlyon.com/pocs/cozy/cozy-oauth-proxy
cd cozy-oauth-proxy
docker-compose up -d
```
### Ecolyo and konnectors
By default the version present on the "build-dev" branch is used to install Ecolyo app and konnectors on a new instance.
Some scripts has been created in order to install, update, downgrade, remove app and konnectors. Please refer to the [dedicated section](/docs/easycozy/scripts.md) for more information.
## Prod environment
This environment is fully managed by Cozy team.
### Cozy stack
Fully managed by Cozy team.
### Proxy
A dedicated proxy is deployed on Cozy side to allow konnector to make the Oauth dance.
The proxy deployed is based on the project available on the Gitlab but variables are overwritten using flags by the Cozy team in order to fit to the environment.
For each modification in production, it needs:
After that we should ask Cozy to pull the modification from the Gitlab in order to have them in production.
### Ecolyo and konnectors
The production environment is based on the build branch which should reflect the build of sources present on master branch.
Each deployment is done manually for each app/konnector by:
- building the application (yarn build)
- deploy the build on the build branch (yarn deploy)
- publishing content of build branch into Cozy repository (yarn cozyPublish)
Once it is published, Cozy team should validate it before deploying the new app version into all Cozy Grand Lyon instances.