onlyoffice-redmine icon indicating copy to clipboard operation
onlyoffice-redmine copied to clipboard

Plugin use problems

Open silasalbuquerque opened this issue 2 years ago • 2 comments

Hello fellows,

Is the ability to use the onlyoffice_redmine plugin on a Redmine that is accessed via subdomain (eg: redmine.mysite.org) or via subdirectory (eg: mysite.org/redmine) working correctly? I'm asking this because I get error when I try to create or edit a file in Redmine (subdomain) using OnlyOffice: image

The error is: image

If Redmine is accessed via subdirectory (eg: mysite.org/redmine), the problem is even worse and the message, after trying to create or edit the file, indicates that the page was not found: image

The error is: image

If there aren't subdomains and Redmine is the only site provided by Apache (root directory), it works fine.

Redmine Environment: Ubuntu server 22.04 Apache 2.4.52 Redmine 5.0.0. stable Ruby 3.0.2-p107 (2021-07-07) [x86_64-linux-gnu] Rails 6.1.4.7 Mysql 8.0.28-0ubuntu4

Redmine plugins: onlyoffice_redmine 1.1.0

Only Office Environment: Ubuntu server 22.04 Nginx 1.18.0 (Ubuntu)

Apache .conf files - Redmine accessed via subdomain:

# Sub domain www.mysite.org
<VirtualHost *:80>
        ServerName www.mysite.org
        DocumentRoot /var/www/html/
        <Directory /var/www/html/>
                AllowOverride All
                Order Allow,Deny
                Allow from All
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/www-error.log
        CustomLog ${APACHE_LOG_DIR}/www-access.log combined
</VirtualHost>

# Sub domain redmine.mysite.org
<VirtualHost *:80>
        ServerName redmine.mysite.org
        RailsEnv production
        DocumentRoot /opt/redmine/public
        <Directory "/opt/redmine/public">
                Allow from All
                Require all granted
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/redmine-error.log
        CustomLog ${APACHE_LOG_DIR}/redmine-access.log combined
</VirtualHost>

Apache .conf files - Redmine accessed via subdirectory:

# domain www.mysite.org
<VirtualHost *:80>
        ServerName www.mysite.org
        RailsEnv production
        DocumentRoot /var/www/html

        <Directory /var/www/html/>
            AllowOverride All
            Order Allow,Deny
            Allow from All
        </Directory>

        <Directory /var/www/html/redmine>
            RailsBaseURI /redmine
            PassengerAppRoot /opt/redmine
            AllowOverride All
            Order Allow,Deny
            Allow from All
        </Directory>

        <Directory /opt/redmine/public>
                Allow from all
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

silasalbuquerque avatar May 10 '22 23:05 silasalbuquerque

I found a way to use the plugin when redmine is installed in a subdirectory. It is a bit hacky, but It seems it is working. What I did is to use mod_rewrite in Apache, and to add the folowing rules to my redmine.conf file

RewriteEngine on
RewriteRule "^/onlyoffice/(.*)$" "/redmine/onlyoffice/$1" [PT]
RewriteRule "^/documents/(.*)$" "/redmine/documents/$1" [PT]
RewriteRule "^/plugin_assets/(.*)$" "/redmine/plugin_assets/$1" [PT]
RewriteRule "^/issues/(.*)$" "/redmine/issues/$1" [PT]

I'm not sure if these are all the rules needed, but it seems to be working fine.

ramezquitao avatar Jun 22 '22 23:06 ramezquitao

Please check if the issue persists with the recently released version 3.0 of the plugin.

SergeyKorneyev avatar Jan 30 '24 13:01 SergeyKorneyev