GithubHelp home page GithubHelp logo

pojntfx / nextcloud-talk-bot-framework Goto Github PK

View Code? Open in Web Editor NEW
24.0 4.0 12.0 808 KB

A framework for writing Nextcloud Talk chatbots with every language that supports gRPC.

Home Page: https://pojntfx.github.io/nextcloud-talk-bot-framework/

License: GNU Affero General Public License v3.0

Dockerfile 1.45% Go 80.05% Shell 18.50%
nextcloud nextcloud-talk jitsi videochat chat-bot video-chat-meetings jitsi-meeting bot nxtalkproxyd nextcloud-talk-bot-framework

nextcloud-talk-bot-framework's Issues

Rewrite in Go

The existing implementation is written in Node, which is both slow and does not support threads natively. This should be rewritten in Go.

Sleep Timer for Pooling mechanism

The framework currently pools every few microseconds and manages to drive a 16 core system to 100% usage.
This should be configurable via docker environment flags

Jitsi Bot funktioniert nur ein paar Stunden

Hallo,
ich habe den Jitsi Bot für meine Nextcloud eingerichtet und funktioniert soweit auch.
Leider funktioniert es bei mir aber nur wenige Stunden. Ein neustarten der Docker Container behebt das Problem und der Bot antwortet wieder auf #videochat etc.

In den Logs sieht man, dass der Bot regelmäßig crashed und "unexpected end of JSON input" wirft einen Error.

Habt ihr eine Idee, dass dieses Fehlerbild behebt?

Anbei die Logs:
{"level":30,"time":1588771142875,"pid":27,"hostname":"a5ee28939ce3","msg":"connecting to nxta lkproxyd with address nxtalkproxyd:1969"} {"level":30,"time":1588771142878,"pid":27,"hostname":"a5ee28939ce3","msg":"bot crashed, resta rting in 0.125 seconds:"} {"level":30,"time":1588771142880,"pid":27,"hostname":"a5ee28939ce3","msg":"starting WebRTC no de subsystem with timeout 20 seconds"} {"level":30,"time":1588771143085,"pid":27,"hostname":"a5ee28939ce3","msg":"connecting to nxta lkproxyd with address nxtalkproxyd:1969"} {"level":30,"time":1588771143088,"pid":27,"hostname":"a5ee28939ce3","msg":"bot crashed, resta rting in 0.125 seconds:"} {"level":30,"time":1588771143090,"pid":27,"hostname":"a5ee28939ce3","msg":"starting WebRTC no de subsystem with timeout 20 seconds"} {"level":30,"time":1588771143319,"pid":27,"hostname":"a5ee28939ce3","msg":"connecting to nxta lkproxyd with address nxtalkproxyd:1969"} {"level":30,"time":1588771143323,"pid":27,"hostname":"a5ee28939ce3","msg":"bot crashed, resta rting in 0.125 seconds:"} {"level":30,"time":1588771143325,"pid":27,"hostname":"a5ee28939ce3","msg":"starting WebRTC no de subsystem with timeout 20 seconds"} {"level":30,"time":1588771143581,"pid":27,"hostname":"a5ee28939ce3","msg":"connecting to nxta lkproxyd with address nxtalkproxyd:1969"} {"level":30,"time":1588771143585,"pid":27,"hostname":"a5ee28939ce3","msg":"bot crashed, resta rting in 0.125 seconds:"} {"level":30,"time":1588771143586,"pid":27,"hostname":"a5ee28939ce3","msg":"starting WebRTC no de subsystem with timeout 20 seconds"} {"level":30,"time":1588771143795,"pid":27,"hostname":"a5ee28939ce3","msg":"connecting to nxta lkproxyd with address nxtalkproxyd:1969"} {"level":30,"time":1588771143798,"pid":27,"hostname":"a5ee28939ce3","msg":"bot crashed, resta

{"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","error":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"could not read rooms, retrying"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","error":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"could not read rooms, retrying"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","error":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"could not read rooms, retrying"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","error":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"could not read rooms, retrying"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"} {"level":"info","status":"unexpected end of JSON input","timestamp":"2020-05-06T13:16:52Z","message":"received Nextcloud client status"}

Make this a command

Hello, I just tried your chat bot and it runs as expected. 👍
I wonder if it could be turned into a "command" as explained here : https://nextcloud-talk.readthedocs.io/en/latest/commands/ in Nextcloud docs ?

Doing so would permit to invoke the command /videochat (for example) without having to add jitsi-bot user to the conversation.

What do you think about this ?

nxtalkproxyd doesn't grab `NXTALKPROXYD_ADDRREMOTE` variable from `docker-compose.yml`

I have tried building and launching the docker container.
However, when running, I get the following error:

nxtalkproxyd      | {"level":"info","error":"Get \"https://mynetxcloud.com/ocs/v2.php/apps/spreed/api/v1/room\": dial tcp: lookup mynetxcloud.com on xxx.xxx.xxx.xxx:53: no such host","timestamp":"2020-05-19T04:16:02Z","message":"could not read rooms, retrying"}

(IP address of DNS cache removed in log for security)

It looks like the container is trying to connect to the default nextcloud instance: https://mynetxcloud.com

my docker-compose file contains the following environment variable definitions:

        environment:
            NXTALKPROXYD_DBPATH: "/var/lib/nxtalkproxyd"
            NXTALKPROXYD_USERNAME: "jitsibot"
            NXTALKPROXYD_PASSWORD: "<PASSWORD>"
            NXTALKPROXYD_ADDRREMOTE: "https://nextcloud.server.net"
            NCTALKPROXYD_ADDRLOCAL:: "https://nxtalkproxyd:1696"

Enable setting the password & interact with the Jitsi API

It should be possible to interact with the Jitsi API; currently, work is done here:

Jitsi doesn't have a "real API" as in REST or gRPC, but I've managed to set one by spinning up a headless Chrome instance and thus getting a WebRTC node, which in turn uses the official Jitsi "client API" to join a room & set it's password. It's already working, although there is currently no connection to the Nextcloud API.

In order to achieve the latter, I'll be decomposing the bot from the framework and introduce a gRPC service to make this project independent of the specific bot's language; this will allow y'all to write bots in whatever language that supports gRPC (which is pretty much every language).

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.