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 Introduction

Nextcloud Talk Bot Framework

A framework to realize Nextcloud Talk chatbots in a client/server model, where sessions exchange data via gRPC stubs.

The bot has bin re-written as nctalkbot-jitsi. It takes advantage of the new framework and implements the client side. Please have a look at at pojntfx/nextcloud-talk-bot-jitsi. The server part is available as nctalkproxyd. The source-code is provided in this repo.

Take a look at the following introduction video:

thumbnail

Overview

The Nextcloud Talk Bot Framework discribes a client/server infrastructure to realize Nextcloud chatbots, that interact via gRPC sessions. Shown here is an example for nctalkbot-jitsi.

  • Server side: nctalkproxyd implements a server instance written in the Go language. This component handles all the interaction with the Nextcloud API. It will listen for new chat requests while monitoring the associated rooms. Chat requests will be processed and the relavant data are proxied via gRPC messages to the client side. The new session will be advertised inside the addressed Nextcloud chat.

  • Client side: In order to create a chatbot, a client counterpart has to be implemented in any gRPC supported language. This Client will interacts with nctalkproxyd sending and recieving messages. The latter will will take care of all the heavy lifting (eg. handling the Nextcloud Talk API, keeping track of participants). nctalkbot-jitsi is a reference implementation written in JavaScript.

  • Jitsi-Meet: Participants will connect to the initiated Jitsi meeting inside a new window of their browser session. jitsi-meet-node will take care to process the needed steps. The communication with the Jitsi-Meet server follows the JitsiMeetExternal API. The framework is taking care to preset the Session parameters (eg. Name, password), beside participant specicfic options (participant name, language, etc).

The following image try to illustrate the major components and its workflow.

nctalkbot-framework.png

Installation

Go Package

A Go package is available.

Docker Image

A Docker image is available at Docker Hub.

Others

If you're interested in using alternatives like OCI images, see OCI.

Usage

The API will asure fast and secure messsage exchange via gRPC using protocol buffers. The protocol description itself is defined in pkg/protos/nextcloud_talk.proto.

nctalkbot-jitsi is a pretty advanced chatbot implementation, using this framework. Take it as a reference.

nctalkproxyd will integrate itself in the Nextcloud Talk infrastructure while authenticating as a dedicated user. In order to use the bot, this user (e.g. name it "jitsibot") needs to be added as a participent in every Nextcloud Talk room. You will handle that as an admin user from within the Nextcloud GUI.

The following code will interconnect a nctalkproxyd docker container with a nctalkbot-jitsicontainer. Please adapt variables to meet your production/testing needs. The given values are just examples:

% docker volume create nctalkproxyd
% docker network create nctalkbots
% docker run \
	-p 1969:1969 \
	-v nctalkproxyd:/var/lib/nctalkproxyd \
	-e NCTALKPROXYD_DBPATH=/var/lib/nctalkproxyd \
	-e NCTALKPROXYD_USERNAME=botusername \
	-e NCTALKPROXYD_PASSWORD=botpassword \
	-e NCTALKPROXYD_ADDRREMOTE=https://mynextcloud.com \
	--network nctalkchatbots \
	--name nctalkproxyd \
	-d pojntfx/nctalkproxyd
% docker run \
	-e NCTALKBOT_BOT_NAME=botusername \
	-e NCTALKBOT_COMMANDS=\#videochat,\#videocall,\#custom \
	-e NCTALKBOT_SLEEP_TIME=20 \
	-e NCTALKBOT_JITSI_ADDR=meet.jit.si \
	-e NCTALKBOT_JITSI_ROOM_PASSWORD_BYTE_LENGTH=1 \
	-e NCTALKBOT_NCTALKPROXYD_ADDR=localhost:1969 \
	--network nctalkbots \
	-d pojntfx/nctalkbot-jitsi

License

Nextcloud Talk Bot Framework (c) 2020 Felicitas Pojtinger

SPDX-License-Identifier: AGPL-3.0

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.