From 0b8030530424f9979a1a89ea8cfc3cd4fc7205bf Mon Sep 17 00:00:00 2001 From: Artur Kyryliuk Date: Sun, 15 Nov 2026 19:10:15 +0100 Subject: [PATCH 1/3] build: make the S3, SFTP and WebDAV drivers optional packages Only the local folder driver is needed by every installation, yet the AWS SDK (77 MB), phpseclib and sabre/dav were installed on every site. Their adapters move from require to suggest, like the other drivers; Driver::available() already reports a missing one with its install command. "conflict" keeps the minimum versions when they are installed (SFTP <3.36 would break host-key pinning). league/flysystem-local, which the local driver needs and only the core's dependencies happened to bring, is now required. The builds keep these drivers: ci/plugin.env PLUGIN_EXTRAS is installed next to the plugin (tests, demo, zip, images; empty builds the bare plugin) and the smoke test checks it. amount:demo --s3 skips with the install command when S3 is missing. Upgrading sites lose the three drivers on composer update unless they install them; the README says so. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 5 +++ README.md | 18 ++++++++- ci/compose-evo.sh | 8 +++- ci/lib/write-custom-composer.php | 8 +++- ci/plugin.env | 7 ++++ ci/smoke.sh | 8 ++++ composer.json | 12 ++++-- src/Console/DemoCommand.php | 10 +++++ tests/Unit/PackagesTest.php | 69 ++++++++++++++++++++++++++++++++ 9 files changed, 136 insertions(+), 9 deletions(-) create mode 100644 tests/Unit/PackagesTest.php diff --git a/AGENTS.md b/AGENTS.md index 79d960c..47d76a4 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. +- **Storage drivers are optional packages**: `require` holds only `league/flysystem` and + `league/flysystem-local`; every other driver's package is in `suggest`, with its minimum version + in `conflict` (SFTP `<3.36` would break host-key pinning). Builds (tests, demo, zip, images) + add `PLUGIN_EXTRAS` from `ci/plugin.env`, so tests may use the S3/SFTP/WebDAV classes; code may + not assume them outside their driver (`Driver::available()`). `PackagesTest` keeps this in sync. - **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 diff --git a/README.md b/README.md index 0565a8b..dca9328 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,22 @@ php artisan package:installrequire elcreator/amount "*" php artisan migrate ``` -The module appears in the manager menu as **aMount**. Run `php artisan amount:drivers` to see which drivers are -installed; install a missing one with the command it prints. `php artisan amount:demo --run` seeds a demo on a local +The module appears in the manager menu as **aMount**. Only the local folder driver comes with it; every storage +driver is an optional package, so a site carries just the ones it uses (the AWS SDK alone is about 77 MB). Run +`php artisan amount:drivers` to see which drivers are installed; install a missing one with the command it prints, +e.g. for S3, SFTP and WebDAV (the trailing `0` records a package without running Composer, so it runs once): + +```sh +php artisan package:installrequire league/flysystem-aws-s3-v3 "*" 0 +php artisan package:installrequire league/flysystem-sftp-v3 "*" 0 +php artisan package:installrequire league/flysystem-webdav "*" +``` + +> **Upgrading from a version that required S3, SFTP and WebDAV:** `composer update` removes those packages if nothing +> else needs them, and mounts using them then report the install command instead of connecting. Install the drivers +> you use as above before or after updating. + +The ready-made zip and Docker images include the S3, SFTP and WebDAV drivers. `php artisan amount:demo --run` seeds a demo on a local disk (no account needed). ## Permissions diff --git a/ci/compose-evo.sh b/ci/compose-evo.sh index 9d379b6..d6a4a30 100755 --- a/ci/compose-evo.sh +++ b/ci/compose-evo.sh @@ -179,7 +179,8 @@ step "core/custom/composer.json" # CMS plus this one plugin; a package that happened to be installed in the # core this was built from has no business travelling into a published image. custom="$target/core/custom/composer.json" -PLUGIN_PACKAGE="$PLUGIN_PACKAGE" PLUGIN_SLUG="$PLUGIN_SLUG" php "$here/lib/write-custom-composer.php" "$custom" +PLUGIN_PACKAGE="$PLUGIN_PACKAGE" PLUGIN_SLUG="$PLUGIN_SLUG" PLUGIN_EXTRAS="${PLUGIN_EXTRAS:-}" \ + php "$here/lib/write-custom-composer.php" "$custom" cat "$custom" step "composer update $PLUGIN_PACKAGE (partial)" @@ -200,7 +201,10 @@ step "composer update $PLUGIN_PACKAGE (partial)" # being maintained and wrong for a build that has to be reproducible. lock_before=$(mktemp) cp "$target/core/composer.lock" "$lock_before" -( cd "$target/core" && composer update "${composer_args[@]}" --with-dependencies "$PLUGIN_PACKAGE" ) +# The optional packages from plugin.env (PLUGIN_EXTRAS) are named too, so they +# may be installed; word splitting is intended. +# shellcheck disable=SC2086 +( cd "$target/core" && composer update "${composer_args[@]}" --with-dependencies "$PLUGIN_PACKAGE" ${PLUGIN_EXTRAS:-} ) step "What the plugin changed in core/composer.lock" php "$here/lib/lock-delta.php" "$lock_before" "$target/core/composer.lock" diff --git a/ci/lib/write-custom-composer.php b/ci/lib/write-custom-composer.php index 8a07c05..152dc4a 100644 --- a/ci/lib/write-custom-composer.php +++ b/ci/lib/write-custom-composer.php @@ -12,12 +12,16 @@ * else they had installed there is exactly what must not travel into a * published zip or image. * - * Usage: PLUGIN_PACKAGE=... PLUGIN_SLUG=... php write-custom-composer.php + * PLUGIN_EXTRAS (optional, space-separated package names) are required at + * any version: the plugin's own "conflict" section sets their minimums. + * + * Usage: PLUGIN_PACKAGE=... PLUGIN_SLUG=... [PLUGIN_EXTRAS=...] php write-custom-composer.php */ $custom = $argv[1] ?? ''; $package = getenv('PLUGIN_PACKAGE') ?: ''; $slug = getenv('PLUGIN_SLUG') ?: ''; +$extras = preg_split('/\s+/', trim((string) getenv('PLUGIN_EXTRAS')), -1, PREG_SPLIT_NO_EMPTY) ?: []; if ($custom === '' || $package === '' || $slug === '') { fwrite(STDERR, "usage: PLUGIN_PACKAGE=... PLUGIN_SLUG=... php write-custom-composer.php \n"); @@ -44,7 +48,7 @@ 'options' => ['symlink' => false], ], ], - 'require' => [$package => '@dev'], + 'require' => [$package => '@dev'] + array_fill_keys($extras, '*'), 'autoload' => ['psr-4' => ['EvolutionCMS\\Custom\\' => 'src/']], ]; diff --git a/ci/plugin.env b/ci/plugin.env index 0de9b1b..5a0a76d 100644 --- a/ci/plugin.env +++ b/ci/plugin.env @@ -14,6 +14,13 @@ PLUGIN_PROVIDER='Elcreator\aMount\aMountServiceProvider' # Directory name under core/custom/packages/, and the local docker image name. PLUGIN_SLUG='amount' +# Optional (composer "suggest") packages the builds install next to the plugin, +# space-separated, at any version the plugin's "conflict" allows. The unit +# suite, the demo and the published zip/images then carry these drivers, while +# a site installing the plugin from packagist adds only the ones it uses. +# PLUGIN_EXTRAS= (set but empty) builds the bare plugin. +PLUGIN_EXTRAS="${PLUGIN_EXTRAS-league/flysystem-aws-s3-v3 league/flysystem-sftp-v3 league/flysystem-webdav}" + # The CMS this plugin is built into. EVO_REPO="${EVO_REPO:-https://github.com/evolution-cms/evolution}" EVO_REF="${EVO_REF:-3.5.x}" diff --git a/ci/smoke.sh b/ci/smoke.sh index 5e037fa..74ef4e4 100755 --- a/ci/smoke.sh +++ b/ci/smoke.sh @@ -26,6 +26,14 @@ fail() { echo "smoke.sh: $*" >&2; exit 1; } step "Package is installed" [ -d "$evo_dir/core/vendor/$PLUGIN_PACKAGE" ] || fail "$PLUGIN_PACKAGE missing from core/vendor" +if [ -n "${PLUGIN_EXTRAS:-}" ]; then + step "Optional packages are installed" + for extra in $PLUGIN_EXTRAS; do + [ -d "$evo_dir/core/vendor/$extra" ] || fail "$extra (PLUGIN_EXTRAS) missing from core/vendor" + echo "ok $extra" + done +fi + step "Service provider is discovered" # `artisan package:discover` runs on every composer dump-autoload and drops one # file per discovered provider into core/custom/config/app/providers/. That diff --git a/composer.json b/composer.json index 47f7186..9614061 100644 --- a/composer.json +++ b/composer.json @@ -8,14 +8,15 @@ "php": "^8.3", "evolution-cms/evolution": "^3.5.2", "league/flysystem": "^3.10", - "league/flysystem-aws-s3-v3": "^3.10", - "league/flysystem-sftp-v3": "^3.36", - "league/flysystem-webdav": "^3.6" + "league/flysystem-local": "^3.10" }, "require-dev": { "pestphp/pest": "^4.0" }, "suggest": { + "league/flysystem-aws-s3-v3": "Amazon S3 and S3-compatible driver (MinIO, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces ...)", + "league/flysystem-sftp-v3": "SFTP / SSH driver", + "league/flysystem-webdav": "WebDAV driver (Nextcloud, ownCloud, Synology ...)", "league/flysystem-ftp": "FTP/FTPS driver (needs ext-ftp, which many PHP builds omit, so it is not a hard requirement)", "league/flysystem-async-aws-s3": "AsyncAws S3 driver (lighter alternative to the AWS SDK)", "league/flysystem-google-cloud-storage": "Google Cloud Storage driver", @@ -31,6 +32,11 @@ "overtrue/flysystem-qiniu": "Qiniu Kodo driver", "seiger/stask": "Alternative queue manager: aMount runs its uploads as an sTask worker when it is installed" }, + "conflict": { + "league/flysystem-aws-s3-v3": "<3.10", + "league/flysystem-sftp-v3": "<3.36", + "league/flysystem-webdav": "<3.6" + }, "autoload": { "psr-4": { "Elcreator\\aMount\\": "src/" diff --git a/src/Console/DemoCommand.php b/src/Console/DemoCommand.php index f362992..ac74f0e 100644 --- a/src/Console/DemoCommand.php +++ b/src/Console/DemoCommand.php @@ -2,6 +2,7 @@ namespace Elcreator\aMount\Console; +use Elcreator\aMount\Drivers\Drivers; use Elcreator\aMount\Models\FileEntry; use Elcreator\aMount\Models\Mount; use Elcreator\aMount\Models\Rule; @@ -84,6 +85,15 @@ private function s3(Mounts $mounts, Rules $rules): array return []; } + // The S3 package is optional (composer "suggest"). + $driver = Drivers::get('s3'); + + if (!$driver->available()) { + $this->warn('Skipping --s3: the S3 driver is not installed. Install it with: ' . $driver->installCommand()); + + return []; + } + $mount = $this->mount($mounts, 'Demo S3 (MinIO)', 's3', [ 'bucket' => $env['BUCKET'], 'region' => $env['REGION'] ?: 'us-east-1', 'endpoint' => $env['ENDPOINT'], 'path_style' => true, 'key' => $env['KEY'], 'secret' => $env['SECRET'], diff --git a/tests/Unit/PackagesTest.php b/tests/Unit/PackagesTest.php new file mode 100644 index 0000000..63d7b50 --- /dev/null +++ b/tests/Unit/PackagesTest.php @@ -0,0 +1,69 @@ + amountReset()); + +function amountComposer(): array +{ + return json_decode((string) file_get_contents(dirname(__DIR__, 2) . '/composer.json'), true, 512, JSON_THROW_ON_ERROR); +} + +/** @return string[] the PLUGIN_EXTRAS of ci/plugin.env */ +function amountPluginExtras(): array +{ + $env = (string) file_get_contents(dirname(__DIR__, 2) . '/ci/plugin.env'); + + return preg_match('/^PLUGIN_EXTRAS="\$\{PLUGIN_EXTRAS-([^}]*)\}"/m', $env, $m) ? preg_split('/\s+/', trim($m[1]), -1, PREG_SPLIT_NO_EMPTY) : []; +} + +it('requires only what every installation uses', function () { + expect(array_keys(amountComposer()['require'])) + ->toBe(['php', 'evolution-cms/evolution', 'league/flysystem', 'league/flysystem-local']); +}); + +it('offers every storage driver package as a suggestion, apart from the local one', function () { + $composer = amountComposer(); + // What the required CMS brings itself (guzzle for the computer driver). + $core = json_decode((string) file_get_contents((getenv('EVO_CORE_PATH_TEST') ?: 'C:/projects/Opensource/evo/evolution/core') . '/composer.json'), true); + + foreach (Drivers::all() as $driver) { + foreach ($driver->packages() as $package) { + $declared = array_key_exists($package, $composer['require']) || array_key_exists($package, $composer['suggest']) + || array_key_exists($package, (array) ($core['require'] ?? [])); + + expect($declared)->toBeTrue($driver->id() . ' needs ' . $package . ', which neither composer.json nor the CMS core declares'); + } + } + + expect($composer['suggest'])->toHaveKeys(['league/flysystem-aws-s3-v3', 'league/flysystem-sftp-v3', 'league/flysystem-webdav']); +}); + +it('keeps the minimum versions of the optional drivers it depends on', function () { + // SFTP below 3.36 takes neither several pinned keys nor the OpenSSH SHA256 form. + expect(amountComposer()['conflict'])->toBe([ + 'league/flysystem-aws-s3-v3' => '<3.10', + 'league/flysystem-sftp-v3' => '<3.36', + 'league/flysystem-webdav' => '<3.6', + ]); +}); + +it('builds the published CMS with the S3, SFTP and WebDAV drivers', function () { + $suggest = amountComposer()['suggest']; + $extras = amountPluginExtras(); + + expect($extras)->toBe(['league/flysystem-aws-s3-v3', 'league/flysystem-sftp-v3', 'league/flysystem-webdav']); + + foreach ($extras as $package) { + expect($suggest)->toHaveKey($package); + } +}); + +it('tells how to install a missing driver with one installrequire call per package', function () { + foreach (Drivers::all() as $driver) { + // package:installrequire {key} {value} takes one package per call. + expect(substr_count($driver->installCommand(), 'package:installrequire'))->toBe(1) + ->and(count($driver->packages()))->toBe(1, $driver->id() . ' lists several packages; installCommand() would need one call each'); + } +}); From fc1195266a47f8611554aaf9839a6d785764ae7d Mon Sep 17 00:00:00 2001 From: Artur Kyryliuk Date: Mon, 16 Nov 2026 02:08:00 +0100 Subject: [PATCH 2/3] feat: install a missing storage driver from the manager or artisan Administrators get an Install button next to a missing driver. The page queues an `amount.driver_install` system task through the core's SystemTaskService (its permission, super-administrator gate, exclusive lock and scheduler checks); system:task-worker runs it with the core's ConsoleInstallFlowService, so Composer never runs in a web request and a failed install is rolled back. Requests name a driver, never a package. `amount:drivers --install=s3,sftp,webdav` installs from a shell, one package:installrequire run per missing package, and is now the install hint shown for a missing driver. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 10 +- README.md | 15 +- docs/DESIGN.md | 7 +- lang/en/global.php | 11 + src/Console/DriverInstallHandler.php | 63 ++++ src/Console/DriversCommand.php | 77 +++- src/Drivers/Driver.php | 19 +- src/Http/Controllers/BootstrapController.php | 4 + src/Http/Controllers/DriverController.php | 21 ++ src/Http/routes.php | 6 + src/Services/DriverInstaller.php | 268 ++++++++++++++ src/aMountServiceProvider.php | 28 ++ tests/Unit/ControllersTest.php | 4 +- tests/Unit/DriverInstallTest.php | 367 +++++++++++++++++++ tests/Unit/DriversTest.php | 2 +- tests/Unit/PackagesTest.php | 10 +- views/partials/script-core.blade.php | 1 + views/partials/script-mounts.blade.php | 51 ++- views/partials/styles.blade.php | 1 + 19 files changed, 944 insertions(+), 21 deletions(-) create mode 100644 src/Console/DriverInstallHandler.php create mode 100644 src/Http/Controllers/DriverController.php create mode 100644 src/Services/DriverInstaller.php create mode 100644 tests/Unit/DriverInstallTest.php diff --git a/AGENTS.md b/AGENTS.md index 47d76a4..369a7fc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,7 +22,7 @@ src/Http/routes.php the route contract (relative to the module group; ` src/Http/Controllers/ thin: request -> one service call -> JSON. Base Controller: respond()/fail()/ok()/presentRun() src/Services/ Actor, Mounts, Rules, Files, Runs, Syncer, Transfer, Delivery, Serve, ServerConfig, AmountException src/Queue/ Dispatcher, SystemQueue (CMS task queue), STaskQueue (sTask) -src/Console/ SyncHandler (task handler), TickCommand, ServerCommand, DriversCommand, DemoCommand +src/Console/ SyncHandler, DriverInstallHandler (task handlers), TickCommand, ServerCommand, DriversCommand, DemoCommand src/Workers/SyncWorker sTask worker (file guarded: only loads when sTask exists) src/Listeners/ NotFound (OnPageNotFound), Cleanup (OnManagerDeleteUser) src/Drivers/ one class per Flysystem adapter; Drivers::all() @@ -46,6 +46,10 @@ ci/ .github/ builds a full CMS with the plugin inside (Docker), in `conflict` (SFTP `<3.36` would break host-key pinning). Builds (tests, demo, zip, images) add `PLUGIN_EXTRAS` from `ci/plugin.env`, so tests may use the S3/SFTP/WebDAV classes; code may not assume them outside their driver (`Driver::available()`). `PackagesTest` keeps this in sync. +- **Installing a driver** (DESIGN rule 11): `amount:drivers --install=` from a shell; from the page, only an + administrator, through the CMS task queue (`DriverInstaller` queues `amount.driver_install` via the core's + `createTaskFromStoreRequest()`, `DriverInstallHandler` delegates to `ConsoleInstallFlowService`). Never run Composer + in a request, and never take a package name from a request: packages come from `Driver::packages()`. - **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 @@ -95,8 +99,8 @@ ci/ .github/ builds a full CMS with the plugin inside (Docker), `{ok:true, ...}` or `{ok:false, error, message[, errors, candidates]}` with the refusal's HTTP status (403 forbidden, 404 not found, 409 ambiguous/refused, 422 invalid with `errors` field => message, 502 store failure). -`GET /bootstrap` returns `drivers, mounts, foreign_mounts, rules, presets, runs, queue, server (administrators only, else -null), flags{may_manage,is_admin,use_udperms,serve_enabled}, user_id, groups (administrators only), limits, csrf_token`. +`GET /bootstrap` returns `drivers, driver_installs (unfinished installs by driver id, administrators only), mounts, foreign_mounts, rules, presets, runs, queue, server (administrators only, else +null), flags{may_manage,is_admin,may_install_drivers,use_udperms,serve_enabled}, user_id, groups (administrators only), limits, csrf_token`. Runs are presented by `Controller::presentRun()`. ## Tests diff --git a/README.md b/README.md index dca9328..c2a5128 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,18 @@ php artisan migrate The module appears in the manager menu as **aMount**. Only the local folder driver comes with it; every storage driver is an optional package, so a site carries just the ones it uses (the AWS SDK alone is about 77 MB). Run -`php artisan amount:drivers` to see which drivers are installed; install a missing one with the command it prints, -e.g. for S3, SFTP and WebDAV (the trailing `0` records a package without running Composer, so it runs once): +`php artisan amount:drivers` to see which drivers are installed, and install missing ones by id, e.g. S3, SFTP and +WebDAV (each package goes through the CMS's `package:installrequire`, which undoes a failed install): ```sh -php artisan package:installrequire league/flysystem-aws-s3-v3 "*" 0 -php artisan package:installrequire league/flysystem-sftp-v3 "*" 0 -php artisan package:installrequire league/flysystem-webdav "*" +php artisan amount:drivers --install=s3,sftp,webdav ``` +Administrators can also click **Install** next to a missing driver in the manager. The page doesn't run Composer +itself: it queues a task for the CMS task worker (the same queue the Extras module installs through) and shows its +progress. That needs a running `system:task-worker` (the CMS cron line starts it) and a `core/vendor` directory the +worker can write to. Other managers see the command to pass on. + > **Upgrading from a version that required S3, SFTP and WebDAV:** `composer update` removes those packages if nothing > else needs them, and mounts using them then report the install command instead of connecting. Install the drivers > you use as above before or after updating. @@ -162,6 +165,8 @@ access, and **this site's code**. 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. +- **Only an administrator can install a driver from the manager**, since that changes the site's code. Composer runs in + the CMS task worker, never in a web request, and only for the packages the chosen driver lists. - **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 diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 6f522f0..40fb92a 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -47,6 +47,11 @@ is gone); **private** ones are downloadable only by managers who may see the ori (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). +11. Composer never runs in a web request. A missing driver is installed from the manager only by an administrator, + as an `amount.driver_install` system task (`Services\DriverInstaller`, `Console\DriverInstallHandler`): exclusive, + `system_tasks.manage_packages` + super administrator, queued through the core's + `SystemTaskService::createTaskFromStoreRequest()` (its lock and scheduler checks) and run by `system:task-worker` + with the core's `ConsoleInstallFlowService`. Requests name a driver; the packages always come from the driver. ## Already written (do not rewrite; extend only if a contract below says so) @@ -207,7 +212,7 @@ heartbeat for too long is healed to `error`, the page polls). Private files (backups) are never served by the web server; they are denied by the existing rules and downloaded through the authenticated manager endpoint. - `Console\ServerCommand` (`amount:server {server?} {--write} {--probe}`), `Console\DriversCommand` (`amount:drivers`: table of - drivers, installed or not, with install command), `Console\DemoCommand` (`amount:demo`: seeds a local-driver demo mount "Demo cloud", + drivers, installed or not, with install command; `--install=` runs `package:installrequire` once per missing package), `Console\DemoCommand` (`amount:demo`: seeds a local-driver demo mount "Demo cloud", sample files under `assets/amount-demo/`, one public rule, one backup-like private rule, optionally runs them synchronously for demo purposes — must be idempotent). - `Listeners\Cleanup` — remove a deleted user's personal mounts/rules/index rows; remove a deleted user group from diff --git a/lang/en/global.php b/lang/en/global.php index a7253b3..f2e939c 100644 --- a/lang/en/global.php +++ b/lang/en/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver is already installed.', + 'error_driver_not_installable' => ':driver has its packages but still cannot start; it probably needs a PHP extension. Ask whoever runs the server.', + 'error_driver_install_unavailable' => 'This Evolution CMS cannot install packages from the manager. Install it with: :command', + 'error_driver_install_refused' => 'The CMS did not queue the installation: :reason', '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.', @@ -293,6 +297,13 @@ 'ui_driver_choose' => 'Choose :name', 'ui_driver_choose_short' => 'Choose', 'ui_driver_missing' => 'Needs an extra package (:packages). Install it with:', + 'ui_driver_install' => 'Install', + 'ui_driver_install_aria' => 'Install :name', + 'ui_driver_install_help' => 'The CMS task worker installs it with Composer in the background and undoes everything if it fails.', + 'ui_driver_install_queued' => 'Waiting for the CMS task worker...', + 'ui_driver_installing' => 'Installing (:progress%): :message', + 'ui_driver_installed' => ':name is installed.', + 'ui_driver_install_failed' => 'The installation failed: :message', 'ui_group_object' => 'Object storage', 'ui_group_cloud' => 'Cloud drives', 'ui_group_server' => 'Servers', diff --git a/src/Console/DriverInstallHandler.php b/src/Console/DriverInstallHandler.php new file mode 100644 index 0000000..0b26470 --- /dev/null +++ b/src/Console/DriverInstallHandler.php @@ -0,0 +1,63 @@ +payload_json) ? $task->payload_json : []; + $id = (string) ($payload['driver'] ?? ''); + + if (!Drivers::has($id)) { + throw new RuntimeException('Unknown aMount driver "' . $id . '".'); + } + + $driver = Drivers::get($id); + $packages = $driver->packages(); + + foreach ($packages as $package) { + $step = clone $task; + $step->forceFill(['payload_json' => [ + 'composer_name' => $package, + 'resolved_version' => '*', + 'composer_version' => '*', + 'source_kind' => 'console', + ] + $payload]); + + $this->flow()->execute($step, $report); + } + + return [ + 'message' => $driver->label() . ' installed.', + 'result' => ['task_type' => DriverInstaller::TYPE, 'driver' => $id, 'packages' => $packages], + ]; + } + + private function flow(): object + { + return self::$flow !== null ? (self::$flow)() : new ConsoleInstallFlowService(); + } +} diff --git a/src/Console/DriversCommand.php b/src/Console/DriversCommand.php index 69765f7..2eed352 100644 --- a/src/Console/DriversCommand.php +++ b/src/Console/DriversCommand.php @@ -5,14 +5,25 @@ use Elcreator\aMount\Drivers\Drivers; use Illuminate\Console\Command; -/** Lists every driver, installed or not, with the command that installs a missing one. */ +/** + * Lists every driver, installed or not, with the command that installs a missing one; + * `--install` installs missing drivers through the CMS's `package:installrequire`. + */ class DriversCommand extends Command { - protected $signature = 'amount:drivers'; + protected $signature = 'amount:drivers + {--install=* : Install these drivers\' packages (driver ids, repeated or comma-separated, e.g. s3,sftp,webdav)}'; - protected $description = 'List storage drivers and whether their packages are installed'; + protected $description = 'List storage drivers and whether their packages are installed, or install them'; public function handle(): int + { + $wanted = $this->wanted(); + + return $wanted === [] ? $this->list() : $this->install($wanted); + } + + private function list(): int { $rows = []; @@ -29,4 +40,64 @@ public function handle(): int return self::SUCCESS; } + + /** @param string[] $ids */ + private function install(array $ids): int + { + $unknown = array_values(array_filter($ids, static fn (string $id): bool => !Drivers::has($id))); + if ($unknown !== []) { + $this->error('Unknown driver: ' . implode(', ', $unknown) . '. Run amount:drivers for the list.'); + + return self::FAILURE; + } + + $packages = []; + foreach ($ids as $id) { + $driver = Drivers::get($id); + if ($driver->available()) { + $this->line($driver->label() . ' is already installed.'); + continue; + } + if ($driver->missingPackages() === []) { + $this->warn($driver->label() . ' has its packages but still cannot start: check the PHP extensions it needs.'); + continue; + } + array_push($packages, ...$driver->missingPackages()); + } + + // One Composer run per package: package:installrequire rolls back only its own + // package, so packages recorded without a run would stay half-added after a failure. + foreach (array_values(array_unique($packages)) as $package) { + $this->info('Installing ' . $package . '...'); + $exitCode = $this->installPackage($package); + + if ($exitCode !== 0) { + $this->error('Installing ' . $package . ' failed; the site keeps its previous packages.'); + + return self::FAILURE; + } + } + + return self::SUCCESS; + } + + /** @return string[] driver ids from every --install value */ + private function wanted(): array + { + $ids = []; + foreach ((array) $this->option('install') as $value) { + foreach (explode(',', (string) $value) as $id) { + if (trim($id) !== '') { + $ids[] = trim($id); + } + } + } + + return array_values(array_unique($ids)); + } + + protected function installPackage(string $package): int + { + return (int) $this->call('package:installrequire', ['key' => $package, 'value' => '*']); + } } diff --git a/src/Drivers/Driver.php b/src/Drivers/Driver.php index 1966484..866eaeb 100644 --- a/src/Drivers/Driver.php +++ b/src/Drivers/Driver.php @@ -2,6 +2,7 @@ namespace Elcreator\aMount\Drivers; +use Composer\InstalledVersions; use Elcreator\aMount\Support\Destination; use Elcreator\aMount\Support\Lang; use League\Flysystem\Config as FlysystemConfig; @@ -108,9 +109,25 @@ public function available(): bool return class_exists($this->probeClass()) || interface_exists($this->probeClass()); } + /** + * The packages Composer has not installed. Can be empty while the driver is + * still unavailable: FTP also needs PHP's ftp extension, which no package brings. + * + * @return string[] + */ + public function missingPackages(): array + { + if (!class_exists(InstalledVersions::class)) { + return $this->available() ? [] : $this->packages(); + } + + return array_values(array_filter($this->packages(), static fn (string $package): bool => !InstalledVersions::isInstalled($package))); + } + + /** The command for a shell; {@see \Elcreator\aMount\Console\DriversCommand} runs `package:installrequire` per package. */ public function installCommand(): string { - return 'cd core && php artisan package:installrequire ' . implode(' ', array_map(static fn ($p) => $p . ' "*"', $this->packages())); + return 'cd core && php artisan amount:drivers --install=' . $this->id(); } /** Settings errors, field => message key. Empty when usable. @return array */ diff --git a/src/Http/Controllers/BootstrapController.php b/src/Http/Controllers/BootstrapController.php index 9381044..b132760 100644 --- a/src/Http/Controllers/BootstrapController.php +++ b/src/Http/Controllers/BootstrapController.php @@ -5,6 +5,7 @@ use Elcreator\aMount\Drivers\Drivers; use Elcreator\aMount\Models\Run; use Elcreator\aMount\Queue\Dispatcher; +use Elcreator\aMount\Services\DriverInstaller; use Elcreator\aMount\Services\Files; use Elcreator\aMount\Services\Mounts; use Elcreator\aMount\Services\Rules; @@ -31,9 +32,11 @@ public function show(): JsonResponse $rules = new Rules($actor); $manage = $actor->mayManage(); $principal = $actor->principal(); + $installer = new DriverInstaller($actor); return [ 'drivers' => array_values(array_map([$this, 'describeDriver'], Drivers::all())), + 'driver_installs' => $installer->pending(), 'mounts' => $mounts->visible()->map(fn ($m) => $mounts->present($m))->all(), 'foreign_mounts' => $mounts->foreign(), 'rules' => $rules->list()->map(fn ($r) => $rules->present($r))->all(), @@ -44,6 +47,7 @@ public function show(): JsonResponse 'flags' => [ 'may_manage' => $manage, 'is_admin' => $principal->isAdministrator(), + 'may_install_drivers' => $installer->allowed(), 'use_udperms' => $principal->udperms, 'serve_enabled' => Config::serveEnabled(), ], diff --git a/src/Http/Controllers/DriverController.php b/src/Http/Controllers/DriverController.php new file mode 100644 index 0000000..f2e3dc8 --- /dev/null +++ b/src/Http/Controllers/DriverController.php @@ -0,0 +1,21 @@ +respond(fn () => (new DriverInstaller($this->actor()))->install($this->text($request, 'driver'))); + } + + public function status(int|string $id): JsonResponse + { + return $this->respond(fn () => ['task' => (new DriverInstaller($this->actor()))->status((int) $id)]); + } +} diff --git a/src/Http/routes.php b/src/Http/routes.php index ef5b033..d75ba9a 100644 --- a/src/Http/routes.php +++ b/src/Http/routes.php @@ -1,6 +1,8 @@ name('amount.index'); Route::get('/bootstrap', [BootstrapController::class, 'show'])->name('amount.bootstrap'); +// Installing a missing driver's packages (administrators only), through the CMS task queue. +Route::post('/drivers/install', [DriverController::class, 'install'])->name('amount.drivers.install'); +Route::get('/drivers/install/{id}', [DriverController::class, 'status'])->whereNumber('id')->name('amount.drivers.status'); + // Mounts: remote storage connections. Route::post('/mounts', [MountController::class, 'store'])->name('amount.mounts.store'); // Registered before `/mounts/{uuid}`, which would otherwise take "test" for a uuid. diff --git a/src/Services/DriverInstaller.php b/src/Services/DriverInstaller.php new file mode 100644 index 0000000..b52215e --- /dev/null +++ b/src/Services/DriverInstaller.php @@ -0,0 +1,268 @@ +actor->userId() > 0 && $this->actor->principal()->isAdministrator(); + } + + /** + * Queue the installation of a driver's missing packages. + * + * @return array{task: array, warnings: array>} + * @throws AmountException + */ + public function install(string $driverId): array + { + if ($this->actor->userId() <= 0 || !$this->actor->principal()->isAdministrator()) { + throw AmountException::forbidden(); + } + + $driver = Drivers::has($driverId) ? Drivers::get($driverId) : throw AmountException::invalid('error_driver_unknown'); + $name = ['driver' => $driver->label(), 'command' => $driver->installCommand()]; + + if ($driver->available()) { + throw new AmountException('driver_installed', AmountException::text('aMount::global.error_driver_installed', $name), 409); + } + + if ($driver->missingPackages() === []) { + throw new AmountException('driver_not_installable', AmountException::text('aMount::global.error_driver_not_installable', $name), 409); + } + + if (!self::supported()) { + throw new AmountException('install_unavailable', AmountException::text('aMount::global.error_driver_install_unavailable', $name), 409); + } + + $pending = self::pendingFor($driver); + if ($pending !== null) { + return ['task' => self::present($pending), 'warnings' => []]; + } + + $service = self::$service !== null ? (self::$service)() : new SystemTaskService(); + $result = $service->createTaskFromStoreRequest(self::TYPE, ['driver' => $driver->id()], $this->requester(), true); + + if (empty($result['ok']) || !isset($result['task']['id'])) { + throw new AmountException('install_refused', AmountException::text('aMount::global.error_driver_install_refused', [ + 'reason' => (string) ($result['message'] ?? ''), + ]), 409); + } + + return ['task' => $result['task'], 'warnings' => array_values((array) ($result['warnings'] ?? []))]; + } + + /** + * Where an installation stands, for the page polling it. + * + * @return array + * @throws AmountException + */ + public function status(int $taskId): array + { + if ($this->actor->userId() <= 0 || !$this->actor->principal()->isAdministrator()) { + throw AmountException::forbidden(); + } + + $task = self::supported() ? SystemCliTask::query()->where('type', self::TYPE)->find($taskId) : null; + + return $task !== null ? self::present($task) : throw AmountException::notFound('task'); + } + + /** + * Unfinished installations by driver id, so a reloaded page keeps showing them. + * + * @return array> + */ + public function pending(): array + { + if (!$this->allowed()) { + return []; + } + + $pending = []; + foreach (self::activeQuery()->orderBy('id')->get() as $task) { + $presented = self::present($task); + $pending[$presented['driver']] = $presented; + } + + return $pending; + } + + /** + * The creator the CMS calls once its own checks have passed, from this + * class or from its generic task endpoint alike. + * + * @param array $request + * @param array $requester the requester snapshot the core checked + * @return array + */ + public static function queue(array $request, array $requester = [], bool $isSuperAdmin = false): array + { + $id = (string) ($request['driver'] ?? ''); + $driver = Drivers::has($id) ? Drivers::get($id) : null; + + if ($driver === null || $driver->available() || $driver->missingPackages() === []) { + return ['ok' => false, 'error_code' => 'SNAPSHOT_INVALID', 'message' => 'Not an aMount driver with packages to install.']; + } + + $packages = $driver->missingPackages(); + $now = Carbon::now(); + $payload = [ + 'task_type' => self::TYPE, + 'driver' => $driver->id(), + 'packages' => $packages, + 'display_title' => 'aMount: ' . $driver->label(), + 'package_name' => $packages[0], + 'composer_name' => $packages[0], + 'resolved_version' => '*', + 'composer_version' => '*', + 'source_kind' => 'console', + ]; + + $task = SystemCliTask::query()->create([ + 'uuid' => (string) Str::uuid(), + 'type' => self::TYPE, + 'target' => $packages[0], + 'requested_version' => '*', + 'status' => 'queued', + 'step' => 'queued', + 'progress' => 0, + 'message' => 'Queued', + 'payload_json' => $payload, + 'result_json' => [], + 'created_by' => isset($requester['user_id']) ? (int) $requester['user_id'] : null, + 'locked_by' => '', + 'attempt_count' => 0, + 'worker_host' => '', + 'worker_pid' => null, + 'error_code' => '', + 'catalog_snapshot_hash' => hash('sha256', (string) json_encode($payload, JSON_UNESCAPED_SLASHES)), + 'requested_by_snapshot' => $requester, + 'created_at' => $now, + 'updated_at' => $now, + ]); + + return ['ok' => true, 'task' => self::present($task)]; + } + + /** @return array */ + public static function present(SystemCliTask $task): array + { + $payload = is_array($task->payload_json) ? $task->payload_json : []; + $driver = (string) ($payload['driver'] ?? ''); + $status = (string) $task->status; + + return [ + 'id' => (int) $task->getKey(), + 'driver' => $driver, + 'packages' => array_values((array) ($payload['packages'] ?? [])), + 'status' => $status, + 'step' => (string) $task->step, + 'progress' => (int) $task->progress, + 'message' => (string) $task->message, + 'finished' => !in_array($status, self::ACTIVE, true), + // Asked in this request: a finished install's classes load from the next one on. + 'installed' => $driver !== '' && Drivers::has($driver) && Drivers::get($driver)->available(), + ]; + } + + private static function pendingFor(Driver $driver): ?SystemCliTask + { + foreach (self::activeQuery()->orderByDesc('id')->get() as $task) { + if ((string) (((array) $task->payload_json)['driver'] ?? '') === $driver->id()) { + return $task; + } + } + + return null; + } + + /** Unfinished tasks; a picked or running one only while its worker's lease lives, as the core counts them. */ + private static function activeQuery() + { + $now = Carbon::now(); + + return SystemCliTask::query() + ->where('type', self::TYPE) + ->whereIn('status', self::ACTIVE) + ->where(static function ($query) use ($now) { + $query->where('status', 'queued')->orWhereNull('lease_expires_at')->orWhere('lease_expires_at', '>=', $now); + }); + } + + /** + * The requester snapshot the core checks, from the database rather than the + * session (`Principal`), like every other permission decision in aMount. + * + * @return array + */ + private function requester(): array + { + $principal = $this->actor->principal(); + + return [ + 'user_id' => $this->actor->userId(), + 'role' => $principal->role, + 'is_super_admin' => $principal->isAdministrator(), + 'permissions' => [ + 'exec_module' => $principal->can('exec_module') ? 1 : 0, + 'system_tasks.view' => $principal->can('system_tasks.view') || $principal->can(self::PERMISSION) ? 1 : 0, + self::PERMISSION => $principal->can(self::PERMISSION) ? 1 : 0, + ], + 'requested_at' => date(DATE_ATOM), + 'ip' => isset($_SERVER['REMOTE_ADDR']) ? (string) $_SERVER['REMOTE_ADDR'] : '', + ]; + } +} diff --git a/src/aMountServiceProvider.php b/src/aMountServiceProvider.php index 0d6a511..7f1f164 100644 --- a/src/aMountServiceProvider.php +++ b/src/aMountServiceProvider.php @@ -3,6 +3,7 @@ namespace Elcreator\aMount; use Elcreator\aMount\Console\DemoCommand; +use Elcreator\aMount\Console\DriverInstallHandler; use Elcreator\aMount\Console\DriversCommand; use Elcreator\aMount\Console\ServerCommand; use Elcreator\aMount\Console\SyncHandler; @@ -10,9 +11,11 @@ use Elcreator\aMount\Listeners\Cleanup; use Elcreator\aMount\Listeners\NotFound; use Elcreator\aMount\Queue\STaskQueue; +use Elcreator\aMount\Services\DriverInstaller; use Elcreator\aMount\Services\Mounts; use Elcreator\aMount\Support\Config; use EvolutionCMS\ServiceProvider; +use EvolutionCMS\Services\SystemTasks\ConsoleInstallFlowService; use EvolutionCMS\Services\SystemTasks\SystemTaskRegistry; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Support\Facades\Schema; @@ -33,6 +36,7 @@ public function register(): void $this->mergeConfigFrom(dirname(__DIR__) . '/config/aMount.php', 'cms.settings.aMount'); $this->registerTaskType(); + $this->registerInstallTaskType(); } public function boot(): void @@ -97,6 +101,30 @@ protected function registerTaskType(): void ]); } + /** + * Declare `amount.driver_install`: a missing driver's packages, installed by + * the CMS's console install flow from the manager (see {@see DriverInstaller}). + * + * `exclusive` like the core's own installs, so Composer never runs beside a + * site update or another install; the core's package permission and its + * super-administrator gate apply to whoever queues it. + */ + protected function registerInstallTaskType(): void + { + if (!class_exists(SystemTaskRegistry::class) || !class_exists(ConsoleInstallFlowService::class) + || SystemTaskRegistry::has(DriverInstaller::TYPE)) { + return; + } + + SystemTaskRegistry::register(DriverInstaller::TYPE, DriverInstallHandler::class, [ + 'mode' => SystemTaskRegistry::MODE_EXCLUSIVE, + 'permissions' => [DriverInstaller::PERMISSION], + 'super_admin' => true, + 'creator' => [DriverInstaller::class, 'queue'], + 'label' => 'aMount driver install', + ]); + } + /** `amount:tick` every minute, through the Laravel scheduler the CMS cron line drives. */ protected function scheduleTick(): void { diff --git a/tests/Unit/ControllersTest.php b/tests/Unit/ControllersTest.php index 65e4d89..b3b09e5 100644 --- a/tests/Unit/ControllersTest.php +++ b/tests/Unit/ControllersTest.php @@ -103,9 +103,9 @@ function amountAnswer(JsonResponse $response): array [$status, $body] = amountAnswer($response); expect($status)->toBe(200) - ->and($body)->toHaveKeys(['drivers', 'mounts', 'rules', 'presets', 'queue', 'server', 'flags', 'groups', 'limits', 'csrf_token', 'runs']) + ->and($body)->toHaveKeys(['drivers', 'driver_installs', 'mounts', 'rules', 'presets', 'queue', 'server', 'flags', 'groups', 'limits', 'csrf_token', 'runs']) ->and($body['csrf_token'])->toBeString() - ->and($body['flags'])->toBe(['may_manage' => false, 'is_admin' => false, 'use_udperms' => true, 'serve_enabled' => true]) + ->and($body['flags'])->toBe(['may_manage' => false, 'is_admin' => false, 'may_install_drivers' => false, 'use_udperms' => true, 'serve_enabled' => true]) ->and($body['server'])->toBeNull() ->and($body['groups'])->toBe([]) ->and($body['mounts'])->toHaveCount(1) diff --git a/tests/Unit/DriverInstallTest.php b/tests/Unit/DriverInstallTest.php new file mode 100644 index 0000000..9c4b504 --- /dev/null +++ b/tests/Unit/DriverInstallTest.php @@ -0,0 +1,367 @@ +register(); + DriverInstaller::$service = null; + DriverInstallHandler::$flow = null; +}); + +afterEach(function () { + DriverInstaller::$service = null; + DriverInstallHandler::$flow = null; +}); + +/** A driver whose package Composer has not installed (or, with an installed one, that still cannot start). */ +function amountUninstalledDriver(string $id = 'acme', array $packages = ['acme/flysystem-missing']): Driver +{ + $driver = new class extends Driver { + public string $driverId = 'acme'; + + /** @var string[] */ + public array $driverPackages = []; + + public function id(): string + { + return $this->driverId; + } + + public function label(): string + { + return 'Acme storage'; + } + + public function fields(): array + { + return []; + } + + public function packages(): array + { + return $this->driverPackages; + } + + protected function probeClass(): string + { + return 'Acme\\Flysystem\\MissingAdapter'; + } + + protected function adapter(array $config, array $options): FilesystemAdapter + { + throw new RuntimeException('Not installed.'); + } + }; + $driver->driverId = $id; + $driver->driverPackages = $packages; + Drivers::register($driver); + + return $driver; +} + +/** The core's task service with its environment checks (scheduler health, lock) answered by the test. */ +function amountTaskService(array $preflight = ['ok' => true, 'warnings' => []]): void +{ + DriverInstaller::$service = static fn () => new class($preflight) extends SystemTaskService { + public function __construct(private array $answer) + { + parent::__construct(); + } + + protected function runCreatePreflight($type, array $requesterSnapshot = [], $isSuperAdmin = false) + { + // The parts of the real preflight that need no running scheduler. + if (empty($requesterSnapshot['permissions']['exec_module'])) { + return ['ok' => false, 'error_code' => 'ACL_DENIED', 'message' => 'No exec_module.']; + } + foreach (SystemTaskRegistry::permissions($type) as $permission) { + if (empty($requesterSnapshot['permissions'][$permission])) { + return ['ok' => false, 'error_code' => 'ACL_DENIED', 'message' => 'Missing ' . $permission . '.']; + } + } + if (SystemTaskRegistry::requiresSuperAdmin($type) && !$isSuperAdmin) { + return ['ok' => false, 'error_code' => 'ACL_DENIED', 'message' => 'Super administrators only.']; + } + + return $this->answer; + } + }; +} + +function amountInstallRefusal(callable $call): ?AmountException +{ + try { + $call(); + } catch (AmountException $e) { + return $e; + } + + return null; +} + +it('registers the install task type as exclusive, for super administrators with the package permission', function () { + $definition = SystemTaskRegistry::definition(DriverInstaller::TYPE); + + expect(SystemTaskRegistry::isExclusive(DriverInstaller::TYPE))->toBeTrue() + ->and(SystemTaskRegistry::permissions(DriverInstaller::TYPE))->toBe(['system_tasks.manage_packages']) + ->and(SystemTaskRegistry::requiresSuperAdmin(DriverInstaller::TYPE))->toBeTrue() + ->and(SystemTaskRegistry::creator(DriverInstaller::TYPE))->toBe([DriverInstaller::class, 'queue']) + ->and($definition['handler'])->toBe(DriverInstallHandler::class) + ->and(DriverInstaller::supported())->toBeTrue(); + + (new aMountServiceProvider(Container::getInstance()))->register(); + expect(SystemTaskRegistry::definition(DriverInstaller::TYPE))->toBe($definition); +}); + +it('tells which packages of a driver Composer has not installed', function () { + expect(amountUninstalledDriver()->missingPackages())->toBe(['acme/flysystem-missing']) + ->and(amountUninstalledDriver('half', ['league/flysystem', 'acme/other'])->missingPackages())->toBe(['acme/other']) + ->and(Drivers::get('local')->missingPackages())->toBe([]); +}); + +it('offers the install to administrators only', function () { + amountAdmin(1); + amountUser(7, ['amount', 'amount_manage', 'system_tasks.manage_packages', 'exec_module']); + amountUninstalledDriver(); + + expect((new DriverInstaller(Actor::for(1)))->allowed())->toBeTrue() + ->and((new DriverInstaller(Actor::for(7)))->allowed())->toBeFalse() + ->and((new DriverInstaller(Actor::for(0)))->allowed())->toBeFalse(); + + $refused = amountInstallRefusal(fn () => (new DriverInstaller(Actor::for(7)))->install('acme')); + + expect($refused?->error)->toBe('forbidden')->and($refused?->status)->toBe(403) + ->and(SystemCliTask::query()->count())->toBe(0); +}); + +it('queues the driver\'s own packages through the core\'s task service', function () { + amountAdmin(1); + amountUninstalledDriver(); + amountTaskService(['ok' => true, 'warnings' => [['code' => 'WORKER_STATUS_WARNING', 'message' => 'Worker idle.']]]); + + $result = (new DriverInstaller(Actor::for(1)))->install('acme'); + $task = SystemCliTask::query()->firstOrFail(); + + expect($task->type)->toBe('amount.driver_install') + ->and($task->status)->toBe('queued') + ->and($task->target)->toBe('acme/flysystem-missing') + ->and($task->created_by)->toBe(1) + ->and($task->payload_json['driver'])->toBe('acme') + ->and($task->payload_json['packages'])->toBe(['acme/flysystem-missing']) + ->and($task->requested_by_snapshot['permissions']['system_tasks.manage_packages'])->toBe(1) + ->and($result['task']['id'])->toBe($task->id) + ->and($result['task']['finished'])->toBeFalse() + ->and($result['task']['installed'])->toBeFalse() + ->and($result['warnings'][0]['message'])->toBe('Worker idle.'); +}); + +it('answers a second request with the installation already under way', function () { + amountAdmin(1); + amountUninstalledDriver(); + amountTaskService(); + $installer = new DriverInstaller(Actor::for(1)); + + $first = $installer->install('acme'); + $second = $installer->install('acme'); + + expect($second['task']['id'])->toBe($first['task']['id']) + ->and(SystemCliTask::query()->count())->toBe(1) + ->and($installer->pending())->toHaveKey('acme'); +}); + +it('reports the core\'s refusal', function () { + amountAdmin(1); + amountUninstalledDriver(); + amountTaskService(['ok' => false, 'error_code' => 'GLOBAL_LOCK_ACTIVE', 'message' => 'Another system task is already queued or running.']); + + $refused = amountInstallRefusal(fn () => (new DriverInstaller(Actor::for(1)))->install('acme')); + + expect($refused?->error)->toBe('install_refused')->and($refused?->status)->toBe(409) + ->and($refused?->getMessage())->toContain('Another system task is already queued or running.') + ->and(SystemCliTask::query()->count())->toBe(0); +}); + +it('waits its turn behind another install, by the core\'s own lock', function () { + amountAdmin(1); + amountUninstalledDriver(); + // The real service: a queued core install holds the lock every exclusive task shares. + SystemCliTask::query()->create(['uuid' => 'core-1', 'type' => 'console_install', 'status' => 'queued', 'payload_json' => [], 'result_json' => []]); + + $refused = amountInstallRefusal(fn () => (new DriverInstaller(Actor::for(1)))->install('acme')); + + expect($refused?->error)->toBe('install_refused') + ->and($refused?->getMessage())->toContain('Another system task is already queued or running.') + ->and(SystemCliTask::query()->where('type', DriverInstaller::TYPE)->count())->toBe(0); +}); + +it('refuses what there is nothing to install for', function () { + amountAdmin(1); + amountUninstalledDriver('half', ['league/flysystem']); + amountTaskService(); + $installer = new DriverInstaller(Actor::for(1)); + + expect(amountInstallRefusal(fn () => $installer->install('local'))?->error)->toBe('driver_installed') + ->and(amountInstallRefusal(fn () => $installer->install('half'))?->error)->toBe('driver_not_installable') + ->and(amountInstallRefusal(fn () => $installer->install('nope'))?->error)->toBe('error_driver_unknown') + ->and(SystemCliTask::query()->count())->toBe(0); +}); + +it('lets the core\'s generic endpoint queue only a missing driver\'s own packages', function () { + amountUninstalledDriver(); + + expect(DriverInstaller::queue(['driver' => 'local'])['ok'])->toBeFalse() + ->and(DriverInstaller::queue(['driver' => 'nope', 'packages' => ['evil/package']])['ok'])->toBeFalse() + ->and(SystemCliTask::query()->count())->toBe(0); + + $queued = DriverInstaller::queue(['driver' => 'acme', 'packages' => ['evil/package'], 'composer_name' => 'evil/package'], ['user_id' => 1]); + + expect($queued['ok'])->toBeTrue() + ->and(SystemCliTask::query()->firstOrFail()->payload_json['packages'])->toBe(['acme/flysystem-missing']); +}); + +it('installs each package of the driver with the core\'s console install flow', function () { + amountUninstalledDriver('acme', ['acme/one', 'acme/two']); + $seen = new ArrayObject(); + DriverInstallHandler::$flow = static fn () => new class($seen) { + public function __construct(private ArrayObject $seen) + { + } + + public function execute(SystemCliTask $task, ?callable $report = null): array + { + $this->seen[] = [$task->payload_json['composer_name'], $task->payload_json['composer_version']]; + + return ['message' => 'ok', 'result' => []]; + } + }; + + $task = new SystemCliTask(); + // A row naming another package installs the driver's own ones all the same. + $task->forceFill(['type' => DriverInstaller::TYPE, 'payload_json' => ['driver' => 'acme', 'packages' => ['evil/package'], 'composer_name' => 'evil/package']]); + + $result = (new DriverInstallHandler())->execute($task); + + expect($seen->getArrayCopy())->toBe([['acme/one', '*'], ['acme/two', '*']]) + ->and($result['result']['packages'])->toBe(['acme/one', 'acme/two']); + + $task->forceFill(['payload_json' => ['driver' => 'nope']]); + expect(fn () => (new DriverInstallHandler())->execute($task))->toThrow(RuntimeException::class); +}); + +it('reports an installation to the administrator polling it', function () { + amountAdmin(1); + amountUser(7); + amountUninstalledDriver(); + amountTaskService(); + $id = (new DriverInstaller(Actor::for(1)))->install('acme')['task']['id']; + SystemCliTask::query()->whereKey($id)->update(['status' => 'failed', 'message' => 'composer update failed']); + $other = SystemCliTask::query()->create(['uuid' => 'x-1', 'type' => 'amount.sync', 'status' => 'queued', 'payload_json' => [], 'result_json' => []]); + + $status = (new DriverInstaller(Actor::for(1)))->status($id); + + expect($status['finished'])->toBeTrue()->and($status['status'])->toBe('failed') + ->and($status['message'])->toBe('composer update failed') + ->and(amountInstallRefusal(fn () => (new DriverInstaller(Actor::for(1)))->status($other->id))?->status)->toBe(404) + ->and(amountInstallRefusal(fn () => (new DriverInstaller(Actor::for(7)))->status($id))?->status)->toBe(403); +}); + +it('answers the page through the controller and the bootstrap flags', function () { + amountAdmin(1); + amountUser(7); + amountUninstalledDriver(); + amountTaskService(); + + AmountTestCore::$loginUserId = 7; + $denied = (new DriverController())->install(Request::create('/x', 'POST', ['driver' => 'acme'])); + $flags = (new BootstrapController())->show()->getData(true); + + expect($denied->getStatusCode())->toBe(403) + ->and($flags['flags']['may_install_drivers'])->toBeFalse() + ->and($flags['driver_installs'])->toBe([]); + + AmountTestCore::$loginUserId = 1; + $queued = (new DriverController())->install(Request::create('/x', 'POST', ['driver' => 'acme']))->getData(true); + $polled = (new DriverController())->status($queued['task']['id'])->getData(true); + $boot = (new BootstrapController())->show()->getData(true); + + expect($queued['ok'])->toBeTrue() + ->and($polled['task']['status'])->toBe('queued') + ->and($boot['flags']['may_install_drivers'])->toBeTrue() + ->and($boot['driver_installs']['acme']['id'])->toBe($queued['task']['id']); +}); + +/** Runs `amount:drivers` with the given input; `package:installrequire` is recorded, not run. */ +function amountDriversCommand(array $input, int $exitCode = 0): array +{ + $command = new class extends DriversCommand { + /** @var string[] */ + public array $installed = []; + + public int $exitCode = 0; + + protected function installPackage(string $package): int + { + $this->installed[] = $package; + + return $this->exitCode; + } + }; + $command->exitCode = $exitCode; + $output = new BufferedOutput(); + $arguments = new ArrayInput($input, $command->getDefinition()); + $command->setInput($arguments); + $command->setOutput(new OutputStyle($arguments, $output)); + $status = $command->handle(); + + return [$status, $command->installed, $output->fetch()]; +} + +it('installs drivers from artisan, one Composer run per missing package', function () { + amountUninstalledDriver('acme', ['acme/one']); + amountUninstalledDriver('acme2', ['acme/one', 'acme/two']); + + [$status, $installed, $output] = amountDriversCommand(['--install' => ['acme,local', 'acme2']]); + + expect($status)->toBe(0) + ->and($installed)->toBe(['acme/one', 'acme/two']) + ->and($output)->toContain('is already installed'); +}); + +it('stops at the first failed package and at an unknown driver', function () { + amountUninstalledDriver('acme', ['acme/one', 'acme/two']); + + [$status, $installed] = amountDriversCommand(['--install' => ['acme']], 1); + expect($status)->toBe(1)->and($installed)->toBe(['acme/one']); + + [$status, $installed, $output] = amountDriversCommand(['--install' => ['nope']]); + expect($status)->toBe(1)->and($installed)->toBe([])->and($output)->toContain('Unknown driver: nope'); +}); + +it('still lists the drivers without --install', function () { + amountUninstalledDriver(); + + [$status, $installed, $output] = amountDriversCommand([]); + + expect($status)->toBe(0)->and($installed)->toBe([]) + ->and($output)->toContain('acme')->toContain('amount:drivers --install=acme'); +}); diff --git a/tests/Unit/DriversTest.php b/tests/Unit/DriversTest.php index 511b9eb..5c27605 100644 --- a/tests/Unit/DriversTest.php +++ b/tests/Unit/DriversTest.php @@ -86,7 +86,7 @@ function amountHas(array $lang, string $driver, string $key): bool $missing = array_filter(Drivers::all(), fn (Driver $d) => !$d->available()); foreach ($missing as $driver) { - expect($driver->installCommand())->toContain('package:installrequire')->toContain($driver->packages()[0]); + expect($driver->installCommand())->toBe('cd core && php artisan amount:drivers --install=' . $driver->id()); expect(fn () => $driver->filesystem([]))->toThrow(RuntimeException::class, $driver->installCommand()); } diff --git a/tests/Unit/PackagesTest.php b/tests/Unit/PackagesTest.php index 63d7b50..283e023 100644 --- a/tests/Unit/PackagesTest.php +++ b/tests/Unit/PackagesTest.php @@ -60,10 +60,12 @@ function amountPluginExtras(): array } }); -it('tells how to install a missing driver with one installrequire call per package', function () { +it('tells how to install a missing driver by its id', function () { foreach (Drivers::all() as $driver) { - // package:installrequire {key} {value} takes one package per call. - expect(substr_count($driver->installCommand(), 'package:installrequire'))->toBe(1) - ->and(count($driver->packages()))->toBe(1, $driver->id() . ' lists several packages; installCommand() would need one call each'); + if ($driver->id() === 'ai-computer' && !$driver->available()) { + continue; + } + + expect($driver->installCommand())->toBe('cd core && php artisan amount:drivers --install=' . $driver->id()); } }); diff --git a/views/partials/script-core.blade.php b/views/partials/script-core.blade.php index dce2b59..36575be 100644 --- a/views/partials/script-core.blade.php +++ b/views/partials/script-core.blade.php @@ -657,6 +657,7 @@ function showPageError(text) { function applyBoot(r) { S.drivers = r.drivers || []; + S.driverInstalls = r.driver_installs || {}; S.mounts = r.mounts || []; S.rules = r.rules || []; S.presets = r.presets || []; diff --git a/views/partials/script-mounts.blade.php b/views/partials/script-mounts.blade.php index b55db0c..34c6dcd 100644 --- a/views/partials/script-mounts.blade.php +++ b/views/partials/script-mounts.blade.php @@ -327,7 +327,8 @@ function pickDriver(box, onPick) { } else { add(card, [ h('span', { text: t('ui_driver_missing', { packages: (d.packages || []).join(', ') }) }), - d.install ? commandLine(d.install) : null + d.install ? commandLine(d.install) : null, + S.flags.may_install_drivers ? installControl(d, box, onPick) : null ]); } return card; @@ -336,6 +337,54 @@ function pickDriver(box, onPick) { }); } + /** + * Administrators install a missing driver from here: the CMS task worker runs + * Composer, the page follows the task and offers the driver once it loads. + */ + function installControl(d, box, onPick) { + var msg = h('p', { 'class': 'am-msg', role: 'status' }); + var button = btn(t('ui_driver_install'), { + icon: 'download', small: true, aria: t('ui_driver_install_aria', { name: d.label }), + onclick: function () { + button.disabled = true; + setMsg(msg, t('ui_driver_install_queued')); + api('POST', '/drivers/install', { driver: d.id }).then(function (r) { + if (!r || r.ok === false) { button.disabled = false; setMsg(msg, errMsg(r), 'error'); return; } + follow(r.task, (r.warnings || []).map(function (w) { return w.message; }).join(' ')); + }); + } + }); + + function follow(task, note) { + if (!box.el.parentNode) { return; } + if (task.finished) { + if (task.status === 'succeeded' || task.installed) { + setMsg(msg, t('ui_driver_installed', { name: d.label }), 'ok'); + announce(t('ui_driver_installed', { name: d.label })); + loadBoot(true).then(function () { if (box.el.parentNode) { pickDriver(box, onPick); } }); + } else { + button.disabled = false; + setMsg(msg, t('ui_driver_install_failed', { message: task.message || '' }), 'error'); + } + return; + } + button.disabled = true; + var text = task.status === 'queued' ? t('ui_driver_install_queued') : t('ui_driver_installing', { progress: task.progress || 0, message: task.message || '' }); + setMsg(msg, note ? text + ' ' + note : text); + window.setTimeout(function () { + api('GET', '/drivers/install/' + task.id).then(function (r) { + if (!r || r.ok === false) { button.disabled = false; setMsg(msg, errMsg(r), 'error'); return; } + follow(r.task, ''); + }); + }, 3000); + } + + var pending = (S.driverInstalls || {})[d.id]; + if (pending) { window.setTimeout(function () { follow(pending, ''); }, 0); } + + return h('div', { 'class': 'am-driver-install' }, [h('span', { 'class': 'am-help', text: t('ui_driver_install_help') }), button, msg]); + } + function showWhen(fieldDef, values) { var cond = fieldDef.show; if (!cond) { return true; } diff --git a/views/partials/styles.blade.php b/views/partials/styles.blade.php index 337c2aa..64c556d 100644 --- a/views/partials/styles.blade.php +++ b/views/partials/styles.blade.php @@ -245,6 +245,7 @@ .am-driver b { font-size: 0.9rem; } .am-driver span { color: var(--am-muted); font-size: 0.78rem; } .am-driver .am-cmd { margin-top: 0.3rem; } + .am-driver-install { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; margin-top: 0.4rem; } /* Code block */ .am-code { position: relative; } From 5a38dee936c067ad9ff074f3638123812c35e5a3 Mon Sep 17 00:00:00 2001 From: Artur Kyryliuk Date: Mon, 16 Nov 2026 02:08:01 +0100 Subject: [PATCH 3/3] i18n: translate the driver install strings Co-Authored-By: Claude Opus 5.5 --- lang/az/global.php | 11 +++++++++++ lang/be/global.php | 11 +++++++++++ lang/bg/global.php | 11 +++++++++++ lang/cs/global.php | 11 +++++++++++ lang/da/global.php | 11 +++++++++++ lang/de/global.php | 11 +++++++++++ lang/es/global.php | 11 +++++++++++ lang/fa/global.php | 11 +++++++++++ lang/fi/global.php | 11 +++++++++++ lang/fr/global.php | 11 +++++++++++ lang/he/global.php | 11 +++++++++++ lang/it/global.php | 11 +++++++++++ lang/ja/global.php | 11 +++++++++++ lang/nl/global.php | 11 +++++++++++ lang/nn/global.php | 11 +++++++++++ lang/pl/global.php | 11 +++++++++++ lang/pt/global.php | 11 +++++++++++ lang/sk/global.php | 11 +++++++++++ lang/sv/global.php | 11 +++++++++++ lang/uk/global.php | 11 +++++++++++ lang/zh/global.php | 11 +++++++++++ 21 files changed, 231 insertions(+) diff --git a/lang/az/global.php b/lang/az/global.php index 9e850a4..ba7ce54 100644 --- a/lang/az/global.php +++ b/lang/az/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver artıq quraşdırılıb.', + 'error_driver_not_installable' => ':driver paketlərinə malikdir, lakin yenə də işə düşə bilmir; çox güman ki, PHP genişlənməsi tələb edir. Serveri idarə edən şəxsə müraciət edin.', + 'error_driver_install_unavailable' => 'Bu Evolution CMS menecerdən paket quraşdıra bilmir. Onu bu əmrlə quraşdırın: :command', + 'error_driver_install_refused' => 'CMS quraşdırmanı növbəyə qoymadı: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Seç: :name', 'ui_driver_choose_short' => 'Seç', 'ui_driver_missing' => 'Əlavə paket tələb edir (:packages). Onu bu əmrlə quraşdırın:', + 'ui_driver_install' => 'Quraşdır', + 'ui_driver_install_aria' => 'Quraşdır: :name', + 'ui_driver_install_help' => 'CMS tapşırıq işçisi onu arxa planda Composer ilə quraşdırır və uğursuz olarsa, hər şeyi geri qaytarır.', + 'ui_driver_install_queued' => 'CMS tapşırıq işçisi gözlənilir...', + 'ui_driver_installing' => 'Quraşdırılır (:progress%): :message', + 'ui_driver_installed' => ':name quraşdırıldı.', + 'ui_driver_install_failed' => 'Quraşdırma uğursuz oldu: :message', 'ui_group_object' => 'Obyekt saxlama yerləri', 'ui_group_cloud' => 'Bulud diskləri', 'ui_group_server' => 'Serverlər', diff --git a/lang/be/global.php b/lang/be/global.php index 1a62dbf..4c5804a 100644 --- a/lang/be/global.php +++ b/lang/be/global.php @@ -25,6 +25,10 @@ 'error_ambiguous_mount' => 'Адпавядае некалькі падключэнняў: :names. Якое вы маеце на ўвазе?', 'error_driver_unknown' => 'Гэты тып сховішча невядомы.', 'error_driver_unavailable' => ':driver патрабуе дадатковы пакет. Усталюйце яго камандай: :command', + 'error_driver_installed' => ':driver ужо ўсталяваны.', + 'error_driver_not_installable' => 'У :driver ёсць пакеты, але ён усё роўна не можа запусціцца; верагодна, яму патрэбна пашырэнне PHP. Звярніцеся да таго, хто абслугоўвае сервер.', + 'error_driver_install_unavailable' => 'Гэты Evolution CMS не можа ўсталёўваць пакеты з менеджара. Усталюйце яго камандай: :command', + 'error_driver_install_refused' => 'CMS не паставіла ўсталяванне ў чаргу: :reason', 'error_driver_admin_only' => ':driver звяртаецца да ўласнага дыска гэтага сервера, таму наладзіць яго можа толькі адміністратар.', 'error_destination_private' => ':host знаходзіцца на гэтым серверы або ва ўнутранай сетцы. Падключэнне туды можа стварыць толькі адміністратар.', 'error_destination_unresolved' => 'Не ўдалося знайсці :host. Праверце адрас.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Выбраць: :name', 'ui_driver_choose_short' => 'Выбраць', 'ui_driver_missing' => 'Патрабуе дадатковы пакет (:packages). Усталюйце яго камандай:', + 'ui_driver_install' => 'Усталяваць', + 'ui_driver_install_aria' => 'Усталяваць: :name', + 'ui_driver_install_help' => 'Выканаўца задач CMS усталёўвае яго праз Composer у фоне і адмяняе ўсе змены, калі нешта пойдзе не так.', + 'ui_driver_install_queued' => 'Чакае выканаўцу задач CMS...', + 'ui_driver_installing' => 'Усталяванне (:progress%): :message', + 'ui_driver_installed' => ':name усталяваны.', + 'ui_driver_install_failed' => 'Усталяванне не ўдалося: :message', 'ui_group_object' => 'Аб’ектныя сховішчы', 'ui_group_cloud' => 'Воблачныя дыскі', 'ui_group_server' => 'Серверы', diff --git a/lang/bg/global.php b/lang/bg/global.php index 4e42d4f..9d191c5 100644 --- a/lang/bg/global.php +++ b/lang/bg/global.php @@ -25,6 +25,10 @@ 'error_ambiguous_mount' => 'Съвпадат няколко връзки: :names. Коя имате предвид?', 'error_driver_unknown' => 'Този тип хранилище не е познат.', 'error_driver_unavailable' => ':driver изисква допълнителен пакет. Инсталирайте го с: :command', + 'error_driver_installed' => ':driver вече е инсталиран.', + 'error_driver_not_installable' => ':driver има пакетите си, но все още не може да стартира; вероятно изисква PHP разширение. Обърнете се към този, който поддържа сървъра.', + 'error_driver_install_unavailable' => 'Тази Evolution CMS не може да инсталира пакети от мениджъра. Инсталирайте го с: :command', + 'error_driver_install_refused' => 'CMS не постави инсталацията на опашката: :reason', 'error_driver_admin_only' => ':driver достъпва собствения диск на този сървър, затова само администратор може да го настрои.', 'error_destination_private' => ':host е на този сървър или във вътрешна мрежа. Само администратор може да създаде връзка към него.', 'error_destination_unresolved' => ':host не може да бъде намерен. Проверете адреса.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Избор: :name', 'ui_driver_choose_short' => 'Избор', 'ui_driver_missing' => 'Изисква допълнителен пакет (:packages). Инсталирайте го с:', + 'ui_driver_install' => 'Инсталиране', + 'ui_driver_install_aria' => 'Инсталиране: :name', + 'ui_driver_install_help' => 'Изпълнителят на задачите на CMS го инсталира с Composer във фонов режим и отменя всичко, ако нещо се провали.', + 'ui_driver_install_queued' => 'Изчаква изпълнителя на задачите на CMS...', + 'ui_driver_installing' => 'Инсталиране (:progress%): :message', + 'ui_driver_installed' => ':name е инсталиран.', + 'ui_driver_install_failed' => 'Инсталацията не бе успешна: :message', 'ui_group_object' => 'Обектни хранилища', 'ui_group_cloud' => 'Облачни дискове', 'ui_group_server' => 'Сървъри', diff --git a/lang/cs/global.php b/lang/cs/global.php index 10b52a4..7f44665 100644 --- a/lang/cs/global.php +++ b/lang/cs/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver je už nainstalován.', + 'error_driver_not_installable' => ':driver má své balíčky, ale stále se nemůže spustit; pravděpodobně potřebuje rozšíření PHP. Obraťte se na toho, kdo spravuje server.', + 'error_driver_install_unavailable' => 'Tento Evolution CMS nemůže instalovat balíčky ze správce. Nainstalujte jej příkazem: :command', + 'error_driver_install_refused' => 'CMS nezařadil instalaci do fronty: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Zvolit: :name', 'ui_driver_choose_short' => 'Zvolit', 'ui_driver_missing' => 'Vyžaduje další balíček (:packages). Nainstalujte jej příkazem:', + 'ui_driver_install' => 'Nainstalovat', + 'ui_driver_install_aria' => 'Nainstalovat: :name', + 'ui_driver_install_help' => 'Správce úloh CMS jej nainstaluje na pozadí pomocí nástroje Composer a při selhání vše vrátí zpět.', + 'ui_driver_install_queued' => 'Čeká na správce úloh CMS...', + 'ui_driver_installing' => 'Instalace (:progress%): :message', + 'ui_driver_installed' => ':name je nainstalován.', + 'ui_driver_install_failed' => 'Instalace se nezdařila: :message', 'ui_group_object' => 'Objektová úložiště', 'ui_group_cloud' => 'Cloudové disky', 'ui_group_server' => 'Servery', diff --git a/lang/da/global.php b/lang/da/global.php index 90a0933..984e9e9 100644 --- a/lang/da/global.php +++ b/lang/da/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver er allerede installeret.', + 'error_driver_not_installable' => ':driver har sine pakker, men kan stadig ikke starte; den kræver sandsynligvis en PHP-udvidelse. Spørg den, der driver serveren.', + 'error_driver_install_unavailable' => 'Dette Evolution CMS kan ikke installere pakker fra administrationen. Installer den med: :command', + 'error_driver_install_refused' => 'CMS\'et satte ikke installationen i kø: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Vælg :name', 'ui_driver_choose_short' => 'Vælg', 'ui_driver_missing' => 'Kræver en ekstra pakke (:packages). Installer den med:', + 'ui_driver_install' => 'Installer', + 'ui_driver_install_aria' => 'Installer :name', + 'ui_driver_install_help' => 'CMS\'ets opgaveworker installerer den med Composer i baggrunden og fortryder alt, hvis det mislykkes.', + 'ui_driver_install_queued' => 'Venter på CMS\'ets opgaveworker...', + 'ui_driver_installing' => 'Installerer (:progress%): :message', + 'ui_driver_installed' => ':name er installeret.', + 'ui_driver_install_failed' => 'Installationen mislykkedes: :message', 'ui_group_object' => 'Objektlager', 'ui_group_cloud' => 'Clouddrev', 'ui_group_server' => 'Servere', diff --git a/lang/de/global.php b/lang/de/global.php index a998e2c..aa3eddd 100644 --- a/lang/de/global.php +++ b/lang/de/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver ist bereits installiert.', + 'error_driver_not_installable' => ':driver hat seine Pakete, kann aber trotzdem nicht starten; vermutlich fehlt eine PHP-Erweiterung. Wenden Sie sich an die Person, die den Server betreibt.', + 'error_driver_install_unavailable' => 'Dieses Evolution CMS kann keine Pakete aus dem Manager installieren. Installieren Sie es mit: :command', + 'error_driver_install_refused' => 'Das CMS hat die Installation nicht in die Warteschlange gestellt: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => ':name auswählen', 'ui_driver_choose_short' => 'Auswählen', 'ui_driver_missing' => 'Benötigt ein zusätzliches Paket (:packages). Installieren Sie es mit:', + 'ui_driver_install' => 'Installieren', + 'ui_driver_install_aria' => ':name installieren', + 'ui_driver_install_help' => 'Der Task-Worker des CMS installiert es im Hintergrund mit Composer und macht bei einem Fehler alles rückgängig.', + 'ui_driver_install_queued' => 'Warten auf den Task-Worker des CMS...', + 'ui_driver_installing' => 'Installation (:progress%): :message', + 'ui_driver_installed' => ':name ist installiert.', + 'ui_driver_install_failed' => 'Die Installation ist fehlgeschlagen: :message', 'ui_group_object' => 'Objektspeicher', 'ui_group_cloud' => 'Cloud-Laufwerke', 'ui_group_server' => 'Server', diff --git a/lang/es/global.php b/lang/es/global.php index 7019b26..d73f47d 100644 --- a/lang/es/global.php +++ b/lang/es/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver ya está instalado.', + 'error_driver_not_installable' => ':driver tiene sus paquetes, pero aun así no puede iniciarse; probablemente necesita una extensión de PHP. Consulte a quien administra el servidor.', + 'error_driver_install_unavailable' => 'Este Evolution CMS no puede instalar paquetes desde el administrador. Instálelo con: :command', + 'error_driver_install_refused' => 'El CMS no puso la instalación en cola: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Elegir :name', 'ui_driver_choose_short' => 'Elegir', 'ui_driver_missing' => 'Necesita un paquete adicional (:packages). Instálelo con:', + 'ui_driver_install' => 'Instalar', + 'ui_driver_install_aria' => 'Instalar :name', + 'ui_driver_install_help' => 'El worker de tareas del CMS lo instala con Composer en segundo plano y deshace todo si falla.', + 'ui_driver_install_queued' => 'Esperando al worker de tareas del CMS...', + 'ui_driver_installing' => 'Instalando (:progress%): :message', + 'ui_driver_installed' => ':name está instalado.', + 'ui_driver_install_failed' => 'La instalación falló: :message', 'ui_group_object' => 'Almacenamiento de objetos', 'ui_group_cloud' => 'Unidades en la nube', 'ui_group_server' => 'Servidores', diff --git a/lang/fa/global.php b/lang/fa/global.php index 02c1f86..77d4f0b 100644 --- a/lang/fa/global.php +++ b/lang/fa/global.php @@ -25,6 +25,10 @@ 'error_ambiguous_mount' => 'چند مانت مطابقت دارند: :names. کدام را منظور دارید؟', 'error_driver_unknown' => 'این نوع فضای ذخیره‌سازی شناخته نشده است.', 'error_driver_unavailable' => ':driver به یک بسته اضافی نیاز دارد. آن را با این دستور نصب کنید: :command', + 'error_driver_installed' => ':driver از قبل نصب شده است.', + 'error_driver_not_installable' => ':driver بسته‌های خود را دارد اما همچنان نمی‌تواند اجرا شود؛ احتمالاً به یک افزونه PHP نیاز دارد. از مسئول سرور بپرسید.', + 'error_driver_install_unavailable' => 'این Evolution CMS نمی‌تواند بسته‌ها را از بخش مدیریت نصب کند. آن را با این دستور نصب کنید: :command', + 'error_driver_install_refused' => 'سیستم مدیریت محتوا نصب را در صف قرار نداد: :reason', 'error_driver_admin_only' => ':driver به دیسک خود این سرور دسترسی دارد، بنابراین فقط مدیر کل می‌تواند آن را راه‌اندازی کند.', 'error_destination_private' => ':host روی این سرور یا در یک شبکه داخلی است. فقط مدیر کل می‌تواند مانتی به آنجا وصل کند.', 'error_destination_unresolved' => ':host پیدا نشد. نشانی را بررسی کنید.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'انتخاب :name', 'ui_driver_choose_short' => 'انتخاب', 'ui_driver_missing' => 'به یک بسته اضافی (:packages) نیاز دارد. آن را با این دستور نصب کنید:', + 'ui_driver_install' => 'نصب', + 'ui_driver_install_aria' => 'نصب :name', + 'ui_driver_install_help' => 'پردازشگر وظایف سیستم مدیریت محتوا آن را در پس‌زمینه با Composer نصب می‌کند و در صورت شکست، همه چیز را برمی‌گرداند.', + 'ui_driver_install_queued' => 'در انتظار پردازشگر وظایف سیستم مدیریت محتوا...', + 'ui_driver_installing' => 'در حال نصب (:progress%): :message', + 'ui_driver_installed' => ':name نصب شد.', + 'ui_driver_install_failed' => 'نصب ناموفق بود: :message', 'ui_group_object' => 'ذخیره‌سازی شیء', 'ui_group_cloud' => 'درایوهای ابری', 'ui_group_server' => 'سرورها', diff --git a/lang/fi/global.php b/lang/fi/global.php index a33ec62..9dc6cca 100644 --- a/lang/fi/global.php +++ b/lang/fi/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver on jo asennettu.', + 'error_driver_not_installable' => 'Tallennustyypin :driver paketit on asennettu, mutta se ei silti käynnisty; se tarvitsee luultavasti PHP-laajennuksen. Kysy palvelimen ylläpitäjältä.', + 'error_driver_install_unavailable' => 'Tämä Evolution CMS ei voi asentaa paketteja hallinnasta. Asenna se komennolla: :command', + 'error_driver_install_refused' => 'CMS ei lisännyt asennusta jonoon: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Valitse :name', 'ui_driver_choose_short' => 'Valitse', 'ui_driver_missing' => 'Tarvitsee lisäpaketin (:packages). Asenna se komennolla:', + 'ui_driver_install' => 'Asenna', + 'ui_driver_install_aria' => 'Asenna :name', + 'ui_driver_install_help' => 'CMS:n tehtäväkäsittelijä asentaa sen taustalla Composer-työkalulla ja peruu kaiken, jos asennus epäonnistuu.', + 'ui_driver_install_queued' => 'Odotetaan CMS:n tehtäväkäsittelijää...', + 'ui_driver_installing' => 'Asennetaan (:progress%): :message', + 'ui_driver_installed' => ':name on asennettu.', + 'ui_driver_install_failed' => 'Asennus epäonnistui: :message', 'ui_group_object' => 'Objektitallennus', 'ui_group_cloud' => 'Pilviasemat', 'ui_group_server' => 'Palvelimet', diff --git a/lang/fr/global.php b/lang/fr/global.php index 451d0aa..66c0da4 100644 --- a/lang/fr/global.php +++ b/lang/fr/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver est déjà installé.', + 'error_driver_not_installable' => ':driver dispose de ses paquets mais ne peut toujours pas démarrer ; il lui faut probablement une extension PHP. Adressez-vous à la personne qui gère le serveur.', + 'error_driver_install_unavailable' => 'Cet Evolution CMS ne peut pas installer de paquets depuis le gestionnaire. Installez-le avec : :command', + 'error_driver_install_refused' => 'Le CMS n\'a pas mis l\'installation en file d\'attente : :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Choisir :name', 'ui_driver_choose_short' => 'Choisir', 'ui_driver_missing' => 'Nécessite un paquet supplémentaire (:packages). Installez-le avec :', + 'ui_driver_install' => 'Installer', + 'ui_driver_install_aria' => 'Installer :name', + 'ui_driver_install_help' => 'Le worker de tâches du CMS l\'installe avec Composer en arrière-plan et annule tout en cas d\'échec.', + 'ui_driver_install_queued' => 'En attente du worker de tâches du CMS...', + 'ui_driver_installing' => 'Installation (:progress%) : :message', + 'ui_driver_installed' => ':name est installé.', + 'ui_driver_install_failed' => 'L\'installation a échoué : :message', 'ui_group_object' => 'Stockage objet', 'ui_group_cloud' => 'Disques cloud', 'ui_group_server' => 'Serveurs', diff --git a/lang/he/global.php b/lang/he/global.php index 4d8904d..130c49b 100644 --- a/lang/he/global.php +++ b/lang/he/global.php @@ -25,6 +25,10 @@ 'error_ambiguous_mount' => 'מספר חיבורים תואמים: :names. לאיזה התכוונתם?', 'error_driver_unknown' => 'סוג האחסון הזה אינו מוכר.', 'error_driver_unavailable' => ':driver דורש חבילה נוספת. התקינו אותה באמצעות: :command', + 'error_driver_installed' => ':driver כבר מותקן.', + 'error_driver_not_installable' => 'ל-:driver יש את החבילות שלו, אבל הוא עדיין לא יכול לפעול; כנראה שהוא דורש הרחבת PHP. פנו למי שמפעיל את השרת.', + 'error_driver_install_unavailable' => 'Evolution CMS זה אינו יכול להתקין חבילות מהמנהל. התקינו אותו באמצעות: :command', + 'error_driver_install_refused' => 'המערכת לא הכניסה את ההתקנה לתור: :reason', 'error_driver_admin_only' => ':driver ניגש לדיסק של שרת זה עצמו, ולכן רק מנהל מערכת יכול להגדיר אותו.', 'error_destination_private' => ':host נמצא בשרת זה או ברשת פנימית. רק מנהל מערכת יכול ליצור אליו חיבור.', 'error_destination_unresolved' => 'לא ניתן למצוא את :host. בדקו את הכתובת.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'בחירת :name', 'ui_driver_choose_short' => 'בחירה', 'ui_driver_missing' => 'דורש חבילה נוספת (:packages). התקינו אותה באמצעות:', + 'ui_driver_install' => 'התקנה', + 'ui_driver_install_aria' => 'התקנת :name', + 'ui_driver_install_help' => 'עובד המשימות של המערכת מתקין אותו באמצעות Composer ברקע, ומבטל הכול אם משהו נכשל.', + 'ui_driver_install_queued' => 'ממתין לעובד המשימות של המערכת...', + 'ui_driver_installing' => 'מתקין (:progress%): :message', + 'ui_driver_installed' => ':name הותקן.', + 'ui_driver_install_failed' => 'ההתקנה נכשלה: :message', 'ui_group_object' => 'אחסון אובייקטים', 'ui_group_cloud' => 'כוננים בענן', 'ui_group_server' => 'שרתים', diff --git a/lang/it/global.php b/lang/it/global.php index 778eeca..6202227 100644 --- a/lang/it/global.php +++ b/lang/it/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver è già installato.', + 'error_driver_not_installable' => ':driver ha i suoi pacchetti ma non riesce ancora ad avviarsi; probabilmente richiede un\'estensione PHP. Chiedi a chi gestisce il server.', + 'error_driver_install_unavailable' => 'Questo Evolution CMS non può installare pacchetti dal manager. Installalo con: :command', + 'error_driver_install_refused' => 'Il CMS non ha messo in coda l\'installazione: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Scegli :name', 'ui_driver_choose_short' => 'Scegli', 'ui_driver_missing' => 'Richiede un pacchetto aggiuntivo (:packages). Installalo con:', + 'ui_driver_install' => 'Installa', + 'ui_driver_install_aria' => 'Installa :name', + 'ui_driver_install_help' => 'Il worker delle attività del CMS lo installa con Composer in background e annulla tutto se qualcosa va storto.', + 'ui_driver_install_queued' => 'In attesa del worker delle attività del CMS...', + 'ui_driver_installing' => 'Installazione (:progress%): :message', + 'ui_driver_installed' => ':name è installato.', + 'ui_driver_install_failed' => 'L\'installazione non è riuscita: :message', 'ui_group_object' => 'Object storage', 'ui_group_cloud' => 'Cloud drive', 'ui_group_server' => 'Server', diff --git a/lang/ja/global.php b/lang/ja/global.php index f65ac35..945aec4 100644 --- a/lang/ja/global.php +++ b/lang/ja/global.php @@ -25,6 +25,10 @@ 'error_ambiguous_mount' => '複数のマウントが一致します: :names。どれを指定しますか?', 'error_driver_unknown' => 'このストレージの種類は不明です。', 'error_driver_unavailable' => ':driver には追加パッケージが必要です。次のコマンドでインストールしてください: :command', + 'error_driver_installed' => ':driver はすでにインストールされています。', + 'error_driver_not_installable' => ':driver のパッケージはありますが、まだ起動できません。PHP 拡張機能が必要な可能性があります。サーバーの管理者に問い合わせてください。', + 'error_driver_install_unavailable' => 'この Evolution CMS はマネージャーからパッケージをインストールできません。次のコマンドでインストールしてください: :command', + 'error_driver_install_refused' => 'CMS はインストールをキューに追加しませんでした: :reason', 'error_driver_admin_only' => ':driver はこのサーバー自身のディスクにアクセスするため、管理者のみが設定できます。', 'error_destination_private' => ':host はこのサーバー上または内部ネットワーク上にあります。そこへのマウントは管理者のみが接続できます。', 'error_destination_unresolved' => ':host が見つかりませんでした。アドレスを確認してください。', @@ -292,6 +296,13 @@ 'ui_driver_choose' => ':name を選択', 'ui_driver_choose_short' => '選択', 'ui_driver_missing' => '追加パッケージ(:packages)が必要です。次のコマンドでインストールしてください:', + 'ui_driver_install' => 'インストール', + 'ui_driver_install_aria' => ':name をインストール', + 'ui_driver_install_help' => 'CMS のタスクワーカーがバックグラウンドで Composer を使ってインストールし、失敗した場合はすべて元に戻します。', + 'ui_driver_install_queued' => 'CMS のタスクワーカーを待機中...', + 'ui_driver_installing' => 'インストール中 (:progress%): :message', + 'ui_driver_installed' => ':name をインストールしました。', + 'ui_driver_install_failed' => 'インストールに失敗しました: :message', 'ui_group_object' => 'オブジェクトストレージ', 'ui_group_cloud' => 'クラウドドライブ', 'ui_group_server' => 'サーバー', diff --git a/lang/nl/global.php b/lang/nl/global.php index 3d734ed..16a960e 100644 --- a/lang/nl/global.php +++ b/lang/nl/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver is al geïnstalleerd.', + 'error_driver_not_installable' => ':driver heeft zijn pakketten, maar kan nog steeds niet starten; waarschijnlijk is er een PHP-extensie nodig. Vraag het aan wie de server beheert.', + 'error_driver_install_unavailable' => 'Dit Evolution CMS kan geen pakketten installeren vanuit het beheer. Installeer het met: :command', + 'error_driver_install_refused' => 'Het CMS heeft de installatie niet in de wachtrij gezet: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => ':name kiezen', 'ui_driver_choose_short' => 'Kiezen', 'ui_driver_missing' => 'Heeft een extra pakket nodig (:packages). Installeer het met:', + 'ui_driver_install' => 'Installeren', + 'ui_driver_install_aria' => ':name installeren', + 'ui_driver_install_help' => 'De taakworker van het CMS installeert het op de achtergrond met Composer en draait alles terug als het mislukt.', + 'ui_driver_install_queued' => 'Wachten op de taakworker van het CMS...', + 'ui_driver_installing' => 'Bezig met installeren (:progress%): :message', + 'ui_driver_installed' => ':name is geïnstalleerd.', + 'ui_driver_install_failed' => 'De installatie is mislukt: :message', 'ui_group_object' => 'Objectopslag', 'ui_group_cloud' => 'Clouddrives', 'ui_group_server' => 'Servers', diff --git a/lang/nn/global.php b/lang/nn/global.php index 7099bad..161505d 100644 --- a/lang/nn/global.php +++ b/lang/nn/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver er allereie installert.', + 'error_driver_not_installable' => ':driver har pakkane sine, men kan framleis ikkje starte; han treng truleg ei PHP-utviding. Spør den som driftar tenaren.', + 'error_driver_install_unavailable' => 'Denne Evolution CMS-en kan ikkje installere pakkar frå handsamaren. Installer han med: :command', + 'error_driver_install_refused' => 'CMS-et sette ikkje installasjonen i kø: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Vel :name', 'ui_driver_choose_short' => 'Vel', 'ui_driver_missing' => 'Treng ein ekstra pakke (:packages). Installer han med:', + 'ui_driver_install' => 'Installer', + 'ui_driver_install_aria' => 'Installer :name', + 'ui_driver_install_help' => 'Oppgåvearbeidaren til CMS-et installerer han med Composer i bakgrunnen og gjer om alt dersom noko går gale.', + 'ui_driver_install_queued' => 'Ventar på oppgåvearbeidaren til CMS-et...', + 'ui_driver_installing' => 'Installerer (:progress%): :message', + 'ui_driver_installed' => ':name er installert.', + 'ui_driver_install_failed' => 'Installasjonen feila: :message', 'ui_group_object' => 'Objektlagring', 'ui_group_cloud' => 'Skystasjonar', 'ui_group_server' => 'Tenarar', diff --git a/lang/pl/global.php b/lang/pl/global.php index d9ea840..8d60ddd 100644 --- a/lang/pl/global.php +++ b/lang/pl/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver jest już zainstalowany.', + 'error_driver_not_installable' => ':driver ma swoje pakiety, ale nadal nie może się uruchomić; prawdopodobnie wymaga rozszerzenia PHP. Zapytaj osobę, która zarządza serwerem.', + 'error_driver_install_unavailable' => 'Ten Evolution CMS nie może instalować pakietów z menedżera. Zainstaluj go poleceniem: :command', + 'error_driver_install_refused' => 'CMS nie dodał instalacji do kolejki: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Wybierz: :name', 'ui_driver_choose_short' => 'Wybierz', 'ui_driver_missing' => 'Wymaga dodatkowego pakietu (:packages). Zainstaluj go poleceniem:', + 'ui_driver_install' => 'Zainstaluj', + 'ui_driver_install_aria' => 'Zainstaluj: :name', + 'ui_driver_install_help' => 'Proces zadań CMS instaluje go w tle za pomocą narzędzia Composer i w razie niepowodzenia cofa wszystkie zmiany.', + 'ui_driver_install_queued' => 'Oczekiwanie na proces zadań CMS...', + 'ui_driver_installing' => 'Instalowanie (:progress%): :message', + 'ui_driver_installed' => ':name jest zainstalowany.', + 'ui_driver_install_failed' => 'Instalacja nie powiodła się: :message', 'ui_group_object' => 'Magazyny obiektowe', 'ui_group_cloud' => 'Dyski w chmurze', 'ui_group_server' => 'Serwery', diff --git a/lang/pt/global.php b/lang/pt/global.php index 9f82580..6c64a03 100644 --- a/lang/pt/global.php +++ b/lang/pt/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver já está instalado.', + 'error_driver_not_installable' => ':driver tem os seus pacotes, mas continua sem conseguir arrancar; provavelmente precisa de uma extensão PHP. Pergunte a quem gere o servidor.', + 'error_driver_install_unavailable' => 'Este Evolution CMS não consegue instalar pacotes a partir do gestor. Instale-o com: :command', + 'error_driver_install_refused' => 'O CMS não colocou a instalação na fila: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Escolher :name', 'ui_driver_choose_short' => 'Escolher', 'ui_driver_missing' => 'Requer um pacote adicional (:packages). Instale-o com:', + 'ui_driver_install' => 'Instalar', + 'ui_driver_install_aria' => 'Instalar :name', + 'ui_driver_install_help' => 'O processo de tarefas do CMS instala-o com o Composer em segundo plano e desfaz tudo se falhar.', + 'ui_driver_install_queued' => 'A aguardar o processo de tarefas do CMS...', + 'ui_driver_installing' => 'A instalar (:progress%): :message', + 'ui_driver_installed' => ':name está instalado.', + 'ui_driver_install_failed' => 'A instalação falhou: :message', 'ui_group_object' => 'Armazenamento de objetos', 'ui_group_cloud' => 'Unidades na nuvem', 'ui_group_server' => 'Servidores', diff --git a/lang/sk/global.php b/lang/sk/global.php index 449bfe1..bba24e7 100644 --- a/lang/sk/global.php +++ b/lang/sk/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver je už nainštalovaný.', + 'error_driver_not_installable' => ':driver má svoje balíky, ale stále sa nemôže spustiť; pravdepodobne potrebuje rozšírenie PHP. Obráťte sa na toho, kto spravuje server.', + 'error_driver_install_unavailable' => 'Tento Evolution CMS nemôže inštalovať balíky zo správcu. Nainštalujte ho príkazom: :command', + 'error_driver_install_refused' => 'CMS nezaradil inštaláciu do frontu: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Vybrať: :name', 'ui_driver_choose_short' => 'Vybrať', 'ui_driver_missing' => 'Vyžaduje ďalší balík (:packages). Nainštalujte ho príkazom:', + 'ui_driver_install' => 'Nainštalovať', + 'ui_driver_install_aria' => 'Nainštalovať: :name', + 'ui_driver_install_help' => 'Pracovný proces úloh CMS ho nainštaluje na pozadí pomocou nástroja Composer a pri zlyhaní všetko vráti späť.', + 'ui_driver_install_queued' => 'Čaká sa na pracovný proces úloh CMS...', + 'ui_driver_installing' => 'Inštaluje sa (:progress%): :message', + 'ui_driver_installed' => ':name je nainštalovaný.', + 'ui_driver_install_failed' => 'Inštalácia zlyhala: :message', 'ui_group_object' => 'Objektové úložiská', 'ui_group_cloud' => 'Cloudové disky', 'ui_group_server' => 'Servery', diff --git a/lang/sv/global.php b/lang/sv/global.php index d9d0326..50aad1e 100644 --- a/lang/sv/global.php +++ b/lang/sv/global.php @@ -25,6 +25,10 @@ '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_installed' => ':driver är redan installerad.', + 'error_driver_not_installable' => ':driver har sina paket men kan ändå inte starta; den behöver troligen ett PHP-tillägg. Fråga den som driver servern.', + 'error_driver_install_unavailable' => 'Detta Evolution CMS kan inte installera paket från hanteraren. Installera det med: :command', + 'error_driver_install_refused' => 'CMS:et köade inte installationen: :reason', '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.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Välj :name', 'ui_driver_choose_short' => 'Välj', 'ui_driver_missing' => 'Kräver ett extra paket (:packages). Installera det med:', + 'ui_driver_install' => 'Installera', + 'ui_driver_install_aria' => 'Installera :name', + 'ui_driver_install_help' => 'CMS-uppgiftsprocessen installerar den med Composer i bakgrunden och ångrar allt om det misslyckas.', + 'ui_driver_install_queued' => 'Väntar på CMS-uppgiftsprocessen...', + 'ui_driver_installing' => 'Installerar (:progress%): :message', + 'ui_driver_installed' => ':name är installerad.', + 'ui_driver_install_failed' => 'Installationen misslyckades: :message', 'ui_group_object' => 'Objektlagring', 'ui_group_cloud' => 'Molnenheter', 'ui_group_server' => 'Servrar', diff --git a/lang/uk/global.php b/lang/uk/global.php index 9e1bd7b..391bdee 100644 --- a/lang/uk/global.php +++ b/lang/uk/global.php @@ -25,6 +25,10 @@ 'error_ambiguous_mount' => 'Підходить кілька дисків: :names. Який саме ви маєте на увазі?', 'error_driver_unknown' => 'Невідомий тип сховища.', 'error_driver_unavailable' => ':driver потребує додаткового пакета. Встановіть його командою: :command', + 'error_driver_installed' => ':driver уже встановлено.', + 'error_driver_not_installable' => ':driver має свої пакети, але все одно не може запуститися; ймовірно, йому потрібне розширення PHP. Зверніться до того, хто обслуговує сервер.', + 'error_driver_install_unavailable' => 'Ця Evolution CMS не може встановлювати пакети з менеджера. Встановіть його командою: :command', + 'error_driver_install_refused' => 'CMS не поставила встановлення в чергу: :reason', 'error_driver_admin_only' => ':driver звертається до власного диска цього сервера, тому налаштувати його може лише адміністратор.', 'error_destination_private' => ':host розташований на цьому сервері або у внутрішній мережі. Підключити туди диск може лише адміністратор.', 'error_destination_unresolved' => 'Не вдалося знайти :host. Перевірте адресу.', @@ -292,6 +296,13 @@ 'ui_driver_choose' => 'Вибрати: :name', 'ui_driver_choose_short' => 'Вибрати', 'ui_driver_missing' => 'Потрібен додатковий пакет (:packages). Встановіть його командою:', + 'ui_driver_install' => 'Встановити', + 'ui_driver_install_aria' => 'Встановити: :name', + 'ui_driver_install_help' => 'Обробник завдань CMS встановлює його у фоні через Composer і скасовує всі зміни, якщо щось піде не так.', + 'ui_driver_install_queued' => 'Очікування обробника завдань CMS...', + 'ui_driver_installing' => 'Встановлення (:progress%): :message', + 'ui_driver_installed' => ':name встановлено.', + 'ui_driver_install_failed' => 'Не вдалося встановити: :message', 'ui_group_object' => 'Об\'єктні сховища', 'ui_group_cloud' => 'Хмарні диски', 'ui_group_server' => 'Сервери', diff --git a/lang/zh/global.php b/lang/zh/global.php index 763f945..0a4d2d1 100644 --- a/lang/zh/global.php +++ b/lang/zh/global.php @@ -25,6 +25,10 @@ 'error_ambiguous_mount' => '有多个挂载盘匹配::names。您指的是哪一个?', 'error_driver_unknown' => '未知的存储类型。', 'error_driver_unavailable' => ':driver 需要额外的软件包。请使用以下命令安装::command', + 'error_driver_installed' => ':driver 已安装。', + 'error_driver_not_installable' => ':driver 的软件包已就绪,但仍无法启动;可能需要某个 PHP 扩展。请联系服务器的运维人员。', + 'error_driver_install_unavailable' => '此 Evolution CMS 无法从管理器安装软件包。请使用以下命令安装::command', + 'error_driver_install_refused' => 'CMS 未将安装加入队列::reason', 'error_driver_admin_only' => ':driver 会访问此服务器自身的磁盘,因此只有超级管理员可以设置。', 'error_destination_private' => ':host 位于此服务器或内部网络中。只有超级管理员可以在那里连接挂载盘。', 'error_destination_unresolved' => '找不到 :host。请检查地址。', @@ -292,6 +296,13 @@ 'ui_driver_choose' => '选择 :name', 'ui_driver_choose_short' => '选择', 'ui_driver_missing' => '需要额外的软件包(:packages)。请使用以下命令安装:', + 'ui_driver_install' => '安装', + 'ui_driver_install_aria' => '安装 :name', + 'ui_driver_install_help' => 'CMS 任务进程会在后台使用 Composer 安装,失败时会撤销所有更改。', + 'ui_driver_install_queued' => '正在等待 CMS 任务进程...', + 'ui_driver_installing' => '正在安装(:progress%)::message', + 'ui_driver_installed' => ':name 已安装。', + 'ui_driver_install_failed' => '安装失败::message', 'ui_group_object' => '对象存储', 'ui_group_cloud' => '云端硬盘', 'ui_group_server' => '服务器',