Giter Club home page Giter Club logo

app_api's Introduction

Nextcloud AppAPI

Tests - Deploy Tests Docs

Supercharge your Nextcloud with AppAPI and applications specifically designed for it.

This project pivots on four main pillars:

  1. Enhanced stability This ecosystem is committed to maintaining API stability over extended periods. This ensures a reliable and consistent user experience as developers won't need to constantly update their apps with each new release.

  2. Enhanced security. Unlike the traditional method, which allowed direct interaction with the core Nextcloud code, this approach emphasizes more specialized API scopes, resulting in greater application stability and a more focused user experience.

  3. Reliable computing power. The ecosystem is designed to solve resource-intensive problems. Developers can easily integrate complex computing functions, including advanced machine learning models, and run them on external hardware.

  4. Community friendly The project aims to attract a diverse and broader developer community by creating applications in various programming languages and providing a well-documented, consistent and user-friendly API. Community collaboration and contributions are encouraged to drive open source innovation.

Documentation

Support

We appreciate any support for this project:

  • ⭐ Star our work on GitHub (it helps us a lot)
  • ❗ Create an Issue or feature request (bring to us an excellent idea)
  • πŸ’ Resolve an Issue and create a Pull Request (contribute to this project)
  • πŸ§‘β€πŸ’» Develop your own application using AppAPI and share it with the world (contact us if help is needed)

In conclusion, we are genuinely excited about the future of the AppAPI project and its potential to transform the way applications are developed and experienced within Nextcloud.

As we embark on this journey, we warmly invite you - developers, thinkers, creators, and visionaries - to join us in shaping a more versatile, stable, and secure app landscape.

Your insights, suggestions, and contributions are invaluable to us.

app_api's People

Contributors

andrey18106 avatar bigcat88 avatar dependabot[bot] avatar edward-ly avatar jospoortvliet avatar kyteinsky avatar marcelklehr avatar mb-finski avatar nextcloud-bot avatar nickvergessen avatar provokateurin avatar rakekniven avatar vstelmakh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

app_api's Issues

Configure ExApp containers with "RestartPolicy: always"

Describe why it is important and where it will be useful

This is required to be a default option in case of server restart to keep ExApps containers running.

Describe your proposed solution

Adjust ExApp containers creation with HostConfig.RestartPolicy: always. This will mitigate containers in disabled state after host server (or daemon server) restart.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Allow apps to provide installation status visible to administrators

Describe why it is important and where it will be useful

If application during installation downloads some model from HuggingFace - it can take long time, depending on the model size.

There is no visual indication to Administrator what is going on, he can think that installation is hang.

Almost all applications will face this issue, we need to solve it in a nice way.

Describe your proposed solution

Currently in example applications we download models in a heartbeat handler.

Theoretically, App can return not only "init" status, but also a number from 0 to 100, how many stuff was done and has to be done.

Will be a nice if we add two optional fields, one short description what is currently going on, and second the number from 0 to 100 indicating the overall process status.

The question is: how in Nextcloud we can display this?

Describe alternatives you've considered, if relevant

No response

Additional context

WebSockets vs. SSE: WebSockets provide a two-way communication channel and are generally more powerful, but also slightly more complex than SSE. SSE might be simpler to implement for just sending updates from server to client.

I am not a professional in frontend and can not decide what is better way we can implement this.

Failed to deploy ExApp

Describe the bug

I've installed AppAPI. I've also installed the docker proxy. I've successfully registered it as the daemon. If I open a terminal in the proxy container, I can successfully touch /var/run/docker.sock. When I go to the store and try to install any of the 5 currently available apps through the GUI, I get this error:

Failed to deploy ExApp

That's all I see in the GUI. In the NextCloud log, the only line that seems relevant is:

