Compare commits

...

4 Commits

Author SHA1 Message Date
9ad51dc6cc Revert "Change version to stop update nagging"
This reverts commit 5a52bd67d4c01511de4249dc1c8f4d5a1660e8da.
2017-09-07 20:38:53 -06:00
ecd02e13db Maybe fix things with .onion... 2017-09-07 20:27:00 -06:00
06aba96872 Do the last commit right 2017-09-07 18:08:28 -06:00
189ed76a62 .onion/TOR clients are no longer served HTTPS 2017-09-07 18:05:11 -06:00
4 changed files with 25 additions and 4 deletions

View File

@ -49,7 +49,12 @@ if (class_exists('\OC\Files\Type\TemplateManager')) {
} }
// Whitelist the wopi URL for iframes, required for Firefox // Whitelist the wopi URL for iframes, required for Firefox
$wopiUrl = str_replace("hostname.host", $_SERVER["HTTP_HOST"], \OC::$server->getConfig()->getAppValue('richdocuments', 'wopi_url')); $replaceWith = str_replace("hostname.host", $_SERVER['HTTP_HOST'], $this->config->getAppValue('richdocuments', 'wopi_url'));
// Use plain HTTP for .onion/TOR
if (strpos($replaceWith, ".onion") !== FALSE) {
$replaceWith = str_replace("https://", "http://", $replaceWith);
}
$wopiUrl = $replaceWith;
if ($wopiUrl !== '') { if ($wopiUrl !== '') {
$manager = \OC::$server->getContentSecurityPolicyManager(); $manager = \OC::$server->getContentSecurityPolicyManager();
$policy = new ContentSecurityPolicy(); $policy = new ContentSecurityPolicy();

View File

@ -5,7 +5,7 @@
<description>Collabora Online allows you to to work with all kinds of office documents directly in your browser. This application requires Collabora Cloudsuite to be installed on one of your servers, please read the documentation to learn more about that.</description> <description>Collabora Online allows you to to work with all kinds of office documents directly in your browser. This application requires Collabora Cloudsuite to be installed on one of your servers, please read the documentation to learn more about that.</description>
<summary>Edit office documents directly in your browser.</summary> <summary>Edit office documents directly in your browser.</summary>
<licence>AGPL</licence> <licence>AGPL</licence>
<version>9999_1.12.34_dontsellme</version> <version>1.12.34_dontsellme</version>
<author>Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk</author> <author>Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk</author>
<bugs>https://github.com/nextcloud/richdocuments/issues</bugs> <bugs>https://github.com/nextcloud/richdocuments/issues</bugs>
<repository type="git">https://github.com/nextcloud/richdocuments.git</repository> <repository type="git">https://github.com/nextcloud/richdocuments.git</repository>

View File

@ -129,7 +129,12 @@ class DocumentController extends Controller {
$response = new TemplateResponse('richdocuments', 'documents', $params, 'empty'); $response = new TemplateResponse('richdocuments', 'documents', $params, 'empty');
$policy = new ContentSecurityPolicy(); $policy = new ContentSecurityPolicy();
$policy->addAllowedFrameDomain(str_replace("hostname.host", $_SERVER["HTTP_HOST"], $this->appConfig->getAppValue('wopi_url'))); $replaceWith = str_replace("hostname.host", $_SERVER['HTTP_HOST'], $this->config->getAppValue('richdocuments', 'wopi_url'));
// Use plain HTTP for .onion/TOR
if (strpos($replaceWith, ".onion") !== FALSE) {
$replaceWith = str_replace("https://", "http://", $replaceWith);
}
$policy->addAllowedFrameDomain($replaceWith);
$policy->allowInlineScript(true); $policy->allowInlineScript(true);
$response->setContentSecurityPolicy($policy); $response->setContentSecurityPolicy($policy);
return $response; return $response;
@ -192,7 +197,12 @@ class DocumentController extends Controller {
$response = new TemplateResponse('richdocuments', 'documents', $params, 'empty'); $response = new TemplateResponse('richdocuments', 'documents', $params, 'empty');
$policy = new ContentSecurityPolicy(); $policy = new ContentSecurityPolicy();
$policy->addAllowedFrameDomain(str_replace("hostname.host", $_SERVER["HTTP_HOST"], $this->appConfig->getAppValue('wopi_url'))); $replaceWith = str_replace("hostname.host", $_SERVER['HTTP_HOST'], $this->config->getAppValue('richdocuments', 'wopi_url'));
// Use plain HTTP for .onion/TOR
if (strpos($replaceWith, ".onion") !== FALSE) {
$replaceWith = str_replace("https://", "http://", $replaceWith);
}
$policy->addAllowedFrameDomain($replaceWith);
$policy->allowInlineScript(true); $policy->allowInlineScript(true);
$response->setContentSecurityPolicy($policy); $response->setContentSecurityPolicy($policy);
return $response; return $response;

View File

@ -89,6 +89,12 @@ class DiscoveryManager {
$responseBody = $response->getBody(); $responseBody = $response->getBody();
$replaceWith = str_replace("hostname.host", $_SERVER['HTTP_HOST'], $this->config->getAppValue('richdocuments', 'wopi_url')); $replaceWith = str_replace("hostname.host", $_SERVER['HTTP_HOST'], $this->config->getAppValue('richdocuments', 'wopi_url'));
// Use plain HTTP for .onion/TOR
if (strpos($replaceWith, ".onion") !== FALSE) {
$replaceWith = str_replace("https://", "http://", $replaceWith);
}
$responseBodyMangled = str_replace($this->config->getAppValue('richdocuments', 'wopi_internal_url'), $replaceWith, $responseBody); $responseBodyMangled = str_replace($this->config->getAppValue('richdocuments', 'wopi_internal_url'), $replaceWith, $responseBody);
// Skylar: Disable saving too, we don't need it if we're not loading ever // Skylar: Disable saving too, we don't need it if we're not loading ever
/*$file->putContent( /*$file->putContent(