@synopackageland/cli 0.8.0 → 0.9.0
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/CHANGELOG.md +124 -0
- package/README.md +26 -4
- package/dist/add.js +4 -17
- package/dist/authorization-sdk.d.ts +0 -1
- package/dist/authorization-sdk.js +0 -1
- package/dist/build-spk/gateway.js +2 -2
- package/dist/build-spk/notices.js +12 -8
- package/dist/capability-overlays.d.ts +15 -0
- package/dist/capability-overlays.js +18 -0
- package/dist/cli-version.d.ts +2 -0
- package/dist/cli-version.js +3 -0
- package/dist/cli.js +3 -1
- package/dist/error-registry.js +12 -4
- package/dist/info.js +2 -1
- package/dist/init.js +52 -58
- package/dist/reproducible.js +1 -1
- package/dist/runtime/delegate-contract.d.ts +15 -0
- package/dist/runtime/delegate-contract.js +2 -0
- package/dist/runtime/executor-build.d.ts +15 -1
- package/dist/runtime/executor-build.js +42 -11
- package/dist/runtime/executor-digests.json +13 -0
- package/dist/runtime/executor-inspect.d.ts +1 -0
- package/dist/runtime/executor-inspect.js +5 -2
- package/dist/runtime/executor-policy.d.ts +3 -1
- package/dist/runtime/executor-policy.js +7 -2
- package/dist/runtime/executor-source.d.ts +21 -0
- package/dist/runtime/executor-source.js +35 -0
- package/dist/runtime/executor-tasks.d.ts +5 -2
- package/dist/runtime/executor-tasks.js +6 -4
- package/dist/runtime/sdk-source.d.ts +31 -0
- package/dist/runtime/sdk-source.js +92 -0
- package/dist/standalone/api-permissions.d.ts +4 -1
- package/dist/standalone/api-permissions.js +10 -18
- package/dist/standalone/build.d.ts +1 -0
- package/dist/standalone/build.js +11 -4
- package/dist/standalone/daemon.js +2 -2
- package/dist/standalone/dsm-window.js +2 -2
- package/dist/standalone/manifest.d.ts +5 -2
- package/dist/standalone/manifest.js +9 -3
- package/dist/standalone/root-window.d.ts +1 -1
- package/dist/standalone/root-window.js +0 -1
- package/dist/standalone/sdk-check.d.ts +9 -0
- package/dist/standalone/sdk-check.js +43 -0
- package/dist/standalone/spk.js +1 -1
- package/dist/template-paths.d.ts +7 -2
- package/dist/template-paths.js +18 -6
- package/package.json +13 -3
- package/dist/templates/_executor/README.md +0 -318
- package/dist/templates/_executor/anchor.go +0 -156
- package/dist/templates/_executor/anchor_test.go +0 -161
- package/dist/templates/_executor/apppriv_review_test.go +0 -28
- package/dist/templates/_executor/auth_presence_review_test.go +0 -38
- package/dist/templates/_executor/cancel_contract_test.go +0 -236
- package/dist/templates/_executor/cmd/lifecycle/main.go +0 -42
- package/dist/templates/_executor/cookie_review_test.go +0 -27
- package/dist/templates/_executor/copy.go +0 -64
- package/dist/templates/_executor/copy_test.go +0 -88
- package/dist/templates/_executor/digest_review_test.go +0 -120
- package/dist/templates/_executor/directories.go +0 -40
- package/dist/templates/_executor/dsm.go +0 -369
- package/dist/templates/_executor/dsm_test.go +0 -290
- package/dist/templates/_executor/executor.go +0 -735
- package/dist/templates/_executor/executor_test.go +0 -314
- package/dist/templates/_executor/go.mod +0 -5
- package/dist/templates/_executor/identity.go +0 -74
- package/dist/templates/_executor/identity_kernel_linux_test.go +0 -60
- package/dist/templates/_executor/identity_linux.go +0 -82
- package/dist/templates/_executor/identity_security_test.go +0 -43
- package/dist/templates/_executor/internal/lifecycle/lifecycle.go +0 -95
- package/dist/templates/_executor/internal/lifecycle/lifecycle_test.go +0 -232
- package/dist/templates/_executor/internal/taskscript/boot.sh +0 -31
- package/dist/templates/_executor/internal/taskscript/cmd/main.go +0 -19
- package/dist/templates/_executor/internal/taskscript/control.sh +0 -31
- package/dist/templates/_executor/internal/taskscript/tasks.go +0 -44
- package/dist/templates/_executor/json_review_test.go +0 -40
- package/dist/templates/_executor/lifecycle_test.go +0 -97
- package/dist/templates/_executor/link_linux.go +0 -28
- package/dist/templates/_executor/long_running_test.go +0 -530
- package/dist/templates/_executor/main.go +0 -576
- package/dist/templates/_executor/managed.go +0 -117
- package/dist/templates/_executor/managed_test.go +0 -137
- package/dist/templates/_executor/move_linux.go +0 -490
- package/dist/templates/_executor/move_linux_test.go +0 -460
- package/dist/templates/_executor/move_validation.go +0 -46
- package/dist/templates/_executor/move_validation_test.go +0 -187
- package/dist/templates/_executor/operations.go +0 -926
- package/dist/templates/_executor/path_test.go +0 -35
- package/dist/templates/_executor/pid.go +0 -37
- package/dist/templates/_executor/pid_test.go +0 -113
- package/dist/templates/_executor/platform_linux.go +0 -187
- package/dist/templates/_executor/platform_linux_test.go +0 -191
- package/dist/templates/_executor/platform_other.go +0 -76
- package/dist/templates/_executor/process.go +0 -142
- package/dist/templates/_executor/purge_log.go +0 -18
- package/dist/templates/_executor/records.go +0 -242
- package/dist/templates/_executor/scope_cancel_contract_test.go +0 -91
- package/dist/templates/_executor/scope_client.go +0 -37
- package/dist/templates/_executor/scope_contract.go +0 -12
- package/dist/templates/_executor/selected_scope.go +0 -146
- package/dist/templates/_executor/selected_scope_test.go +0 -186
- package/dist/templates/_executor/socket_linux_test.go +0 -46
- package/dist/templates/_executor/status_disabled_test.go +0 -33
- package/dist/templates/_executor/store.go +0 -91
- package/dist/templates/_executor/supervise.go +0 -109
- package/dist/templates/_executor/supervise_test.go +0 -130
- package/dist/templates/_executor/task_race_review_test.go +0 -47
- package/dist/templates/_executor/tasks.go +0 -320
- package/dist/templates/_executor/tasks_dsm71_test.go +0 -114
- package/dist/templates/_executor/tasks_review_test.go +0 -43
- package/dist/templates/_executor/tasks_test.go +0 -223
- package/dist/templates/_executor/testdata/evidence/cleanup.json +0 -24
- package/dist/templates/_executor/testdata/evidence/final-smoke.jsonl +0 -9
- package/dist/templates/_executor/testdata/evidence/kernel-acl.json +0 -6
- package/dist/templates/_executor/testdata/evidence/linux-tests.log +0 -123
- package/dist/templates/_executor/testdata/evidence/live.jsonl +0 -23
- package/dist/templates/_executor/testdata/evidence/storage.json +0 -90
- package/dist/templates/_executor/testdata/evidence/validation.json +0 -55
- package/dist/templates/_executor/testdata/live_probe.py +0 -98
- package/dist/templates/_executor/upgrade_watch_test.go +0 -244
- package/dist/templates/_executor/watch.go +0 -164
- package/dist/templates/_executor/watch_test.go +0 -291
- package/dist/templates/_executor/write_review_linux_test.go +0 -87
- package/dist/templates/_shared/AGENTS.md +0 -146
- package/dist/templates/_shared/CLAUDE.md +0 -1
- package/dist/templates/_shared/third-party-notices.mjs +0 -51
- package/dist/templates/binary/LICENSES/GO-LICENSE +0 -27
- package/dist/templates/binary/LICENSES/GO-PATENTS +0 -22
- package/dist/templates/binary/dsm-package.yaml +0 -46
- package/dist/templates/binary/example/main.go +0 -16
- package/dist/templates/binary/gitignore +0 -2
- package/dist/templates/binary/i18n/messages/de.json +0 -4
- package/dist/templates/binary/i18n/messages/en.json +0 -4
- package/dist/templates/binary/i18n/messages/es.json +0 -4
- package/dist/templates/binary/i18n/messages/fr.json +0 -4
- package/dist/templates/binary/i18n/messages/it.json +0 -4
- package/dist/templates/binary/i18n/messages/ja.json +0 -4
- package/dist/templates/binary/i18n/messages/ko.json +0 -4
- package/dist/templates/binary/i18n/messages/zh-CN.json +0 -4
- package/dist/templates/binary/i18n/messages/zh-TW.json +0 -4
- package/dist/templates/binary/ui/app.css +0 -4
- package/dist/templates/binary/ui/app.js +0 -32
- package/dist/templates/compose/compose.yaml +0 -8
- package/dist/templates/compose/synology-app.yaml +0 -16
- package/dist/templates/native-authorization/AuthorizationGate.vue +0 -91
- package/dist/templates/native-authorization/i18n/de.json +0 -37
- package/dist/templates/native-authorization/i18n/en.json +0 -37
- package/dist/templates/native-authorization/i18n/es.json +0 -37
- package/dist/templates/native-authorization/i18n/fr.json +0 -37
- package/dist/templates/native-authorization/i18n/index.ts +0 -15
- package/dist/templates/native-authorization/i18n/it.json +0 -37
- package/dist/templates/native-authorization/i18n/ja.json +0 -37
- package/dist/templates/native-authorization/i18n/ko.json +0 -37
- package/dist/templates/native-authorization/i18n/zh-CN.json +0 -37
- package/dist/templates/native-authorization/i18n/zh-TW.json +0 -37
- package/dist/templates/native-go/README.md +0 -459
- package/dist/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +0 -61
- package/dist/templates/native-go/backend/cmd/app/main.go +0 -95
- package/dist/templates/native-go/backend/cmd/background-worker/main.go +0 -38
- package/dist/templates/native-go/backend/go.mod +0 -9
- package/dist/templates/native-go/backend/go.sum +0 -4
- package/dist/templates/native-go/backend/internal/api/cgi_framing_test.go +0 -32
- package/dist/templates/native-go/backend/internal/api/cookie_review_test.go +0 -28
- package/dist/templates/native-go/backend/internal/api/deadline_test.go +0 -114
- package/dist/templates/native-go/backend/internal/api/dsm-session.go +0 -54
- package/dist/templates/native-go/backend/internal/api/dsm-session_test.go +0 -51
- package/dist/templates/native-go/backend/internal/api/entry_test.go +0 -47
- package/dist/templates/native-go/backend/internal/api/errors.go +0 -47
- package/dist/templates/native-go/backend/internal/api/permissions.go +0 -161
- package/dist/templates/native-go/backend/internal/api/permissions.json +0 -5
- package/dist/templates/native-go/backend/internal/api/permissions_test.go +0 -113
- package/dist/templates/native-go/backend/internal/api/policy_fixture_test.go +0 -8
- package/dist/templates/native-go/backend/internal/api/registry.go +0 -142
- package/dist/templates/native-go/backend/internal/api/registry_test.go +0 -344
- package/dist/templates/native-go/backend/internal/api/resource_limits_test.go +0 -87
- package/dist/templates/native-go/backend/internal/api/sdk-permissions.json +0 -59
- package/dist/templates/native-go/backend/internal/api/sdk_policy_test.go +0 -31
- package/dist/templates/native-go/backend/internal/api/server.go +0 -305
- package/dist/templates/native-go/backend/internal/api/testdata/permissions-cases.json +0 -172
- package/dist/templates/native-go/backend/internal/app/background.go +0 -249
- package/dist/templates/native-go/backend/internal/app/background_none.go +0 -8
- package/dist/templates/native-go/backend/internal/app/background_owner.go +0 -38
- package/dist/templates/native-go/backend/internal/app/background_owner_test.go +0 -163
- package/dist/templates/native-go/backend/internal/app/background_schedule.go +0 -69
- package/dist/templates/native-go/backend/internal/app/background_schedule_test.go +0 -62
- package/dist/templates/native-go/backend/internal/app/background_test.go +0 -320
- package/dist/templates/native-go/backend/internal/app/delegate_config.go +0 -57
- package/dist/templates/native-go/backend/internal/app/delegate_config_test.go +0 -28
- package/dist/templates/native-go/backend/internal/app/delegate_none.go +0 -5
- package/dist/templates/native-go/backend/internal/app/identity.go +0 -20
- package/dist/templates/native-go/backend/internal/app/identity_test.go +0 -15
- package/dist/templates/native-go/backend/internal/app/migrations.go +0 -41
- package/dist/templates/native-go/backend/internal/app/migrations_test.go +0 -41
- package/dist/templates/native-go/backend/internal/app/portal.go +0 -30
- package/dist/templates/native-go/backend/internal/app/portal_test.go +0 -55
- package/dist/templates/native-go/backend/internal/app/root_none.go +0 -9
- package/dist/templates/native-go/backend/internal/app/routes.go +0 -137
- package/dist/templates/native-go/backend/internal/app/routes_test.go +0 -165
- package/dist/templates/native-go/backend/internal/app/session_files.go +0 -9
- package/dist/templates/native-go/backend/internal/app/session_files_test.go +0 -14
- package/dist/templates/native-go/backend/internal/app/shared_folder.go +0 -144
- package/dist/templates/native-go/backend/internal/app/shared_folder_test.go +0 -158
- package/dist/templates/native-go/backend/internal/background/access.go +0 -57
- package/dist/templates/native-go/backend/internal/background/lock_test.go +0 -131
- package/dist/templates/native-go/backend/internal/background/owner_test.go +0 -118
- package/dist/templates/native-go/backend/internal/background/runner.go +0 -185
- package/dist/templates/native-go/backend/internal/background/runner_test.go +0 -209
- package/dist/templates/native-go/backend/internal/background/schedule.go +0 -336
- package/dist/templates/native-go/backend/internal/background/schedule_test.go +0 -368
- package/dist/templates/native-go/backend/internal/background/store.go +0 -825
- package/dist/templates/native-go/backend/internal/background/store_test.go +0 -365
- package/dist/templates/native-go/backend/internal/datamigrate/migrate.go +0 -191
- package/dist/templates/native-go/backend/internal/datamigrate/migrate_test.go +0 -177
- package/dist/templates/native-go/backend/internal/dsm/admin.go +0 -76
- package/dist/templates/native-go/backend/internal/dsm/admin_linux.go +0 -110
- package/dist/templates/native-go/backend/internal/dsm/admin_linux_test.go +0 -105
- package/dist/templates/native-go/backend/internal/dsm/admin_other.go +0 -15
- package/dist/templates/native-go/backend/internal/dsm/admin_test.go +0 -67
- package/dist/templates/native-go/backend/internal/dsm/apppriv.go +0 -30
- package/dist/templates/native-go/backend/internal/dsm/auth.go +0 -94
- package/dist/templates/native-go/backend/internal/dsm/auth_test.go +0 -159
- package/dist/templates/native-go/backend/internal/dsm/bridge_file.go +0 -75
- package/dist/templates/native-go/backend/internal/dsm/bridge_file_test.go +0 -57
- package/dist/templates/native-go/backend/internal/dsm/entry.go +0 -177
- package/dist/templates/native-go/backend/internal/dsm/entry_test.go +0 -315
- package/dist/templates/native-go/backend/internal/dsm/native/admin-aarch64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin-armv7.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin-x86_64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/admin_check.c +0 -28
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-aarch64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-armv7.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv-x86_64.elf +0 -0
- package/dist/templates/native-go/backend/internal/dsm/native/apppriv_check.c +0 -33
- package/dist/templates/native-go/backend/internal/dsm/native/build.sh +0 -18
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/GLIBC-NOTICES.txt +0 -400
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/LGPL-2.1.txt +0 -501
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/SOURCE.txt +0 -5
- package/dist/templates/native-go/backend/internal/dsm/native/licenses/ZIG-MIT.txt +0 -21
- package/dist/templates/native-go/backend/internal/dsm/native/provenance.json +0 -18
- package/dist/templates/native-go/backend/internal/filestation/browse_test.go +0 -67
- package/dist/templates/native-go/backend/internal/filestation/check_permission.go +0 -71
- package/dist/templates/native-go/backend/internal/filestation/check_permission_test.go +0 -77
- package/dist/templates/native-go/backend/internal/filestation/client.go +0 -337
- package/dist/templates/native-go/backend/internal/filestation/client_test.go +0 -155
- package/dist/templates/native-go/backend/internal/filestation/doc.go +0 -4
- package/dist/templates/native-go/backend/internal/filestation/download_dsm71_test.go +0 -82
- package/dist/templates/native-go/backend/internal/filestation/http.go +0 -70
- package/dist/templates/native-go/backend/internal/filestation/http_test.go +0 -188
- package/dist/templates/native-go/backend/internal/filestation/operations_test.go +0 -206
- package/dist/templates/native-go/backend/internal/filestation/read_file_test.go +0 -89
- package/dist/templates/native-go/backend/internal/filestation/sdk_policy_test.go +0 -39
- package/dist/templates/native-go/backend/internal/filestation/service.go +0 -254
- package/dist/templates/native-go/backend/internal/filestation/service_test.go +0 -74
- package/dist/templates/native-go/backend/internal/filestation/upload_stream.go +0 -76
- package/dist/templates/native-go/backend/internal/filestation/upload_stream_test.go +0 -77
- package/dist/templates/native-go/backend/internal/filestation/write.go +0 -32
- package/dist/templates/native-go/backend/internal/filestation/write_test.go +0 -124
- package/dist/templates/native-go/backend/internal/identity/README.md +0 -59
- package/dist/templates/native-go/backend/internal/identity/dsm.go +0 -115
- package/dist/templates/native-go/backend/internal/identity/http.go +0 -291
- package/dist/templates/native-go/backend/internal/identity/identity_test.go +0 -530
- package/dist/templates/native-go/backend/internal/identity/service.go +0 -159
- package/dist/templates/native-go/backend/internal/identity/store.go +0 -109
- package/dist/templates/native-go/backend/internal/jsonlimits/limits.go +0 -48
- package/dist/templates/native-go/backend/internal/jsonlimits/limits_test.go +0 -52
- package/dist/templates/native-go/backend/internal/portal/portal.go +0 -138
- package/dist/templates/native-go/backend/internal/portal/portal_test.go +0 -89
- package/dist/templates/native-go/dsm-package.yaml +0 -71
- package/dist/templates/native-go/gitignore +0 -1
- package/dist/templates/native-go/i18n/glossary.json +0 -663
- package/dist/templates/native-go/i18n/messages/de.json +0 -29
- package/dist/templates/native-go/i18n/messages/en.json +0 -29
- package/dist/templates/native-go/i18n/messages/es.json +0 -29
- package/dist/templates/native-go/i18n/messages/fr.json +0 -29
- package/dist/templates/native-go/i18n/messages/it.json +0 -29
- package/dist/templates/native-go/i18n/messages/ja.json +0 -29
- package/dist/templates/native-go/i18n/messages/ko.json +0 -29
- package/dist/templates/native-go/i18n/messages/zh-CN.json +0 -29
- package/dist/templates/native-go/i18n/messages/zh-TW.json +0 -29
- package/dist/templates/native-go/ui/app.css +0 -45
- package/dist/templates/native-go/ui/app.js +0 -111
- package/dist/templates/native-go-delegate/DELEGATE.md +0 -263
- package/dist/templates/native-go-delegate/backend/cmd/background-worker/main.go +0 -48
- package/dist/templates/native-go-delegate/backend/internal/app/delegate.go +0 -25
- package/dist/templates/native-go-delegate/backend/internal/app/delegate_on.go +0 -5
- package/dist/templates/native-go-delegate/backend/internal/app/delegate_routes_test.go +0 -31
- package/dist/templates/native-go-delegate/backend/internal/background/delegate_review_test.go +0 -174
- package/dist/templates/native-go-delegate/backend/internal/background/delegated.go +0 -277
- package/dist/templates/native-go-delegate/backend/internal/background/delegated_moves.go +0 -270
- package/dist/templates/native-go-delegate/backend/internal/background/delegated_test.go +0 -34
- package/dist/templates/native-go-delegate/backend/internal/delegate/admission_recovery_test.go +0 -410
- package/dist/templates/native-go-delegate/backend/internal/delegate/busy_review_test.go +0 -15
- package/dist/templates/native-go-delegate/backend/internal/delegate/cancel_contract_test.go +0 -95
- package/dist/templates/native-go-delegate/backend/internal/delegate/client.go +0 -151
- package/dist/templates/native-go-delegate/backend/internal/delegate/client_test.go +0 -214
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination.go +0 -110
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_state.go +0 -117
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_state_test.go +0 -60
- package/dist/templates/native-go-delegate/backend/internal/delegate/destination_test.go +0 -116
- package/dist/templates/native-go-delegate/backend/internal/delegate/example.go +0 -81
- package/dist/templates/native-go-delegate/backend/internal/delegate/example_test.go +0 -91
- package/dist/templates/native-go-delegate/backend/internal/delegate/executor_contract_test.go +0 -511
- package/dist/templates/native-go-delegate/backend/internal/delegate/files.go +0 -132
- package/dist/templates/native-go-delegate/backend/internal/delegate/long_running_routes.go +0 -92
- package/dist/templates/native-go-delegate/backend/internal/delegate/long_running_routes_test.go +0 -99
- package/dist/templates/native-go-delegate/backend/internal/delegate/move.go +0 -348
- package/dist/templates/native-go-delegate/backend/internal/delegate/move_test.go +0 -351
- package/dist/templates/native-go-delegate/backend/internal/delegate/operations_list.go +0 -65
- package/dist/templates/native-go-delegate/backend/internal/delegate/operations_list_test.go +0 -114
- package/dist/templates/native-go-delegate/backend/internal/delegate/retry.go +0 -106
- package/dist/templates/native-go-delegate/backend/internal/delegate/retry_test.go +0 -143
- package/dist/templates/native-go-delegate/backend/internal/delegate/service.go +0 -364
- package/dist/templates/native-go-delegate/backend/internal/delegate/service_test.go +0 -318
- package/dist/templates/native-go-delegate/backend/internal/delegate/staging.go +0 -121
- package/dist/templates/native-go-delegate/backend/internal/delegate/status_disabled_test.go +0 -51
- package/dist/templates/native-go-delegate/backend/internal/delegate/testdata/executor_contract.txt +0 -112
- package/dist/templates/native-go-delegate/backend/internal/delegate/transient_contract_test.go +0 -137
- package/dist/templates/native-go-delegate/backend/internal/delegate/wait_cancel_test.go +0 -101
- package/dist/templates/native-go-delegate/backend/internal/delegate/worker.go +0 -225
- package/dist/templates/native-go-delegate/backend/internal/filestation/files.go +0 -43
- package/dist/templates/native-go-delegate/backend/internal/filestation/files_test.go +0 -59
- package/dist/templates/native-go-delegate/frontend/src/CapabilityPanels.vue +0 -37
- package/dist/templates/native-go-delegate/frontend/src/delegate/BackgroundSavePanel.vue +0 -113
- package/dist/templates/native-go-delegate/frontend/src/delegate/DelegatePanel.vue +0 -70
- package/dist/templates/native-go-delegate/frontend/src/delegate/copy.ts +0 -8
- package/dist/templates/native-go-delegate/frontend/src/delegate/i18n/waiting.json +0 -11
- package/dist/templates/native-go-delegate/frontend/test/background-save.test.ts +0 -121
- package/dist/templates/native-go-delegate/frontend/test/delegate.test.ts +0 -145
- package/dist/templates/native-go-delegate/frontend/test/scope-settings.test.ts +0 -49
- package/dist/templates/native-go-delegate/test-frontend.sh +0 -12
- package/dist/templates/native-go-delegate/test.sh +0 -18
- package/dist/templates/native-go-jobs/BACKGROUND.md +0 -108
- package/dist/templates/native-go-jobs/backend/internal/app/background_on.go +0 -7
- package/dist/templates/native-go-jobs/backend/internal/app/background_routes_test.go +0 -90
- package/dist/templates/native-go-jobs/frontend/src/background/BackgroundPanel.vue +0 -170
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/de.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/en.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/es.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/fr.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/it.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/ja.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/ko.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/zh-CN.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n/zh-TW.json +0 -75
- package/dist/templates/native-go-jobs/frontend/src/background/i18n.ts +0 -19
- package/dist/templates/native-go-jobs/frontend/src/background/picker-provider.ts +0 -12
- package/dist/templates/native-go-jobs/frontend/src/background/request-key.ts +0 -5
- package/dist/templates/native-go-jobs/frontend/test/background.test.ts +0 -205
- package/dist/templates/native-go-root-ops/backend/internal/app/executor.go +0 -140
- package/dist/templates/native-go-root-ops/backend/internal/app/executor_test.go +0 -117
- package/dist/templates/native-go-root-ops/root/whoami.sh +0 -3
- package/dist/templates/native-go-vue/README.md +0 -47
- package/dist/templates/native-go-vue/frontend/DESIGN.md +0 -61
- package/dist/templates/native-go-vue/frontend/package-lock.json +0 -2530
- package/dist/templates/native-go-vue/frontend/package.json +0 -6
- package/dist/templates/native-go-vue/frontend/src/App.vue +0 -96
- package/dist/templates/native-go-vue/frontend/src/CapabilityPanels.vue +0 -6
- package/dist/templates/native-go-vue/frontend/src/context.ts +0 -78
- package/dist/templates/native-go-vue/frontend/src/delegate/ExecutorSettings.vue +0 -70
- package/dist/templates/native-go-vue/frontend/src/delegate/catalogs.ts +0 -11
- package/dist/templates/native-go-vue/frontend/src/delegate/copy.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/copy.ts +0 -4
- package/dist/templates/native-go-vue/frontend/src/delegate/executor-settings.test.ts +0 -23
- package/dist/templates/native-go-vue/frontend/src/delegate/executor-setup.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/delegate/facade.test.ts +0 -100
- package/dist/templates/native-go-vue/frontend/src/delegate/facade.ts +0 -85
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/de.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/en.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/es.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/fr.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/it.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/ja.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/ko.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/de.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/en.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/es.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/fr.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/it.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/ja.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/ko.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-CN.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-TW.json +0 -42
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/zh-CN.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/i18n/zh-TW.json +0 -47
- package/dist/templates/native-go-vue/frontend/src/delegate/long-running.ts +0 -57
- package/dist/templates/native-go-vue/frontend/src/delegate/save-copy.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/save-copy.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/delegate/scoped-picker.test.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/delegate/scoped-picker.ts +0 -21
- package/dist/templates/native-go-vue/frontend/src/files/FileBrowser.vue +0 -131
- package/dist/templates/native-go-vue/frontend/src/files/FilesPage.vue +0 -35
- package/dist/templates/native-go-vue/frontend/src/files/files.test.ts +0 -100
- package/dist/templates/native-go-vue/frontend/src/files/provider.test.ts +0 -48
- package/dist/templates/native-go-vue/frontend/src/files/transfers.test.ts +0 -27
- package/dist/templates/native-go-vue/frontend/src/files/transfers.ts +0 -25
- package/dist/templates/native-go-vue/frontend/src/i18n/de.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/en.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/es.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/fr.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/it.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/ja.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/ko.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/zh-CN.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n/zh-TW.json +0 -20
- package/dist/templates/native-go-vue/frontend/src/i18n.ts +0 -13
- package/dist/templates/native-go-vue/frontend/src/identity/DESIGN.md +0 -46
- package/dist/templates/native-go-vue/frontend/src/identity/LoginPage.vue +0 -78
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/de.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/en.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/es.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/fr.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/it.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/ja.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/ko.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/zh-CN.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n/zh-TW.json +0 -27
- package/dist/templates/native-go-vue/frontend/src/identity/i18n.ts +0 -14
- package/dist/templates/native-go-vue/frontend/src/identity/login.test.ts +0 -32
- package/dist/templates/native-go-vue/frontend/src/identity/session.test.ts +0 -33
- package/dist/templates/native-go-vue/frontend/src/identity/session.ts +0 -74
- package/dist/templates/native-go-vue/frontend/src/main.ts +0 -32
- package/dist/templates/native-go-vue/frontend/src/nas/NasPicker.vue +0 -42
- package/dist/templates/native-go-vue/frontend/src/nas/contract.ts +0 -12
- package/dist/templates/native-go-vue/frontend/src/nas/destination.test.ts +0 -48
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/de.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/en.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/es.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/fr.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/it.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/ja.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/ko.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/zh-CN.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n/files/zh-TW.json +0 -41
- package/dist/templates/native-go-vue/frontend/src/nas/i18n.ts +0 -2
- package/dist/templates/native-go-vue/frontend/src/nas/locale.ts +0 -24
- package/dist/templates/native-go-vue/frontend/src/nas/provider.ts +0 -50
- package/dist/templates/native-go-vue/frontend/src/nas/use-request.ts +0 -18
- package/dist/templates/native-go-vue/frontend/src/portal/PortalSettings.vue +0 -39
- package/dist/templates/native-go-vue/frontend/src/shell/AppShell.vue +0 -48
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/de.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/en.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/es.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/fr.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/it.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/ja.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/ko.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/zh-CN.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n/zh-TW.json +0 -4
- package/dist/templates/native-go-vue/frontend/src/shell/i18n.ts +0 -17
- package/dist/templates/native-go-vue/frontend/src/shell/pages.ts +0 -15
- package/dist/templates/native-go-vue/frontend/src/style.css +0 -27
- package/dist/templates/native-go-vue/frontend/test/apps.test.ts +0 -57
- package/dist/templates/native-go-vue/frontend/test/native-controls.test.ts +0 -27
- package/dist/templates/native-go-vue/frontend/test/portal-settings.test.ts +0 -71
- package/dist/templates/native-go-vue/frontend/test/shell-i18n.test.ts +0 -50
- package/dist/templates/native-go-vue/frontend/test/shell-ui.test.ts +0 -20
- package/dist/templates/native-go-vue/frontend/test/shell.test.ts +0 -30
- package/dist/templates/native-go-vue/frontend/tsconfig.json +0 -1
- package/dist/templates/native-go-vue/frontend/vite.config.ts +0 -10
- package/dist/templates/native-go-vue/gitignore +0 -2
- package/templates/_daemon/fixture_linux_test.go +0 -15
- package/templates/_daemon/fixture_other_test.go +0 -7
- package/templates/_daemon/go.mod +0 -5
- package/templates/_daemon/main.go +0 -611
- package/templates/_daemon/main_test.go +0 -315
- package/templates/_daemon/process_linux.go +0 -55
- package/templates/_daemon/process_linux_test.go +0 -161
- package/templates/_daemon/process_other.go +0 -14
- package/templates/_daemon/testdata/child.go +0 -44
- package/templates/_executor/README.md +0 -318
- package/templates/_executor/anchor.go +0 -156
- package/templates/_executor/anchor_test.go +0 -161
- package/templates/_executor/apppriv_review_test.go +0 -28
- package/templates/_executor/auth_presence_review_test.go +0 -38
- package/templates/_executor/cancel_contract_test.go +0 -236
- package/templates/_executor/cmd/lifecycle/main.go +0 -42
- package/templates/_executor/cookie_review_test.go +0 -27
- package/templates/_executor/copy.go +0 -64
- package/templates/_executor/copy_test.go +0 -88
- package/templates/_executor/digest_review_test.go +0 -120
- package/templates/_executor/directories.go +0 -40
- package/templates/_executor/dsm.go +0 -369
- package/templates/_executor/dsm_test.go +0 -290
- package/templates/_executor/executor.go +0 -735
- package/templates/_executor/executor_test.go +0 -314
- package/templates/_executor/go.mod +0 -5
- package/templates/_executor/identity.go +0 -74
- package/templates/_executor/identity_kernel_linux_test.go +0 -60
- package/templates/_executor/identity_linux.go +0 -82
- package/templates/_executor/identity_security_test.go +0 -43
- package/templates/_executor/internal/lifecycle/lifecycle.go +0 -95
- package/templates/_executor/internal/lifecycle/lifecycle_test.go +0 -232
- package/templates/_executor/internal/taskscript/boot.sh +0 -31
- package/templates/_executor/internal/taskscript/cmd/main.go +0 -19
- package/templates/_executor/internal/taskscript/control.sh +0 -31
- package/templates/_executor/internal/taskscript/tasks.go +0 -44
- package/templates/_executor/json_review_test.go +0 -40
- package/templates/_executor/lifecycle_test.go +0 -97
- package/templates/_executor/link_linux.go +0 -28
- package/templates/_executor/long_running_test.go +0 -530
- package/templates/_executor/main.go +0 -576
- package/templates/_executor/managed.go +0 -117
- package/templates/_executor/managed_test.go +0 -137
- package/templates/_executor/move_linux.go +0 -490
- package/templates/_executor/move_linux_test.go +0 -460
- package/templates/_executor/move_validation.go +0 -46
- package/templates/_executor/move_validation_test.go +0 -187
- package/templates/_executor/operations.go +0 -926
- package/templates/_executor/path_test.go +0 -35
- package/templates/_executor/pid.go +0 -37
- package/templates/_executor/pid_test.go +0 -113
- package/templates/_executor/platform_linux.go +0 -187
- package/templates/_executor/platform_linux_test.go +0 -191
- package/templates/_executor/platform_other.go +0 -76
- package/templates/_executor/process.go +0 -142
- package/templates/_executor/purge_log.go +0 -18
- package/templates/_executor/records.go +0 -242
- package/templates/_executor/scope_cancel_contract_test.go +0 -91
- package/templates/_executor/scope_client.go +0 -37
- package/templates/_executor/scope_contract.go +0 -12
- package/templates/_executor/selected_scope.go +0 -146
- package/templates/_executor/selected_scope_test.go +0 -186
- package/templates/_executor/socket_linux_test.go +0 -46
- package/templates/_executor/status_disabled_test.go +0 -33
- package/templates/_executor/store.go +0 -91
- package/templates/_executor/supervise.go +0 -109
- package/templates/_executor/supervise_test.go +0 -130
- package/templates/_executor/task_race_review_test.go +0 -47
- package/templates/_executor/tasks.go +0 -320
- package/templates/_executor/tasks_dsm71_test.go +0 -114
- package/templates/_executor/tasks_review_test.go +0 -43
- package/templates/_executor/tasks_test.go +0 -223
- package/templates/_executor/testdata/evidence/cleanup.json +0 -24
- package/templates/_executor/testdata/evidence/final-smoke.jsonl +0 -9
- package/templates/_executor/testdata/evidence/kernel-acl.json +0 -6
- package/templates/_executor/testdata/evidence/linux-tests.log +0 -123
- package/templates/_executor/testdata/evidence/live.jsonl +0 -23
- package/templates/_executor/testdata/evidence/storage.json +0 -90
- package/templates/_executor/testdata/evidence/validation.json +0 -55
- package/templates/_executor/testdata/live_probe.py +0 -98
- package/templates/_executor/upgrade_watch_test.go +0 -244
- package/templates/_executor/watch.go +0 -164
- package/templates/_executor/watch_test.go +0 -291
- package/templates/_executor/write_review_linux_test.go +0 -87
- package/templates/_gateway/auth.go +0 -101
- package/templates/_gateway/auth_test.go +0 -216
- package/templates/_gateway/cgi.go +0 -133
- package/templates/_gateway/cgi_test.go +0 -156
- package/templates/_gateway/csrf.go +0 -73
- package/templates/_gateway/csrf_test.go +0 -155
- package/templates/_gateway/directory.go +0 -108
- package/templates/_gateway/directory_test.go +0 -202
- package/templates/_gateway/gateway.go +0 -412
- package/templates/_gateway/gateway_test.go +0 -676
- package/templates/_gateway/go.mod +0 -5
- package/templates/_gateway/groups.go +0 -66
- package/templates/_gateway/main.go +0 -45
- package/templates/_shared/AGENTS.md +0 -146
- package/templates/_shared/CLAUDE.md +0 -1
- package/templates/_shared/GO-LICENSE +0 -27
- package/templates/_shared/GO-PATENTS +0 -22
- package/templates/_shared/LICENSES/TEMPLATE.txt +0 -21
- package/templates/_shared/third-party-notices.mjs +0 -51
- package/templates/binary/LICENSES/GO-LICENSE +0 -27
- package/templates/binary/LICENSES/GO-PATENTS +0 -22
- package/templates/binary/dsm-package.yaml +0 -46
- package/templates/binary/example/main.go +0 -16
- package/templates/binary/gitignore +0 -2
- package/templates/binary/i18n/messages/de.json +0 -4
- package/templates/binary/i18n/messages/en.json +0 -4
- package/templates/binary/i18n/messages/es.json +0 -4
- package/templates/binary/i18n/messages/fr.json +0 -4
- package/templates/binary/i18n/messages/it.json +0 -4
- package/templates/binary/i18n/messages/ja.json +0 -4
- package/templates/binary/i18n/messages/ko.json +0 -4
- package/templates/binary/i18n/messages/zh-CN.json +0 -4
- package/templates/binary/i18n/messages/zh-TW.json +0 -4
- package/templates/binary/ui/app.css +0 -4
- package/templates/binary/ui/app.js +0 -32
- package/templates/compose/compose.yaml +0 -8
- package/templates/compose/synology-app.yaml +0 -16
- package/templates/native-authorization/AuthorizationGate.vue +0 -91
- package/templates/native-authorization/i18n/de.json +0 -37
- package/templates/native-authorization/i18n/en.json +0 -37
- package/templates/native-authorization/i18n/es.json +0 -37
- package/templates/native-authorization/i18n/fr.json +0 -37
- package/templates/native-authorization/i18n/index.ts +0 -15
- package/templates/native-authorization/i18n/it.json +0 -37
- package/templates/native-authorization/i18n/ja.json +0 -37
- package/templates/native-authorization/i18n/ko.json +0 -37
- package/templates/native-authorization/i18n/zh-CN.json +0 -37
- package/templates/native-authorization/i18n/zh-TW.json +0 -37
- package/templates/native-go/README.md +0 -459
- package/templates/native-go/backend/THIRD_PARTY_NOTICES.txt +0 -61
- package/templates/native-go/backend/cmd/app/main.go +0 -95
- package/templates/native-go/backend/cmd/background-worker/main.go +0 -38
- package/templates/native-go/backend/go.mod +0 -9
- package/templates/native-go/backend/go.sum +0 -4
- package/templates/native-go/backend/internal/api/cgi_framing_test.go +0 -32
- package/templates/native-go/backend/internal/api/cookie_review_test.go +0 -28
- package/templates/native-go/backend/internal/api/deadline_test.go +0 -114
- package/templates/native-go/backend/internal/api/dsm-session.go +0 -54
- package/templates/native-go/backend/internal/api/dsm-session_test.go +0 -51
- package/templates/native-go/backend/internal/api/entry_test.go +0 -47
- package/templates/native-go/backend/internal/api/errors.go +0 -47
- package/templates/native-go/backend/internal/api/permissions.go +0 -161
- package/templates/native-go/backend/internal/api/permissions.json +0 -5
- package/templates/native-go/backend/internal/api/permissions_test.go +0 -113
- package/templates/native-go/backend/internal/api/policy_fixture_test.go +0 -8
- package/templates/native-go/backend/internal/api/registry.go +0 -142
- package/templates/native-go/backend/internal/api/registry_test.go +0 -344
- package/templates/native-go/backend/internal/api/resource_limits_test.go +0 -87
- package/templates/native-go/backend/internal/api/sdk-permissions.json +0 -59
- package/templates/native-go/backend/internal/api/sdk_policy_test.go +0 -31
- package/templates/native-go/backend/internal/api/server.go +0 -305
- package/templates/native-go/backend/internal/api/testdata/permissions-cases.json +0 -172
- package/templates/native-go/backend/internal/app/background.go +0 -249
- package/templates/native-go/backend/internal/app/background_none.go +0 -8
- package/templates/native-go/backend/internal/app/background_owner.go +0 -38
- package/templates/native-go/backend/internal/app/background_owner_test.go +0 -163
- package/templates/native-go/backend/internal/app/background_schedule.go +0 -69
- package/templates/native-go/backend/internal/app/background_schedule_test.go +0 -62
- package/templates/native-go/backend/internal/app/background_test.go +0 -320
- package/templates/native-go/backend/internal/app/delegate_config.go +0 -57
- package/templates/native-go/backend/internal/app/delegate_config_test.go +0 -28
- package/templates/native-go/backend/internal/app/delegate_none.go +0 -5
- package/templates/native-go/backend/internal/app/identity.go +0 -20
- package/templates/native-go/backend/internal/app/identity_test.go +0 -15
- package/templates/native-go/backend/internal/app/migrations.go +0 -41
- package/templates/native-go/backend/internal/app/migrations_test.go +0 -41
- package/templates/native-go/backend/internal/app/portal.go +0 -30
- package/templates/native-go/backend/internal/app/portal_test.go +0 -55
- package/templates/native-go/backend/internal/app/root_none.go +0 -9
- package/templates/native-go/backend/internal/app/routes.go +0 -137
- package/templates/native-go/backend/internal/app/routes_test.go +0 -165
- package/templates/native-go/backend/internal/app/session_files.go +0 -9
- package/templates/native-go/backend/internal/app/session_files_test.go +0 -14
- package/templates/native-go/backend/internal/app/shared_folder.go +0 -144
- package/templates/native-go/backend/internal/app/shared_folder_test.go +0 -158
- package/templates/native-go/backend/internal/background/access.go +0 -57
- package/templates/native-go/backend/internal/background/lock_test.go +0 -131
- package/templates/native-go/backend/internal/background/owner_test.go +0 -118
- package/templates/native-go/backend/internal/background/runner.go +0 -185
- package/templates/native-go/backend/internal/background/runner_test.go +0 -209
- package/templates/native-go/backend/internal/background/schedule.go +0 -336
- package/templates/native-go/backend/internal/background/schedule_test.go +0 -368
- package/templates/native-go/backend/internal/background/store.go +0 -825
- package/templates/native-go/backend/internal/background/store_test.go +0 -365
- package/templates/native-go/backend/internal/datamigrate/migrate.go +0 -191
- package/templates/native-go/backend/internal/datamigrate/migrate_test.go +0 -177
- package/templates/native-go/backend/internal/dsm/admin.go +0 -76
- package/templates/native-go/backend/internal/dsm/admin_linux.go +0 -110
- package/templates/native-go/backend/internal/dsm/admin_linux_test.go +0 -105
- package/templates/native-go/backend/internal/dsm/admin_other.go +0 -15
- package/templates/native-go/backend/internal/dsm/admin_test.go +0 -67
- package/templates/native-go/backend/internal/dsm/apppriv.go +0 -30
- package/templates/native-go/backend/internal/dsm/auth.go +0 -94
- package/templates/native-go/backend/internal/dsm/auth_test.go +0 -159
- package/templates/native-go/backend/internal/dsm/bridge_file.go +0 -75
- package/templates/native-go/backend/internal/dsm/bridge_file_test.go +0 -57
- package/templates/native-go/backend/internal/dsm/entry.go +0 -177
- package/templates/native-go/backend/internal/dsm/entry_test.go +0 -315
- package/templates/native-go/backend/internal/dsm/native/admin-aarch64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin-armv7.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin-x86_64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/admin_check.c +0 -28
- package/templates/native-go/backend/internal/dsm/native/apppriv-aarch64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv-armv7.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv-x86_64.elf +0 -0
- package/templates/native-go/backend/internal/dsm/native/apppriv_check.c +0 -33
- package/templates/native-go/backend/internal/dsm/native/build.sh +0 -18
- package/templates/native-go/backend/internal/dsm/native/licenses/GLIBC-NOTICES.txt +0 -400
- package/templates/native-go/backend/internal/dsm/native/licenses/LGPL-2.1.txt +0 -501
- package/templates/native-go/backend/internal/dsm/native/licenses/SOURCE.txt +0 -5
- package/templates/native-go/backend/internal/dsm/native/licenses/ZIG-MIT.txt +0 -21
- package/templates/native-go/backend/internal/dsm/native/provenance.json +0 -18
- package/templates/native-go/backend/internal/filestation/browse_test.go +0 -67
- package/templates/native-go/backend/internal/filestation/check_permission.go +0 -71
- package/templates/native-go/backend/internal/filestation/check_permission_test.go +0 -77
- package/templates/native-go/backend/internal/filestation/client.go +0 -337
- package/templates/native-go/backend/internal/filestation/client_test.go +0 -155
- package/templates/native-go/backend/internal/filestation/doc.go +0 -4
- package/templates/native-go/backend/internal/filestation/download_dsm71_test.go +0 -82
- package/templates/native-go/backend/internal/filestation/http.go +0 -70
- package/templates/native-go/backend/internal/filestation/http_test.go +0 -188
- package/templates/native-go/backend/internal/filestation/operations_test.go +0 -206
- package/templates/native-go/backend/internal/filestation/read_file_test.go +0 -89
- package/templates/native-go/backend/internal/filestation/sdk_policy_test.go +0 -39
- package/templates/native-go/backend/internal/filestation/service.go +0 -254
- package/templates/native-go/backend/internal/filestation/service_test.go +0 -74
- package/templates/native-go/backend/internal/filestation/upload_stream.go +0 -76
- package/templates/native-go/backend/internal/filestation/upload_stream_test.go +0 -77
- package/templates/native-go/backend/internal/filestation/write.go +0 -32
- package/templates/native-go/backend/internal/filestation/write_test.go +0 -124
- package/templates/native-go/backend/internal/identity/README.md +0 -59
- package/templates/native-go/backend/internal/identity/dsm.go +0 -115
- package/templates/native-go/backend/internal/identity/http.go +0 -291
- package/templates/native-go/backend/internal/identity/identity_test.go +0 -530
- package/templates/native-go/backend/internal/identity/service.go +0 -159
- package/templates/native-go/backend/internal/identity/store.go +0 -109
- package/templates/native-go/backend/internal/jsonlimits/limits.go +0 -48
- package/templates/native-go/backend/internal/jsonlimits/limits_test.go +0 -52
- package/templates/native-go/backend/internal/portal/portal.go +0 -138
- package/templates/native-go/backend/internal/portal/portal_test.go +0 -89
- package/templates/native-go/dsm-package.yaml +0 -71
- package/templates/native-go/gitignore +0 -1
- package/templates/native-go/i18n/glossary.json +0 -663
- package/templates/native-go/i18n/messages/de.json +0 -29
- package/templates/native-go/i18n/messages/en.json +0 -29
- package/templates/native-go/i18n/messages/es.json +0 -29
- package/templates/native-go/i18n/messages/fr.json +0 -29
- package/templates/native-go/i18n/messages/it.json +0 -29
- package/templates/native-go/i18n/messages/ja.json +0 -29
- package/templates/native-go/i18n/messages/ko.json +0 -29
- package/templates/native-go/i18n/messages/zh-CN.json +0 -29
- package/templates/native-go/i18n/messages/zh-TW.json +0 -29
- package/templates/native-go/ui/app.css +0 -45
- package/templates/native-go/ui/app.js +0 -111
- package/templates/native-go-delegate/DELEGATE.md +0 -263
- package/templates/native-go-delegate/backend/cmd/background-worker/main.go +0 -48
- package/templates/native-go-delegate/backend/internal/app/delegate.go +0 -25
- package/templates/native-go-delegate/backend/internal/app/delegate_on.go +0 -5
- package/templates/native-go-delegate/backend/internal/app/delegate_routes_test.go +0 -31
- package/templates/native-go-delegate/backend/internal/background/delegate_review_test.go +0 -174
- package/templates/native-go-delegate/backend/internal/background/delegated.go +0 -277
- package/templates/native-go-delegate/backend/internal/background/delegated_moves.go +0 -270
- package/templates/native-go-delegate/backend/internal/background/delegated_test.go +0 -34
- package/templates/native-go-delegate/backend/internal/delegate/admission_recovery_test.go +0 -410
- package/templates/native-go-delegate/backend/internal/delegate/busy_review_test.go +0 -15
- package/templates/native-go-delegate/backend/internal/delegate/cancel_contract_test.go +0 -95
- package/templates/native-go-delegate/backend/internal/delegate/client.go +0 -151
- package/templates/native-go-delegate/backend/internal/delegate/client_test.go +0 -214
- package/templates/native-go-delegate/backend/internal/delegate/destination.go +0 -110
- package/templates/native-go-delegate/backend/internal/delegate/destination_state.go +0 -117
- package/templates/native-go-delegate/backend/internal/delegate/destination_state_test.go +0 -60
- package/templates/native-go-delegate/backend/internal/delegate/destination_test.go +0 -116
- package/templates/native-go-delegate/backend/internal/delegate/example.go +0 -81
- package/templates/native-go-delegate/backend/internal/delegate/example_test.go +0 -91
- package/templates/native-go-delegate/backend/internal/delegate/executor_contract_test.go +0 -511
- package/templates/native-go-delegate/backend/internal/delegate/files.go +0 -132
- package/templates/native-go-delegate/backend/internal/delegate/long_running_routes.go +0 -92
- package/templates/native-go-delegate/backend/internal/delegate/long_running_routes_test.go +0 -99
- package/templates/native-go-delegate/backend/internal/delegate/move.go +0 -348
- package/templates/native-go-delegate/backend/internal/delegate/move_test.go +0 -351
- package/templates/native-go-delegate/backend/internal/delegate/operations_list.go +0 -65
- package/templates/native-go-delegate/backend/internal/delegate/operations_list_test.go +0 -114
- package/templates/native-go-delegate/backend/internal/delegate/retry.go +0 -106
- package/templates/native-go-delegate/backend/internal/delegate/retry_test.go +0 -143
- package/templates/native-go-delegate/backend/internal/delegate/service.go +0 -364
- package/templates/native-go-delegate/backend/internal/delegate/service_test.go +0 -318
- package/templates/native-go-delegate/backend/internal/delegate/staging.go +0 -121
- package/templates/native-go-delegate/backend/internal/delegate/status_disabled_test.go +0 -51
- package/templates/native-go-delegate/backend/internal/delegate/testdata/executor_contract.txt +0 -112
- package/templates/native-go-delegate/backend/internal/delegate/transient_contract_test.go +0 -137
- package/templates/native-go-delegate/backend/internal/delegate/wait_cancel_test.go +0 -101
- package/templates/native-go-delegate/backend/internal/delegate/worker.go +0 -225
- package/templates/native-go-delegate/backend/internal/filestation/files.go +0 -43
- package/templates/native-go-delegate/backend/internal/filestation/files_test.go +0 -59
- package/templates/native-go-delegate/frontend/src/CapabilityPanels.vue +0 -37
- package/templates/native-go-delegate/frontend/src/delegate/BackgroundSavePanel.vue +0 -113
- package/templates/native-go-delegate/frontend/src/delegate/DelegatePanel.vue +0 -70
- package/templates/native-go-delegate/frontend/src/delegate/copy.ts +0 -8
- package/templates/native-go-delegate/frontend/src/delegate/i18n/waiting.json +0 -11
- package/templates/native-go-delegate/frontend/test/background-save.test.ts +0 -121
- package/templates/native-go-delegate/frontend/test/delegate.test.ts +0 -145
- package/templates/native-go-delegate/frontend/test/scope-settings.test.ts +0 -49
- package/templates/native-go-delegate/test-frontend.sh +0 -12
- package/templates/native-go-delegate/test.sh +0 -18
- package/templates/native-go-jobs/BACKGROUND.md +0 -108
- package/templates/native-go-jobs/backend/internal/app/background_on.go +0 -7
- package/templates/native-go-jobs/backend/internal/app/background_routes_test.go +0 -90
- package/templates/native-go-jobs/frontend/src/background/BackgroundPanel.vue +0 -170
- package/templates/native-go-jobs/frontend/src/background/i18n/de.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/en.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/es.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/fr.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/it.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/ja.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/ko.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/zh-CN.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n/zh-TW.json +0 -75
- package/templates/native-go-jobs/frontend/src/background/i18n.ts +0 -19
- package/templates/native-go-jobs/frontend/src/background/picker-provider.ts +0 -12
- package/templates/native-go-jobs/frontend/src/background/request-key.ts +0 -5
- package/templates/native-go-jobs/frontend/test/background.test.ts +0 -205
- package/templates/native-go-root-ops/backend/internal/app/executor.go +0 -140
- package/templates/native-go-root-ops/backend/internal/app/executor_test.go +0 -117
- package/templates/native-go-root-ops/root/whoami.sh +0 -3
- package/templates/native-go-vue/README.md +0 -47
- package/templates/native-go-vue/frontend/DESIGN.md +0 -61
- package/templates/native-go-vue/frontend/package-lock.json +0 -2530
- package/templates/native-go-vue/frontend/package.json +0 -6
- package/templates/native-go-vue/frontend/src/App.vue +0 -96
- package/templates/native-go-vue/frontend/src/CapabilityPanels.vue +0 -6
- package/templates/native-go-vue/frontend/src/context.ts +0 -78
- package/templates/native-go-vue/frontend/src/delegate/ExecutorSettings.vue +0 -70
- package/templates/native-go-vue/frontend/src/delegate/catalogs.ts +0 -11
- package/templates/native-go-vue/frontend/src/delegate/copy.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/copy.ts +0 -4
- package/templates/native-go-vue/frontend/src/delegate/executor-settings.test.ts +0 -23
- package/templates/native-go-vue/frontend/src/delegate/executor-setup.ts +0 -24
- package/templates/native-go-vue/frontend/src/delegate/facade.test.ts +0 -100
- package/templates/native-go-vue/frontend/src/delegate/facade.ts +0 -85
- package/templates/native-go-vue/frontend/src/delegate/i18n/de.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/en.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/es.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/fr.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/it.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/ja.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/ko.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/de.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/en.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/es.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/fr.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/it.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/ja.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/ko.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-CN.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/save/zh-TW.json +0 -42
- package/templates/native-go-vue/frontend/src/delegate/i18n/zh-CN.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/i18n/zh-TW.json +0 -47
- package/templates/native-go-vue/frontend/src/delegate/long-running.ts +0 -57
- package/templates/native-go-vue/frontend/src/delegate/save-copy.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/save-copy.ts +0 -24
- package/templates/native-go-vue/frontend/src/delegate/scoped-picker.test.ts +0 -12
- package/templates/native-go-vue/frontend/src/delegate/scoped-picker.ts +0 -21
- package/templates/native-go-vue/frontend/src/files/FileBrowser.vue +0 -131
- package/templates/native-go-vue/frontend/src/files/FilesPage.vue +0 -35
- package/templates/native-go-vue/frontend/src/files/files.test.ts +0 -100
- package/templates/native-go-vue/frontend/src/files/provider.test.ts +0 -48
- package/templates/native-go-vue/frontend/src/files/transfers.test.ts +0 -27
- package/templates/native-go-vue/frontend/src/files/transfers.ts +0 -25
- package/templates/native-go-vue/frontend/src/i18n/de.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/en.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/es.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/fr.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/it.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/ja.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/ko.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/zh-CN.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n/zh-TW.json +0 -20
- package/templates/native-go-vue/frontend/src/i18n.ts +0 -13
- package/templates/native-go-vue/frontend/src/identity/DESIGN.md +0 -46
- package/templates/native-go-vue/frontend/src/identity/LoginPage.vue +0 -78
- package/templates/native-go-vue/frontend/src/identity/i18n/de.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/en.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/es.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/fr.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/it.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/ja.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/ko.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/zh-CN.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n/zh-TW.json +0 -27
- package/templates/native-go-vue/frontend/src/identity/i18n.ts +0 -14
- package/templates/native-go-vue/frontend/src/identity/login.test.ts +0 -32
- package/templates/native-go-vue/frontend/src/identity/session.test.ts +0 -33
- package/templates/native-go-vue/frontend/src/identity/session.ts +0 -74
- package/templates/native-go-vue/frontend/src/main.ts +0 -32
- package/templates/native-go-vue/frontend/src/nas/NasPicker.vue +0 -42
- package/templates/native-go-vue/frontend/src/nas/contract.ts +0 -12
- package/templates/native-go-vue/frontend/src/nas/destination.test.ts +0 -48
- package/templates/native-go-vue/frontend/src/nas/i18n/files/de.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/en.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/es.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/fr.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/it.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/ja.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/ko.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/zh-CN.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n/files/zh-TW.json +0 -41
- package/templates/native-go-vue/frontend/src/nas/i18n.ts +0 -2
- package/templates/native-go-vue/frontend/src/nas/locale.ts +0 -24
- package/templates/native-go-vue/frontend/src/nas/provider.ts +0 -50
- package/templates/native-go-vue/frontend/src/nas/use-request.ts +0 -18
- package/templates/native-go-vue/frontend/src/portal/PortalSettings.vue +0 -39
- package/templates/native-go-vue/frontend/src/shell/AppShell.vue +0 -48
- package/templates/native-go-vue/frontend/src/shell/i18n/de.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/en.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/es.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/fr.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/it.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/ja.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/ko.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/zh-CN.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n/zh-TW.json +0 -4
- package/templates/native-go-vue/frontend/src/shell/i18n.ts +0 -17
- package/templates/native-go-vue/frontend/src/shell/pages.ts +0 -15
- package/templates/native-go-vue/frontend/src/style.css +0 -27
- package/templates/native-go-vue/frontend/test/apps.test.ts +0 -57
- package/templates/native-go-vue/frontend/test/native-controls.test.ts +0 -27
- package/templates/native-go-vue/frontend/test/portal-settings.test.ts +0 -71
- package/templates/native-go-vue/frontend/test/shell-i18n.test.ts +0 -50
- package/templates/native-go-vue/frontend/test/shell-ui.test.ts +0 -20
- package/templates/native-go-vue/frontend/test/shell.test.ts +0 -30
- package/templates/native-go-vue/frontend/tsconfig.json +0 -1
- package/templates/native-go-vue/frontend/vite.config.ts +0 -10
- package/templates/native-go-vue/gitignore +0 -2
- /package/{dist/templates/_daemon → assets/go/daemon}/fixture_linux_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/fixture_other_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/go.mod +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/main.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/main_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_linux.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_linux_test.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/process_other.go +0 -0
- /package/{dist/templates/_daemon → assets/go/daemon}/testdata/child.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/auth.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/auth_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/cgi.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/cgi_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/csrf.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/csrf_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/directory.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/directory_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/gateway.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/gateway_test.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/go.mod +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/groups.go +0 -0
- /package/{dist/templates/_gateway → assets/go/gateway}/main.go +0 -0
- /package/{dist/templates/_shared → assets/licenses}/GO-LICENSE +0 -0
- /package/{dist/templates/_shared → assets/licenses}/GO-PATENTS +0 -0
- /package/{dist/templates/_shared/LICENSES → assets/licenses}/TEMPLATE.txt +0 -0
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
import {readFileSync} from 'node:fs'
|
|
3
|
-
import {join} from 'node:path'
|
|
4
|
-
import {test,expect,beforeEach,afterEach,vi} from 'vitest'
|
|
5
|
-
import {createApp,h,nextTick} from 'vue'
|
|
6
|
-
import {AppRoot} from '@synopackageland/ui'
|
|
7
|
-
import BackgroundPanel from '../src/background/BackgroundPanel.vue'
|
|
8
|
-
import {backgroundCatalogs,backgroundCopy} from '../src/background/i18n'
|
|
9
|
-
import {nasCopy} from '../src/nas/locale'
|
|
10
|
-
// DSM HTTP exposes getRandomValues, but not the secure-context randomUUID API.
|
|
11
|
-
beforeEach(()=>vi.stubGlobal('crypto',{getRandomValues:globalThis.crypto.getRandomValues.bind(globalThis.crypto)}))
|
|
12
|
-
afterEach(()=>vi.unstubAllGlobals())
|
|
13
|
-
// The UI Select is a Reka combobox: drive it by keyboard (the UI README helper), which also proves it is keyboard operable.
|
|
14
|
-
// Attrs such as data-schedule-interval land on the focusable combobox itself.
|
|
15
|
-
async function choose(root:HTMLElement,marker:string,label:string){
|
|
16
|
-
const trigger=root.querySelector<HTMLElement>(`[${marker}][role=combobox]`)!;expect(trigger,marker).toBeTruthy()
|
|
17
|
-
expect(trigger.id,marker).toBeTruthy();expect(root.querySelector(`label[for="${trigger.id}"]`),marker).toBeTruthy()
|
|
18
|
-
trigger.dispatchEvent(new KeyboardEvent('keydown',{key:'ArrowDown',bubbles:true,cancelable:true}));await settle()
|
|
19
|
-
const option=[...document.querySelectorAll<HTMLElement>('[role=option]')].find(o=>o.textContent?.trim()===label)
|
|
20
|
-
if(!option||option.getAttribute('aria-disabled')==='true')throw new Error(`No enabled option: ${label}`)
|
|
21
|
-
option.focus();option.dispatchEvent(new KeyboardEvent('keydown',{key:'Enter',bubbles:true,cancelable:true}));await settle()
|
|
22
|
-
expect(trigger.textContent).toContain(label)
|
|
23
|
-
}
|
|
24
|
-
async function settle(){for(let i=0;i<20;i++){await Promise.resolve();await nextTick()}}
|
|
25
|
-
type Call=(method:string,params?:Record<string,unknown>)=>Promise<any>
|
|
26
|
-
function mount(call:Call,locale='en'){
|
|
27
|
-
const root=document.createElement('div');document.body.append(root)
|
|
28
|
-
const app=createApp({render:()=>h(AppRoot,{},()=>h(BackgroundPanel,{ctx:{call,locale}}))})
|
|
29
|
-
app.config.idPrefix=`bg-${Math.random()}`;app.mount(root)
|
|
30
|
-
return {root,close(){app.unmount();root.remove()}}
|
|
31
|
-
}
|
|
32
|
-
const click=(root:HTMLElement,text:string)=>{const b=[...root.querySelectorAll('button')].find(b=>b.textContent?.trim()===text)!;expect(b).toBeTruthy();b.click()}
|
|
33
|
-
const status=()=>({supported:true,admin:true,revision:1,queued:0,running:0,worker:{username:'SynoPkg',alive:true},limits:{maxInputBytes:524288,maxQueued:16,maxOwnerPending:2,maxOwnerBytes:1048576,maxTotalBytes:16777216,jobTimeoutSeconds:60}})
|
|
34
|
-
|
|
35
|
-
test('non-administrators see unsupported and no action',async()=>{
|
|
36
|
-
const f=mount(async()=>{throw {code:'unsupported'}});await settle()
|
|
37
|
-
expect(f.root.textContent).toContain(backgroundCopy('en').unsupported);expect(f.root.querySelector('button')).toBeNull();f.close()
|
|
38
|
-
})
|
|
39
|
-
const browse=(args?:Record<string,unknown>)=>args?.folder
|
|
40
|
-
?{files:[{name:'fixture.bin',path:`${args.folder}/fixture.bin`,isdir:false,additional:{size:3}}],total:1,offset:0}
|
|
41
|
-
:{shares:[{name:'share',path:'/share',isdir:true}],total:1,offset:0}
|
|
42
|
-
test('pick a file, submit, cancel and result use only bg.* routes',async()=>{
|
|
43
|
-
const calls:Array<[string,Record<string,unknown>|undefined]>=[];let jobs:any[]=[]
|
|
44
|
-
const f=mount(async(m,p)=>{
|
|
45
|
-
calls.push([m,p])
|
|
46
|
-
switch(m){
|
|
47
|
-
case 'bg.status':return status()
|
|
48
|
-
case 'bg.jobs.list':return {jobs}
|
|
49
|
-
case 'bg.browse':return browse(p)
|
|
50
|
-
case 'bg.jobs.submit':jobs=[{id:'j1',name:'fixture.bin',state:'queued'}];return {job:jobs[0],duplicate:false}
|
|
51
|
-
case 'bg.jobs.cancel':jobs=[{...jobs[0],state:'canceled'}];return {job:jobs[0]}
|
|
52
|
-
case 'bg.jobs.result':return {result:{sha256:'x'}}
|
|
53
|
-
}
|
|
54
|
-
});await settle()
|
|
55
|
-
const copy=backgroundCopy('en'),pick=nasCopy('en')
|
|
56
|
-
expect(f.root.querySelector('[data-bg-folder]')).toBeNull();expect(f.root.querySelector('[data-bg-file]')).toBeNull()
|
|
57
|
-
const submitButton=()=>[...f.root.querySelectorAll('button')].find(b=>b.textContent?.trim()===copy.submit)!
|
|
58
|
-
expect(submitButton().disabled).toBe(true)
|
|
59
|
-
click(f.root,copy.chooseFile);await settle()
|
|
60
|
-
click(f.root,'share');await settle()
|
|
61
|
-
click(f.root,pick.selectAction);await settle();click(f.root,pick.confirm);await settle()
|
|
62
|
-
expect(f.root.textContent).toContain('/share/fixture.bin')
|
|
63
|
-
expect(submitButton().disabled).toBe(false)
|
|
64
|
-
click(f.root,copy.submit);await settle()
|
|
65
|
-
const submit=calls.find(c=>c[0]==='bg.jobs.submit')![1]!
|
|
66
|
-
expect(submit.folder).toBe('/share');expect(submit.relative).toBe('fixture.bin');expect(submit.key).toMatch(/^[a-f0-9]{32}$/)
|
|
67
|
-
expect(f.root.querySelector('[data-job-state=queued]')).not.toBeNull()
|
|
68
|
-
click(f.root,copy.cancel);await settle()
|
|
69
|
-
expect(f.root.querySelector('[data-job-state=canceled]')).not.toBeNull()
|
|
70
|
-
expect(calls.filter(c=>c[0]==='bg.browse').length).toBeGreaterThan(0)
|
|
71
|
-
expect(calls.every(c=>/^bg\./.test(c[0]))).toBe(true)
|
|
72
|
-
f.close()
|
|
73
|
-
})
|
|
74
|
-
test('a denied listing shows a localized error and cannot submit',async()=>{
|
|
75
|
-
const f=mount(async(m)=>{
|
|
76
|
-
if(m==='bg.status')return status()
|
|
77
|
-
if(m==='bg.jobs.list')return {jobs:[]}
|
|
78
|
-
if(m==='bg.browse')throw {code:'denied',message:'Cookie=CANARY'}
|
|
79
|
-
});await settle()
|
|
80
|
-
click(f.root,backgroundCopy('en').chooseFile);await settle()
|
|
81
|
-
expect(f.root.textContent).toContain(nasCopy('en').errorDenied);expect(f.root.textContent).not.toContain('CANARY')
|
|
82
|
-
expect([...f.root.querySelectorAll('button')].find(b=>b.textContent?.trim()===backgroundCopy('en').submit)!.disabled).toBe(true)
|
|
83
|
-
f.close()
|
|
84
|
-
})
|
|
85
|
-
test('nine locales have identical keys and placeholders',()=>{
|
|
86
|
-
const en=backgroundCatalogs.en,flat=(o:any,p=''):Record<string,string>=>Object.fromEntries(Object.entries(o).flatMap(([k,v])=>typeof v==='string'?[[p+k,v]]:Object.entries(flat(v,`${p}${k}.`))))
|
|
87
|
-
const base=flat(en)
|
|
88
|
-
expect(Object.keys(backgroundCatalogs).sort()).toEqual(['de','en','es','fr','it','ja','ko','zh-CN','zh-TW'])
|
|
89
|
-
for(const catalog of Object.values(backgroundCatalogs)){
|
|
90
|
-
const map=flat(catalog);expect(Object.keys(map).sort()).toEqual(Object.keys(base).sort())
|
|
91
|
-
for(const [k,v] of Object.entries(map)){expect(v.length).toBeGreaterThan(0);expect(v.match(/\{\w+\}/g)??[]).toEqual(base[k].match(/\{\w+\}/g)??[])}
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
test('a null job list from the worker renders as no jobs',async()=>{
|
|
96
|
-
const f=mount(async m=>m==='bg.status'?status():m==='bg.jobs.list'?{jobs:null}:{});await settle()
|
|
97
|
-
expect(f.root.textContent).toContain(backgroundCopy('en').noJobs);f.close()
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
// One test per locale: each mounts its own app, so a slow host cannot push nine mounts past one test timeout.
|
|
101
|
-
test.each(Object.keys(backgroundCatalogs))('the picker dialog explains the one-time read in %s',async locale=>{
|
|
102
|
-
const f=mount(async(m,p)=>m==='bg.status'?status():m==='bg.jobs.list'?{jobs:[]}:browse(p),locale);await settle()
|
|
103
|
-
const copy=backgroundCopy(locale)
|
|
104
|
-
click(f.root,copy.chooseFile);await settle()
|
|
105
|
-
const dialog=f.root.querySelector('[role=dialog]')!.textContent!
|
|
106
|
-
expect(dialog).toContain(copy.pickerConsent)
|
|
107
|
-
f.close()
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
test('ordinary owner can submit but has no administrator controls',async()=>{
|
|
111
|
-
const calls:string[]=[]
|
|
112
|
-
const f=mount(async(m,p)=>{calls.push(m);if(m==='bg.status')return {...status(),admin:false};if(m==='bg.jobs.list')return {jobs:[{id:'owned',name:'owned.bin',state:'queued',submitter:{user:'bob',uid:'1025'}}]};if(m==='bg.browse')return browse(p);return {}});await settle()
|
|
113
|
-
const c=backgroundCopy('en')
|
|
114
|
-
expect(f.root.textContent).toContain(c.ownerScope)
|
|
115
|
-
expect(f.root.textContent).not.toContain(c.purgeOwner)
|
|
116
|
-
expect([...f.root.querySelectorAll('button')].some(b=>b.textContent?.trim()===c.chooseFile)).toBe(true)
|
|
117
|
-
click(f.root,c.cancel);await settle();expect(calls).toContain('bg.jobs.cancel');f.close()
|
|
118
|
-
})
|
|
119
|
-
test('admin exact owner purge requires explicit confirmation',async()=>{
|
|
120
|
-
const calls:Array<[string,Record<string,unknown>|undefined]>=[]
|
|
121
|
-
const f=mount(async(m,p)=>{calls.push([m,p]);if(m==='bg.status')return {...status(),admin:true};if(m==='bg.jobs.list')return {jobs:[{id:'one',name:'a',state:'succeeded',submitter:{user:'bob',uid:'1025'}}]};return {}});await settle()
|
|
122
|
-
const c=backgroundCopy('en')
|
|
123
|
-
click(f.root,c.purgeOwner);await settle();expect(calls.some(([m])=>m==='bg.jobs.purge')).toBe(false)
|
|
124
|
-
click(f.root,c.confirmPurge);await settle()
|
|
125
|
-
expect(calls.find(([m])=>m==='bg.jobs.purge')?.[1]).toEqual({owner:{user:'bob',uid:'1025'}});f.close()
|
|
126
|
-
})
|
|
127
|
-
test('malformed status cannot render action controls or crash the panel',async()=>{
|
|
128
|
-
const f=mount(async()=>({state:'not-enabled'}));await settle()
|
|
129
|
-
expect(f.root.textContent).toContain(backgroundCopy('en').errors.failed)
|
|
130
|
-
expect(f.root.querySelector('button')).toBeNull();f.close()
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
test('schedule creation requires copy consent; owner controls disable and delete exact schedule',async()=>{
|
|
134
|
-
const calls:Array<[string,Record<string,unknown>|undefined]>=[];let schedules:any[]=[]
|
|
135
|
-
const f=mount(async(m,p)=>{calls.push([m,p]);switch(m){
|
|
136
|
-
case 'bg.status':return {...status(),owner:{user:'bob',uid:'1025'},admin:false}
|
|
137
|
-
case 'bg.jobs.list':return {jobs:[{id:'import',name:'copy.bin',state:'succeeded',copyRetained:true,submitter:{user:'bob',uid:'1025'}}]}
|
|
138
|
-
case 'bg.schedules.list':return {schedules}
|
|
139
|
-
case 'bg.schedules.create':schedules=[{id:'schedule',name:'copy.bin',owner:{user:'bob',uid:'1025'},enabled:true,intervalSeconds:3600,nextAt:'2026-10-05T01:00:00Z',missed:0,workerRevision:1}];return {schedule:schedules[0]}
|
|
140
|
-
case 'bg.schedules.disable':schedules=[{...schedules[0],enabled:false}];return {schedule:schedules[0]}
|
|
141
|
-
case 'bg.schedules.delete':schedules=[];return {deleted:true}
|
|
142
|
-
default:return {}
|
|
143
|
-
}});await settle();const c=backgroundCopy('en')
|
|
144
|
-
click(f.root,c.scheduleCopy);await settle()
|
|
145
|
-
expect(calls.some(([m])=>m==='bg.schedules.create')).toBe(false)
|
|
146
|
-
const create=[...f.root.querySelectorAll('button')].find(b=>b.textContent?.trim()===c.createSchedule)!
|
|
147
|
-
expect(create.disabled).toBe(true)
|
|
148
|
-
await choose(f.root,'data-schedule-interval',c.weekly)
|
|
149
|
-
const consent=f.root.querySelector<HTMLElement>('[data-schedule-consent] [role=checkbox], [role=checkbox][data-schedule-consent]')!;consent.click();await settle()
|
|
150
|
-
click(f.root,c.createSchedule);await settle()
|
|
151
|
-
expect(calls.find(([m])=>m==='bg.schedules.create')?.[1]).toMatchObject({jobId:'import',intervalSeconds:604800,consent:true})
|
|
152
|
-
expect(calls.find(([m])=>m==='bg.schedules.create')?.[1]?.key).toMatch(/^[a-f0-9]{32}$/)
|
|
153
|
-
expect(f.root.querySelector('[data-schedule-id=schedule]')?.textContent).toContain(c.nextRun.replace('{time}','').trim().split(':')[0])
|
|
154
|
-
click(f.root,c.disableSchedule);await settle();expect(calls.find(([m])=>m==='bg.schedules.disable')?.[1]).toEqual({id:'schedule'})
|
|
155
|
-
click(f.root,c.deleteSchedule);await settle();expect(calls.some(([m])=>m==='bg.schedules.delete')).toBe(false)
|
|
156
|
-
click(f.root,c.confirmDeleteSchedule);await settle();expect(calls.find(([m])=>m==='bg.schedules.delete')?.[1]).toEqual({id:'schedule'});f.close()
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
test('administrator sees the exact selected copy before enabling a schedule',async()=>{
|
|
160
|
-
const calls:Array<[string,Record<string,unknown>|undefined]>=[]
|
|
161
|
-
const name='private-'.padEnd(128,'x')
|
|
162
|
-
const f=mount(async(m,p)=>{calls.push([m,p]);if(m==='bg.status')return status();if(m==='bg.jobs.list')return {jobs:[]};if(m==='bg.schedules.list')return {schedules:[{id:'disabled',name,owner:{user:'normal1',uid:'1025'},enabled:false,nextAt:'2026-10-05T01:00:00Z',missed:0}]};return {}});await settle()
|
|
163
|
-
const c=backgroundCopy('en');click(f.root,c.enableSchedule);await settle()
|
|
164
|
-
const expected=c.enableScheduleConsent.replace('{name}',name)
|
|
165
|
-
expect(expected).toContain(name);expect(f.root.textContent).toContain(expected)
|
|
166
|
-
expect(calls.some(([m])=>m==='bg.schedules.enable')).toBe(false)
|
|
167
|
-
click(f.root,c.confirmEnableSchedule);await settle()
|
|
168
|
-
expect(calls.find(([m])=>m==='bg.schedules.enable')?.[1]).toEqual({id:'disabled',consent:true});f.close()
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
// Same rule as the base template (test/native-controls.test.ts): UI components only, and the
|
|
172
|
-
// UI's own Form auto layout and FormItem id binding instead of per-app workarounds.
|
|
173
|
-
test('the background panel uses only UI components and the UI form binding',()=>{
|
|
174
|
-
const template=readFileSync(join(__dirname,'../src/background/BackgroundPanel.vue'),'utf8').replace(/<script[\s\S]*?<\/script>/g,'').replace(/<style[\s\S]*?<\/style>/g,'')
|
|
175
|
-
expect(template.match(/<(?:a|input|select|textarea|label)[\s>/]/g)).toBeNull()
|
|
176
|
-
expect(template).not.toMatch(/direction="vertical"|field\.controlId|role="group"/)
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
test('fresh ordinary user can pick and submit without administrator switches',async()=>{
|
|
180
|
-
const calls:string[]=[]
|
|
181
|
-
const f=mount(async(m,p)=>{calls.push(m);if(m==='bg.status')return {...status(),admin:false}
|
|
182
|
-
if(m==='bg.browse')return browse(p);if(m==='bg.jobs.list')return {jobs:[]};return {schedules:[]}});await settle()
|
|
183
|
-
click(f.root,backgroundCopy('en').chooseFile);await settle()
|
|
184
|
-
expect(calls).toContain('bg.browse')
|
|
185
|
-
expect(calls).not.toContain('bg.mode.set');expect(calls).not.toContain('bg.users.set');f.close()
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
test.each(Object.keys(backgroundCatalogs))('jobs_busy renders a retry message in %s and permits retry',async locale=>{
|
|
189
|
-
let attempts=0
|
|
190
|
-
const f=mount(async(m)=>{
|
|
191
|
-
if(m==='bg.status')return status()
|
|
192
|
-
if(m==='bg.jobs.list'){
|
|
193
|
-
if(attempts++===0)throw {code:'jobs_busy',message:'CANARY'}
|
|
194
|
-
return {jobs:[]}
|
|
195
|
-
}
|
|
196
|
-
return {schedules:[]}
|
|
197
|
-
},locale);await settle()
|
|
198
|
-
const copy=backgroundCopy(locale)
|
|
199
|
-
expect(copy.errors.jobs_busy).toBeTruthy()
|
|
200
|
-
expect(copy.errors.jobs_busy).not.toBe(copy.errors.failed)
|
|
201
|
-
expect(f.root.querySelector('[role=alert]')?.textContent).toBe(copy.errors.jobs_busy)
|
|
202
|
-
expect(f.root.textContent).not.toContain('CANARY')
|
|
203
|
-
click(f.root,copy.refresh);await settle();expect(attempts).toBe(2)
|
|
204
|
-
f.close()
|
|
205
|
-
})
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
package app
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"bufio"
|
|
5
|
-
"context"
|
|
6
|
-
"encoding/json"
|
|
7
|
-
"errors"
|
|
8
|
-
"net"
|
|
9
|
-
"net/http"
|
|
10
|
-
"os"
|
|
11
|
-
"path/filepath"
|
|
12
|
-
"strings"
|
|
13
|
-
"syscall"
|
|
14
|
-
"time"
|
|
15
|
-
|
|
16
|
-
"dsmapp/internal/api"
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
func (cfg Config) rootRoutes() []api.Route {
|
|
20
|
-
return []api.Route{
|
|
21
|
-
api.Handle("executor.control", cfg.executorControl),
|
|
22
|
-
api.Handle("executor.status", cfg.executorStatus),
|
|
23
|
-
api.HandleRequest("root.run", cfg.executorRootRun),
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// API permissions default to administrators for unlisted methods. Check here
|
|
28
|
-
// too: control mutates the fixed package-owned control file before DSM run.
|
|
29
|
-
func (cfg Config) executorControl(_ context.Context, caller api.Caller, raw json.RawMessage) (any, error) {
|
|
30
|
-
if !caller.Admin() {
|
|
31
|
-
return nil, errors.New("admin_required")
|
|
32
|
-
}
|
|
33
|
-
var in struct {
|
|
34
|
-
Action string `json:"action"`
|
|
35
|
-
}
|
|
36
|
-
if err := decodeParams(raw, &in); err != nil {
|
|
37
|
-
return nil, err
|
|
38
|
-
}
|
|
39
|
-
if in.Action != "start" && in.Action != "stop" && in.Action != "purge" {
|
|
40
|
-
return nil, api.BadRequest("executor_control_invalid")
|
|
41
|
-
}
|
|
42
|
-
dir := filepath.Join(cfg.DataDir, "executor")
|
|
43
|
-
if err := os.MkdirAll(dir, 0700); err != nil {
|
|
44
|
-
return nil, err
|
|
45
|
-
}
|
|
46
|
-
info, err := os.Lstat(dir)
|
|
47
|
-
if err != nil || !info.IsDir() || info.Mode()&os.ModeSymlink != 0 {
|
|
48
|
-
return nil, errors.New("executor_control_directory_invalid")
|
|
49
|
-
}
|
|
50
|
-
if err := writeFileAtomic(filepath.Join(dir, "control"), []byte(in.Action)); err != nil {
|
|
51
|
-
return nil, err
|
|
52
|
-
}
|
|
53
|
-
return map[string]bool{"written": true}, nil
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// The executor closes its socket while paused: the package is stopped, or an
|
|
57
|
-
// upgrade changed the pins and awaits administrator approval.
|
|
58
|
-
func (cfg Config) executorStatus(ctx context.Context, _ api.Caller, _ json.RawMessage) (any, error) {
|
|
59
|
-
status, err := cfg.executorRequest(ctx, "status", nil, nil)
|
|
60
|
-
if errors.Is(err, syscall.ENOENT) || errors.Is(err, syscall.ECONNREFUSED) {
|
|
61
|
-
next := "Start the package."
|
|
62
|
-
if cfg.startRequested() {
|
|
63
|
-
next = "The package is running: an administrator approves background access again in Administrator setup; the executor log names the cause."
|
|
64
|
-
}
|
|
65
|
-
return map[string]any{"ready": false, "state": "paused", "reason": "executor_not_listening", "next": next}, nil
|
|
66
|
-
}
|
|
67
|
-
return status, err
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Package start and stop write the lifecycle mailbox; its last request tells a
|
|
71
|
-
// stopped package from a running one whose executor stays paused.
|
|
72
|
-
func (cfg Config) startRequested() bool {
|
|
73
|
-
f, err := os.Open(filepath.Join(cfg.DataDir, "executor", "control"))
|
|
74
|
-
if err != nil {
|
|
75
|
-
return false
|
|
76
|
-
}
|
|
77
|
-
defer f.Close()
|
|
78
|
-
b := make([]byte, 16)
|
|
79
|
-
n, _ := f.Read(b)
|
|
80
|
-
return strings.TrimSpace(string(b[:n])) == "start"
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
func (cfg Config) executorRootRun(ctx context.Context, caller api.Caller, req *http.Request, raw json.RawMessage) (any, error) {
|
|
84
|
-
if !caller.Admin() {
|
|
85
|
-
return nil, errors.New("admin_required")
|
|
86
|
-
}
|
|
87
|
-
var in struct {
|
|
88
|
-
Name string `json:"name"`
|
|
89
|
-
}
|
|
90
|
-
if err := decodeParams(raw, &in); err != nil {
|
|
91
|
-
return nil, err
|
|
92
|
-
}
|
|
93
|
-
// Executor independently verifies both session values and administrator identity.
|
|
94
|
-
auth, err := api.DSMSession(req)
|
|
95
|
-
if err != nil {
|
|
96
|
-
return nil, err
|
|
97
|
-
}
|
|
98
|
-
return cfg.executorRequest(ctx, "root.run", auth, map[string]string{"name": in.Name})
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// executorSocketBase is a variable so tests can use a temporary directory.
|
|
102
|
-
var executorSocketBase = "/run/synopkgland"
|
|
103
|
-
|
|
104
|
-
func (cfg Config) executorRequest(ctx context.Context, op string, auth, params any) (any, error) {
|
|
105
|
-
conn, err := (&net.Dialer{Timeout: 5 * time.Second}).DialContext(ctx, "unix", filepath.Join(executorSocketBase, cfg.PackageID, "executor.sock"))
|
|
106
|
-
if err != nil {
|
|
107
|
-
return nil, err
|
|
108
|
-
}
|
|
109
|
-
defer conn.Close()
|
|
110
|
-
if err := conn.SetDeadline(time.Now().Add(30 * time.Second)); err != nil {
|
|
111
|
-
return nil, err
|
|
112
|
-
}
|
|
113
|
-
if auth == nil {
|
|
114
|
-
auth = map[string]any{}
|
|
115
|
-
}
|
|
116
|
-
if params == nil {
|
|
117
|
-
params = map[string]any{}
|
|
118
|
-
}
|
|
119
|
-
if err := json.NewEncoder(conn).Encode(map[string]any{"v": 1, "op": op, "auth": auth, "params": params}); err != nil {
|
|
120
|
-
return nil, err
|
|
121
|
-
}
|
|
122
|
-
scanner := bufio.NewScanner(conn)
|
|
123
|
-
scanner.Buffer(make([]byte, 4096), 64*1024)
|
|
124
|
-
if !scanner.Scan() {
|
|
125
|
-
return nil, errors.New("executor_response_invalid")
|
|
126
|
-
}
|
|
127
|
-
var response struct {
|
|
128
|
-
OK bool `json:"ok"`
|
|
129
|
-
Result json.RawMessage `json:"result"`
|
|
130
|
-
Code string `json:"code"`
|
|
131
|
-
Message string `json:"message"`
|
|
132
|
-
}
|
|
133
|
-
if err := json.Unmarshal(scanner.Bytes(), &response); err != nil {
|
|
134
|
-
return nil, err
|
|
135
|
-
}
|
|
136
|
-
if !response.OK {
|
|
137
|
-
return nil, errors.New(response.Code + ": " + response.Message)
|
|
138
|
-
}
|
|
139
|
-
return response.Result, nil
|
|
140
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
package app
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"net"
|
|
5
|
-
"os"
|
|
6
|
-
"path/filepath"
|
|
7
|
-
"strings"
|
|
8
|
-
"testing"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
func init() {
|
|
12
|
-
sampleParams["executor.control"] = `{"action":"stop"}`
|
|
13
|
-
sampleParams["executor.status"] = `{}`
|
|
14
|
-
sampleParams["root.run"] = `{"name":"whoami"}`
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
func TestExecutorControlAcceptsOnlyFixedActions(t *testing.T) {
|
|
18
|
-
cfg := testConfig(t)
|
|
19
|
-
for _, action := range []string{"start", "stop", "purge"} {
|
|
20
|
-
code, out := call(t, cfg, alice, "executor.control", `{"action":"`+action+`"}`)
|
|
21
|
-
if code != "" {
|
|
22
|
-
t.Fatalf("%s: %s %v", action, code, out)
|
|
23
|
-
}
|
|
24
|
-
b, err := os.ReadFile(filepath.Join(cfg.DataDir, "executor/control"))
|
|
25
|
-
if err != nil || string(b) != action {
|
|
26
|
-
t.Fatalf("control was not written: %s %v", b, err)
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
for _, raw := range []string{`{"action":"start;id"}`, `{"action":"start\nstop"}`, `{"action":""}`, `{"action":"stop","path":"/etc/passwd"}`} {
|
|
30
|
-
if code, _ := call(t, cfg, alice, "executor.control", raw); code != "bad_request" {
|
|
31
|
-
t.Fatalf("accepted %s: %s", raw, code)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
func TestExecutorControlRejectsSymlinkDirectory(t *testing.T) {
|
|
37
|
-
cfg := testConfig(t)
|
|
38
|
-
outside := t.TempDir()
|
|
39
|
-
if err := os.Symlink(outside, filepath.Join(cfg.DataDir, "executor")); err != nil {
|
|
40
|
-
t.Fatal(err)
|
|
41
|
-
}
|
|
42
|
-
if code, _ := call(t, cfg, alice, "executor.control", `{"action":"stop"}`); code == "" {
|
|
43
|
-
t.Fatal("accepted symlink")
|
|
44
|
-
}
|
|
45
|
-
if _, err := os.Stat(filepath.Join(outside, "control")); !os.IsNotExist(err) {
|
|
46
|
-
t.Fatal("wrote outside data directory")
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
func TestExecutorRootRunRequiresCurrentDSMCookie(t *testing.T) {
|
|
51
|
-
t.Setenv("HTTP_COOKIE", "")
|
|
52
|
-
if code, _ := call(t, testConfig(t), alice, "root.run", `{"name":"whoami"}`); code == "" {
|
|
53
|
-
t.Fatal("root.run accepted absent DSM cookie")
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// The executor closes its listener while paused (package stopped, or pins
|
|
58
|
-
// awaiting administrator approval). Status then answers, not "internal".
|
|
59
|
-
func TestExecutorStatusReportsAPausedExecutor(t *testing.T) {
|
|
60
|
-
cfg := testConfig(t)
|
|
61
|
-
previous := executorSocketBase
|
|
62
|
-
// A short base: unix socket paths are limited to about 100 bytes.
|
|
63
|
-
base, err := os.MkdirTemp("/tmp", "exec")
|
|
64
|
-
if err != nil {
|
|
65
|
-
t.Fatal(err)
|
|
66
|
-
}
|
|
67
|
-
executorSocketBase = base
|
|
68
|
-
defer func() { executorSocketBase = previous; os.RemoveAll(base) }()
|
|
69
|
-
check := func(name string) {
|
|
70
|
-
t.Helper()
|
|
71
|
-
code, envelope := call(t, cfg, alice, "executor.status", `{}`)
|
|
72
|
-
out, _ := envelope["data"].(map[string]any)
|
|
73
|
-
if code != "" || out["ready"] != false || out["state"] != "paused" || out["reason"] != "executor_not_listening" || out["next"] == "" || out["next"] == nil {
|
|
74
|
-
t.Fatalf("%s: %s %v", name, code, out)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
check("no socket")
|
|
78
|
-
if code, _ := call(t, cfg, bob, "executor.status", `{}`); code != "" {
|
|
79
|
-
t.Fatal("authenticated user cannot read a paused status", code)
|
|
80
|
-
}
|
|
81
|
-
dir := filepath.Join(executorSocketBase, cfg.PackageID)
|
|
82
|
-
os.MkdirAll(dir, 0700)
|
|
83
|
-
ln, err := net.ListenUnix("unix", &net.UnixAddr{Name: filepath.Join(dir, "executor.sock"), Net: "unix"})
|
|
84
|
-
if err != nil {
|
|
85
|
-
t.Fatal(err)
|
|
86
|
-
}
|
|
87
|
-
ln.SetUnlinkOnClose(false)
|
|
88
|
-
ln.Close()
|
|
89
|
-
check("closed listener")
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// next follows the last lifecycle request: a running package needs approval
|
|
93
|
-
// again, not a start.
|
|
94
|
-
func TestExecutorStatusNextFollowsTheLifecycleRequest(t *testing.T) {
|
|
95
|
-
cfg := testConfig(t)
|
|
96
|
-
previous := executorSocketBase
|
|
97
|
-
executorSocketBase = t.TempDir()
|
|
98
|
-
defer func() { executorSocketBase = previous }()
|
|
99
|
-
next := func() string {
|
|
100
|
-
t.Helper()
|
|
101
|
-
_, envelope := call(t, cfg, alice, "executor.status", `{}`)
|
|
102
|
-
out, _ := envelope["data"].(map[string]any)
|
|
103
|
-
s, _ := out["next"].(string)
|
|
104
|
-
return s
|
|
105
|
-
}
|
|
106
|
-
if !strings.HasPrefix(next(), "Start the package.") {
|
|
107
|
-
t.Fatal("no request:", next())
|
|
108
|
-
}
|
|
109
|
-
mailbox := filepath.Join(cfg.DataDir, "executor")
|
|
110
|
-
os.MkdirAll(mailbox, 0700)
|
|
111
|
-
for request, start := range map[string]bool{"stop\n": true, "start\n": false, "start": false} {
|
|
112
|
-
os.WriteFile(filepath.Join(mailbox, "control"), []byte(request), 0600)
|
|
113
|
-
if got := next(); strings.HasPrefix(got, "Start the package") != start || got == "" {
|
|
114
|
-
t.Fatalf("%q: %s", request, got)
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Native Go with Vue
|
|
2
|
-
|
|
3
|
-
Edit `frontend/src/App.vue` and `main.ts` to build a DSM-window app with the
|
|
4
|
-
public `@synopackageland/ui` components and embedded theme.
|
|
5
|
-
|
|
6
|
-
```sh
|
|
7
|
-
cd frontend
|
|
8
|
-
npm ci
|
|
9
|
-
npm test
|
|
10
|
-
npm run build
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
The base app reads package status and edits the package greeting through
|
|
14
|
-
`ctx.call`. Each window has its own Vue mount, request state and host
|
|
15
|
-
subscriptions; unmount disposes subscriptions and ignores late responses.
|
|
16
|
-
|
|
17
|
-
`--with root-ops` adds the existing DSM approval gate for fixed `root/*.sh`
|
|
18
|
-
operations. `--with jobs` adds package-account jobs and schedules; it combines with root-ops and files. `--with files` enables current-session File Station access,
|
|
19
|
-
and the background picker uses the retained session provider.
|
|
20
|
-
|
|
21
|
-
With `portal:` declared (`synopkgland add portal`), the status page shows
|
|
22
|
-
`src/portal/PortalSettings.vue`: the DSM Application Portal link, the alias form
|
|
23
|
-
for administrators, and the Control Panel shortcut.
|
|
24
|
-
|
|
25
|
-
Use public library controls, the embedded theme, per-app modal scope and unique
|
|
26
|
-
Vue ID prefixes. Backend route permissions and DSM checks remain authoritative.
|
|
27
|
-
Generated build and unit tests do not establish NAS runtime acceptance.
|
|
28
|
-
|
|
29
|
-
The manifest is dsm-package.yaml schema 2: backend.kind: go and capabilities.files: session, jobs: true, identity: standalone, rootOps: true. Use --with login to declare standalone identity. Existing projects use synopkgland add <cap>...; app entrypoints stay app-owned, SDK conflicts are refused. check, inspect, build, deploy and status accept --json.
|
|
30
|
-
|
|
31
|
-
Use the installed `@synopackageland/ui`; package.json and the lockfile pin its version and integrity.
|
|
32
|
-
`AppRoot` defaults to app modal scope and stays bounded at `height: 100%`;
|
|
33
|
-
`AppLayout wide-layout="window"` keeps the DSM shell in window mode even when
|
|
34
|
-
maximized. Only whole-page web/Portal apps should opt into document scope or
|
|
35
|
-
`wide-layout="web"`. The DSM host sets the 700px minimum window width.
|
|
36
|
-
Import `themes/dsm7-embedded.css` and assign each mount a unique
|
|
37
|
-
`app.config.idPrefix` before mounting.
|
|
38
|
-
|
|
39
|
-
Start with AGENTS.md, `synopkgland skill list` and `synopkgland skill path`.
|
|
40
|
-
Read `synopkgland skill show ui-vue` for direct Vue component work and
|
|
41
|
-
`synopkgland skill show ui-json` for optional declarative specs and their
|
|
42
|
-
validate/render workflow. The existing host/backend lifecycle remains in place.
|
|
43
|
-
|
|
44
|
-
For UI discovery, run `npx --no syno-pkg-land-ui catalog --json` and
|
|
45
|
-
`npx --no syno-pkg-land-ui describe Button --json` from the installed frontend.
|
|
46
|
-
Read its prompt and exported Vue docs/types before choosing component APIs.
|
|
47
|
-
Use `syno-pkg-land-ui` directly in npm scripts; keep AI guidance version-independent.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Native DSM Vue template
|
|
3
|
-
description: Existing package settings UI using the installed @synopackageland/ui.
|
|
4
|
-
typography:
|
|
5
|
-
body:
|
|
6
|
-
fontFamily: "var(--ui-font-sans)"
|
|
7
|
-
fontSize: "13px"
|
|
8
|
-
lineHeight: 1.5
|
|
9
|
-
title:
|
|
10
|
-
fontSize: "20px"
|
|
11
|
-
fontWeight: 600
|
|
12
|
-
state:
|
|
13
|
-
fontSize: "15px"
|
|
14
|
-
fontWeight: 600
|
|
15
|
-
spacing:
|
|
16
|
-
actions: "8px"
|
|
17
|
-
heading-gap: "16px"
|
|
18
|
-
section-gap: "24px"
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
# Design System: Native DSM Vue template
|
|
22
|
-
|
|
23
|
-
Read `AGENTS.md` at the project root and `synopkgland skill show ui-vue` before UI edits.
|
|
24
|
-
|
|
25
|
-
For UI discovery, run `npx --no syno-pkg-land-ui catalog --json` and
|
|
26
|
-
`npx --no syno-pkg-land-ui describe Button --json` from the installed frontend.
|
|
27
|
-
Read its prompt and exported Vue docs/types before choosing component APIs.
|
|
28
|
-
Use `syno-pkg-land-ui` directly in npm scripts; keep AI guidance version-independent.
|
|
29
|
-
|
|
30
|
-
## Overview
|
|
31
|
-
|
|
32
|
-
The template runs inside a DSM package window. `AppShell` provides status and
|
|
33
|
-
optional background navigation. The base page shows package status and a greeting
|
|
34
|
-
editor; the root overlay adds its existing fixed-operation authorization gate.
|
|
35
|
-
|
|
36
|
-
Use the installed `@synopackageland/ui` controls and `themes/dsm7-embedded.css`.
|
|
37
|
-
The theme owns colors, typography, spacing and dialogs. Keep per-app modal scope,
|
|
38
|
-
a unique Vue ID prefix and vertical scrolling at the DSM minimum window size.
|
|
39
|
-
|
|
40
|
-
Refresh and save expose busy state and localized errors. Reopen refreshes status.
|
|
41
|
-
Each mount owns its state; unmount unsubscribes from host events and ignores late
|
|
42
|
-
responses. Backend route policies decide access.
|
|
43
|
-
|
|
44
|
-
### Opt-in background schedules (S1-a)
|
|
45
|
-
|
|
46
|
-
The `native-go-jobs` overlay extends this **Operate** surface within the inherited `AppRoot`, embedded theme, `SettingsSection`, Button and Callout system. It introduces no new palette or global tokens.
|
|
47
|
-
|
|
48
|
-
- **Private-copy consent:** “Schedule this copy” is available for the signed-in owner's retained, successful, unscheduled job copy. “Private copy: {name}” identifies the input; “Repeat every” offers “Hour”, “Day” and “Week”. “Create schedule” stays disabled until the user checks “I agree to keep and reprocess this fixed copy as the package user. No new source files or personal ACLs are read.” The help explains the eight-schedule limit and that missed runs are recorded, never replayed.
|
|
49
|
-
- **Ownership and recovery:** preserve user-and-UID owner isolation. Administrator rows expose “Owner: {user} (UID {uid})”. A worker change shows “The worker revision changed. An administrator must review and explicitly enable this schedule.” Only administrators, while background mode is on, see “Enable schedule”. Its confirmation names the exact private copy: “Enable the schedule for {name} with the current worker revision? I agree to reprocess this fixed copy. Past runs will not be replayed.” Actions are “Confirm enable” and “Cancel”.
|
|
50
|
-
- **Layout:** schedule name/state, owner, next run, missed runs and warnings stack above a grouped, wrapping action row. Long names and copy wrap within the available width. Keep the inherited vertical scrolling at the minimum window size; do not squeeze schedules into one viewport. The labeled select and consent checkbox retain visible keyboard focus using existing theme tokens.
|
|
51
|
-
- **Errors and cleanup:** danger alerts map known error codes to localized safe copy, with a localized fallback rather than raw server text. The catalogs cover nine locales. Preserve per-mount disposal: stop polling, dispose the picker, revoke result download URLs and prevent pending responses from restoring disposed state. Deletion confirmation explains that queued jobs cancel, running jobs drain and finished results remain.
|
|
52
|
-
|
|
53
|
-
Evidence: `.herdr-project/syno-package-land-sdk-t-0129/library/ui-desktop.png` and `ui-minimum.png` are local component-fixture captures. The finish review disposition is **ship**, with all three material findings resolved. A fresh `normal1` NAS browser readback passed before the final UI adjustments; these captures validate the final adjustments locally and do not establish final DSM visual acceptance.
|
|
54
|
-
|
|
55
|
-
## Do's and Don'ts
|
|
56
|
-
|
|
57
|
-
- Do use existing public UI components, embedded theme tokens and state/recovery copy.
|
|
58
|
-
- Do retain permission gating, readable loading/empty/error states and per-instance cleanup.
|
|
59
|
-
- Do use the library's `Select`, `Checkbox`, `Input`, `Textarea`, `Form`, `FormItem`, `FilePicker` (`variant="compact"`, in the app locale) and `Link` for controls; there is no native `<input>` or `<a>`. Leave `Form` on its automatic direction (labels stack below 520px of container width) and let a `FormItem` bind its control, with no `direction="vertical"`, `role="group"` or `field.controlId`.
|
|
60
|
-
- Do not infer authority from frontend observations or scheduler history.
|
|
61
|
-
- Don't introduce a separate palette, component system or modal workaround around the library contract.
|