summaryrefslogtreecommitdiffstats
path: root/lib/Controller/PageController.php
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2023-02-09 05:18:03 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2023-02-15 22:00:45 +0100
commitbe3a4f2f0fd51fc62454165ba6ce4a9d33ce1e0a (patch)
treef5adc195d359c44436c13bb079fadc7c887aacca /lib/Controller/PageController.php
parent6fd10016b59a5a23920c5f0efc2d0777c1bb9a1f (diff)
Add specific page for recording calls
Instead of joining the call in the main Talk page now a specific page to be used only by the recording server was added. This will make possible to use a specific UI tailored for call recording, but also to use an internal client of the external signaling server rather than a normal participant. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib/Controller/PageController.php')
-rw-r--r--lib/Controller/PageController.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
index d0985fb6e..5e60d88dc 100644
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -41,6 +41,7 @@ use OCP\App\IAppManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\ContentSecurityPolicy;
+use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\TemplateResponse;
@@ -303,6 +304,56 @@ class PageController extends Controller {
}
/**
+ * @PublicPage
+ * @NoCSRFRequired
+ * @BruteForceProtection(action=talkRoomToken)
+ *
+ * @param string $token
+ * @return TemplateResponse|NotFoundResponse
+ */
+ public function recording(string $token = ''): Response {
+ try {
+ $room = $this->manager->getRoomByToken($token);
+ } catch (RoomNotFoundException $e) {
+ $response = new NotFoundResponse();
+ $response->throttle(['token' => $token]);
+
+ return $response;
+ }
+
+ if (class_exists(LoadViewer::class)) {
+ $this->eventDispatcher->dispatchTyped(new LoadViewer());
+ }
+
+ $this->publishInitialStateForGuest();
+
+ $this->eventDispatcher->dispatchTyped(new LoadAdditionalScriptsEvent());
+ $this->eventDispatcher->dispatchTyped(new RenderReferenceEvent());
+
+ $response = new PublicTemplateResponse($this->appName, 'recording', [
+ 'id-app-content' => '#app-content-vue',
+ 'id-app-navigation' => null,
+ ]);
+
+ $response->setFooterVisible(false);
+ $csp = new ContentSecurityPolicy();
+ $csp->addAllowedConnectDomain('*');
+ $csp->addAllowedMediaDomain('blob:');
+ $csp->addAllowedWorkerSrcDomain('blob:');
+ $csp->addAllowedWorkerSrcDomain("'self'");
+ $csp->addAllowedChildSrcDomain('blob:');
+ $csp->addAllowedChildSrcDomain("'self'");
+ $csp->addAllowedScriptDomain('blob:');
+ $csp->addAllowedScriptDomain("'self'");
+ $csp->addAllowedConnectDomain('blob:');
+ $csp->addAllowedConnectDomain("'self'");
+ $csp->addAllowedImageDomain('https://*.tile.openstreetmap.org');
+ $response->setContentSecurityPolicy($csp);
+
+ return $response;
+ }
+
+ /**
* @param string $token
* @param string $password
* @return TemplateResponse|RedirectResponse