From b12700446a7b8057c8430b352b5e0bb89fe31252 Mon Sep 17 00:00:00 2001 From: Artur Kyryliuk Date: Sun, 15 Nov 2026 18:19:46 +0100 Subject: [PATCH 1/2] fix(security): administrators decide where a mount connects - Local folder and ZIP mounts read and write wherever PHP can, outside the file manager root. Only an administrator may create, test or repoint one; the driver picker hides them from everyone else (H-003). - WebDAV URLs, S3 endpoints (and the virtual-hosted bucket name), FTP/SFTP hosts and the computer gateway must resolve to public addresses only, every record, unless an administrator configured the mount. The checked address is the one connected to (cURL RESOLVE / the IP itself) and WebDAV follows no redirect, so neither DNS rebinding nor a redirect reaches an internal service (H-002). - SFTP refuses to connect without a pinned host key. OpenSSH SHA256 form, md5 hex, and several keys for rotation are accepted; flysystem-sftp-v3 ^3.36 for those formats (M-004). Enforced on save/test with readable 403/422 answers, and again on every connection through Mount::trusted(): config mounts, or whoever last set the connection settings being an administrator now. Mounts a manager set up before this change stop working until an administrator re-saves them. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 5 + README.md | 7 + composer.json | 2 +- docs/DESIGN.md | 7 + lang/en/global.php | 12 +- src/Drivers/AsyncS3Driver.php | 5 + src/Drivers/ComputerDriver.php | 5 + src/Drivers/Driver.php | 70 +++++- src/Drivers/FtpDriver.php | 8 +- src/Drivers/LocalDriver.php | 5 + src/Drivers/S3Driver.php | 44 ++++ src/Drivers/SftpDriver.php | 51 +++- src/Drivers/WebDavDriver.php | 55 ++++- src/Drivers/ZipDriver.php | 5 + src/Models/Mount.php | 33 ++- src/Services/Mounts.php | 60 ++++- src/Support/Destination.php | 116 +++++++++ tests/Unit/DestinationsTest.php | 324 +++++++++++++++++++++++++ tests/Unit/DriversTest.php | 8 +- tests/Unit/MountDraftTest.php | 8 +- tests/Unit/ServeTest.php | 2 +- tests/helpers.php | 39 ++- views/partials/script-mounts.blade.php | 3 +- 23 files changed, 843 insertions(+), 31 deletions(-) create mode 100644 src/Support/Destination.php create mode 100644 tests/Unit/DestinationsTest.php diff --git a/AGENTS.md b/AGENTS.md index b06ac53..79d960c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,6 +41,11 @@ ci/ .github/ builds a full CMS with the plugin inside (Docker), first, and only then asks whether the path exists. - **A stranger's personal mount is "not found", never "forbidden"** (and not even an administrator opens it); `Mounts::find()` enforces it, controllers must always go through it. +- **Where a mount connects** (DESIGN rule 10): `Driver::filesystem()` is fail-closed - without + `_trusted` (set by `Mount::filesystem()` from `Mount::trusted()`) local/zip refuse and every + `destinations()` entry must resolve public. A driver gaining a host/URL field must list it in + `destinations()`. Tests: `amountMount()` records an administrator as `configured_by`, and + `Destination::$resolver` is faked (`amountFakeResolver()`), so no test does DNS. - **Secrets**: `Mounts::present()` masks them; `update()` keeps the stored value for a blank field. Controllers whitelist input keys and reject non-scalar values where scalars belong (`Controller::text()/flag()/listOf()/ids()`). - **Task type is registered in `register()`**, not `boot()`: the consumer (`system:task-worker`) is a CLI process with diff --git a/README.md b/README.md index 524739f..0565a8b 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,13 @@ access, and **this site's code**. - **Site mounts** are usable by managers with `amount` (optionally only members of chosen user groups). A manager without `amount_manage` is confined to `u/` on a site mount, so one manager's uploads cannot land in or overwrite another's. +- **Only an administrator can point a mount at this server or the internal network.** The local folder and ZIP drivers + read and write wherever PHP can, so they are offered to administrators only. Everyone else may connect a WebDAV URL, + S3 endpoint, FTP/SFTP host or computer gateway only when it resolves to public addresses; the address that was checked + is the one connected to, and WebDAV redirects are not followed. This is checked when the mount is saved or tested and + again on every connection, for whoever last changed its connection settings. Mounts from configuration are trusted. +- **SFTP needs a pinned host key** (`ssh-keyscan HOST | ssh-keygen -lf -` prints it as `SHA256:...`); a connection to + a server presenting another key is refused. Several keys may be pinned, so a key can be rotated without downtime. - **Downloads back are cautious.** The destination must be a folder the user can write to; nothing is overwritten unless asked and allowed; executable and server-configuration file names are refused unless the user may edit code; files are written to `.amount-part`, size-checked, then renamed. A database dump downloaded back is restored with the CMS's diff --git a/composer.json b/composer.json index 5318998..47f7186 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "evolution-cms/evolution": "^3.5.2", "league/flysystem": "^3.10", "league/flysystem-aws-s3-v3": "^3.10", - "league/flysystem-sftp-v3": "^3.0.14", + "league/flysystem-sftp-v3": "^3.36", "league/flysystem-webdav": "^3.6" }, "require-dev": { diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 41fb40c..6f522f0 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -40,6 +40,13 @@ is gone); **private** ones are downloadable only by managers who may see the ori 8. A file's identity is `path_hash = sha1(site path)`; never index long paths. Site paths are validated by `Paths::clean()`. 9. A step must be safe to run twice (a worker can die anywhere): upload to the final key is idempotent; local deletion happens only after the remote size is verified AND the local file is unchanged (size+mtime) since it was read. +10. Where a mount connects is an administrator's decision. `Driver::touchesHost()` drivers (local, zip) are + administrator-only; `Driver::destinations()` must resolve to public addresses only (`Support\Destination`, every + record) unless an administrator configured the mount. Enforced in `Mounts` on save/test (readable 403/422) and in + `Driver::filesystem()` on every connection via `Mount::trusted()`: config mounts, or `options.configured_by` + (else owner, else creator) being an administrator *now*. Untrusted connections use the checked address + (`_pinned`: cURL `RESOLVE` for WebDAV/S3, the address itself for FTP/SFTP) and WebDAV follows no redirect. + SFTP refuses to connect without a pinned host key (`host_fingerprint`, several allowed for rotation). ## Already written (do not rewrite; extend only if a contract below says so) diff --git a/lang/en/global.php b/lang/en/global.php index a3bf7ff..a7253b3 100644 --- a/lang/en/global.php +++ b/lang/en/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Several mounts match: :names. Which one do you mean?', 'error_driver_unknown' => 'This storage type is not known.', 'error_driver_unavailable' => ':driver needs an extra package. Install it with: :command', + 'error_driver_admin_only' => ':driver reaches this server\'s own disk, so only an administrator can set it up.', + 'error_destination_private' => ':host is on this server or an internal network. Only an administrator can connect a mount there.', + 'error_destination_unresolved' => ':host could not be found. Check the address.', + 'error_destination_invalid' => 'This is not a valid address.', + 'error_sftp_fingerprint' => 'Pin the server\'s host key, e.g. SHA256:... as printed by: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'The WebDAV URL must start with http:// or https://.', 'error_mount_in_use' => 'This mount is used by :count folder rule(s). Remove them first or force the removal.', 'error_mount_unusable' => 'This mount does not exist or you may not use it.', 'error_rule_running' => 'This rule is running right now. Cancel the run first.', @@ -156,7 +162,7 @@ 'h_gdrive_service' => 'Paste the service account JSON; share the target folder with its e-mail address.', 'h_gdrive_team' => 'Only for a shared drive.', 'h_gridfs_uri' => 'The MongoDB connection URI.', - 'h_local_root' => 'Absolute path of the folder on this server, outside the web root.', + 'h_local_root' => 'Absolute path of the folder on this server, outside the web root. Administrators only.', 'h_onedrive_drive' => 'Leave empty for the default drive.', 'h_onedrive_tenant' => 'Directory (tenant) ID; "common" for personal accounts.', 'h_prefix' => 'Everything is stored below this folder. Leave empty for the top.', @@ -164,11 +170,11 @@ 'h_s3_endpoint' => 'Leave empty for Amazon S3. Required for other S3-compatible providers.', 'h_s3_key' => 'Leave empty to use the server role or environment credentials.', 'h_s3_token' => 'Only for temporary credentials.', - 'h_sftp_fingerprint' => 'Optional: pin the server key (recommended).', + 'h_sftp_fingerprint' => 'Required. The server\'s host key, e.g. SHA256:... from: ssh-keyscan HOST | ssh-keygen -lf -. Several keys (separated by spaces or lines) let you rotate one.', 'h_sftp_key' => 'Optional private key used instead of a password.', 'h_sftp_root' => 'Absolute remote folder to work in.', 'h_webdav_uri' => 'The full WebDAV URL, for Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Absolute path of the ZIP file on this server.', + 'h_zip_path' => 'Absolute path of the ZIP file on this server. Administrators only.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/src/Drivers/AsyncS3Driver.php b/src/Drivers/AsyncS3Driver.php index 2eb8749..157bed2 100644 --- a/src/Drivers/AsyncS3Driver.php +++ b/src/Drivers/AsyncS3Driver.php @@ -55,6 +55,11 @@ public function fields(): array ]; } + public function destinations(array $config): array + { + return ['endpoint' => trim((string) ($config['endpoint'] ?? ''))]; + } + protected function adapter(array $config, array $options): FilesystemAdapter { $arguments = ['region' => trim((string) ($config['region'] ?? '')) ?: 'us-east-1']; diff --git a/src/Drivers/ComputerDriver.php b/src/Drivers/ComputerDriver.php index c530d58..3823b0c 100644 --- a/src/Drivers/ComputerDriver.php +++ b/src/Drivers/ComputerDriver.php @@ -81,6 +81,11 @@ public function fields(): array ]; } + public function destinations(array $config): array + { + return ['gateway' => trim((string) ($config['gateway'] ?? ''))]; + } + protected function adapter(array $config, array $options): FilesystemAdapter { $owner = isset($options['_owner_id']) ? (int) $options['_owner_id'] : null; diff --git a/src/Drivers/Driver.php b/src/Drivers/Driver.php index 0539b39..1966484 100644 --- a/src/Drivers/Driver.php +++ b/src/Drivers/Driver.php @@ -2,6 +2,8 @@ namespace Elcreator\aMount\Drivers; +use Elcreator\aMount\Support\Destination; +use Elcreator\aMount\Support\Lang; use League\Flysystem\Config as FlysystemConfig; use League\Flysystem\Filesystem; use League\Flysystem\FilesystemAdapter; @@ -72,6 +74,29 @@ public function writesAtomically(): bool return false; } + /** + * Whether the settings name a path on this machine (a folder, a ZIP file). + * Such a mount reads and writes anything the PHP process can reach, outside + * the file manager's root, so only an administrator may configure one. + */ + public function touchesHost(): bool + { + return false; + } + + /** + * The network destinations the adapter connects to, field => URL or host, + * as configured. A mount not configured by an administrator may reach only + * public addresses ({@see Destination}). + * + * @param array $config + * @return array + */ + public function destinations(array $config): array + { + return []; + } + /** Whether the settings can carry a public base URL the adapter cannot work out itself. */ public function needsPublicUrl(): bool { @@ -116,7 +141,14 @@ public function defaults(): array return $defaults; } - /** @throws RuntimeException */ + /** + * `$options['_trusted']` says an administrator (or the site configuration) + * chose these settings. Without it the host-touching drivers refuse and + * every destination must resolve to public addresses; the checked + * addresses reach the adapter as `$options['_pinned']` (host => address). + * + * @throws RuntimeException + */ public function filesystem(array $config, array $options = []): Filesystem { if (!$this->available()) { @@ -135,10 +167,45 @@ public function filesystem(array $config, array $options = []): Filesystem throw new RuntimeException($this->label() . ': missing ' . implode(', ', array_keys($errors)) . '.'); } + if (empty($options['_trusted'])) { + if ($this->touchesHost()) { + throw new RuntimeException(Lang::get('aMount::global.error_driver_admin_only', ['driver' => $this->label()])); + } + + $options['_pinned'] = $this->pinDestinations($config); + } + // Visibility is passed per write (see writeConfig()), not as a default. return new Filesystem($this->adapter($config, $options)); } + /** + * Resolve and check every destination, host => the address to connect to. + * + * @return array + * @throws RuntimeException naming the refused host + */ + public function pinDestinations(array $config): array + { + $pinned = []; + + foreach ($this->destinations($config) as $value) { + if (trim($value) === '') { + continue; + } + + $found = Destination::inspect($value); + + if ($found['status'] !== Destination::OK) { + throw new RuntimeException(Lang::get('aMount::global.error_destination_' . $found['status'], ['host' => $found['host'] ?? $value])); + } + + $pinned[(string) $found['host']] = (string) $found['address']; + } + + return $pinned; + } + /** Flysystem write config for one file. */ public function writeConfig(array $options, string $visibility): array { @@ -166,6 +233,7 @@ public function describe(): array 'defaults' => $this->defaults(), 'supports_visibility' => $this->supportsVisibility(), 'needs_public_url' => $this->needsPublicUrl(), + 'admin_only' => $this->touchesHost(), ]; } diff --git a/src/Drivers/FtpDriver.php b/src/Drivers/FtpDriver.php index 8e052d9..b425cdc 100644 --- a/src/Drivers/FtpDriver.php +++ b/src/Drivers/FtpDriver.php @@ -62,10 +62,16 @@ public function fields(): array ]; } + public function destinations(array $config): array + { + return ['host' => trim((string) ($config['host'] ?? ''))]; + } + protected function adapter(array $config, array $options): FilesystemAdapter { return new FtpAdapter(FtpConnectionOptions::fromArray([ - 'host' => trim((string) $config['host']), + // The checked address when the settings were not chosen by an administrator. + 'host' => $options['_pinned'][strtolower(trim((string) $config['host'], '[]'))] ?? trim((string) $config['host']), 'root' => '/' . trim((string) ($config['root'] ?? '/'), '/'), 'username' => trim((string) $config['username']), 'password' => (string) $config['password'], diff --git a/src/Drivers/LocalDriver.php b/src/Drivers/LocalDriver.php index 466783a..1b7261e 100644 --- a/src/Drivers/LocalDriver.php +++ b/src/Drivers/LocalDriver.php @@ -47,6 +47,11 @@ public function needsPublicUrl(): bool return true; } + public function touchesHost(): bool + { + return true; + } + public function fields(): array { return [ diff --git a/src/Drivers/S3Driver.php b/src/Drivers/S3Driver.php index ea068f4..1f5f325 100644 --- a/src/Drivers/S3Driver.php +++ b/src/Drivers/S3Driver.php @@ -89,6 +89,24 @@ public function validate(array $config): array return $errors; } + /** + * A virtual-hosted request goes to `.`, a name of its + * own (a wildcard record may point it anywhere), so it is checked too. + */ + public function destinations(array $config): array + { + $endpoint = trim((string) ($config['endpoint'] ?? '')); + $destinations = ['endpoint' => $endpoint]; + $host = $endpoint === '' ? null : parse_url(str_contains($endpoint, '://') ? $endpoint : 'https://' . $endpoint, PHP_URL_HOST); + $bucket = trim((string) ($config['bucket'] ?? '')); + + if (is_string($host) && $host !== '' && $bucket !== '' && empty($config['path_style']) && filter_var(trim($host, '[]'), FILTER_VALIDATE_IP) === false) { + $destinations['bucket'] = $bucket . '.' . $host; + } + + return $destinations; + } + protected function adapter(array $config, array $options): FilesystemAdapter { $arguments = [ @@ -106,6 +124,7 @@ protected function adapter(array $config, array $options): FilesystemAdapter if (trim((string) ($config['endpoint'] ?? '')) !== '') { $arguments['endpoint'] = trim((string) $config['endpoint']); + $arguments['http']['curl'] = self::pinnedCurl($arguments['endpoint'], $options['_pinned'] ?? null); $arguments['use_path_style_endpoint'] = (bool) ($config['path_style'] ?? false); // Newer SDKs add CRC checksums that several S3-compatible servers // do not understand (R2, MinIO, B2 reject them). @@ -115,4 +134,29 @@ protected function adapter(array $config, array $options): FilesystemAdapter return new AwsS3V3Adapter(new S3Client($arguments), trim((string) $config['bucket']), self::prefix($config)); } + + /** + * cURL options that make the SDK connect to the checked addresses of a + * custom endpoint (and its bucket host) instead of resolving the names + * again; empty when nothing was pinned. + * + * @param array|null $pinned host => address + * @return array + */ + public static function pinnedCurl(string $endpoint, ?array $pinned): array + { + if (!$pinned || !defined('CURLOPT_RESOLVE')) { + return []; + } + + $parts = parse_url(str_contains($endpoint, '://') ? $endpoint : 'https://' . $endpoint); + $port = (int) ($parts['port'] ?? (strtolower((string) ($parts['scheme'] ?? 'https')) === 'http' ? 80 : 443)); + $resolve = []; + + foreach ($pinned as $host => $address) { + $resolve[] = sprintf('%s:%d:%s', $host, $port, str_contains($address, ':') ? '[' . $address . ']' : $address); + } + + return [CURLOPT_RESOLVE => $resolve]; + } } diff --git a/src/Drivers/SftpDriver.php b/src/Drivers/SftpDriver.php index 72cdfda..ecce5b0 100644 --- a/src/Drivers/SftpDriver.php +++ b/src/Drivers/SftpDriver.php @@ -2,9 +2,11 @@ namespace Elcreator\aMount\Drivers; +use Elcreator\aMount\Support\Lang; use League\Flysystem\FilesystemAdapter; use League\Flysystem\PhpseclibV3\SftpAdapter; use League\Flysystem\PhpseclibV3\SftpConnectionProvider; +use RuntimeException; final class SftpDriver extends Driver { @@ -52,7 +54,7 @@ public function fields(): array self::secret('password'), self::area('private_key', false, ['help' => 'aMount::global.h_sftp_key']), self::secret('passphrase'), - self::text('host_fingerprint', false, ['secret' => false, 'help' => 'aMount::global.h_sftp_fingerprint']), + self::text('host_fingerprint', true, ['secret' => false, 'help' => 'aMount::global.h_sftp_fingerprint']), self::text('root', true, ['default' => '/', 'help' => 'aMount::global.h_sftp_root']), ]; } @@ -65,16 +67,59 @@ public function validate(array $config): array $errors['password'] = 'aMount::global.error_field_required'; } + if (trim((string) ($config['host_fingerprint'] ?? '')) !== '' && self::fingerprints((string) $config['host_fingerprint']) === []) { + $errors['host_fingerprint'] = 'aMount::global.error_sftp_fingerprint'; + } + return $errors; } + public function destinations(array $config): array + { + return ['host' => trim((string) ($config['host'] ?? ''))]; + } + + /** + * The pinned host keys: OpenSSH `SHA256:...` (what `ssh-keygen -lf` prints), + * `md5:`/`sha1:`/`sha512:` prefixed, or colon/plain hex. Several may be + * given, separated by spaces, commas or lines, so a key can be rotated by + * pinning the new one before the server switches. Anything else is ignored, + * which lets a pasted `ssh-keygen` line work as is. + * + * @return string[] + */ + public static function fingerprints(string $value): array + { + $found = []; + + foreach (preg_split('/[\s,]+/', trim($value)) ?: [] as $token) { + $token = trim($token, '()'); + + if (preg_match('/^(md5|sha1|sha256|sha512):[A-Za-z0-9+\/=:]+$/i', $token) || preg_match('/^(?:[0-9a-f]{2}:?){16,64}$/i', $token)) { + $found[] = $token; + } + } + + return array_values(array_unique($found)); + } + protected function adapter(array $config, array $options): FilesystemAdapter { $key = trim((string) ($config['private_key'] ?? '')); + $fingerprints = self::fingerprints((string) ($config['host_fingerprint'] ?? '')); + + // Without a pinned key anyone on the network path could pose as the server. + if ($fingerprints === []) { + throw new RuntimeException(Lang::get('aMount::global.error_sftp_fingerprint')); + } + + // Hosts given by name are pinned like WebDAV, so the key check runs against the checked address. + $host = trim((string) $config['host']); + $host = $options['_pinned'][strtolower(trim($host, '[]'))] ?? $host; return new SftpAdapter( new SftpConnectionProvider( - host: trim((string) $config['host']), + host: $host, username: trim((string) $config['username']), password: ($config['password'] ?? '') !== '' ? (string) $config['password'] : null, privateKey: $key !== '' ? $key : null, @@ -82,7 +127,7 @@ protected function adapter(array $config, array $options): FilesystemAdapter port: (int) ($config['port'] ?? 22) ?: 22, timeout: 30, maxTries: 3, - hostFingerprint: trim((string) ($config['host_fingerprint'] ?? '')) ?: null + hostFingerprint: $fingerprints ), '/' . trim((string) ($config['root'] ?? '/'), '/') ); diff --git a/src/Drivers/WebDavDriver.php b/src/Drivers/WebDavDriver.php index bf79919..7ca2a08 100644 --- a/src/Drivers/WebDavDriver.php +++ b/src/Drivers/WebDavDriver.php @@ -4,6 +4,7 @@ use League\Flysystem\FilesystemAdapter; use League\Flysystem\WebDAV\WebDAVAdapter; +use RuntimeException; use Sabre\DAV\Client; /** @@ -53,7 +54,36 @@ public function fields(): array ]; } + public function validate(array $config): array + { + $errors = parent::validate($config); + $uri = trim((string) ($config['base_uri'] ?? '')); + + if ($uri !== '' && !preg_match('#^https?://[^/\s]+#i', $uri)) { + $errors['base_uri'] = 'aMount::global.error_webdav_uri'; + } + + return $errors; + } + + public function destinations(array $config): array + { + return ['base_uri' => trim((string) ($config['base_uri'] ?? ''))]; + } + protected function adapter(array $config, array $options): FilesystemAdapter + { + return new WebDAVAdapter(self::client($config, $options['_pinned'] ?? null), self::prefix($config)); + } + + /** + * With $pinned (settings not chosen by an administrator) cURL connects to + * the address that was checked, never re-resolving the name, and no + * redirect is followed: either would let a public URL lead to an internal one. + * + * @param array|null $pinned host => address + */ + public static function client(array $config, ?array $pinned): Client { $settings = ['baseUri' => rtrim(trim((string) $config['base_uri']), '/') . '/']; @@ -67,6 +97,29 @@ protected function adapter(array $config, array $options): FilesystemAdapter }; } - return new WebDAVAdapter(new Client($settings), self::prefix($config)); + if ($pinned === null) { + return new Client($settings); + } + + $client = new class ($settings) extends Client { + public function __construct(array $settings) + { + parent::__construct($settings); + $this->maxRedirects = 0; + } + }; + + $parts = parse_url($settings['baseUri']); + $host = strtolower(trim((string) ($parts['host'] ?? ''), '[]')); + $address = $pinned[$host] ?? null; + + if ($address === null) { + throw new RuntimeException('WebDAV: ' . $host . ' was not checked.'); + } + + $port = (int) ($parts['port'] ?? (strtolower((string) ($parts['scheme'] ?? '')) === 'https' ? 443 : 80)); + $client->addCurlSetting(CURLOPT_RESOLVE, [sprintf('%s:%d:%s', $host, $port, str_contains($address, ':') ? '[' . $address . ']' : $address)]); + + return $client; } } diff --git a/src/Drivers/ZipDriver.php b/src/Drivers/ZipDriver.php index 2112f06..7b06f97 100644 --- a/src/Drivers/ZipDriver.php +++ b/src/Drivers/ZipDriver.php @@ -48,6 +48,11 @@ public function needsPublicUrl(): bool return true; } + public function touchesHost(): bool + { + return true; + } + public function fields(): array { return [ diff --git a/src/Models/Mount.php b/src/Models/Mount.php index 187a979..500817c 100644 --- a/src/Models/Mount.php +++ b/src/Models/Mount.php @@ -5,6 +5,7 @@ use Elcreator\aMount\Drivers\Drivers; use Elcreator\aMount\Support\Config; use Elcreator\aMount\Support\Crypt; +use Elcreator\aMount\Support\Principal; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; @@ -122,7 +123,37 @@ public function grantGroups(array $groups): void public function filesystem(): Filesystem { // The owner travels along for drivers that resolve a key per manager (ComputerDriver). - return Drivers::get($this->driver)->filesystem($this->credentials(), $this->options() + ['_owner_id' => $this->owner_id]); + return Drivers::get($this->driver)->filesystem($this->credentials(), $this->options() + [ + '_owner_id' => $this->owner_id, + '_trusted' => $this->trusted(), + ]); + } + + /** + * Who last set the connection settings. Rows saved before this was recorded + * fall back to the owner, then to the creator. + */ + public function configuredBy(): ?int + { + $id = (int) ($this->option('configured_by') ?? $this->owner_id ?? $this->created_by ?? 0); + + return $id > 0 ? $id : null; + } + + /** + * Whether the settings were chosen by someone allowed to point a mount at + * this machine or an internal network: the site configuration, or an + * account that is an administrator *now* (a demoted one loses it on the next run). + */ + public function trusted(): bool + { + if ($this->isFromConfig()) { + return true; + } + + $by = $this->configuredBy(); + + return $by !== null && Principal::forUser($by)->isAdministrator(); } public function rules() diff --git a/src/Services/Mounts.php b/src/Services/Mounts.php index 5832cf1..af99d16 100644 --- a/src/Services/Mounts.php +++ b/src/Services/Mounts.php @@ -9,6 +9,7 @@ use Elcreator\aMount\Models\Rule; use Elcreator\aMount\Models\Run; use Elcreator\aMount\Support\Config; +use Elcreator\aMount\Support\Destination; use Elcreator\aMount\Support\Paths; use Elcreator\aMount\Support\Principal; use Illuminate\Database\Eloquent\Collection; @@ -179,6 +180,7 @@ public function create(array $in): Mount $name = $this->name($in['name'] ?? ''); $config = $this->config($driver, (array) ($in['config'] ?? []), []); + $this->guard($driver, $config); $mount = new Mount(); $mount->uuid = Mount::newUuid(); @@ -187,7 +189,7 @@ public function create(array $in): Mount $mount->owner_id = $personal ? $this->actor->userId() : null; $mount->created_by = $this->actor->userId(); $mount->status = Mount::STATUS_UNTESTED; - $mount->options_json = $this->options((array) ($in['options'] ?? []), []); + $mount->options_json = ['configured_by' => $this->actor->userId()] + $this->options((array) ($in['options'] ?? []), []); $mount->setCredentials($config); $mount->save(); @@ -216,16 +218,19 @@ public function update(Mount $mount, array $in): Mount $mount->name = $this->name($in['name']); } + if (array_key_exists('options', $in)) { + $mount->options_json = $this->options((array) $in['options'], $mount->options()); + } + if (array_key_exists('config', $in)) { - $mount->setCredentials($this->config($driver, (array) $in['config'], $mount->credentials())); + $config = $this->config($driver, (array) $in['config'], $mount->credentials()); + $this->guard($driver, $config); + $mount->setCredentials($config); + $mount->options_json = ['configured_by' => $this->actor->userId()] + $mount->options(); $mount->status = Mount::STATUS_UNTESTED; $mount->last_error = null; } - if (array_key_exists('options', $in)) { - $mount->options_json = $this->options((array) $in['options'], $mount->options()); - } - $mount->save(); if (!$mount->isPersonal() && array_key_exists('groups', $in)) { @@ -352,12 +357,13 @@ public function testDraft(array $in, ?string $uuid = null): array $driver = $existing ? Drivers::get($existing->driver) : $this->driverFor((string) ($in['driver'] ?? '')); $config = $this->config($driver, (array) ($in['config'] ?? []), $existing ? $existing->credentials() : []); + $this->guard($driver, $config); // A throwaway model: it only carries the settings to the driver and is never saved. $draft = new Mount(); $draft->driver = $driver->id(); $draft->owner_id = $personal ? $this->actor->userId() : null; - $draft->options_json = $this->options((array) ($in['options'] ?? []), $existing ? $existing->options() : []); + $draft->options_json = ['configured_by' => $this->actor->userId()] + $this->options((array) ($in['options'] ?? []), $existing ? $existing->options() : []); $draft->setCredentials($config); return $this->probe($draft); @@ -508,7 +514,7 @@ public function present(Mount $mount): array } $options = $mount->options(); - unset($options['config_key']); + unset($options['config_key'], $options['configured_by']); return [ 'uuid' => $mount->uuid, @@ -702,10 +708,46 @@ private function config(Driver $driver, array $in, array $stored): array return $config; } + /** + * What only an administrator may configure, refused with a readable answer + * when the settings are saved or tested. The worker enforces the same + * through {@see Mount::trusted()}, so this is not the only line. + * + * @throws AmountException + */ + private function guard(Driver $driver, array $config): void + { + if ($this->actor->principal()->isAdministrator()) { + return; + } + + if ($driver->touchesHost()) { + throw new AmountException('admin_only', AmountException::text('aMount::global.error_driver_admin_only', ['driver' => $driver->label()]), 403); + } + + $errors = []; + + foreach ($driver->destinations($config + $driver->defaults()) as $field => $value) { + if (trim($value) === '') { + continue; + } + + $found = Destination::inspect($value); + + if ($found['status'] !== Destination::OK) { + $errors[$field] = AmountException::text('aMount::global.error_destination_' . $found['status'], ['host' => $found['host'] ?? $value]); + } + } + + if ($errors !== []) { + throw AmountException::fields($errors); + } + } + /** @return array */ private function options(array $in, array $stored): array { - $options = array_intersect_key($stored, array_flip(['source', 'config_key'])); + $options = array_intersect_key($stored, array_flip(['source', 'config_key', 'configured_by'])); $errors = []; $url = trim((string) ($in['public_url'] ?? ($stored['public_url'] ?? ''))); diff --git a/src/Support/Destination.php b/src/Support/Destination.php new file mode 100644 index 0000000..0f030e9 --- /dev/null +++ b/src/Support/Destination.php @@ -0,0 +1,116 @@ + addresses. Null uses the system resolver. */ + public static ?Closure $resolver = null; + + /** + * Host of a URL (`https://host/dav/`), a DSN-less `host:port` or a bare host. + * Brackets of an IPv6 literal are removed; null when no host can be read. + */ + public static function host(string $value): ?string + { + $value = trim($value); + + if ($value === '' || preg_match('/\s/', $value)) { + return null; + } + + $host = parse_url(str_contains($value, '://') ? $value : 'tcp://' . $value, PHP_URL_HOST); + + if (!is_string($host) || $host === '') { + return null; + } + + return strtolower(trim($host, '[]')); + } + + /** + * Every address the host resolves to. Both the system resolver (hosts file, + * numeric forms such as `2130706433`) and DNS A/AAAA records are asked, + * because the connecting library may use either. + * + * @return string[] + */ + public static function addresses(string $host): array + { + if (filter_var($host, FILTER_VALIDATE_IP) !== false) { + return [$host]; + } + + if (self::$resolver !== null) { + return array_values(array_unique(array_map('strval', (self::$resolver)($host)))); + } + + $found = gethostbynamel($host) ?: []; + + foreach (@dns_get_record($host, DNS_A | DNS_AAAA) ?: [] as $record) { + $ip = $record['ip'] ?? $record['ipv6'] ?? null; + + if (is_string($ip) && $ip !== '') { + $found[] = $ip; + } + } + + return array_values(array_unique($found)); + } + + /** Globally routable: not loopback, private, link-local, CGNAT, documentation, reserved ... */ + public static function isPublic(string $ip): bool + { + // ::ffff:127.0.0.1 is 127.0.0.1 to the socket. + if (preg_match('/^::ffff:(\d{1,3}(?:\.\d{1,3}){3})$/i', $ip, $m)) { + $ip = $m[1]; + } + + return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_GLOBAL_RANGE) !== false; + } + + /** + * The verdict for one configured value, with the address to connect to. + * + * @return array{status:string, host:?string, address:?string} + */ + public static function inspect(string $value): array + { + $host = self::host($value); + + if ($host === null) { + return ['status' => self::INVALID, 'host' => null, 'address' => null]; + } + + $addresses = self::addresses($host); + + if ($addresses === []) { + return ['status' => self::UNRESOLVED, 'host' => $host, 'address' => null]; + } + + foreach ($addresses as $address) { + if (!self::isPublic($address)) { + return ['status' => self::PRIVATE, 'host' => $host, 'address' => null]; + } + } + + return ['status' => self::OK, 'host' => $host, 'address' => $addresses[0]]; + } +} diff --git a/tests/Unit/DestinationsTest.php b/tests/Unit/DestinationsTest.php new file mode 100644 index 0000000..bdd7f3c --- /dev/null +++ b/tests/Unit/DestinationsTest.php @@ -0,0 +1,324 @@ + amountReset()); + +function amountRefusal(callable $fn): ?AmountException +{ + try { + $fn(); + } catch (AmountException $e) { + return $e; + } + + return null; +} + +function amountLocalRoot(): string +{ + static $n = 0; + $root = AMOUNT_TEST_REMOTE . '/host' . ++$n; + amountEnsureDir($root); + + return $root; +} + +function amountUsable(Driver $driver): bool +{ + return $driver->available(); +} + +// --------------------------------------------------------------------- +// Destination +// --------------------------------------------------------------------- + +it('reads the host of URLs, host:port pairs and IPv6 literals', function () { + expect(Destination::host('https://Cloud.Example/remote.php/dav/'))->toBe('cloud.example') + ->and(Destination::host('sftp.example:2222'))->toBe('sftp.example') + ->and(Destination::host('http://[::1]:8080/'))->toBe('::1') + ->and(Destination::host(''))->toBeNull() + ->and(Destination::host('http://a b/'))->toBeNull() + ->and(Destination::host('http:///nohost'))->toBeNull(); +}); + +it('treats only globally routable addresses as public', function (string $ip, bool $public) { + expect(Destination::isPublic($ip))->toBe($public); +})->with([ + 'loopback' => ['127.0.0.1', false], + 'private 10/8' => ['10.1.2.3', false], + 'private 192.168' => ['192.168.0.10', false], + 'metadata' => ['169.254.169.254', false], + 'cgnat' => ['100.64.0.1', false], + 'unspecified' => ['0.0.0.0', false], + 'ipv6 loopback' => ['::1', false], + 'ipv6 unique local' => ['fd00::1', false], + 'ipv4-mapped loopback' => ['::ffff:127.0.0.1', false], + 'public v4' => ['93.184.215.14', true], + 'public v6' => ['2606:4700:4700::1111', true], +]); + +it('refuses a host when any of its addresses is internal', function () { + expect(Destination::inspect('https://cloud.example/dav/'))->toBe(['status' => 'ok', 'host' => 'cloud.example', 'address' => '93.184.215.14']) + ->and(Destination::inspect('http://mixed.test/')['status'])->toBe('private') + ->and(Destination::inspect('http://nas.lan/')['status'])->toBe('private') + ->and(Destination::inspect('http://localhost/')['status'])->toBe('private') + ->and(Destination::inspect('http://169.254.169.254/latest/')['status'])->toBe('private') + ->and(Destination::inspect('http://gone.invalid/')['status'])->toBe('unresolved') + ->and(Destination::inspect('not a url')['status'])->toBe('invalid'); +}); + +it('has a message for every refusal', function () { + $lang = require dirname(__DIR__, 2) . '/lang/en/global.php'; + + foreach ([Destination::INVALID, Destination::UNRESOLVED, Destination::PRIVATE] as $status) { + expect($lang)->toHaveKey('error_destination_' . $status); + } + + expect($lang)->toHaveKeys(['error_driver_admin_only', 'error_sftp_fingerprint', 'error_webdav_uri']); +}); + +// --------------------------------------------------------------------- +// Drivers on this machine's disk (H-003) +// --------------------------------------------------------------------- + +it('marks exactly the folder and ZIP drivers as reaching this server', function () { + $touching = array_values(array_map(fn (Driver $d) => $d->id(), array_filter(Drivers::all(), fn (Driver $d) => $d->touchesHost()))); + sort($touching); + + expect($touching)->toBe(['local', 'zip']) + ->and(Drivers::get('local')->describe()['admin_only'])->toBeTrue() + ->and(Drivers::get('s3')->describe()['admin_only'])->toBeFalse(); +}); + +it('lets only an administrator create, test or reconfigure a local mount', function () { + amountAdmin(1); + amountUser(2, ['amount', 'amount_manage', 'file_manager']); + $root = amountLocalRoot(); + + $personal = amountRefusal(fn () => (new Mounts(Actor::for(2)))->create(['name' => 'Disk', 'driver' => 'local', 'config' => ['root' => '/']])); + $site = amountRefusal(fn () => (new Mounts(Actor::for(2)))->create(['name' => 'Disk', 'driver' => 'local', 'scope' => 'site', 'config' => ['root' => '/']])); + $draft = amountRefusal(fn () => (new Mounts(Actor::for(2)))->testDraft(['driver' => 'local', 'config' => ['root' => '/']])); + $zip = amountRefusal(fn () => (new Mounts(Actor::for(2)))->create(['name' => 'Zip', 'driver' => 'zip', 'config' => ['path' => '/tmp/x.zip']])); + + expect($personal?->status)->toBe(403)->and($personal?->error)->toBe('admin_only') + ->and($site?->status)->toBe(403) + ->and($draft?->status)->toBe(403) + ->and(Mount::query()->count())->toBe(0); + + if (amountUsable(Drivers::get('zip'))) { + expect($zip?->status)->toBe(403); + } + + $mount = (new Mounts(Actor::for(1)))->create(['name' => 'Disk', 'driver' => 'local', 'scope' => 'site', 'config' => ['root' => $root]]); + + // A manager may still use the administrator's mount and edit what does not move it ... + expect((new Mounts(Actor::for(2)))->test($mount)['ok'])->toBeTrue(); + (new Mounts(Actor::for(2)))->update($mount, ['name' => 'Shared disk', 'options' => ['root' => 'backups']]); + expect($mount->fresh()->trusted())->toBeTrue(); + + // ... but not repoint it. + $repoint = amountRefusal(fn () => (new Mounts(Actor::for(2)))->update($mount->fresh(), ['config' => ['root' => '/']])); + expect($repoint?->status)->toBe(403) + ->and($mount->fresh()->credentials()['root'])->toBe($root); +}); + +it('refuses at run time a local mount a manager set up before the fix', function () { + amountUser(2); + $legacy = new Mount(['uuid' => Mount::newUuid(), 'name' => 'Old', 'driver' => 'local', 'owner_id' => 2, 'options_json' => [], 'status' => Mount::STATUS_OK]); + $legacy->setCredentials(['root' => '/']); + $legacy->save(); + + expect($legacy->trusted())->toBeFalse() + ->and(fn () => $legacy->filesystem())->toThrow(RuntimeException::class, 'administrator'); + + $probe = (new Mounts(Actor::for(2)))->test($legacy); + expect($probe['ok'])->toBeFalse()->and($legacy->fresh()->status)->toBe(Mount::STATUS_ERROR); +}); + +it('stops a local mount once the administrator who set it up is demoted', function () { + amountAdmin(1); + $mount = (new Mounts(Actor::for(1)))->create(['name' => 'Disk', 'driver' => 'local', 'config' => ['root' => amountLocalRoot()]]); + + expect($mount->filesystem())->toBeInstanceOf(League\Flysystem\Filesystem::class); + + Capsule::table('user_attributes')->where('internalKey', 1)->update(['role' => 7]); + + expect(fn () => $mount->fresh()->filesystem())->toThrow(RuntimeException::class); +}); + +it('trusts mounts defined in the site configuration', function () { + $mount = new Mount(['uuid' => Mount::newUuid(), 'name' => 'Cfg', 'driver' => 'local', 'owner_id' => null, 'options_json' => ['source' => 'config', 'config_key' => 'x']]); + + expect($mount->trusted())->toBeTrue(); +}); + +it('never shows who configured a mount in its settings', function () { + amountAdmin(1); + $mounts = new Mounts(Actor::for(1)); + $mount = $mounts->create(['name' => 'Disk', 'driver' => 'local', 'config' => ['root' => amountLocalRoot()]]); + + expect($mount->option('configured_by'))->toBe(1) + ->and($mounts->present($mount)['options'])->not->toHaveKey('configured_by'); +}); + +// --------------------------------------------------------------------- +// Network destinations (H-002) +// --------------------------------------------------------------------- + +it('refuses a WebDAV URL on an internal network for a manager', function (string $uri, string $status) { + if (!amountUsable(Drivers::get('webdav'))) { + $this->markTestSkipped('webdav package not installed'); + } + + amountUser(2); + $mounts = new Mounts(Actor::for(2)); + + $create = amountRefusal(fn () => $mounts->create(['name' => 'Dav', 'driver' => 'webdav', 'config' => ['base_uri' => $uri]])); + $draft = amountRefusal(fn () => $mounts->testDraft(['driver' => 'webdav', 'config' => ['base_uri' => $uri]])); + + expect($create?->status)->toBe(422) + ->and($create?->errors)->toHaveKey('base_uri') + ->and($create?->errors['base_uri'])->toBe(AmountException::text('aMount::global.error_destination_' . $status, ['host' => Destination::host($uri)])) + ->and($draft?->status)->toBe(422) + ->and(Mount::query()->count())->toBe(0); +})->with([ + 'loopback' => ['http://127.0.0.1:8080/', 'private'], + 'metadata' => ['http://169.254.169.254/', 'private'], + 'localhost' => ['http://localhost/dav/', 'private'], + 'lan name' => ['https://nas.lan/remote.php/dav/', 'private'], + 'one private record' => ['https://mixed.test/dav/', 'private'], + 'ipv6 loopback' => ['http://[::1]/', 'private'], + 'unresolvable' => ['https://gone.invalid/', 'unresolved'], +]); + +it('accepts a public WebDAV URL for a manager and an internal one for an administrator', function () { + if (!amountUsable(Drivers::get('webdav'))) { + $this->markTestSkipped('webdav package not installed'); + } + + amountAdmin(1); + amountUser(2); + + $public = (new Mounts(Actor::for(2)))->create(['name' => 'Cloud', 'driver' => 'webdav', 'config' => ['base_uri' => 'https://cloud.example/dav/']]); + $lan = (new Mounts(Actor::for(1)))->create(['name' => 'NAS', 'driver' => 'webdav', 'config' => ['base_uri' => 'https://nas.lan/dav/']]); + $scheme = amountRefusal(fn () => (new Mounts(Actor::for(1)))->create(['name' => 'X', 'driver' => 'webdav', 'config' => ['base_uri' => 'file:///etc/']])); + + expect($public->exists)->toBeTrue() + ->and($public->trusted())->toBeFalse() + ->and($lan->trusted())->toBeTrue() + ->and($scheme?->errors)->toHaveKey('base_uri'); +}); + +it('checks the address again on every connection', function () { + if (!amountUsable(Drivers::get('webdav'))) { + $this->markTestSkipped('webdav package not installed'); + } + + amountUser(2); + $mount = (new Mounts(Actor::for(2)))->create(['name' => 'Cloud', 'driver' => 'webdav', 'config' => ['base_uri' => 'https://cloud.example/dav/']]); + + expect($mount->filesystem())->toBeInstanceOf(League\Flysystem\Filesystem::class); + + // The name now points inside (DNS rebinding): the next connection refuses. + Destination::$resolver = fn (string $host) => $host === 'cloud.example' ? ['169.254.169.254'] : ['93.184.215.14']; + + expect(fn () => $mount->fresh()->filesystem())->toThrow(RuntimeException::class, 'cloud.example'); +}); + +it('pins the checked address and follows no redirect for an untrusted WebDAV mount', function () { + if (!class_exists(Sabre\DAV\Client::class)) { + $this->markTestSkipped('sabre/dav not installed'); + } + + $pinned = WebDavDriver::client(['base_uri' => 'https://cloud.example/dav'], ['cloud.example' => '93.184.215.14']); + $trusted = WebDavDriver::client(['base_uri' => 'https://nas.lan/dav'], null); + $v6 = WebDavDriver::client(['base_uri' => 'http://cloud.example:8080/dav'], ['cloud.example' => '2606:4700:4700::1111']); + + $settings = fn ($client) => (new ReflectionProperty($client, 'curlSettings'))->getValue($client); + $redirects = fn ($client) => (new ReflectionProperty($client, 'maxRedirects'))->getValue($client); + + expect($settings($pinned)[CURLOPT_RESOLVE])->toBe(['cloud.example:443:93.184.215.14']) + ->and($redirects($pinned))->toBe(0) + ->and($settings($trusted))->not->toHaveKey(CURLOPT_RESOLVE) + ->and($redirects($trusted))->toBeGreaterThan(0) + ->and($settings($v6)[CURLOPT_RESOLVE])->toBe(['cloud.example:8080:[2606:4700:4700::1111]']) + ->and(fn () => WebDavDriver::client(['base_uri' => 'https://other.example/'], ['cloud.example' => '93.184.215.14']))->toThrow(RuntimeException::class); +}); + +it('applies the same guard to S3 endpoints, FTP and SFTP hosts and the computer gateway', function (string $driver, array $config, string $field) { + if (!amountUsable(Drivers::get($driver))) { + $this->markTestSkipped($driver . ' package not installed'); + } + + amountUser(2); + $refused = amountRefusal(fn () => (new Mounts(Actor::for(2)))->testDraft(['driver' => $driver, 'config' => $config])); + + expect($refused?->status)->toBe(422)->and($refused?->errors)->toHaveKey($field); +})->with([ + 's3 endpoint' => ['s3', ['bucket' => 'b', 'endpoint' => 'http://minio.lan:9000', 'path_style' => true], 'endpoint'], + 'async s3 endpoint' => ['async-s3', ['bucket' => 'b', 'endpoint' => 'http://127.0.0.1:9000'], 'endpoint'], + 'ftp host' => ['ftp', ['host' => '10.0.0.8', 'username' => 'u', 'password' => 'p', 'root' => '/'], 'host'], + 'sftp host' => ['sftp', ['host' => 'localhost', 'username' => 'u', 'password' => 'p', 'root' => '/', 'host_fingerprint' => 'SHA256:abc'], 'host'], + 'computer gateway' => ['ai-computer', ['computer' => 'laptop', 'api_key' => 'k', 'gateway' => 'http://169.254.169.254/api'], 'gateway'], +]); + +it('checks and pins the virtual-hosted bucket name of a custom S3 endpoint', function () { + $s3 = Drivers::get('s3'); + + expect($s3->destinations(['endpoint' => 'https://s3.example', 'bucket' => 'media']))->toBe(['endpoint' => 'https://s3.example', 'bucket' => 'media.s3.example']) + ->and($s3->destinations(['endpoint' => 'https://s3.example', 'bucket' => 'media', 'path_style' => true]))->toBe(['endpoint' => 'https://s3.example']) + ->and($s3->destinations(['endpoint' => 'http://203.0.114.9:9000', 'bucket' => 'media']))->toBe(['endpoint' => 'http://203.0.114.9:9000']) + ->and($s3->destinations(['bucket' => 'media']))->toBe(['endpoint' => '']); + + // A wildcard record sends the bucket host somewhere else than the endpoint. + Destination::$resolver = fn (string $host) => $host === 'media.s3.example' ? ['169.254.169.254'] : ['93.184.215.14']; + expect(fn () => $s3->pinDestinations(['endpoint' => 'https://s3.example', 'bucket' => 'media']))->toThrow(RuntimeException::class, 'media.s3.example'); + + amountFakeResolver(); + $pinned = $s3->pinDestinations(['endpoint' => 'https://s3.example', 'bucket' => 'media']); + + expect(S3Driver::pinnedCurl('https://s3.example', $pinned))->toBe([CURLOPT_RESOLVE => ['s3.example:443:93.184.215.14', 'media.s3.example:443:93.184.215.14']]) + ->and(S3Driver::pinnedCurl('http://s3.example:9000', ['s3.example' => '93.184.215.14']))->toBe([CURLOPT_RESOLVE => ['s3.example:9000:93.184.215.14']]) + ->and(S3Driver::pinnedCurl('https://s3.example', null))->toBe([]); +}); + +// --------------------------------------------------------------------- +// SFTP host key (M-004) +// --------------------------------------------------------------------- + +it('requires a pinned SFTP host key', function () { + $sftp = Drivers::get('sftp'); + $base = ['host' => 'sftp.example', 'username' => 'u', 'password' => 'p', 'root' => '/']; + + expect($sftp->validate($base))->toHaveKey('host_fingerprint') + ->and($sftp->validate($base + ['host_fingerprint' => 'trust me']))->toBe(['host_fingerprint' => 'aMount::global.error_sftp_fingerprint']) + ->and($sftp->validate($base + ['host_fingerprint' => 'SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8']))->toBe([]); + + if (amountUsable($sftp)) { + expect(fn () => $sftp->filesystem($base, ['_trusted' => true]))->toThrow(RuntimeException::class, 'host_fingerprint'); + + amountUser(2); + $refused = amountRefusal(fn () => (new Mounts(Actor::for(2)))->create(['name' => 'Box', 'driver' => 'sftp', 'config' => $base])); + expect($refused?->errors)->toHaveKey('host_fingerprint'); + } +}); + +it('reads pinned host keys in the forms ssh-keygen and Flysystem use, several for rotation', function () { + $line = '256 SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8 sftp.example (ED25519)'; + $md5 = '16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48'; + + expect(SftpDriver::fingerprints($line))->toBe(['SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8']) + ->and(SftpDriver::fingerprints("SHA256:old+key/1=\n" . $md5 . ', md5:' . str_replace(':', '', $md5)))->toBe(['SHA256:old+key/1=', $md5, 'md5:' . str_replace(':', '', $md5)]) + ->and(SftpDriver::fingerprints('none here 256'))->toBe([]); +}); diff --git a/tests/Unit/DriversTest.php b/tests/Unit/DriversTest.php index 2857b41..511b9eb 100644 --- a/tests/Unit/DriversTest.php +++ b/tests/Unit/DriversTest.php @@ -96,7 +96,7 @@ function amountHas(array $lang, string $driver, string $key): bool it('builds the local driver and round-trips a file', function () { $root = AMOUNT_TEST_REMOTE . '/driver-local'; amountEnsureDir($root); - $fs = Drivers::get('local')->filesystem(['root' => $root]); + $fs = Drivers::get('local')->filesystem(['root' => $root], ['_trusted' => true]); $fs->write('a/b.txt', 'hello'); @@ -127,9 +127,9 @@ function amountHas(array $lang, string $driver, string $key): bool })->with([ 's3' => ['s3', ['bucket' => 'b', 'region' => 'eu-central-1', 'key' => 'k', 'secret' => 's']], 's3 compatible' => ['s3', ['bucket' => 'b', 'endpoint' => 'http://minio:9000', 'path_style' => true, 'key' => 'k', 'secret' => 's']], - 'sftp' => ['sftp', ['host' => 'example.invalid', 'username' => 'u', 'password' => 'p', 'root' => '/backups']], - 'ftp' => ['ftp', ['host' => 'example.invalid', 'username' => 'u', 'password' => 'p', 'root' => '/']], - 'webdav' => ['webdav', ['base_uri' => 'https://example.invalid/dav/', 'username' => 'u', 'password' => 'p']], + 'sftp' => ['sftp', ['host' => 'sftp.example', 'username' => 'u', 'password' => 'p', 'root' => '/backups', 'host_fingerprint' => 'SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8']], + 'ftp' => ['ftp', ['host' => 'ftp.example', 'username' => 'u', 'password' => 'p', 'root' => '/']], + 'webdav' => ['webdav', ['base_uri' => 'https://dav.example/dav/', 'username' => 'u', 'password' => 'p']], ]); it('passes visibility to the adapter only when the mount opts in', function () { diff --git a/tests/Unit/MountDraftTest.php b/tests/Unit/MountDraftTest.php index 7a80395..1bb45f8 100644 --- a/tests/Unit/MountDraftTest.php +++ b/tests/Unit/MountDraftTest.php @@ -25,7 +25,7 @@ function amountDraftRoot(): string } it('tests an unsaved mount without storing anything', function () { - amountUser(2); + amountAdmin(2); $root = amountDraftRoot(); $result = (new Mounts(Actor::for(2)))->testDraft(['driver' => 'local', 'config' => ['root' => $root]]); @@ -44,7 +44,7 @@ function amountDraftRoot(): string }); it('reports a failing connection as a verdict, not an error', function () { - amountUser(2); + amountAdmin(2); $result = (new Mounts(Actor::for(2)))->testDraft(['driver' => 'local', 'config' => ['root' => amountDraftRoot() . '/missing/../../nope-' . uniqid()]]); @@ -67,7 +67,7 @@ function amountDraftRoot(): string }); it('keeps stored secrets for an edited mount and refuses somebody else\'s', function () { - amountUser(2); + amountAdmin(2); amountUser(3); $mount = amountMount(2); @@ -80,7 +80,7 @@ function amountDraftRoot(): string }); it('answers the stateless test over HTTP with a result and no mount', function () { - amountUser(2); + amountAdmin(2); AmountTestCore::$loginUserId = 2; $request = Request::create('/x', 'POST', ['driver' => 'local', 'config' => ['root' => amountDraftRoot()]]); diff --git a/tests/Unit/ServeTest.php b/tests/Unit/ServeTest.php index d14d99c..51c2802 100644 --- a/tests/Unit/ServeTest.php +++ b/tests/Unit/ServeTest.php @@ -112,7 +112,7 @@ function amountPublicSetup(array $mountOptions = [], array $rule = []): array // And so does the mount's own setting. AmountTestCore::config()->set('cms.settings.aMount.serve.mode', 'auto'); - $mount->update(['options_json' => ['public_url' => 'https://cdn.example', 'serve' => 'proxy']]); + $mount->update(['options_json' => ['public_url' => 'https://cdn.example', 'serve' => 'proxy'] + $mount->options()]); expect(Serve::publicResponse($entry->fresh()->load('mount')))->toBeInstanceOf(StreamedResponse::class); }); diff --git a/tests/helpers.php b/tests/helpers.php index 53b620a..ec8c38d 100644 --- a/tests/helpers.php +++ b/tests/helpers.php @@ -6,6 +6,7 @@ use Elcreator\aMount\Models\Rule; use Elcreator\aMount\Models\Run; use Elcreator\aMount\Services\Syncer; +use Elcreator\aMount\Support\Destination; use Illuminate\Container\Container; use Illuminate\Database\Capsule\Manager as Capsule; use Illuminate\Database\Eloquent\Model; @@ -187,6 +188,7 @@ function amountReset(): void AmountTestCore::reset(); Drivers::reset(); + amountFakeResolver(); amountRemoveTree(AMOUNT_TEST_ROOT . '/assets'); amountRemoveTree(AMOUNT_TEST_REMOTE); @@ -194,6 +196,39 @@ function amountReset(): void amountEnsureDir(AMOUNT_TEST_REMOTE); } +/** + * No DNS in tests. `*.lan` and `localhost` are internal, `mixed.test` hides one + * private record among public ones, `*.invalid` does not resolve, anything + * else resolves to a public address. + */ +function amountFakeResolver(): void +{ + Destination::$resolver = static function (string $host): array { + return match (true) { + $host === 'localhost' => ['127.0.0.1', '::1'], + str_ends_with($host, '.lan') => ['10.0.0.5'], + $host === 'mixed.test' => ['93.184.215.14', '192.168.1.10'], + str_ends_with($host, '.invalid') => [], + default => ['93.184.215.14'], + }; + }; +} + +/** + * The administrator recorded as having configured the fixture mounts, so the + * local driver keeps serving as the byte store of non-administrators' tests. + */ +function amountFixtureAdmin(): int +{ + $id = 9990; + + if (!Capsule::table('users')->where('id', $id)->exists()) { + amountAdmin($id); + } + + return $id; +} + function amountEnsureDir(string $path): void { if (!is_dir($path)) { @@ -320,7 +355,7 @@ function amountMount(?int $ownerId = null, array $options = [], string $name = ' 'name' => $name, 'driver' => 'local', 'owner_id' => $ownerId, - 'options_json' => $options, + 'options_json' => $options + ['configured_by' => amountFixtureAdmin()], 'status' => Mount::STATUS_OK, ]); $mount->setCredentials(['root' => $root]); @@ -419,3 +454,5 @@ function amountEntry(Rule $rule, string $sitePath): ?FileEntry // --------------------------------------------------------------------------- amountBoot(); + +amountFakeResolver(); diff --git a/views/partials/script-mounts.blade.php b/views/partials/script-mounts.blade.php index 8727f29..b55db0c 100644 --- a/views/partials/script-mounts.blade.php +++ b/views/partials/script-mounts.blade.php @@ -309,7 +309,8 @@ function pickDriver(box, onPick) { add(box.foot, btn(t('ui_cancel'), { onclick: function () { box.close(); } })); add(box.body, h('p', { 'class': 'am-help', text: t('ui_driver_pick') })); GROUP_ORDER.forEach(function (group) { - var drivers = S.drivers.filter(function (d) { return (d.group || 'other') === group; }); + // Folder and ZIP drivers reach this server's disk: offered to administrators only (the API refuses the rest). + var drivers = S.drivers.filter(function (d) { return (d.group || 'other') === group && (!d.admin_only || S.flags.is_admin); }); if (!drivers.length) { return; } add(box.body, h('section', { 'class': 'am-driver-group' }, [ h('h3', { text: groupLabel(group) }), From b01fef756b0294b4c810848c01cfcff36caab351 Mon Sep 17 00:00:00 2001 From: Artur Kyryliuk Date: Sun, 15 Nov 2026 18:27:29 +0100 Subject: [PATCH 2/2] i18n: translate the mount destination and SFTP host key strings Co-Authored-By: Claude Opus 5.5 --- lang/az/global.php | 12 +++++++++--- lang/be/global.php | 12 +++++++++--- lang/bg/global.php | 12 +++++++++--- lang/cs/global.php | 12 +++++++++--- lang/da/global.php | 12 +++++++++--- lang/de/global.php | 12 +++++++++--- lang/es/global.php | 12 +++++++++--- lang/fa/global.php | 12 +++++++++--- lang/fi/global.php | 12 +++++++++--- lang/fr/global.php | 12 +++++++++--- lang/he/global.php | 12 +++++++++--- lang/it/global.php | 12 +++++++++--- lang/ja/global.php | 12 +++++++++--- lang/nl/global.php | 12 +++++++++--- lang/nn/global.php | 12 +++++++++--- lang/pl/global.php | 12 +++++++++--- lang/pt/global.php | 12 +++++++++--- lang/sk/global.php | 12 +++++++++--- lang/sv/global.php | 12 +++++++++--- lang/uk/global.php | 12 +++++++++--- lang/zh/global.php | 12 +++++++++--- 21 files changed, 189 insertions(+), 63 deletions(-) diff --git a/lang/az/global.php b/lang/az/global.php index e3c9646..9e850a4 100644 --- a/lang/az/global.php +++ b/lang/az/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Bir neçə qoşulma uyğun gəlir: :names. Hansını nəzərdə tutursunuz?', 'error_driver_unknown' => 'Bu saxlama növü tanınmır.', 'error_driver_unavailable' => ':driver əlavə paket tələb edir. Onu bu əmrlə quraşdırın: :command', + 'error_driver_admin_only' => ':driver bu serverin öz diskinə çıxış əldə edir, ona görə də onu yalnız administrator qura bilər.', + 'error_destination_private' => ':host bu serverdə və ya daxili şəbəkədədir. Ora qoşulmanı yalnız administrator yarada bilər.', + 'error_destination_unresolved' => ':host tapılmadı. Ünvanı yoxlayın.', + 'error_destination_invalid' => 'Bu, düzgün ünvan deyil.', + 'error_sftp_fingerprint' => 'Serverin host açarını sabitləyin, məs. SHA256:... (bu əmrin çıxışı: ssh-keyscan HOST | ssh-keygen -lf -)', + 'error_webdav_uri' => 'WebDAV URL-i http:// və ya https:// ilə başlamalıdır.', 'error_mount_in_use' => 'Bu qoşulmadan qovluq qaydaları istifadə edir: :count. Əvvəlcə onları silin və ya silməni məcburi edin.', 'error_mount_unusable' => 'Bu qoşulma mövcud deyil və ya ondan istifadə icazəniz yoxdur.', 'error_rule_running' => 'Bu qayda hazırda işləyir. Əvvəlcə icranı ləğv edin.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Xidmət hesabının JSON-unu yapışdırın; hədəf qovluğu onun e-poçt ünvanı ilə paylaşın.', 'h_gdrive_team' => 'Yalnız paylaşılan disk üçün.', 'h_gridfs_uri' => 'MongoDB qoşulma URI-si.', - 'h_local_root' => 'Bu serverdə qovluğun mütləq yolu, veb kökündən kənarda.', + 'h_local_root' => 'Bu serverdə qovluğun mütləq yolu, veb kökündən kənarda. Yalnız administratorlar üçün.', 'h_onedrive_drive' => 'Defolt disk üçün boş buraxın.', 'h_onedrive_tenant' => 'Kataloq (tenant) ID-si; şəxsi hesablar üçün "common".', 'h_prefix' => 'Hər şey bu qovluğun altında saxlanılır. Ən yuxarı səviyyə üçün boş buraxın.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Amazon S3 üçün boş buraxın. Digər S3-uyğun provayderlər üçün məcburidir.', 'h_s3_key' => 'Server rolundan və ya mühit məlumatlarından istifadə etmək üçün boş buraxın.', 'h_s3_token' => 'Yalnız müvəqqəti giriş məlumatları üçün.', - 'h_sftp_fingerprint' => 'Könüllü: server açarını sabitləyin (tövsiyə olunur).', + 'h_sftp_fingerprint' => 'Məcburidir. Serverin host açarı, məs. SHA256:... (əmr: ssh-keyscan HOST | ssh-keygen -lf -). Bir neçə açar (boşluq və ya sətirlərlə ayrılmış) açarı dəyişməyə imkan verir.', 'h_sftp_key' => 'Şifrə əvəzinə istifadə olunan könüllü gizli açar.', 'h_sftp_root' => 'İşləmək üçün uzaq serverdəki mütləq qovluq.', 'h_webdav_uri' => 'Tam WebDAV URL-i, Nextcloud üçün: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Bu serverdə ZIP faylının mütləq yolu.', + 'h_zip_path' => 'Bu serverdə ZIP faylının mütləq yolu. Yalnız administratorlar üçün.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/be/global.php b/lang/be/global.php index ba9d6b6..1a62dbf 100644 --- a/lang/be/global.php +++ b/lang/be/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Адпавядае некалькі падключэнняў: :names. Якое вы маеце на ўвазе?', 'error_driver_unknown' => 'Гэты тып сховішча невядомы.', 'error_driver_unavailable' => ':driver патрабуе дадатковы пакет. Усталюйце яго камандай: :command', + 'error_driver_admin_only' => ':driver звяртаецца да ўласнага дыска гэтага сервера, таму наладзіць яго можа толькі адміністратар.', + 'error_destination_private' => ':host знаходзіцца на гэтым серверы або ва ўнутранай сетцы. Падключэнне туды можа стварыць толькі адміністратар.', + 'error_destination_unresolved' => 'Не ўдалося знайсці :host. Праверце адрас.', + 'error_destination_invalid' => 'Гэта несапраўдны адрас.', + 'error_sftp_fingerprint' => 'Замацуйце ключ хаста сервера, напрыклад SHA256:..., які выводзіць: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'URL WebDAV павінен пачынацца з http:// або https://.', 'error_mount_in_use' => 'Гэта падключэнне выкарыстоўваюць правілы папак: :count. Спачатку выдаліце іх або прымусьце выдаленне.', 'error_mount_unusable' => 'Гэта падключэнне не існуе, або вы не маеце права яго выкарыстоўваць.', 'error_rule_running' => 'Гэта правіла выконваецца зараз. Спачатку скасуйце выкананне.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Устаўце JSON сэрвіснага ўліковага запісу; падзяліцеся мэтавай папкай з яго адрасам электроннай пошты.', 'h_gdrive_team' => 'Толькі для агульнага дыска.', 'h_gridfs_uri' => 'URI падключэння да MongoDB.', - 'h_local_root' => 'Абсалютны шлях да папкі на гэтым серверы, па-за каранём вэб-сервера.', + 'h_local_root' => 'Абсалютны шлях да папкі на гэтым серверы, па-за каранём вэб-сервера. Толькі для адміністратараў.', 'h_onedrive_drive' => 'Пакіньце пустым для дыска па змаўчанні.', 'h_onedrive_tenant' => 'ID каталога (tenant); «common» для асабістых уліковых запісаў.', 'h_prefix' => 'Усё захоўваецца ў гэтай папцы. Пакіньце пустым для верхняга ўзроўню.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Пакіньце пустым для Amazon S3. Абавязкова для іншых S3-сумяшчальных правайдараў.', 'h_s3_key' => 'Пакіньце пустым, каб выкарыстоўваць ролю сервера або ўліковыя даныя асяроддзя.', 'h_s3_token' => 'Толькі для часовых уліковых даных.', - 'h_sftp_fingerprint' => 'Неабавязкова: замацаваць ключ сервера (рэкамендуецца).', + 'h_sftp_fingerprint' => 'Абавязкова. Ключ хаста сервера, напрыклад SHA256:... з каманды: ssh-keyscan HOST | ssh-keygen -lf -. Некалькі ключоў (праз прабел або з новага радка) дазваляюць замяніць адзін з іх.', 'h_sftp_key' => 'Неабавязковы закрыты ключ, які выкарыстоўваецца замест пароля.', 'h_sftp_root' => 'Абсалютная выдаленая папка, у якой працаваць.', 'h_webdav_uri' => 'Поўны URL WebDAV, для Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Абсалютны шлях да файла ZIP на гэтым серверы.', + 'h_zip_path' => 'Абсалютны шлях да файла ZIP на гэтым серверы. Толькі для адміністратараў.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/bg/global.php b/lang/bg/global.php index 01d78bf..4e42d4f 100644 --- a/lang/bg/global.php +++ b/lang/bg/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Съвпадат няколко връзки: :names. Коя имате предвид?', 'error_driver_unknown' => 'Този тип хранилище не е познат.', 'error_driver_unavailable' => ':driver изисква допълнителен пакет. Инсталирайте го с: :command', + 'error_driver_admin_only' => ':driver достъпва собствения диск на този сървър, затова само администратор може да го настрои.', + 'error_destination_private' => ':host е на този сървър или във вътрешна мрежа. Само администратор може да създаде връзка към него.', + 'error_destination_unresolved' => ':host не може да бъде намерен. Проверете адреса.', + 'error_destination_invalid' => 'Това не е валиден адрес.', + 'error_sftp_fingerprint' => 'Фиксирайте хост ключа на сървъра, напр. SHA256:..., както го извежда: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'URL адресът на WebDAV трябва да започва с http:// или https://.', 'error_mount_in_use' => 'Тази връзка се използва от правила за папки: :count. Първо ги премахнете или принудете премахването.', 'error_mount_unusable' => 'Тази връзка не съществува или нямате право да я използвате.', 'error_rule_running' => 'Това правило се изпълнява в момента. Първо отменете изпълнението.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Поставете JSON на сервизния акаунт; споделете целевата папка с неговия имейл адрес.', 'h_gdrive_team' => 'Само за споделен диск.', 'h_gridfs_uri' => 'URI за връзка с MongoDB.', - 'h_local_root' => 'Абсолютен път на папката на този сървър, извън главната папка на уеб сървъра.', + 'h_local_root' => 'Абсолютен път на папката на този сървър, извън главната папка на уеб сървъра. Само за администратори.', 'h_onedrive_drive' => 'Оставете празно за диска по подразбиране.', 'h_onedrive_tenant' => 'ID на директорията (tenant); „common“ за лични акаунти.', 'h_prefix' => 'Всичко се съхранява под тази папка. Оставете празно за най-горното ниво.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Оставете празно за Amazon S3. Задължително за други S3-съвместими доставчици.', 'h_s3_key' => 'Оставете празно, за да се използват ролята на сървъра или данните от средата.', 'h_s3_token' => 'Само за временни идентификационни данни.', - 'h_sftp_fingerprint' => 'По избор: фиксиране на ключа на сървъра (препоръчително).', + 'h_sftp_fingerprint' => 'Задължително. Хост ключът на сървъра, напр. SHA256:... от: ssh-keyscan HOST | ssh-keygen -lf -. Няколко ключа (разделени с интервали или редове) позволяват смяна на ключ.', 'h_sftp_key' => 'Незадължителен частен ключ, използван вместо парола.', 'h_sftp_root' => 'Абсолютна отдалечена папка, в която да се работи.', 'h_webdav_uri' => 'Пълният WebDAV URL, за Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Абсолютен път на ZIP файла на този сървър.', + 'h_zip_path' => 'Абсолютен път на ZIP файла на този сървър. Само за администратори.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/cs/global.php b/lang/cs/global.php index a5a64f8..10b52a4 100644 --- a/lang/cs/global.php +++ b/lang/cs/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Odpovídá více připojení: :names. Které máte na mysli?', 'error_driver_unknown' => 'Tento typ úložiště není znám.', 'error_driver_unavailable' => ':driver vyžaduje další balíček. Nainstalujte jej příkazem: :command', + 'error_driver_admin_only' => ':driver přistupuje k vlastnímu disku tohoto serveru, proto ho může nastavit jen administrátor.', + 'error_destination_private' => ':host je na tomto serveru nebo ve vnitřní síti. Připojení tam může vytvořit jen administrátor.', + 'error_destination_unresolved' => ':host se nepodařilo najít. Zkontrolujte adresu.', + 'error_destination_invalid' => 'Toto není platná adresa.', + 'error_sftp_fingerprint' => 'Připněte klíč hostitele serveru, např. SHA256:..., jak ho vypíše: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'URL WebDAV musí začínat http:// nebo https://.', 'error_mount_in_use' => 'Toto připojení používá počet pravidel složek: :count. Nejprve je odstraňte nebo odstranění vynuťte.', 'error_mount_unusable' => 'Toto připojení neexistuje nebo ho nemůžete použít.', 'error_rule_running' => 'Toto pravidlo právě běží. Nejprve zrušte běh.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Vložte JSON servisního účtu a cílovou složku sdílejte na jeho e-mailovou adresu.', 'h_gdrive_team' => 'Pouze pro sdílený disk.', 'h_gridfs_uri' => 'Připojovací URI MongoDB.', - 'h_local_root' => 'Absolutní cesta ke složce na tomto serveru, mimo webový kořen.', + 'h_local_root' => 'Absolutní cesta ke složce na tomto serveru, mimo webový kořen. Pouze pro administrátory.', 'h_onedrive_drive' => 'Pro výchozí disk nechte prázdné.', 'h_onedrive_tenant' => 'ID adresáře (tenanta); „common“ pro osobní účty.', 'h_prefix' => 'Vše se ukládá pod tuto složku. Pro nejvyšší úroveň nechte prázdné.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Pro Amazon S3 nechte prázdné. U ostatních poskytovatelů kompatibilních s S3 je povinné.', 'h_s3_key' => 'Nechte prázdné, aby se použila role serveru nebo přihlašovací údaje z prostředí.', 'h_s3_token' => 'Pouze pro dočasné přihlašovací údaje.', - 'h_sftp_fingerprint' => 'Volitelné: připnout klíč serveru (doporučeno).', + 'h_sftp_fingerprint' => 'Povinné. Klíč hostitele serveru, např. SHA256:... z: ssh-keyscan HOST | ssh-keygen -lf -. Více klíčů (oddělených mezerami nebo řádky) umožňuje jeden vyměnit.', 'h_sftp_key' => 'Volitelný soukromý klíč použitý místo hesla.', 'h_sftp_root' => 'Absolutní vzdálená složka, ve které se pracuje.', 'h_webdav_uri' => 'Úplná adresa WebDAV, pro Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Absolutní cesta k souboru ZIP na tomto serveru.', + 'h_zip_path' => 'Absolutní cesta k souboru ZIP na tomto serveru. Pouze pro administrátory.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/da/global.php b/lang/da/global.php index 876e953..90a0933 100644 --- a/lang/da/global.php +++ b/lang/da/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Flere monteringer passer: :names. Hvilken mener du?', 'error_driver_unknown' => 'Denne lagertype er ukendt.', 'error_driver_unavailable' => ':driver kræver en ekstra pakke. Installer den med: :command', + 'error_driver_admin_only' => ':driver tilgår serverens egen disk, så kun en administrator kan opsætte den.', + 'error_destination_private' => ':host ligger på denne server eller et internt netværk. Kun en administrator kan oprette en montering dertil.', + 'error_destination_unresolved' => ':host blev ikke fundet. Kontrollér adressen.', + 'error_destination_invalid' => 'Dette er ikke en gyldig adresse.', + 'error_sftp_fingerprint' => 'Fastlås serverens værtsnøgle, f.eks. SHA256:... som udskrevet af: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'WebDAV-URL\'en skal begynde med http:// eller https://.', 'error_mount_in_use' => 'Denne montering bruges af :count mappereg(e)l. Fjern dem først, eller gennemtving fjernelsen.', 'error_mount_unusable' => 'Denne montering findes ikke, eller du må ikke bruge den.', 'error_rule_running' => 'Denne regel kører lige nu. Annuller kørslen først.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Indsæt servicekontoens JSON; del målmappen med dens e-mailadresse.', 'h_gdrive_team' => 'Kun for et delt drev.', 'h_gridfs_uri' => 'MongoDB-forbindelses-URI\'en.', - 'h_local_root' => 'Absolut sti til mappen på denne server, uden for webroden.', + 'h_local_root' => 'Absolut sti til mappen på denne server, uden for webroden. Kun administratorer.', 'h_onedrive_drive' => 'Lad feltet stå tomt for standarddrevet.', 'h_onedrive_tenant' => 'Mappe-ID (tenant); "common" til personlige konti.', 'h_prefix' => 'Alt gemmes under denne mappe. Lad feltet stå tomt for øverste niveau.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Lad feltet stå tomt for Amazon S3. Påkrævet for andre S3-kompatible udbydere.', 'h_s3_key' => 'Lad feltet stå tomt for at bruge serverens rolle eller miljøets legitimationsoplysninger.', 'h_s3_token' => 'Kun for midlertidige legitimationsoplysninger.', - 'h_sftp_fingerprint' => 'Valgfrit: fastlås serverens nøgle (anbefalet).', + 'h_sftp_fingerprint' => 'Påkrævet. Serverens værtsnøgle, f.eks. SHA256:... fra: ssh-keyscan HOST | ssh-keygen -lf -. Flere nøgler (adskilt af mellemrum eller linjer) gør det muligt at udskifte en.', 'h_sftp_key' => 'Valgfri privat nøgle, der bruges i stedet for et kodeord.', 'h_sftp_root' => 'Absolut fjernmappe, der arbejdes i.', 'h_webdav_uri' => 'Den fulde WebDAV-URL, for Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Absolut sti til ZIP-filen på denne server.', + 'h_zip_path' => 'Absolut sti til ZIP-filen på denne server. Kun administratorer.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/de/global.php b/lang/de/global.php index 97ed2e4..a998e2c 100644 --- a/lang/de/global.php +++ b/lang/de/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Mehrere Mounts passen: :names. Welchen meinen Sie?', 'error_driver_unknown' => 'Dieser Speichertyp ist nicht bekannt.', 'error_driver_unavailable' => ':driver benötigt ein zusätzliches Paket. Installieren Sie es mit: :command', + 'error_driver_admin_only' => ':driver greift auf die eigene Festplatte dieses Servers zu, daher kann ihn nur ein Administrator einrichten.', + 'error_destination_private' => ':host liegt auf diesem Server oder in einem internen Netzwerk. Nur ein Administrator kann dorthin einen Mount anlegen.', + 'error_destination_unresolved' => ':host wurde nicht gefunden. Prüfen Sie die Adresse.', + 'error_destination_invalid' => 'Dies ist keine gültige Adresse.', + 'error_sftp_fingerprint' => 'Hinterlegen Sie den Host-Schlüssel des Servers fest, z. B. SHA256:... wie ausgegeben von: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'Die WebDAV-URL muss mit http:// oder https:// beginnen.', 'error_mount_in_use' => 'Dieser Mount wird von :count Verzeichnisregel(n) verwendet. Entfernen Sie diese zuerst oder erzwingen Sie das Entfernen.', 'error_mount_unusable' => 'Dieser Mount existiert nicht oder Sie dürfen ihn nicht verwenden.', 'error_rule_running' => 'Diese Regel läuft gerade. Brechen Sie zuerst den Lauf ab.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Fügen Sie das JSON des Dienstkontos ein; geben Sie das Zielverzeichnis für dessen E-Mail-Adresse frei.', 'h_gdrive_team' => 'Nur für ein geteiltes Laufwerk.', 'h_gridfs_uri' => 'Die MongoDB-Verbindungs-URI.', - 'h_local_root' => 'Absoluter Pfad des Verzeichnisses auf diesem Server, außerhalb des Web-Roots.', + 'h_local_root' => 'Absoluter Pfad des Verzeichnisses auf diesem Server, außerhalb des Web-Roots. Nur für Administratoren.', 'h_onedrive_drive' => 'Leer lassen für das Standardlaufwerk.', 'h_onedrive_tenant' => 'Verzeichnis-ID (Tenant); „common“ für persönliche Konten.', 'h_prefix' => 'Alles wird unterhalb dieses Verzeichnisses gespeichert. Leer lassen für die oberste Ebene.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Für Amazon S3 leer lassen. Für andere S3-kompatible Anbieter erforderlich.', 'h_s3_key' => 'Leer lassen, um die Serverrolle oder Zugangsdaten aus der Umgebung zu verwenden.', 'h_s3_token' => 'Nur für temporäre Zugangsdaten.', - 'h_sftp_fingerprint' => 'Optional: den Serverschlüssel fest hinterlegen (empfohlen).', + 'h_sftp_fingerprint' => 'Erforderlich. Der Host-Schlüssel des Servers, z. B. SHA256:... aus: ssh-keyscan HOST | ssh-keygen -lf -. Mehrere Schlüssel (durch Leerzeichen oder Zeilen getrennt) ermöglichen einen Schlüsselwechsel.', 'h_sftp_key' => 'Optionaler privater Schlüssel, der anstelle eines Passworts verwendet wird.', 'h_sftp_root' => 'Absolutes Verzeichnis auf dem Server, in dem gearbeitet wird.', 'h_webdav_uri' => 'Die vollständige WebDAV-URL, für Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Absoluter Pfad der ZIP-Datei auf diesem Server.', + 'h_zip_path' => 'Absoluter Pfad der ZIP-Datei auf diesem Server. Nur für Administratoren.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/es/global.php b/lang/es/global.php index 8f24e2b..7019b26 100644 --- a/lang/es/global.php +++ b/lang/es/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Varios montajes coinciden: :names. ¿A cuál se refiere?', 'error_driver_unknown' => 'Este tipo de almacenamiento no se conoce.', 'error_driver_unavailable' => ':driver necesita un paquete adicional. Instálelo con: :command', + 'error_driver_admin_only' => ':driver accede al propio disco de este servidor, por lo que solo un administrador puede configurarlo.', + 'error_destination_private' => ':host está en este servidor o en una red interna. Solo un administrador puede conectar un montaje allí.', + 'error_destination_unresolved' => 'No se encontró :host. Compruebe la dirección.', + 'error_destination_invalid' => 'Esta no es una dirección válida.', + 'error_sftp_fingerprint' => 'Fije la clave de host del servidor, p. ej. SHA256:... tal como la muestra: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'La URL de WebDAV debe empezar por http:// o https://.', 'error_mount_in_use' => 'Este montaje lo usan :count regla(s) de carpeta. Elimínelas primero o fuerce la eliminación.', 'error_mount_unusable' => 'Este montaje no existe o no puede usarlo.', 'error_rule_running' => 'Esta regla se está ejecutando ahora. Cancele primero la ejecución.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Pegue el JSON de la cuenta de servicio; comparta la carpeta de destino con su dirección de correo electrónico.', 'h_gdrive_team' => 'Solo para una unidad compartida.', 'h_gridfs_uri' => 'La URI de conexión de MongoDB.', - 'h_local_root' => 'Ruta absoluta de la carpeta en este servidor, fuera de la raíz web.', + 'h_local_root' => 'Ruta absoluta de la carpeta en este servidor, fuera de la raíz web. Solo administradores.', 'h_onedrive_drive' => 'Déjelo vacío para la unidad predeterminada.', 'h_onedrive_tenant' => 'ID del directorio (tenant); «common» para cuentas personales.', 'h_prefix' => 'Todo se guarda dentro de esta carpeta. Déjelo vacío para el nivel superior.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Déjelo vacío para Amazon S3. Obligatorio para otros proveedores compatibles con S3.', 'h_s3_key' => 'Déjelo vacío para usar el rol del servidor o las credenciales del entorno.', 'h_s3_token' => 'Solo para credenciales temporales.', - 'h_sftp_fingerprint' => 'Opcional: fijar la clave del servidor (recomendado).', + 'h_sftp_fingerprint' => 'Obligatorio. La clave de host del servidor, p. ej. SHA256:... de: ssh-keyscan HOST | ssh-keygen -lf -. Varias claves (separadas por espacios o líneas) permiten rotar una.', 'h_sftp_key' => 'Clave privada opcional usada en lugar de una contraseña.', 'h_sftp_root' => 'Carpeta remota absoluta en la que trabajar.', 'h_webdav_uri' => 'La URL completa de WebDAV; para Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Ruta absoluta del archivo ZIP en este servidor.', + 'h_zip_path' => 'Ruta absoluta del archivo ZIP en este servidor. Solo administradores.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/fa/global.php b/lang/fa/global.php index 2147220..02c1f86 100644 --- a/lang/fa/global.php +++ b/lang/fa/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'چند مانت مطابقت دارند: :names. کدام را منظور دارید؟', 'error_driver_unknown' => 'این نوع فضای ذخیره‌سازی شناخته نشده است.', 'error_driver_unavailable' => ':driver به یک بسته اضافی نیاز دارد. آن را با این دستور نصب کنید: :command', + 'error_driver_admin_only' => ':driver به دیسک خود این سرور دسترسی دارد، بنابراین فقط مدیر کل می‌تواند آن را راه‌اندازی کند.', + 'error_destination_private' => ':host روی این سرور یا در یک شبکه داخلی است. فقط مدیر کل می‌تواند مانتی به آنجا وصل کند.', + 'error_destination_unresolved' => ':host پیدا نشد. نشانی را بررسی کنید.', + 'error_destination_invalid' => 'این یک نشانی معتبر نیست.', + 'error_sftp_fingerprint' => 'کلید میزبان سرور را ثابت کنید، مثلاً SHA256:... همان‌طور که این دستور چاپ می‌کند: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'نشانی WebDAV باید با http:// یا https:// شروع شود.', 'error_mount_in_use' => 'این مانت توسط :count قانون پوشه استفاده می‌شود. ابتدا آن‌ها را حذف کنید یا حذف را اجباری کنید.', 'error_mount_unusable' => 'این مانت وجود ندارد یا شما مجاز به استفاده از آن نیستید.', 'error_rule_running' => 'این قانون هم‌اکنون در حال اجراست. ابتدا اجرا را لغو کنید.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'JSON حساب سرویس را وارد کنید؛ پوشه مقصد را با نشانی ایمیل آن به اشتراک بگذارید.', 'h_gdrive_team' => 'فقط برای درایو اشتراکی.', 'h_gridfs_uri' => 'URI اتصال MongoDB.', - 'h_local_root' => 'مسیر مطلق پوشه روی این سرور، خارج از ریشه وب.', + 'h_local_root' => 'مسیر مطلق پوشه روی این سرور، خارج از ریشه وب. فقط برای مدیران کل.', 'h_onedrive_drive' => 'برای درایو پیش‌فرض خالی بگذارید.', 'h_onedrive_tenant' => 'شناسه دایرکتوری (tenant)؛ برای حساب‌های شخصی «common».', 'h_prefix' => 'همه چیز زیر این پوشه ذخیره می‌شود. برای سطح بالا خالی بگذارید.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'برای Amazon S3 خالی بگذارید. برای دیگر ارائه‌دهندگان سازگار با S3 الزامی است.', 'h_s3_key' => 'برای استفاده از نقش سرور یا اطلاعات اعتبارسنجی محیط، خالی بگذارید.', 'h_s3_token' => 'فقط برای اطلاعات اعتبارسنجی موقت.', - 'h_sftp_fingerprint' => 'اختیاری: کلید سرور را ثابت کنید (توصیه می‌شود).', + 'h_sftp_fingerprint' => 'الزامی. کلید میزبان سرور، مثلاً SHA256:... از: ssh-keyscan HOST | ssh-keygen -lf -. چند کلید (جداشده با فاصله یا خط) امکان جایگزینی یکی از آن‌ها را می‌دهد.', 'h_sftp_key' => 'کلید خصوصی اختیاری که به جای کلمه عبور استفاده می‌شود.', 'h_sftp_root' => 'پوشه مطلق راه دور برای کار.', 'h_webdav_uri' => 'نشانی کامل WebDAV، برای Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'مسیر مطلق فایل ZIP روی این سرور.', + 'h_zip_path' => 'مسیر مطلق فایل ZIP روی این سرور. فقط برای مدیران کل.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/fi/global.php b/lang/fi/global.php index d2b50aa..a33ec62 100644 --- a/lang/fi/global.php +++ b/lang/fi/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Useampi liitos täsmää: :names. Mitä niistä tarkoitat?', 'error_driver_unknown' => 'Tätä tallennustilan tyyppiä ei tunneta.', 'error_driver_unavailable' => ':driver tarvitsee lisäpaketin. Asenna se komennolla: :command', + 'error_driver_admin_only' => ':driver käyttää tämän palvelimen omaa levyä, joten vain pääkäyttäjä voi määrittää sen.', + 'error_destination_private' => ':host on tällä palvelimella tai sisäverkossa. Vain pääkäyttäjä voi luoda sinne liitoksen.', + 'error_destination_unresolved' => 'Kohdetta :host ei löytynyt. Tarkista osoite.', + 'error_destination_invalid' => 'Tämä ei ole kelvollinen osoite.', + 'error_sftp_fingerprint' => 'Kiinnitä palvelimen isäntäavain, esim. SHA256:... kuten komento tulostaa: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'WebDAV-URL:n on alettava http:// tai https://.', 'error_mount_in_use' => 'Tätä liitosta käyttää :count kansiosääntöä. Poista ne ensin tai pakota poisto.', 'error_mount_unusable' => 'Tätä liitosta ei ole tai et saa käyttää sitä.', 'error_rule_running' => 'Tämä sääntö on parhaillaan käynnissä. Peruuta ajo ensin.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Liitä palvelutilin JSON; jaa kohdekansio sen sähköpostiosoitteelle.', 'h_gdrive_team' => 'Vain jaetulle asemalle.', 'h_gridfs_uri' => 'MongoDB-yhteyden URI.', - 'h_local_root' => 'Kansion absoluuttinen polku tällä palvelimella, verkon juuren ulkopuolella.', + 'h_local_root' => 'Kansion absoluuttinen polku tällä palvelimella, verkon juuren ulkopuolella. Vain pääkäyttäjille.', 'h_onedrive_drive' => 'Jätä tyhjäksi oletusasemaa varten.', 'h_onedrive_tenant' => 'Hakemiston (tenant) tunnus; "common" henkilökohtaisille tileille.', 'h_prefix' => 'Kaikki tallennetaan tämän kansion alle. Jätä tyhjäksi ylintä tasoa varten.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Jätä tyhjäksi Amazon S3:a varten. Pakollinen muille S3-yhteensopiville palveluntarjoajille.', 'h_s3_key' => 'Jätä tyhjäksi, jos käytetään palvelimen roolia tai ympäristön tunnistetietoja.', 'h_s3_token' => 'Vain tilapäisille tunnistetiedoille.', - 'h_sftp_fingerprint' => 'Valinnainen: kiinnitä palvelimen avain (suositeltu).', + 'h_sftp_fingerprint' => 'Pakollinen. Palvelimen isäntäavain, esim. SHA256:... komennosta: ssh-keyscan HOST | ssh-keygen -lf -. Useampi avain (välilyönnein tai riveittäin eroteltuna) mahdollistaa avaimen vaihdon.', 'h_sftp_key' => 'Valinnainen yksityinen avain, jota käytetään salasanan sijaan.', 'h_sftp_root' => 'Absoluuttinen etäkansio, jossa työskennellään.', 'h_webdav_uri' => 'Täydellinen WebDAV-osoite, Nextcloudille: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'ZIP-tiedoston absoluuttinen polku tällä palvelimella.', + 'h_zip_path' => 'ZIP-tiedoston absoluuttinen polku tällä palvelimella. Vain pääkäyttäjille.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/fr/global.php b/lang/fr/global.php index 9969128..451d0aa 100644 --- a/lang/fr/global.php +++ b/lang/fr/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Plusieurs montages correspondent : :names. Lequel souhaitez-vous ?', 'error_driver_unknown' => 'Ce type de stockage est inconnu.', 'error_driver_unavailable' => ':driver nécessite un paquet supplémentaire. Installez-le avec : :command', + 'error_driver_admin_only' => ':driver accède au disque propre de ce serveur ; seul un administrateur peut donc le configurer.', + 'error_destination_private' => ':host se trouve sur ce serveur ou sur un réseau interne. Seul un administrateur peut y connecter un montage.', + 'error_destination_unresolved' => ':host est introuvable. Vérifiez l\'adresse.', + 'error_destination_invalid' => 'Cette adresse n\'est pas valide.', + 'error_sftp_fingerprint' => 'Épinglez la clé d\'hôte du serveur, par ex. SHA256:... telle qu\'affichée par : ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'L\'URL WebDAV doit commencer par http:// ou https://.', 'error_mount_in_use' => 'Ce montage est utilisé par :count règle(s) de répertoire. Supprimez-les d\'abord ou forcez la suppression.', 'error_mount_unusable' => 'Ce montage n\'existe pas ou vous n\'êtes pas autorisé à l\'utiliser.', 'error_rule_running' => 'Cette règle est en cours d\'exécution. Annulez d\'abord l\'exécution.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Collez le JSON du compte de service ; partagez le répertoire cible avec son adresse e-mail.', 'h_gdrive_team' => 'Uniquement pour un disque partagé.', 'h_gridfs_uri' => 'L\'URI de connexion MongoDB.', - 'h_local_root' => 'Chemin absolu du répertoire sur ce serveur, en dehors de la racine web.', + 'h_local_root' => 'Chemin absolu du répertoire sur ce serveur, en dehors de la racine web. Réservé aux administrateurs.', 'h_onedrive_drive' => 'Laissez vide pour le disque par défaut.', 'h_onedrive_tenant' => 'ID du répertoire (tenant) ; « common » pour les comptes personnels.', 'h_prefix' => 'Tout est stocké sous ce répertoire. Laissez vide pour le niveau supérieur.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Laissez vide pour Amazon S3. Obligatoire pour les autres fournisseurs compatibles S3.', 'h_s3_key' => 'Laissez vide pour utiliser le rôle du serveur ou les identifiants de l\'environnement.', 'h_s3_token' => 'Uniquement pour des identifiants temporaires.', - 'h_sftp_fingerprint' => 'Facultatif : épingler la clé du serveur (recommandé).', + 'h_sftp_fingerprint' => 'Obligatoire. La clé d\'hôte du serveur, par ex. SHA256:... obtenue avec : ssh-keyscan HOST | ssh-keygen -lf -. Plusieurs clés (séparées par des espaces ou des lignes) permettent d\'en remplacer une.', 'h_sftp_key' => 'Clé privée facultative utilisée à la place d\'un mot de passe.', 'h_sftp_root' => 'Répertoire distant absolu dans lequel travailler.', 'h_webdav_uri' => 'L\'URL WebDAV complète, pour Nextcloud : https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Chemin absolu du fichier ZIP sur ce serveur.', + 'h_zip_path' => 'Chemin absolu du fichier ZIP sur ce serveur. Réservé aux administrateurs.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/he/global.php b/lang/he/global.php index a36f94d..4d8904d 100644 --- a/lang/he/global.php +++ b/lang/he/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'מספר חיבורים תואמים: :names. לאיזה התכוונתם?', 'error_driver_unknown' => 'סוג האחסון הזה אינו מוכר.', 'error_driver_unavailable' => ':driver דורש חבילה נוספת. התקינו אותה באמצעות: :command', + 'error_driver_admin_only' => ':driver ניגש לדיסק של שרת זה עצמו, ולכן רק מנהל מערכת יכול להגדיר אותו.', + 'error_destination_private' => ':host נמצא בשרת זה או ברשת פנימית. רק מנהל מערכת יכול ליצור אליו חיבור.', + 'error_destination_unresolved' => 'לא ניתן למצוא את :host. בדקו את הכתובת.', + 'error_destination_invalid' => 'זו אינה כתובת תקינה.', + 'error_sftp_fingerprint' => 'נעצו את מפתח המארח של השרת, למשל SHA256:... כפי שמודפס על ידי: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'כתובת ה-URL של WebDAV חייבת להתחיל ב-http:// או ב-https://.', 'error_mount_in_use' => 'החיבור הזה בשימוש של :count כללי תיקיות. הסירו אותם קודם או אלצו את ההסרה.', 'error_mount_unusable' => 'החיבור הזה אינו קיים או שאינכם מורשים להשתמש בו.', 'error_rule_running' => 'הכלל הזה רץ כעת. בטלו קודם את ההרצה.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'הדביקו את ה-JSON של חשבון השירות; שתפו את תיקיית היעד עם כתובת הדוא"ל שלו.', 'h_gdrive_team' => 'רק עבור כונן משותף.', 'h_gridfs_uri' => 'כתובת ה-URI של החיבור ל-MongoDB.', - 'h_local_root' => 'נתיב מוחלט של התיקייה בשרת זה, מחוץ לשורש האתר.', + 'h_local_root' => 'נתיב מוחלט של התיקייה בשרת זה, מחוץ לשורש האתר. למנהלי מערכת בלבד.', 'h_onedrive_drive' => 'השאירו ריק לכונן ברירת המחדל.', 'h_onedrive_tenant' => 'מזהה ספרייה (Tenant); "common" לחשבונות אישיים.', 'h_prefix' => 'הכול נשמר מתחת לתיקייה זו. השאירו ריק לרמה העליונה.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'השאירו ריק עבור Amazon S3. חובה עבור ספקים אחרים התואמים ל-S3.', 'h_s3_key' => 'השאירו ריק כדי להשתמש בתפקיד השרת או בפרטי הגישה מהסביבה.', 'h_s3_token' => 'רק עבור פרטי גישה זמניים.', - 'h_sftp_fingerprint' => 'אופציונלי: נעיצת מפתח השרת (מומלץ).', + 'h_sftp_fingerprint' => 'חובה. מפתח המארח של השרת, למשל SHA256:... מתוך: ssh-keyscan HOST | ssh-keygen -lf -. מספר מפתחות (מופרדים ברווחים או בשורות) מאפשרים להחליף אחד מהם.', 'h_sftp_key' => 'מפתח פרטי אופציונלי שישמש במקום סיסמה.', 'h_sftp_root' => 'תיקייה מרוחקת מוחלטת לעבודה.', 'h_webdav_uri' => 'כתובת ה-WebDAV המלאה, עבור Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'נתיב מוחלט של קובץ ה-ZIP בשרת זה.', + 'h_zip_path' => 'נתיב מוחלט של קובץ ה-ZIP בשרת זה. למנהלי מערכת בלבד.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/it/global.php b/lang/it/global.php index e1c24ba..778eeca 100644 --- a/lang/it/global.php +++ b/lang/it/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Più mount corrispondono: :names. Quale intendi?', 'error_driver_unknown' => 'Questo tipo di archiviazione non è riconosciuto.', 'error_driver_unavailable' => ':driver richiede un pacchetto aggiuntivo. Installalo con: :command', + 'error_driver_admin_only' => ':driver accede al disco di questo server, quindi solo un amministratore può configurarlo.', + 'error_destination_private' => ':host si trova su questo server o su una rete interna. Solo un amministratore può collegarvi un mount.', + 'error_destination_unresolved' => 'Impossibile trovare :host. Controlla l\'indirizzo.', + 'error_destination_invalid' => 'Questo non è un indirizzo valido.', + 'error_sftp_fingerprint' => 'Fissa la chiave host del server, ad es. SHA256:... come stampata da: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'L\'URL WebDAV deve iniziare con http:// o https://.', 'error_mount_in_use' => 'Questo mount è usato da :count regole cartella. Rimuovile prima o forza la rimozione.', 'error_mount_unusable' => 'Questo mount non esiste o non hai il permesso di usarlo.', 'error_rule_running' => 'Questa regola è in esecuzione. Annulla prima l\'esecuzione.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Incolla il JSON dell\'account di servizio; condividi la cartella di destinazione con il suo indirizzo e-mail.', 'h_gdrive_team' => 'Solo per un\'unità condivisa.', 'h_gridfs_uri' => 'L\'URI di connessione a MongoDB.', - 'h_local_root' => 'Percorso assoluto della cartella su questo server, fuori dalla web root.', + 'h_local_root' => 'Percorso assoluto della cartella su questo server, fuori dalla web root. Solo per amministratori.', 'h_onedrive_drive' => 'Lascia vuoto per l\'unità predefinita.', 'h_onedrive_tenant' => 'ID della directory (tenant); "common" per gli account personali.', 'h_prefix' => 'Tutto viene archiviato sotto questa cartella. Lascia vuoto per la radice.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Lascia vuoto per Amazon S3. Obbligatorio per gli altri provider compatibili con S3.', 'h_s3_key' => 'Lascia vuoto per usare il ruolo del server o le credenziali d\'ambiente.', 'h_s3_token' => 'Solo per credenziali temporanee.', - 'h_sftp_fingerprint' => 'Facoltativo: fissa la chiave del server (consigliato).', + 'h_sftp_fingerprint' => 'Obbligatorio. La chiave host del server, ad es. SHA256:... da: ssh-keyscan HOST | ssh-keygen -lf -. Più chiavi (separate da spazi o righe) permettono di sostituirne una.', 'h_sftp_key' => 'Chiave privata facoltativa usata al posto di una password.', 'h_sftp_root' => 'Cartella remota assoluta in cui lavorare.', 'h_webdav_uri' => 'L\'URL WebDAV completo, per Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Percorso assoluto del file ZIP su questo server.', + 'h_zip_path' => 'Percorso assoluto del file ZIP su questo server. Solo per amministratori.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/ja/global.php b/lang/ja/global.php index 98927e9..f65ac35 100644 --- a/lang/ja/global.php +++ b/lang/ja/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => '複数のマウントが一致します: :names。どれを指定しますか?', 'error_driver_unknown' => 'このストレージの種類は不明です。', 'error_driver_unavailable' => ':driver には追加パッケージが必要です。次のコマンドでインストールしてください: :command', + 'error_driver_admin_only' => ':driver はこのサーバー自身のディスクにアクセスするため、管理者のみが設定できます。', + 'error_destination_private' => ':host はこのサーバー上または内部ネットワーク上にあります。そこへのマウントは管理者のみが接続できます。', + 'error_destination_unresolved' => ':host が見つかりませんでした。アドレスを確認してください。', + 'error_destination_invalid' => '有効なアドレスではありません。', + 'error_sftp_fingerprint' => 'サーバーのホスト鍵を固定してください。例: SHA256:... (次のコマンドで表示されます: ssh-keyscan HOST | ssh-keygen -lf -)', + 'error_webdav_uri' => 'WebDAV の URL は http:// または https:// で始まる必要があります。', 'error_mount_in_use' => 'このマウントは :count 件のフォルダルールで使用されています。先にルールを削除するか、強制的に削除してください。', 'error_mount_unusable' => 'このマウントは存在しないか、使用する権限がありません。', 'error_rule_running' => 'このルールは現在実行中です。先に実行をキャンセルしてください。', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'サービスアカウントの JSON を貼り付け、対象フォルダをそのメールアドレスと共有してください。', 'h_gdrive_team' => '共有ドライブの場合のみ。', 'h_gridfs_uri' => 'MongoDB の接続 URI。', - 'h_local_root' => 'このサーバー上のフォルダの絶対パス(Web ルートの外)。', + 'h_local_root' => 'このサーバー上のフォルダの絶対パス(Web ルートの外)。管理者のみ。', 'h_onedrive_drive' => '既定のドライブを使う場合は空欄にしてください。', 'h_onedrive_tenant' => 'ディレクトリ(テナント)ID。個人アカウントの場合は "common"。', 'h_prefix' => 'すべてこのフォルダの下に保存されます。最上位に保存する場合は空欄にしてください。', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Amazon S3 の場合は空欄にしてください。その他の S3 互換プロバイダーでは必須です。', 'h_s3_key' => 'サーバーのロールまたは環境の認証情報を使う場合は空欄にしてください。', 'h_s3_token' => '一時的な認証情報の場合のみ。', - 'h_sftp_fingerprint' => '任意: サーバーの鍵を固定します(推奨)。', + 'h_sftp_fingerprint' => '必須。サーバーのホスト鍵。例: SHA256:... (取得: ssh-keyscan HOST | ssh-keygen -lf -)。複数の鍵 (スペースまたは改行で区切る) を指定すると鍵を入れ替えられます。', 'h_sftp_key' => 'パスワードの代わりに使う秘密鍵(任意)。', 'h_sftp_root' => '作業するリモートフォルダの絶対パス。', 'h_webdav_uri' => '完全な WebDAV URL。Nextcloud の場合: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'このサーバー上の ZIP ファイルの絶対パス。', + 'h_zip_path' => 'このサーバー上の ZIP ファイルの絶対パス。管理者のみ。', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/nl/global.php b/lang/nl/global.php index ee4dd4b..3d734ed 100644 --- a/lang/nl/global.php +++ b/lang/nl/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Meerdere mounts komen overeen: :names. Welke bedoelt u?', 'error_driver_unknown' => 'Dit opslagtype is onbekend.', 'error_driver_unavailable' => ':driver heeft een extra pakket nodig. Installeer het met: :command', + 'error_driver_admin_only' => ':driver benadert de eigen schijf van deze server, dus alleen een administrator kan hem instellen.', + 'error_destination_private' => ':host staat op deze server of in een intern netwerk. Alleen een administrator kan daar een mount koppelen.', + 'error_destination_unresolved' => ':host is niet gevonden. Controleer het adres.', + 'error_destination_invalid' => 'Dit is geen geldig adres.', + 'error_sftp_fingerprint' => 'Zet de hostsleutel van de server vast, bijv. SHA256:... zoals getoond door: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'De WebDAV-URL moet beginnen met http:// of https://.', 'error_mount_in_use' => 'Deze mount wordt gebruikt door :count mapregels. Verwijder ze eerst of forceer de verwijdering.', 'error_mount_unusable' => 'Deze mount bestaat niet of u mag hem niet gebruiken.', 'error_rule_running' => 'Deze regel wordt nu uitgevoerd. Annuleer eerst de uitvoering.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Plak de JSON van het serviceaccount; deel de doelmap met het bijbehorende e-mailadres.', 'h_gdrive_team' => 'Alleen voor een gedeelde schijf.', 'h_gridfs_uri' => 'De MongoDB-verbindings-URI.', - 'h_local_root' => 'Absoluut pad van de map op deze server, buiten de webroot.', + 'h_local_root' => 'Absoluut pad van de map op deze server, buiten de webroot. Alleen voor administrators.', 'h_onedrive_drive' => 'Laat leeg voor de standaardschijf.', 'h_onedrive_tenant' => 'Directory-ID (tenant); "common" voor persoonlijke accounts.', 'h_prefix' => 'Alles wordt onder deze map opgeslagen. Laat leeg voor het hoogste niveau.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Laat leeg voor Amazon S3. Verplicht voor andere S3-compatibele providers.', 'h_s3_key' => 'Laat leeg om de serverrol of de inloggegevens uit de omgeving te gebruiken.', 'h_s3_token' => 'Alleen voor tijdelijke inloggegevens.', - 'h_sftp_fingerprint' => 'Optioneel: zet de serversleutel vast (aanbevolen).', + 'h_sftp_fingerprint' => 'Verplicht. De hostsleutel van de server, bijv. SHA256:... uit: ssh-keyscan HOST | ssh-keygen -lf -. Met meerdere sleutels (gescheiden door spaties of regels) kunt u er een vervangen.', 'h_sftp_key' => 'Optionele privésleutel die in plaats van een wachtwoord wordt gebruikt.', 'h_sftp_root' => 'Absolute externe map om in te werken.', 'h_webdav_uri' => 'De volledige WebDAV-URL, voor Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Absoluut pad van het ZIP-bestand op deze server.', + 'h_zip_path' => 'Absoluut pad van het ZIP-bestand op deze server. Alleen voor administrators.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/nn/global.php b/lang/nn/global.php index 4abf67f..7099bad 100644 --- a/lang/nn/global.php +++ b/lang/nn/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Fleire monteringar passar: :names. Kva meiner du?', 'error_driver_unknown' => 'Denne lagringstypen er ukjend.', 'error_driver_unavailable' => ':driver treng ein ekstra pakke. Installer han med: :command', + 'error_driver_admin_only' => ':driver når den eigne disken til denne tenaren, så berre ein administrator kan setje han opp.', + 'error_destination_private' => ':host er på denne tenaren eller i eit internt nettverk. Berre ein administrator kan kople ei montering dit.', + 'error_destination_unresolved' => 'Fann ikkje :host. Sjekk adressa.', + 'error_destination_invalid' => 'Dette er ikkje ei gyldig adresse.', + 'error_sftp_fingerprint' => 'Fest vertsnøkkelen til tenaren, t.d. SHA256:... slik han blir skriven ut av: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'WebDAV-URL-en må byrje med http:// eller https://.', 'error_mount_in_use' => 'Denne monteringa blir brukt av :count mappereglar. Fjern dei først, eller tving fram fjerninga.', 'error_mount_unusable' => 'Denne monteringa finst ikkje, eller du har ikkje løyve til å bruke ho.', 'error_rule_running' => 'Denne regelen køyrer no. Avbryt køyringa først.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Lim inn JSON for tenestekontoen; del målmappa med e-postadressen til kontoen.', 'h_gdrive_team' => 'Berre for ein delt stasjon.', 'h_gridfs_uri' => 'MongoDB-tilkoplings-URI-en.', - 'h_local_root' => 'Absolutt sti til mappa på denne tenaren, utanfor vevrota.', + 'h_local_root' => 'Absolutt sti til mappa på denne tenaren, utanfor vevrota. Berre for administratorar.', 'h_onedrive_drive' => 'La stå tomt for standardstasjonen.', 'h_onedrive_tenant' => 'Katalog-ID (tenant); «common» for personlege kontoar.', 'h_prefix' => 'Alt blir lagra under denne mappa. La stå tomt for øvste nivå.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'La stå tomt for Amazon S3. Påkravd for andre S3-kompatible leverandørar.', 'h_s3_key' => 'La stå tomt for å bruke tenarrolla eller påloggingsinformasjon frå miljøet.', 'h_s3_token' => 'Berre for mellombels påloggingsinformasjon.', - 'h_sftp_fingerprint' => 'Valfritt: fest tenarnøkkelen (tilrådd).', + 'h_sftp_fingerprint' => 'Påkravd. Vertsnøkkelen til tenaren, t.d. SHA256:... frå: ssh-keyscan HOST | ssh-keygen -lf -. Fleire nøklar (skilde med mellomrom eller linjer) let deg byte ut ein.', 'h_sftp_key' => 'Valfri privat nøkkel som blir brukt i staden for passord.', 'h_sftp_root' => 'Absolutt ekstern mappe å arbeide i.', 'h_webdav_uri' => 'Den fullstendige WebDAV-URL-en, for Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Absolutt sti til ZIP-fila på denne tenaren.', + 'h_zip_path' => 'Absolutt sti til ZIP-fila på denne tenaren. Berre for administratorar.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/pl/global.php b/lang/pl/global.php index 53239d4..d9ea840 100644 --- a/lang/pl/global.php +++ b/lang/pl/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Pasuje kilka dysków: :names. Który masz na myśli?', 'error_driver_unknown' => 'Nieznany typ magazynu.', 'error_driver_unavailable' => ':driver wymaga dodatkowego pakietu. Zainstaluj go poleceniem: :command', + 'error_driver_admin_only' => ':driver sięga do własnego dysku tego serwera, więc skonfigurować go może tylko administrator.', + 'error_destination_private' => ':host znajduje się na tym serwerze lub w sieci wewnętrznej. Tylko administrator może podłączyć tam dysk.', + 'error_destination_unresolved' => 'Nie znaleziono :host. Sprawdź adres.', + 'error_destination_invalid' => 'To nie jest prawidłowy adres.', + 'error_sftp_fingerprint' => 'Przypnij klucz hosta serwera, np. SHA256:... wypisany przez: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'Adres URL WebDAV musi zaczynać się od http:// lub https://.', 'error_mount_in_use' => 'Ten dysk jest używany przez reguły folderów (liczba: :count). Najpierw je usuń lub wymuś usunięcie.', 'error_mount_unusable' => 'Ten dysk nie istnieje lub nie masz uprawnień do jego użycia.', 'error_rule_running' => 'Ta reguła jest właśnie uruchomiona. Najpierw anuluj uruchomienie.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Wklej JSON konta usługi; udostępnij folder docelowy jego adresowi e-mail.', 'h_gdrive_team' => 'Tylko dla dysku współdzielonego.', 'h_gridfs_uri' => 'URI połączenia z MongoDB.', - 'h_local_root' => 'Ścieżka bezwzględna folderu na tym serwerze, poza katalogiem głównym WWW.', + 'h_local_root' => 'Ścieżka bezwzględna folderu na tym serwerze, poza katalogiem głównym WWW. Tylko dla administratorów.', 'h_onedrive_drive' => 'Zostaw puste, aby użyć dysku domyślnego.', 'h_onedrive_tenant' => 'ID katalogu (tenanta); „common” dla kont osobistych.', 'h_prefix' => 'Wszystko jest zapisywane poniżej tego folderu. Zostaw puste, aby użyć poziomu głównego.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Zostaw puste dla Amazon S3. Wymagane dla innych dostawców zgodnych z S3.', 'h_s3_key' => 'Zostaw puste, aby użyć roli serwera lub danych uwierzytelniających ze środowiska.', 'h_s3_token' => 'Tylko dla poświadczeń tymczasowych.', - 'h_sftp_fingerprint' => 'Opcjonalnie: przypnij klucz serwera (zalecane).', + 'h_sftp_fingerprint' => 'Wymagane. Klucz hosta serwera, np. SHA256:... z: ssh-keyscan HOST | ssh-keygen -lf -. Kilka kluczy (oddzielonych spacjami lub wierszami) pozwala wymienić jeden z nich.', 'h_sftp_key' => 'Opcjonalny klucz prywatny używany zamiast hasła.', 'h_sftp_root' => 'Bezwzględna ścieżka zdalnego folderu roboczego.', 'h_webdav_uri' => 'Pełny adres WebDAV, dla Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Ścieżka bezwzględna pliku ZIP na tym serwerze.', + 'h_zip_path' => 'Ścieżka bezwzględna pliku ZIP na tym serwerze. Tylko dla administratorów.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/pt/global.php b/lang/pt/global.php index 83a711e..9f82580 100644 --- a/lang/pt/global.php +++ b/lang/pt/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Várias unidades correspondem: :names. A qual se refere?', 'error_driver_unknown' => 'Este tipo de armazenamento não é conhecido.', 'error_driver_unavailable' => ':driver requer um pacote adicional. Instale-o com: :command', + 'error_driver_admin_only' => ':driver acede ao próprio disco deste servidor, por isso só um administrador o pode configurar.', + 'error_destination_private' => ':host está neste servidor ou numa rede interna. Só um administrador pode ligar uma unidade aí.', + 'error_destination_unresolved' => 'Não foi possível encontrar :host. Verifique o endereço.', + 'error_destination_invalid' => 'Este não é um endereço válido.', + 'error_sftp_fingerprint' => 'Fixe a chave de anfitrião do servidor, p. ex. SHA256:... tal como apresentada por: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'O URL WebDAV tem de começar por http:// ou https://.', 'error_mount_in_use' => 'Esta unidade é utilizada por regras de pasta (quantidade: :count). Remova-as primeiro ou force a remoção.', 'error_mount_unusable' => 'Esta unidade não existe ou não tem permissão para a utilizar.', 'error_rule_running' => 'Esta regra está em execução neste momento. Cancele primeiro a execução.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Cole o JSON da conta de serviço; partilhe a pasta de destino com o respetivo endereço de e-mail.', 'h_gdrive_team' => 'Apenas para uma unidade partilhada.', 'h_gridfs_uri' => 'O URI de ligação do MongoDB.', - 'h_local_root' => 'Caminho absoluto da pasta neste servidor, fora da raiz web.', + 'h_local_root' => 'Caminho absoluto da pasta neste servidor, fora da raiz web. Apenas administradores.', 'h_onedrive_drive' => 'Deixe vazio para a unidade predefinida.', 'h_onedrive_tenant' => 'ID do diretório (tenant); "common" para contas pessoais.', 'h_prefix' => 'Tudo é guardado abaixo desta pasta. Deixe vazio para o nível superior.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Deixe vazio para o Amazon S3. Obrigatório para outros fornecedores compatíveis com S3.', 'h_s3_key' => 'Deixe vazio para utilizar a função do servidor ou as credenciais do ambiente.', 'h_s3_token' => 'Apenas para credenciais temporárias.', - 'h_sftp_fingerprint' => 'Opcional: fixar a chave do servidor (recomendado).', + 'h_sftp_fingerprint' => 'Obrigatório. A chave de anfitrião do servidor, p. ex. SHA256:... obtida com: ssh-keyscan HOST | ssh-keygen -lf -. Várias chaves (separadas por espaços ou linhas) permitem substituir uma.', 'h_sftp_key' => 'Chave privada opcional utilizada em vez de uma senha.', 'h_sftp_root' => 'Pasta remota absoluta onde trabalhar.', 'h_webdav_uri' => 'O URL WebDAV completo, para Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Caminho absoluto do ficheiro ZIP neste servidor.', + 'h_zip_path' => 'Caminho absoluto do ficheiro ZIP neste servidor. Apenas administradores.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/sk/global.php b/lang/sk/global.php index 4e4a806..449bfe1 100644 --- a/lang/sk/global.php +++ b/lang/sk/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Vyhovuje viacero diskov: :names. Ktorý máte na mysli?', 'error_driver_unknown' => 'Tento typ úložiska nie je známy.', 'error_driver_unavailable' => ':driver vyžaduje ďalší balík. Nainštalujte ho príkazom: :command', + 'error_driver_admin_only' => ':driver pristupuje k vlastnému disku tohto servera, preto ho môže nastaviť iba administrátor.', + 'error_destination_private' => ':host je na tomto serveri alebo vo vnútornej sieti. Disk tam môže pripojiť iba administrátor.', + 'error_destination_unresolved' => ':host sa nepodarilo nájsť. Skontrolujte adresu.', + 'error_destination_invalid' => 'Toto nie je platná adresa.', + 'error_sftp_fingerprint' => 'Pripnite kľúč hostiteľa servera, napr. SHA256:..., ako ho vypíše: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'URL WebDAV musí začínať http:// alebo https://.', 'error_mount_in_use' => 'Tento disk používajú pravidlá priečinkov (počet: :count). Najprv ich odstráňte alebo vynúťte odstránenie.', 'error_mount_unusable' => 'Tento disk neexistuje alebo ho nemôžete používať.', 'error_rule_running' => 'Toto pravidlo práve beží. Najprv zrušte spustenie.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Vložte JSON servisného účtu; cieľový priečinok zdieľajte s jeho e-mailovou adresou.', 'h_gdrive_team' => 'Iba pre zdieľaný disk.', 'h_gridfs_uri' => 'Pripojovacie URI MongoDB.', - 'h_local_root' => 'Absolútna cesta k priečinku na tomto serveri, mimo koreňového adresára webu.', + 'h_local_root' => 'Absolútna cesta k priečinku na tomto serveri, mimo koreňového adresára webu. Iba pre administrátorov.', 'h_onedrive_drive' => 'Nechajte prázdne pre predvolený disk.', 'h_onedrive_tenant' => 'ID adresára (tenanta); „common“ pre osobné účty.', 'h_prefix' => 'Všetko sa ukladá pod tento priečinok. Nechajte prázdne pre najvyššiu úroveň.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Pre Amazon S3 nechajte prázdne. Vyžaduje sa pri iných poskytovateľoch kompatibilných s S3.', 'h_s3_key' => 'Nechajte prázdne, ak sa majú použiť rola servera alebo prístupové údaje z prostredia.', 'h_s3_token' => 'Iba pre dočasné prístupové údaje.', - 'h_sftp_fingerprint' => 'Voliteľné: pripnúť kľúč servera (odporúčané).', + 'h_sftp_fingerprint' => 'Povinné. Kľúč hostiteľa servera, napr. SHA256:... z: ssh-keyscan HOST | ssh-keygen -lf -. Viac kľúčov (oddelených medzerami alebo riadkami) umožňuje jeden vymeniť.', 'h_sftp_key' => 'Voliteľný súkromný kľúč používaný namiesto hesla.', 'h_sftp_root' => 'Absolútna cesta vzdialeného priečinka, v ktorom sa pracuje.', 'h_webdav_uri' => 'Úplná adresa WebDAV, pre Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Absolútna cesta k súboru ZIP na tomto serveri.', + 'h_zip_path' => 'Absolútna cesta k súboru ZIP na tomto serveri. Iba pre administrátorov.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/sv/global.php b/lang/sv/global.php index 748905f..d9d0326 100644 --- a/lang/sv/global.php +++ b/lang/sv/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Flera enheter matchar: :names. Vilken menar du?', 'error_driver_unknown' => 'Den här lagringstypen är okänd.', 'error_driver_unavailable' => ':driver kräver ett extra paket. Installera det med: :command', + 'error_driver_admin_only' => ':driver når den här serverns egen disk, så bara en administratör kan konfigurera den.', + 'error_destination_private' => ':host finns på den här servern eller i ett internt nätverk. Bara en administratör kan ansluta en enhet dit.', + 'error_destination_unresolved' => ':host hittades inte. Kontrollera adressen.', + 'error_destination_invalid' => 'Det här är inte en giltig adress.', + 'error_sftp_fingerprint' => 'Fäst serverns värdnyckel, t.ex. SHA256:... som skrivs ut av: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'WebDAV-URL:en måste börja med http:// eller https://.', 'error_mount_in_use' => 'Den här enheten används av mappregler (antal: :count). Ta bort dem först eller tvinga borttagning.', 'error_mount_unusable' => 'Den här enheten finns inte eller så får du inte använda den.', 'error_rule_running' => 'Den här regeln körs just nu. Avbryt körningen först.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Klistra in tjänstkontots JSON; dela målmappen med dess e-postadress.', 'h_gdrive_team' => 'Endast för en delad enhet.', 'h_gridfs_uri' => 'MongoDB-anslutnings-URI.', - 'h_local_root' => 'Absolut sökväg till mappen på den här servern, utanför webbroten.', + 'h_local_root' => 'Absolut sökväg till mappen på den här servern, utanför webbroten. Endast administratörer.', 'h_onedrive_drive' => 'Lämna tomt för standardenheten.', 'h_onedrive_tenant' => 'Katalog-ID (tenant); "common" för personliga konton.', 'h_prefix' => 'Allt lagras under den här mappen. Lämna tomt för översta nivån.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Lämna tomt för Amazon S3. Krävs för andra S3-kompatibla leverantörer.', 'h_s3_key' => 'Lämna tomt för att använda serverns roll eller miljöns autentiseringsuppgifter.', 'h_s3_token' => 'Endast för tillfälliga autentiseringsuppgifter.', - 'h_sftp_fingerprint' => 'Valfritt: fäst serverns nyckel (rekommenderas).', + 'h_sftp_fingerprint' => 'Obligatoriskt. Serverns värdnyckel, t.ex. SHA256:... från: ssh-keyscan HOST | ssh-keygen -lf -. Flera nycklar (åtskilda med blanksteg eller rader) gör att du kan byta ut en.', 'h_sftp_key' => 'Valfri privat nyckel som används i stället för ett lösenord.', 'h_sftp_root' => 'Absolut fjärrmapp att arbeta i.', 'h_webdav_uri' => 'Den fullständiga WebDAV-adressen, för Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Absolut sökväg till ZIP-filen på den här servern.', + 'h_zip_path' => 'Absolut sökväg till ZIP-filen på den här servern. Endast administratörer.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/uk/global.php b/lang/uk/global.php index 34097e7..9e1bd7b 100644 --- a/lang/uk/global.php +++ b/lang/uk/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => 'Підходить кілька дисків: :names. Який саме ви маєте на увазі?', 'error_driver_unknown' => 'Невідомий тип сховища.', 'error_driver_unavailable' => ':driver потребує додаткового пакета. Встановіть його командою: :command', + 'error_driver_admin_only' => ':driver звертається до власного диска цього сервера, тому налаштувати його може лише адміністратор.', + 'error_destination_private' => ':host розташований на цьому сервері або у внутрішній мережі. Підключити туди диск може лише адміністратор.', + 'error_destination_unresolved' => 'Не вдалося знайти :host. Перевірте адресу.', + 'error_destination_invalid' => 'Це недійсна адреса.', + 'error_sftp_fingerprint' => 'Закріпіть ключ хоста сервера, наприклад SHA256:..., який виводить: ssh-keyscan HOST | ssh-keygen -lf -', + 'error_webdav_uri' => 'URL WebDAV має починатися з http:// або https://.', 'error_mount_in_use' => 'Цей диск використовують правила папок (кількість: :count). Спершу видаліть їх або примусово видаліть диск.', 'error_mount_unusable' => 'Цей диск не існує, або вам не дозволено ним користуватися.', 'error_rule_running' => 'Це правило виконується просто зараз. Спершу скасуйте запуск.', @@ -155,7 +161,7 @@ 'h_gdrive_service' => 'Вставте JSON службового облікового запису; надайте цільовій папці доступ для його адреси e-mail.', 'h_gdrive_team' => 'Лише для спільного диска.', 'h_gridfs_uri' => 'URI підключення до MongoDB.', - 'h_local_root' => 'Абсолютний шлях до папки на цьому сервері, поза кореневою папкою вебсайту.', + 'h_local_root' => 'Абсолютний шлях до папки на цьому сервері, поза кореневою папкою вебсайту. Лише для адміністраторів.', 'h_onedrive_drive' => 'Залиште порожнім для диска за замовчуванням.', 'h_onedrive_tenant' => 'ID каталогу (tenant); «common» для особистих облікових записів.', 'h_prefix' => 'Усе зберігається нижче цієї папки. Залиште порожнім для верхнього рівня.', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Для Amazon S3 залиште порожнім. Обов\'язково для інших провайдерів, сумісних з S3.', 'h_s3_key' => 'Залиште порожнім, щоб використати роль сервера або облікові дані із середовища.', 'h_s3_token' => 'Лише для тимчасових облікових даних.', - 'h_sftp_fingerprint' => 'Необов\'язково: закріпити ключ сервера (рекомендовано).', + 'h_sftp_fingerprint' => 'Обов\'язково. Ключ хоста сервера, наприклад SHA256:... з: ssh-keyscan HOST | ssh-keygen -lf -. Кілька ключів (через пробіл або з нового рядка) дають змогу замінити один із них.', 'h_sftp_key' => 'Необов\'язковий приватний ключ, який використовується замість пароля.', 'h_sftp_root' => 'Абсолютний шлях до віддаленої робочої папки.', 'h_webdav_uri' => 'Повна адреса WebDAV, для Nextcloud: https://host/remote.php/dav/files/USER/', - 'h_zip_path' => 'Абсолютний шлях до файлу ZIP на цьому сервері.', + 'h_zip_path' => 'Абсолютний шлях до файлу ZIP на цьому сервері. Лише для адміністраторів.', // Manager UI: page and shared 'ui_title' => 'aMount', diff --git a/lang/zh/global.php b/lang/zh/global.php index 9a27acd..763f945 100644 --- a/lang/zh/global.php +++ b/lang/zh/global.php @@ -25,6 +25,12 @@ 'error_ambiguous_mount' => '有多个挂载盘匹配::names。您指的是哪一个?', 'error_driver_unknown' => '未知的存储类型。', 'error_driver_unavailable' => ':driver 需要额外的软件包。请使用以下命令安装::command', + 'error_driver_admin_only' => ':driver 会访问此服务器自身的磁盘,因此只有超级管理员可以设置。', + 'error_destination_private' => ':host 位于此服务器或内部网络中。只有超级管理员可以在那里连接挂载盘。', + 'error_destination_unresolved' => '找不到 :host。请检查地址。', + 'error_destination_invalid' => '这不是有效的地址。', + 'error_sftp_fingerprint' => '请固定服务器的主机密钥,例如 SHA256:...(可通过以下命令获取:ssh-keyscan HOST | ssh-keygen -lf -)', + 'error_webdav_uri' => 'WebDAV URL 必须以 http:// 或 https:// 开头。', 'error_mount_in_use' => '此挂载盘正被文件夹规则使用(数量::count)。请先移除这些规则,或强制移除。', 'error_mount_unusable' => '此挂载盘不存在,或您无权使用。', 'error_rule_running' => '此规则正在运行。请先取消运行。', @@ -155,7 +161,7 @@ 'h_gdrive_service' => '粘贴服务账号 JSON;并将目标文件夹共享给其电子邮件地址。', 'h_gdrive_team' => '仅适用于共享云端硬盘。', 'h_gridfs_uri' => 'MongoDB 连接 URI。', - 'h_local_root' => '此服务器上该文件夹的绝对路径,应位于 Web 根目录之外。', + 'h_local_root' => '此服务器上该文件夹的绝对路径,应位于 Web 根目录之外。仅限超级管理员。', 'h_onedrive_drive' => '留空则使用默认云端硬盘。', 'h_onedrive_tenant' => '目录(tenant)ID;个人账户请填 "common"。', 'h_prefix' => '所有内容都存放在此文件夹下。留空则存放在顶层。', @@ -163,11 +169,11 @@ 'h_s3_endpoint' => 'Amazon S3 请留空。其他兼容 S3 的提供商必须填写。', 'h_s3_key' => '留空则使用服务器角色或环境中的凭据。', 'h_s3_token' => '仅适用于临时凭据。', - 'h_sftp_fingerprint' => '可选:固定服务器密钥(推荐)。', + 'h_sftp_fingerprint' => '必填。服务器的主机密钥,例如 SHA256:...(来自:ssh-keyscan HOST | ssh-keygen -lf -)。填写多个密钥(以空格或换行分隔)即可轮换其中一个。', 'h_sftp_key' => '可选的私钥,用于替代密码。', 'h_sftp_root' => '要使用的远程文件夹的绝对路径。', 'h_webdav_uri' => '完整的 WebDAV 地址,Nextcloud 示例:https://host/remote.php/dav/files/USER/', - 'h_zip_path' => '此服务器上 ZIP 文件的绝对路径。', + 'h_zip_path' => '此服务器上 ZIP 文件的绝对路径。仅限超级管理员。', // Manager UI: page and shared 'ui_title' => 'aMount',