Giter Site home page Giter Site logo

cloud-py-api / cloud_py_api Goto Github PK

View Code? Open in Web Editor NEW
49.0 4.0 7.0 7.63 MB

Nextcloud framework for developing apps using Python

Home Page: https://apps.nextcloud.com/apps/cloud_py_api

License: GNU Affero General Public License v3.0

JavaScript 16.59% PHP 56.37% Makefile 0.28% Vue 5.02% Python 21.75%
nextcloud python framework php

cloud_py_api's Introduction

Nextcloud Python Framework

(Py)Analysis & Coverage PythonVersion impl pypi codecov

Framework(App) for Nextcloud to develop apps, that using Python.

Consists of PHP part(cloud_py_api app) and a Python module(nc-py-api).

Current state: Abandoned

Project was divided into two different repositories:

Provides Convenient Functions for Python

  • Read & Write File System objects
  • Working with Database
  • Wrapper around OCC calls
  • Calling your python function from php part of app and return a result

🚀 Installation

In your Nextcloud, simply enable the cloud_py_api app through the Apps management and then install apps, that using it.

The Nextcloud cloud_py_api app supports Nextcloud version 25 and higher.

More information can be found on Wiki page

Maintainers

Apps using this

  • MediaDC - Nextcloud Media Duplicate collector app. Python part - core logics for duplicates search.

cloud_py_api's People

Contributors

andrey18106 avatar bigcat88 avatar nextcloud-bot avatar pre-commit-ci[bot] avatar rakekniven avatar renovate[bot] 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

Watchers

 avatar  avatar  avatar  avatar

cloud_py_api's Issues

Unable to open the settings page

Describe the bug
Unable to open settings page after fresh install

To Reproduce
Steps to reproduce the behavior:

  1. Install the app
  2. Go to Administrative settings
  3. Go to Cloud Python API

Expected behavior
The settings page opened

Desktop (please complete the following information):

  • Debian based docker container
  • x86
  • Nextcloud version 26.0.1
  • Database configuration Postgres 10.4
  • app version, that using cloud_py_api
  • cloud_py_api version 0.1.7
  • cloud_py_api config and admin settings (can be obtained in bug report admin settings section) clicking "Collect system info" does nothing

Additional context
Logs

{"reqId":"rJ0XBmqRv17bfstKEIRx","level":3,"time":"2023-04-22T16:28:52+00:00","remoteAddr":"158.181.193.51","user":"Speranskiy","app":"index","method":"GET","url":"/apps/cloud_py_api/api/v1/settings","message":"Could not resolve OCA\\Cloud_Py_API\\Service\\UtilsService! Class \"OCA\\Cloud_Py_API\\Service\\UtilsService\" does not exist","userAgent":"Mozilla/5.0 (X11;
Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.15.9 Chrome/87.0.4280.144 Safari/537.36","version":"26.0.1.1","exception":{"Exception":"OCP\\AppFramework\\QueryException","Message":"Could not resolve OCA\\Cloud_Py_API\\Service\\UtilsService! Class \"OCA\\Cloud_Py_API\\Service\\UtilsService\" does not exist","Code":0,"Trace":[{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":116,"function":"array_map","args":[["Closure"],[["ReflectionParameter","request"],["ReflectionParameter","service"],"*** sensitive parameters replaced ***"]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":124,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[["ReflectionClass","OCA\\Cloud_Py_API\\Controller\\SettingsController"]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":493,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":465,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":162,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["cloud_py_api.settings.index"]]},{"file":"/var/www/html/lib/base.php","line":1056,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/cloud_py_api/api/v1/settings"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","Line":110,"Previous":{"Exception":"OC\\AppFramework\\Utility\\QueryNotFoundException","Message":"Could not resolve OCA\\Cloud_Py_API\\Service\\UtilsService! Class
\"OCA\\Cloud_Py_API\\Service\\UtilsService\" does not exist","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Cloud_Py_API\\Service\\UtilsService"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":493,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Cloud_Py_API\\Service\\UtilsService"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":465,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Cloud_Py_API\\Service\\UtilsService"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":97,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Cloud_Py_API\\Service\\UtilsService",true]},{"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":116,"function":"array_map","args":[["Closure"],[["ReflectionParameter","request"],["ReflectionParameter","service"],"*** sensitive parameters replaced ***"]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":124,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[["ReflectionClass","OCA\\Cloud_Py_API\\Controller\\SettingsController"]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":142,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":493,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":465,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":162,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Cloud_Py_API\\Controller\\SettingsController","index",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["cloud_py_api.settings.index"]]},{"file":"/var/www/html/lib/base.php","line":1056,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/cloud_py_api/api/v1/settings"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","Line":131},"CustomMessage":"--"}}
^C

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (:packageFile)