[Sun Jan 28 03:31:25.883881 2024] [php:notice] [pid 51] [client 172.20.0.4:36082] cURL error 18: transfer closed with outstanding read data remaining (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://nextcloud_docker_socket_proxy:2375/v1.41/images/create?fromImage=ghcr.io/cloud-py-api/ai_image_generator_bot:2.0.0

There's no log output from the proxy

Steps/Code to Reproduce

Select "Deploy and Enable" on an ExApp.

Expected Results

Should install and enable.

Actual Results

Seemingly fails to download.

Setup configuration

Docker compose file for the socket proxy:
nextcloud_docker_socket_proxy:
image: ghcr.io/cloud-py-api/aa-docker-socket-proxy:release
container_name: nextcloud_docker_socket_proxy
privileged: true
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- NC_HAPROXY_PASSWORD="some_secure_password"
networks:
- nextcloud_network

Error with apps supporting /init

Describe the bug

While trying to install and use ai_image_generator_bot, I fell on an error with the /init requests:

  • the app supports /init request, this starts the download of libraries and periodically send progress status indications (/ocs/v1.php/apps/app_api/apps/status/ai_image_generator_bot?format=json with content containing progress percentage).
  • when a progress status indication reaches the app_api authorization check, the app is not yet enabled, so the if (!$exApp->getEnabled()) (Service/AppAPIService.php [198]) returns an authentication error
  • the app download process crashes on the error, and the download stops (and never finishes), so the app is never operational.

If I comment the test on getEnabled() part, the app installs and runs correctly (including downloading libraries).
To be noted that if the libraries are already downloaded (cached), the /init process crashes, but a later /activate will work, as the app is already operational with all its libraries...

Steps/Code to Reproduce

install eg. ai_image_generator_bot after cleaning it persistent storage if present.

Expected Results

App installs, initializes and activates successfully.

Actual Results

The App is installs, but never initializes. The app is not working.

Setup configuration

Nextcloud 28.0.3
app_api 2.3.1

app_api tries to connect ExApps via localhost

Describe the bug

While the communication between Deploy Daemon and app_api works fine, the communication between app_api and ExApps is broken on my setup.

Steps/Code to Reproduce

  1. Install app_api app in Nextcloud
    sudo -u www-data php occ app:install app_api

  2. Install docker and nextcloud-appapi-dsp on another machine

docker run -e NC_HAPROXY_PASSWORD="$uper$ecret" \
  -e BIND_ADDRESS="10.1.2.5" \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --name nextcloud-appapi-dsp -h nextcloud-appapi-dsp --net host \
  --restart unless-stopped --privileged -d ghcr.io/cloud-py-api/nextcloud-appapi-dsp:release
  1. Goto /settings/admin/app_api and add the Deploy Daemon via docker-socket-proxy template

  2. Try to install context_chat_backend or any other ExApp via the web interface or:

sudo -u www-data php occ app_api:app:deploy context_chat_backend
# Container gets deployed and running but fails to verify that the init is done.
# WA: Manually register the app:
sudo -u www-data php occ app_api:app:register context_chat_backend docker_socket_proxy --force-scopes
# ..and enable it:
sudo -u www-data php occ app_api:app:enable context_chat_backend
# Error happening, see below
  1. Dumb workaround:
    Forward the ports with ssh and install the app again:
root@nextcloud:~# ssh -L 23000:127.0.0.1:23000 -L 23001:127.0.0.1:23001 -L 23002:127.0.0.1:23002 -L 23003:127.0.0.1:23003 [email protected]

Expected Results

ExApp gets listed as installed and enabled.

Actual Results

[app_api] Fehler: Failed to enable ExApp context_chat_backend. Error: cURL error 7: Failed to connect to localhost port 23000 after 0 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:23000/enabled?enabled=1

Setup configuration

app_api = 2.0.4
nextcloud = 28.0.2

Persistent storage for the applications [TRACKING]

Persistent storage between updates

Goals:

  1. The ability to store persistent data on the file system for the application
  2. Works universally, regardless of the type of deployment daemon

The path to the storage is in the APP_PERSIST_STORAGE environment variable
All files, folders and subfolders remain between app updates.

As currently only Docker is available for the deployment of the applications, lets see how we can achieve this with it:

  1. We create volume for each app and mount it to /persistent_data folder inside container.
  2. We set APP_PERSIST_STORAGE=/persistent_data, SDK and App should honour it and store data in that folder.

We will also consider a hypothetical option, a deployment of a python virtual environment:

  1. Python Deploy Daemon(hypothetical) creates a folder for the application, somewhere in the host.
  2. Sets APP_PERSIST_STORAGE=/path/to/app/folder, SDK and App should honour it and store data in that folder.

File actions menu: Allow user to apply action on multiple files at once

Describe why it is important and where it will be useful

Currently one can apply a file menu action only for one single file. It would be useful for the user to select multiple files and apply the file menu action on all at once.

Describe your proposed solution

To not change the protocol, trigger the configured action handler for each file in parallel.

If additions to the protocol are considered, add something like an optional multiselectActionHandler to the registration of a File Actions Menu, which is used when multiple files are selected and which receives a list of files at once. This would allow for advanced use cases like merging multiple files.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Simplify `File Actions Menu`.`Register`

During writing example in Python without SDK met this:

    json_data={
        "fileActionMenuParams": {
            "name": "to_gif",
            "display_name": "TO GIF",
            "mime": "video",
            "permissions": 31,  # this should be optional
            "order": 0,  # this should be optional
            "icon": "",  # this should be optional
            "icon_class": "icon-app-ecosystem-v2",  # this should be optional
            "action_handler": "/video_to_gif",
        }
    }

If they are already Optional this should be reflected in the documentation.
Recommended default values (from my point of view), is in code that up top.

Missing documentation

AppEcosystemAuth::

  • Log endpoint
  • Preferences
  • AppConfig
  • getNCUsersList

OCS:

  • OCSExApp

Invalid timeout for ExApps, install of App that downloads big model - fails

Describe the bug

I am try to implement a Talk bot using this model: https://huggingface.co/stabilityai/sdxl-turbo

Model size is 6.94G, it always fail in download after probably 40 seconds.

Steps/Code to Reproduce

with nc_py_api:

@asynccontextmanager
async def lifespan(_app: FastAPI):
    set_handlers(APP, enabled_handler, models_to_fetch={"stabilityai/sdxl-turbo": {}})
    yield
    

Expected Results

Model download in a 6 minutes on my slow internet connection.

Actual Results

ExApp my_new_bot initialization failed. Error: ExApp my_new_bot initialization timed out (2400m)

And I got it very quick.
Looks like here:

protected function run($argument): void {
// Iterate over all ExApp and check for status.init_start_time if it is older than ex_app_init_timeout minutes
// set status.progress=0 and status.error message with timeout error
try {
$exApps = $this->mapper->findAll();
$initTimeoutMinutes = intval($this->config->getAppValue(Application::APP_ID, 'ex_app_init_timeout', '40'));
foreach ($exApps as $exApp) {
$status = json_decode($exApp->getStatus(), true);
if (!isset($status['init_start_time'])) {
continue;
}
if (($status['init_start_time'] + $initTimeoutMinutes * 60) > time()) {
$this->service->setAppInitProgress(
$exApp->getAppid(), 0, sprintf('ExApp %s initialization timed out (%sm)', $exApp->getAppid(), $initTimeoutMinutes * 60)
);
}
}
} catch (Exception) {
}
}
}

looks like condition check should be reverted

Setup configuration

NC: stable 27, AppAPI: 1.4.2

Lack of clarity in dockumentation

Describe the bug

I am trying to build an java ExApp using your API and need a little more type safety πŸ˜„ than the provided python apps. This way I stumbled over several inconsistencies in the documentation.

Installation FLow

https://cloud-py-api.github.io/app_api/tech_details/InstallationFlow.html

Enabled

Then enabled request does not seem to have a payload but a query parameter enabled which is an integer value (1 enabled, 0 disabled).

e.g. the request is an PUT on http://expapp:2432/enabled?enabled=1

AppAPI Nextcloud APIs

Logging

https://cloud-py-api.github.io/app_api/tech_details/api/logging.html

Please indicate that log level is an int ( if correct, please link Nextcloud doc )

{
        "level": "loglevel",
        "message": "message",
}

AppConfig

https://cloud-py-api.github.io/app_api/tech_details/api/appconfig.html

Request data seems to be of the wrong format.
Had more success with (like in preferences):

{
        "configKey": "key",
        "configValue": "value"
}

