A FastAPI service for integrating chatbots with Nextcloud, providing webhook support for real-time interactions.
This repository contains a FastAPI service that acts as a chatbot for integration with Nextcloud. The service listens for webhook events from Nextcloud and processes them accordingly. The setup involves running the FastAPI application locally and connecting it to Nextcloud, which runs in a Docker container.
uvicorn
for running the app.git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
fastapi
uvicorn
httpx
# .env file
NEXTCLOUD_BOT_SECRET=
NEXTCLOUD_URL=http:
# In Development
uvicorn main:app --host <IPv4 Address> --port 8000
This command starts the FastAPI server locally at http://<IPv4_Address>:8000/.
Ensure the Nextcloud instance is running and reachable.
Use the following command to install and configure the bot:
# Replace <> with your actual details.
php /var/www/html/occ talk:bot:install --feature bots-v1 <BOT_NAME> <BOT_SECRET> <BOT_SERVICE_URL/webhook> <DESCRIPTION>
See full documntation here: OCC documentation
Send a test message from Nextcloud and ensure that your FastAPI service logs or processes the message as expected. If communication fails, ensure that Nextcloud can reach the bot address.