Skip to content

docs(exapp): how HaRP and the ExApp proxy match routes - #15980

Merged
oleksandr-nc merged 3 commits into
masterfrom
fix/exapps/route-verbs
Nov 7, 2026
Merged

oleksandr-nc merged 3 commits into
masterfrom
fix/exapps/route-verbs

Conversation

@oleksandr-nc

@oleksandr-nc oleksandr-nc commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The routes page does not say how a request is matched against the routes. The lifecycle page says that /heartbeat is called periodically, while AppAPI only calls it after installing, updating or enabling an ExApp, and the deployment page gives a 90 second heartbeat timeout instead of 10 minutes. The routes page now has a short Matching section.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

@oleksandr-nc
oleksandr-nc force-pushed the fix/exapps/route-verbs branch 2 times, most recently from 21aeadc to 745ce51 Compare October 30, 2026 11:23
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
@oleksandr-nc
oleksandr-nc force-pushed the fix/exapps/route-verbs branch from 745ce51 to 7c49667 Compare October 30, 2026 11:39

@kyteinsky kyteinsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!
left a couple small comments below.

Comment on lines +40 to +41
The ``GET /heartbeat`` method is called periodically by Nextcloud to check the ExApp health status,
i.e. if its webserver is running and receiving requests.
AppAPI calls ``GET /heartbeat`` after installing, updating or enabling the ExApp, until it answers,
to check that its web server is running.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ``GET /heartbeat`` method is called periodically by Nextcloud to check the ExApp health status,
i.e. if its webserver is running and receiving requests.
AppAPI calls ``GET /heartbeat`` after installing, updating or enabling the ExApp, until it answers,
to check that its web server is running.
AppAPI calls ``GET /heartbeat`` periodically after installing or updating the ExApp, until it answers, to check if its web server is up and running.

maybe this feels better since "enabling" would mean the step after heartbeat and init

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling runs it too: AppAPI starts the container and waits for /heartbeat before PUT /enabled, also when a disabled ExApp is enabled again. I changed "after" to "when" so it doesn't read as the step after enabling, and took "periodically" and "up and running" from your suggestion.

Comment on lines +48 to +49
Other methods get ``405``, except ``404`` from the ExApp proxy for the ones it serves: ``GET``, ``HEAD``, ``POST``, ``PUT``, ``DELETE``.
HaRP applies the highest access level among the readings of a path (letter case, a trailing slash, ``;`` parameters, an escaped ``/``), so write a route for a directory as ``^/img(/.*)?$``.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe these two lines can be explained in more detail, with some examples for the first line, so it's easier to not misunderstand it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an example with three routes and what each request gets. The readings line now names the ExApp proxy too, since it checks them as well now.

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
… headers

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
- ``GET /api/items`` needs a user: the ``USER`` route comes before ``.*``.
- ``DELETE /api/items`` gets ``405`` from HaRP and ``404`` from the ExApp proxy; ``PATCH /api/items`` gets ``405`` from both.
- ``GET /IMG/logo.png`` needs an admin: in this letter case only ``.*`` matches it.
- With ``^/img/.*`` as the first route, ``GET /img/`` would need an admin: without the trailing slash only ``.*`` matches it, so write a route for a directory as ``^/img(/.*)?$``.

@kyteinsky kyteinsky Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- With ``^/img/.*`` as the first route, ``GET /img/`` would need an admin: without the trailing slash only ``.*`` matches it, so write a route for a directory as ``^/img(/.*)?$``.
- With ``^/img/.*`` as the first route, ``GET /img/`` would need an admin since the check will be performed against ``GET /img/`` and ``GET /img`` (without the trailing slash). Which is matched by ``.*`` only, so write a route for a directory as ``^/img(/.*)?$``.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had understood a bit wrong before, edited.
does this sound good?

@oleksandr-nc
oleksandr-nc merged commit 9590fc7 into master Nov 7, 2026
27 checks passed
@oleksandr-nc
oleksandr-nc deleted the fix/exapps/route-verbs branch November 7, 2026 15:21
@oleksandr-nc

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@oleksandr-nc

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@oleksandr-nc

Copy link
Copy Markdown
Contributor Author

/backport to stable33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants