{"id":23739453,"url":"https://github.com/gitayam/matrix-to-discourse","last_synced_at":"2026-01-16T03:09:02.303Z","repository":{"id":251657654,"uuid":"837799493","full_name":"gitayam/matrix-to-discourse","owner":"gitayam","description":"A Maubot plugin that allows users to post messages from a Matrix room to a Discourse forum and search the forum.","archived":false,"fork":false,"pushed_at":"2025-05-28T02:10:48.000Z","size":450,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-04T15:45:52.908Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://forum.irregularchat.com/t/introducing-the-matrix-to-discourse-bot/129","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitayam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-04T04:25:27.000Z","updated_at":"2025-05-28T02:10:51.000Z","dependencies_parsed_at":"2024-11-13T07:20:40.663Z","dependency_job_id":"bb23d9c6-b734-4a44-b9f5-cfa98dc480c0","html_url":"https://github.com/gitayam/matrix-to-discourse","commit_stats":null,"previous_names":["gitayam/matrix-to-discourse"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/gitayam/matrix-to-discourse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitayam%2Fmatrix-to-discourse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitayam%2Fmatrix-to-discourse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitayam%2Fmatrix-to-discourse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitayam%2Fmatrix-to-discourse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitayam","download_url":"https://codeload.github.com/gitayam/matrix-to-discourse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitayam%2Fmatrix-to-discourse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28476883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:02:43.018Z","status":"ssl_error","status_checked_at":"2026-01-16T03:01:27.857Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-31T09:36:54.590Z","updated_at":"2026-01-16T03:09:02.289Z","avatar_url":"https://github.com/gitayam.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Matrix to Discourse Bot \n[Latest v1.2](https://github.com/gitayam/matrix-to-discourse/releases/tag/v1.2)\n\nA Maubot plugin that allows users to post messages from a Matrix room to a Discourse forum and search the forum. This version includes support for multiple AI API options, such as OpenAI, Google Gemini, local LLM models, and the ability to disable AI altogether.\n\n## Configuration\n\nThe bot can be configured to use different AI models for generating titles, summaries, and tags for posts. The following AI models are supported:\n\n- OpenAI (GPT)\n- Google (Gemini)\n- Local LLM (including OpenWebUI)\n- None (no AI model)\n\n### Using OpenWebUI\n\nYou can configure the bot to use OpenWebUI in two ways:\n\n#### Option 1: Using the OpenAI compatibility mode\n\nIf your OpenWebUI instance supports the OpenAI API format, you can configure the bot to use it by setting the `ai_model_type` to `openai` and updating the OpenAI configuration:\n\n```yaml\nai_model_type: \"openai\"\n\nopenai:\n  api_key: \"your_openwebui_api_key\"\n  api_endpoint: \"https://your-openwebui-instance.com/v1/chat/completions\"\n  model: \"your_model_name\"\n  max_tokens: 3000\n  temperature: 1\n```\n\n#### Option 2: Using the Local LLM mode\n\nYou can also configure the bot to use OpenWebUI by setting the `ai_model_type` to `local` and updating the Local LLM configuration:\n\n```yaml\nai_model_type: \"local\"\n\nlocal_llm:\n  connection_type: \"api\"\n  api_endpoint: \"https://your-openwebui-instance.com/v1/chat/completions\"\n  api_format: \"openai\"\n  auth_method: \"bearer\"\n  api_key: \"your_openwebui_api_key\"\n  model: \"your_model_name\"\n  max_tokens: 2048\n  temperature: 0.7\n```\n\n### Example Configuration for OpenWebUI\n\nHere's an example configuration for using OpenWebUI with the provided API key:\n\n```yaml\nai_model_type: \"local\"\n\nlocal_llm:\n  connection_type: \"api\"\n  api_endpoint: \"https://ai.untitledstartup.xyz/v1/chat/completions\"\n  api_format: \"openai\"\n  auth_method: \"bearer\"\n  api_key: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU2NTgxNTExLTg4NjktNDRjMy05NmEyLWJmZTU3MWE2MTAxYiJ9._-DLbG_CVufD9JkxWgexotuMsdYkrp7Nrh4OBgc0sQk\"\n  model: \"your_model_name\"\n  max_tokens: 2048\n  temperature: 0.7\n```\n\nReplace `your_model_name` with the name of the model you want to use.\n\n## Typical Use\n\nTo use this bot you'll need:\n\n- Maubot installed and running on your Matrix server\n- For the most robust and easiest matrix and maubot setup, consider using: matrix-docker-ansible-deploy\n- A Discourse forum that you can post to\n- An AI API key (OpenAI, Google Gemini, or a local LLM model, or you can configure it to use none)\n\nDownload the matrix-to-discourse.mbp file from the releases page and follow the instructions in the Maubot documentation to install the plugin.\n\nYou'll upload the plugin to your Maubot instance, configure it with your AI API key (if applicable), Discourse API key, and Discourse categories and information. You can then use the bot to post messages from Matrix to Discourse and search Discourse from Matrix.\n\nMaubot Instance is typically at: https://matrix.domain.tld/_matrix/maubot/\n\nIf using matrix-docker-ansible-deploy, set it up with the following configuration:\n\n```\nmatrix_bot_maubot_enabled: true\nmatrix_bot_maubot_initial_password: 'secrets_here'\nmatrix_bot_maubot_admins:\n  - user: 'secrets_here'\n```\n\n## AI Model Options\n\nYou can configure the bot to use one of the following AI models for generating titles for Discourse posts:\n\n- OpenAI: Uses OpenAI models like GPT.\n- Google Gemini: Uses Google Gemini for AI-powered tasks.\n- Local LLM: Uses a locally hosted LLM model or a local server such as Ollama.\n- None: If no AI model is configured, the user must provide a title for Discourse posts manually.\n\n### AI Model Configuration\n\n- ai_model_type: Choose the AI model type. Options are openai, google, local, or none.\n- If none, the user must provide a title for each post.\n\n#### OpenAI API Configuration\n\nTo get your API key, sign up at OpenAI Platform or log in at OpenAI Login.\n\n- gpt_api_key: Your OpenAI API key.\n- api_endpoint: API endpoint for OpenAI.\n- model: Model to use for OpenAI (e.g., gpt-4).\n- max_tokens: Maximum tokens for OpenAI responses.\n- temperature: Temperature setting for OpenAI responses.\n\n#### Google Gemini API Configuration\n\nTo use the Google Gemini API, follow the steps to get an API key from Google Cloud Console.\n\n- google_api_key: Your Google Gemini API key.\n- api_endpoint: API endpoint for Google Gemini.\n- model: Google Gemini model (e.g., gemini-1.5-pro).\n- max_tokens: Maximum tokens for responses.\n- temperature: Temperature setting for responses.\n\n#### Local LLM Configuration\n\nTo use a local model (e.g., LLaMA or a model hosted on Ollama), provide the local API details or file path.\n\n- model_path: Path to the local LLM model (e.g., .gguf files).\n- api_endpoint: Endpoint for your local LLM server (e.g., http://localhost:11434/api/chat).\n- model: Local LLM model name.\n\nDiscourse Configuration\n\nTo get your API key, go to https://discourse.example.com/admin/api/keys. Replace discourse.example.com with your Discourse URL.\n\n- discourse_api_key: Your Discourse API key.\n- discourse_api_username: Your Discourse API username.\n- discourse_base_url: Base URL for your Discourse forum.\n- matrix_to_discourse_topic: Mapping of Matrix room IDs to Discourse topic IDs.\n- unsorted_category_id: The category ID for the unsorted category.\n\nExample base-config.yaml\n\n###### AI Model Configuration ######\nai_model_type: \"openai\"  # Choose between \"openai\", \"google\", \"local\", \"none\"\n\n###### OpenAI API Configuration ######\n```\ngpt_api_key: \"your_openai_key_here\"\napi_endpoint: \"https://api.openai.com/v1/chat/completions\"\nmodel: \"gpt-4\"\nmax_tokens: 3000\ntemperature: 1\n```\n\n###### Google Gemini API Configuration ######\n``` \ngoogle_api_key: \"your_google_gemini_key_here\"\napi_endpoint: \"https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent\"\nmodel: \"gemini-1.5-pro\"\nmax_tokens: 3000\ntemperature: 1\n```\n\n###### Local LLM Configuration ######\n```\nmodel_path: \"/path/to/your/local/model\"\napi_endpoint: \"http://localhost:11434/api/chat\"\nmodel: \"llama2\"\nmax_tokens: 3000\ntemperature: 1\n```\n\n###### Discourse Configuration ######\n```\ndiscourse_api_key: \"your_discourse_key_here\"\ndiscourse_api_username: \"your_discourse_username_here\"\ndiscourse_base_url: \"https://discourse.example.com\"\nmatrix_to_discourse_topic:\n  \"!roomID1:server\": \"27\"\n  \"!roomID2:server\": \"4\"\nunsorted_category_id: 9\n```\n\nCommands\n\n`!fpost`\n\nCreates a post on the Discourse forum using the replied-to message's content.\n\n- Usage:\n- !fpost [title] — Posts the replied-to message with the given title to Discourse.\n- If AI is enabled, the bot will generate a title if one is not provided.\n- If AI is set to none, the user must provide a title manually.\n\n!fsearch\n\nSearches the Discourse forum for the specified query.\n\n- Usage: !fsearch \u003cquery\u003e\n- Example:\n- !fsearch matrix bots\n\nInstallation\n\n\t1.\tClone the repository:\n\ngit clone https://github.com/gitayam/matrix-to-discourse.git\n\n\n\t2.\tInstall the required dependencies:\n\npip3 install -r requirements.txt\n\n\n\t3.\tDeploy the bot on your Maubot instance.\n\t4.\tConfigure the base-config.yaml file with your settings.\n\nContributing\n\nTo contribute to this project, please see the Roadmap page for a list of features that need to be implemented.\n\nLicense\n\nThis project is licensed under the GPL-3.0 License. See the LICENSE file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitayam%2Fmatrix-to-discourse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitayam%2Fmatrix-to-discourse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitayam%2Fmatrix-to-discourse/lists"}