mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-11-25 21:28:33 +00:00
Fix formatting issues
This commit is contained in:
@@ -28,9 +28,9 @@ exists for your ngrok application ([See the CODE documentation: ](https://sdk.co
|
||||
|
||||
##### Configure your app
|
||||
|
||||
Set the [EDITOR_SERVER` variable to point to your collabora server, this should be done in your `.env.local` file.
|
||||
Set the `EDITOR_SERVER` variable to point to your collabora server, this should be done in your `.env.local` file.
|
||||
|
||||
At this point, everything must be fine. In case of errors, watch the log from your collabora server, use the `profiler ](https://symfony.com/doc/current/profiler.html)
|
||||
At this point, everything must be fine. In case of errors, watch the log from your collabora server, use the [profiler](https://symfony.com/doc/current/profiler.html)
|
||||
to debug the requests.
|
||||
|
||||
In case of error while validating proof (you'll see those messages in the collabora's logs), you can temporarily disable
|
||||
@@ -61,16 +61,18 @@ Ensure that the proxy is running.
|
||||
|
||||
##### Create a certificate database for collabora
|
||||
|
||||
Collabora must validate your certificate generated by the symfony console. For that, you need `to create a NSS database <https://sdk.collaboraonline.com/docs/installation/Configuration.html#validating-digital-signatures>`
|
||||
Collabora must validate your certificate generated by the symfony console. For that, you need [to create a NSS database](https://sdk.collaboraonline.com/docs/installation/Configuration.html#validating-digital-signatures)
|
||||
and configure collabora to use it.
|
||||
|
||||
At first, export the certificate for symfony development. Use the graphical interface from your browser to get the
|
||||
certificate as a PEM file.
|
||||
|
||||
```bash
|
||||
# create your database in a custom directory
|
||||
`mkdir /path/to/your/directory`
|
||||
`certutil -N -d /path/to/your/directory`
|
||||
`cat /path/to/your/ca.crt | certutil -d . -A symfony -t -t C,P,C,u,w -a`
|
||||
```
|
||||
|
||||
Launch CODE properly configured
|
||||
|
||||
|
||||
@@ -4,64 +4,76 @@
|
||||
|
||||
You will need:
|
||||
|
||||
- [Composer ](https://getcomposer.org)_;
|
||||
- [Symfony-cli tool ](https://symfony.com/download)_;
|
||||
- [docker ](https://docs.docker.com/engine/install/)_ and
|
||||
[docker-compose ](https://docs.docker.com/compose/)_
|
||||
- [Composer ](https://getcomposer.org);
|
||||
- [Symfony-cli tool ](https://symfony.com/download);
|
||||
- [docker ](https://docs.docker.com/engine/install/) and [docker-compose ](https://docs.docker.com/compose/)
|
||||
- node > 20 and yarn 1.22
|
||||
|
||||
### First initialization
|
||||
|
||||
1. clone the repository and move to the cloned directory:
|
||||
|
||||
git clone https://gitlab.com/Chill-Projet/chill-bundles.git
|
||||
cd chill-bundles
|
||||
```bash
|
||||
git clone https://gitlab.com/Chill-Projet/chill-bundles.git
|
||||
cd chill-bundles
|
||||
```
|
||||
|
||||
2. install dependencies using composer
|
||||
|
||||
composer install
|
||||
```bash
|
||||
composer install
|
||||
```
|
||||
|
||||
3. Install and compile assets:
|
||||
|
||||
yarn install
|
||||
yarn run encore production
|
||||
```bash
|
||||
yarn install
|
||||
yarn run encore production
|
||||
```
|
||||
|
||||
**note** double-check that you have the node version > 20 using the
|
||||
``node --version`` command.
|
||||
**note** double-check that you have the node version > 20 using the `node --version` command.
|
||||
|
||||
1. configure your project: create a ``.env.local`` file at the root, and
|
||||
add the admin password:
|
||||
4. Configure your project: create a `.env.local` file at the root, and add the admin password:
|
||||
|
||||
# for this installation mode, the environment should always be "dev"
|
||||
APP_ENV=dev
|
||||
ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm
|
||||
# note: if you copy-paste the line above, the password will be "admin".
|
||||
**note** for this installation mode, the environment should always be "dev"
|
||||
```
|
||||
APP_ENV=dev
|
||||
ADMIN_PASSWORD=\$2y\$13\$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm
|
||||
```
|
||||
**note**: if you copy-paste the line above, the password will be "admin".
|
||||
|
||||
2. start the stack using ``docker compose up -d``, check the status of
|
||||
the start with ``docker compose ps``
|
||||
5. Start the stack using `docker compose up -d`, check the status of the start with `docker compose ps`
|
||||
|
||||
3. configure all the necessary third-party tools
|
||||
6. Configure all the necessary third-party tools. On the first start, it may last a bit longer. You can always check with `docker compose ps`
|
||||
|
||||
` # the first start, it may last some seconds, you can check with docker compose ps
|
||||
# run migrations
|
||||
symfony console doctrine:migrations:migrate
|
||||
# setup messenger
|
||||
symfony console messenger:setup-transports
|
||||
# prepare some views
|
||||
symfony console chill:db:sync-views
|
||||
# generate jwt token, required for some api features (webdav access, ...)
|
||||
symfony console lexik:jwt:generate-keypair`
|
||||
```bash
|
||||
# Run migrations
|
||||
symfony console doctrine:migrations:migrate
|
||||
|
||||
4. add some fixtures
|
||||
# Setup messenger
|
||||
symfony console messenger:setup-transports
|
||||
|
||||
This will truncate all the existing data of the database. But remember,
|
||||
we are in dev mode!
|
||||
# Prepare some views
|
||||
symfony console chill:db:sync-views
|
||||
|
||||
symfony console doctrine:fixtures:load
|
||||
# Generate jwt token, required for some api features (webdav access, ...)
|
||||
symfony console lexik:jwt:generate-keypair
|
||||
```
|
||||
|
||||
5. launch symfony dev-server
|
||||
7. Add some fixtures
|
||||
|
||||
`symfony server:start -d`
|
||||
This will truncate all the existing data of the database. But remember,
|
||||
we are in dev mode!
|
||||
|
||||
```bash
|
||||
symfony console doctrine:fixtures:load
|
||||
```
|
||||
|
||||
8. launch symfony dev-server
|
||||
|
||||
```bash
|
||||
symfony server:start -d
|
||||
```
|
||||
|
||||
And visit the web page it suggests. You can log in with user
|
||||
`center a_social` and password `password`, or login `admin` with
|
||||
|
||||
@@ -19,40 +19,44 @@ Symfony apps ](https://symfony.com/doc/current/deployment.html).
|
||||
- `docker` with the plugin `compose`: https://docs.docker.com/engine/install/ and https://docs.docker.com/compose/install/
|
||||
|
||||
### Initialize the project and it's dependencies
|
||||
|
||||
```bash
|
||||
symfony new --version=5.4 my_chill_project
|
||||
cd my_chill_project
|
||||
```
|
||||
|
||||
We strongly encourage you to initialize a git repository at this step, to track further changes.
|
||||
|
||||
```bash
|
||||
# add the flex endpoints required for custom recipes
|
||||
`cat <<< "$(jq '.extra.symfony += {"endpoint": ["flex://defaults", "https://gitlab.com/api/v4/projects/57371968/repository/files/index.json/raw?ref=main"]}' composer.json)" > composer.json`
|
||||
# install chill and some dependencies
|
||||
`symfony composer require -W chill-project/chill-bundles ^3.7.1 champs-libres/wopi-lib dev-master@dev champs-libres/wopi-bundle dev-master@dev symfony/amqp-messenger`
|
||||
```
|
||||
|
||||
We encourage you to accept the inclusion of the "Docker configuration from recipes": this is the documented way to run the database.
|
||||
You must also accept to configure recipes from the contrib repository, unless you want to configure the bundles manually).
|
||||
|
||||
` # fix some configuration
|
||||
```bash
|
||||
# fix some configuration
|
||||
./post-install-chill.sh
|
||||
# populate the cache for the first time. This is necessary to dump some translation files, required for the asset compilation
|
||||
symfony console cache:clear
|
||||
# install node dependencies
|
||||
yarn install
|
||||
# and compile assets
|
||||
yarn run encore production`
|
||||
yarn run encore production
|
||||
```
|
||||
|
||||
If you encounter this error during asset compilation ([yarn run encore production`) (repeated multiple times):
|
||||
|
||||
```bash
|
||||
[tsl] ERROR in /tmp/chill/v1/public/bundles/chillcalendar/types.ts(2,65)
|
||||
TS2307: Cannot find module '../../../ChillMainBundle/Resources/public/types' or its corresponding type declarations.
|
||||
```bash
|
||||
[tsl] ERROR in /tmp/chill/v1/public/bundles/chillcalendar/types.ts(2,65)
|
||||
TS2307: Cannot find module '../../../ChillMainBundle/Resources/public/types' or its corresponding type declarations.
|
||||
```
|
||||
|
||||
run:
|
||||
|
||||
```bash
|
||||
rm -rf public/bundles/*
|
||||
```bash
|
||||
rm -rf public/bundles/*
|
||||
```
|
||||
|
||||
Then restart the compilation of assets (```yarn run encore production```)
|
||||
@@ -76,8 +80,10 @@ The required variables are:
|
||||
|
||||
##### `ADMIN_PASSWORD`
|
||||
|
||||
You can generate a hashed and salted admin password using the command: `symfony console security:hash-password <your password> 'Symfony\Component\Security\Core\User\User'[.Then,
|
||||
you can either:
|
||||
You can generate a hashed and salted admin password using the command:
|
||||
`symfony console security:hash-password <your password> 'Symfony\Component\Security\Core\User\User'`
|
||||
|
||||
Then, you can either:
|
||||
|
||||
- add this password to the `.env.local` file, you must escape the character `$`: if the generated password
|
||||
is `$2y$13$iyvJLuT4YEa6iWXyQV4/N.hNHpNG8kXlYDkkt5MkYy4FXcSwYAwmm`, your `.env.local` file will be:
|
||||
@@ -98,14 +104,15 @@ You can set it to `null://null` if you do not plan to use sending SMS.
|
||||
|
||||
OVHCLOUD_DSN=null://null
|
||||
|
||||
If you plan to do it, you can configure the notifier component `as described in the symfony documentation ](https://symfony.com/doc/current/notifier.html#notifier-sms-channel).
|
||||
If you plan to do it, you can configure the notifier component `as described in the [symfony documentation](https://symfony.com/doc/current/notifier.html#notifier-sms-channel).
|
||||
|
||||
Some environment variables are available for the JWT authentication bundle in the [.env` file.
|
||||
Some environment variables are available for the JWT authentication bundle in the `.env` file.
|
||||
|
||||
### Prepare database, messenger queue, and other configuration
|
||||
|
||||
To continue the installation process, you will have to run migrations:
|
||||
|
||||
```bash
|
||||
# start databases and other services
|
||||
docker compose up -d
|
||||
# the first start, it may last some seconds, you can check with docker compose ps
|
||||
@@ -119,12 +126,13 @@ To continue the installation process, you will have to run migrations:
|
||||
symfony console chill:main:languages:populate
|
||||
# generate jwt token, required for some api features (webdav access, ...)
|
||||
symfony console lexik:jwt:generate-keypair
|
||||
```
|
||||
|
||||
If you encounter this error:
|
||||
|
||||
```
|
||||
No transport supports the given Messenger DSN.
|
||||
```
|
||||
```
|
||||
No transport supports the given Messenger DSN.
|
||||
```
|
||||
|
||||
Please check that you installed the package `symfony/amqp-messenger`.
|
||||
|
||||
@@ -133,14 +141,16 @@ To continue the installation process, you will have to run migrations:
|
||||
At this step, Chill will be ready to be served locally, but without any configuration. You can run the project
|
||||
locally using the `local symfony server ](https://symfony.com/doc/current/setup/symfony_server.html):
|
||||
|
||||
```bash
|
||||
# see the whole possibilities at https://symfony.com/doc/current/setup/symfony_server.html
|
||||
symfony server:start -d
|
||||
```
|
||||
|
||||
If you need to test the instance with accounts and some basic configuration, please install the fixtures (see below).
|
||||
|
||||
## Add capabilities for dev
|
||||
|
||||
If you need to add custom bundles, you can develop them in the [src/` directory, like for any other symfony project. You
|
||||
If you need to add custom bundles, you can develop them in the `src/` directory, like for any other symfony project. You
|
||||
can rely on the whole chill framework, meaning there is no need to add them to the original `chill-bundles`.
|
||||
|
||||
You will require some bundles to have the following development tools:
|
||||
@@ -150,23 +160,28 @@ You will require some bundles to have the following development tools:
|
||||
|
||||
### Install fixtures
|
||||
|
||||
```bash
|
||||
# generate fixtures for chill
|
||||
symfony composer require --dev doctrine/doctrine-fixtures-bundle nelmio/alice
|
||||
# now, you can generate fixtures (this will reset your database)
|
||||
symfony console doctrine:fixtures:load
|
||||
```
|
||||
|
||||
This will generate user accounts, centers, and some basic configuration.
|
||||
|
||||
The accounts created are: `center a_social`, `center b_social`, `center a_direction`, ... The full list is
|
||||
visible in the "users" table: `docker compose exec database psql -U app -c "SELECT username FROM users"`.
|
||||
The accounts created are: `center a_social`, `center b_social`, `center a_direction`, ...
|
||||
|
||||
The full list is visible in the "users" table: `docker compose exec database psql -U app -c "SELECT username FROM users"`.
|
||||
|
||||
The password is always `password`.
|
||||
|
||||
The fixtures are not fully functional. See the `corresponding issue ](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/280).
|
||||
The fixtures are not fully functional. See the `corresponding issue ](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/280).
|
||||
|
||||
### Add web profiler and debugger
|
||||
|
||||
```bash
|
||||
symfony composer require --dev symfony/web-profiler-bundle symfony/debug-bundle
|
||||
```
|
||||
|
||||
### Working on chill bundles
|
||||
|
||||
@@ -179,6 +194,7 @@ You will have to download chill-bundles as a git repository (and not as an archi
|
||||
|
||||
In your `composer.json` file, add these lines:
|
||||
|
||||
```bash
|
||||
{
|
||||
"config": {
|
||||
+ "preferred-install": {
|
||||
@@ -186,6 +202,7 @@ In your `composer.json` file, add these lines:
|
||||
"*": "dist"
|
||||
+ }
|
||||
}
|
||||
```
|
||||
|
||||
Then, run `symfony composer reinstall chill-project/chill-bundles` to re-install the package from source.
|
||||
|
||||
@@ -199,8 +216,10 @@ In order to update your app, you must update dependencies:
|
||||
|
||||
After each update, you must update your database schema:
|
||||
|
||||
```bash
|
||||
symfony console doctrine:migrations:migrate
|
||||
symfony console chill:db:sync-views
|
||||
```
|
||||
|
||||
## Commit and share your project
|
||||
|
||||
@@ -220,25 +239,29 @@ When another developer clones your project, they will have to:
|
||||
|
||||
run those commands:
|
||||
|
||||
` # for production (or in dev, when you don't need to work on your assets and need some speed)
|
||||
```bash
|
||||
# for production (or in dev, when you don't need to work on your assets and need some speed)
|
||||
yarn run encore production
|
||||
# in dev, when you want to reload the assets on each changes
|
||||
yarn run encore dev --watch`
|
||||
```
|
||||
|
||||
### How to execute the console ?
|
||||
|
||||
` # start the console with all required variables
|
||||
```bash
|
||||
# start the console with all required variables
|
||||
symfony console
|
||||
# you can add your command after that:
|
||||
symfony console list`
|
||||
symfony console list
|
||||
```
|
||||
|
||||
### How to generate documents
|
||||
|
||||
Documents are generated asynchronously by `"consuming messages" ](https://symfony.com/doc/current/messenger.html#consuming-messages-running-the-worker).
|
||||
Documents are generated asynchronously by [consuming messages](https://symfony.com/doc/current/messenger.html#consuming-messages-running-the-worker).
|
||||
|
||||
You must generate them using a dedicated process:
|
||||
|
||||
symfony console messenger:consume async priority
|
||||
`symfony console messenger:consume async priority`
|
||||
|
||||
To avoid memory issues, we encourage you to also use the `--limit` parameter of the command.
|
||||
|
||||
|
||||
@@ -25,7 +25,11 @@ Go to the "Single sign-on" ("Authentication unique") section. Choose "SAML" as a
|
||||
2. The url response must be your Chill's URL appended by `/saml/acs`
|
||||
3. The only used attributes is `emailaddress`, which must match the user's email one.
|
||||
|
||||
You must download the certificate, as base64. The format for the download is `cer`: you will remove the first and last line (the ones with `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`), and remove all the return line. The final result should be something as `MIIAbcdef...XyZA=`.
|
||||
You must download the certificate, as base64. The format for the download is `cer`: you will remove the first and last line
|
||||
|
||||
(the ones with `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`),
|
||||
|
||||
and remove all the return line. The final result should be something as `MIIAbcdef...XyZA=`.
|
||||
|
||||
This certificat will be your `SAML_IDP_X509_CERT` variable.
|
||||
|
||||
@@ -35,10 +39,12 @@ Remember to provider user's access to your app, using the "Utilisateurs et group
|
||||
|
||||
You must now have gathered all the required variables for SSO:
|
||||
|
||||
```bash
|
||||
SAML_BASE_URL=https://test.chill.be # must be
|
||||
SAML_ENTITY_ID=https://test.chill.be # must match the one entered
|
||||
SAML_IDP_APP_UUID=42XXXXXX-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
SAML_IDP_X509_CERT: MIIC...E8u3bk # truncated
|
||||
```
|
||||
|
||||
###### Configure chill app
|
||||
|
||||
@@ -212,21 +218,20 @@ The sync daemon must have write access:
|
||||
|
||||
At this step, you might choose to accept those permissions for all users or let them do it by yourself.
|
||||
|
||||
Grab your client id:
|
||||
|
||||
This will be your `OAUTH_AZURE_CLIENT_ID` variable.
|
||||
Grab your client id: This will be your `OAUTH_AZURE_CLIENT_ID` variable.
|
||||
|
||||
Generate a secret:
|
||||
|
||||
This will be your `OAUTH_AZURE_CLIENT_SECRET` variable.
|
||||
Generate a secret: This will be your `OAUTH_AZURE_CLIENT_SECRET` variable.
|
||||
|
||||
And get you azure's tenant id, which is the same as the `SAML_IDP_APP_UUID` (see above).
|
||||
|
||||
Your variables will be:
|
||||
|
||||
```bash
|
||||
OAUTH_AZURE_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
OAUTH_AZURE_CLIENT_TENANT=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
OAUTH_AZURE_CLIENT_SECRET: 3-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
Then, configure chill:
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@ To configure this, add this config variable in your environment:
|
||||
SHORT_MESSAGE_DSN=ovh://applicationKey:applicationSecret@endpoint?consumerKey=xxxx&sender=yyyy&service_name=zzzz
|
||||
```
|
||||
|
||||
To generate the application key, secret, and consumerKey, refers to their `documentation ](https://docs.ovh.com/gb/en/api/first-steps-with-ovh-api/).
|
||||
To generate the application key, secret, and consumerKey, refers to their [documentation ](https://docs.ovh.com/gb/en/api/first-steps-with-ovh-api/).
|
||||
|
||||
Before to be able to send your first sms, you must enable your account, grab some credits, and configure a sender. The service_name is an internal configuration generated by OVH.
|
||||
|
||||
Reference in New Issue
Block a user