Merge pull request #5274 from nextcloud/enh/5063/add-whiteboard

add whiteboard container
This commit is contained in:
Simon L. 2024-09-17 10:17:28 +02:00 committed by GitHub
commit b3f63e5f74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 153 additions and 6 deletions

View file

@ -8,7 +8,8 @@
"nextcloud-aio-collabora",
"nextcloud-aio-talk",
"nextcloud-aio-nextcloud",
"nextcloud-aio-notify-push"
"nextcloud-aio-notify-push",
"nextcloud-aio-whiteboard"
],
"display_name": "Apache",
"image": "nextcloud/aio-apache",
@ -37,7 +38,8 @@
"TZ=%TIMEZONE%",
"APACHE_MAX_SIZE=%APACHE_MAX_SIZE%",
"APACHE_MAX_TIME=%NEXTCLOUD_MAX_TIME%",
"NOTIFY_PUSH_HOST=nextcloud-aio-notify-push"
"NOTIFY_PUSH_HOST=nextcloud-aio-notify-push",
"WHITEBOARD_HOST=nextcloud-aio-whiteboard"
],
"volumes": [
{
@ -148,7 +150,8 @@
"TURN_SECRET",
"SIGNALING_SECRET",
"FULLTEXTSEARCH_PASSWORD",
"IMAGINARY_SECRET"
"IMAGINARY_SECRET",
"WHITEBOARD_SECRET"
],
"volumes": [
{
@ -224,7 +227,9 @@
"APACHE_PORT=%APACHE_PORT%",
"ADDITIONAL_TRUSTED_PROXY=%CADDY_IP_ADDRESS%",
"THIS_IS_AIO=true",
"IMAGINARY_SECRET=%IMAGINARY_SECRET%"
"IMAGINARY_SECRET=%IMAGINARY_SECRET%",
"WHITEBOARD_SECRET=%WHITEBOARD_SECRET%",
"WHITEBOARD_ENABLED=%WHITEBOARD_ENABLED%"
],
"stop_grace_period": 600,
"restart": "unless-stopped",
@ -746,6 +751,39 @@
"cap_drop": [
"NET_RAW"
]
},
{
"container_name": "nextcloud-aio-whiteboard",
"image_tag": "%AIO_CHANNEL%",
"display_name": "Whiteboard",
"image": "nextcloud/aio-whiteboard",
"init": true,
"expose": [
"3002"
],
"internal_port": "3002",
"environment": [
"TZ=%TIMEZONE%",
"NEXTCLOUD_URL=https://%NC_DOMAIN%",
"JWT_SECRET_KEY=%WHITEBOARD_SECRET%",
"STORAGE_STRATEGY=redis",
"REDIS_HOST=nextcloud-aio-redis",
"REDIS_HOST_PASSWORD=%REDIS_PASSWORD%"
],
"secrets": [
"WHITEBOARD_SECRET",
"REDIS_PASSWORD"
],
"restart": "unless-stopped",
"profiles": [
"whiteboard"
],
"networks": [
"nextcloud-aio"
],
"cap_drop": [
"NET_RAW"
]
}
]
}

View file

@ -0,0 +1,5 @@
document.addEventListener("DOMContentLoaded", function(event) {
// Whiteboard
let whiteboard = document.getElementById("whiteboard");
whiteboard.disabled = true;
});

View file

@ -125,6 +125,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
'is_dri_device_enabled' => $configurationManager->isDriDeviceEnabled(),
'is_talk_recording_enabled' => $configurationManager->isTalkRecordingEnabled(),
'is_docker_socket_proxy_enabled' => $configurationManager->isDockerSocketProxyEnabled(),
'is_whiteboard_enabled' => $configurationManager->isWhiteboardEnabled(),
]);
})->setName('profile');
$app->get('/login', function (Request $request, Response $response, array $args) use ($container) {

View file

@ -66,4 +66,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
dockerSocketProxy.addEventListener('change', makeOptionsFormSubmitVisible);
// dockerSocketProxy.addEventListener('change', handleDockerSocketProxyWarning);
}
// Whiteboard
let whiteboard = document.getElementById("whiteboard");
whiteboard.addEventListener('change', makeOptionsFormSubmitVisible);
});