Still unsure of the value sensitive? JSON boolean, int 1/0 or String with true/false?

For both the the block Get app config values the documented response data seems to be insufficient.

Actual response is more like

{"ocs":
    {"meta": {"status":"ok","statuscode":100,"message":"OK","totalitems":"","itemsperpage":""},
    "data":[
        { "configkey": "key1", "configvalue": "value1" },
        { "configkey": "key2", "configvalue": "value2" },
        { "configkey": "key3", "configvalue": "value3" },
]}}

Same might be true for the preferences but not yet tested.

Also please indicate if there is any UI (planned) to configure AppConfig or Preferences.

Get list of NC users

https://cloud-py-api.github.io/app_api/tech_details/api/utils.html
The the documented response data seems to be insufficient.

Actual response is more like

{"ocs":
    {"meta": {"status":"ok","statuscode":100,"message":"OK","totalitems":"","itemsperpage":""},
    "data":["user1", "user2", "user3"]}
}


### Steps/Code to Reproduce

Read documentation and try to build an app

### Expected Results

Documentation matches the actual api

### Actual Results

See text

### Setup configuration

exapp_api = 1.4.3 nextcloud=27.1.5

I18N for File actions menu (Top Menu Entry and Talk bots)

Describe why it is important and where it will be useful

In Nextcloud each user can set the applications language to have the best user experience and lowest entry barrier. Unfortunately the current implementation of the registration of File Actions Menu, Top Menu Entry and Talk Bots does only support to register a menu in one single language without any hint which is the (preferred) language of the Nextcloud instance.

Describe your proposed solution

Enhance the registration of menu entries like that. If you check if displayName is a plain string or an object this solution is downwards compatible,too.

{
        "name": "unique_name_of_file_actions_menu",
        "displayName": [
            {
                "lang": "en",
                "text": "Display name (for UI listing)"
            },
            {
                "lang": "de",
                "text": "Anzeige name"
            },
            {
                "lang": "default",
                "text": "Display name (for UI listing)"
            }
        ],
        "actionHandler": "/action_handler_route"
        "mime": "mime of files where to display action menu",
        "icon": "img/icon.svg",
        "permissions": "permissions",
        "order": "order_in_file_actions_menu",
}

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Failed when setting up dev environment

Describe the bug

New to App_API and try to explore but failed during the dev environment setup.
Hope some help and thanks in advance.

image

Steps/Code to Reproduce

Get last version from GitHub

git clone https://github.com/cloud-py-api/app_api.git

Move to the app_api directory with shell:

cd app_api

Then, build NPM and JS with shell:

npm ci && npm run build

Expected Results

No errors as below:

ERROR in [eslint] EACCES: permission denied, mkdir '/var/www/nextcloud/apps/app_api/node_modules/.cache/eslint-webpack-plugin'

ERROR in [stylelint] EACCES: permission denied, mkdir '/var/www/nextcloud/apps/app_api/node_modules/.cache/stylelint-webpack-plugin'

Actual Results

Can revoke following external applications:

talk_bot_ai_example
upscaler_example

Setup configuration

Nextcloud 28.0.0
App_API 1.4.2
Ubuntu 23.10

Daemon page button: "Test deploy"

Considering the complex scheme of operation and interaction between ExApp and Nextcloud instance, for many it will be difficult to configure the working configuration of the Deploy Daemon.

Therefore, in addition to the current β€œVerify connection” button, we must add a second button that will quickly deploy the Skeleton application, so that the instance administrator can understand whether his configuration is working or not.

It is also desirable that the button not just say β€œOk” or β€œNot Ok”, but displays a list of actions that have been completed, the action that resulted in an error, and possible options for correcting the configuration.

For example, if the β€œHeartbeat” request does not pass, it should be clearly and clearly understood that Nextcloud cannot send a regular request to ExApp, which may be worth paying attention to the β€œhost” value in the Deploy Config or checking the firewall.

Write a small FAQ in the documentation and from the user interface of this new flow, link to the desired FAQ item.

If, for example an /init does not pass, we must notify that there is no connection from ExApp to the Nextcloud instance, perhaps the wrong NextCloud URL is specified in the Deploy Config.

This will make life much easier not only for administrators who want to try installing AppAPI for the first time, but also for us, because in case of any problems, we will be able to identify the problem much faster and more clearly and help with it.

Failed to setup daemon for nextcloud within docker and direkt access to docker socket.

Describe the bug

I am running nextcloud successfully using docker and traefik as reverse-proxy for ssl and routing.
The docker host machine is a QNAP ARM64 NAS.
To install App_Api I added the docker socket as proxy as volume to the nextcloud container. I also added an additional docker network for the apps.

networks:
  web:
    external: true
  nextcloud-apps:
    external: true
 app:
    image: nextcloud:27
    depends_on:
      - database
      - redis-nextcloud
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - nextcloud:/var/www/html
    env_file:
      ... Reference to local env file
    ports:
      - 8085:80
    restart: always
    labels:
    ... Removed traefik config
    networks:
      - web
      - default
      - nextcloud-apps

Then I added a deamon r:
occ app_api:daemon:register --net nextcloud-apps --set-default docker_local_sock "Local docker" docker-install unix-socket /var/run/docker.sock https://nextcloud.[mydomain].de

Results in:
Daemon successfully registered.

Within the admin ui I try to verify the connection, but get an error: Failed to connect to Daemon. Check the logs.

Does not work with host network either.

Steps/Code to Reproduce

See above

Expected Results

Successful connection to AppAPI daemon

Actual Results

