Verified Commit 0a4909d5 authored by Jakob Moser's avatar Jakob Moser
Browse files

Rename file to LDAP

parent 99311fdb
Loading
Loading
Loading
Loading
Loading

docs/backend.md

deleted100644 → 0
+0 −84
Original line number Diff line number Diff line

# If you are a contributor...

> ⚡ **This project now uses [`uv`](https://github.com/astral-sh/uv) for dependency management.**  
> Install `uv` once using [`pipx`](https://pypa.github.io/pipx/):

```bash
pip install pipx
pipx install uv
```

## I want to setup portal on my local machine!

First you gotta clone this repository.
We advise you to do this with Gitlabs VS Code integration, but you can also use the terminal.

```sh
git clone https://gitlab.cl.uni-heidelberg.de/Fachschaft/portal.git
```

Then you have two options:

### ...with docker

To run a flask shell inside the container:

```sh
sudo docker exec -it portal-app-1 flask shell
```

### ...without docker

Make sure you are in the `portal` directory

```bash
# mkdir yourself into the portal directory

# Technically optional: create a virtual environment manually
uv venv .venv
source .venv/bin/activate

uv pip sync
export FLASK_APP=portal
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
uv pip sync --dev
mkdir -p instance
touch instance/portal.db
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.

---

#### 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.

---

docs/ldap.md

0 → 100644
+10 −0
Original line number Diff line number Diff line
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

```

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.