Compare commits

...
Sign in to create a new pull request.

17 commits
main ... main

Author SHA1 Message Date
3095f1726e Merge pull request 'Do not render a different view when user is found but password invalid' (#87) from fabientot/guichet:prevent-bruteforce-on-login-form into main
Reviewed-on: Deuxfleurs/guichet#87
2025-03-26 08:27:32 +00:00
b319421c1f Do not render a different view when user is found 2025-03-25 12:29:01 +01:00
48526f6aca Merge pull request 'Add a button to visit the website' (#85) from fabientot/guichet:add-visit-button-to-website into main
Reviewed-on: Deuxfleurs/guichet#85
2025-03-24 15:41:57 +00:00
492be02f59 Merge pull request 'Add instructions about how to run Guichet locally' (#81) from fabientot/guichet:improve-local-development into main
Reviewed-on: Deuxfleurs/guichet#81
2025-03-24 15:41:28 +00:00
4dfd072385 Merge pull request 'Add missing username in dxfl cli instructions' (#84) from fabientot/guichet:fix-missing-username-in-dxfl-cli-docs into main
Reviewed-on: Deuxfleurs/guichet#84
2025-03-24 14:12:19 +00:00
08b036b2fb Add a button to visit the website 2025-03-23 21:47:08 +01:00
c1fcc1bbba Add line breaks 2025-03-23 20:39:25 +01:00
97a0d1ed24 Add password example 2025-03-23 20:37:49 +01:00
56d78d4a1f Update comments 2025-03-23 20:35:12 +01:00
9fef8d855f Typo + link 2025-03-23 20:32:56 +01:00
a7180549ed Add garage in list 2025-03-23 20:31:25 +01:00
59b8ecf02f Add missing username in dxfl cli instructions 2025-03-23 20:21:40 +01:00
0d3457142e Update readme 2025-03-23 20:11:13 +01:00
f8a3714d8c Merge pull request 'Update new DNS endpoint on website's detail page' (#83) from tixie/guichet:update-dns-endpoint-wording into main
Reviewed-on: Deuxfleurs/guichet#83
2025-03-21 06:36:39 +00:00
791f6aa3b8
use global.site.deuxfleurs.fr in website inspector's footer 2025-03-21 05:04:03 +01:00
4f3b5d8210 Do not expose ports in consul 2025-03-20 23:29:05 +01:00
48df2123cf Improve developper experience
- Add docker compose
- Fix a few typo in README
- Add steps to run project locally
- Add a sample bottin config
2025-03-20 23:27:59 +01:00
4 changed files with 74 additions and 19 deletions

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`.
@ -143,3 +143,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.

View file

@ -237,8 +237,6 @@ func handleLogout(w http.ResponseWriter, r *http.Request) {
// --- Login Controller ---
type LoginFormData struct {
Username string
WrongUser bool
WrongPass bool
ErrorMessage string
}
@ -266,10 +264,9 @@ func handleLogin(w http.ResponseWriter, r *http.Request) {
data := &LoginFormData{
Username: username,
}
if ldap.IsErrorWithCode(err, ldap.LDAPResultInvalidCredentials) {
data.WrongPass = true
} else if ldap.IsErrorWithCode(err, ldap.LDAPResultNoSuchObject) {
data.WrongUser = true
if ldap.IsErrorWithCode(err, ldap.LDAPResultInvalidCredentials) ||
ldap.IsErrorWithCode(err, ldap.LDAPResultNoSuchObject) {
data.ErrorMessage = "Le mot de passe et identifiant ne correspondent pas."
} else {
data.ErrorMessage = err.Error()
}

View file

@ -42,7 +42,12 @@
</p>
</div>
<div class="col-md-9">
<h2>{{ .View.Name.Url }}</h2>
<div class="d-flex justify-content-between align-items-center">
<h2>{{ .View.Name.Url }}</h2>
<div>
<a href="https://{{ .View.Name.Url }}" target="_blank" rel="noreferrer external" class="btn btn-dark">Visiter</a>
</div>
</div>
<!-- QUOTAS -->
@ -94,7 +99,7 @@
<pre>
sudo npm install -g dxfl
dxfl login
dxfl login {{ .Describe.Username }}
</pre>
<p>Pour déployer votre site contenu dans le dossier <code>public</code> :</p>
@ -360,7 +365,7 @@ scp -oHostKeyAlgorithms=+ssh-rsa -P2222 -r ./public/ {{ .Describe.Username }}@sf
{{ if .View.Name.Expanded }}
<h5 class="mt-5">Vous ne savez pas comment configurer votre nom de domaine ?</h5>
<p> Le nom de domaine {{ .View.Name.Url }} n'est pas géré par Deuxfleurs, il vous revient donc de configurer la zone DNS. Vous devez ajouter une entrée <code>CNAME garage.deuxfleurs.fr</code> ou <code>ALIAS garage.deuxfleurs.fr</code> auprès de votre hébergeur DNS, qui est souvent aussi le bureau d'enregistrement (eg. Gandi, GoDaddy, BookMyName, etc.).</p>
<p> Le nom de domaine {{ .View.Name.Url }} n'est pas géré par Deuxfleurs, il vous revient donc de configurer la zone DNS. Vous devez ajouter une entrée <code>CNAME global.site.deuxfleurs.fr</code> ou <code>ALIAS global.site.deuxfleurs.fr</code> auprès de votre hébergeur DNS, qui est souvent aussi le bureau d'enregistrement (eg. Gandi, GoDaddy, BookMyName, etc.).</p>
{{ end }}

View file

@ -4,15 +4,9 @@
<h4>S'identifier</h4>
<form method="POST">
{{if .WrongUser}}
<div class="alert alert-danger">Identifiant invalide.</div>
{{end}}
{{if .WrongPass}}
<div class="alert alert-danger">Mot de passe invalide.</div>
{{end}}
{{if .ErrorMessage}}
{{ with .ErrorMessage}}
<div class="alert alert-danger">Impossible de se connecter.
<div style="font-size: 0.8em">{{ .ErrorMessage }}</div>
<div style="font-size: 0.8em">{{ . }}</div>
</div>
{{end}}
<div class="form-group">