[app_api] Fehler: GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to localhost port 80 after 0 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost/v1.41/_ping at <>

  1. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 158
    GuzzleHttp\Handler\CurlFactory::createRejection("*** sensitive parameters replaced ***")
  2. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 110
    GuzzleHttp\Handler\CurlFactory::finishError(["GuzzleHttp\Handler\CurlHandler"], "*** sensitive parameters replaced ***", ["GuzzleHttp\Handler\CurlFactory"])
  3. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 47
    GuzzleHttp\Handler\CurlFactory::finish(["GuzzleHttp\Handler\CurlHandler"], "*** sensitive parameters replaced ***", ["GuzzleHttp\Handler\CurlFactory"])
  4. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 28
    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  5. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 48
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}("*** sensitive parameters replaced ***")
  6. /var/www/html/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}("*** sensitive parameters replaced ***")
  7. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  8. /var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp{closure}("*** sensitive parameters replaced ***")
  9. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63
    GuzzleHttp\RedirectMiddleware->__invoke("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  10. /var/www/html/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp{closure}("*** sensitive parameters replaced ***")
  11. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 331
    GuzzleHttp\HandlerStack->__invoke("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  12. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 168
    GuzzleHttp\Client->transfer("*** sensitive parameters replaced ", " sensitive parameters replaced ***")
  13. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Client->requestAsync("*** sensitive parameters replaced ***")
  14. /var/www/html/3rdparty/guzzlehttp/guzzle/src/ClientTrait.php line 44
    GuzzleHttp\Client->request("*** sensitive parameters replaced ***", "http://localhost/v1.41/_ping", [true])
  15. /var/www/html/custom_apps/app_api/lib/DeployActions/DockerActions.php line 283
    GuzzleHttp\Client->get("http://localhost/v1.41/_ping")
  16. /var/www/html/custom_apps/app_api/lib/Controller/DaemonConfigController.php line 104
    OCA\AppAPI\DeployActions\DockerActions->ping("http://localhost")
  17. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\AppAPI\Controller\DaemonConfigController->verifyDaemonConnection("docker_local")
  18. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController(["OCA\AppAPI\C ... "], "verifyDaemonConnection")
  19. /var/www/html/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch(["OCA\AppAPI\C ... "], "verifyDaemonConnection")
  20. /var/www/html/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main("OCA\AppAPI\Co ... r", "verifyDaemonConnection", ["OC\AppFramewo ... "], ["docker_local", ... "])
  21. /var/www/html/lib/base.php line 1068
    OC\Route\Router->match("/apps/app_api/d ... k")
  22. /var/www/html/index.php line 36
    OC::handleRequest()

POST /apps/app_api/daemons/docker_local/check
from 93.104.100.117 by admin at 2023-12-15T06:25:27+00:00

Setup configuration

nextcloud = 27.1.4 appApi=1.4.2

I18N - Grammar correction

Describe why it is important and where it will be useful

I18/l10n improvements

Describe your proposed solution

in src/components/DaemonConfig/RegisterDaemonConfigModal.vue:15

"This is default...." should read: "These are the default.."

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Notification management

Goals of the notification system in the app ecosystem v2:

  • not break the compatibility with the SDKs when we extend it
  • be generic enough so that we don't have a limited list of supported use cases
  • allow the apps to set
    • the notification target (INotification::setLink)
    • an icon (by path? like actions/download)
    • a title/subject
    • a message
    • the rich parameters for the title and message
    • a list of actions

We would have our own data format for the API calls, no need to be close to what the core notification system does, the app ecosystem parses the params sent by the ext apps and produces notifications.

For links (notification target and action link), we could support a list of target elements (file, user, talk room...) so the SDK could avoid generating URLs and leave it to the app ecosystem. For example, the SDK would pass

{
    "type": "file",
    "id": "123",
}

and it would result in calling

$notification->setLink($this->url->linkToRoute('files.view.index', ['fileid' => 123]));

For the rich parameters, we could just directly use the ones sent by the ext apps so we would support everything supported by INotification.

Any other aspect of the notifications we should cover?

Error when trying to install talk_bot_ai_example

Describe the bug

Error when trying to install talk_bot_ai_example

Steps/Code to Reproduce

  1. Enable DSP and app_api in AIO
  2. Go into the store and install talk_bot_ai_example
  3. error

Expected Results

it should install the app without error

Actual Results

there are mutliple errors:

{"reqId":"yroCYbT8yRWW4i6qjsH2","level":3,"time":"2023-10-05T14:17:43+00:00","remoteAddr":"","user":"--","app":"app_api","method":"","url":"--","message":"Failed to get daemon config by name. Error: Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*ex_apps_daemons` WHERE `name` = :dcValue1\"; ","userAgent":"--","version":"27.1.2.1","exception":{"Exception":"OCP\\AppFramework\\Db\\DoesNotExistException","Message":"Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*ex_apps_daemons` WHERE `name` = :dcValue1\"; ","Code":0,"Trace":[{"file":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php","line":361,"function":"findOneQuery","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->","args":[["OC\\DB\\QueryBuilder\\QueryBuilder"]]},{"file":"/var/www/html/custom_apps/app_api/lib/Db/DaemonConfigMapper.php","line":50,"function":"findEntity","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->","args":[["OC\\DB\\QueryBuilder\\QueryBuilder"]]},{"file":"/var/www/html/custom_apps/app_api/lib/Service/DaemonConfigService.php","line":97,"function":"findByName","class":"OCA\\AppAPI\\Db\\DaemonConfigMapper","type":"->","args":["docker_aio"]},{"file":"/var/www/html/custom_apps/app_api/lib/DeployActions/AIODockerActions.php","line":44,"function":"getDaemonConfigByName","class":"OCA\\AppAPI\\Service\\DaemonConfigService","type":"->","args":["docker_aio"]},{"file":"/var/www/html/custom_apps/app_api/lib/Migration/DataInitializationStep.php","line":43,"function":"registerAIODaemonConfig","class":"OCA\\AppAPI\\DeployActions\\AIODockerActions","type":"->","args":[]},{"file":"/var/www/html/lib/private/Repair.php","line":127,"function":"run","class":"OCA\\AppAPI\\Migration\\DataInitializationStep","type":"->","args":[["OC\\Repair"]]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":905,"function":"run","class":"OC\\Repair","type":"->","args":[]},{"file":"/var/www/html/lib/private/Installer.php","line":164,"function":"executeRepairSteps","class":"OC_App","type":"::","args":["app_api",["OCA\\AppAPI\\Migration\\DataInitializationStep"]]},{"file":"/var/www/html/core/Command/App/Install.php","line":81,"function":"installApp","class":"OC\\Installer","type":"->","args":["app_api",false]},{"file":"/var/www/html/3rdparty/symfony/console/Command/Command.php","line":298,"function":"execute","class":"OC\\Core\\Command\\App\\Install","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":1040,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["OC\\Core\\Command\\App\\Install"],["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/3rdparty/symfony/console/Application.php","line":171,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/lib/private/Console/Application.php","line":211,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->","args":[["Symfony\\Component\\Console\\Input\\ArgvInput"],["Symfony\\Component\\Console\\Output\\ConsoleOutput"]]},{"file":"/var/www/html/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->","args":[]},{"file":"/var/www/html/occ","line":11,"args":["/var/www/html/console.php"],"function":"require_once"}],"File":"/var/www/html/lib/public/AppFramework/Db/QBMapper.php","Line":283,"message":"Failed to get daemon config by name. Error: Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*ex_apps_daemons` WHERE `name` = :dcValue1\"; ","exception":[],"CustomMessage":"Failed to get daemon config by name. Error: Did expect one result but found none when executing: query \"SELECT * FROM `*PREFIX*ex_apps_daemons` WHERE `name` = :dcValue1\"; "},"id":"651ec98a21fa0"}
{"reqId":"aANNxrzWJynZ8e7qOvDZ","level":3,"time":"2023-10-05T14:34:37+00:00","remoteAddr":"2003:ee:571a:d401:4c02:6800:703:12d","user":"admin","app":"PHP","method":"POST","url":"/apps/app_api/apps/enable","message":"simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '&lt;' not found at /var/www/html/custom_apps/app_api/lib/Service/AppAPIService.php#432","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36","version":"27.1.2.1","data":{"app":"PHP"},"id":"651ec98a21db5"}
{"reqId":"aANNxrzWJynZ8e7qOvDZ","level":3,"time":"2023-10-05T14:34:37+00:00","remoteAddr":"2003:ee:571a:d401:4c02:6800:703:12d","user":"admin","app":"PHP","method":"POST","url":"/apps/app_api/apps/enable","message":"simplexml_load_string(): \u001f at /var/www/html/custom_apps/app_api/lib/Service/AppAPIService.php#432","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36","version":"27.1.2.1","data":{"app":"PHP"},"id":"651ec98a21d9e"}
{"reqId":"aANNxrzWJynZ8e7qOvDZ","level":3,"time":"2023-10-05T14:34:37+00:00","remoteAddr":"2003:ee:571a:d401:4c02:6800:703:12d","user":"admin","app":"PHP","method":"POST","url":"/apps/app_api/apps/enable","message":"simplexml_load_string(): ^ at /var/www/html/custom_apps/app_api/lib/Service/AppAPIService.php#432","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36","version":"27.1.2.1","data":{"app":"PHP"},"id":"651ec98a21d89"}
{"reqId":"aANNxrzWJynZ8e7qOvDZ","level":3,"time":"2023-10-05T14:34:37+00:00","remoteAddr":"2003:ee:571a:d401:4c02:6800:703:12d","user":"admin","app":"index","method":"POST","url":"/apps/app_api/apps/enable","message":"OCA\\AppAPI\\Service\\AppAPIService::getLatestExAppInfoFromAppstore(): Return value must be of type ?SimpleXMLElement, bool returned in file '/var/www/html/custom_apps/app_api/lib/Service/AppAPIService.php' line 432","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36","version":"27.1.2.1","exception":{"Exception":"Exception","Message":"OCA\\AppAPI\\Service\\AppAPIService::getLatestExAppInfoFromAppstore(): Return value must be of type ?SimpleXMLElement, bool returned in file '/var/www/html/custom_apps/app_api/lib/Service/AppAPIService.php' line 432","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\AppAPI\\Controller\\ExAppsPageController"],"enableApps"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\AppAPI\\Controller\\ExAppsPageController","enableApps",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["app_api.ExAppsPage.enableApps"]]},{"file":"/var/www/html/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/app_api/apps/enable"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"OCA\\AppAPI\\Service\\AppAPIService::getLatestExAppInfoFromAppstore(): Return value must be of type ?SimpleXMLElement, bool returned","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/app_api/lib/Controller/ExAppsPageController.php","line":439,"function":"getLatestExAppInfoFromAppstore","class":"OCA\\AppAPI\\Service\\AppAPIService","type":"->","args":["talk_bot_ai_example"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"enableApps","class":"OCA\\AppAPI\\Controller\\ExAppsPageController","type":"->","args":[["talk_bot_ai_example"],[]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\AppAPI\\Controller\\ExAppsPageController"],"enableApps"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\AppAPI\\Controller\\ExAppsPageController"],"enableApps"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\AppAPI\\Controller\\ExAppsPageController","enableApps",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["app_api.ExAppsPage.enableApps"]]},{"file":"/var/www/html/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/app_api/apps/enable"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/custom_apps/app_api/lib/Service/AppAPIService.php","Line":432},"CustomMessage":"--"},"id":"651ec98a21d6e"}

Setup configuration

AIO 7.4.0 Beta

recommend to use AIOs docker-socket-proxy container as if using normal docker?

Describe why it is important and where it will be useful

Currently the default deployment recommendation (making docker socket available for www-data user) is really insecure imho as the www-data user basically gets root privileges by doing so.

Describe your proposed solution

Recommend to use docker-socket-proxy container by AIO which features at least a bit of protection and is made for this use case.

This would need some changes in the AIO container that I am willing to accept.

Describe alternatives you've considered, if relevant

Recommending docker rootless instead?

Additional context

No response

GPU passthrough not working (NVIDIA)

We need this for complex models.

Theoretically this should work and we took code from AIO for this(for NVIDIA at least), but during tests we found that do not work in our current setups.

And after we solve this, all this stuff should be documented.

Andrey will check on Nvidia, he will install a separate Linux on his system for this, I will check on AMD.
We will check everything not on a virtual machine, but on separate Linux installed for this purpose on real equipment, as it should be in production.

AppAPI 2.0 Release Information

We are preparing with joy and optimism for the release of AppAPI version 2.0

Ref: #212

The main innovations of this version for Administrators:

  1. Implemented Docker Socket Proxy (https://github.com/cloud-py-api/docker-socket-proxy)
  2. Added the ability to install applications on a remote docker using Docker Socket Proxy with HTTPS
  3. The Daemon creation UI has been rewritten, creating demons using selectable templates has been implemented
  4. Creation of Daemons now is much simpler with less params, Unraid/Proxmox/etc.. are now easy supported.

The main cool difference for the developers:

  1. Nextcloud Talk Bots now should use AppAPI authentication for incoming endpoints
  2. Field protocol in info.xml is deprecated and ignored from now. All ExApps should implement only simple HTTP.
  3. occ app_api:app:register appName manual_install --json-info - does not require protocol or host fields anymore, these values are from now calculated based on Daemon values.
  4. If you have part of application in PHP, then to communicate with ExApp you should use exAppRequest or exAppRequestWithUserInit from PublicFunctions.php, as it handles new Auth correctly for Docker Socket Proxy installs.

How to Update from 1.x version to 2.0 version?

Ideal variant is:

  1. Remove all ExApps
  2. Remove all Daemons
  3. Uninstall AppAPI 1.4.x
  4. Install AppAPI 2.0

Variant when you first got update to AppAPI 2.0 and after that found this topic:

  1. Try Remove all ExApps and after that all Daemons, after that uninstall AppAPI.
  2. Truncate oc_ex_apps, oc_ex_apps_daemons, oc_appconfig_ex, oc_preferences_ex tables.
  3. For talk bots, truncate: oc_talk_bots_conversation, oc_talk_bots_server tables.
  4. Reset memcache(in case of redis, do: redis-cli and flushAll after that inside redis command line)

Feel free to ask questions inside this topic if something is unclear.

Watch for Docker events on image pull to display deploy progress in UI

Describe why it is important and where it will be useful

ExApps packaged in Docker container (especially with AI features) could have pretty big image sizes, as well as initialization data to download.
It's important to keep the ExApp "Deploy and enable" progress visible to the user.

This is also crucial in case of a slow download speed due to both slow user connection speed or slow container registry.

Describe your proposed solution

Implement watch and filtering out the docker events (pull events) to keep track and show the progress.

Describe alternatives you've considered, if relevant

No response

Additional context

For UI this will also allow to restore the download progress state after page refresh.

Failure to install on NC27.1.2

Describe the bug

Installing from the store fails, with an apparently bad database query:

An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB, TEXT, GEOMETRY or JSON column 'deploy_config' can't have a default value

Steps/Code to Reproduce

  1. Install NextCloud 27.1.2
  2. Attempt to install AppAPI

Expected Results

AppAPI extension installs correctly

Actual Results

Fails to install, citing query error.

Setup configuration

NextCloud 27.1.2 with mySQL 8.0.34

Inconsistent `/api/v1/ex-app/all` endpoint

1. Return type changes depending on input value

That is very bad for OpenAPI, and for any type of linters in any language

2. No possible use case for extended=0

Why any would need list of installed external applications?

Suggestion:

Remove extended parameter, /api/v1/ex-app/all should print always full output like with extended=1

Add /api/v1/ex-app/enabled endpoint to get the list of IDs of enabled external applications on the server.

Feedback

Hey hey, first of all, it was very nice to read your code. It's a huge app and it's already pretty clean πŸ‘ πŸ’™

Here are some random remarks and questions:

  • You can use static functions as callback in array_map and array_filter as long as you don't use $this in the callback
array_map(static function (IUser $user) {
	return $user->getUID();
}, $this->userManager->searchDisplayName(''));
  • Maybe you can rename the command classes to more explicit names like Enable to EnableApp or EnableExApp so it's more obvious it does not mean "enable the external app system".
  • Would it make sense to use named constants for scope groups? They could be declared as public const in the ExAppApiScopeService class.
  • Any reason to set Php min version to 8.1? NC 26 supports Php 8.0.
  • As far as I understand, it's possible to set the config value "sensitive" flag each time you set a value, right? Could we do something like making this command parameter optional? And if it's not set:
    • set "sensitive" to false if the config key does not exist
    • keep the "sensitive" value if the config key already exists
  • We can talk about that later but I'm interested in the daemon concept. It's the entity to manage apps on a different host than the NC server, right? Is the local instance considered as a daemon or is it handle very differently?
  • As far as I understand, exApps are not declaring anything statically, right? They have to make multiple OCS API calls at the right moment. Maybe this could be factorized in one "initialization" request in which we could group things. It would be a sort of equivalent to sending an info.xml. Maybe it does not make sense. You tell me.
  • I see that IControllerMethodReflector is deprecated (in AppEcosystemAuthMiddleware). Is there any obstacle to use Php8 method attributes? Not a big deal but it might save us maintenance/time to directly use Php8 stuff.
  • Really not a big deal but
new Vue({
	el: '#app_ecosystem_v2_settings',
	render: h => h(AdminSettings),
})

can be replaced with

const View = Vue.extend(AdminSettings)
new View().$mount('#app_ecosystem_v2_settings')

Which I think will be easier to migrate to Vue 3

  • Why do you expose the loglevel in the capabilities?

Looking forward to continue the discussion in a call.

Extend documentation about Deploy daemon configuration (networking)

Describe why it is important and where it will be useful

The most common issue to start win AppAPI - is Deploy daemon configurations problems related to the specifics of our communication logic (Docker network mode, nextcloud instance url).

Describe your proposed solution

Extend documentation and mention possible problems and their solutions (e.g. FAQ section).

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Image not returned to chat or folder with 2FA enabled

Installed this on AIO 7.9.0 (Nextcloud 27.1.5) and while the logs seem to show the app responds to @image prompt, I'm not getting an image back either in chat or in the folder.

TRACE: 172.18.0.8:35626 - HTTP connection made
TRACE: 172.18.0.8:35626 - ASGI [12] Started scope={'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.11', 15888), 'client': ('172.18.0.8', 35626), 'scheme': 'http', 'root_path': '', 'headers': '<...>', 'state': {}, 'method': 'POST', 'path': '/stable_diffusion', 'raw_path': b'/stable_diffusion', 'query_string': b''}
TRACE: 172.18.0.8:35626 - ASGI [12] Receive {'type': 'http.request', 'body': '<322 bytes>', 'more_body': False}
TRACE: 172.18.0.8:35626 - ASGI [12] Send {'type': 'http.response.start', 'status': 200, 'headers': '<...>'}
image generated: 22.71879433398135s
[401] Unauthorized <request: GET /ocs/v1.php/cloud/capabilities>
offloading model
INFO: 172.18.0.8:35626 - "POST /stable_diffusion HTTP/1.1" 200 OK
TRACE: 172.18.0.8:35626 - ASGI [12] Send {'type': 'http.response.body', 'body': '<0 bytes>'}
TRACE: 172.18.0.8:35626 - ASGI [12] Completed
task added
loading model
Loading pipeline components...: 14%|β–ˆβ– | 1/7 [00:00<00:04, 1.41it/s]TRACE: 172.18.0.8:35626 - HTTP connection lost
Loading pipeline components...: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7/7 [00:02<00:00, 2.84it/s]
model loaded: 2.475664479075931s
generating image
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:08<00:00, 8.17s/it]

I do see the 401 error in there but unsure how to deal with it.

Here are some screenshots showing what I think is a successful installation.

image

image

image

Nextcloud flow integration

Describe why it is important and where it will be useful

ExApps seem to be an excellent backend for further automations using the already established Nextcloud flows.

Describe your proposed solution

Add another API like the one for the File Actions Menu which lets the ExApp register itself as target for Nextcloud flows.
Protocol and Payload could be almost identical to the one of the File Actions Menu.

Describe alternatives you've considered, if relevant

Alternatively the ExApp would have to constantly search for changed files matching the criteria of the flow, generating unnecessary load on both Nextcloud service as well as the Ex App (and its host) itself. This is a major unnecessary performance issue.

Additional context

No response

Style and script urls are not generated correctly because of the appended cache buster

Thanks for this great app. I'm really looking forward to what people will create with this.

I played around a bit and have some problems. I created a .NET microservice which should be able to create its own top menu entry with a for now very simple page.

The source code is here https://github.com/splitt3r/nextcloud-dotnet-microservice

My problem now is that i can't get the style and script loading to work:

image

image

It tries to load: http://localhost:8080/custom_apps/app_api/css/proxy/dotnet_microservice/style.css
It should in theory also load : http://localhost:8080/custom_apps/app_api/js/proxy/dotnet_microservice/script.js (which it does not yet)

What works is: http://localhost:8080/apps/app_api/proxy/dotnet_microservice/style.css
And also: http://localhost:8080/apps/app_api/proxy/dotnet_microservice/script.js
Content type etc. looks good for those two urls.

Maybe you have a hint what i'm doing wrong here. Thanks in advance

FileActions : allow to register multiply mime types at once

Describe why it is important and where it will be useful

While writing an example of an archiver in Go, I encountered a problem that it would be convenient to specify several mimetypes for one endpoints at once.

Could we do this little breaking change before we go too far?

Describe your proposed solution

"fileActionMenuParams": Payload{
    "name":           "unpack",
    "display_name":   "Unpack",
    "mime":           []string{"application/gzip", "application/7z"},
    "permissions":    31,
    "action_handler": "/unpack",
},

Change "mime" from string to list.

Describe alternatives you've considered, if relevant

None

Additional context

No response

SSL certificate not found / Internal Server Error - Docker AIO container

Describe the bug

After deleting default daemon, it is not possible to add back with the same data. Log: "SSL certificate not found".
After that AppAPI page in NC is not reachable anymore. Log: "Internal Server Error"

Steps/Code to Reproduce

Delete AppAPI Default Deploy Daemon and try to add it back

Expected Results

Shoud let you do that

Actual Results

SSL certificate not found

Setup configuration

AppApi 1.4.4. NC 28.0.1

Independent Multi-Acceleration Support

The application can optionally support multiple acceleration types:

  1. CUDA
  2. ROCm (AMD)
  3. Intel Neural Compressor (https://pypi.org/project/optimum-intel/)
  4. AWS Neuron (Amazon)
  5. Others Every big corp currently developing their chip with AI

SDKs for those methods are big, see: image is huge, is this intended

Also very important to note, that if application will support several methods of acceleration, not only it image will become huge, but it will take very long time to build it.

And currently if there is an error in one acceleration method, then to fix it you need to rebuild the entire image, and not just a small one related to this method(which is obviously much faster).

Currently application has such structure in info.xml file:

<docker-install>
	<registry>ghcr.io</registry>
	<image>cloud-py-api/talk_bot_ai_example</image>
	<image-tag>latest</image-tag>
</docker-install>

For app there is no way to provide several images, minimal one for CPU, second for NVIDIA and third for AWS.

My suggestion will be to expand it with additional optional field: <acceleration>

It will look something like this after it:

<docker-install>
	<registry>ghcr.io</registry>
	<image>cloud-py-api/talk_bot_ai_example</image>
	<image-tag>latest</image-tag>
</docker-install>
<docker-install>
	<registry>ghcr.io</registry>
	<image>cloud-py-api/talk_bot_ai_example_cuda</image>
	<image-tag>latest</image-tag>
	<acceleration>CUDA</acceleration>
</docker-install>

Also we add to Docker deploy daemon config one field where admin can select which acceleration method for this daemon is preferred/available. (as it is stored as json, it will be relatively easy)

After that you can have one daemon for CPU, second one for CUDA, remote third for AWS and all should work seamlessly and in one-click as required.

Modifications from the AppStore side if we choose to implement this is possible.

Benefits

  • Faster building of release
  • Size Optimisation
  • Scalability

Any other ideas(like publish a separate application for each method) if any, are welcome.

App API complains about 'Docker Socket' with 'Docker Socket Proxy' set up.

Describe the bug

I have set up Nextcloud AIO and App API complains about the 'docker socket' although 'Docker Socket Proxy' is set up. It seems like it's a irreverent error since it displays that it has connected successfully to the proxy. See the following screenshot included.

Steps/Code to Reproduce

Install Nextcloud AIO, select for 'Docker Socket Proxy' as one of the optional containers to install. Run into this error displayed in the Nextcloud Web Interface.

Expected Results

No error is shown.

Actual Results

Screenshot from 2023-10-22 04-44-39

Setup configuration

Running Nextcloud AIO v7.5.0 BETA generated after this nextcloud/all-in-one#3566

App API = 1.0.1
Nextcloud = 27.1.2

System Specs
Operating System: Linux 6.1.55-1-MANJARO x86_64
CPU: Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz (4 cores)
Memory: 15.50 GB

EDIT: There's 16GB of RAM installed, but above is just what I got from the system info page of Nextcloud.

I18N - Clarification for string

Describe why it is important and where it will be useful

Improving I18n/l10n work

Describe your proposed solution

in src/components/DaemonConfig/RegisterDaemonConfigModal.vue:

"accepts-deploy-id:" doesn't have more context, if we're referring to the docker daemon that's currently the one that supports it, a good rephrase could be: "Current daemon supports accept-deploy-id?" or maybe methods. (i'm not entirely sure if this is merely a status prompt or not) however, as we cannot directly translate: "accepts-deploy-id" it should be treated like a whole string.

Thanks for any clarification / minor correction of the string to appropriately update translations.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

ExApp default app icon handling

Describe why it is important and where it will be useful

By default in various places (Apps management, TopMenu) app icon is used if exists (app/img/app.svg).
Currently we do not support automatic retrieval of app icon by its default location (app/img/app.svg), which is a proxyfied request to ExApp.

Describe your proposed solution

Implement check and usage of default app icon to be the same as for regular PHP apps.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Not working with AIO

Describe the bug

The default created deamon is not set to http and nextcloud-aio-docker-socket-proxy:2375 but unix-socket /var/run/docker.sock
(also see nextcloud/all-in-one#3489)
if it configured manually to nextcloud-aio-docker-socket-proxy:2375 and http, checking ends in this error:

[index] Error: InvalidArgumentException: SSL certificate not found:  at <<closure>>

 0. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 59
    GuzzleHttp\Handler\CurlFactory->applyHandlerOptions(["GuzzleHttp\\Ha ... l], [[["GuzzleHttp/7 ... "])
 1. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 43
    GuzzleHttp\Handler\CurlFactory->create("*** sensitive parameters replaced ***")
 2. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 28
    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 3. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 48
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/html/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}("*** sensitive parameters replaced ***")
 5. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 6. /var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 7. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63
    GuzzleHttp\RedirectMiddleware->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 8. /var/www/html/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 9. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 331
    GuzzleHttp\HandlerStack->__invoke("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
10. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 168
    GuzzleHttp\Client->transfer("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
11. /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Client->requestAsync("*** sensitive parameters replaced ***")
12. /var/www/html/3rdparty/guzzlehttp/guzzle/src/ClientTrait.php line 44
    GuzzleHttp\Client->request("*** sensitive parameters replaced ***", "http://nextclou ... g", [true])
13. /var/www/html/custom_apps/app_api/lib/DeployActions/DockerActions.php line 294
    GuzzleHttp\Client->get("http://nextclou ... g")
14. /var/www/html/custom_apps/app_api/lib/Controller/DaemonConfigController.php line 111
    OCA\AppAPI\DeployActions\DockerActions->ping("http://nextclou ... 5")
15. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\AppAPI\Controller\DaemonConfigController->verifyDaemonConnection("docker_local")
16. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController(["OCA\\AppAPI\\C ... "], "verifyDaemonConnection")
17. /var/www/html/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch(["OCA\\AppAPI\\C ... "], "verifyDaemonConnection")
18. /var/www/html/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main("OCA\\AppAPI\\Co ... r", "verifyDaemonConnection", ["OC\\AppFramewo ... "], ["docker_local", ... "])
19. /var/www/html/lib/base.php line 1068
    OC\Route\Router->match("/apps/app_api/d ... k")
20. /var/www/html/index.php line 36
    OC::handleRequest()

POST /apps/app_api/daemons/docker_local/check
from <ip> by Zoey at 2023-10-06T16:58:53+00:00

running docker exec nextcloud-aio-nextcloud curl -s http://nextcloud-aio-docker-socket-proxy:2375/v1.41/_ping returns "OK"

Steps/Code to Reproduce

Enable docker socket proxy in AIO

Expected Results

Works + auto configuration

Actual Results

SSL Errors/No autoconfiguration

Setup configuration

Nextcloud AIO Beta v7.4.0 & app_api v1.0.1

I18N for Notifications (and other futher message directly to one user)

Describe why it is important and where it will be useful

Nextcloud each user can set the applications language to have the best user experience and lowest entry barrier.
Currently the available APIs give no indication on the preferred language for the user.

Describe your proposed solution

Possible solutions:

  1. Send an additional X-USER-LANG header with each request for an user to given the app the possibility to react in the users language.
    Pro: Downwards compatible. Con: App has to keep track of the user language internally
  2. Extend the Get list of NC users endpoint with additional metadata per user, especially language but also user group for additional authorization.
    Pro: Best extensible place to put additional user metadata. Con: Not downwards compatible.
  3. Enhance the Notification API to accept rich_subject and rich_message in multiple languages and let the ui choose which one. Pro: Works without any additional information about the user. Con: Not downwards compatible, depending on the implementation.
{
        "params": {
                "object": "app_api",
                "object_id": "app_api_id",
                "subject_type": "app_api_ex_app",
                "subject_params": {
                        "rich_subject":  [
                               {
                                       "lang": "en",
                                      "text": ""Image {file} successfully upscaled!"
                              }, 
                               {
                                       "lang": "de",
                                      "text": ""Bild {file} erfolgreich vergrâßert!"
                              }, 
                         ],
                        "rich_subject_params": {
                                "file": {
                                        "type": "file",
                                        "id": 123,
                                        "name": "upscaled_image_name",
                                        "path": "path/to/upscaled_image_name"
                                }
                        },
                        "rich_message"://  ... see rich subject
                        "rich_message_params": {
                                "user": {
                                        "type": "user",
                                        "id": "admin",
                                        "name": "admin"
                                }
                        },
                        "link": "http(s)://nextcloud.local/index.php/apps/files/?fileid=123"
                }
        }
}

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.