Merge pull request #2674 from nextcloud/enh/noid/trigger-talk-recording

allow to disable/enable talk-recording
This commit is contained in:
Simon L 2023-06-06 09:31:13 +02:00 committed by GitHub
commit c5ff752174
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 117 additions and 4 deletions

View file

@ -583,6 +583,21 @@ else
fi
fi
# Talk recording
if [ -d "/var/www/html/custom_apps/spreed" ]; then
if [ "$TALK_RECORDING_ENABLED" = 'yes' ]; then
while ! nc -z "$TALK_RECORDING_HOST" 1234; do
echo "waiting for Talk Recording to become available..."
sleep 5
done
# TODO: migrate to occ command if that becomes available
RECORDING_SERVERS_STRING="{\"servers\":[{\"server\":\"http://$TALK_RECORDING_HOST:1234/\",\"verify\":true}],\"secret\":\"$RECORDING_SECRET\"}"
php /var/www/html/occ config:app:set spreed recording_servers --value="$RECORDING_SERVERS_STRING"
else
php /var/www/html/occ config:app:delete spreed recording_servers
fi
fi
# Clamav
if [ "$CLAMAV_ENABLED" = 'yes' ]; then
count=0

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",
@ -170,7 +171,10 @@
"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%",
"TALK_RECORDING_HOST=nextcloud-aio-talk-recording"
],
"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 %}

View file

@ -6,6 +6,7 @@ Included are:
- Nextcloud Office
- High performance backend for Nextcloud Files
- High performance backend for Nextcloud Talk and TURN-server
- Nextcloud Talk Recording-server
- Backup solution (based on [BorgBackup](https://github.com/borgbackup/borg#what-is-borgbackup))
- Imaginary (for previews of heic, heif, illustrator, pdf, svg, tiff and webp)
- ClamAV (Antivirus backend for Nextcloud)

View file

@ -9,6 +9,7 @@
- [ ] Nextcloud Talk by opening the Talk app in Nextcloud, creating a new chat and trying to join a call in this chat. Also verifying in the settings that the HPB and turn server work.
- [ ] Imaginary by having a look if when uploading a new picture in Nextcloud, it adds some log entries to the container
- [ ] Fulltextsearch by trying to search for a heading inside a file in Nextcloud
- [ ] Talk-recording by starting a call and trying to record something
- [ ] When Collabora is enabled, it should show below the Optional Addons section a section where you can change the dictionaries for collabora. `de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru` should be a valid setting. E.g. `de.De` not. If already set, it should show a button that allows to remove the setting again.
You can now continue with [060-environmental-variables.md](./060-environmental-variables.md)