allow to disable/enable talk-recording

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-06-05 15:05:14 +02:00
parent 07faad0ab2
commit 70f27ae304
12 changed files with 113 additions and 4 deletions

View file

@ -6,6 +6,7 @@
"nextcloud-aio-onlyoffice",
"nextcloud-aio-collabora",
"nextcloud-aio-talk",
"nextcloud-aio-talk-recording",
"nextcloud-aio-nextcloud"
],
"display_name": "Apache",
@ -23,6 +24,7 @@
"NEXTCLOUD_HOST=nextcloud-aio-nextcloud",
"COLLABORA_HOST=nextcloud-aio-collabora",
"TALK_HOST=nextcloud-aio-talk",
"TALK_RECORDING_HOST=nextcloud-aio-talk-recording",
"APACHE_PORT=%APACHE_PORT%",
"ONLYOFFICE_HOST=nextcloud-aio-onlyoffice",
"TZ=%TIMEZONE%",
@ -170,7 +172,9 @@
"STARTUP_APPS=%NEXTCLOUD_STARTUP_APPS%",
"ADDITIONAL_APKS=%NEXTCLOUD_ADDITIONAL_APKS%",
"ADDITIONAL_PHP_EXTENSIONS=%NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS%",
"INSTALL_LATEST_MAJOR=%INSTALL_LATEST_MAJOR%"
"INSTALL_LATEST_MAJOR=%INSTALL_LATEST_MAJOR%",
"TALK_RECORDING_ENABLED=%TALK_RECORDING_ENABLED%",
"RECORDING_SECRET=%RECORDING_SECRET%"
],
"restart": "unless-stopped",
"devices": [
@ -259,11 +263,34 @@
"TURN_SECRET=%TURN_SECRET%",
"SIGNALING_SECRET=%SIGNALING_SECRET%",
"TZ=%TIMEZONE%",
"TALK_PORT=%TALK_PORT%"
"TALK_PORT=%TALK_PORT%",
"INTERNAL_SECRET=%TALK_INTERNAL_SECRET%"
],
"secrets": [
"TURN_SECRET",
"SIGNALING_SECRET"
"SIGNALING_SECRET",
"TALK_INTERNAL_SECRET"
],
"restart": "unless-stopped"
},
{
"container_name": "nextcloud-aio-talk-recording",
"display_name": "Talk Recording",
"image": "nextcloud/aio-talk-recording",
"expose": [
"1234"
],
"internal_port": "1234",
"environment": [
"NC_DOMAIN=%NC_DOMAIN%",
"TZ=%TIMEZONE%",
"RECORDING_SECRET=%RECORDING_SECRET%",
"INTERNAL_SECRET=%TALK_INTERNAL_SECRET%"
],
"shm_size": 2147483648,
"secrets": [
"RECORDING_SECRET",
"TALK_INTERNAL_SECRET"
],
"restart": "unless-stopped"
},

View file

@ -0,0 +1,4 @@
document.addEventListener("DOMContentLoaded", function(event) {
// Talk-recording
document.getElementById("talk-recording").disabled = true;
});

View file

