aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/InstalledVersions.php20
-rw-r--r--lib/composer/composer/installed.php4
-rw-r--r--lib/l10n/be.js1
-rw-r--r--lib/l10n/be.json1
-rw-r--r--lib/l10n/fr.js8
-rw-r--r--lib/l10n/fr.json8
-rw-r--r--lib/l10n/sw.js20
-rw-r--r--lib/l10n/sw.json20
-rw-r--r--lib/private/AppFramework/Http/Request.php47
-rw-r--r--lib/private/Files/Cache/CacheQueryBuilder.php2
-rw-r--r--lib/private/Files/SetupManager.php12
-rw-r--r--lib/private/Files/Storage/DAV.php4
-rw-r--r--lib/private/Files/Utils/Scanner.php8
-rw-r--r--lib/private/Setup/AbstractDatabase.php1
14 files changed, 114 insertions, 42 deletions
diff --git a/lib/composer/composer/InstalledVersions.php b/lib/composer/composer/InstalledVersions.php
index 6d29bff66aa..2052022fd8e 100644
--- a/lib/composer/composer/InstalledVersions.php
+++ b/lib/composer/composer/InstalledVersions.php
@@ -27,6 +27,12 @@ use Composer\Semver\VersionParser;
class InstalledVersions
{
/**
+ * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
+ * @internal
+ */
+ private static $selfDir = null;
+
+ /**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
@@ -323,6 +329,18 @@ class InstalledVersions
}
/**
+ * @return string
+ */
+ private static function getSelfDir()
+ {
+ if (self::$selfDir === null) {
+ self::$selfDir = strtr(__DIR__, '\\', '/');
+ }
+
+ return self::$selfDir;
+ }
+
+ /**
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
@@ -336,7 +354,7 @@ class InstalledVersions
$copiedLocalDir = false;
if (self::$canGetVendors) {
- $selfDir = strtr(__DIR__, '\\', '/');
+ $selfDir = self::getSelfDir();
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
diff --git a/lib/composer/composer/installed.php b/lib/composer/composer/installed.php
index 1cfe4bf1d74..cd89ef10785 100644
--- a/lib/composer/composer/installed.php
+++ b/lib/composer/composer/installed.php
@@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => 'b7422ba97b7b42a9955a52031a32457ca521d740',
+ 'reference' => '3fce359f4c606737b21b1b4213efd5bc5536e867',
'type' => 'library',
'install_path' => __DIR__ . '/../../../',
'aliases' => array(),
@@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => 'b7422ba97b7b42a9955a52031a32457ca521d740',
+ 'reference' => '3fce359f4c606737b21b1b4213efd5bc5536e867',
'type' => 'library',
'install_path' => __DIR__ . '/../../../',
'aliases' => array(),
diff --git a/lib/l10n/be.js b/lib/l10n/be.js
index eb38c0ed05e..fe8c6a25449 100644
--- a/lib/l10n/be.js
+++ b/lib/l10n/be.js
@@ -6,6 +6,7 @@ OC.L10N.register(
"Files" : "Файлы",
"_%n year ago_::_%n years ago_" : ["%n год таму","%n гады таму","%n гадоў таму","%n гадоў таму"],
"seconds ago" : "с таму",
+ "%1$s (renamed)" : "%1$s (перайменаваны)",
"Templates" : "Шаблоны",
"__language_name__" : "Беларуская",
"Apps" : "Праграмы",
diff --git a/lib/l10n/be.json b/lib/l10n/be.json
index d944caed749..6fdb1056171 100644
--- a/lib/l10n/be.json
+++ b/lib/l10n/be.json
@@ -4,6 +4,7 @@
"Files" : "Файлы",
"_%n year ago_::_%n years ago_" : ["%n год таму","%n гады таму","%n гадоў таму","%n гадоў таму"],
"seconds ago" : "с таму",
+ "%1$s (renamed)" : "%1$s (перайменаваны)",
"Templates" : "Шаблоны",
"__language_name__" : "Беларуская",
"Apps" : "Праграмы",
diff --git a/lib/l10n/fr.js b/lib/l10n/fr.js
index edfe25a6362..3356ec5f0f2 100644
--- a/lib/l10n/fr.js
+++ b/lib/l10n/fr.js
@@ -371,10 +371,10 @@ OC.L10N.register(
"Output images" : "Images de sortie",
"The generated images" : "Les images générées",
"Generate speech" : "Générer une synthèse vocale",
- "Generate speech from a transcript" : "Générer la vocalisation à partir d'une transcription",
- "Write transcript that you want the assistant to generate speech from" : "Écrire la transcription à partir de laquelle vous voulez générer la vocalisation",
- "Output speech" : "Sortie de la vocalisation",
- "The generated speech" : "La vocalisation générée",
+ "Generate speech from a transcript" : "Générer synthèse vocale à partir d'une transcription",
+ "Write transcript that you want the assistant to generate speech from" : "Écrire la transcription à partir de laquelle vous voulez générer la synthèse vocale",
+ "Output speech" : "Synthèse vocale",
+ "The generated speech" : "La synthèse vocale générée",
"Free text to text prompt" : "Texte libre à texte libre",
"Runs an arbitrary prompt through a language model that returns a reply" : "Exécute une commande arbitraire à l'aide d'un modèle linguistique qui génère une réponse",
"Describe a task that you want the assistant to do or ask a question" : "Décrivez une tâche que vous voulez que l'assistant effectue ou posez une question",
diff --git a/lib/l10n/fr.json b/lib/l10n/fr.json
index 6f1edd70da2..4d7ac492a36 100644
--- a/lib/l10n/fr.json
+++ b/lib/l10n/fr.json
@@ -369,10 +369,10 @@
"Output images" : "Images de sortie",
"The generated images" : "Les images générées",
"Generate speech" : "Générer une synthèse vocale",
- "Generate speech from a transcript" : "Générer la vocalisation à partir d'une transcription",
- "Write transcript that you want the assistant to generate speech from" : "Écrire la transcription à partir de laquelle vous voulez générer la vocalisation",
- "Output speech" : "Sortie de la vocalisation",
- "The generated speech" : "La vocalisation générée",
+ "Generate speech from a transcript" : "Générer synthèse vocale à partir d'une transcription",
+ "Write transcript that you want the assistant to generate speech from" : "Écrire la transcription à partir de laquelle vous voulez générer la synthèse vocale",
+ "Output speech" : "Synthèse vocale",
+ "The generated speech" : "La synthèse vocale générée",
"Free text to text prompt" : "Texte libre à texte libre",
"Runs an arbitrary prompt through a language model that returns a reply" : "Exécute une commande arbitraire à l'aide d'un modèle linguistique qui génère une réponse",
"Describe a task that you want the assistant to do or ask a question" : "Décrivez une tâche que vous voulez que l'assistant effectue ou posez une question",
diff --git a/lib/l10n/sw.js b/lib/l10n/sw.js
index 9e10b43b403..0eca41da17e 100644
--- a/lib/l10n/sw.js
+++ b/lib/l10n/sw.js
@@ -45,9 +45,27 @@ OC.L10N.register(
"Storage is temporarily not available" : "Uhifadhi haupo kwa muda",
"Images" : "Picha",
"Question" : "Swali",
+ "Voice chat with the assistant" : "Voice chat with the assistant",
+ "System prompt" : "System prompt",
+ "Define rules and assumptions that the assistant should follow during the conversation." : "Define rules and assumptions that the assistant should follow during the conversation.",
+ "Chat voice message" : "Chat voice message",
+ "Chat history" : "Chat history",
+ "Input transcript" : "Input transcript",
+ "Transcription of the audio input" : "Transcription of the audio input",
+ "Response voice message" : "Response voice message",
+ "The generated voice response as part of the conversation" : "The generated voice response as part of the conversation",
+ "Output transcript" : "Output transcript",
+ "Transcription of the audio output" : "Transcription of the audio output",
+ "Transcribe audio" : "Transcribe audio",
+ "Audio input" : "Audio input",
"Confirmation" : "Uthibitisho",
+ "Prompt" : "Prompt",
+ "Describe a task that you want the assistant to do or ask a question" : "Describe a task that you want the assistant to do or ask a question",
+ "The history of chat messages before the current message, starting with a message by the user" : "The history of chat messages before the current message, starting with a message by the user",
"Text" : "Maandishi",
+ "Summarize" : "Summarize",
"Summary" : "Muhtasari",
- "Translate" : "Tafsiri"
+ "Translate" : "Tafsiri",
+ "Result" : "Result"
},
"nplurals=2; plural=(n != 1);");
diff --git a/lib/l10n/sw.json b/lib/l10n/sw.json
index a645af4e6a8..5759a8f07f4 100644
--- a/lib/l10n/sw.json
+++ b/lib/l10n/sw.json
@@ -43,9 +43,27 @@
"Storage is temporarily not available" : "Uhifadhi haupo kwa muda",
"Images" : "Picha",
"Question" : "Swali",
+ "Voice chat with the assistant" : "Voice chat with the assistant",
+ "System prompt" : "System prompt",
+ "Define rules and assumptions that the assistant should follow during the conversation." : "Define rules and assumptions that the assistant should follow during the conversation.",
+ "Chat voice message" : "Chat voice message",
+ "Chat history" : "Chat history",
+ "Input transcript" : "Input transcript",
+ "Transcription of the audio input" : "Transcription of the audio input",
+ "Response voice message" : "Response voice message",
+ "The generated voice response as part of the conversation" : "The generated voice response as part of the conversation",
+ "Output transcript" : "Output transcript",
+ "Transcription of the audio output" : "Transcription of the audio output",
+ "Transcribe audio" : "Transcribe audio",
+ "Audio input" : "Audio input",
"Confirmation" : "Uthibitisho",
+ "Prompt" : "Prompt",
+ "Describe a task that you want the assistant to do or ask a question" : "Describe a task that you want the assistant to do or ask a question",
+ "The history of chat messages before the current message, starting with a message by the user" : "The history of chat messages before the current message, starting with a message by the user",
"Text" : "Maandishi",
+ "Summarize" : "Summarize",
"Summary" : "Muhtasari",
- "Translate" : "Tafsiri"
+ "Translate" : "Tafsiri",
+ "Result" : "Result"
},"pluralForm" :"nplurals=2; plural=(n != 1);"
} \ No newline at end of file
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index e662cb8679a..7cc7467675c 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -14,6 +14,7 @@ use OC\Security\TrustedDomainHelper;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IRequestId;
+use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\IpUtils;
/**
@@ -627,36 +628,46 @@ class Request implements \ArrayAccess, \Countable, IRequest {
/**
* Returns the server protocol. It respects one or more reverse proxies servers
- * and load balancers
+ * and load balancers. Precedence:
+ * 1. `overwriteprotocol` config value
+ * 2. `X-Forwarded-Proto` header value
+ * 3. $_SERVER['HTTPS'] value
+ * If an invalid protocol is provided, defaults to http, continues, but logs as an error.
+ *
* @return string Server protocol (http or https)
*/
public function getServerProtocol(): string {
- if ($this->config->getSystemValueString('overwriteprotocol') !== ''
- && $this->isOverwriteCondition()) {
- return $this->config->getSystemValueString('overwriteprotocol');
- }
+ $proto = 'http';
- if ($this->fromTrustedProxy() && isset($this->server['HTTP_X_FORWARDED_PROTO'])) {
+ if ($this->config->getSystemValueString('overwriteprotocol') !== ''
+ && $this->isOverwriteCondition()
+ ) {
+ $proto = strtolower($this->config->getSystemValueString('overwriteprotocol'));
+ } elseif ($this->fromTrustedProxy()
+ && isset($this->server['HTTP_X_FORWARDED_PROTO'])
+ ) {
if (str_contains($this->server['HTTP_X_FORWARDED_PROTO'], ',')) {
$parts = explode(',', $this->server['HTTP_X_FORWARDED_PROTO']);
$proto = strtolower(trim($parts[0]));
} else {
$proto = strtolower($this->server['HTTP_X_FORWARDED_PROTO']);
}
-
- // Verify that the protocol is always HTTP or HTTPS
- // default to http if an invalid value is provided
- return $proto === 'https' ? 'https' : 'http';
+ } elseif (!empty($this->server['HTTPS'])
+ && $this->server['HTTPS'] !== 'off'
+ ) {
+ $proto = 'https';
}
- if (isset($this->server['HTTPS'])
- && $this->server['HTTPS'] !== null
- && $this->server['HTTPS'] !== 'off'
- && $this->server['HTTPS'] !== '') {
- return 'https';
+ if ($proto !== 'https' && $proto !== 'http') {
+ // log unrecognized value so admin has a chance to fix it
+ \OCP\Server::get(LoggerInterface::class)->critical(
+ 'Server protocol is malformed [falling back to http] (check overwriteprotocol and/or X-Forwarded-Proto to remedy): ' . $proto,
+ ['app' => 'core']
+ );
}
- return 'http';
+ // default to http if provided an invalid value
+ return $proto === 'https' ? 'https' : 'http';
}
/**
@@ -743,11 +754,11 @@ class Request implements \ArrayAccess, \Countable, IRequest {
}
/**
- * Get PathInfo from request
+ * Get PathInfo from request (rawurldecoded)
* @throws \Exception
* @return string|false Path info or false when not found
*/
- public function getPathInfo() {
+ public function getPathInfo(): string|false {
$pathInfo = $this->getRawPathInfo();
return \Sabre\HTTP\decodePath($pathInfo);
}
diff --git a/lib/private/Files/Cache/CacheQueryBuilder.php b/lib/private/Files/Cache/CacheQueryBuilder.php
index 5ae60ee80b6..5492452273b 100644
--- a/lib/private/Files/Cache/CacheQueryBuilder.php
+++ b/lib/private/Files/Cache/CacheQueryBuilder.php
@@ -28,7 +28,7 @@ class CacheQueryBuilder extends ExtendedQueryBuilder {
public function selectTagUsage(): self {
$this
- ->select('systemtag.name', 'systemtag.id', 'systemtag.visibility', 'systemtag.editable', 'systemtag.etag')
+ ->select('systemtag.name', 'systemtag.id', 'systemtag.visibility', 'systemtag.editable', 'systemtag.etag', 'systemtag.color')
->selectAlias($this->createFunction('COUNT(filecache.fileid)'), 'number_files')
->selectAlias($this->createFunction('MAX(filecache.fileid)'), 'ref_file_id')
->from('filecache', 'filecache')
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php
index 37ecd5779e6..b92c608a81d 100644
--- a/lib/private/Files/SetupManager.php
+++ b/lib/private/Files/SetupManager.php
@@ -292,7 +292,7 @@ class SetupManager {
$mounts = array_filter($mounts, function (IMountPoint $mount) use ($previouslySetupProviders) {
return !in_array($mount->getMountProvider(), $previouslySetupProviders);
});
- $this->userMountCache->registerMounts($user, $mounts, $newProviders);
+ $this->registerMounts($user, $mounts, $newProviders);
$cacheDuration = $this->config->getSystemValueInt('fs_mount_cache_duration', 5 * 60);
if ($cacheDuration > 0) {
@@ -457,7 +457,7 @@ class SetupManager {
}
if (count($mounts)) {
- $this->userMountCache->registerMounts($user, $mounts, $currentProviders);
+ $this->registerMounts($user, $mounts, $currentProviders);
$this->setupForUserWith($user, function () use ($mounts) {
array_walk($mounts, [$this->mountManager, 'addMount']);
});
@@ -528,7 +528,7 @@ class SetupManager {
$mounts = $this->mountProviderCollection->getUserMountsForProviderClasses($user, $providers);
}
- $this->userMountCache->registerMounts($user, $mounts, $providers);
+ $this->registerMounts($user, $mounts, $providers);
$this->setupForUserWith($user, function () use ($mounts) {
array_walk($mounts, [$this->mountManager, 'addMount']);
});
@@ -600,4 +600,10 @@ class SetupManager {
});
}
}
+
+ private function registerMounts(IUser $user, array $mounts, ?array $mountProviderClasses = null): void {
+ if ($this->lockdownManager->canAccessFilesystem()) {
+ $this->userMountCache->registerMounts($user, $mounts, $mountProviderClasses);
+ }
+ }
}
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index afd8f87e2de..2d166b5438d 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -116,7 +116,7 @@ class DAV extends Common {
// inject mock for testing
$this->certManager = \OC::$server->getCertificateManager();
}
- $this->root = $parameters['root'] ?? '/';
+ $this->root = rawurldecode($parameters['root'] ?? '/');
$this->root = '/' . ltrim($this->root, '/');
$this->root = rtrim($this->root, '/') . '/';
} else {
@@ -191,7 +191,7 @@ class DAV extends Common {
if ($this->secure) {
$baseUri .= 's';
}
- $baseUri .= '://' . $this->host . $this->root;
+ $baseUri .= '://' . $this->host . $this->encodePath($this->root);
return $baseUri;
}
diff --git a/lib/private/Files/Utils/Scanner.php b/lib/private/Files/Utils/Scanner.php
index e9ed351b27b..576cb66b3cf 100644
--- a/lib/private/Files/Utils/Scanner.php
+++ b/lib/private/Files/Utils/Scanner.php
@@ -205,7 +205,10 @@ class Scanner extends PublicEmitter {
foreach (['', 'files'] as $path) {
if (!$storage->isCreatable($path)) {
$fullPath = $storage->getSourcePath($path);
- if (!$storage->is_dir($path) && $storage->getCache()->inCache($path)) {
+ if (isset($mounts[$mount->getMountPoint() . $path . '/'])) {
+ // /<user>/files is overwritten by a mountpoint, so this check is irrelevant
+ break;
+ } elseif (!$storage->is_dir($path) && $storage->getCache()->inCache($path)) {
throw new NotFoundException("User folder $fullPath exists in cache but not on disk");
} elseif ($storage->is_dir($path)) {
$ownerUid = fileowner($fullPath);
@@ -213,9 +216,6 @@ class Scanner extends PublicEmitter {
$owner = $owner['name'] ?? $ownerUid;
$permissions = decoct(fileperms($fullPath));
throw new ForbiddenException("User folder $fullPath is not writable, folders is owned by $owner and has mode $permissions");
- } elseif (isset($mounts[$mount->getMountPoint() . $path . '/'])) {
- // /<user>/files is overwritten by a mountpoint, so this check is irrelevant
- break;
} else {
// if the root exists in neither the cache nor the storage the user isn't setup yet
break 2;
diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php
index ec4ce040090..8f6294faa66 100644
--- a/lib/private/Setup/AbstractDatabase.php
+++ b/lib/private/Setup/AbstractDatabase.php
@@ -77,7 +77,6 @@ abstract class AbstractDatabase {
$this->config->setValues([
'dbname' => $dbName,
'dbhost' => $dbHost,
- 'dbport' => $dbPort,
'dbtableprefix' => $dbTablePrefix,
]);