View file

@ -95,6 +95,10 @@ class ContainerDefinitionFetcher
if (!$this->configurationManager->isDockerSocketProxyEnabled()) {
continue;
}
} elseif ($entry['container_name'] === 'nextcloud-aio-whiteboard') {
if (!$this->configurationManager->isWhiteboardEnabled()) {
continue;
}
}
$ports = new ContainerPorts();
@ -200,6 +204,10 @@ class ContainerDefinitionFetcher
if (!$this->configurationManager->isDockerSocketProxyEnabled()) {
continue;
}
} elseif ($value === 'nextcloud-aio-whiteboard') {
if (!$this->configurationManager->isWhiteboardEnabled()) {
continue;
}
}
$dependsOn[] = $value;
}

View file

@ -120,6 +120,11 @@ class ConfigurationController
} else {
$this->configurationManager->SetDockerSocketProxyEnabledState(0);
}
if (isset($request->getParsedBody()['whiteboard'])) {
$this->configurationManager->SetWhiteboardEnabledState(1);
} else {
$this->configurationManager->SetWhiteboardEnabledState(0);
}
}
if (isset($request->getParsedBody()['delete_collabora_dictionaries'])) {

View file

@ -164,6 +164,21 @@ class ConfigurationManager
$this->WriteConfig($config);
}
public function isWhiteboardEnabled() : bool {
$config = $this->GetConfig();
if (isset($config['isWhiteboardEnabled']) && $config['isWhiteboardEnabled'] === 1) {
return true;
} else {
return false;
}
}
public function SetWhiteboardEnabledState(int $value) : void {
$config = $this->GetConfig();
$config['isWhiteboardEnabled'] = $value;
$this->WriteConfig($config);
}
public function SetClamavEnabledState(int $value) : void {
$config = $this->GetConfig();
$config['isClamavEnabled'] = $value;

View file

@ -417,6 +417,12 @@ class DockerActionManager
if (in_array('caddy', $communityContainers, true)) {
$replacements[1] = gethostbyname('nextcloud-aio-caddy');
}
} elseif ($out[1] === 'WHITEBOARD_ENABLED') {
if ($this->configurationManager->isWhiteboardEnabled()) {
$replacements[1] = 'yes';
} else {
$replacements[1] = '';
}
} else {
$secret = $this->configurationManager->GetSecret($out[1]);
if ($secret === "") {

View file

@ -597,6 +597,11 @@
{% else %}
<p><input type="checkbox" id="docker-socket-proxy" name="docker-socket-proxy"><label for="docker-socket-proxy">Docker Socket Proxy (needed for <a href="https://github.com/cloud-py-api/app_api#nextcloud-appapi">Nextcloud App API</a>)</label></p>
{% endif %}
{% if is_whiteboard_enabled == true %}
<p><input type="checkbox" id="whiteboard" name="whiteboard" checked="checked"><label for="whiteboard">Whiteboard</label></p>
{% else %}
<p><input type="checkbox" id="whiteboard" name="whiteboard"><label for="whiteboard">Whiteboard</label></p>
{% endif %}
<input id="options-form-submit" type="submit" value="Save changes" />
<script type="text/javascript" src="options-form-submit.js"></script>
</form>
@ -612,6 +617,7 @@
<script type="text/javascript" src="disable-imaginary.js"></script>
<script type="text/javascript" src="disable-fulltextsearch.js"></script>
<script type="text/javascript" src="disable-talk-recording.js"></script>
<script type="text/javascript" src="disable-whiteboard.js"></script>
{% endif %}
{% if is_collabora_enabled == true and isAnyRunning == false and was_start_button_clicked == true %}