Add instructions about how to run Guichet locally #81

Merged
quentin merged 8 commits from fabientot/guichet:improve-local-development into main 2025-03-24 15:41:29 +00:00

View file

@ -8,10 +8,10 @@ Guichet is a simple LDAP web interface for the following tasks:
- administration of the LDAP directory
- inviting new users to create accounts
Guichet works well with the [Bottin](https://bottin.eu) LDAP server.
Guichet works well with the [Bottin](https://git.deuxfleurs.fr/deuxfleurs/bottin) LDAP server.
Currently, Guichet's templates are only in French as it has been created for
the [Deuxfleurs](https://deuxfleurs.fr) collective.
We would gladly merge a pull request with an English transaltion !
We would gladly merge a pull request with an English translation !
A Docker image is provided on the [Docker hub](https://hub.docker.com/r/lxpz/guichet_amd64).
An example for running Guichet on a Nomad cluster can be found in `guichet.hcl.example`.
@ -129,3 +129,62 @@ Here is an example of Bottin ACLs that may be used to support Guichet invitation
Consult [this directory](https://git.deuxfleurs.fr/Deuxfleurs/infrastructure/src/branch/main/app/directory/config)
to view the full configuration in use on Deuxfleurs.
## Contribute & local development
Guichet needs a few components to work :
- A Bottin server
- that needs a consul server
- And a Garage cluster (of at least one node)
A basic consul / bottin stack is available through the docker compose file you can find in `integration` subdirectory:
```sh
cd integration
docker compose up -d
```
You can then run Guichet locally :
```sh
# First, copy a sample config file
copy config.json.example config.json
# Run the go development server
go run .
```
It will be available on http://localhost:9991.
### First run
#### How to get my admin password
On first Bottin's run, it is displayed in the logs.
You can easily find it by reading the container logs :
```sh
docker compose logs bottin | grep password:
```
- The **username** is provided in the log, and should look like this: `cn=admin,dc=bottin,dc=eu`.
- The **password** is right after in the same log line.
#### Garage
⚠️ Be aware at this stage that your local Guichet installation is not 100% working, especially the websites features.
You need to initialise Garage. It can be done in a few commands, coming from [the official Garage's documentation](https://garagehq.deuxfleurs.fr/documentation/quick-start/):
```sh
# Find your Garage node ID
docker compose exec garage /garage
# Your id is eb820c8da5605f78 in the output below
ID Hostname Address Tags Zone Capacity DataAvail
eb820c8da5605f78 9bd710b31be0 127.0.0.1:3901 NO ROLE ASSIGNED
# Then create a cluster layout with this id
docker compose exec garage /garage layout assign -z dc1 -c 1G eb820c8da5605f78
# Finally, apply the layout
docker compose exec garage /garage layout apply
```
🎉 You now can go to http://localhost:9991/website without getting 503 errors.