From 48df2123cfba93b684832078d52d4813045eee35 Mon Sep 17 00:00:00 2001 From: Fabien Le Frapper Date: Thu, 20 Mar 2025 23:24:03 +0100 Subject: [PATCH] Improve developper experience - Add docker compose - Fix a few typo in README - Add steps to run project locally - Add a sample bottin config --- README.md | 26 ++++++++++++++++++++++++-- bottin.config.json | 13 +++++++++++++ docker-compose.yml | 24 ++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 bottin.config.json create mode 100644 docker-compose.yml diff --git a/README.md b/README.md index 483ea71..d8ddaef 100644 --- a/README.md +++ b/README.md @@ -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,25 @@ 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 + +Guichet needs a few components to work : +- A Bottin server +- that needs a consul server +A basic consul / bottin stack is available through the docker compose file + +``` +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 diff --git a/bottin.config.json b/bottin.config.json new file mode 100644 index 0000000..2592f8f --- /dev/null +++ b/bottin.config.json @@ -0,0 +1,13 @@ +{ + "suffix": "dc=bottin,dc=eu", + "bind": "127.0.0.1:1389", + "consul_host": "consul:8500", + "acl": [ + "ANONYMOUS::bind:*,ou=users,dc=bottin,dc=eu:", + "ANONYMOUS::bind:cn=admin,dc=bottin,dc=eu:", + "*,dc=bottin,dc=eu::read:*:* !userpassword", + "*::read modify:SELF:*", + "cn=admin,dc=bottin,dc=eu::read add modify delete:*:*", + "*:cn=admin,ou=groups,dc=bottin,dc=eu:read add modify delete:*:*" + ] +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..45675f2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +services: + bottin: + image: lxpz/bottin_amd64 + platform: linux/amd64 + entrypoint: /bottin -config /config.json + depends_on: + consul: + condition: service_healthy + restart: true + ports: + - 389:389 + volumes: + - ./bottin.config.json:/config.json + consul: + image: consul:1.15 + command: agent -server -ui -node=server-1 -bootstrap-expect=1 -client=0.0.0.0 + healthcheck: + test: curl --fail http://localhost:8500/ui || exit 1 + interval: 10s + retries: 5 + start_period: 10s + timeout: 10s + ports: + - "8500:8500"