canaille-globuzma/README.md

71 lines
2.2 KiB
Markdown
Raw Normal View History

2020-11-05 11:18:17 +00:00
<div align="center">
<img src="canaille/static/img/canaille-full.png" height="200" alt="Canaille" />
</div>
2020-08-31 12:10:32 +00:00
2020-11-05 11:18:17 +00:00
**Canaille** is a French word meaning *rascal*. It is roughly pronounced **Can I?**,
2020-10-23 12:42:08 +00:00
as in *Can I access your data?* Canaille is a simple OpenID Connect provider based upon a LDAP database.
2020-08-14 11:21:01 +00:00
2020-08-19 12:13:10 +00:00
It aims to be very light, simple to install and simple to maintain. Its main features are :
2020-08-27 14:08:26 +00:00
- Authentication against a LDAP directory;
2020-10-23 12:17:50 +00:00
- OAuth/OpenID Connect support;
- No outdated or exotic protocol support;
- No additional database required. Everything is stored in your LDAP server;
- The code is easy to read and easy to edit.
2020-08-18 15:39:34 +00:00
2020-08-19 12:01:33 +00:00
## Install
2020-11-05 11:18:17 +00:00
⚠ Canaille is under heavy development and may not fit a production environment yet. ⚠
2020-08-19 12:02:08 +00:00
First you need to install the schemas into your LDAP server. There are several ways to achieve this:
2020-08-19 12:01:33 +00:00
2020-08-31 11:57:04 +00:00
### LDAP schemas
2020-10-23 10:50:51 +00:00
As of OpenLDAP 2.4, two configuration methods are available:
- The [deprecated](https://www.openldap.org/doc/admin24/slapdconf2.html) one, based on a configuration file (generally `/etc/ldap/slapd.conf`);
- The new one, based on a configuration directory (generally `/etc/ldap/slapd.d`).
2020-10-23 10:52:39 +00:00
Depending on the configuration method you use with your OpenLDAP installation, you need to chose how to add the canaille schemas:
2020-10-23 10:50:51 +00:00
#### Old fashion: Copy the schemas in your filesystem
2020-08-19 12:01:33 +00:00
```bash
2020-08-26 10:05:35 +00:00
test -d /etc/openldap/schema && sudo cp schema/* /etc/openldap/schema
test -d /etc/ldap/schema && sudo cp schema/* /etc/ldap/schema
2020-08-19 12:01:33 +00:00
sudo service slapd restart
```
2020-10-23 10:50:51 +00:00
#### New fashion: Use slapadd to add the schemas
2020-08-19 12:01:33 +00:00
```bash
sudo slapadd -n0 -l schema/*.ldif
2020-10-23 10:50:51 +00:00
sudo service slapd restart
2020-08-19 12:01:33 +00:00
```
2020-08-31 11:57:04 +00:00
### Web interface
2020-08-31 09:23:50 +00:00
Then you can deploy the code either by copying the git repository or installing the pip package:
```bash
2020-10-21 12:04:40 +00:00
pip install canaille
2020-08-31 09:23:50 +00:00
```
Finally you have to run the website in a WSGI server:
```bash
pip install gunicorn
2020-10-21 12:04:40 +00:00
gunicorn "canaille:create_app()"
2020-08-31 09:23:50 +00:00
```
2020-08-19 12:01:33 +00:00
## Recurrent jobs
You might want to clean up your database to avoid it growing too much. You can regularly delete
expired tokens and authorization codes with:
```
2020-10-23 10:27:50 +00:00
env CONFIG=/path/to/config.toml FASK_APP=canaille flask clean
```
2020-11-05 16:51:59 +00:00
# Contribute
2020-08-18 15:39:34 +00:00
2020-11-05 16:51:59 +00:00
Want to contribute? Take a look on [CONTRIBUTING.md](CONTRIBUTING.md).