diff --git a/README.md b/README.md index f39dc3add334bab9a948c4f9444151e0da9b0e07..a19b6180a4959748c08cbf21a9ac9f01f735337c 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,36 @@ alembic upgrade head # to create (and update!) the database flask run ``` +Also, you have to set up the LDAP server in Flask. At the moment we are required to use a VPN or `lennonproxy` to access the LDAP server. The following command forwards the LDAP server to your local machine: + +```sh +sudo ssh -D <your_forwarded_port> -p 80 <username>@lennon.cl.uni-heidelberg.de -L 636:ldap2:636 +python3 -m venv venv +source venv/bin/activate +pip install -r requirements.txt +export FLASK_APP=portal +alembic upgrade head # to create (and update!) the database +flask run +flask shell +``` + +```python +>>> from portal.model import * +>>> from portal import db +>>> l = ldapDirectory() +l = LdapDirectory() +l.url = "ldaps://ldap2.cl.uni-heidelberg.de" +l.base_dn= "ou=accounts,dc=cl,dc=uni-heidelberg,dc=de" +db.session.add(l) +db.session.commit() +exit() +``` +The app should run without problems now. + +Also, if you are using an Apple device, please deactivate the "AirPlay Receiver" as it might cause problems with the LDAP connection. + --- -#### Wichtig: +#### Important: Alembic must always be up to date in order to update the database schema. Please run `alembic upgrade head` after pulling changes from the repository.