From f9d5aa7366a377df1e7dfa93ae742a90ac1447e9 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Mon, 21 Sep 2026 11:00:50 +0200 Subject: [PATCH] block onlyoffice and dsp getting enabled on the backend Signed-off-by: Simon L. --- php/public/containers-form-submit.js | 10 ++++++++++ php/src/Data/ConfigurationManager.php | 20 +++++++++++++++++++- php/templates/containers.twig | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/php/public/containers-form-submit.js b/php/public/containers-form-submit.js index f6e5c447..3d397af0 100644 --- a/php/public/containers-form-submit.js +++ b/php/public/containers-form-submit.js @@ -96,6 +96,13 @@ document.addEventListener("DOMContentLoaded", function () { } } + function handleOnlyofficeWarning() { + if (document.getElementById("office-onlyoffice").checked) { + alert('⚠️ The ONLYOFFICE container is deprecated. Please use Nextcloud Office powered by Euro-Office instead!'); + document.getElementById("office-onlyoffice").checked = false + } + } + function handleHarpWarning() { if (document.getElementById("harp").checked) { alert('⚠️ Warning! Enabling this container comes with possible Security problems since you are exposing the docker socket and all its privileges to the HaRP container. Enable this only if you are sure what you are doing!'); @@ -109,6 +116,9 @@ document.addEventListener("DOMContentLoaded", function () { if (document.getElementById("harp")) { document.getElementById("harp").addEventListener('change', handleHarpWarning); } + if (document.getElementById("office-onlyoffice")) { + document.getElementById("office-onlyoffice").addEventListener('change', handleOnlyofficeWarning); + } // Initialize talk-recording visibility on page load handleTalkVisibility(); // Ensure talk-recording is correctly initialized diff --git a/php/src/Data/ConfigurationManager.php b/php/src/Data/ConfigurationManager.php index e1ee3184..5140d28e 100644 --- a/php/src/Data/ConfigurationManager.php +++ b/php/src/Data/ConfigurationManager.php @@ -36,7 +36,7 @@ class ConfigurationManager public bool $isDockerSocketProxyEnabled { // Type-cast because old configs could have 1/0 for this key. get => (bool) $this->get('isDockerSocketProxyEnabled', false); - set { $this->set('isDockerSocketProxyEnabled', $value); } + set { $this->setDockerSocketProxyEnabled($value); } } public bool $isHarpEnabled { @@ -407,6 +407,19 @@ class ConfigurationManager return array_key_exists($key, $this->getConfig()); } + /** + * The docker socket proxy is deprecated in favor of HaRP. It may stay enabled where it already is, but + * must not get enabled anew. + */ + private function setDockerSocketProxyEnabled(bool $value) : void { + // Read via get() because accessing the property inside its own set hook does not invoke the get + // hook. Type-cast because old configs could have 1/0 for this key. + $isEnabled = (bool) $this->get('isDockerSocketProxyEnabled', false); + // ANDing only ever moves the value towards false: disabling always works, while enabling is + // ignored unless it is already enabled. + $this->set('isDockerSocketProxyEnabled', ($isEnabled && $value)); + } + private function unset(string ...$keys) : void { $changed = false; $this->getConfig(); @@ -424,6 +437,11 @@ class ConfigurationManager private function writeOfficeSuite(OfficeSuite $officeSuite) : void { + // Onlyoffice is deprecated in favor of Eurooffice. It may stay selected where it already is, but must + // not get selected anew. + if ($officeSuite === OfficeSuite::Onlyoffice && $this->readOfficeSuite() !== OfficeSuite::Onlyoffice) { + return; + } $this->set('officeSuite', $officeSuite->value); // Remove the deprecated options. $this->unset('isCollaboraEnabled', 'isOnlyofficeEnabled', 'isEuroofficeEnabled'); diff --git a/php/templates/containers.twig b/php/templates/containers.twig index cd8e73e8..0dbb468c 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -27,7 +27,7 @@ {# js for optional containers and additional containers forms #} - + {% set hasBackupLocation = borg_backup_host_location or borg_remote_repo %} {% set isAnyRunning = false %}