@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,232 +0,0 @@
|
|
|
1
|
-
package lifecycle
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"context"
|
|
5
|
-
"os"
|
|
6
|
-
"path/filepath"
|
|
7
|
-
"strings"
|
|
8
|
-
"testing"
|
|
9
|
-
"time"
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
func TestRequestPersistsOfflineWithoutScheduler(t *testing.T) {
|
|
13
|
-
for _, action := range []string{"stop", "purge"} {
|
|
14
|
-
t.Run(action, func(t *testing.T) {
|
|
15
|
-
root := t.TempDir()
|
|
16
|
-
// No executor ever ran: its socket directory does not exist.
|
|
17
|
-
cfg := Config{Package: "TestApp", Data: root, Socket: filepath.Join(root, "run", "executor.sock")}
|
|
18
|
-
if err := Run(context.Background(), cfg, action); err != nil {
|
|
19
|
-
t.Fatal(err)
|
|
20
|
-
}
|
|
21
|
-
path := filepath.Join(root, "executor", "control")
|
|
22
|
-
b, err := os.ReadFile(path)
|
|
23
|
-
if err != nil || string(b) != action+"\n" {
|
|
24
|
-
t.Fatal(string(b), err)
|
|
25
|
-
}
|
|
26
|
-
info, _ := os.Stat(path)
|
|
27
|
-
if info.Mode().Perm() != 0600 {
|
|
28
|
-
t.Fatal(info.Mode())
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
func TestRequestWaitsForSocketAndTimeoutDoesNotBlockUninstall(t *testing.T) {
|
|
34
|
-
for _, action := range []string{"stop", "purge"} {
|
|
35
|
-
for _, timeout := range []bool{false, true} {
|
|
36
|
-
t.Run(action+"-"+map[bool]string{false: "confirmed", true: "timeout"}[timeout], func(t *testing.T) {
|
|
37
|
-
root := t.TempDir()
|
|
38
|
-
os.Mkdir(filepath.Join(root, "run"), 0750)
|
|
39
|
-
socket := filepath.Join(root, "run", "executor.sock")
|
|
40
|
-
os.WriteFile(socket, []byte{}, 0600)
|
|
41
|
-
warnings := []string{}
|
|
42
|
-
cfg := Config{Package: "TestApp", Data: root, Socket: socket, Log: func(s string) { warnings = append(warnings, s) }}
|
|
43
|
-
limit := 500 * time.Millisecond
|
|
44
|
-
if timeout {
|
|
45
|
-
limit = 50 * time.Millisecond
|
|
46
|
-
}
|
|
47
|
-
ctx, cancel := context.WithTimeout(context.Background(), limit)
|
|
48
|
-
defer cancel()
|
|
49
|
-
done := make(chan struct{})
|
|
50
|
-
if !timeout {
|
|
51
|
-
go func() {
|
|
52
|
-
defer close(done)
|
|
53
|
-
for {
|
|
54
|
-
if _, err := os.Stat(filepath.Join(root, "executor", "control")); err == nil {
|
|
55
|
-
// Pause closes the socket; purge ends with its directory.
|
|
56
|
-
if action == "purge" {
|
|
57
|
-
os.RemoveAll(filepath.Dir(socket))
|
|
58
|
-
} else {
|
|
59
|
-
os.Remove(socket)
|
|
60
|
-
}
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
select {
|
|
64
|
-
case <-ctx.Done():
|
|
65
|
-
return
|
|
66
|
-
case <-time.After(time.Millisecond):
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}()
|
|
70
|
-
} else {
|
|
71
|
-
close(done)
|
|
72
|
-
}
|
|
73
|
-
if err := Run(ctx, cfg, action); err != nil {
|
|
74
|
-
t.Fatal("uninstall was blocked:", err)
|
|
75
|
-
}
|
|
76
|
-
<-done
|
|
77
|
-
if !timeout && len(warnings) != 0 {
|
|
78
|
-
t.Fatal("confirmation timed out", warnings)
|
|
79
|
-
}
|
|
80
|
-
if timeout && (len(warnings) != 1 || !strings.Contains(warnings[0], "timeout")) {
|
|
81
|
-
t.Fatal("missing warning", warnings)
|
|
82
|
-
}
|
|
83
|
-
if _, err := os.Stat(filepath.Join(root, "executor", "control")); err != nil {
|
|
84
|
-
t.Fatal("pending purge lost", err)
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// A stopped package already paused the executor and removed its socket, so
|
|
92
|
-
// preuninst's purge must wait for the root purge itself: the executor removes
|
|
93
|
-
// its socket directory only after consuming purge. Returning earlier lets DSM
|
|
94
|
-
// delete the mailbox before the paused monitor polls it.
|
|
95
|
-
func TestPurgeOfPausedExecutorWaitsForSocketDirectoryRemoval(t *testing.T) {
|
|
96
|
-
root := t.TempDir()
|
|
97
|
-
dir := filepath.Join(root, "run")
|
|
98
|
-
os.Mkdir(dir, 0750)
|
|
99
|
-
cfg := Config{Package: "TestApp", Data: root, Socket: filepath.Join(dir, "executor.sock")}
|
|
100
|
-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
|
101
|
-
defer cancel()
|
|
102
|
-
consumed := make(chan time.Time, 1)
|
|
103
|
-
go func() {
|
|
104
|
-
for ctx.Err() == nil {
|
|
105
|
-
if b, _ := os.ReadFile(filepath.Join(root, "executor", "control")); string(b) == "purge\n" {
|
|
106
|
-
time.Sleep(300 * time.Millisecond)
|
|
107
|
-
consumed <- time.Now()
|
|
108
|
-
os.RemoveAll(dir)
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
time.Sleep(time.Millisecond)
|
|
112
|
-
}
|
|
113
|
-
}()
|
|
114
|
-
if err := Run(ctx, cfg, "purge"); err != nil {
|
|
115
|
-
t.Fatal(err)
|
|
116
|
-
}
|
|
117
|
-
select {
|
|
118
|
-
case <-consumed:
|
|
119
|
-
default:
|
|
120
|
-
t.Fatal("purge returned before the executor removed its socket directory")
|
|
121
|
-
}
|
|
122
|
-
if ctx.Err() != nil {
|
|
123
|
-
t.Fatal("purge confirmation timed out")
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
func TestStopOfPausedExecutorDoesNotWaitForSocketDirectory(t *testing.T) {
|
|
128
|
-
root := t.TempDir()
|
|
129
|
-
dir := filepath.Join(root, "run")
|
|
130
|
-
os.Mkdir(dir, 0750)
|
|
131
|
-
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
|
132
|
-
defer cancel()
|
|
133
|
-
if err := Run(ctx, Config{Package: "TestApp", Data: root, Socket: filepath.Join(dir, "executor.sock")}, "stop"); err != nil {
|
|
134
|
-
t.Fatal(err)
|
|
135
|
-
}
|
|
136
|
-
if ctx.Err() != nil {
|
|
137
|
-
t.Fatal("stop waited for the socket directory")
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
func TestRequestRejectsInvalidActionAndSymlink(t *testing.T) {
|
|
142
|
-
root := t.TempDir()
|
|
143
|
-
cfg := Config{Package: "TestApp", Data: root, Socket: filepath.Join(root, "socket")}
|
|
144
|
-
if Run(context.Background(), cfg, "resume") == nil {
|
|
145
|
-
t.Fatal("invalid action accepted")
|
|
146
|
-
}
|
|
147
|
-
os.Mkdir(filepath.Join(root, "executor"), 0700)
|
|
148
|
-
outside := filepath.Join(root, "outside")
|
|
149
|
-
os.WriteFile(outside, []byte("safe"), 0600)
|
|
150
|
-
os.Symlink(outside, filepath.Join(root, "executor", "control"))
|
|
151
|
-
if Run(context.Background(), cfg, "purge") == nil {
|
|
152
|
-
t.Fatal("symlink accepted")
|
|
153
|
-
}
|
|
154
|
-
b, _ := os.ReadFile(outside)
|
|
155
|
-
if string(b) != "safe" {
|
|
156
|
-
t.Fatal("outside changed")
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
func TestInaccessibleSocketDoesNotBlockStopOrUninstall(t *testing.T) {
|
|
161
|
-
// ENOTDIR is deterministic even under root, unlike chmod-based EACCES.
|
|
162
|
-
// Both are status inspection failures, not control-file write failures.
|
|
163
|
-
for _, action := range []string{"stop", "purge"} {
|
|
164
|
-
t.Run(action, func(t *testing.T) {
|
|
165
|
-
root := t.TempDir()
|
|
166
|
-
blocked := filepath.Join(root, "blocked")
|
|
167
|
-
os.WriteFile(blocked, []byte{}, 0600)
|
|
168
|
-
logged := false
|
|
169
|
-
cfg := Config{Package: "TestApp", Data: root, Socket: filepath.Join(blocked, "executor.sock"), Log: func(string) { logged = true }}
|
|
170
|
-
if err := Run(context.Background(), cfg, action); err != nil {
|
|
171
|
-
t.Fatal("socket inspection blocked lifecycle", err)
|
|
172
|
-
}
|
|
173
|
-
if !logged {
|
|
174
|
-
t.Fatal("missing inaccessible socket warning")
|
|
175
|
-
}
|
|
176
|
-
b, err := os.ReadFile(filepath.Join(root, "executor", "control"))
|
|
177
|
-
if err != nil || string(b) != action+"\n" {
|
|
178
|
-
t.Fatal(string(b), err)
|
|
179
|
-
}
|
|
180
|
-
})
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
func TestUnreadableSocketDirectoryStillPersistsStopAndPurge(t *testing.T) {
|
|
185
|
-
if os.Geteuid() == 0 {
|
|
186
|
-
t.Skip("EACCES requires an unprivileged process; ENOTDIR regression covers root")
|
|
187
|
-
}
|
|
188
|
-
for _, action := range []string{"stop", "purge"} {
|
|
189
|
-
t.Run(action, func(t *testing.T) {
|
|
190
|
-
root := t.TempDir()
|
|
191
|
-
dir := filepath.Join(root, "socket-dir")
|
|
192
|
-
os.Mkdir(dir, 0700)
|
|
193
|
-
os.WriteFile(filepath.Join(dir, "executor.sock"), nil, 0600)
|
|
194
|
-
os.Chmod(dir, 0)
|
|
195
|
-
defer os.Chmod(dir, 0700)
|
|
196
|
-
logged := false
|
|
197
|
-
cfg := Config{Package: "TestApp", Data: root, Socket: filepath.Join(dir, "executor.sock"), Log: func(string) { logged = true }}
|
|
198
|
-
if _, err := os.Lstat(cfg.Socket); !os.IsPermission(err) {
|
|
199
|
-
t.Fatal("fixture did not deny inspection", err)
|
|
200
|
-
}
|
|
201
|
-
if err := Run(context.Background(), cfg, action); err != nil {
|
|
202
|
-
t.Fatal("permission denial blocked lifecycle", err)
|
|
203
|
-
}
|
|
204
|
-
if !logged {
|
|
205
|
-
t.Fatal("missing warning")
|
|
206
|
-
}
|
|
207
|
-
b, err := os.ReadFile(filepath.Join(root, "executor", "control"))
|
|
208
|
-
if err != nil || string(b) != action+"\n" {
|
|
209
|
-
t.Fatal(string(b), err)
|
|
210
|
-
}
|
|
211
|
-
})
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
func TestStartWritesResumeWithoutWaitingForSocket(t *testing.T) {
|
|
216
|
-
root := t.TempDir()
|
|
217
|
-
socket := filepath.Join(root, "socket")
|
|
218
|
-
os.WriteFile(socket, []byte("still paused"), 0600)
|
|
219
|
-
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
|
220
|
-
defer cancel()
|
|
221
|
-
started := time.Now()
|
|
222
|
-
if err := Run(ctx, Config{Package: "TestApp", Data: root, Socket: socket}, "start"); err != nil {
|
|
223
|
-
t.Fatal(err)
|
|
224
|
-
}
|
|
225
|
-
if time.Since(started) > 100*time.Millisecond {
|
|
226
|
-
t.Fatal("start waited for approval/socket")
|
|
227
|
-
}
|
|
228
|
-
b, err := os.ReadFile(filepath.Join(root, "executor/control"))
|
|
229
|
-
if err != nil || string(b) != "start\n" {
|
|
230
|
-
t.Fatal("missing resume request")
|
|
231
|
-
}
|
|
232
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
# synopkgland executor boot
|
|
3
|
-
set -eu
|
|
4
|
-
umask 77
|
|
5
|
-
export PATH=/usr/bin:/bin
|
|
6
|
-
p=@PACKAGE@
|
|
7
|
-
q=/var/packages/$p
|
|
8
|
-
s=$q/target/executor
|
|
9
|
-
r=/usr/local/etc/synopkgland/$p
|
|
10
|
-
d=$r/runtime
|
|
11
|
-
o="--package $p"
|
|
12
|
-
v(){ echo "$2@POLICY_DIGEST@ ${1}policy.json"|sha256sum -c - >/dev/null||{ logger digest;exit 1;};}
|
|
13
|
-
a=purge
|
|
14
|
-
if [ -d $q ];then
|
|
15
|
-
a=stop
|
|
16
|
-
[ "$(cat $q/var/executor/control)" != purge ] || { a=purge;[ -e $d ] || [ -L $d ] || { logger purged;exit 0;};}
|
|
17
|
-
else [ -d $r ] || exit 0;fi
|
|
18
|
-
mkdir -p -m 700 $d
|
|
19
|
-
[ "$(find $d -maxdepth 0 -uid 0 -type d -perm 700)" = $d ]
|
|
20
|
-
cd $d
|
|
21
|
-
[ $a = stop ] || { v ./ "";exec ./executor control purge $o;}
|
|
22
|
-
e=$(sed -n 's/^synopkgland_executor_sha256="\([0-9a-f]*\)"$/\1/p' $q/INFO)
|
|
23
|
-
[ ${#e} = 64 ]
|
|
24
|
-
cp $s/executor .executor
|
|
25
|
-
cp $s/policy.json .policy.json
|
|
26
|
-
v . "$e .executor
|
|
27
|
-
"
|
|
28
|
-
chmod 700 .executor
|
|
29
|
-
for f in executor policy.json;do mv .$f $f;done
|
|
30
|
-
[ -e $s/../root ] && cp -R $s/../root .
|
|
31
|
-
./executor control start $o
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Canonical renderer used to check CLI/executor byte equivalence locally.
|
|
2
|
-
package main
|
|
3
|
-
|
|
4
|
-
import (
|
|
5
|
-
"encoding/json"
|
|
6
|
-
"os"
|
|
7
|
-
"synopkgland/executor/internal/taskscript"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
func main() {
|
|
11
|
-
if len(os.Args) != 3 {
|
|
12
|
-
os.Exit(2)
|
|
13
|
-
}
|
|
14
|
-
tasks, err := taskscript.Generate(os.Args[1], os.Args[2])
|
|
15
|
-
if err != nil {
|
|
16
|
-
os.Exit(1)
|
|
17
|
-
}
|
|
18
|
-
json.NewEncoder(os.Stdout).Encode(tasks)
|
|
19
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
# synopkgland executor control
|
|
3
|
-
set -eu
|
|
4
|
-
umask 77
|
|
5
|
-
export PATH=/usr/bin:/bin
|
|
6
|
-
p=@PACKAGE@
|
|
7
|
-
q=/var/packages/$p
|
|
8
|
-
s=$q/target/executor
|
|
9
|
-
r=/usr/local/etc/synopkgland/$p
|
|
10
|
-
d=$r/runtime
|
|
11
|
-
v(){ echo "$3@POLICY_DIGEST@ $1/$2policy.json"|sha256sum -c - >/dev/null || { logger digest;exit 1;};}
|
|
12
|
-
mkdir -p -m 700 "$d"
|
|
13
|
-
[ "$(find "$d" -maxdepth 0 -uid 0 -type d -perm 700)" = "$d" ]
|
|
14
|
-
a=$(cat "$q/var/executor/control")
|
|
15
|
-
case "$a" in start|stop|purge) ;; *) exit 1;; esac
|
|
16
|
-
if [ "$a" = stop ]; then
|
|
17
|
-
v "$d" '' ''
|
|
18
|
-
exec "$d/executor" control stop --package "$p"
|
|
19
|
-
fi
|
|
20
|
-
# Root runs only executor bytes anchored in the root-owned INFO, under the approved policy.
|
|
21
|
-
e=$(sed -n 's/^synopkgland_executor_sha256="\([0-9a-f]*\)"$/\1/p' "$q/INFO")
|
|
22
|
-
[ ${#e} = 64 ] || { logger anchor;exit 1;}
|
|
23
|
-
cp "$s/executor" "$d/.executor"
|
|
24
|
-
cp "$s/policy.json" "$d/.policy.json"
|
|
25
|
-
v "$d" . "$e $d/.executor
|
|
26
|
-
"
|
|
27
|
-
chmod 700 "$d/.executor"
|
|
28
|
-
[ "$a" = start ] || exec "$d/.executor" control purge --package "$p"
|
|
29
|
-
for f in executor policy.json; do mv "$d/.$f" "$d/$f"; done
|
|
30
|
-
[ -e "$s/../root" ] && cp -R "$s/../root" "$d"
|
|
31
|
-
"$d/executor" control start --package "$p"
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Package taskscript renders the canonical lifecycle scripts shared with the CLI.
|
|
2
|
-
package taskscript
|
|
3
|
-
|
|
4
|
-
import (
|
|
5
|
-
_ "embed"
|
|
6
|
-
"errors"
|
|
7
|
-
"regexp"
|
|
8
|
-
"strings"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
//go:embed boot.sh
|
|
12
|
-
var boot string
|
|
13
|
-
|
|
14
|
-
//go:embed control.sh
|
|
15
|
-
var control string
|
|
16
|
-
|
|
17
|
-
type Task struct {
|
|
18
|
-
Kind string `json:"kind"`
|
|
19
|
-
Name string `json:"name"`
|
|
20
|
-
Header string `json:"header"`
|
|
21
|
-
Script string `json:"script"`
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Tasks pin only the approved policy. Executor bytes are anchored per SPK in the
|
|
25
|
-
// root-owned package INFO, so an executor-only upgrade keeps both definitions.
|
|
26
|
-
func Generate(pkg, pd string) ([]Task, error) {
|
|
27
|
-
if !regexp.MustCompile(`^[A-Za-z][A-Za-z0-9]{1,63}$`).MatchString(pkg) || !regexp.MustCompile(`^[a-f0-9]{64}$`).MatchString(pd) {
|
|
28
|
-
return nil, errors.New("task pins")
|
|
29
|
-
}
|
|
30
|
-
replace := strings.NewReplacer("@PACKAGE@", pkg, "@POLICY_DIGEST@", pd)
|
|
31
|
-
tasks := []Task{}
|
|
32
|
-
for i, source := range []string{boot, control} {
|
|
33
|
-
kind, limit := "boot", 1024
|
|
34
|
-
if i == 1 {
|
|
35
|
-
kind, limit = "control", 6000
|
|
36
|
-
}
|
|
37
|
-
script := replace.Replace(source)
|
|
38
|
-
if len(script) > limit || strings.Contains(script, "%") {
|
|
39
|
-
return nil, errors.New("task script")
|
|
40
|
-
}
|
|
41
|
-
tasks = append(tasks, Task{kind, pkg + " executor " + kind, "#!/bin/sh\n# synopkgland executor " + kind + "\n", script})
|
|
42
|
-
}
|
|
43
|
-
return tasks, nil
|
|
44
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
package main
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"testing"
|
|
5
|
-
)
|
|
6
|
-
|
|
7
|
-
func TestReviewCaseFoldedDuplicateAuthRejected(t *testing.T) {
|
|
8
|
-
for _, raw := range []string{
|
|
9
|
-
`{"v":1,"op":"delegate.list","auth":{"dsm_cookie":"a","DSM_COOKIE":"b","dsm_synotoken":"token"},"params":{}}`,
|
|
10
|
-
`{"v":1,"op":"delegate.list","auth":{"DSM_COOKIE":"a","dsm_synotoken":"token"},"params":{}}`,
|
|
11
|
-
`{"v":1,"op":"delegate.list","AUTH":{"dsm_cookie":"a","dsm_synotoken":"token"},"params":{}}`,
|
|
12
|
-
`{"v":1,"op":"files.list","auth":{},"params":{"path":"/home","PATH":"/other"}}`,
|
|
13
|
-
`{"v":1,"op":"files.list","auth":{},"params":{"PATH":"/home"}}`,
|
|
14
|
-
`{"v":1,"op":"files.list","auth":{},"Params":{}}`,
|
|
15
|
-
} {
|
|
16
|
-
var req Request
|
|
17
|
-
if strictJSON([]byte(raw), &req) == nil {
|
|
18
|
-
t.Errorf("ambiguous or case variant accepted: %s", raw)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
func TestStrictJSONCaseInsensitiveKeysIncludeUnicodeFolds(t *testing.T) {
|
|
23
|
-
for _, raw := range []string{`{"key":1,"KEY":2}`, `{"s":1,"ſ":2}`, `{"k":1,"K":2}`} {
|
|
24
|
-
var out map[string]any
|
|
25
|
-
if strictJSON([]byte(raw), &out) == nil {
|
|
26
|
-
t.Errorf("case duplicate accepted: %s", raw)
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
func TestStrictJSONDirectCredentialAndParamsKeysAreCanonical(t *testing.T) {
|
|
32
|
-
var auth Auth
|
|
33
|
-
var params Params
|
|
34
|
-
if strictJSON([]byte(`{"DSM_COOKIE":"a"}`), &auth) == nil {
|
|
35
|
-
t.Fatal("uppercase direct auth key")
|
|
36
|
-
}
|
|
37
|
-
if strictJSON([]byte(`{"PATH":"/home"}`), ¶ms) == nil {
|
|
38
|
-
t.Fatal("uppercase direct params key")
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
package main
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
"os"
|
|
6
|
-
"path/filepath"
|
|
7
|
-
"syscall"
|
|
8
|
-
"testing"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
func TestFinishControlPurgesOfflineRuntimeGrantsAndStaleSocket(t *testing.T) {
|
|
12
|
-
root := t.TempDir()
|
|
13
|
-
state := filepath.Join(root, "state")
|
|
14
|
-
socket := filepath.Join(root, "socket")
|
|
15
|
-
for _, path := range []string{filepath.Join(state, "runtime"), filepath.Join(state, "delegations"), socket} {
|
|
16
|
-
os.MkdirAll(path, 0700)
|
|
17
|
-
os.WriteFile(filepath.Join(path, "stale"), []byte("data"), 0600)
|
|
18
|
-
}
|
|
19
|
-
if err := finishControl(state, filepath.Join(state, "runtime"), socket, true); err != nil {
|
|
20
|
-
t.Fatal(err)
|
|
21
|
-
}
|
|
22
|
-
for _, path := range []string{state, socket} {
|
|
23
|
-
if _, err := os.Lstat(path); !os.IsNotExist(err) {
|
|
24
|
-
t.Fatalf("remnant %s", path)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if err := finishControl(state, filepath.Join(state, "runtime"), socket, true); err != nil {
|
|
28
|
-
t.Fatal(err)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
func TestFinishStopKeepsGrantsButRemovesSocketAndPurgeRejectsForeignRuntime(t *testing.T) {
|
|
32
|
-
root := t.TempDir()
|
|
33
|
-
state := filepath.Join(root, "state")
|
|
34
|
-
socket := filepath.Join(root, "socket")
|
|
35
|
-
os.MkdirAll(state, 0700)
|
|
36
|
-
os.MkdirAll(socket, 0700)
|
|
37
|
-
if err := finishControl(state, filepath.Join(state, "runtime"), socket, false); err != nil {
|
|
38
|
-
t.Fatal(err)
|
|
39
|
-
}
|
|
40
|
-
if _, err := os.Stat(state); err != nil {
|
|
41
|
-
t.Fatal(err)
|
|
42
|
-
}
|
|
43
|
-
if err := finishControl(state, root, socket, true); err == nil {
|
|
44
|
-
t.Fatal("accepted foreign runtime")
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
func TestCreatedDirectoriesHonorModesUnderPrivateUmask(t *testing.T) {
|
|
49
|
-
root := t.TempDir()
|
|
50
|
-
old := syscall.Umask(0077)
|
|
51
|
-
defer syscall.Umask(old)
|
|
52
|
-
for _, mode := range []os.FileMode{0755, 0750, 0700} {
|
|
53
|
-
path := filepath.Join(root, fmt.Sprintf("dir-%o", mode))
|
|
54
|
-
info, err := createDirectory(path, mode, os.Geteuid(), os.Getegid())
|
|
55
|
-
if err != nil {
|
|
56
|
-
t.Fatal(err)
|
|
57
|
-
}
|
|
58
|
-
if !directoryMatches(info, mode, os.Geteuid(), os.Getegid()) {
|
|
59
|
-
t.Fatal("umask corrupted directory contract", info.Mode())
|
|
60
|
-
}
|
|
61
|
-
if _, err := createDirectory(path, mode, os.Geteuid(), os.Getegid()); err == nil {
|
|
62
|
-
t.Fatal("existing directory was adopted")
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
func TestDirectoryValidationRejectsExistingWrongModeOwnerAndSymlink(t *testing.T) {
|
|
67
|
-
root := t.TempDir()
|
|
68
|
-
path := filepath.Join(root, "existing")
|
|
69
|
-
os.Mkdir(path, 0700)
|
|
70
|
-
info, _ := os.Lstat(path)
|
|
71
|
-
if directoryMatches(info, 0755, os.Geteuid(), os.Getegid()) {
|
|
72
|
-
t.Fatal("wrong mode accepted")
|
|
73
|
-
}
|
|
74
|
-
if directoryMatches(info, 0700, os.Geteuid()+1, os.Getegid()) {
|
|
75
|
-
t.Fatal("wrong owner accepted")
|
|
76
|
-
}
|
|
77
|
-
if directoryMatches(info, 0700, os.Geteuid(), os.Getegid()+1) {
|
|
78
|
-
t.Fatal("wrong group accepted")
|
|
79
|
-
}
|
|
80
|
-
link := path + "-link"
|
|
81
|
-
os.Symlink(path, link)
|
|
82
|
-
info, _ = os.Lstat(link)
|
|
83
|
-
if directoryMatches(info, 0700, os.Geteuid(), os.Getegid()) {
|
|
84
|
-
t.Fatal("symlink accepted")
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// The legacy write child linked its own copy without waiting for serve, so an
|
|
89
|
-
// orphan could still publish. Nothing spawns it since files.write moved to the
|
|
90
|
-
// move child; neither it nor its cleanup child may run at all.
|
|
91
|
-
func TestLegacyWriteChildrenAreNotCommands(t *testing.T) {
|
|
92
|
-
for _, child := range []string{"write-child", "cleanup-child"} {
|
|
93
|
-
if err := run([]string{child}); err == nil || err.Error() != "invalid command" {
|
|
94
|
-
t.Fatalf("%s: %v", child, err)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//go:build linux
|
|
2
|
-
|
|
3
|
-
package main
|
|
4
|
-
|
|
5
|
-
import (
|
|
6
|
-
"fmt"
|
|
7
|
-
"os"
|
|
8
|
-
"syscall"
|
|
9
|
-
"unsafe"
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
func linkOpenPart(part, dir *os.File, name string) error {
|
|
13
|
-
// /proc/self/fd/<fd> refers to the still-open inode. Following that one trusted
|
|
14
|
-
// proc link prevents a subject from swapping a guessed temporary pathname.
|
|
15
|
-
old, err := syscall.BytePtrFromString(fmt.Sprintf("/proc/self/fd/%d", part.Fd()))
|
|
16
|
-
if err != nil {
|
|
17
|
-
return err
|
|
18
|
-
}
|
|
19
|
-
new, err := syscall.BytePtrFromString(name)
|
|
20
|
-
if err != nil {
|
|
21
|
-
return err
|
|
22
|
-
}
|
|
23
|
-
_, _, errno := syscall.Syscall6(syscall.SYS_LINKAT, ^uintptr(99), uintptr(unsafe.Pointer(old)), dir.Fd(), uintptr(unsafe.Pointer(new)), 0x400, 0)
|
|
24
|
-
if errno != 0 {
|
|
25
|
-
return errno
|
|
26
|
-
}
|
|
27
|
-
return nil
|
|
28
|
-
}
|