Commit Graph

27 Commits

Author SHA1 Message Date
6cfbeb7fe7 feat(DockerEngine): use API from HaRP instead of using Docker directly
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
2025-05-29 09:30:51 +03:00
e27b687ddf feat: Advanced deploy options
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
2025-01-20 19:23:27 +02:00
217a6f9e17 fix(occ): correct app_api:app:update enabled state of ExApps, introduce helper options (#478)
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>
2024-12-27 13:25:19 +00:00
c5f3d6a764 docs(reuse): Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-12-18 08:40:54 +01:00
1eab9f6814 feat: remove ApiScopes (#373)
Ongoing optimization, unnecessary stuff removal to reduce the number of
requests during AppAPIAuth.

---------

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
2024-09-04 20:37:02 +03:00
65003cd5d1 ExApp routes (public/user/admin) support (#327)
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>
2024-08-02 16:47:06 +03:00
3d503b3403 drop ExApp scopes table, rewrite code of it (#285)
This is ongoing part of optimizations of reducing the number of
database/cache requests.

---------

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
2024-05-07 10:50:51 +03:00
af00e1787f Test deploy adjustments (#280)
Test Deploy fixes, timeout logic adjustments, docs.
2024-04-30 13:59:54 +03:00
7391eeea65 initial support for Docker Healthcheck (#273)
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>
2024-04-17 11:41:04 +03:00
36c2db5835 removed "ex_apps_api_scopes" table (#262)
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>
2024-04-04 12:05:23 +03:00
508ecaa4aa added "all" and "showonly" flags to occ app:update (#256)
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>
2024-03-28 11:24:24 +03:00
f7eefb801b performance: store API scopes as a list in the main table (#254)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-03-27 19:24:34 +03:00
1abe49909b made the "system" flag much cleaner (#237)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2024-02-21 16:52:19 +03:00
078e5eb862 reset "Error state" during Updating/Enabling of ExApp (#236)
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>
2024-02-21 13:02:41 +03:00
071b763624 feat(l10n): L10N support for ExApps (#227)
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
2024-02-20 20:41:05 +03:00
c7d1c3e8b8 "Deploy" removed, Register Rework (#233)
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>
2024-02-19 18:50:06 +03:00
7ad5541eae removed "optional API Scope" support (#220)
* added URL encoding for Docker Container Pull action
* added two logs with `info` level for PullImage action
* removed "optional API Scope" support
* added AppAPI options toggles in Admin settings
* added RestartPolicy option to created containers

CI fails unrelated:
https://github.com/pytest-dev/pytest-asyncio/issues/737

---------

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Co-authored-by: Andrey Borysenko <andrey18106x@gmail.com>
Co-authored-by: Nextcloud bot <bot@nextcloud.com>
Co-authored-by: rakekniven <2069590+rakekniven@users.noreply.github.com>
2024-02-01 21:58:00 +03:00
003794670a Daemon Templates, Docker Socket Proxy, AppAPI 2.0 (#212) 2024-01-25 12:33:48 +00:00
ec0324b0df Rework of App:Register (#128)
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>
2023-11-27 15:31:37 +03:00
b0e06fe4a1 property declaration/assigment php8.0 style (#124)
* removed property declaration/assigment
* added "void" return type to subclasses of Command class.

---------

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2023-11-24 15:11:37 +03:00
e409b7e0ce ExApp init, disable apps actions if daemon not accessible (#96)
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
2023-10-19 17:28:52 +03:00
8017dba784 UI implementation(appstore, daemons) (#77)
- [ ] polish
- [ ] update docs with screenshots

---------

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Alexander Piskun <13381981+bigcat88@users.noreply.github.com>
2023-10-02 20:55:33 +03:00
8b3f129143 app_ecosystem_v2 to app_api renaming(1) (#68)
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
2023-09-11 12:42:34 +03:00
8e94d8a411 small general adjustments for AIO compatibility (#63)
Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
2023-09-04 12:24:38 +03:00
efa55ea343 use ApiScopes names instead of numbers (#51)
- [ ] 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>
2023-08-22 19:46:19 +03:00
ba9f61c556 DeployActions code fixes (#46) 2023-08-21 14:59:02 +03:00
36be89c48e Deploy actions updates (#43)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Co-authored-by: Alexander Piskun <bigcat88@icloud.com>
2023-08-16 13:17:17 +03:00