@synopackageland/cli 0.3.10 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +57 -9
- package/dist/bin.js +1 -2
- package/dist/build-spk/generator.d.ts +0 -3
- package/dist/build-spk/generator.js +138 -287
- package/dist/build-spk/native-lifecycle.js +0 -3
- package/dist/build-spk/native-payload.js +0 -1
- package/dist/build-spk/notices.d.ts +5 -0
- package/dist/build-spk/notices.js +60 -0
- package/dist/cli.js +178 -151
- package/dist/compose/analyze.d.ts +1 -2
- package/dist/compose/analyze.js +5 -48
- package/dist/contract/unsupported-types.d.ts +10 -0
- package/dist/contract/unsupported-types.js +49 -0
- package/dist/contract/validate.js +25 -2
- package/dist/contract/web-launch.js +0 -2
- package/dist/deploy/deploy.d.ts +1 -4
- package/dist/deploy/deploy.js +45 -156
- package/dist/deploy/homes-values.js +1 -1
- package/dist/deploy/plan.d.ts +18 -0
- package/dist/deploy/plan.js +54 -0
- package/dist/deploy/spk-version.d.ts +2 -14
- package/dist/deploy/spk-version.js +25 -111
- package/dist/dev.d.ts +1 -3
- package/dist/dev.js +14 -28
- package/dist/error-registry.js +830 -862
- package/dist/host/dsm-client.js +12 -272
- package/dist/host/dsm-port-profile.d.ts +0 -1
- package/dist/host/dsm-port-profile.js +0 -2
- package/dist/host/types.d.ts +1 -83
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -6
- package/dist/info.d.ts +0 -1
- package/dist/info.js +3 -10
- package/dist/init.d.ts +15 -1
- package/dist/init.js +128 -12
- package/dist/log.js +2 -3
- package/dist/native/validate.js +0 -1
- package/dist/standalone/binary.d.ts +9 -0
- package/dist/standalone/binary.js +67 -0
- package/dist/standalone/build.d.ts +25 -0
- package/dist/standalone/build.js +110 -0
- package/dist/standalone/daemon.d.ts +23 -0
- package/dist/standalone/daemon.js +114 -0
- package/dist/standalone/dsm-window.d.ts +26 -0
- package/dist/standalone/dsm-window.js +291 -0
- package/dist/standalone/helper-inventory.d.ts +16 -0
- package/dist/standalone/helper-inventory.js +2 -0
- package/dist/standalone/helper.d.ts +21 -0
- package/dist/standalone/helper.js +105 -0
- package/dist/standalone/host-adapter.d.ts +5 -0
- package/dist/standalone/host-adapter.js +148 -0
- package/dist/standalone/host-platform.d.ts +13 -0
- package/dist/standalone/host-platform.js +42 -0
- package/dist/standalone/host-types.d.ts +49 -0
- package/dist/standalone/host-types.js +1 -0
- package/dist/standalone/i18n.d.ts +28 -0
- package/dist/standalone/i18n.js +161 -0
- package/dist/standalone/inspect-helper.d.ts +6 -0
- package/dist/standalone/inspect-helper.js +88 -0
- package/dist/standalone/inspect-spk.d.ts +23 -0
- package/dist/standalone/inspect-spk.js +209 -0
- package/dist/standalone/lifecycle-helper.d.ts +2 -0
- package/dist/standalone/lifecycle-helper.js +12 -0
- package/dist/standalone/lifecycle.d.ts +3 -0
- package/dist/standalone/lifecycle.js +53 -0
- package/dist/standalone/manifest.d.ts +73 -0
- package/dist/standalone/manifest.js +279 -0
- package/dist/standalone/reopen-events.d.ts +2 -0
- package/dist/standalone/reopen-events.js +28 -0
- package/dist/standalone/root-messages.d.ts +7 -0
- package/dist/standalone/root-messages.js +259 -0
- package/dist/standalone/root-ops.d.ts +42 -0
- package/dist/standalone/root-ops.js +101 -0
- package/dist/standalone/root-window.d.ts +36 -0
- package/dist/standalone/root-window.js +302 -0
- package/dist/standalone/spk.d.ts +23 -0
- package/dist/standalone/spk.js +192 -0
- package/dist/template-paths.d.ts +2 -0
- package/dist/template-paths.js +9 -0
- package/dist/templates/_daemon/fixture_linux_test.go +15 -0
- package/dist/templates/_daemon/fixture_other_test.go +7 -0
- package/dist/templates/_daemon/go.mod +3 -0
- package/dist/templates/_daemon/main.go +608 -0
- package/dist/templates/_daemon/main_test.go +242 -0
- package/dist/templates/_daemon/process_linux.go +55 -0
- package/dist/templates/_daemon/process_linux_test.go +161 -0
- package/dist/templates/_daemon/process_other.go +14 -0
- package/dist/templates/_daemon/testdata/child.go +41 -0
- package/dist/templates/_shared/GO-LICENSE +27 -0
- package/dist/templates/_shared/GO-PATENTS +22 -0
- package/dist/templates/_shared/LICENSES/TEMPLATE.txt +21 -0
- package/dist/templates/_shared/notice-overrides/index.json +14 -0
- package/dist/templates/_shared/notice-overrides/utils-0.4.2-LICENSE +21 -0
- package/dist/templates/_shared/notice-overrides/utils-0.5.0-LICENSE +21 -0
- package/dist/templates/_shared/third-party-notices.mjs +51 -0
- package/dist/templates/binary/synology-app.yaml +7 -0
- package/dist/templates/hello-files/compose.yaml +0 -1
- package/dist/templates/hello-web/compose.yaml +13 -10
- package/dist/templates/hello-web/html/app.js +1 -23
- package/dist/templates/hello-web/html/index.html +1 -3
- package/dist/templates/hello-web-page/compose.yaml +13 -10
- package/dist/templates/hello-web-page/html/app.js +1 -23
- package/dist/templates/hello-web-page/html/index.html +1 -3
- package/dist/templates/native-go/README.md +324 -0
- package/dist/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +59 -0
- package/dist/templates/native-go/backend/cmd/app/main.go +49 -0
- package/dist/templates/native-go/backend/cmd/dsm-readonly-probe/main_linux.go +46 -0
- package/dist/templates/native-go/backend/cmd/helper/main.go +38 -0
- package/dist/templates/native-go/backend/go.mod +7 -0
- package/dist/templates/native-go/backend/go.sum +4 -0
- package/dist/templates/native-go/backend/internal/api/binary.go +154 -0
- package/dist/templates/native-go/backend/internal/api/binary_test.go +165 -0
- package/dist/templates/native-go/backend/internal/api/errors.go +33 -0
- package/dist/templates/native-go/backend/internal/api/registry.go +104 -0
- package/dist/templates/native-go/backend/internal/api/registry_test.go +329 -0
- package/dist/templates/native-go/backend/internal/api/server.go +159 -0
- package/dist/templates/native-go/backend/internal/app/nas_cgi_artifact_test.go +121 -0
- package/dist/templates/native-go/backend/internal/app/nas_refusal_test.go +46 -0
- package/dist/templates/native-go/backend/internal/app/root_none.go +9 -0
- package/dist/templates/native-go/backend/internal/app/routes.go +138 -0
- package/dist/templates/native-go/backend/internal/app/routes_test.go +172 -0
- package/dist/templates/native-go/backend/internal/dsm/auth.go +118 -0
- package/dist/templates/native-go/backend/internal/dsm/auth_test.go +139 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/collector_linux.go +335 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/collector_linux_test.go +41 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/protocol.go +179 -0
- package/dist/templates/native-go/backend/internal/dsmprobe/protocol_test.go +29 -0
- package/dist/templates/native-go/backend/internal/helper/cohort.go +393 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_publication.go +18 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_publication_test.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/cohort_test.go +372 -0
- package/dist/templates/native-go/backend/internal/helper/control.go +424 -0
- package/dist/templates/native-go/backend/internal/helper/control_test.go +250 -0
- package/dist/templates/native-go/backend/internal/helper/data_contract.go +242 -0
- package/dist/templates/native-go/backend/internal/helper/data_contract_test.go +51 -0
- package/dist/templates/native-go/backend/internal/helper/data_decode.go +184 -0
- package/dist/templates/native-go/backend/internal/helper/data_decode_pointer_test.go +30 -0
- package/dist/templates/native-go/backend/internal/helper/data_protocol.go +416 -0
- package/dist/templates/native-go/backend/internal/helper/data_protocol_test.go +449 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_linux.go +139 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_linux_test.go +121 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux.go +95 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux_test.go +56 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_bridge_linux.go +144 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_bridge_linux_test.go +89 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_home_linux.go +107 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_home_linux_test.go +82 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_probe_transport_linux.go +151 -0
- package/dist/templates/native-go/backend/internal/helper/dsm_probe_transport_linux_test.go +66 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority.go +516 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority_contract.go +88 -0
- package/dist/templates/native-go/backend/internal/helper/grant_authority_test.go +510 -0
- package/dist/templates/native-go/backend/internal/helper/grant_cohort.go +389 -0
- package/dist/templates/native-go/backend/internal/helper/grant_cohort_test.go +239 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery.go +49 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery_methods.go +273 -0
- package/dist/templates/native-go/backend/internal/helper/grant_delivery_test.go +322 -0
- package/dist/templates/native-go/backend/internal/helper/grant_operation_contract.go +47 -0
- package/dist/templates/native-go/backend/internal/helper/grant_readonly_test.go +180 -0
- package/dist/templates/native-go/backend/internal/helper/grant_repository_linux.go +415 -0
- package/dist/templates/native-go/backend/internal/helper/grant_repository_linux_test.go +468 -0
- package/dist/templates/native-go/backend/internal/helper/grant_rpc.go +147 -0
- package/dist/templates/native-go/backend/internal/helper/grant_rpc_test.go +51 -0
- package/dist/templates/native-go/backend/internal/helper/grant_snapshot.go +75 -0
- package/dist/templates/native-go/backend/internal/helper/grant_supervisor_linux.go +134 -0
- package/dist/templates/native-go/backend/internal/helper/grant_supervisor_linux_test.go +254 -0
- package/dist/templates/native-go/backend/internal/helper/lease.go +112 -0
- package/dist/templates/native-go/backend/internal/helper/lease_linux.go +44 -0
- package/dist/templates/native-go/backend/internal/helper/lease_other.go +8 -0
- package/dist/templates/native-go/backend/internal/helper/lifecycle.go +234 -0
- package/dist/templates/native-go/backend/internal/helper/lifecycle_test.go +473 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot.go +284 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_repository_linux.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_repository_linux_test.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/managed_pilot_test.go +210 -0
- package/dist/templates/native-go/backend/internal/helper/nas_shipped_refusal_linux_test.go +97 -0
- package/dist/templates/native-go/backend/internal/helper/native_discovery.go +79 -0
- package/dist/templates/native-go/backend/internal/helper/native_identity.go +89 -0
- package/dist/templates/native-go/backend/internal/helper/native_provider.go +159 -0
- package/dist/templates/native-go/backend/internal/helper/native_provider_test.go +421 -0
- package/dist/templates/native-go/backend/internal/helper/observation.go +204 -0
- package/dist/templates/native-go/backend/internal/helper/observation_health_test.go +115 -0
- package/dist/templates/native-go/backend/internal/helper/observation_reload_budget_test.go +117 -0
- package/dist/templates/native-go/backend/internal/helper/observation_test.go +196 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic.go +109 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_linux.go +76 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_linux_test.go +124 -0
- package/dist/templates/native-go/backend/internal/helper/observer_diagnostic_test.go +98 -0
- package/dist/templates/native-go/backend/internal/helper/operation_bootstrap_linux.go +193 -0
- package/dist/templates/native-go/backend/internal/helper/operation_credentials_linux.go +56 -0
- package/dist/templates/native-go/backend/internal/helper/operation_linux.go +480 -0
- package/dist/templates/native-go/backend/internal/helper/operation_linux_test.go +528 -0
- package/dist/templates/native-go/backend/internal/helper/peer_linux.go +44 -0
- package/dist/templates/native-go/backend/internal/helper/peer_other.go +7 -0
- package/dist/templates/native-go/backend/internal/helper/process_linux.go +177 -0
- package/dist/templates/native-go/backend/internal/helper/process_other.go +5 -0
- package/dist/templates/native-go/backend/internal/helper/publication_test.go +178 -0
- package/dist/templates/native-go/backend/internal/helper/read_stream_cohort_linux_test.go +156 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_linux.go +109 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_linux_test.go +118 -0
- package/dist/templates/native-go/backend/internal/helper/read_transfer_test.go +177 -0
- package/dist/templates/native-go/backend/internal/helper/readonly.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_admission.go +85 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_cohort_linux_test.go +253 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_linux_test.go +378 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_mount_linux.go +65 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_mount_proxy_linux.go +113 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_operations_linux.go +168 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_resolver_linux.go +241 -0
- package/dist/templates/native-go/backend/internal/helper/readonly_test.go +40 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity.go +252 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity_contract.go +105 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_identity_test.go +406 -0
- package/dist/templates/native-go/backend/internal/helper/relaxed_invalidation.go +200 -0
- package/dist/templates/native-go/backend/internal/helper/repair.go +132 -0
- package/dist/templates/native-go/backend/internal/helper/repair_test.go +271 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_acl_linux_test.go +303 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_fixture_linux_test.go +184 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_actor_races_linux_test.go +231 -0
- package/dist/templates/native-go/backend/internal/helper/s1r_fixture_contract_linux_test.go +18 -0
- package/dist/templates/native-go/backend/internal/helper/server_linux.go +124 -0
- package/dist/templates/native-go/backend/internal/helper/status.go +334 -0
- package/dist/templates/native-go/backend/internal/helper/status_test.go +288 -0
- package/dist/templates/native-go/backend/internal/helper/supervision.go +107 -0
- package/dist/templates/native-go/backend/internal/helper/supervision_test.go +124 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame.go +76 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame_linux_test.go +69 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_frame_test.go +107 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_linux.go +363 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_linux_test.go +913 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_socket_eof_test.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/supervisor_socket_test.go +45 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/create.json +23 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/frames.json +67 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/grant-store.json +52 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/intent.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/list.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/publish.json +20 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/read.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/stat.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/testdata/protocol2/write-stream.json +22 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection.go +75 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection_linux_test.go +135 -0
- package/dist/templates/native-go/backend/internal/helper/unit_connection_test.go +133 -0
- package/dist/templates/native-go/backend/internal/helper/unit_frame_test.go +32 -0
- package/dist/templates/native-go/backend/internal/helper/unit_linux.go +364 -0
- package/dist/templates/native-go/backend/internal/helper/unit_linux_test.go +46 -0
- package/dist/templates/native-go/backend/internal/helper/unit_mechanisms_linux_test.go +217 -0
- package/dist/templates/native-go/backend/internal/helper/unit_padding_linux_test.go +178 -0
- package/dist/templates/native-go/backend/internal/helper/unit_query_linux.go +111 -0
- package/dist/templates/native-go/backend/internal/helper/unit_reload_linux_test.go +372 -0
- package/dist/templates/native-go/backend/internal/helper/unit_reload_sequence_linux_test.go +232 -0
- package/dist/templates/native-go/backend/internal/helper/write.go +77 -0
- package/dist/templates/native-go/backend/internal/helper/write_admission.go +260 -0
- package/dist/templates/native-go/backend/internal/helper/write_admission_test.go +135 -0
- package/dist/templates/native-go/backend/internal/helper/write_cohort_linux_test.go +218 -0
- package/dist/templates/native-go/backend/internal/helper/write_files_linux.go +202 -0
- package/dist/templates/native-go/backend/internal/helper/write_files_linux_test.go +199 -0
- package/dist/templates/native-go/backend/internal/helper/write_intent_linux.go +116 -0
- package/dist/templates/native-go/backend/internal/helper/write_intent_linux_test.go +74 -0
- package/dist/templates/native-go/backend/internal/helper/write_operation_linux.go +245 -0
- package/dist/templates/native-go/backend/internal/helper/write_test.go +53 -0
- package/dist/templates/native-go/dsm-package.yaml +58 -0
- package/dist/templates/native-go/gitignore +1 -0
- package/dist/templates/native-go/i18n/glossary.json +662 -0
- package/dist/templates/native-go/i18n/messages/de.json +28 -0
- package/dist/templates/native-go/i18n/messages/en.json +28 -0
- package/dist/templates/native-go/i18n/messages/es.json +28 -0
- package/dist/templates/native-go/i18n/messages/fr.json +28 -0
- package/dist/templates/native-go/i18n/messages/it.json +28 -0
- package/dist/templates/native-go/i18n/messages/ja.json +28 -0
- package/dist/templates/native-go/i18n/messages/ko.json +28 -0
- package/dist/templates/native-go/i18n/messages/zh-CN.json +28 -0
- package/dist/templates/native-go/i18n/messages/zh-TW.json +28 -0
- package/dist/templates/native-go/ui/app.css +35 -0
- package/dist/templates/native-go/ui/app.js +101 -0
- package/dist/templates/native-go-better-auth/backend/internal/app/identity.go +208 -0
- package/dist/templates/native-go-better-auth/backend/internal/app/identity_test.go +113 -0
- package/dist/templates/native-go-better-auth/node/app.mjs +72 -0
- package/dist/templates/native-go-better-auth/node/build.mjs +4 -0
- package/dist/templates/native-go-better-auth/node/package-lock.json +862 -0
- package/dist/templates/native-go-better-auth/node/package.json +1 -0
- package/dist/templates/native-go-better-auth/node/test/auth.test.mjs +31 -0
- package/dist/templates/native-go-integration/backend/internal/app/identity_none.go +6 -0
- package/dist/templates/native-go-integration/backend/internal/app/personal.go +203 -0
- package/dist/templates/native-go-integration/backend/internal/app/personal_test.go +119 -0
- package/dist/templates/native-go-root/backend/internal/app/root.go +107 -0
- package/dist/templates/native-go-root/backend/internal/app/root_test.go +124 -0
- package/dist/templates/native-go-root/root/whoami.sh +6 -0
- package/dist/templates/native-go-vue/README.md +224 -0
- package/dist/templates/native-go-vue/frontend/DESIGN.md +78 -0
- package/dist/templates/native-go-vue/frontend/package-lock.json +2410 -0
- package/dist/templates/native-go-vue/frontend/package.json +6 -0
- package/dist/templates/native-go-vue/frontend/src/App.vue +159 -0
- package/dist/templates/native-go-vue/frontend/src/context.ts +56 -0
- package/dist/templates/native-go-vue/frontend/src/main.ts +29 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasGrantSettings.vue +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasPathPicker.vue +106 -0
- package/dist/templates/native-go-vue/frontend/src/nas/NasUnavailable.vue +20 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/de.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/en.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/es.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/fr.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/it.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/ja.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/ko.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/zh-CN.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/zh-TW.json +74 -0
- package/dist/templates/native-go-vue/frontend/src/nas/i18n.ts +38 -0
- package/dist/templates/native-go-vue/frontend/src/nas/mock-provider.ts +119 -0
- package/dist/templates/native-go-vue/frontend/src/nas/provider.ts +59 -0
- package/dist/templates/native-go-vue/frontend/src/nas/use-request.ts +27 -0
- package/dist/templates/native-go-vue/frontend/src/style.css +31 -0
- package/dist/templates/native-go-vue/frontend/test/apps.test.ts +190 -0
- package/dist/templates/native-go-vue/frontend/test/nas-provider.test.ts +81 -0
- package/dist/templates/native-go-vue/frontend/test/nas-request.test.ts +21 -0
- package/dist/templates/native-go-vue/frontend/test/nas-ui.test.ts +261 -0
- package/dist/templates/native-go-vue/frontend/tsconfig.json +1 -0
- package/dist/templates/native-go-vue/frontend/vite.config.ts +10 -0
- package/dist/templates/native-go-vue/gitignore +2 -0
- package/dist/types.d.ts +1 -1
- package/dist/validate.js +11 -7
- package/package.json +5 -8
- package/schema/synology-app.schema.json +36 -37
- package/skills/SKILL.md +4 -48
- package/skills/reference/create.md +11 -83
- package/skills/reference/deploy.md +7 -78
- package/skills/reference/diagnose.md +4 -101
- package/skills/reference/files.md +5 -41
- package/skills/reference/identity.md +3 -29
- package/skills/reference/wrap.md +0 -2
- package/templates/_daemon/fixture_linux_test.go +15 -0
- package/templates/_daemon/fixture_other_test.go +7 -0
- package/templates/_daemon/go.mod +3 -0
- package/templates/_daemon/main.go +608 -0
- package/templates/_daemon/main_test.go +242 -0
- package/templates/_daemon/process_linux.go +55 -0
- package/templates/_daemon/process_linux_test.go +161 -0
- package/templates/_daemon/process_other.go +14 -0
- package/templates/_daemon/testdata/child.go +41 -0
- package/templates/_shared/GO-LICENSE +27 -0
- package/templates/_shared/GO-PATENTS +22 -0
- package/templates/_shared/LICENSES/TEMPLATE.txt +21 -0
- package/templates/_shared/notice-overrides/index.json +14 -0
- package/templates/_shared/notice-overrides/utils-0.4.2-LICENSE +21 -0
- package/templates/_shared/notice-overrides/utils-0.5.0-LICENSE +21 -0
- package/templates/_shared/third-party-notices.mjs +51 -0
- package/templates/binary/synology-app.yaml +7 -0
- package/templates/hello-files/compose.yaml +0 -1
- package/templates/hello-web/compose.yaml +13 -10
- package/templates/hello-web/html/app.js +1 -23
- package/templates/hello-web/html/index.html +1 -3
- package/templates/hello-web-page/compose.yaml +13 -10
- package/templates/hello-web-page/html/app.js +1 -23
- package/templates/hello-web-page/html/index.html +1 -3
- package/templates/native-go/README.md +324 -0
- package/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +59 -0
- package/templates/native-go/backend/cmd/app/main.go +49 -0
- package/templates/native-go/backend/cmd/dsm-readonly-probe/main_linux.go +46 -0
- package/templates/native-go/backend/cmd/helper/main.go +38 -0
- package/templates/native-go/backend/go.mod +7 -0
- package/templates/native-go/backend/go.sum +4 -0
- package/templates/native-go/backend/internal/api/binary.go +154 -0
- package/templates/native-go/backend/internal/api/binary_test.go +165 -0
- package/templates/native-go/backend/internal/api/errors.go +33 -0
- package/templates/native-go/backend/internal/api/registry.go +104 -0
- package/templates/native-go/backend/internal/api/registry_test.go +329 -0
- package/templates/native-go/backend/internal/api/server.go +159 -0
- package/templates/native-go/backend/internal/app/nas_cgi_artifact_test.go +121 -0
- package/templates/native-go/backend/internal/app/nas_refusal_test.go +46 -0
- package/templates/native-go/backend/internal/app/root_none.go +9 -0
- package/templates/native-go/backend/internal/app/routes.go +138 -0
- package/templates/native-go/backend/internal/app/routes_test.go +172 -0
- package/templates/native-go/backend/internal/dsm/auth.go +118 -0
- package/templates/native-go/backend/internal/dsm/auth_test.go +139 -0
- package/templates/native-go/backend/internal/dsmprobe/collector_linux.go +335 -0
- package/templates/native-go/backend/internal/dsmprobe/collector_linux_test.go +41 -0
- package/templates/native-go/backend/internal/dsmprobe/protocol.go +179 -0
- package/templates/native-go/backend/internal/dsmprobe/protocol_test.go +29 -0
- package/templates/native-go/backend/internal/helper/cohort.go +393 -0
- package/templates/native-go/backend/internal/helper/cohort_publication.go +18 -0
- package/templates/native-go/backend/internal/helper/cohort_publication_test.go +105 -0
- package/templates/native-go/backend/internal/helper/cohort_test.go +372 -0
- package/templates/native-go/backend/internal/helper/control.go +424 -0
- package/templates/native-go/backend/internal/helper/control_test.go +250 -0
- package/templates/native-go/backend/internal/helper/data_contract.go +242 -0
- package/templates/native-go/backend/internal/helper/data_contract_test.go +51 -0
- package/templates/native-go/backend/internal/helper/data_decode.go +184 -0
- package/templates/native-go/backend/internal/helper/data_decode_pointer_test.go +30 -0
- package/templates/native-go/backend/internal/helper/data_protocol.go +416 -0
- package/templates/native-go/backend/internal/helper/data_protocol_test.go +449 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_linux.go +139 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_linux_test.go +121 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux.go +95 -0
- package/templates/native-go/backend/internal/helper/dsm_acl_syscall_linux_test.go +56 -0
- package/templates/native-go/backend/internal/helper/dsm_bridge_linux.go +144 -0
- package/templates/native-go/backend/internal/helper/dsm_bridge_linux_test.go +89 -0
- package/templates/native-go/backend/internal/helper/dsm_home_linux.go +107 -0
- package/templates/native-go/backend/internal/helper/dsm_home_linux_test.go +82 -0
- package/templates/native-go/backend/internal/helper/dsm_probe_transport_linux.go +151 -0
- package/templates/native-go/backend/internal/helper/dsm_probe_transport_linux_test.go +66 -0
- package/templates/native-go/backend/internal/helper/grant_authority.go +516 -0
- package/templates/native-go/backend/internal/helper/grant_authority_contract.go +88 -0
- package/templates/native-go/backend/internal/helper/grant_authority_test.go +510 -0
- package/templates/native-go/backend/internal/helper/grant_cohort.go +389 -0
- package/templates/native-go/backend/internal/helper/grant_cohort_test.go +239 -0
- package/templates/native-go/backend/internal/helper/grant_delivery.go +49 -0
- package/templates/native-go/backend/internal/helper/grant_delivery_methods.go +273 -0
- package/templates/native-go/backend/internal/helper/grant_delivery_test.go +322 -0
- package/templates/native-go/backend/internal/helper/grant_operation_contract.go +47 -0
- package/templates/native-go/backend/internal/helper/grant_readonly_test.go +180 -0
- package/templates/native-go/backend/internal/helper/grant_repository_linux.go +415 -0
- package/templates/native-go/backend/internal/helper/grant_repository_linux_test.go +468 -0
- package/templates/native-go/backend/internal/helper/grant_rpc.go +147 -0
- package/templates/native-go/backend/internal/helper/grant_rpc_test.go +51 -0
- package/templates/native-go/backend/internal/helper/grant_snapshot.go +75 -0
- package/templates/native-go/backend/internal/helper/grant_supervisor_linux.go +134 -0
- package/templates/native-go/backend/internal/helper/grant_supervisor_linux_test.go +254 -0
- package/templates/native-go/backend/internal/helper/lease.go +112 -0
- package/templates/native-go/backend/internal/helper/lease_linux.go +44 -0
- package/templates/native-go/backend/internal/helper/lease_other.go +8 -0
- package/templates/native-go/backend/internal/helper/lifecycle.go +234 -0
- package/templates/native-go/backend/internal/helper/lifecycle_test.go +473 -0
- package/templates/native-go/backend/internal/helper/managed_pilot.go +284 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_repository_linux.go +74 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_repository_linux_test.go +40 -0
- package/templates/native-go/backend/internal/helper/managed_pilot_test.go +210 -0
- package/templates/native-go/backend/internal/helper/nas_shipped_refusal_linux_test.go +97 -0
- package/templates/native-go/backend/internal/helper/native_discovery.go +79 -0
- package/templates/native-go/backend/internal/helper/native_identity.go +89 -0
- package/templates/native-go/backend/internal/helper/native_provider.go +159 -0
- package/templates/native-go/backend/internal/helper/native_provider_test.go +421 -0
- package/templates/native-go/backend/internal/helper/observation.go +204 -0
- package/templates/native-go/backend/internal/helper/observation_health_test.go +115 -0
- package/templates/native-go/backend/internal/helper/observation_reload_budget_test.go +117 -0
- package/templates/native-go/backend/internal/helper/observation_test.go +196 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic.go +109 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_linux.go +76 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_linux_test.go +124 -0
- package/templates/native-go/backend/internal/helper/observer_diagnostic_test.go +98 -0
- package/templates/native-go/backend/internal/helper/operation_bootstrap_linux.go +193 -0
- package/templates/native-go/backend/internal/helper/operation_credentials_linux.go +56 -0
- package/templates/native-go/backend/internal/helper/operation_linux.go +480 -0
- package/templates/native-go/backend/internal/helper/operation_linux_test.go +528 -0
- package/templates/native-go/backend/internal/helper/peer_linux.go +44 -0
- package/templates/native-go/backend/internal/helper/peer_other.go +7 -0
- package/templates/native-go/backend/internal/helper/process_linux.go +177 -0
- package/templates/native-go/backend/internal/helper/process_other.go +5 -0
- package/templates/native-go/backend/internal/helper/publication_test.go +178 -0
- package/templates/native-go/backend/internal/helper/read_stream_cohort_linux_test.go +156 -0
- package/templates/native-go/backend/internal/helper/read_transfer.go +40 -0
- package/templates/native-go/backend/internal/helper/read_transfer_linux.go +109 -0
- package/templates/native-go/backend/internal/helper/read_transfer_linux_test.go +118 -0
- package/templates/native-go/backend/internal/helper/read_transfer_test.go +177 -0
- package/templates/native-go/backend/internal/helper/readonly.go +105 -0
- package/templates/native-go/backend/internal/helper/readonly_admission.go +85 -0
- package/templates/native-go/backend/internal/helper/readonly_cohort_linux_test.go +253 -0
- package/templates/native-go/backend/internal/helper/readonly_linux_test.go +378 -0
- package/templates/native-go/backend/internal/helper/readonly_mount_linux.go +65 -0
- package/templates/native-go/backend/internal/helper/readonly_mount_proxy_linux.go +113 -0
- package/templates/native-go/backend/internal/helper/readonly_operations_linux.go +168 -0
- package/templates/native-go/backend/internal/helper/readonly_resolver_linux.go +241 -0
- package/templates/native-go/backend/internal/helper/readonly_test.go +40 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity.go +252 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity_contract.go +105 -0
- package/templates/native-go/backend/internal/helper/relaxed_identity_test.go +406 -0
- package/templates/native-go/backend/internal/helper/relaxed_invalidation.go +200 -0
- package/templates/native-go/backend/internal/helper/repair.go +132 -0
- package/templates/native-go/backend/internal/helper/repair_test.go +271 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_acl_linux_test.go +303 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_fixture_linux_test.go +184 -0
- package/templates/native-go/backend/internal/helper/s1r_actor_races_linux_test.go +231 -0
- package/templates/native-go/backend/internal/helper/s1r_fixture_contract_linux_test.go +18 -0
- package/templates/native-go/backend/internal/helper/server_linux.go +124 -0
- package/templates/native-go/backend/internal/helper/status.go +334 -0
- package/templates/native-go/backend/internal/helper/status_test.go +288 -0
- package/templates/native-go/backend/internal/helper/supervision.go +107 -0
- package/templates/native-go/backend/internal/helper/supervision_test.go +124 -0
- package/templates/native-go/backend/internal/helper/supervisor_frame.go +76 -0
- package/templates/native-go/backend/internal/helper/supervisor_frame_linux_test.go +69 -0
- package/templates/native-go/backend/internal/helper/supervisor_frame_test.go +107 -0
- package/templates/native-go/backend/internal/helper/supervisor_linux.go +363 -0
- package/templates/native-go/backend/internal/helper/supervisor_linux_test.go +913 -0
- package/templates/native-go/backend/internal/helper/supervisor_socket_eof_test.go +74 -0
- package/templates/native-go/backend/internal/helper/supervisor_socket_test.go +45 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/create.json +23 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/frames.json +67 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/grant-store.json +52 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/intent.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/list.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/publish.json +20 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/read.json +22 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/stat.json +22 -0
- package/templates/native-go/backend/internal/helper/testdata/protocol2/write-stream.json +22 -0
- package/templates/native-go/backend/internal/helper/unit_connection.go +75 -0
- package/templates/native-go/backend/internal/helper/unit_connection_linux_test.go +135 -0
- package/templates/native-go/backend/internal/helper/unit_connection_test.go +133 -0
- package/templates/native-go/backend/internal/helper/unit_frame_test.go +32 -0
- package/templates/native-go/backend/internal/helper/unit_linux.go +364 -0
- package/templates/native-go/backend/internal/helper/unit_linux_test.go +46 -0
- package/templates/native-go/backend/internal/helper/unit_mechanisms_linux_test.go +217 -0
- package/templates/native-go/backend/internal/helper/unit_padding_linux_test.go +178 -0
- package/templates/native-go/backend/internal/helper/unit_query_linux.go +111 -0
- package/templates/native-go/backend/internal/helper/unit_reload_linux_test.go +372 -0
- package/templates/native-go/backend/internal/helper/unit_reload_sequence_linux_test.go +232 -0
- package/templates/native-go/backend/internal/helper/write.go +77 -0
- package/templates/native-go/backend/internal/helper/write_admission.go +260 -0
- package/templates/native-go/backend/internal/helper/write_admission_test.go +135 -0
- package/templates/native-go/backend/internal/helper/write_cohort_linux_test.go +218 -0
- package/templates/native-go/backend/internal/helper/write_files_linux.go +202 -0
- package/templates/native-go/backend/internal/helper/write_files_linux_test.go +199 -0
- package/templates/native-go/backend/internal/helper/write_intent_linux.go +116 -0
- package/templates/native-go/backend/internal/helper/write_intent_linux_test.go +74 -0
- package/templates/native-go/backend/internal/helper/write_operation_linux.go +245 -0
- package/templates/native-go/backend/internal/helper/write_test.go +53 -0
- package/templates/native-go/dsm-package.yaml +58 -0
- package/templates/native-go/gitignore +1 -0
- package/templates/native-go/i18n/glossary.json +662 -0
- package/templates/native-go/i18n/messages/de.json +28 -0
- package/templates/native-go/i18n/messages/en.json +28 -0
- package/templates/native-go/i18n/messages/es.json +28 -0
- package/templates/native-go/i18n/messages/fr.json +28 -0
- package/templates/native-go/i18n/messages/it.json +28 -0
- package/templates/native-go/i18n/messages/ja.json +28 -0
- package/templates/native-go/i18n/messages/ko.json +28 -0
- package/templates/native-go/i18n/messages/zh-CN.json +28 -0
- package/templates/native-go/i18n/messages/zh-TW.json +28 -0
- package/templates/native-go/ui/app.css +35 -0
- package/templates/native-go/ui/app.js +101 -0
- package/templates/native-go-better-auth/backend/internal/app/identity.go +208 -0
- package/templates/native-go-better-auth/backend/internal/app/identity_test.go +113 -0
- package/templates/native-go-better-auth/node/app.mjs +72 -0
- package/templates/native-go-better-auth/node/build.mjs +4 -0
- package/templates/native-go-better-auth/node/package-lock.json +862 -0
- package/templates/native-go-better-auth/node/package.json +1 -0
- package/templates/native-go-better-auth/node/test/auth.test.mjs +31 -0
- package/templates/native-go-integration/backend/internal/app/identity_none.go +6 -0
- package/templates/native-go-integration/backend/internal/app/personal.go +203 -0
- package/templates/native-go-integration/backend/internal/app/personal_test.go +119 -0
- package/templates/native-go-root/backend/internal/app/root.go +107 -0
- package/templates/native-go-root/backend/internal/app/root_test.go +124 -0
- package/templates/native-go-root/root/whoami.sh +6 -0
- package/templates/native-go-vue/README.md +224 -0
- package/templates/native-go-vue/frontend/DESIGN.md +78 -0
- package/templates/native-go-vue/frontend/package-lock.json +2410 -0
- package/templates/native-go-vue/frontend/package.json +6 -0
- package/templates/native-go-vue/frontend/src/App.vue +159 -0
- package/templates/native-go-vue/frontend/src/context.ts +56 -0
- package/templates/native-go-vue/frontend/src/main.ts +29 -0
- package/templates/native-go-vue/frontend/src/nas/NasGrantSettings.vue +74 -0
- package/templates/native-go-vue/frontend/src/nas/NasPathPicker.vue +106 -0
- package/templates/native-go-vue/frontend/src/nas/NasUnavailable.vue +20 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/de.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/en.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/es.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/fr.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/it.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/ja.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/ko.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/zh-CN.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n/zh-TW.json +74 -0
- package/templates/native-go-vue/frontend/src/nas/i18n.ts +38 -0
- package/templates/native-go-vue/frontend/src/nas/mock-provider.ts +119 -0
- package/templates/native-go-vue/frontend/src/nas/provider.ts +59 -0
- package/templates/native-go-vue/frontend/src/nas/use-request.ts +27 -0
- package/templates/native-go-vue/frontend/src/style.css +31 -0
- package/templates/native-go-vue/frontend/test/apps.test.ts +190 -0
- package/templates/native-go-vue/frontend/test/nas-provider.test.ts +81 -0
- package/templates/native-go-vue/frontend/test/nas-request.test.ts +21 -0
- package/templates/native-go-vue/frontend/test/nas-ui.test.ts +261 -0
- package/templates/native-go-vue/frontend/tsconfig.json +1 -0
- package/templates/native-go-vue/frontend/vite.config.ts +10 -0
- package/templates/native-go-vue/gitignore +2 -0
- package/dist/attestation/app-package.d.ts +0 -86
- package/dist/attestation/app-package.js +0 -206
- package/dist/attestation/install-on-host.d.ts +0 -14
- package/dist/attestation/install-on-host.js +0 -52
- package/dist/attestation/keyring.d.ts +0 -21
- package/dist/attestation/keyring.js +0 -168
- package/dist/attestation/platform-service.d.ts +0 -70
- package/dist/attestation/platform-service.js +0 -250
- package/dist/build-spk/broker-glue.d.ts +0 -16
- package/dist/build-spk/broker-glue.js +0 -40
- package/dist/deploy/catalog-publish.d.ts +0 -3
- package/dist/deploy/catalog-publish.js +0 -7
- package/dist/doctor.d.ts +0 -22
- package/dist/doctor.js +0 -822
- package/dist/error-collector.d.ts +0 -2
- package/dist/error-collector.js +0 -46
- package/dist/host/broker-paths.d.ts +0 -1
- package/dist/host/broker-paths.js +0 -1
- package/dist/host/broker-upgrade-preflight.d.ts +0 -61
- package/dist/host/broker-upgrade-preflight.js +0 -156
- package/dist/host/digests.d.ts +0 -5
- package/dist/host/digests.js +0 -63
- package/dist/host/fake-nas.d.ts +0 -49
- package/dist/host/fake-nas.js +0 -193
- package/dist/mock-broker/bootstrap.d.ts +0 -2
- package/dist/mock-broker/bootstrap.js +0 -8
- package/dist/mock-broker/files.d.ts +0 -60
- package/dist/mock-broker/files.js +0 -408
- package/dist/mock-broker/oidc.d.ts +0 -31
- package/dist/mock-broker/oidc.js +0 -161
- package/dist/mock-broker/path.d.ts +0 -9
- package/dist/mock-broker/path.js +0 -50
- package/dist/mock-broker/server.d.ts +0 -19
- package/dist/mock-broker/server.js +0 -350
- package/dist/publish/build-ledger.d.ts +0 -22
- package/dist/publish/build-ledger.js +0 -26
- package/dist/publish/community-path.d.ts +0 -6
- package/dist/publish/community-path.js +0 -41
- package/dist/publish/curated-release.d.ts +0 -78
- package/dist/publish/curated-release.js +0 -883
- package/dist/publish/file-build-ledger.d.ts +0 -18
- package/dist/publish/file-build-ledger.js +0 -268
- package/dist/publish/github-pr.d.ts +0 -25
- package/dist/publish/github-pr.js +0 -85
- package/dist/publish/github-repo.d.ts +0 -8
- package/dist/publish/github-repo.js +0 -21
- package/dist/publish/platform-service-release.d.ts +0 -60
- package/dist/publish/platform-service-release.js +0 -333
- package/dist/publish/preflight.d.ts +0 -24
- package/dist/publish/preflight.js +0 -138
- package/dist/publish/publish.d.ts +0 -27
- package/dist/publish/publish.js +0 -136
- package/dist/publish/sync-definition.d.ts +0 -4
- package/dist/publish/sync-definition.js +0 -48
- package/dist/release-bin.d.ts +0 -2
- package/dist/release-bin.js +0 -23
- package/dist/templates/hello-web/html/sdk.js +0 -68
- package/dist/templates/hello-web-page/html/sdk.js +0 -68
- package/dist/templates/native/synology-app.yaml +0 -7
- package/dist/test-host.d.ts +0 -15
- package/dist/test-host.js +0 -37
- package/templates/hello-web/html/sdk.js +0 -68
- package/templates/hello-web-page/html/sdk.js +0 -68
- package/templates/native/synology-app.yaml +0 -7
- /package/dist/templates/{native → binary}/native.yaml +0 -0
- /package/templates/{native → binary}/native.yaml +0 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text of the authorization panel every privilege: root package shows, the
|
|
3
|
+
* same in every package. DSM's own words (Task Scheduler, Run, Remove, …) are
|
|
4
|
+
* taken verbatim from DSM 7.4; test/standalone-root-messages.test.ts pins them.
|
|
5
|
+
*/
|
|
6
|
+
export const ROOT_MESSAGES = {
|
|
7
|
+
en: {
|
|
8
|
+
title: "Administrator authorization",
|
|
9
|
+
intro: "This package can run the fixed operation \"{op}\" as root. A DSM administrator approves it once with their password. DSM then keeps it as a disabled task in Task Scheduler that runs only when an administrator clicks Run here.",
|
|
10
|
+
status: "Status",
|
|
11
|
+
last_run: "Last run time",
|
|
12
|
+
never: "Not run yet",
|
|
13
|
+
output: "Result",
|
|
14
|
+
"state.checking": "Loading...",
|
|
15
|
+
"state.missing": "Not authorized",
|
|
16
|
+
"state.ready": "Authorized",
|
|
17
|
+
"state.outdated": "The package was updated and needs authorization again",
|
|
18
|
+
"state.conflict": "Another Task Scheduler task already uses the name \"{name}\"",
|
|
19
|
+
authorize: "Authorize",
|
|
20
|
+
run: "Run",
|
|
21
|
+
remove: "Remove",
|
|
22
|
+
retry: "Retry",
|
|
23
|
+
completed: "Completed",
|
|
24
|
+
cancelled: "Authorization was cancelled. Nothing was created.",
|
|
25
|
+
admin_only: "Only administrator accounts can perform this operation.",
|
|
26
|
+
uninstall_hint: "Before uninstalling this package, click Remove to delete its task from Task Scheduler.",
|
|
27
|
+
"error.root_conflict": "Rename or delete the task \"{name}\" in Task Scheduler, then click Retry.",
|
|
28
|
+
"error.root_cancelled": "Password confirmation was cancelled. No operation was run.",
|
|
29
|
+
"error.root_not_ready": "Authorize this operation first.",
|
|
30
|
+
"error.root_task_failed": "The task ended with an error. Check its history in Task Scheduler, then click Retry.",
|
|
31
|
+
"error.root_timeout": "The task did not finish in time. Check it in Task Scheduler, then click Retry.",
|
|
32
|
+
"error.root_verify_failed": "Task Scheduler does not show the expected task. Click Retry.",
|
|
33
|
+
"error.default": "The operation failed ({code}). Click Retry.",
|
|
34
|
+
},
|
|
35
|
+
"zh-TW": {
|
|
36
|
+
title: "管理員授權",
|
|
37
|
+
intro: "此套件可用 root 身分執行固定操作「{op}」。DSM 管理員以密碼核准一次後,DSM 會在任務排程表中保留一個已停用的任務,只有管理員在此按下「執行」時才會執行。",
|
|
38
|
+
status: "狀態",
|
|
39
|
+
last_run: "最後執行時間",
|
|
40
|
+
never: "尚未執行",
|
|
41
|
+
output: "結果",
|
|
42
|
+
"state.checking": "載入中...",
|
|
43
|
+
"state.missing": "未授權",
|
|
44
|
+
"state.ready": "已授權",
|
|
45
|
+
"state.outdated": "套件已更新,需要重新授權",
|
|
46
|
+
"state.conflict": "任務排程表中已有其他任務使用名稱「{name}」",
|
|
47
|
+
authorize: "授權",
|
|
48
|
+
run: "執行",
|
|
49
|
+
remove: "移除",
|
|
50
|
+
retry: "重試",
|
|
51
|
+
completed: "已完成",
|
|
52
|
+
cancelled: "已取消授權,未建立任何任務。",
|
|
53
|
+
admin_only: "僅限管理員帳號允許執行此操作。",
|
|
54
|
+
uninstall_hint: "解除安裝此套件前,請按「移除」從任務排程表刪除它的任務。",
|
|
55
|
+
"error.root_conflict": "請在任務排程表中重新命名或刪除任務「{name}」,再按「重試」。",
|
|
56
|
+
"error.root_cancelled": "已取消密碼確認,未執行任何操作。",
|
|
57
|
+
"error.root_not_ready": "請先授權此操作。",
|
|
58
|
+
"error.root_task_failed": "任務執行失敗。請在任務排程表查看其記錄,再按「重試」。",
|
|
59
|
+
"error.root_timeout": "任務未在時限內完成。請在任務排程表確認後,再按「重試」。",
|
|
60
|
+
"error.root_verify_failed": "任務排程表中沒有預期的任務。請按「重試」。",
|
|
61
|
+
"error.default": "操作失敗({code})。請按「重試」。",
|
|
62
|
+
},
|
|
63
|
+
"zh-CN": {
|
|
64
|
+
title: "管理员授权",
|
|
65
|
+
intro: "此套件可以 root 身份运行固定操作“{op}”。DSM 管理员用密码批准一次后,DSM 会在任务计划中保留一个已禁用的任务,只有管理员在此单击“运行”时才会运行。",
|
|
66
|
+
status: "状态",
|
|
67
|
+
last_run: "最后运行时间",
|
|
68
|
+
never: "尚未运行",
|
|
69
|
+
output: "结果",
|
|
70
|
+
"state.checking": "加载中...",
|
|
71
|
+
"state.missing": "未授权",
|
|
72
|
+
"state.ready": "已授权",
|
|
73
|
+
"state.outdated": "套件已更新,需要重新授权",
|
|
74
|
+
"state.conflict": "任务计划中已有其他任务使用名称“{name}”",
|
|
75
|
+
authorize: "授权",
|
|
76
|
+
run: "运行",
|
|
77
|
+
remove: "删除",
|
|
78
|
+
retry: "重试",
|
|
79
|
+
completed: "已完成",
|
|
80
|
+
cancelled: "已取消授权,未创建任何任务。",
|
|
81
|
+
admin_only: "只有管理员帐户才能执行此操作。",
|
|
82
|
+
uninstall_hint: "卸载此套件前,请单击“删除”从任务计划中删除它的任务。",
|
|
83
|
+
"error.root_conflict": "请在任务计划中重命名或删除任务“{name}”,然后单击“重试”。",
|
|
84
|
+
"error.root_cancelled": "已取消密码确认,未执行任何操作。",
|
|
85
|
+
"error.root_not_ready": "请先授权此操作。",
|
|
86
|
+
"error.root_task_failed": "任务运行失败。请在任务计划中查看其记录,然后单击“重试”。",
|
|
87
|
+
"error.root_timeout": "任务未在时限内完成。请在任务计划中确认后单击“重试”。",
|
|
88
|
+
"error.root_verify_failed": "任务计划中没有预期的任务。请单击“重试”。",
|
|
89
|
+
"error.default": "操作失败({code})。请单击“重试”。",
|
|
90
|
+
},
|
|
91
|
+
ja: {
|
|
92
|
+
title: "管理者の承認",
|
|
93
|
+
intro: "このパッケージは固定の操作「{op}」を root として実行できます。DSM 管理者がパスワードで一度承認すると、DSM はタスク スケジューラーに無効のタスクとして保持し、管理者がここで「実行」をクリックしたときだけ実行します。",
|
|
94
|
+
status: "状態",
|
|
95
|
+
last_run: "最終実行時刻",
|
|
96
|
+
never: "まだ実行されていません",
|
|
97
|
+
output: "結果",
|
|
98
|
+
"state.checking": "読み込み中...",
|
|
99
|
+
"state.missing": "未承認",
|
|
100
|
+
"state.ready": "承認済み",
|
|
101
|
+
"state.outdated": "パッケージが更新されたため、再承認が必要です",
|
|
102
|
+
"state.conflict": "タスク スケジューラーの別のタスクが名前「{name}」を使用しています",
|
|
103
|
+
authorize: "承認",
|
|
104
|
+
run: "実行",
|
|
105
|
+
remove: "削除",
|
|
106
|
+
retry: "再試行",
|
|
107
|
+
completed: "完了",
|
|
108
|
+
cancelled: "承認はキャンセルされました。何も作成されていません。",
|
|
109
|
+
admin_only: "この操作を実行できるのは管理者アカウントのみです。",
|
|
110
|
+
uninstall_hint: "このパッケージをアンインストールする前に、「削除」をクリックしてタスク スケジューラーからタスクを削除してください。",
|
|
111
|
+
"error.root_conflict": "タスク スケジューラーでタスク「{name}」の名前を変更するか削除してから、「再試行」をクリックしてください。",
|
|
112
|
+
"error.root_cancelled": "パスワードの確認がキャンセルされました。操作は実行されていません。",
|
|
113
|
+
"error.root_not_ready": "先にこの操作を承認してください。",
|
|
114
|
+
"error.root_task_failed": "タスクがエラーで終了しました。タスク スケジューラーで履歴を確認してから、「再試行」をクリックしてください。",
|
|
115
|
+
"error.root_timeout": "タスクが時間内に完了しませんでした。タスク スケジューラーで確認してから、「再試行」をクリックしてください。",
|
|
116
|
+
"error.root_verify_failed": "タスク スケジューラーに想定したタスクが見つかりません。「再試行」をクリックしてください。",
|
|
117
|
+
"error.default": "操作に失敗しました ({code})。「再試行」をクリックしてください。",
|
|
118
|
+
},
|
|
119
|
+
ko: {
|
|
120
|
+
title: "관리자 승인",
|
|
121
|
+
intro: "이 패키지는 고정된 작업 \"{op}\"을(를) root로 실행할 수 있습니다. DSM 관리자가 암호로 한 번 승인하면 DSM이 작업 스케줄러에 비활성화된 작업으로 보관하며, 관리자가 여기에서 \"실행\"을 클릭할 때만 실행됩니다.",
|
|
122
|
+
status: "상태",
|
|
123
|
+
last_run: "마지막 실행 시간",
|
|
124
|
+
never: "아직 실행되지 않음",
|
|
125
|
+
output: "결과",
|
|
126
|
+
"state.checking": "로드 중…",
|
|
127
|
+
"state.missing": "승인되지 않음",
|
|
128
|
+
"state.ready": "승인됨",
|
|
129
|
+
"state.outdated": "패키지가 업데이트되어 다시 승인해야 합니다",
|
|
130
|
+
"state.conflict": "작업 스케줄러의 다른 작업이 이미 \"{name}\" 이름을 사용하고 있습니다",
|
|
131
|
+
authorize: "승인",
|
|
132
|
+
run: "실행",
|
|
133
|
+
remove: "제거",
|
|
134
|
+
retry: "재시도",
|
|
135
|
+
completed: "완료됨",
|
|
136
|
+
cancelled: "승인이 취소되었습니다. 아무것도 만들어지지 않았습니다.",
|
|
137
|
+
admin_only: "관리자 계정에서만 이 작업을 수행할 수 있습니다.",
|
|
138
|
+
uninstall_hint: "이 패키지를 제거하기 전에 \"제거\"를 클릭하여 작업 스케줄러에서 작업을 삭제하십시오.",
|
|
139
|
+
"error.root_conflict": "작업 스케줄러에서 작업 \"{name}\"의 이름을 바꾸거나 삭제한 후 \"재시도\"를 클릭하십시오.",
|
|
140
|
+
"error.root_cancelled": "비밀번호 확인이 취소되었습니다. 작업이 실행되지 않았습니다.",
|
|
141
|
+
"error.root_not_ready": "먼저 이 작업을 승인하십시오.",
|
|
142
|
+
"error.root_task_failed": "작업이 오류로 종료되었습니다. 작업 스케줄러에서 기록을 확인한 후 \"재시도\"를 클릭하십시오.",
|
|
143
|
+
"error.root_timeout": "작업이 제시간에 완료되지 않았습니다. 작업 스케줄러에서 확인한 후 \"재시도\"를 클릭하십시오.",
|
|
144
|
+
"error.root_verify_failed": "작업 스케줄러에 예상한 작업이 없습니다. \"재시도\"를 클릭하십시오.",
|
|
145
|
+
"error.default": "작업에 실패했습니다({code}). \"재시도\"를 클릭하십시오.",
|
|
146
|
+
},
|
|
147
|
+
de: {
|
|
148
|
+
title: "Administratorfreigabe",
|
|
149
|
+
intro: "Dieses Paket kann den festen Vorgang „{op}“ als root ausführen. Ein DSM-Administrator genehmigt ihn einmal mit seinem Passwort. DSM behält ihn dann als deaktivierte Aufgabe im Aufgabenplaner, die nur ausgeführt wird, wenn ein Administrator hier auf „Ausführen“ klickt.",
|
|
150
|
+
status: "Status",
|
|
151
|
+
last_run: "Letzte Ausführungszeit",
|
|
152
|
+
never: "Noch nicht ausgeführt",
|
|
153
|
+
output: "Ergebnis",
|
|
154
|
+
"state.checking": "Wird geladen...",
|
|
155
|
+
"state.missing": "Nicht freigegeben",
|
|
156
|
+
"state.ready": "Freigegeben",
|
|
157
|
+
"state.outdated": "Das Paket wurde aktualisiert und muss erneut freigegeben werden",
|
|
158
|
+
"state.conflict": "Eine andere Aufgabe im Aufgabenplaner verwendet bereits den Namen „{name}“",
|
|
159
|
+
authorize: "Freigeben",
|
|
160
|
+
run: "Ausführen",
|
|
161
|
+
remove: "Entfernen",
|
|
162
|
+
retry: "Neuer Versuch",
|
|
163
|
+
completed: "Abgeschlossen",
|
|
164
|
+
cancelled: "Die Freigabe wurde abgebrochen. Es wurde nichts erstellt.",
|
|
165
|
+
admin_only: "Nur Administratorkonten können diesen Vorgang ausführen.",
|
|
166
|
+
uninstall_hint: "Klicken Sie vor der Deinstallation dieses Pakets auf „Entfernen“, um seine Aufgabe aus dem Aufgabenplaner zu löschen.",
|
|
167
|
+
"error.root_conflict": "Benennen Sie die Aufgabe „{name}“ im Aufgabenplaner um oder löschen Sie sie, und klicken Sie dann auf „Neuer Versuch“.",
|
|
168
|
+
"error.root_cancelled": "Die Passwortbestätigung wurde abgebrochen. Es wurde keine Aktion ausgeführt.",
|
|
169
|
+
"error.root_not_ready": "Geben Sie diesen Vorgang zuerst frei.",
|
|
170
|
+
"error.root_task_failed": "Die Aufgabe wurde mit einem Fehler beendet. Prüfen Sie ihren Verlauf im Aufgabenplaner, und klicken Sie dann auf „Neuer Versuch“.",
|
|
171
|
+
"error.root_timeout": "Die Aufgabe wurde nicht rechtzeitig beendet. Prüfen Sie sie im Aufgabenplaner, und klicken Sie dann auf „Neuer Versuch“.",
|
|
172
|
+
"error.root_verify_failed": "Der Aufgabenplaner zeigt die erwartete Aufgabe nicht. Klicken Sie auf „Neuer Versuch“.",
|
|
173
|
+
"error.default": "Der Vorgang ist fehlgeschlagen ({code}). Klicken Sie auf „Neuer Versuch“.",
|
|
174
|
+
},
|
|
175
|
+
fr: {
|
|
176
|
+
title: "Autorisation de l'administrateur",
|
|
177
|
+
intro: "Ce paquet peut exécuter l'opération fixe « {op} » en tant que root. Un administrateur DSM l'approuve une fois avec son mot de passe. DSM la conserve ensuite comme tâche désactivée dans le Planificateur de tâches, qui ne s'exécute que lorsqu'un administrateur clique ici sur « Exécuter ».",
|
|
178
|
+
status: "Statut",
|
|
179
|
+
last_run: "Dernière heure d'exécution",
|
|
180
|
+
never: "Pas encore exécutée",
|
|
181
|
+
output: "Résultat",
|
|
182
|
+
"state.checking": "Chargement...",
|
|
183
|
+
"state.missing": "Non autorisée",
|
|
184
|
+
"state.ready": "Autorisée",
|
|
185
|
+
"state.outdated": "Le paquet a été mis à jour et doit être autorisé de nouveau",
|
|
186
|
+
"state.conflict": "Une autre tâche du Planificateur de tâches utilise déjà le nom « {name} »",
|
|
187
|
+
authorize: "Autoriser",
|
|
188
|
+
run: "Exécuter",
|
|
189
|
+
remove: "Supprimer",
|
|
190
|
+
retry: "Réessayer",
|
|
191
|
+
completed: "Terminé",
|
|
192
|
+
cancelled: "L'autorisation a été annulée. Rien n'a été créé.",
|
|
193
|
+
admin_only: "Seuls les comptes administrateur peuvent effectuer cette opération.",
|
|
194
|
+
uninstall_hint: "Avant de désinstaller ce paquet, cliquez sur « Supprimer » pour retirer sa tâche du Planificateur de tâches.",
|
|
195
|
+
"error.root_conflict": "Renommez ou supprimez la tâche « {name} » dans le Planificateur de tâches, puis cliquez sur « Réessayer ».",
|
|
196
|
+
"error.root_cancelled": "La confirmation du mot de passe a été annulée. Aucune opération n’a été exécutée.",
|
|
197
|
+
"error.root_not_ready": "Autorisez d'abord cette opération.",
|
|
198
|
+
"error.root_task_failed": "La tâche s'est terminée avec une erreur. Consultez son historique dans le Planificateur de tâches, puis cliquez sur « Réessayer ».",
|
|
199
|
+
"error.root_timeout": "La tâche ne s'est pas terminée à temps. Vérifiez-la dans le Planificateur de tâches, puis cliquez sur « Réessayer ».",
|
|
200
|
+
"error.root_verify_failed": "Le Planificateur de tâches n'affiche pas la tâche attendue. Cliquez sur « Réessayer ».",
|
|
201
|
+
"error.default": "L'opération a échoué ({code}). Cliquez sur « Réessayer ».",
|
|
202
|
+
},
|
|
203
|
+
es: {
|
|
204
|
+
title: "Autorización del administrador",
|
|
205
|
+
intro: "Este paquete puede ejecutar la operación fija «{op}» como root. Un administrador de DSM la aprueba una vez con su contraseña. Después, DSM la conserva como una tarea desactivada en el Programador de tareas que solo se ejecuta cuando un administrador hace clic aquí en «Ejecutar».",
|
|
206
|
+
status: "Estado",
|
|
207
|
+
last_run: "Hora de la última ejecución",
|
|
208
|
+
never: "Aún no se ha ejecutado",
|
|
209
|
+
output: "Resultado",
|
|
210
|
+
"state.checking": "Cargando...",
|
|
211
|
+
"state.missing": "No autorizada",
|
|
212
|
+
"state.ready": "Autorizada",
|
|
213
|
+
"state.outdated": "El paquete se actualizó y debe autorizarse de nuevo",
|
|
214
|
+
"state.conflict": "Otra tarea del Programador de tareas ya usa el nombre «{name}»",
|
|
215
|
+
authorize: "Autorizar",
|
|
216
|
+
run: "Ejecutar",
|
|
217
|
+
remove: "Quitar",
|
|
218
|
+
retry: "Volver a intentar",
|
|
219
|
+
completed: "Finalizado",
|
|
220
|
+
cancelled: "Se canceló la autorización. No se creó nada.",
|
|
221
|
+
admin_only: "Solo las cuentas de administrador pueden realizar esta operación.",
|
|
222
|
+
uninstall_hint: "Antes de desinstalar este paquete, haga clic en «Quitar» para eliminar su tarea del Programador de tareas.",
|
|
223
|
+
"error.root_conflict": "Cambie el nombre de la tarea «{name}» o elimínela en el Programador de tareas y, a continuación, haga clic en «Volver a intentar».",
|
|
224
|
+
"error.root_cancelled": "Se canceló la confirmación de la contraseña. No se ejecutó ninguna operación.",
|
|
225
|
+
"error.root_not_ready": "Primero autorice esta operación.",
|
|
226
|
+
"error.root_task_failed": "La tarea terminó con un error. Consulte su historial en el Programador de tareas y, a continuación, haga clic en «Volver a intentar».",
|
|
227
|
+
"error.root_timeout": "La tarea no terminó a tiempo. Revísela en el Programador de tareas y, a continuación, haga clic en «Volver a intentar».",
|
|
228
|
+
"error.root_verify_failed": "El Programador de tareas no muestra la tarea esperada. Haga clic en «Volver a intentar».",
|
|
229
|
+
"error.default": "Error en la operación ({code}). Haga clic en «Volver a intentar».",
|
|
230
|
+
},
|
|
231
|
+
it: {
|
|
232
|
+
title: "Autorizzazione dell'amministratore",
|
|
233
|
+
intro: "Questo pacchetto può eseguire l'operazione fissa \"{op}\" come root. Un amministratore DSM la approva una volta con la propria password. DSM la conserva quindi come attività disattivata in Utilità di pianificazione, che viene eseguita solo quando un amministratore fa clic qui su \"Esegui\".",
|
|
234
|
+
status: "Stato",
|
|
235
|
+
last_run: "Ora ultima esecuzione",
|
|
236
|
+
never: "Non ancora eseguita",
|
|
237
|
+
output: "Risultato",
|
|
238
|
+
"state.checking": "Caricamento...",
|
|
239
|
+
"state.missing": "Non autorizzata",
|
|
240
|
+
"state.ready": "Autorizzata",
|
|
241
|
+
"state.outdated": "Il pacchetto è stato aggiornato e deve essere autorizzato di nuovo",
|
|
242
|
+
"state.conflict": "Un'altra attività in Utilità di pianificazione usa già il nome \"{name}\"",
|
|
243
|
+
authorize: "Autorizza",
|
|
244
|
+
run: "Esegui",
|
|
245
|
+
remove: "Rimuovi",
|
|
246
|
+
retry: "Riprova",
|
|
247
|
+
completed: "Completato",
|
|
248
|
+
cancelled: "Autorizzazione annullata. Non è stato creato nulla.",
|
|
249
|
+
admin_only: "Solo gli account administrator possono eseguire questa operazione.",
|
|
250
|
+
uninstall_hint: "Prima di disinstallare questo pacchetto, fare clic su \"Rimuovi\" per eliminare la sua attività da Utilità di pianificazione.",
|
|
251
|
+
"error.root_conflict": "Rinominare o eliminare l'attività \"{name}\" in Utilità di pianificazione, quindi fare clic su \"Riprova\".",
|
|
252
|
+
"error.root_cancelled": "La conferma della password è stata annullata. Nessuna operazione è stata eseguita.",
|
|
253
|
+
"error.root_not_ready": "Autorizzare prima questa operazione.",
|
|
254
|
+
"error.root_task_failed": "L'attività è terminata con un errore. Controllarne la cronologia in Utilità di pianificazione, quindi fare clic su \"Riprova\".",
|
|
255
|
+
"error.root_timeout": "L'attività non è terminata in tempo. Controllarla in Utilità di pianificazione, quindi fare clic su \"Riprova\".",
|
|
256
|
+
"error.root_verify_failed": "Utilità di pianificazione non mostra l'attività prevista. Fare clic su \"Riprova\".",
|
|
257
|
+
"error.default": "Operazione non riuscita ({code}). Fare clic su \"Riprova\".",
|
|
258
|
+
},
|
|
259
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { StandaloneError } from "./manifest.js";
|
|
2
|
+
/**
|
|
3
|
+
* Root operations of a `privilege: root` Standalone Package. Each
|
|
4
|
+
* `root/<name>.sh` becomes the fixed script of one disabled DSM Task
|
|
5
|
+
* Scheduler task owned by root, which a DSM administrator creates through
|
|
6
|
+
* DSM's own password confirmation and runs on demand. The package itself
|
|
7
|
+
* never runs as root and nothing it can write is ever executed as root.
|
|
8
|
+
*/
|
|
9
|
+
export interface RootOp {
|
|
10
|
+
name: string;
|
|
11
|
+
body: string;
|
|
12
|
+
/** Internal generator flag for protected helper control output. */
|
|
13
|
+
protectedOutput?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type RootOpsResult = {
|
|
16
|
+
ok: true;
|
|
17
|
+
ops: RootOp[];
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
errors: StandaloneError[];
|
|
21
|
+
};
|
|
22
|
+
export declare const ROOT_OPS_DIR = "root";
|
|
23
|
+
export declare const ROOT_OP_END = "SYNOPKGLAND_ROOT_OP_END";
|
|
24
|
+
export declare function rootTaskName(packageId: string, op: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* The fixed start of an operation's task text. It does not carry the version,
|
|
27
|
+
* so the window can tell its own outdated task from someone else's.
|
|
28
|
+
*/
|
|
29
|
+
export declare function rootTaskHeader(packageId: string, op: string): string;
|
|
30
|
+
/** Root-owned tmpfs folder the tasks write to; the package account can only read it. */
|
|
31
|
+
export declare function rootOutputDir(packageId: string): string;
|
|
32
|
+
export declare function loadRootOps(dir: string): RootOpsResult;
|
|
33
|
+
/**
|
|
34
|
+
* The exact text of the DSM task. The body runs from a quoted here-document
|
|
35
|
+
* (no expansion) and its stdout replaces `<op>.out` in the root-owned run
|
|
36
|
+
* folder. The package version is part of the text, so every upgrade changes
|
|
37
|
+
* what the administrator approved and needs approval again.
|
|
38
|
+
*/
|
|
39
|
+
export declare function renderRootTaskScript(manifest: {
|
|
40
|
+
package: string;
|
|
41
|
+
spkVersion: string;
|
|
42
|
+
}, op: RootOp): string;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { existsSync, lstatSync, readdirSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
export const ROOT_OPS_DIR = "root";
|
|
4
|
+
export const ROOT_OP_END = "SYNOPKGLAND_ROOT_OP_END";
|
|
5
|
+
const MAX_ROOT_OP_BYTES = 16 * 1024;
|
|
6
|
+
const OP_FILE = /^([a-z][a-z0-9_]{0,31})\.sh$/;
|
|
7
|
+
export function rootTaskName(packageId, op) {
|
|
8
|
+
return `${packageId} root: ${op}`;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The fixed start of an operation's task text. It does not carry the version,
|
|
12
|
+
* so the window can tell its own outdated task from someone else's.
|
|
13
|
+
*/
|
|
14
|
+
export function rootTaskHeader(packageId, op) {
|
|
15
|
+
return `#!/bin/sh\n# synopkgland root operation "${op}" of ${packageId} `;
|
|
16
|
+
}
|
|
17
|
+
/** Root-owned tmpfs folder the tasks write to; the package account can only read it. */
|
|
18
|
+
export function rootOutputDir(packageId) {
|
|
19
|
+
return `/run/synopkgland-${packageId}`;
|
|
20
|
+
}
|
|
21
|
+
export function loadRootOps(dir) {
|
|
22
|
+
const names = existsSync(dir) ? readdirSync(dir).sort() : [];
|
|
23
|
+
if (names.length === 0) {
|
|
24
|
+
return {
|
|
25
|
+
ok: false,
|
|
26
|
+
errors: [{ code: "STANDALONE_ROOT_OPS_MISSING", message: `privilege: root 需要 ${ROOT_OPS_DIR}/<名稱>.sh,至少一個 root 操作。` }],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const errors = [];
|
|
30
|
+
const ops = [];
|
|
31
|
+
for (const file of names) {
|
|
32
|
+
const op = readRootOp(join(dir, file), file);
|
|
33
|
+
if ("error" in op) {
|
|
34
|
+
errors.push({ code: "STANDALONE_ROOT_OP_INVALID", message: `${ROOT_OPS_DIR}/${file}:${op.error}` });
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
ops.push(op);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return errors.length === 0 ? { ok: true, ops } : { ok: false, errors };
|
|
41
|
+
}
|
|
42
|
+
function readRootOp(path, file) {
|
|
43
|
+
const name = OP_FILE.exec(file)?.[1];
|
|
44
|
+
if (!name) {
|
|
45
|
+
return { error: "檔名必須是小寫英數與底線組成的 <名稱>.sh(最多 32 字元),此資料夾不放其他檔案。" };
|
|
46
|
+
}
|
|
47
|
+
const stat = lstatSync(path);
|
|
48
|
+
if (!stat.isFile()) {
|
|
49
|
+
return { error: "必須是一般檔案(不可是 symlink 或資料夾)。" };
|
|
50
|
+
}
|
|
51
|
+
if (stat.size > MAX_ROOT_OP_BYTES) {
|
|
52
|
+
return { error: `不可超過 ${MAX_ROOT_OP_BYTES} bytes。` };
|
|
53
|
+
}
|
|
54
|
+
const body = readFileSync(path, "utf8");
|
|
55
|
+
if (!body.startsWith("#!/bin/sh\n") || body.includes("\0") || body.includes("�")) {
|
|
56
|
+
return { error: "必須是以 #!/bin/sh 開頭的 UTF-8 文字 script。" };
|
|
57
|
+
}
|
|
58
|
+
if (body.split("\n").includes(ROOT_OP_END)) {
|
|
59
|
+
return { error: `不可包含單獨一行的 ${ROOT_OP_END}。` };
|
|
60
|
+
}
|
|
61
|
+
return { name, body };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The exact text of the DSM task. The body runs from a quoted here-document
|
|
65
|
+
* (no expansion) and its stdout replaces `<op>.out` in the root-owned run
|
|
66
|
+
* folder. The package version is part of the text, so every upgrade changes
|
|
67
|
+
* what the administrator approved and needs approval again.
|
|
68
|
+
*/
|
|
69
|
+
export function renderRootTaskScript(manifest, op) {
|
|
70
|
+
const body = op.body.endsWith("\n") ? op.body : `${op.body}\n`;
|
|
71
|
+
return `${rootTaskHeader(manifest.package, op.name)}${manifest.spkVersion}.
|
|
72
|
+
# Approved by a DSM administrator; runs only when this task is run.
|
|
73
|
+
set -eu
|
|
74
|
+
umask 022
|
|
75
|
+
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
|
76
|
+
export PATH
|
|
77
|
+
dir=${rootOutputDir(manifest.package)}
|
|
78
|
+
${op.protectedOutput ? `[ "$(id -u)" = 0 ]
|
|
79
|
+
[ ! -L /run ] && [ "$(stat -c %u /run)" = 0 ]
|
|
80
|
+
[ ! -L "$dir" ]
|
|
81
|
+
if [ ! -e "$dir" ]; then mkdir -m 0755 "$dir"; fi
|
|
82
|
+
[ -d "$dir" ] && [ "$(stat -c %u "$dir")" = 0 ]
|
|
83
|
+
output_mode=$(stat -c %a "$dir")
|
|
84
|
+
[ "$((0$output_mode & 0022))" = 0 ]
|
|
85
|
+
` : `if [ -L "$dir" ] || [ ! -d "$dir" ]; then
|
|
86
|
+
rm -f "$dir"
|
|
87
|
+
mkdir -m 0755 "$dir"
|
|
88
|
+
fi
|
|
89
|
+
`}tmp=$(mktemp "$dir/.${op.name}.XXXXXX")
|
|
90
|
+
if /bin/sh -eu >"$tmp" <<'${ROOT_OP_END}'
|
|
91
|
+
${body}${ROOT_OP_END}
|
|
92
|
+
then
|
|
93
|
+
chmod 0644 "$tmp"
|
|
94
|
+
mv -f "$tmp" "$dir/${op.name}.out"
|
|
95
|
+
else
|
|
96
|
+
status=$?
|
|
97
|
+
rm -f "$tmp"
|
|
98
|
+
exit "$status"
|
|
99
|
+
fi
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type RootOp } from "./root-ops.js";
|
|
2
|
+
/** What the window embeds per root operation: the task it may create, and how to recognize it. */
|
|
3
|
+
export interface RootTask {
|
|
4
|
+
op: string;
|
|
5
|
+
name: string;
|
|
6
|
+
header: string;
|
|
7
|
+
script: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function rootTasks(manifest: {
|
|
10
|
+
package: string;
|
|
11
|
+
spkVersion: string;
|
|
12
|
+
rootOps?: RootOp[];
|
|
13
|
+
}): RootTask[];
|
|
14
|
+
/**
|
|
15
|
+
* `createRootAccess(options)` → `{ state, authorize, run, remove }`, plain
|
|
16
|
+
* ES5 for DSM's desktop. Every DSM call goes through `options.send` (the
|
|
17
|
+
* AppWindow's sendWebAPI) as the signed-in administrator:
|
|
18
|
+
*
|
|
19
|
+
* - authorize: DSM's own password confirmation, then one disabled root task
|
|
20
|
+
* with exactly the embedded script. The one-use token goes into that single
|
|
21
|
+
* create call and is never kept.
|
|
22
|
+
* - run: re-reads the task and runs it only if it is still exactly ours, then
|
|
23
|
+
* waits for its history entry and asks the backend for the output. Repair
|
|
24
|
+
* additionally requires fresh PasswordConfirm and another exact task check.
|
|
25
|
+
* - an older version of our task is "outdated" and never runs; authorizing
|
|
26
|
+
* again replaces it. A same-named task that is not ours is a "conflict" and
|
|
27
|
+
* is never run, replaced or deleted.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ROOT_RUNTIME = "function createRootAccess(options) {\n var API = \"SYNO.Core.TaskScheduler\";\n var POLL_MS = 500, POLLS = 60;\n var byOp = {};\n options.tasks.forEach(function (task) { byOp[task.op] = task; });\n\n function fail(code) {\n var error = new Error(code);\n error.code = code;\n return error;\n }\n function begin(op) {\n if (!Object.prototype.hasOwnProperty.call(byOp, op)) return Promise.reject(fail(\"root_unknown_op\"));\n if (options.user().admin !== true) return Promise.reject(fail(\"admin_required\"));\n return Promise.resolve(byOp[op]);\n }\n function isRootTask(summary) {\n return summary.owner === \"root\" && summary.real_owner === \"root\" && summary.enable === false && summary.type === \"script\";\n }\n function find(task) {\n return options.send(API, \"list\", 3, { start: 0, limit: 500 }).then(function (data) {\n if (!data || !Array.isArray(data.tasks)) throw fail(\"root_bad_response\");\n var named = data.tasks.filter(function (summary) { return summary && summary.name === task.name; });\n if (named.length === 0) return { state: \"missing\" };\n if (named.length > 1 || !isRootTask(named[0])) return { state: \"conflict\" };\n var ref = { id: named[0].id, real_owner: named[0].real_owner };\n return options.send(API, \"get\", 4, ref).then(function (detail) {\n var script = detail && detail.extra && detail.extra.script;\n if (!detail || String(detail.id) !== String(ref.id) || detail.name !== task.name\n || detail.owner !== \"root\" || detail.enable !== false || detail.type !== \"script\" || typeof script !== \"string\") {\n return { state: \"conflict\" };\n }\n if (script === task.script) return { state: \"ready\", ref: ref };\n if (script.indexOf(task.header) === 0) return { state: \"outdated\", ref: ref };\n return { state: \"conflict\" };\n });\n });\n }\n function definition(task, user) {\n var hours = [];\n for (var h = 1; h <= 23; h++) hours.push(h);\n return {\n name: task.name,\n real_owner: user,\n owner: \"root\",\n enable: false,\n type: \"script\",\n schedule: {\n date_type: 0, week_day: \"0,1,2,3,4,5,6\", repeat_date: 1001, monthly_week: [], hour: 0, minute: 0,\n repeat_hour: 0, repeat_min: 0, last_work_hour: 0,\n repeat_min_store_config: [1, 5, 10, 15, 20, 30], repeat_hour_store_config: hours\n },\n extra: { notify_enable: false, script: task.script, notify_mail: \"\", notify_if_error: false }\n };\n }\n function newest(history) {\n if (!Array.isArray(history)) throw fail(\"root_bad_response\");\n return history.reduce(function (latest, entry) {\n return entry && (!latest || Number(entry.timestamp) > Number(latest.timestamp)) ? entry : latest;\n }, null);\n }\n function history(ref) {\n return options.send(API, \"get_history_status_list\", 1, { id: ref.id }).then(newest);\n }\n function waitForRun(ref, before, polls) {\n return history(ref).then(function (latest) {\n var finished = latest && (!before || latest.timestamp !== before.timestamp)\n && latest.exit_type !== \"running\" && latest.stop_time;\n if (finished) {\n if (latest.exit_code !== 0) throw fail(\"root_task_failed\");\n return;\n }\n if (polls <= 1) throw fail(\"root_timeout\");\n return options.wait(POLL_MS).then(function () { return waitForRun(ref, before, polls - 1); });\n });\n }\n\n return {\n state: function (op) {\n return begin(op).then(find).then(function (found) { return found.state; });\n },\n authorize: function (op) {\n return begin(op).then(function (task) {\n return find(task).then(function (found) {\n if (found.state === \"ready\") return \"ready\";\n if (found.state === \"conflict\") throw fail(\"root_conflict\");\n return options.confirmPassword().then(function (token) {\n if (!token) return \"cancelled\";\n var params = definition(task, options.user().name);\n params.SynoConfirmPWToken = token;\n var replaced = found.state === \"outdated\"\n ? options.send(API, \"delete\", 2, { tasks: [found.ref] })\n : Promise.resolve();\n return replaced.then(function () {\n return options.send(API + \".Root\", \"create\", 4, params);\n }).then(function () {\n return find(task);\n }).then(function (after) {\n if (after.state !== \"ready\") throw fail(\"root_verify_failed\");\n return \"ready\";\n });\n });\n });\n });\n },\n run: function (op) {\n return begin(op).then(function (task) {\n return find(task).then(function (found) {\n if (found.state !== \"ready\") throw fail(\"root_not_ready\");\n // Repair requires fresh interactive consent even for a retained task.\n // Confirmation tokens are never cached or reused as scheduler tokens.\n var consent = op === \"helper_repair\" ? options.confirmPassword() : Promise.resolve(true);\n return consent.then(function (token) {\n if (!token) throw fail(\"root_cancelled\");\n // The user may leave the dialog open while the scheduler changes.\n return op === \"helper_repair\" ? begin(op).then(find) : found;\n }).then(function (verified) {\n if (verified.state !== \"ready\") throw fail(\"root_not_ready\");\n return history(verified.ref).then(function (before) {\n return options.send(API, \"run\", 2, { tasks: [verified.ref] }).then(function () {\n return waitForRun(verified.ref, before, POLLS);\n });\n });\n });\n }).then(function () {\n return options.call(\"root.output\", { op: op });\n });\n });\n },\n remove: function (op) {\n return begin(op).then(function (task) {\n return find(task).then(function (found) {\n if (found.state === \"missing\") return \"missing\";\n if (found.state === \"conflict\") throw fail(\"root_conflict\");\n return options.send(API, \"delete\", 2, { tasks: [found.ref] }).then(function () {\n return find(task);\n }).then(function (after) {\n if (after.state !== \"missing\") throw fail(\"root_verify_failed\");\n return \"missing\";\n });\n });\n });\n },\n output: function (op) {\n return begin(op).then(function () {\n return options.call(\"root.output\", { op: op });\n });\n }\n };\n}";
|
|
30
|
+
/**
|
|
31
|
+
* The authorization panel the window shows above the app for each root
|
|
32
|
+
* operation, identical in every package. `rootPanelView(model)` decides what
|
|
33
|
+
* it shows; `mountRootPanel(host, access, i18n, tasks, admin)` draws it with
|
|
34
|
+
* DOM text nodes only (no HTML from data).
|
|
35
|
+
*/
|
|
36
|
+
export declare const ROOT_PANEL = "function rootPanelShowsResult(state) {\n return state === \"ready\" || state === \"outdated\";\n}\n\nfunction rootPanelView(model) {\n if (!model.admin) return { status: null, buttons: [], message: { key: \"admin_only\" } };\n function buttons(actions) {\n return actions.map(function (action) { return { action: action, disabled: model.busy === true }; });\n }\n if (model.error) {\n return {\n status: \"state.\" + model.state, buttons: buttons([\"retry\"]),\n message: { key: \"error.\" + model.error, params: { name: model.name, code: model.error } }\n };\n }\n var message = model.notice ? { key: model.notice } : null;\n switch (model.state) {\n case \"missing\":\n return { status: \"state.missing\", buttons: buttons([\"authorize\"]), message: message };\n case \"outdated\":\n return { status: \"state.outdated\", buttons: buttons([\"authorize\", \"remove\"]), message: message };\n case \"ready\":\n return { status: \"state.ready\", buttons: buttons([\"run\", \"remove\"]), message: message };\n case \"conflict\":\n return { status: \"state.conflict\", buttons: buttons([\"retry\"]), message: { key: \"error.root_conflict\", params: { name: model.name } } };\n default:\n return { status: \"state.checking\", buttons: [], message: null };\n }\n}\n\nfunction mountRootPanel(host, access, i18n, tasks, admin) {\n var t = i18n.t;\n function el(tag, className, text) {\n var node = document.createElement(tag);\n if (className) node.className = className;\n if (text !== undefined) node.textContent = text;\n return node;\n }\n function say(message) {\n if (!message) return \"\";\n var text = t(message.key, message.params);\n return text === message.key && message.key.indexOf(\"error.\") === 0 ? t(\"error.default\", message.params) : text;\n }\n tasks.forEach(function (task) {\n var model = { admin: admin, name: task.name, state: \"checking\", busy: false, error: null, notice: null };\n var result = null;\n var section = el(\"section\", \"dsmapp-rootpanel\");\n host.appendChild(section);\n\n function render() {\n var view = rootPanelView(model);\n while (section.firstChild) section.removeChild(section.firstChild);\n section.appendChild(el(\"h2\", null, t(\"title\")));\n section.appendChild(el(\"p\", null, t(\"intro\", { op: task.op })));\n if (view.status) {\n var facts = el(\"dl\");\n facts.appendChild(el(\"dt\", null, t(\"status\")));\n facts.appendChild(el(\"dd\", \"dsmapp-rootpanel-state\", t(view.status, { name: task.name })));\n facts.appendChild(el(\"dt\", null, t(\"last_run\")));\n facts.appendChild(el(\"dd\", null, result && result.modified\n ? new Date(result.modified * 1000).toLocaleString(i18n.locale) : t(\"never\")));\n section.appendChild(facts);\n }\n if (view.message) section.appendChild(el(\"p\", \"dsmapp-rootpanel-message\", say(view.message)));\n if (result && typeof result.output === \"string\") {\n section.appendChild(el(\"div\", \"dsmapp-rootpanel-label\", t(\"output\")));\n section.appendChild(el(\"pre\", \"dsmapp-rootpanel-output\", result.output));\n }\n var actions = el(\"div\", \"dsmapp-rootpanel-actions\");\n view.buttons.forEach(function (button) {\n var node = el(\"button\", button.action === \"remove\" ? null : \"dsmapp-rootpanel-primary\", t(button.action));\n node.type = \"button\";\n node.disabled = button.disabled;\n node.onclick = function () { act(button.action); };\n actions.appendChild(node);\n });\n section.appendChild(actions);\n if (admin && rootPanelShowsResult(model.state)) section.appendChild(el(\"p\", \"dsmapp-rootpanel-hint\", t(\"uninstall_hint\")));\n }\n function settle(promise, notice) {\n model.busy = true;\n model.error = null;\n model.notice = null;\n render();\n return promise.then(function (value) {\n model.notice = typeof notice === \"function\" ? notice(value) : notice;\n }, function (error) {\n if (error && error.code === \"root_cancelled\") model.notice = \"cancelled\";\n else model.error = (error && error.code) || \"unknown\";\n }).then(function () {\n model.busy = false;\n render();\n });\n }\n function refresh(notice) {\n return settle(access.state(task.op).then(function (state) {\n model.state = state;\n if (!rootPanelShowsResult(state)) return;\n return access.output(task.op).then(function (out) { result = out; });\n }), notice);\n }\n function refreshAfterChange() {\n return model.error ? null : refresh(model.notice);\n }\n function act(action) {\n if (action === \"retry\") return refresh(null);\n if (action === \"authorize\") {\n return settle(access.authorize(task.op), function (outcome) {\n return outcome === \"cancelled\" ? \"cancelled\" : null;\n }).then(refreshAfterChange);\n }\n if (action === \"run\") {\n return settle(access.run(task.op).then(function (out) { result = out; }), \"completed\");\n }\n if (action === \"remove\") {\n return settle(access.remove(task.op).then(function () { result = null; }), null).then(refreshAfterChange);\n }\n }\n render();\n if (admin) refresh(null);\n });\n}";
|