@ -120,6 +120,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
'nextcloud_max_time' => $configurationManager->GetNextcloudMaxTime(),
'nextcloud_memory_limit' => $configurationManager->GetNextcloudMemoryLimit(),
'is_dri_device_enabled' => $configurationManager->isDriDeviceEnabled(),
'is_talk_recording_enabled' => $configurationManager->isTalkRecordingEnabled(),
]);
})->setName('profile');
$app->get('/login', function (Request $request, Response $response, array $args) use ($container) {

View file

@ -3,6 +3,16 @@ function makeOptionsFormSubmitVisible() {
optionsFormSubmit.style.display = 'block';
}
function handleTalkVisibility(talk) {
let talkRecording = document.getElementById("talk-recording")
if (talk.checked) {
talkRecording.disabled = false
} else {
talkRecording.checked = false
talkRecording.disabled = true
}
}
document.addEventListener("DOMContentLoaded", function(event) {
// handle submit button for options form
var optionsFormSubmit = document.getElementById("options-form-submit");
@ -25,6 +35,14 @@ document.addEventListener("DOMContentLoaded", function(event) {
// Talk
var talk = document.getElementById("talk");
talk.addEventListener('change', makeOptionsFormSubmitVisible);
talk.addEventListener('change', handleTalkVisibility);
// Talk-recording
var talkRecording = document.getElementById("talk-recording");
talkRecording.addEventListener('change', makeOptionsFormSubmitVisible);
if (!talk.checked) {
talkRecording.disabled = true
}
// Imaginary
var imaginary = document.getElementById("imaginary");

View file

@ -81,6 +81,10 @@ class ContainerDefinitionFetcher
if (!$this->configurationManager->isTalkEnabled()) {
continue;
}
} elseif ($entry['container_name'] === 'nextcloud-aio-talk-recording') {
if (!$this->configurationManager->isTalkRecordingEnabled()) {
continue;
}
} elseif ($entry['container_name'] === 'nextcloud-aio-imaginary') {
if (!$this->configurationManager->isImaginaryEnabled()) {
continue;
@ -179,6 +183,10 @@ class ContainerDefinitionFetcher
if (!$this->configurationManager->isTalkEnabled()) {
continue;
}
} elseif ($value === 'nextcloud-aio-talk-recording') {
if (!$this->configurationManager->isTalkRecordingEnabled()) {
continue;
}
} elseif ($value === 'nextcloud-aio-imaginary') {
if (!$this->configurationManager->isImaginaryEnabled()) {
continue;

View file

@ -95,6 +95,11 @@ class ConfigurationController
} else {
$this->configurationManager->SetTalkEnabledState(0);
}
if (isset($request->getParsedBody()['talk-recording'])) {
$this->configurationManager->SetTalkRecordingEnabledState(1);
} else {
$this->configurationManager->SetTalkRecordingEnabledState(0);
}
if (isset($request->getParsedBody()['imaginary'])) {
$this->configurationManager->SetImaginaryEnabledState(1);
} else {

View file

@ -230,6 +230,27 @@ class ConfigurationManager
$this->WriteConfig($config);
}
public function isTalkRecordingEnabled() : bool {
if (!$this->isTalkEnabled()) {
return false;
}
$config = $this->GetConfig();
if (isset($config['isTalkRecordingEnabled']) && $config['isTalkRecordingEnabled'] === 1) {
return true;
} else {
return false;
}
}
public function SetTalkRecordingEnabledState(int $value) : void {
if (!$this->isTalkEnabled()) {
$value = 0;
}
$config = $this->GetConfig();
$config['isTalkRecordingEnabled'] = $value;
$this->WriteConfig($config);
}
/**
* @throws InvalidSettingConfigurationException
*/

View file

@ -278,6 +278,12 @@ class DockerActionManager
} else {
$replacements[1] = '';
}
} elseif ($out[1] === 'TALK_RECORDING_ENABLED') {
if ($this->configurationManager->isTalkRecordingEnabled()) {
$replacements[1] = 'yes';
} else {
$replacements[1] = '';
}
} elseif ($out[1] === 'ONLYOFFICE_ENABLED') {
if ($this->configurationManager->isOnlyofficeEnabled()) {
$replacements[1] = 'yes';

View file

@ -544,6 +544,11 @@
{% else %}
<input type="checkbox" id="talk" name="talk"><label for="talk">Nextcloud Talk (needs ports {{ talk_port }}/TCP and {{ talk_port }}/UDP open/forwarded in your firewall/router)</label><br><br>
{% endif %}
{% if is_talk_recording_enabled == true %}
<input type="checkbox" id="talk-recording" name="talk-recording" checked="checked"><label for="talk-recording">Talk Recording (needs ~1GB additional RAM)</label><br>
{% else %}
<input type="checkbox" id="talk-recording" name="talk-recording"><label for="talk-recording">Talk Recording (needs ~1GB additional RAM)</label><br>
{% endif %}
{% if is_onlyoffice_enabled == true %}
<input type="checkbox" id="onlyoffice" name="onlyoffice" checked="checked"><label for="onlyoffice">OnlyOffice</label><br>
{% else %}
@ -552,7 +557,7 @@
<input id="options-form-submit" class="button" type="submit" value="Save changes" />
<script type="text/javascript" src="options-form-submit.js"></script>
</form>
<b>Minimal system requirements:</b> When any optional addon is enabled, at least 2GB RAM, a dual-core CPU and 40GB system storage are required. When enabling ClamAV or Fulltextsearch, at least 3GB RAM are required. When enabling everything, at least 4GB RAM are required. Recommended are at least 1GB more RAM than the minimal requirement. For further advices and recommendations see <b><a href="https://github.com/nextcloud/all-in-one/discussions/1335">this documentation</a></b><br><br>
<b>Minimal system requirements:</b> When any optional addon is enabled, at least 2GB RAM, a dual-core CPU and 40GB system storage are required. When enabling ClamAV, Talk Recording or Fulltextsearch, at least 3GB RAM are required. When enabling everything, at least 5GB RAM are required. Recommended are at least 1GB more RAM than the minimal requirement. For further advices and recommendations see <b><a href="https://github.com/nextcloud/all-in-one/discussions/1335">this documentation</a></b><br><br>
{% if isAnyRunning == true or is_x64_platform == false %}
<script type="text/javascript" src="disable-clamav.js"></script>
{% endif %}
@ -562,6 +567,7 @@
<script type="text/javascript" src="disable-onlyoffice.js"></script>
<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>
{% endif %}
{% if is_collabora_enabled == true and isAnyRunning == false and was_start_button_clicked == true %}