You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `centralwebhook` binary is small ~15MB and only consumes
27
-
~5MB of memory when running.
28
-
29
-
> [!NOTE]
30
-
> There is a 8000 byte Postgres limit for the submission XML that can be sent
31
-
> until [this issue](https://github.com/hotosm/central-webhook/issues/9)
32
-
> is addressed.
33
-
>
34
-
> The submission XML will simply be truncated in this case.
26
+
The `centralwebhook` tool is a simple CLI that installs or uninstalls database triggers. Once installed, the triggers use the `pgsql-http` extension to send HTTP requests directly from the database.
35
27
36
28
## Prerequisites
37
29
38
-
- ODK Central running, connecting to an accessible Postgresql database.
39
-
- A POST webhook endpoint on your service API, to call when the selected
40
-
event occurs.
30
+
- ODK Central running, connecting to an accessible PostgreSQL database.
31
+
- The `pgsql-http` extension installed and enabled in your PostgreSQL database:
32
+
```sql
33
+
CREATE EXTENSION http;
34
+
```
35
+
> [!NOTE]
36
+
> **Using our helper images**: We provide PostgreSQL images with the `pgsql-http` extension pre-installed:
37
+
> -`ghcr.io/hotosm/postgres:18-http` (based on vanilla PostgreSQL 18 images)
38
+
>
39
+
> These images are drop-in replacements for standard PostgreSQL images and simply add the extension.
40
+
>
41
+
> **Installing manually**: If you don't wish to use these images, you must install the `pgsql-http` extension yourself. The extension may require superuser privileges to install. If you cannot install it yourself, ask your database administrator.
42
+
- A POST webhook endpoint on your service API, to call when the selected event occurs.
41
43
42
44
## Usage
43
45
44
-
The `centralwebhook` tool is a service that runs continually, monitoring the
45
-
ODK Central database for updates and triggering the webhook as appropriate.
46
+
The `centralwebhook` tool is a CLI that installs or uninstalls database triggers. After installation, the triggers run automatically whenever audit events occur in the database.
46
47
47
-
### Integrate Into [ODK Central](https://github.com/getodk/central) Stack
48
+
### Install Triggers
48
49
49
-
- It's possible to include this as part of the standard ODK Central docker
50
-
compose stack.
51
-
- First add the environment variables to your `.env` file:
0 commit comments