Resolves: #474
This PR corrects AppAPI `occ app_api:app:update` command logic in the
following way:
1. By default disabled ExApps are not updated. Use option
`--include-disabled` to update disabled ExApps too.
2. During update ExApp is enabled to perform initialization step, if it
was disabled before update - by default it will be disabled after
update.
---------
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
This PR introduces new (mandatory if you use the ExApp proxy) registration of the routes that are allowed to call on ExApp via AppAPI ExApp proxy.
---------
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
Before this, we didn’t have a `healthcheck` at all, but instead there
was simply a check to see if the container was running.
Checking whether the container is running has been moved to Deploy stage
and now occurs at the end of the deployment process.
And between deployment and “init” there is now a correct health check.
Applications are not required to support healthcheck at all, so it is
only checked if `['State']['Health']['Status']` is present.
Without a timeout, the timeout must be set by the application itself, as
it is usually done for Docker containers healthcheck.
During a healthcheck, an application, for example, can now install some
of its own packages or do something other with its docker container.
It should not communicate with the Nextcloud itself at this
stage(healthcheck), because application is not considered enabled.
---------
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Andrey Borysenko <andrey18106x@gmail.com>
We hold pre-defined API Scopes in memory only.
Anyway we currently do not supporting defining API Scopes at runtime and
not sure that we will in future, so better to make it simpler and faster
for now.
---------
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
They do almost the same like the original flags from Server repo with
one difference:
`--showonly` flag can be specified only with `--all` flag.
We can not easy make `--showonly` work for specified appid, cause we
support updating ExApps with specifyng `json` or `xml` and not only by
`appid`.
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
This will fix situations when ExApp after update or enabling work
without errors, but state of previous error is still in DB and UI
displays an error when all is already ok.
Also now we set 'error'(empty) always be present in "status" to allow us
in future not check for it presence.
---------
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
PR should not break anything, for old parts added a workarounds, that we
will remove in a month when all ExApps will publish their updates.
**Changes**:
* UI now use the same algorithm/code for ExApp `register` & `update` as
the CLI commands.
* Deprecated "deploy" command, now `register` commands performs deploy.
**Refactoring**:
* Removed internal `DispatchInit` command, as from CLI we already can do
it without spawning additional process.
* Removed hack(`status['active']`) when we have some half-enabled state
of ExApp when it is not enabled, but already can call APIs, now ExApp
enables before calling `/init`
* Made code more consistent in many place.
OTHER CHANGES FOR DEVS:
* For `--json-info` parameter in occ `register` command keys renamed:
"appid" -> "id", "system_app" -> "system"
_Old naming is still supported but will be removed in future, in such
way we make consistent parameters between `info.xml` and `--json-info`._
----
Related: #219
_AppAPI will perform deploy & registration in a background and issue
should be fixed_
---------
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Andrey Borysenko <andrey18106x@gmail.com>
Fixes: #122
1. Made sending the "init" request in a separate process
2. If "init" request fails with STATUS_NOT_IMPLEMENTED or
STATUS_NOT_FOUND sets the progress to 100
3. Added `wait-finish` optional parameter to `app_api:app:register` occ
command.
What is missing:
- [x] Global option: how long the "/init" request can be proceed.
- [x] Docs update for this
- [x] Update nc_py_api CI for this
- [x] Added test for registering ExApp that does not have "/init"
endpoint.
This allows to implement ExApp without "/init" endpoint and made it
optional.
---------
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Andrey Borysenko <andrey18106x@gmail.com>
* removed property declaration/assigment
* added "void" return type to subclasses of Command class.
---------
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
- [ ] Update ExApps used in tests to provide textual scopes (ApiScope
names)
---------
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Alexander Piskun <bigcat88@icloud.com>