Conversation
Introduce ONLYOFFICE Document Server integration allowing supported DMSF files to be opened for viewing and collaborative editing via the existing server, with callbacks persisting edited content as new DMSF revisions instead of overwriting attachments. - Expose configurable Document Server URLs, JWT settings, and reuse of the official plugin's settings - Add view/edit controls in the file show view and context menu when the file type is supported - Filter force-save callbacks to avoid creating revisions on each automatic save and reject callbacks when newer revisions exist - Document the new plugin settings, migration step, and callback behavior in the README
|
Some test don't pass. Please fix it. Also don't forget to check your code using Rubocop prior committing. |
|
I'll close for now |
|
Run locally: If it passes, push your commits. |
|
Any progress? Can I help somehow? |
|
It's just that I'm not that familiar with Rail and Redmine XD, i need to put some more effort on it. I'll try to get back to it as soon as I can. |
- Add missing English strings to all locales, preserving translations - Add localization regression tests and Rails functional tests - Exempt signed Document Server endpoints from browser login checks - Ensure User.current is restored after callback processing - Normalize Ruby line endings and update test workflow triggers Standalone localization tests and Ruby syntax checks passed. Full Redmine unit and functional suites, RuboCop, and multi-version testing remain pending. These changes have NOT been validated in a complete Redmine environment or with a real ONLYOFFICE Document Server.
|
Thanks for the feedback. I have prepared the localization update and additional regression tests. Important: I have not been able to validate these changes in a complete, running Redmine environment or with a real ONLYOFFICE Document Server. The requested Rails test suites and RuboCop have not been run, and multi-version compatibility has not been verified. 1. LocalizationAll 29 new ONLYOFFICE localization keys are now present in all 17 locale files. For the 15 languages that were missing these entries, I added the English values and marked them for translation. The existing English and Italian entries, as well as all pre-existing translations, have been preserved. A standalone localization regression test was also added to check key coverage, non-empty values, interpolation consistency, and duplicate keys without relying on translation fallbacks. 2. Limited checks completedThe following checks were completed on the prepared update:
These are limited checks only. They do not verify Rails integration, database behavior, HTTP requests, or document editing and saving through ONLYOFFICE. I also added 18 Rails functional tests, but these have not yet been executed in a complete Redmine environment. 3. Required validation still pendingThe following commands still need to be run from the Redmine root directory: bundle exec rake redmine:plugins:test:units NAME=redmine_dmsf RAILS_ENV=test
bundle exec rake redmine:plugins:test:functionals NAME=redmine_dmsf RAILS_ENV=test
bundle exec rubocop -c plugins/redmine_dmsf/.rubocop.yml plugins/redmine_dmsf/Testing across the applicable supported Redmine versions and an end-to-end check with a real ONLYOFFICE Document Server are also still pending. The localization request is addressed in the prepared changes, but the testing request remains open. I am not claiming that the full test suites pass or that the integration is ready for production. |
|
Hi, thanks for taking a look at this. I’ve done some work on the implementation, but I’m not experienced enough with the project to clearly understand the best way to integrate it into the existing codebase. Would you be willing to use my work as a starting point and handle the actual integration yourself? I’d be happy if what I’ve already done could at least serve as a base or reference, and of course I can help clarify anything about my changes if needed. Thanks! |
Summary
This PR adds native ONLYOFFICE Docs integration to DMSF, allowing users to view and edit supported office documents directly from the DMSF interface.
The integration is designed specifically for the DMSF revision model. Unlike standard Redmine attachments, DMSF documents are not overwritten when they are updated. Every successful ONLYOFFICE editing session creates a new
DmsfFileRevision.This addresses the limitation described in:
https://github.com/danmunn/redmine_dmsf/issues/1334https://github.com/ONLYOFFICE/onlyoffice-redmineMotivation
The official ONLYOFFICE Redmine plugin works with Redmine
Attachmentrecords and replaces the underlying attachment content after editing.DMSF uses a different storage and versioning model:
DmsfFile;DmsfFileRevision;For this reason, directly reusing the standard attachment callback would overwrite document content and bypass DMSF revision management.
This implementation integrates ONLYOFFICE directly with DMSF while remaining compatible with an existing ONLYOFFICE Document Server.
Main features
onlyoffice_redmineplugin when available.HS256,HS384, andHS512.User interface
Two new actions are available for supported documents:
The edit action is shown only when the current user has permission to modify the document and the file is not locked by another user.
View sessions use a revision-specific editor key.
Edit sessions use a shared revision key so multiple users can collaborate on the same current revision.
Save and revision behavior
When ONLYOFFICE reports that a document is ready to be saved:
DmsfFileRevisionis created.The source revision is never overwritten.
ONLYOFFICE callback status
2creates the new DMSF revision.Force-save callback status
6is acknowledged but does not create a revision, preventing automatic background saves from generating unnecessary DMSF versions.Conflict handling
The editor configuration includes the ID of the revision used to start the session.
Before saving, the callback verifies that this revision is still the latest revision of the DMSF file.
When another revision has already been created, the callback is rejected instead of silently overwriting or superseding newer work.
Duplicate callback requests are also detected so that repeated ONLYOFFICE notifications do not create multiple identical revisions.
Security
The integration includes:
The JWT secret must match the secret configured on the ONLYOFFICE Document Server.
Configuration
The integration can work in two modes.
Reuse the official ONLYOFFICE plugin settings
When
onlyoffice_redmineis installed, DMSF can reuse its configuration, including:This allows the standard Redmine integration and DMSF integration to use the same Document Server.
Standalone DMSF configuration
DMSF can also be configured independently with:
Network and reverse-proxy support
Separate public and internal URLs are supported.
This is useful when:
URLs included in the editor configuration are rewritten to use the appropriate public or internal endpoint depending on which service consumes them.
Supported formats
The integration is enabled only for configured office-document extensions supported by the connected ONLYOFFICE Document Server.
Unsupported files continue to use the standard DMSF download and preview behavior.
LibreOffice compatibility
This integration does not remove the existing LibreOffice-based preview functionality.
ONLYOFFICE is added as an alternative for online document viewing and editing.
Administrators who no longer need LibreOffice-generated previews may leave the DMSF
office_binsetting empty.Backward compatibility
onlyoffice_redmineplugin is optional.Validation performed
The following checks were performed:
HS256,HS384, andHS512.Deployment notes
After installing the updated plugin, run:
RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=redmine_dmsfThen restart Redmine and configure ONLYOFFICE under:
The Redmine URL used by the Document Server must be reachable from the Document Server container or host.
The Document Server URL configured in Redmine must also be reachable from the Redmine container or host.
Related issues
Closes or addresses:
https://github.com/danmunn/redmine_dmsf/issues/1334