Skip to content

Commit

Permalink
Merge branch 'main' into pr/main/00
Browse files Browse the repository at this point in the history
  • Loading branch information
timar committed Jun 25, 2024
2 parents 59789cb + 948900c commit faabbb8
Show file tree
Hide file tree
Showing 34 changed files with 545 additions and 268 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
},
extends: [
'@nextcloud',
'@nextcloud/eslint-config/typescript',
'plugin:cypress/recommended',
],
env: {
Expand All @@ -28,5 +29,7 @@ module.exports = {
'jsdoc/require-param-description': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-property-description': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
}
}
20 changes: 10 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions l10n/gl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions l10n/gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
"Upload extra font file" : "Enviar un ficheiro adicional de tipo de letra",
"Upload a font file" : "Enviar un ficheiro de tipo de letra",
"Available fonts" : "Tipos de letra dispoñíbeis",
"For ideal document compatibility we recommend you to install commonly used fonts. If your users are working with Microsoft Office, installing their proprietary fonts can be done following the documentation." : "Para unha compatibilidade ideal dos documentos, recomendámoslle que instale tipos de letra de uso habitual. Se os seus usuarios están a traballar con Microsoft Office, a instalación das súas fontes propietarias pódese facer seguindo a documentación.",
"Custom fonts documentation" : "Documentación sobre tipos de letra personalizados",
"Secure view settings" : "Axustes de vista segura",
"Secure view enables you to secure documents by embedding a watermark" : "A vista segura permite protexer documentos inserindo unha marca de auga",
"The settings only apply to compatible office files that are opened in Nextcloud Office" : "Os axustes só se aplica aos ficheiros de oficina compatíbeis que se abran en Nextcloud Office",
Expand All @@ -126,8 +128,12 @@
"Make sure to set this URL: {url} in the coolwsd.xml file of your Collabora Online server to ensure the added fonts get loaded automatically." : "Asegúrese de estabelecer este URL: {url} no ficheiro coolwsd.xml do seu servidor de Collabora Online para garantir que os tipos de letra engadidos carguen automaticamente.",
"Failed to save settings" : "Produciuse un fallo ao gardar os axustes",
"Font format not supported ({mime})" : "Formato de tipo de letra non compatíbel ({mime})",
"Guest name" : "Nome do convidado",
"Submit name" : "Enviar o nome",
"Please enter the guest name you wish to use before proceeding to the document. If you don't provide one, the default will be used." : "Introduza o nome de convidado que quere usar antes de continuar co documento. Se non fornece un, utilizarase o predeterminado.",
"Confirm" : "Confirmar",
"Cancel" : "Cancelar",
"Path to save" : "Ruta para gardar",
"Save" : "Gardar",
"Save As" : "Gardar como",
"Link to your Zotero library" : "Ligazón á súa biblioteca de Zotero",
Expand All @@ -146,11 +152,16 @@
"Select file or folder to link to" : "Seleccione o ficheiro ou cartafol ao que ligar",
"Insert image" : "Inserir unha imaxe",
"Document loading failed" : "Produciuse un fallo ao cargar o documento",
"Please check the Collabora Online server log for more details and make sure that Nextcloud can be reached from there." : "Consulte o rexistro do servidor de Collabora Online para obter máis detalles e asegúrese de que se poida acceder a Nextcloud dende alí.",
"Socket connection closed unexpectedly. The reverse proxy might be misconfigured, please contact the administrator." : "O conectador pechouse de xeito inesperado. É posíbel que o proxy inverso estea mal configurado, póñase en contacto coa administración.",
"More information can be found in the reverse proxy documentation" : "Pode atopar máis información na documentación do proxy inverso",
"Close" : "Pechar",
"Edit" : "Editar",
"Starting the built-in CODE server failed" : "Produciuse un erro ao iniciar o servidor CODE integrado",
"Loading {filename} …" : "Cargando {filename}…",
"Open in local editor" : "Abrir no editor local",
"Cluster is scaling …" : "O clúster está a escalar…",
"The collaborative editing was terminated by another user" : "Outro usuario rematou a edición colaborativa",
"Failed to load {productName} - please try again later" : "Produciuse un fallo ao cargar {productName}; ténteo máis adiante",
"{productName} is not configured" : "{productName} non está configurado",
"Error" : "Erro",
Expand All @@ -173,11 +184,13 @@
"Continue editing online" : "Continuar a edición en liña",
"The file should now open locally. If you don't see this happening, make sure that the desktop client is installed on your system." : "O ficheiro agora debería abrirse localmente. Se ve que isto non ocorre, asegúrese de que o cliente de escritorio estea instalado no seu sistema.",
"Retry to open locally" : "Volver tentar abrir localmente",
"Save a copy of the file under a new name and continue editing the new file" : "Garde unha copia do ficheiro cun novo nome e continúe a editar o novo ficheiro",
"Failed to revert the document to older version" : "Produciuse un fallos ao reverter o documento cara a versión anterior",
"Select a personal template folder" : "Seleccione un cartafol de modelos persoais",
"Failed to update the Zotero API key" : "Produciuse un fallo ao actualizar a chave da API de Zotero",
"Saving …" : "Gardando…",
"Built-in CODE server failed to start" : "Non foi posíbel iniciar o servidor CODE integrado",
"Insert image from {name}" : "Inserir unha imaxe dende {name}",
"Remove from favorites" : "Retirar de favoritos",
"Add to favorites" : "Engadir a favoritos",
"Details" : "Detalles",
Expand All @@ -187,6 +200,7 @@
"Guest" : "Convidado",
"Follow current editor" : "Seguir o editor actual",
"New file" : "Novo ficheiro",
"Please enter the filename for the new file" : "Introduza o nome de ficheiro para o novo ficheiro",
"Create" : "Crear",
"New drawing" : "Novo debuxo",
"Could not create file" : "Non foi posíbel crear o ficheiro",
Expand Down
3 changes: 3 additions & 0 deletions l10n/lv.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ OC.L10N.register(
"Failed to upload the file" : "Neizdevās augšupielādēt datni",
"File is too big" : "Datne ir par lielu",
"Invalid file provided" : "Norādīta nederīga datne",
"New document" : "Jauns dokuments",
"New spreadsheet" : "Jauna izklājlapa",
"New presentation" : "Jauna prezentācija",
"Images" : "Attēli",
"Office" : "Birojs",
"Empty" : "Tukšs",
Expand Down
3 changes: 3 additions & 0 deletions l10n/lv.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"Failed to upload the file" : "Neizdevās augšupielādēt datni",
"File is too big" : "Datne ir par lielu",
"Invalid file provided" : "Norādīta nederīga datne",
"New document" : "Jauns dokuments",
"New spreadsheet" : "Jauna izklājlapa",
"New presentation" : "Jauna prezentācija",
"Images" : "Attēli",
"Office" : "Birojs",
"Empty" : "Tukšs",
Expand Down
3 changes: 3 additions & 0 deletions l10n/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ OC.L10N.register(
"Show watermark for shares without download permission" : "Visa vattenstämpel för delningar utan nedladdningstillstånd",
"Show watermark for all link shares" : "Visa vattenstämpel för alla länkdelningar",
"Failed to save settings" : "Kunde inte spara inställningarna",
"Guest name" : "Gästnamn",
"Submit name" : "Skicka namn",
"Please enter the guest name you wish to use before proceeding to the document. If you don't provide one, the default will be used." : "Ange gästnamnet du vill använda innan du fortsätter till dokumentet. Om du inte tillhandahåller något, kommer ett standardnamn att användas.",
"Confirm" : "Bekräfta",
"Cancel" : "Avbryt",
"Save" : "Spara",
Expand Down
3 changes: 3 additions & 0 deletions l10n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
"Show watermark for shares without download permission" : "Visa vattenstämpel för delningar utan nedladdningstillstånd",
"Show watermark for all link shares" : "Visa vattenstämpel för alla länkdelningar",
"Failed to save settings" : "Kunde inte spara inställningarna",
"Guest name" : "Gästnamn",
"Submit name" : "Skicka namn",
"Please enter the guest name you wish to use before proceeding to the document. If you don't provide one, the default will be used." : "Ange gästnamnet du vill använda innan du fortsätter till dokumentet. Om du inte tillhandahåller något, kommer ett standardnamn att användas.",
"Confirm" : "Bekräfta",
"Cancel" : "Avbryt",
"Save" : "Spara",
Expand Down
57 changes: 2 additions & 55 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand All @@ -7,7 +9,6 @@
namespace OCA\Richdocuments\AppInfo;

use OCA\Files_Sharing\Event\ShareLinkAccessedEvent;
use OCA\Richdocuments\AppConfig;
use OCA\Richdocuments\Capabilities;
use OCA\Richdocuments\Db\WopiMapper;
use OCA\Richdocuments\Listener\AddContentSecurityPolicyListener;
Expand All @@ -28,11 +29,8 @@
use OCA\Richdocuments\Preview\OpenDocument;
use OCA\Richdocuments\Preview\Pdf;
use OCA\Richdocuments\Reference\OfficeTargetReferenceProvider;
use OCA\Richdocuments\Service\CapabilitiesService;
use OCA\Richdocuments\Service\DiscoveryService;
use OCA\Richdocuments\Template\CollaboraTemplateProvider;
use OCA\Viewer\Event\LoadViewer;
use OCP\App\IAppManager;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
Expand All @@ -45,7 +43,6 @@
use OCP\Preview\BeforePreviewFetchedEvent;
use OCP\Security\CSP\AddContentSecurityPolicyEvent;
use OCP\Security\FeaturePolicy\AddFeaturePolicyEvent;
use OCP\Server;

class Application extends App implements IBootstrap {
public const APPNAME = 'richdocuments';
Expand All @@ -54,7 +51,6 @@ public function __construct(array $urlParams = []) {
parent::__construct(self::APPNAME, $urlParams);
}


public function register(IRegistrationContext $context): void {
$context->registerTemplateProvider(CollaboraTemplateProvider::class);
$context->registerCapability(Capabilities::class);
Expand Down Expand Up @@ -84,54 +80,5 @@ public function register(IRegistrationContext $context): void {
}

public function boot(IBootContext $context): void {
$this->checkAndEnableCODEServer();
}

public function checkAndEnableCODEServer() {
// Supported only on Linux OS, and x86_64 & ARM64 platforms
$supportedArchs = ['x86_64', 'aarch64'];
$osFamily = PHP_VERSION_ID >= 70200 ? PHP_OS_FAMILY : PHP_OS;
if ($osFamily !== 'Linux' || !in_array(php_uname('m'), $supportedArchs)) {
return;
}

$CODEAppID = (php_uname('m') === 'x86_64') ? 'richdocumentscode' : 'richdocumentscode_arm64';

if (Server::get(IAppManager::class)->isEnabledForUser($CODEAppID)) {
$appConfig = $this->getContainer()->get(AppConfig::class);
$wopi_url = $appConfig->getAppValue('wopi_url');
$isCODEEnabled = strpos($wopi_url, 'proxy.php?req=') !== false;

// Check if we have the wopi_url set to custom currently
if ($wopi_url !== null && $wopi_url !== '' && $isCODEEnabled === false) {
return;
}

$urlGenerator = \OC::$server->getURLGenerator();
$relativeUrl = $urlGenerator->linkTo($CODEAppID, '') . 'proxy.php';
$absoluteUrl = $urlGenerator->getAbsoluteURL($relativeUrl);
$new_wopi_url = $absoluteUrl . '?req=';

// Check if the wopi url needs to be updated
if ($isCODEEnabled && $wopi_url === $new_wopi_url) {
return;
}

$appConfig->setAppValue('wopi_url', $new_wopi_url);
$appConfig->setAppValue('disable_certificate_verification', 'yes');

/** @var DiscoveryService $discoveryService */
$discoveryService = $this->getContainer()->get(DiscoveryService::class);
/** @var CapabilitiesService $capabilitiesService */
$capabilitiesService = $this->getContainer()->get(CapabilitiesService::class);

$discoveryService->resetCache();
$capabilitiesService->resetCache();
try {
$capabilitiesService->fetch();
$discoveryService->fetch();
} catch (\Exception $e) {
}
}
}
}
Loading

0 comments on commit faabbb8

Please sign in to comment.