Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
e1937ef
first working state of matterbridge PoC, server side only
Aug 11, 2020
5486c64
check if participant is moderator for all bridge related actions
Aug 12, 2020
15b94b4
implement UI for matterbridge management
Aug 12, 2020
2fa346e
add 'check all' bridge manager method
Aug 12, 2020
ec55933
fix relaunch when check, add new default part for my room, clean matt…
Aug 13, 2020
5532cfb
small design improvement
Aug 13, 2020
da8730d
check bridge process when getting it
Aug 13, 2020
784323d
implement method to kill zombie matterbridge processes
Aug 13, 2020
328fe65
stupid
Aug 13, 2020
2504198
Adjust the design of bridge basic settings
gary-kim Aug 14, 2020
7c588e9
design detail
Aug 14, 2020
b3399bc
php lint
Aug 14, 2020
3b2845d
add label to all inputs
Aug 14, 2020
71b0414
add a few systems
Aug 16, 2020
ebb2d83
factorize parts in one versatile component
Aug 17, 2020
b76e7ee
avoid deletion of my part
Aug 17, 2020
0eb911c
add discord and telegram
Aug 17, 2020
2b0ad77
add steam
Aug 17, 2020
f1f78e7
add zulip
Aug 17, 2020
67f6aa5
first round of design fixes
Aug 17, 2020
c2df67b
add info links (to mb doc) for all bridge type
Aug 17, 2020
b550604
simplify part management now that there is no local part in UI, get r…
Aug 17, 2020
8b1d5fa
fix after first review
Aug 17, 2020
6b824b4
lint fix
Aug 17, 2020
09b053e
create bot user if it does not exist
Aug 18, 2020
01a0114
begin to manage bot access token
Aug 18, 2020
a960586
generate new room-specific app token when enabling bridge, revoke all…
Aug 19, 2020
ae873eb
add doc
Aug 19, 2020
18ab5f2
new DB table to store bridge configs
Aug 19, 2020
260494d
set avatar to brige bot user
Aug 19, 2020
298f0d9
review fixes
Aug 19, 2020
824674a
directly load image content
Aug 19, 2020
a8c3f51
change config key for bot password
Aug 20, 2020
c1d761c
rebased to get settings tab, + another round of fixes
Aug 20, 2020
efb28a4
improve insert/update in bridge table
Aug 20, 2020
f931672
Use room object from enviroment
nickvergessen Aug 20, 2020
df0f9ec
log debug info, level 1
Aug 20, 2020
9b83640
lint fix
Aug 20, 2020
9ed27b3
basic toggle matterbridge via admin settings
Aug 21, 2020
8013641
stop all bridges when disabling admin setting
Aug 21, 2020
452c7dc
lint
Aug 21, 2020
4bacb51
lint2
Aug 21, 2020
90d758c
lint3
Aug 21, 2020
4ecff56
Adjust design of Matterbridge integration
jancborchardt Aug 21, 2020
9a94fb3
tab replacement
Aug 21, 2020
6d0b2c8
Allow to install the Matterbridge app directly in the Talk settings
nickvergessen Aug 24, 2020
6ee5c04
Move stopAllBridges to a controller without a Room
nickvergessen Aug 24, 2020
be31ca6
Fix migration
nickvergessen Aug 24, 2020
791f831
Only available for admins
nickvergessen Aug 24, 2020
d112702
Simple ticks without parameters
nickvergessen Aug 24, 2020
1c8004f
Add a description to the admin settings
nickvergessen Aug 24, 2020
f1269e0
settings routes before conversation specific ones
nickvergessen Aug 24, 2020
4ad2f3b
Make installing feel smoother and explain the timeout
nickvergessen Aug 24, 2020
a7ca2c7
Rename to Matterbridge everywhere
nickvergessen Aug 24, 2020
4700152
Fix unit tests
nickvergessen Aug 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ And in the works for the [coming versions](https://github.com/nextcloud/spreed/m

]]></description>

<version>10.0.0-dev.3</version>
<version>10.0.0-dev.4</version>
<licence>agpl</licence>

<author>Daniel Calviño Sánchez</author>
Expand Down
50 changes: 50 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,56 @@
],
],

/**
* Bridge settings
*/
[
'name' => 'MatterbridgeSettings#stopAllBridges',
'url' => '/api/{apiVersion}/bridge',
'verb' => 'DELETE',
'requirements' => [
'apiVersion' => 'v1',
],
],
[
'name' => 'MatterbridgeSettings#getMatterbridgeVersion',
'url' => '/api/{apiVersion}/bridge/version',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v1',
],
],

/**
* Bridges
*/
[
'name' => 'Matterbridge#getBridgeOfRoom',
'url' => '/api/{apiVersion}/bridge/{token}',
'verb' => 'GET',
'requirements' => [
'apiVersion' => 'v1',
'token' => '^[a-z0-9]{4,30}$',
],
],
[
'name' => 'Matterbridge#editBridgeOfRoom',
'url' => '/api/{apiVersion}/bridge/{token}',
'verb' => 'PUT',
'requirements' => [
'apiVersion' => 'v1',
'token' => '^[a-z0-9]{4,30}$',
],
],
[
'name' => 'Matterbridge#deleteBridgeOfRoom',
'url' => '/api/{apiVersion}/bridge/{token}',
'verb' => 'DELETE',
'requirements' => [
'apiVersion' => 'v1',
'token' => '^[a-z0-9]{4,30}$',
],
],

