# LDAPWeb aka profile.hackerspace.pl

## Configuration

No configuration is required to see and change your own profile and password.

To test admin pages, notifications, and avatars, you need to configure these environment variables:

- `LDAPWEB_ADMIN_DN` - LDAP user DN, e.g. `uid=radex,ou=people,dc=hackerspace,dc=pl`
- `LDAPWEB_ADMIN_PASSWORD` - password to the above LDAP user
- `LDAPWEB_SMTP_USER` - username with a `@hackerspace.pl` mailbox, e.g. `radex`
- `LDAPWEB_SMTP_PASSWORD` - password to the above mailbox
- `LDAPWEB_ADMIN_GROUPS` - comma-separated LDAP groups allowed to see admin pages (note that every user has a group with the same name), e.g. `radex,zarzad`
- `LDAPWEB_PAPERTRAIL_RECIPIENTS` - comma-separated email addresses that will get email alerts for changes done via admin UI

See `webapp/config.py` for more details.

(Note that you don't need to be an LDAP admin to be able to hack on this - you just won't see all attributes, and won't be able to change other people's profiles)

## Quick Start

```
poetry install
poetry run flask --app webapp run -p 5001 --debug
```

Open app at localhost:5001

To test changing password locally, you must add HACKERSPACE.PL realm to your /etc/krb5.conf. See krb5.conf for an example

## Quick Start (Dockerized)

```
docker build -t ldapweb .
docker run -p 8000:8000 ldapweb
```

Open app at localhost:8000

## Deployment

Build Docker imagine manually and bump https://code.hackerspace.pl/hswaw/hscloud/src/branch/master/hswaw/ldapweb/prod.jsonnet