Containerization

This is a tracking issue for the release 0.2.0.

Currently we have 3 problems:

  1. If files are encrypted or besides on a remote location, we use occ request to get them from PHP
  2. Notification to php is not universal and work with using occ for this, those only locally.
  3. PHP starts binary using exec when task starts.

Suggestions for a solution

  1. Use WebDAV in these cases for now, in future just add support to asking files from remote locations using python libraries.
  2. Register universal API endpoint, firing appropriate event, that underlined apps can handle to get task finished payload.
  3. Binary placed to auto start when it is a container, register handler using FastAPI and wait till php connect to it and gives a task name to start. For Authentication of PHP request in this case used some data from database.
    3a. When not a container PHP starts binary if it was not started before and works with the same way as in point 3.

No DB connection because occ config:system:get doesn't always return a proper value

Describe the bug

If Nextcloud's database config is done via environment variables (possible with variables named NC_<cfgvalue>, see PR 3966), occ config:system:get does not respect this and cloud_py_api can't connect to the database.

I opened a Nextcloud bug on this subject because I think the occ command should reliably return the configuration, but one could still argue that occ config:system:get should only complement the functionality of occ config:system:set and only operate on the config.php. Therefore you might want to explore other options on your side.

To Reproduce

See instructions in nextcloud/server#36126

Expected behavior

Working database connection, regardless of how it is configured.

Seems like database not initialized properly. Try to re-enable the app

Describe the bug
Hi. I used nextcloud in docker container. db - postgress, nextcloud from stable-fpm-alpine with ffmpeg, imagemagick, procps, samba-client, supervisor. I can't find cloud_py_api in nextcloud UI so I installed that manualy. NC version 25.0.6

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Perform some actions '...'
  3. See error

Expected behavior
App just not working. with media DC the same

Screenshots
Снимок экрана 2023-05-02 в 12 48 29

Desktop (please complete the following information):

  • OS [e.g. docker from stable-fpm-alpine]
  • CPU [architecture x86]
  • Nextcloud version [e.g. 25.0.6]
  • Database configuration (postgres:9-alpine)
  • app version, that using cloud_py_api
  • cloud_py_api version [e.g. 0.1.7]
  • cloud_py_api config and admin settings (can be obtained in bug report admin settings section)

App can't be installed, would make the system instable

Describe the bug
I'd like to install this app as a pre-req before installing MediaDC. But Netxcloud 28.0.4 (using the image from Linuxserver.io) won't allow this installation.

To Reproduce
Nextcloud running in Docker, based on Linuxerver.io image. Version 28.0.4.
Going to App store and tried to install this App.

grafik

Expected behavior
This app is a pre-req before installing MediaDC application.

Desktop (please complete the following information):

  • OS Alpine
  • CPU 2 core VM, Proxmox
  • Nextcloud version 28.0.4
  • Database configuration mariaDB
  • app version, that using cloud_py_api: N/A
  • cloud_py_api version [e.g. 0.1.0]: N/A
  • cloud_py_api config and admin settings (can be obtained in bug report admin settings section): N/A

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.