committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 187 additions and 63 deletions
-
4README.md
-
33conf/nginx.conf
-
6manifest.json
-
28scripts/_common.sh
-
7scripts/install
-
5scripts/upgrade
-
7scripts/upgrade.d/upgrade.13.sh
-
7scripts/upgrade.d/upgrade.14.sh
-
14scripts/upgrade.d/upgrade.last.sh
-
56sources/patches_last_version/app-00-add-logout_url-conf.patch
-
66sources/patches_last_version/app-01-disable-CSPv3-nonce_and_allow-YNH-fonts.patch
-
17sources/patches_last_version/app-02-Allow-for-eval-in-JS-scripts-for-YunoHost-tile.patch
@ -0,0 +1,7 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
# Last available nextcloud version |
||||
|
next_version="14.0.0" |
||||
|
|
||||
|
# Nextcloud tarball checksum sha256 |
||||
|
nextcloud_source_sha256="f965c14286e7aabbfe49c947d86af59597af302c35d10e0b5440e7e6c53b8f47" |
||||
@ -0,0 +1,7 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
# Last available nextcloud version |
||||
|
next_version="15.0.0" |
||||
|
|
||||
|
# Nextcloud tarball checksum sha256 |
||||
|
nextcloud_source_sha256="5bb0c58171353da844019b64080c21078002a59ab956ab72adb958844a98eb78" |
||||
@ -1,10 +1,16 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
# Last available nextcloud version |
# Last available nextcloud version |
||||
next_version="13.0.6" |
|
||||
|
next_version="15.0.4" |
||||
|
|
||||
# Nextcloud tarball checksum sha256 |
# Nextcloud tarball checksum sha256 |
||||
nextcloud_source_sha256="90fc9e960b6a477bb14ee87042b3d158bde95c3f0157677cb4547ca7649968d4" |
|
||||
|
nextcloud_source_sha256="f87db047c174f563e391a22c959d9ace767ca14ef0f97fc394f3061fc63d8f77" |
||||
|
|
||||
# Patch nextcloud files only for the last version |
|
||||
cp -a ../sources/patches_last_version/* ../sources/patches |
|
||||
|
# This function will only be executed upon applying the last upgrade referenced above |
||||
|
last_upgrade_operations () { |
||||
|
# Patch nextcloud files only for the last version |
||||
|
cp -a ../sources/patches_last_version/* ../sources/patches |
||||
|
|
||||
|
# Execute post-upgrade operations later on |
||||
|
(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php occ db:add-missing-indices ; sudo -u $app php occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log") |
||||
|
} |
||||
@ -1,14 +1,62 @@ |
|||||
|
core/Controller/LoginController.php | 25 ++++++++++++++----------- |
||||
|
1 file changed, 14 insertions(+), 11 deletions(-) |
||||
|
|
||||
|
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
|
||||
|
index 182d2bc106..82523e306e 100644
|
||||
--- a/core/Controller/LoginController.php
|
--- a/core/Controller/LoginController.php
|
||||
+++ b/core/Controller/LoginController.php
|
+++ b/core/Controller/LoginController.php
|
||||
@@ -119,7 +119,10 @@
|
|
||||
|
@@ -95,13 +95,13 @@ class LoginController extends Controller {
|
||||
|
* @param Throttler $throttler |
||||
|
*/ |
||||
|
public function __construct($appName, |
||||
|
- IRequest $request,
|
||||
|
- IUserManager $userManager,
|
||||
|
- IConfig $config,
|
||||
|
- ISession $session,
|
||||
|
- IUserSession $userSession,
|
||||
|
- IURLGenerator $urlGenerator,
|
||||
|
- ILogger $logger,
|
||||
|
+ IRequest $request,
|
||||
|
+ IUserManager $userManager,
|
||||
|
+ IConfig $config,
|
||||
|
+ ISession $session,
|
||||
|
+ IUserSession $userSession,
|
||||
|
+ IURLGenerator $urlGenerator,
|
||||
|
+ ILogger $logger,
|
||||
|
Manager $twoFactorManager, |
||||
|
Defaults $defaults, |
||||
|
Throttler $throttler) { |
||||
|
@@ -130,7 +130,10 @@ class LoginController extends Controller {
|
||||
} |
} |
||||
$this->userSession->logout(); |
$this->userSession->logout(); |
||||
|
|
||||
|
|
||||
- $response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
|
- $response = new RedirectResponse($this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm'));
|
||||
+ $redirectUrl = $this->config->getSystemValue('logout_url',
|
+ $redirectUrl = $this->config->getSystemValue('logout_url',
|
||||
+ $this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')
|
|
||||
|
+ $this->urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')
|
||||
+ );
|
+ );
|
||||
+ $response = new RedirectResponse($redirectUrl);
|
+ $response = new RedirectResponse($redirectUrl);
|
||||
$response->addHeader('Clear-Site-Data', '"cache", "cookies", "storage", "executionContexts"'); |
|
||||
|
$response->addHeader('Clear-Site-Data', '"cache", "storage", "executionContexts"'); |
||||
return $response; |
return $response; |
||||
} |
} |
||||
|
@@ -303,10 +306,10 @@ class LoginController extends Controller {
|
||||
|
$previousUser = $user; |
||||
|
$user = $users[0]->getUID(); |
||||
|
if($user !== $previousUser) { |
||||
|
- $loginResult = $this->userManager->checkPassword($user, $password);
|
||||
|
- }
|
||||
|
+ $loginResult = $this->userManager->checkPassword($user, $password);
|
||||
|
} |
||||
|
} |
||||
|
+ }
|
||||
|
|
||||
|
if ($loginResult === false) { |
||||
|
$this->logger->warning('Login failed: \''. $user . |
||||
|
@@ -314,7 +317,7 @@ class LoginController extends Controller {
|
||||
|
['app' => 'core']); |
||||
|
return $this->createLoginFailedResponse($user, $originalUser, |
||||
|
$redirect_url, self::LOGIN_MSG_INVALIDPASSWORD); |
||||
|
- }
|
||||
|
+ }
|
||||
|
|
||||
|
// TODO: remove password checks from above and let the user session handle failures |
||||
|
// requires https://github.com/owncloud/core/pull/24616 |
||||
@ -1,33 +1,33 @@ |
|||||
lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php | 4 ++++ |
|
||||
lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php | 3 ++- |
|
||||
2 files changed, 6 insertions(+), 1 deletion(-) |
|
||||
|
|
||||
diff --git a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
|
|
||||
index 85ae127f5f..91618a09fc 100644
|
|
||||
--- a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
|
|
||||
+++ b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
|
|
||||
@@ -65,6 +65,10 @@ class ContentSecurityPolicyNonceManager {
|
|
||||
* @return bool |
|
||||
*/ |
|
||||
public function browserSupportsCspV3() { |
|
||||
+ // YunoHost patch: disable CSPv3 nonces to:
|
|
||||
+ // - avoid white page on first login from YunoHost portal
|
|
||||
+ // - allow YunoHost tile display
|
|
||||
+ return false;
|
|
||||
$browserWhitelist = [ |
|
||||
Request::USER_AGENT_CHROME, |
|
||||
// Firefox 45+ |
|
||||
diff --git a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
|
|
||||
index 64d4eb6e5d..59d5885620 100644
|
|
||||
--- a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
|
|
||||
+++ b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
|
|
||||
@@ -377,7 +377,8 @@ class EmptyContentSecurityPolicy {
|
|
||||
|
|
||||
if(!empty($this->allowedFontDomains)) { |
|
||||
$policy .= 'font-src ' . implode(' ', $this->allowedFontDomains); |
|
||||
- $policy .= ';';
|
|
||||
+ // YunoHost patch: extend font-src to load data fonts embedded in YunoHost tile script
|
|
||||
+ $policy .= ' data:;';
|
|
||||
} |
|
||||
|
|
||||
if(!empty($this->allowedConnectDomains)) { |
|
||||
|
.../Security/CSP/ContentSecurityPolicyNonceManager.php | 4 ++++ |
||||
|
lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php | 3 ++- |
||||
|
2 files changed, 6 insertions(+), 1 deletion(-) |
||||
|
|
||||
|
diff --git a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
|
||||
|
index 795d8cc864..5f3c961445 100644
|
||||
|
--- a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
|
||||
|
+++ b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
|
||||
|
@@ -70,6 +70,10 @@ class ContentSecurityPolicyNonceManager {
|
||||
|
* @return bool |
||||
|
*/ |
||||
|
public function browserSupportsCspV3(): bool { |
||||
|
+ // YunoHost patch: disable CSPv3 nonces to:
|
||||
|
+ // - avoid white page on first login from YunoHost portal
|
||||
|
+ // - allow YunoHost tile display
|
||||
|
+ return false;
|
||||
|
$browserWhitelist = [ |
||||
|
Request::USER_AGENT_CHROME, |
||||
|
// Firefox 45+ |
||||
|
diff --git a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
|
||||
|
index 3fcef1d0ef..7ce01a68fc 100644
|
||||
|
--- a/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
|
||||
|
+++ b/lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php
|
||||
|
@@ -449,7 +449,8 @@ class EmptyContentSecurityPolicy {
|
||||
|
|
||||
|
if(!empty($this->allowedFontDomains)) { |
||||
|
$policy .= 'font-src ' . implode(' ', $this->allowedFontDomains); |
||||
|
- $policy .= ';';
|
||||
|
+ // YunoHost patch: extend font-src to load data fonts embedded in YunoHost tile script
|
||||
|
+ $policy .= ' data:;';
|
||||
|
} |
||||
|
|
||||
|
if(!empty($this->allowedConnectDomains)) { |
||||
@ -0,0 +1,17 @@ |
|||||
|
lib/public/AppFramework/Http/ContentSecurityPolicy.php | 3 ++- |
||||
|
1 file changed, 2 insertions(+), 1 deletion(-) |
||||
|
|
||||
|
diff --git a/lib/public/AppFramework/Http/ContentSecurityPolicy.php b/lib/public/AppFramework/Http/ContentSecurityPolicy.php
|
||||
|
index e9ecf00036..8e69c8d2dc 100644
|
||||
|
--- a/lib/public/AppFramework/Http/ContentSecurityPolicy.php
|
||||
|
+++ b/lib/public/AppFramework/Http/ContentSecurityPolicy.php
|
||||
|
@@ -44,7 +44,8 @@ class ContentSecurityPolicy extends EmptyContentSecurityPolicy {
|
||||
|
/** @var bool Whether inline JS snippets are allowed */ |
||||
|
protected $inlineScriptAllowed = false; |
||||
|
/** @var bool Whether eval in JS scripts is allowed */ |
||||
|
- protected $evalScriptAllowed = false;
|
||||
|
+ // YunoHost patch: allow for eval in JS scripts for YunoHost tile
|
||||
|
+ protected $evalScriptAllowed = true;
|
||||
|
/** @var array Domains from which scripts can get loaded */ |
||||
|
protected $allowedScriptDomains = [ |
||||
|
'\'self\'', |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue