jfcherng-roundcube / plugin-cloudview

A Roundcube plugin which lets you view documents with cloud viewers.
https://packagist.org/packages/jfcherng-roundcube/cloudview
MIT License
10 stars 5 forks source link

cloudview doesn't work behind ssl-termination #12

Closed ScrumpyJack closed 3 years ago

ScrumpyJack commented 3 years ago

roundcude 1.4.8 cloudview latest

To build the URL to view the attachment, cloudview uses RoundCubeHelper::getSiteUrl but this doesn't seem to work behind ssl-termination (in my case traefik) that adds the ssl proxy header X-Forwarded-Proto: "https"

Can we have an option for force https:// in cloudview directly?

jfcherng commented 3 years ago

Can we have an option for force https:// in cloudview directly?

Sure. Sounds like a valid request to me.

But I wonder if I setup RC as a local site and access it from outside via a reverse proxy, will the returned query URL correct (from RoundCubeHelper::getSiteUrl) rather than something like 127.0.0.1:xxxx/xxxxx...?

https://github.com/jfcherng-roundcube/plugin-cloudview/blob/07259881dba69a260052096f913bf83631a01328/src/Helper/RoundcubeHelper.php#L14-L31

jfcherng commented 3 years ago

Are you able to try this patch? https://github.com/jfcherng-roundcube/plugin-cloudview/commit/04ad9f56005cb09be506d4c845d05000bc1930c5

ScrumpyJack commented 3 years ago

Yes that worked.

I had to add the full path, as I serve under https://example.com/roundcube and the url builder missed out /roundcube

jfcherng commented 3 years ago

Yes that worked.

I had to add the full path, as I serve under example.com/roundcube and the url builder missed out /roundcube

Great! 0.6.11 has been released.