Skip to content

Commit

Permalink
Merge pull request #10548 from nextcloud/backport/10545/stable25
Browse files Browse the repository at this point in the history
[stable25] fix(page): Decouple the index controller from the executing method
  • Loading branch information
nickvergessen authored Sep 21, 2023
2 parents 0433b82 + 6547a0f commit fbd7b76
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 42 deletions.
18 changes: 13 additions & 5 deletions .drone.jsonnet
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
## 1. Download/install drone binary:
## curl -L https://github.com/harness/drone-cli/releases/latest/download/drone_linux_amd64.tar.gz | tar zx
## curl -L https://github.com/harness/drone-cli/releases/latest/download/drone_linux_amd64.tar.gz | tar zx
## 2. Adjust the matrix as wished
## 3. Run: ./drone jsonnet --stream --format yml
## 4. Commit the result
## 3. Transform jsonnet to yml:
## ./drone jsonnet --stream --format yml
## 4. Export your drone token and the server:
## export DRONE_SERVER=https://drone.nextcloud.com export DRONE_TOKEN=…
## 5. Sign off the changes:
## ./drone sign nextcloud/spreed --save
## 6. Copy the new signature from .drone.yml to `hmac` field in this file
## 7. Transform jsonnet to yml again (to transfer the signature correctly):
## ./drone jsonnet --stream --format yml
## 8. Commit the result

local Pipeline(test_set, database, services) = {
kind: "pipeline",
Expand All @@ -15,7 +23,7 @@ local Pipeline(test_set, database, services) = {
environment: {
APP_NAME: "spreed",
CORE_BRANCH: "stable25",
GUESTS_BRANCH: "master",
GUESTS_BRANCH: "stable-2.5",
NOTIFICATIONS_BRANCH: "stable25",
DATABASEHOST: database
},
Expand Down Expand Up @@ -154,6 +162,6 @@ local PipelinePostgreSQL(test_set) = Pipeline(

{
kind: "signature",
hmac: "84d0676d3e4c9aba8fd34cea87fcad71664bbe2e1a5c5f379bd3e9c0c07f2193"
hmac: "3f632bada9ee7e7b504b4302e1a261856f1720432784f36b911b28302fa54a03"
},
]
62 changes: 31 additions & 31 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-callapi
Expand Down Expand Up @@ -60,7 +60,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat
Expand Down Expand Up @@ -96,7 +96,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat-2
Expand Down Expand Up @@ -132,7 +132,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-command
Expand Down Expand Up @@ -169,7 +169,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation
Expand Down Expand Up @@ -206,7 +206,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation-2
Expand Down Expand Up @@ -242,7 +242,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-federation
Expand Down Expand Up @@ -278,7 +278,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-integration
Expand Down Expand Up @@ -314,7 +314,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing
Expand Down Expand Up @@ -350,7 +350,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: sqlite
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing-2
Expand Down Expand Up @@ -400,7 +400,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-callapi
Expand Down Expand Up @@ -451,7 +451,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat
Expand Down Expand Up @@ -502,7 +502,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat-2
Expand Down Expand Up @@ -553,7 +553,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-command
Expand Down Expand Up @@ -605,7 +605,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation
Expand Down Expand Up @@ -657,7 +657,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation-2
Expand Down Expand Up @@ -708,7 +708,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-federation
Expand Down Expand Up @@ -759,7 +759,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-integration
Expand Down Expand Up @@ -810,7 +810,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing
Expand Down Expand Up @@ -861,7 +861,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: mysql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing-2
Expand Down Expand Up @@ -907,7 +907,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-callapi
Expand Down Expand Up @@ -952,7 +952,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat
Expand Down Expand Up @@ -997,7 +997,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-chat-2
Expand Down Expand Up @@ -1042,7 +1042,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-command
Expand Down Expand Up @@ -1088,7 +1088,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation
Expand Down Expand Up @@ -1134,7 +1134,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-conversation-2
Expand Down Expand Up @@ -1179,7 +1179,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-federation
Expand Down Expand Up @@ -1224,7 +1224,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-integration
Expand Down Expand Up @@ -1269,7 +1269,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing
Expand Down Expand Up @@ -1314,7 +1314,7 @@ steps:
APP_NAME: spreed
CORE_BRANCH: stable25
DATABASEHOST: pgsql
GUESTS_BRANCH: master
GUESTS_BRANCH: stable-2.5
NOTIFICATIONS_BRANCH: stable25
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
name: integration-sharing-2
Expand All @@ -1325,5 +1325,5 @@ trigger:
event:
- push
---
hmac: 84d0676d3e4c9aba8fd34cea87fcad71664bbe2e1a5c5f379bd3e9c0c07f2193
hmac: 3f632bada9ee7e7b504b4302e1a261856f1720432784f36b911b28302fa54a03
kind: signature
21 changes: 17 additions & 4 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function showCall(string $token): Response {
*/
public function authenticatePassword(string $token, string $password = ''): Response {
// This is the entry point from the `/call/{token}` URL which is hardcoded in the server.
return $this->index($token, '', $password);
return $this->pageHandler($token, '', $password);
}

/**
Expand All @@ -154,7 +154,7 @@ public function authenticatePassword(string $token, string $password = ''): Resp
* @return Response
*/
public function notFound(): Response {
return $this->index();
return $this->pageHandler();
}

/**
Expand All @@ -164,7 +164,7 @@ public function notFound(): Response {
* @return Response
*/
public function duplicateSession(): Response {
return $this->index();
return $this->pageHandler();
}

/**
Expand All @@ -173,13 +173,26 @@ public function duplicateSession(): Response {
* @UseSession
* @BruteForceProtection(action=talkRoomToken)
*
* @param string $token
* @param string $callUser
* @return TemplateResponse|RedirectResponse
* @throws HintException
*/
public function index(string $token = '', string $callUser = ''): Response {
if ($callUser !== '') {
$token = '';
}
return $this->pageHandler($token, $callUser);
}

/**
* @param string $token
* @param string $callUser
* @param string $password
* @return TemplateResponse|RedirectResponse
* @throws HintException
*/
public function index(string $token = '', string $callUser = '', string $password = ''): Response {
protected function pageHandler(string $token = '', string $callUser = '', string $password = ''): Response {
$user = $this->userSession->getUser();
if (!$user instanceof IUser) {
return $this->guestEnterRoom($token, $password);
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/run.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

APP_NAME=spreed
NOTIFICATIONS_BRANCH="master"
GUESTS_BRANCH="master"
NOTIFICATIONS_BRANCH="stable25"
GUESTS_BRANCH="stable-2.5"

APP_INTEGRATION_DIR=$PWD
ROOT_DIR=${APP_INTEGRATION_DIR}/../../../..
Expand Down

0 comments on commit fbd7b76

Please sign in to comment.