/**
* PublicShareAuth
Expand Down
9 changes: 4 additions & 5 deletions css/settings-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@
}


.commands.section {
.commands.section,
.matterbridge.section {
.icon-beta-feature {
@include icon-color('customization', 'categories', $color-warning, 1, true);
}
}

p.settings-hint > a {
text-decoration: underline !important;
}

.commands.section {
#commands_list {
display: grid;
grid-template-columns: minmax(100px, 200px) minmax(100px, 200px) 1fr minmax(100px, 200px) minmax(100px, 200px);
Expand Down
Binary file added img/bridge-bot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
103 changes: 103 additions & 0 deletions lib/Controller/MatterbridgeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?php

declare(strict_types=1);
/**
* @copyright Copyright (c) 2020 Julien Veyssier <[email protected]>
*
* @author Julien Veyssier <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\Talk\Controller;

use OCA\Talk\Exceptions\ImpossibleToKillException;
use OCA\Talk\Manager;
use OCA\Talk\MatterbridgeManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;

class MatterbridgeController extends AEnvironmentAwareController {
/** @var string|null */
protected $userId;
/** @var Manager */
protected $manager;
/** @var MatterbridgeManager */
protected $bridgeManager;

public function __construct(string $appName,
?string $UserId,
IRequest $request,
Manager $manager,
MatterbridgeManager $bridgeManager) {
parent::__construct($appName, $request);
$this->userId = $UserId;
$this->manager = $manager;
$this->bridgeManager = $bridgeManager;
}

/**
* Get bridge information of one room
*
* @NoAdminRequired
* @RequireLoggedInModeratorParticipant
*
* @return DataResponse
*/
public function getBridgeOfRoom(): DataResponse {
$this->bridgeManager->checkBridge($this->room);
$bridge = $this->bridgeManager->getBridgeOfRoom($this->room);
return new DataResponse($bridge);
}

/**
* Edit bridge information of one room
*
* @NoAdminRequired
* @RequireLoggedInModeratorParticipant
*
* @param bool $enabled
* @param array $parts
* @return DataResponse
*/
public function editBridgeOfRoom(bool $enabled, array $parts = []): DataResponse {
try {
$success = $this->bridgeManager->editBridgeOfRoom($this->room, $enabled, $parts);
} catch (ImpossibleToKillException $e) {
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_NOT_ACCEPTABLE);
}
return new DataResponse($success);
}

/**
* Delete bridge of one room
*
* @NoAdminRequired
* @RequireLoggedInModeratorParticipant
*
* @return DataResponse
*/
public function deleteBridgeOfRoom(): DataResponse {
try {
$success = $this->bridgeManager->deleteBridgeOfRoom($this->room);
} catch (ImpossibleToKillException $e) {
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_NOT_ACCEPTABLE);
}
return new DataResponse($success);
}
}
77 changes: 77 additions & 0 deletions lib/Controller/MatterbridgeSettingsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

declare(strict_types=1);
/**
* @copyright Copyright (c) 2020 Joas Schilling <[email protected]>
*
* @author Joas Schilling <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\Talk\Controller;

use OCA\Talk\MatterbridgeManager;
use OCA\Talk\Exceptions\ImpossibleToKillException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\IRequest;

class MatterbridgeSettingsController extends OCSController {
/** @var MatterbridgeManager */
protected $bridgeManager;

public function __construct(string $appName,
IRequest $request,
MatterbridgeManager $bridgeManager) {
parent::__construct($appName, $request);
$this->bridgeManager = $bridgeManager;
}

/**
* Get Matterbridge version
*
* @return DataResponse
*/
public function getMatterbridgeVersion(): DataResponse {
$version = $this->bridgeManager->getCurrentVersionFromBinary();
if ($version === null) {
return new DataResponse([
'error' => 'binary',
], Http::STATUS_BAD_REQUEST);
}

return new DataResponse([
'version' => $version,
]);
}

/**
* Stop all bridges
*
* @return DataResponse
*/
public function stopAllBridges(): DataResponse {
try {
$success = $this->bridgeManager->stopAllBridges();
} catch (ImpossibleToKillException $e) {
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_NOT_ACCEPTABLE);
}
return new DataResponse($success);
}
}
1 change: 1 addition & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ public function index(string $token = '', string $callUser = '', string $passwor
}

$this->publishInitialStateForUser($user, $this->rootFolder, $this->appManager);
$this->initialStateService->provideInitialState('talk', 'enable_matterbridge', $this->serverConfig->getAppValue('spreed', 'enable_matterbridge', '0') === '1');

if (class_exists(LoadViewer::class)) {
$this->eventDispatcher->dispatchTyped(new LoadViewer());
Expand Down
28 changes: 28 additions & 0 deletions lib/Exceptions/ImpossibleToKillException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);
/**
* @copyright Copyright (c) 2020 Julien Veyssier <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/


namespace OCA\Talk\Exceptions;

class ImpossibleToKillException extends \Exception {
}
Loading