{"id":19245586,"url":"https://github.com/collaboraonline/collabora-mattermost","last_synced_at":"2025-04-09T11:10:12.411Z","repository":{"id":40291921,"uuid":"212380397","full_name":"CollaboraOnline/collabora-mattermost","owner":"CollaboraOnline","description":"Mattermost plugin to integrate Collabora Online so that users can view or edit files directly in the chat.","archived":false,"fork":false,"pushed_at":"2025-03-11T20:48:29.000Z","size":1780,"stargazers_count":54,"open_issues_count":22,"forks_count":18,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-02T08:35:03.688Z","etag":null,"topics":["go","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CollaboraOnline.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-02T15:47:09.000Z","updated_at":"2025-03-21T10:54:13.000Z","dependencies_parsed_at":"2024-06-18T22:55:48.367Z","dependency_job_id":"91ae785a-81fe-4dc0-b08d-0fc39587aa94","html_url":"https://github.com/CollaboraOnline/collabora-mattermost","commit_stats":{"total_commits":63,"total_committers":9,"mean_commits":7.0,"dds":0.6666666666666667,"last_synced_commit":"d04d3515285a9bf4038212ff9055dee117994884"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CollaboraOnline%2Fcollabora-mattermost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CollaboraOnline%2Fcollabora-mattermost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CollaboraOnline%2Fcollabora-mattermost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CollaboraOnline%2Fcollabora-mattermost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CollaboraOnline","download_url":"https://codeload.github.com/CollaboraOnline/collabora-mattermost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027408,"owners_count":21035594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","hacktoberfest"],"created_at":"2024-11-09T17:28:24.187Z","updated_at":"2025-04-09T11:10:12.380Z","avatar_url":"https://github.com/CollaboraOnline.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Collabora Online Mattermost plugin\n\nThis plugin enables Mattermost users to preview and collaboratively edit documents (simple text files, word, spreadsheet and presentation documents) via a [Collabora Online](https://www.collaboraoffice.com/collabora-online/) Server using the WOPI protocol.\n\n![Demo](https://www.collaboraoffice.com/wp-content/uploads/2019/09/plugin_video.gif)\n\n## How does it work?\n\nThe plugin will parse the messages that contain attachments and will display a list with the files that can be viewed or edited. The file is automatically saved when editing, so you don’t have to do it manually.\n\nBelow you can see a list with the supported formats:\n\n- OpenDocument format: .ods, .odt, .odp, .odg etc.\n- Microsoft: .doc, .docx, .xls, .xlsx, .ppt, .pptx etc.\n- Others: .txt, .csv, .gif, .jpg, .jpeg, .png, .svg, .pdf etc.\n\nPlease note that files like .pdf, .jpg, .svg, and others can only be viewed and not edited.\n  \nCollabora Online uses a WOPI-like protocol (client) to access the files on your Mattermost server (host). You can read more about it on \u003chttps://learn.microsoft.com/en-us/microsoft-365/cloud-storage-partner-program/online/\u003e. Hence, you will also need a Collabora Online instance to use the plugin.\nYou can build your own, or conveniently use a version of our [CODE edition](https://www.collaboraoffice.com/code/).\n\n## Installation\n\n1. You can get the latest version on the [releases page](https://github.com/CollaboraOnline/collabora-mattermost/releases/latest).\n1. Upload this file in the Mattermost **System Console \u003e Plugins \u003e Management** page to install the plugin. To learn more about how to upload a plugin, [see the documentation](https://docs.mattermost.com/administration/plugins.html#custom-plugins).\n1. After installing the plugin, you should go to the plugin's settings in System Console and set the Collabora Online address (more about this below).\n   A page refresh may be required for the plugin’s settings to appear in the System Console.\n\n\n### System Console Settings\n\n- **Collabora Online URL**:\n  The URL (and port) of the Collabora Online server that provides the editing functionality as a WOPI client. Collabora Online should use the same protocol (http:// or https://) as the server installation. Naturally, https:// is recommended.\n\n- **Disable certificate verification**:\n  You must enable this setting and accept the local ssl certificate in your browser to be able to preview and edit files when using a self-signed certificate for CollaboraOnline server.\n\n- **Token Encryption Key**:\n  The plugin internally generates and passes an access token to Collabora Online that is used later by it to do various operations.\n  This setting is the key used to encrypt/decrypt such tokens and must be generated once before starting the plugin for the first time.\n\n## Development\n\nYou can use the self-hosted Collabora Online Server i.e. the [CODE](https://www.collaboraoffice.com/code/) docker image.\n- Collabora Online Development Edition (CODE) is available as a Docker image from [Docker Hub](https://hub.docker.com/r/collabora/code/).\n- Follow [step-by-step instructions](https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html).\n\n```sh\n# pull collabora image\ndocker pull collabora/code\n\n# Run with http url: http://localhost:9980/\ndocker run -t -d -p 127.0.0.1:9980:9980 -p [::1]:9980:9980 -e 'domain=my\\\\.-local\\\\.-ip\\\\.address' -e \"username=admin\" -e \"password=secret\" --restart always --cap-add MKNOD -e \"extra_params=--o:ssl.enable=false\" --name=code collabora/code\n\n# Run with https url: https://localhost:9980/\ndocker run -t -d -p 127.0.0.1:9980:9980 -p [::1]:9980:9980 -e 'domain=my\\\\.-local\\\\.-ip\\\\.address' -e \"username=admin\" -e \"password=secret\" --restart always --cap-add MKNOD --name=code collabora/code\n```\n\n**Additional Notes**: \n\n1. You need to make sure SSL is enabled (with local ssl certificate accepted in your browser) or disabled for both Mattermost and CODE.\n   If one setup has https enabled and the other not, it will not work.\n\n1. Starting the CODE docker container for the first time will take a while!\n   `docker run` returns quickly, but you will not be able to actually use it for the next 5 minutes or so.\n   Look at `docker logs -f code` for details.\n\n1. Replace the string `my-local-ipaddress` with your local IP address!\n   Each `.` of the address must be accompanied by the double-backslash `\\\\`, thus avoiding misinterpretations.\n\n1. The `domain` environment variable should point to the Mattermost server's IP address and not the Collabora Server.\n\n1. If you are using a self-signed certificate with mattermost running over `https`, you must enable the `Disable certificate verification` system console setting \n   and accept the local ssl certificate in your browser to be able to preview files.\n\n## Building the plugin\n\n- Make sure you have following components installed:\n    - Go - v1.16 - [Getting Started](https://golang.org/doc/install)\n      \u003e **Note:** If you have installed Go to a custom location, make sure the `$GOROOT` variable is set properly. Refer [Installing to a custom location](https://golang.org/doc/install#install).\n    - NodeJS - v14.17 and NPM - [Downloading and installing Node.js and npm](https://docs.npmjs.com/getting-started/installing-node). Later version of NodeJS (\u003e= 16) do not work.\n    - make\n    - golangci-lint\n\n- Note that this project uses [Go modules](https://github.com/golang/go/wiki/Modules). Be sure to locate the project outside of `$GOPATH`.\nTo learn more about plugins, see [plugin documentation](https://developers.mattermost.com/extend/plugins/).\n\n- Build your plugin:\n    ```\n    make dist\n    ```\n\n- This will produce a single plugin file (with support for multiple architectures) for upload to your Mattermost server:\n    ```\n    dist/com.collaboraonline.mattermost-x.y.z.tar.gz\n    ```\n\n- This plugin contains both a server and web app portion.\n  Read the Mattermost documentation about the [Developer Workflow](https://developers.mattermost.com/extend/plugins/developer-workflow/)\n  and [Developer Setup](https://developers.mattermost.com/extend/plugins/developer-setup/) for more information about developing and extending plugins.\n\n## Make \u0026 auto installation\n\nTo avoid having to manually install your plugin, build and deploy your plugin using one of the following options.\n\n### Deploying with Local Mode\n\nIf your Mattermost server is running locally, you can enable [local mode](https://docs.mattermost.com/administration/mmctl-cli-tool.html#local-mode) to streamline deploying your plugin. Edit your server configuration as follows:\n\n```json\n{\n    \"ServiceSettings\": {\n        ...\n        \"EnableLocalMode\": true,\n        \"LocalModeSocketLocation\": \"/var/tmp/mattermost_local.socket\"\n    }\n}\n```\n\nand then deploy your plugin:\n```\nmake deploy\n```\n\nYou may also customize the Unix socket path:\n```\nexport MM_LOCALSOCKETPATH=/var/tmp/alternate_local.socket\nmake deploy\n```\n\nIf developing a plugin with a webapp, watch for changes and deploy those automatically:\n```\nexport MM_SERVICESETTINGS_SITEURL=http://localhost:8065\nexport MM_ADMIN_TOKEN=\u003cmm-admin-auth-token\u003e\nmake watch\n```\n\n### Deploying with credentials\n\nAlternatively, you can authenticate with the server's API with credentials:\n```\nexport MM_SERVICESETTINGS_SITEURL=http://localhost:8065\nexport MM_ADMIN_USERNAME=admin\nexport MM_ADMIN_PASSWORD=password\nmake deploy\n```\n\nor with a [personal access token](https://docs.mattermost.com/developer/personal-access-tokens.html):\n```\nexport MM_SERVICESETTINGS_SITEURL=http://localhost:8065\nexport MM_ADMIN_TOKEN=\u003cmm-admin-auth-token\u003e\nmake deploy\n```\n\n## Troubleshooting\n\n- Q. If you get `Connection Refused` error while trying to preview files when running CODE docker image locally.  \n  A. Use docker host network:\n     ```shell\n     docker run -t -d --network host -e 'domain=localhost' -e \"username=admin\" -e \"password=secret\" -e \"DONT_GEN_SSL_CERT=true\" -e \"extra_params=--o:ssl.enable=false\" --restart always --cap-add MKNOD --name=code collabora/code\n     ```\n\n- Q. If you are running development mode on a Mac and see `Cleaning up documet from last session` message and then `Connection Refused` error while trying to preview files while running CODE docker image locally.  \n  A. Make sure mattermost sureURL is set to `host.docker.internal:8065` (if running in development mode). Use domain property properly:\n    ```shell\n    docker run -t -d -p 9980:9980 -e 'domain=localhost|host\\\\.docker\\\\.internal' -e \"username=admin\" -e \"password=secret\" --restart always --cap-add MKNOD -e \"extra_params=--o:ssl.enable=false\" -e \"DONT_GEN_SSL_CERT=true\" --name=code collabora/code\n    ```\n\n- Q. Failed to read document from storage. Please contact your storage server administrator.  \n  A. Make sure you are running both Mattermost and Collabora Server with the same protocol (http/https).\n     Check your Mattermost logs for more information.\n\n- Q. CollaboraOnline Server URL in the system console does not get updated.  \n  A. You may need to disable and re-enable the plugin for the server URL (or other system console settings) changes to take effect.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcollaboraonline%2Fcollabora-mattermost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcollaboraonline%2Fcollabora-mattermost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcollaboraonline%2Fcollabora-mattermost/lists"}