2021-06-25 16:18:38 +02:00
|
|
|
# meincantor-api
|
|
|
|
The API backend for the GCG.MeinCantor school platform built with Rocket.rs in Rust.
|
2022-04-16 20:35:06 +02:00
|
|
|
|
2022-08-28 17:13:43 +02:00
|
|
|
It includes a plugin for receiving data from Indiware Mobil and an OpenID Connect authentication extension.
|
2022-04-16 20:35:06 +02:00
|
|
|
|
|
|
|
See the repository of the [main application](https://git.cantorgymnasium.de/cantortechnik/meincantor-app) for additional information.
|
|
|
|
|
|
|
|
## Building
|
|
|
|
|
|
|
|
Dependencies:
|
|
|
|
- `openssl-devel`
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo build --release
|
|
|
|
```
|
|
|
|
|
|
|
|
## Deployment
|
|
|
|
|
|
|
|
### docker-compose
|
|
|
|
|
|
|
|
```
|
|
|
|
version: "3.1"
|
|
|
|
services:
|
|
|
|
api:
|
2022-08-28 17:13:43 +02:00
|
|
|
image: registry.cantorgymnasium.de/cantortechnik/meincantor-api
|
2022-04-16 20:35:06 +02:00
|
|
|
restart: always
|
|
|
|
ports:
|
|
|
|
- 8000:8000
|
|
|
|
environment:
|
2022-08-28 17:13:43 +02:00
|
|
|
IW_TIMETABLE: https://stundenplan24.de/EXAMPLE_SCHOOL/mobil/mobdaten
|
2022-04-16 20:35:06 +02:00
|
|
|
IW_TIMETABLE_USER: EXAMPLE_USER
|
|
|
|
IW_TIMETABLE_PASSWORD: EXAMPLE_PASSWORD
|
2022-08-28 17:13:43 +02:00
|
|
|
OIDC_USERINFO: https://keycloak.example.com/auth/realms/EXAMPLE_REALM/protocol/openid-connect/userinfo
|
2022-04-16 20:35:06 +02:00
|
|
|
volumes:
|
|
|
|
- ./static:/app/static
|
|
|
|
```
|
|
|
|
|
|
|
|
1. Create folder `mkdir meincantor-api`
|
|
|
|
2. Create `docker-compose.yml` file with the content above
|
|
|
|
3. Start with `docker-compose up -d`
|
|
|
|
|
|
|
|
|
|
|
|
### local
|
|
|
|
|
|
|
|
1. Edit `src/config.rs`
|
|
|
|
2. Rebuild the binary
|
|
|
|
3. Execute the binary with `./target/release/api`
|
|
|
|
|
|
|
|
## Licensing
|
|
|
|
|
|
|
|
```
|
|
|
|
Copyright (C) 2021-2022 Denys Konovalov
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
```
|