README.md 2.84 KB
Newer Older
Bengfort's avatar
README  
Bengfort committed
1
2
Castellum Scheduler -- an open source tool for scheduling appointments

Bengfort's avatar
Bengfort committed
3
4
5
6
Scheduler allows users to set up a set of timeslots and generate unique
invitation links. Each invited person can then pick a free slot without
needing to log in. In a way this is the opposite of doodle where
everyone agrees on the same time slot.
Bengfort's avatar
README  
Bengfort committed
7
8
9
10
11
12

Scheduler is part of the [Castellum][1] project, but can be used with
other tools just as well.

# Installation

13
14
## Development

Bengfort's avatar
README  
Bengfort committed
15
16
17
For development, a single `make` will install all dependencies and start
the server. You can log in as "admin" with password "password".

Bengfort's avatar
Bengfort committed
18
19
20
If you want to run the scheduler alongside castellum for development you
need to set the following settings in castellum:

Bengfort's avatar
Bengfort committed
21
```python
Bengfort's avatar
Bengfort committed
22
23
24
25
SCHEDULER_URL = 'http://localhost:8001'
SCHEDULER_TOKEN = 'CHANGEME'
```

26
27
28
29
30
31
32
33
## Production

There are many different ways to deploy a django application. Please see
the [django documentation][2] for details. A complete example is also
availabe in the [castellum documentation][3].

Most important steps:

34
35
-   Create a settings file and set the `DJANGO_SETTINGS_MODULE`
    environment variable accordingly
Bengfort's avatar
Bengfort committed
36
37
-   Provide values `SECRET_KEY` and `API_TOKEN` in the settings file you
    just created
38
39
-   Setup a database and add the relevant information to the settings
    file
Bengfort's avatar
Bengfort committed
40
41
42
-   Add links to the imprint and data protection information to `NAV`.
    You can either create them with an external CMS or by using [django
    flatpages][5].
43
44
-   Configure authentication, e.g. [LDAP][4]

Bengfort's avatar
Bengfort committed
45
# API
46
47
48

This system is designed so that castellum can remain in a secure
internal network and only the scheduler is accessible from the internet.
Bengfort's avatar
Bengfort committed
49
50
51
52
53
54
55
56
57
58
59
60
61

All API requests must send an `Authorization` header with the secret
token defined in `settings.API_TOKEN`.

You can use PUT/DELETE requests to create/delete invitations for a
schedule. PUT will always respond with 204. DELETE will respond with 404
if no matching invitation existed.

You can use a GET request to get the currently selected timeslot for an
invitation.

Example:

Bengfort's avatar
Bengfort committed
62
```sh
Bengfort's avatar
Bengfort committed
63
64
$ curl -X PUT -H 'Authorization: token CHANGEME' http://localhost:8001/api/26f4c524-4c74-4788-90c6-889dff86001d/foo/
$ curl -X GET -H 'Authorization: token CHANGEME' http://localhost:8001/api/26f4c524-4c74-4788-90c6-889dff86001d/foo/
Bengfort's avatar
Bengfort committed
65
{"datetime": "2020-11-03T07:00:00"}
Bengfort's avatar
Bengfort committed
66
67
$ curl -X GET -H 'Authorization: token CHANGEME' http://localhost:8001/api/26f4c524-4c74-4788-90c6-889dff86001d/
{"foo": "2020-11-03T07:00:00"}
Bengfort's avatar
Bengfort committed
68
$ curl -X DELETE -H 'Authorization: token CHANGEME' http://localhost:8001/api/26f4c524-4c74-4788-90c6-889dff86001d/foo/
Bengfort's avatar
Bengfort committed
69
```
Bengfort's avatar
Bengfort committed
70

Bengfort's avatar
README  
Bengfort committed
71
[1]: https://www.mpib-berlin.mpg.de/research-data/castellum
72
73
74
[2]: https://docs.djangoproject.com/en/stable/howto/deployment/
[3]: https://git.mpib-berlin.mpg.de/castellum/castellum/-/tree/main/docs/example_deployment
[4]: https://django-auth-ldap.readthedocs.io/en/latest/
Bengfort's avatar
Bengfort committed
75
[5]: https://docs.djangoproject.com/en/stable/ref/contrib/flatpages/