@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,315 +0,0 @@
|
|
|
1
|
-
package main
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"context"
|
|
5
|
-
"encoding/json"
|
|
6
|
-
"os"
|
|
7
|
-
"os/exec"
|
|
8
|
-
"os/user"
|
|
9
|
-
"path/filepath"
|
|
10
|
-
"runtime"
|
|
11
|
-
"strings"
|
|
12
|
-
"syscall"
|
|
13
|
-
"testing"
|
|
14
|
-
"time"
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
func fixture(t *testing.T, mode string) (string, string, string) {
|
|
18
|
-
t.Helper()
|
|
19
|
-
root, err := os.MkdirTemp("/tmp", "c1-runtime-")
|
|
20
|
-
if err != nil {
|
|
21
|
-
t.Fatal(err)
|
|
22
|
-
}
|
|
23
|
-
t.Cleanup(func() { os.RemoveAll(root) })
|
|
24
|
-
dest, data := filepath.Join(root, "target"), filepath.Join(root, "var")
|
|
25
|
-
if err := os.MkdirAll(filepath.Join(dest, "daemon/payload"), 0755); err != nil {
|
|
26
|
-
t.Fatal(err)
|
|
27
|
-
}
|
|
28
|
-
if err := os.Mkdir(data, 0700); err != nil {
|
|
29
|
-
t.Fatal(err)
|
|
30
|
-
}
|
|
31
|
-
control, child := os.Getenv("DAEMON_CONTROL_BIN"), os.Getenv("DAEMON_CHILD_BIN")
|
|
32
|
-
if control == "" {
|
|
33
|
-
control, child = filepath.Join(root, "control"), filepath.Join(root, "child")
|
|
34
|
-
for _, spec := range [][]string{{"build", "-o", control, "."}, {"build", "-o", child, "./testdata/child.go"}} {
|
|
35
|
-
if raw, err := exec.Command("go", spec...).CombinedOutput(); err != nil {
|
|
36
|
-
t.Fatalf("%v: %s", err, raw)
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
raw, err := os.ReadFile(child)
|
|
41
|
-
if err != nil {
|
|
42
|
-
t.Fatal(err)
|
|
43
|
-
}
|
|
44
|
-
app := filepath.Join(dest, "daemon/payload/app")
|
|
45
|
-
if err := os.WriteFile(app, raw, 0755); err != nil {
|
|
46
|
-
t.Fatal(err)
|
|
47
|
-
}
|
|
48
|
-
// macOS verifies a newly written executable on its first exec, which takes
|
|
49
|
-
// seconds on a loaded host; pay it here, not inside a one-second budget.
|
|
50
|
-
if raw, err := exec.Command(app, "cleanup").CombinedOutput(); err != nil {
|
|
51
|
-
t.Fatalf("payload warm-up: %v %s", err, raw)
|
|
52
|
-
}
|
|
53
|
-
cfg := config{Package: "DaemonFixture", Exec: "app", Args: []string{"${SYNOPKG_PKGVAR}/a space", "$(touch BAD)'", "${SYNOPKG_PKGDEST}"}, Env: map[string]string{"APP_MODE": mode}, Timeouts: deadlines{Start: 2, Stop: 2, Status: 1, Uninstall: 2}}
|
|
54
|
-
if os.Geteuid() == 0 {
|
|
55
|
-
cfg.Package = "nobody"
|
|
56
|
-
} else {
|
|
57
|
-
u, err := user.Current()
|
|
58
|
-
if err != nil {
|
|
59
|
-
t.Fatal(err)
|
|
60
|
-
}
|
|
61
|
-
cfg.Package = u.Username
|
|
62
|
-
}
|
|
63
|
-
raw, _ = json.Marshal(cfg)
|
|
64
|
-
if err := os.WriteFile(filepath.Join(dest, "daemon/config.json"), raw, 0644); err != nil {
|
|
65
|
-
t.Fatal(err)
|
|
66
|
-
}
|
|
67
|
-
if os.Geteuid() == 0 {
|
|
68
|
-
// Only inside the disposable root VM: run the shipped manager as nobody.
|
|
69
|
-
if runtime.GOOS != "linux" {
|
|
70
|
-
t.Fatal("root fixture requires Linux VM")
|
|
71
|
-
}
|
|
72
|
-
filepath.Walk(root, func(path string, _ os.FileInfo, err error) error {
|
|
73
|
-
if err == nil {
|
|
74
|
-
return os.Chown(path, 65534, 65534)
|
|
75
|
-
}
|
|
76
|
-
return err
|
|
77
|
-
})
|
|
78
|
-
os.Chmod(root, 0755)
|
|
79
|
-
}
|
|
80
|
-
t.Cleanup(func() { runControl(control, "stop", dest, data) })
|
|
81
|
-
return control, dest, data
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
func runControl(control, action, dest, data string) (int, string) {
|
|
85
|
-
ctx, cancel := context.WithTimeout(context.Background(), 8*time.Second)
|
|
86
|
-
defer cancel()
|
|
87
|
-
cmd := exec.CommandContext(ctx, control, action, dest, data)
|
|
88
|
-
cmd.Env = append(os.Environ(), "UNLISTED_SECRET=must-not-leak", "LD_PRELOAD=must-not-leak")
|
|
89
|
-
dropFixtureUser(cmd)
|
|
90
|
-
raw, err := cmd.CombinedOutput()
|
|
91
|
-
if err == nil {
|
|
92
|
-
return 0, string(raw)
|
|
93
|
-
}
|
|
94
|
-
if e, ok := err.(*exec.ExitError); ok {
|
|
95
|
-
return e.ExitCode(), string(raw)
|
|
96
|
-
}
|
|
97
|
-
return -1, err.Error()
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Readiness only proves the child stayed alive for a second, not that it reached
|
|
101
|
-
// main: on a loaded host a stop can kill it before it writes its line. Spawn
|
|
102
|
-
// identity therefore comes from the inventory, and log content is awaited.
|
|
103
|
-
func recordedChild(t *testing.T, data string) int {
|
|
104
|
-
t.Helper()
|
|
105
|
-
raw, err := os.ReadFile(filepath.Join(data, "daemon/daemon.pid"))
|
|
106
|
-
if err != nil {
|
|
107
|
-
t.Fatal(err)
|
|
108
|
-
}
|
|
109
|
-
var r record
|
|
110
|
-
if err := json.Unmarshal(raw, &r); err != nil || r.Child < 1 {
|
|
111
|
-
t.Fatalf("daemon inventory: %v %s", err, raw)
|
|
112
|
-
}
|
|
113
|
-
return r.Child
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
func awaitChildLines(t *testing.T, data string, want int) {
|
|
117
|
-
t.Helper()
|
|
118
|
-
path := filepath.Join(data, "daemon/daemon.log")
|
|
119
|
-
for deadline := time.Now().Add(10 * time.Second); ; time.Sleep(20 * time.Millisecond) {
|
|
120
|
-
raw, _ := os.ReadFile(path)
|
|
121
|
-
if got := strings.Count(string(raw), `"uid":`); got >= want || time.Now().After(deadline) {
|
|
122
|
-
if got != want {
|
|
123
|
-
t.Fatalf("child lines=%d want=%d: %s", got, want, raw)
|
|
124
|
-
}
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
func TestDaemonLifecycle(t *testing.T) {
|
|
131
|
-
control, dest, data := fixture(t, "normal")
|
|
132
|
-
step := func(action string, want int) {
|
|
133
|
-
t.Helper()
|
|
134
|
-
if rc, out := runControl(control, action, dest, data); rc != want {
|
|
135
|
-
t.Fatalf("%s rc=%d want=%d: %s", action, rc, want, out)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
step("status", 3)
|
|
139
|
-
step("stop", 0)
|
|
140
|
-
step("start", 0)
|
|
141
|
-
awaitChildLines(t, data, 1)
|
|
142
|
-
first := recordedChild(t, data)
|
|
143
|
-
step("status", 0)
|
|
144
|
-
step("start", 0)
|
|
145
|
-
if child := recordedChild(t, data); child != first {
|
|
146
|
-
t.Fatalf("duplicate start spawned another child: %d replaced %d", child, first)
|
|
147
|
-
}
|
|
148
|
-
step("restart", 0)
|
|
149
|
-
if child := recordedChild(t, data); child == first {
|
|
150
|
-
t.Fatalf("restart kept child %d", child)
|
|
151
|
-
}
|
|
152
|
-
awaitChildLines(t, data, 2)
|
|
153
|
-
step("stop", 0)
|
|
154
|
-
step("stop", 0)
|
|
155
|
-
step("status", 3)
|
|
156
|
-
step("unknown", 1)
|
|
157
|
-
raw, err := os.ReadFile(filepath.Join(data, "daemon/daemon.log"))
|
|
158
|
-
if err != nil {
|
|
159
|
-
t.Fatal(err)
|
|
160
|
-
}
|
|
161
|
-
if strings.Count(string(raw), `"uid":`) != 2 {
|
|
162
|
-
t.Fatalf("unexpected child spawn: %s", raw)
|
|
163
|
-
}
|
|
164
|
-
if strings.Contains(string(raw), "must-not-leak") {
|
|
165
|
-
t.Fatalf("ambient environment leaked: %s", raw)
|
|
166
|
-
}
|
|
167
|
-
if !strings.Contains(string(raw), "$(touch BAD)'") || !strings.Contains(string(raw), "/a space") {
|
|
168
|
-
t.Fatalf("argv changed: %s", raw)
|
|
169
|
-
}
|
|
170
|
-
stat, _ := os.Stat(filepath.Join(data, "daemon/daemon.log"))
|
|
171
|
-
if stat.Mode().Perm() != 0600 {
|
|
172
|
-
t.Fatal("log permissions")
|
|
173
|
-
}
|
|
174
|
-
stat, err = os.Stat(filepath.Join(data, "daemon/tmp"))
|
|
175
|
-
if err != nil || stat.Mode().Perm() != 0700 {
|
|
176
|
-
t.Fatal("private TMPDIR missing", err)
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
func TestImmediateExitAndEscalation(t *testing.T) {
|
|
181
|
-
for _, mode := range []string{"exit", "ignore"} {
|
|
182
|
-
t.Run(mode, func(t *testing.T) {
|
|
183
|
-
control, dest, data := fixture(t, mode)
|
|
184
|
-
rc, out := runControl(control, "start", dest, data)
|
|
185
|
-
if mode == "exit" {
|
|
186
|
-
if rc != 1 {
|
|
187
|
-
t.Fatalf("false readiness: %d %s", rc, out)
|
|
188
|
-
}
|
|
189
|
-
} else {
|
|
190
|
-
if rc != 0 {
|
|
191
|
-
t.Fatalf("start: %d %s", rc, out)
|
|
192
|
-
}
|
|
193
|
-
if rc, out = runControl(control, "stop", dest, data); rc != 0 {
|
|
194
|
-
t.Fatalf("escalation: %d %s", rc, out)
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
if rc, out = runControl(control, "status", dest, data); rc != 3 {
|
|
198
|
-
t.Fatalf("residue: %d %s", rc, out)
|
|
199
|
-
}
|
|
200
|
-
})
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
func TestForeignStateAndRootRefusal(t *testing.T) {
|
|
205
|
-
control, dest, data := fixture(t, "normal")
|
|
206
|
-
if os.Geteuid() == 0 {
|
|
207
|
-
raw, err := exec.Command(control, "start", dest, data).CombinedOutput()
|
|
208
|
-
if err == nil || !strings.Contains(string(raw), "package account") {
|
|
209
|
-
t.Fatalf("root accepted: %s %v", raw, err)
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
os.Mkdir(filepath.Join(data, "daemon"), 0700)
|
|
213
|
-
if os.Geteuid() == 0 {
|
|
214
|
-
os.Chown(filepath.Join(data, "daemon"), 65534, 65534)
|
|
215
|
-
}
|
|
216
|
-
os.Symlink(filepath.Join(data, "victim"), filepath.Join(data, "daemon/daemon.log"))
|
|
217
|
-
if rc, out := runControl(control, "start", dest, data); rc != 1 {
|
|
218
|
-
t.Fatalf("symlink accepted: %d %s", rc, out)
|
|
219
|
-
}
|
|
220
|
-
if _, err := os.Stat(filepath.Join(data, "victim")); !os.IsNotExist(err) {
|
|
221
|
-
t.Fatal("followed log symlink")
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
func TestUninstallCleanup(t *testing.T) {
|
|
226
|
-
for _, mode := range []string{"cleanup", "cleanup-fail", "cleanup-hang"} {
|
|
227
|
-
t.Run(mode, func(t *testing.T) {
|
|
228
|
-
control, dest, data := fixture(t, "normal")
|
|
229
|
-
path := filepath.Join(dest, "daemon/config.json")
|
|
230
|
-
raw, _ := os.ReadFile(path)
|
|
231
|
-
var cfg config
|
|
232
|
-
json.Unmarshal(raw, &cfg)
|
|
233
|
-
cfg.UninstallArgs = []string{mode, "${SYNOPKG_PKGVAR}"}
|
|
234
|
-
raw, _ = json.Marshal(cfg)
|
|
235
|
-
os.WriteFile(path, raw, 0644)
|
|
236
|
-
if rc, out := runControl(control, "start", dest, data); rc != 0 {
|
|
237
|
-
t.Fatalf("start: %d %s", rc, out)
|
|
238
|
-
}
|
|
239
|
-
want := 1
|
|
240
|
-
if mode == "cleanup" {
|
|
241
|
-
want = 0
|
|
242
|
-
}
|
|
243
|
-
if rc, out := runControl(control, "uninstall", dest, data); rc != want {
|
|
244
|
-
t.Fatalf("cleanup rc=%d want=%d: %s", rc, want, out)
|
|
245
|
-
}
|
|
246
|
-
if rc, out := runControl(control, "status", dest, data); rc != 3 {
|
|
247
|
-
t.Fatalf("cleanup must not restart daemon: %d %s", rc, out)
|
|
248
|
-
}
|
|
249
|
-
})
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// A revoke on uninstall can outlast the stop deadline on a loaded NAS; it has
|
|
254
|
-
// its own budget instead of Stop-1.
|
|
255
|
-
func TestUninstallCommandHasItsOwnBudget(t *testing.T) {
|
|
256
|
-
control, dest, data := fixture(t, "normal")
|
|
257
|
-
path := filepath.Join(dest, "daemon/config.json")
|
|
258
|
-
raw, _ := os.ReadFile(path)
|
|
259
|
-
var cfg config
|
|
260
|
-
json.Unmarshal(raw, &cfg)
|
|
261
|
-
cfg.UninstallArgs = []string{"cleanup-slow"}
|
|
262
|
-
cfg.Timeouts.Uninstall = 5
|
|
263
|
-
raw, _ = json.Marshal(cfg)
|
|
264
|
-
os.WriteFile(path, raw, 0644)
|
|
265
|
-
if rc, out := runControl(control, "start", dest, data); rc != 0 {
|
|
266
|
-
t.Fatalf("start: %d %s", rc, out)
|
|
267
|
-
}
|
|
268
|
-
if rc, out := runControl(control, "uninstall", dest, data); rc != 0 {
|
|
269
|
-
t.Fatalf("slow uninstall within its budget failed: %d %s", rc, out)
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
func TestPackageAccountIdentity(t *testing.T) {
|
|
274
|
-
control, dest, data := fixture(t, "normal")
|
|
275
|
-
path := filepath.Join(dest, "daemon/config.json")
|
|
276
|
-
raw, _ := os.ReadFile(path)
|
|
277
|
-
var cfg config
|
|
278
|
-
json.Unmarshal(raw, &cfg)
|
|
279
|
-
cfg.Package = "root"
|
|
280
|
-
raw, _ = json.Marshal(cfg)
|
|
281
|
-
os.WriteFile(path, raw, 0644)
|
|
282
|
-
rc, out := runControl(control, "start", dest, data)
|
|
283
|
-
if rc == 0 {
|
|
284
|
-
runControl(control, "stop", dest, data)
|
|
285
|
-
}
|
|
286
|
-
if rc != 1 {
|
|
287
|
-
t.Fatalf("other account accepted: %d %s", rc, out)
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
func TestFIFOInventoryCannotBlockStatus(t *testing.T) {
|
|
292
|
-
control, dest, data := fixture(t, "normal")
|
|
293
|
-
state := filepath.Join(data, "daemon")
|
|
294
|
-
os.Mkdir(state, 0700)
|
|
295
|
-
path := filepath.Join(state, "daemon.pid")
|
|
296
|
-
t.Cleanup(func() { os.Remove(path) })
|
|
297
|
-
if err := syscall.Mkfifo(path, 0600); err != nil {
|
|
298
|
-
t.Fatal(err)
|
|
299
|
-
}
|
|
300
|
-
if os.Geteuid() == 0 {
|
|
301
|
-
os.Chown(state, 65534, 65534)
|
|
302
|
-
os.Chown(path, 65534, 65534)
|
|
303
|
-
}
|
|
304
|
-
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
|
305
|
-
defer cancel()
|
|
306
|
-
cmd := exec.CommandContext(ctx, control, "status", dest, data)
|
|
307
|
-
dropFixtureUser(cmd)
|
|
308
|
-
raw, err := cmd.CombinedOutput()
|
|
309
|
-
if ctx.Err() != nil {
|
|
310
|
-
t.Fatal("status blocked on FIFO")
|
|
311
|
-
}
|
|
312
|
-
if e, ok := err.(*exec.ExitError); !ok || e.ExitCode() != 1 {
|
|
313
|
-
t.Fatalf("FIFO status: %s %v", raw, err)
|
|
314
|
-
}
|
|
315
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
//go:build linux
|
|
2
|
-
|
|
3
|
-
package main
|
|
4
|
-
|
|
5
|
-
import (
|
|
6
|
-
"errors"
|
|
7
|
-
"net"
|
|
8
|
-
"os"
|
|
9
|
-
"strconv"
|
|
10
|
-
"syscall"
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
func childAttributes() *syscall.SysProcAttr { return &syscall.SysProcAttr{Pdeathsig: syscall.SIGKILL} }
|
|
14
|
-
func processBirth(pid int) string {
|
|
15
|
-
raw, err := os.ReadFile("/proc/" + strconv.Itoa(pid) + "/stat")
|
|
16
|
-
if err != nil {
|
|
17
|
-
return ""
|
|
18
|
-
}
|
|
19
|
-
birth, _ := parseBirth(string(raw))
|
|
20
|
-
return birth
|
|
21
|
-
}
|
|
22
|
-
func recordedChildAlive(pid int, birth string) bool {
|
|
23
|
-
raw, err := os.ReadFile("/proc/" + strconv.Itoa(pid) + "/stat")
|
|
24
|
-
if os.IsNotExist(err) {
|
|
25
|
-
return false
|
|
26
|
-
}
|
|
27
|
-
if err != nil {
|
|
28
|
-
return true
|
|
29
|
-
}
|
|
30
|
-
actual, alive := parseBirth(string(raw))
|
|
31
|
-
if actual == "" {
|
|
32
|
-
return true
|
|
33
|
-
}
|
|
34
|
-
return alive && (birth == "" || actual == birth)
|
|
35
|
-
}
|
|
36
|
-
func checkPeer(conn *net.UnixConn, pid int) error {
|
|
37
|
-
fd, err := conn.SyscallConn()
|
|
38
|
-
if err != nil {
|
|
39
|
-
return err
|
|
40
|
-
}
|
|
41
|
-
var peer *syscall.Ucred
|
|
42
|
-
var getErr error
|
|
43
|
-
if err := fd.Control(func(raw uintptr) {
|
|
44
|
-
peer, getErr = syscall.GetsockoptUcred(int(raw), syscall.SOL_SOCKET, syscall.SO_PEERCRED)
|
|
45
|
-
}); err != nil {
|
|
46
|
-
return err
|
|
47
|
-
}
|
|
48
|
-
if getErr != nil {
|
|
49
|
-
return getErr
|
|
50
|
-
}
|
|
51
|
-
if peer.Uid != uint32(os.Geteuid()) || peer.Pid != int32(pid) {
|
|
52
|
-
return errors.New("foreign daemon supervisor")
|
|
53
|
-
}
|
|
54
|
-
return nil
|
|
55
|
-
}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
//go:build linux
|
|
2
|
-
|
|
3
|
-
package main
|
|
4
|
-
|
|
5
|
-
import (
|
|
6
|
-
"encoding/json"
|
|
7
|
-
"os"
|
|
8
|
-
"os/exec"
|
|
9
|
-
"path/filepath"
|
|
10
|
-
"strconv"
|
|
11
|
-
"sync"
|
|
12
|
-
"syscall"
|
|
13
|
-
"testing"
|
|
14
|
-
"time"
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
func waitDead(t *testing.T, pid int, birth string) {
|
|
18
|
-
t.Helper()
|
|
19
|
-
until := time.Now().Add(3 * time.Second)
|
|
20
|
-
for time.Now().Before(until) {
|
|
21
|
-
if !recordedChildAlive(pid, birth) {
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
time.Sleep(20 * time.Millisecond)
|
|
25
|
-
}
|
|
26
|
-
t.Fatalf("PID %d remained alive", pid)
|
|
27
|
-
}
|
|
28
|
-
func readFixtureRecord(t *testing.T, data string) record {
|
|
29
|
-
t.Helper()
|
|
30
|
-
raw, err := os.ReadFile(filepath.Join(data, "daemon/daemon.pid"))
|
|
31
|
-
if err != nil {
|
|
32
|
-
t.Fatal(err)
|
|
33
|
-
}
|
|
34
|
-
var r record
|
|
35
|
-
if err := json.Unmarshal(raw, &r); err != nil {
|
|
36
|
-
t.Fatal(err)
|
|
37
|
-
}
|
|
38
|
-
return r
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
func TestLinuxSupervisorDeathAndConcurrentStart(t *testing.T) {
|
|
42
|
-
control, dest, data := fixture(t, "normal")
|
|
43
|
-
var wg sync.WaitGroup
|
|
44
|
-
results := make(chan int, 6)
|
|
45
|
-
for i := 0; i < 6; i++ {
|
|
46
|
-
wg.Add(1)
|
|
47
|
-
go func() { defer wg.Done(); rc, _ := runControl(control, "start", dest, data); results <- rc }()
|
|
48
|
-
}
|
|
49
|
-
wg.Wait()
|
|
50
|
-
close(results)
|
|
51
|
-
for rc := range results {
|
|
52
|
-
if rc != 0 {
|
|
53
|
-
t.Fatalf("concurrent start: %d", rc)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
r := readFixtureRecord(t, data)
|
|
57
|
-
if err := syscall.Kill(r.Supervisor, syscall.SIGKILL); err != nil {
|
|
58
|
-
t.Fatal(err)
|
|
59
|
-
}
|
|
60
|
-
waitDead(t, r.Child, r.Birth)
|
|
61
|
-
if rc, out := runControl(control, "status", dest, data); rc != 1 {
|
|
62
|
-
t.Fatalf("lost-supervisor status: %d %s", rc, out)
|
|
63
|
-
}
|
|
64
|
-
if rc, out := runControl(control, "stop", dest, data); rc != 0 {
|
|
65
|
-
t.Fatalf("retire dead child: %d %s", rc, out)
|
|
66
|
-
}
|
|
67
|
-
if rc, out := runControl(control, "start", dest, data); rc != 0 {
|
|
68
|
-
t.Fatalf("restart after death: %d %s", rc, out)
|
|
69
|
-
}
|
|
70
|
-
if r2 := readFixtureRecord(t, data); r2.Child == r.Child {
|
|
71
|
-
t.Fatal("did not start fresh child")
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
func TestLinuxInventoryNeverSignalsForeignPID(t *testing.T) {
|
|
76
|
-
control, dest, data := fixture(t, "normal")
|
|
77
|
-
if rc, out := runControl(control, "start", dest, data); rc != 0 {
|
|
78
|
-
t.Fatalf("start: %d %s", rc, out)
|
|
79
|
-
}
|
|
80
|
-
r := readFixtureRecord(t, data)
|
|
81
|
-
if rc, out := runControl(control, "stop", dest, data); rc != 0 {
|
|
82
|
-
t.Fatalf("stop: %d %s", rc, out)
|
|
83
|
-
}
|
|
84
|
-
foreign := exec.Command("/bin/sleep", "30")
|
|
85
|
-
if err := foreign.Start(); err != nil {
|
|
86
|
-
t.Fatal(err)
|
|
87
|
-
}
|
|
88
|
-
defer func() { foreign.Process.Kill(); foreign.Wait() }()
|
|
89
|
-
r.Supervisor = foreign.Process.Pid
|
|
90
|
-
r.Child = foreign.Process.Pid
|
|
91
|
-
r.Birth = processBirth(r.Child)
|
|
92
|
-
raw, _ := json.Marshal(r)
|
|
93
|
-
path := filepath.Join(data, "daemon/daemon.pid")
|
|
94
|
-
if err := os.WriteFile(path, raw, 0600); err != nil {
|
|
95
|
-
t.Fatal(err)
|
|
96
|
-
}
|
|
97
|
-
if os.Geteuid() == 0 {
|
|
98
|
-
os.Chown(path, 65534, 65534)
|
|
99
|
-
}
|
|
100
|
-
for _, action := range []string{"stop", "start", "restart"} {
|
|
101
|
-
if rc, out := runControl(control, action, dest, data); rc != 1 {
|
|
102
|
-
t.Fatalf("%s accepted live unwitnessed PID: %d %s", action, rc, out)
|
|
103
|
-
}
|
|
104
|
-
if !recordedChildAlive(r.Child, r.Birth) {
|
|
105
|
-
t.Fatal("signalled inventory PID")
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// A reused numeric PID with a different birth can be retired without killing it.
|
|
109
|
-
r.Birth = "1"
|
|
110
|
-
raw, _ = json.Marshal(r)
|
|
111
|
-
os.WriteFile(path, raw, 0600)
|
|
112
|
-
if rc, out := runControl(control, "stop", dest, data); rc != 0 {
|
|
113
|
-
t.Fatalf("retire reused PID: %d %s", rc, out)
|
|
114
|
-
}
|
|
115
|
-
if !recordedChildAlive(foreign.Process.Pid, processBirth(foreign.Process.Pid)) {
|
|
116
|
-
t.Fatal("killed reused PID")
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
func TestLinuxChildSelfExitAndDeadlines(t *testing.T) {
|
|
121
|
-
control, dest, data := fixture(t, "normal")
|
|
122
|
-
if rc, out := runControl(control, "start", dest, data); rc != 0 {
|
|
123
|
-
t.Fatalf("start: %d %s", rc, out)
|
|
124
|
-
}
|
|
125
|
-
r := readFixtureRecord(t, data)
|
|
126
|
-
if err := syscall.Kill(r.Child, syscall.SIGTERM); err != nil {
|
|
127
|
-
t.Fatal(err)
|
|
128
|
-
}
|
|
129
|
-
waitDead(t, r.Child, r.Birth)
|
|
130
|
-
time.Sleep(100 * time.Millisecond)
|
|
131
|
-
if rc, out := runControl(control, "status", dest, data); rc != 1 {
|
|
132
|
-
t.Fatalf("self exit: %d %s", rc, out)
|
|
133
|
-
}
|
|
134
|
-
control, dest, data = fixture(t, "ignore")
|
|
135
|
-
if rc, out := runControl(control, "start", dest, data); rc != 0 {
|
|
136
|
-
t.Fatalf("start: %d %s", rc, out)
|
|
137
|
-
}
|
|
138
|
-
r = readFixtureRecord(t, data)
|
|
139
|
-
began := time.Now()
|
|
140
|
-
if rc, out := runControl(control, "stop", dest, data); rc != 0 {
|
|
141
|
-
t.Fatalf("stop: %d %s", rc, out)
|
|
142
|
-
}
|
|
143
|
-
if elapsed := time.Since(began); elapsed < time.Second || elapsed > 3*time.Second {
|
|
144
|
-
t.Fatalf("stop deadline: %s", elapsed)
|
|
145
|
-
}
|
|
146
|
-
waitDead(t, r.Child, r.Birth)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
func TestParseLinuxProcBirth(t *testing.T) {
|
|
150
|
-
fields := []string{"S", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "1234"}
|
|
151
|
-
raw := "42 (a ) tricky name)"
|
|
152
|
-
for _, f := range fields {
|
|
153
|
-
raw += " " + f
|
|
154
|
-
}
|
|
155
|
-
if birth, alive := parseBirth(raw); birth != "1234" || !alive {
|
|
156
|
-
t.Fatal(birth, alive)
|
|
157
|
-
}
|
|
158
|
-
if recordedChildAlive(os.Getpid(), strconv.Itoa(os.Getpid())) {
|
|
159
|
-
t.Fatal("different process birth matched")
|
|
160
|
-
}
|
|
161
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//go:build !linux
|
|
2
|
-
|
|
3
|
-
package main
|
|
4
|
-
|
|
5
|
-
import (
|
|
6
|
-
"net"
|
|
7
|
-
"syscall"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
// Host-only tests exercise lifecycle/quoting; published controllers target Linux.
|
|
11
|
-
func childAttributes() *syscall.SysProcAttr { return &syscall.SysProcAttr{} }
|
|
12
|
-
func processBirth(int) string { return "host-fixture" }
|
|
13
|
-
func recordedChildAlive(pid int, _ string) bool { return syscall.Kill(pid, 0) == nil }
|
|
14
|
-
func checkPeer(*net.UnixConn, int) error { return nil }
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Linux/host fixture: a foreground process; never installed on a NAS.
|
|
2
|
-
package main
|
|
3
|
-
|
|
4
|
-
import (
|
|
5
|
-
"encoding/json"
|
|
6
|
-
"os"
|
|
7
|
-
"os/signal"
|
|
8
|
-
"syscall"
|
|
9
|
-
"time"
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
func main() {
|
|
13
|
-
if len(os.Args) > 1 {
|
|
14
|
-
switch os.Args[1] {
|
|
15
|
-
case "cleanup":
|
|
16
|
-
os.Exit(0)
|
|
17
|
-
case "cleanup-slow":
|
|
18
|
-
time.Sleep(2500 * time.Millisecond)
|
|
19
|
-
os.Exit(0)
|
|
20
|
-
case "cleanup-fail":
|
|
21
|
-
os.Exit(2)
|
|
22
|
-
case "cleanup-hang":
|
|
23
|
-
signal.Ignore(syscall.SIGTERM, syscall.SIGINT)
|
|
24
|
-
for {
|
|
25
|
-
time.Sleep(time.Second)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if os.Getenv("APP_MODE") == "exit" {
|
|
30
|
-
os.Exit(2)
|
|
31
|
-
}
|
|
32
|
-
raw, _ := json.Marshal(map[string]any{"uid": os.Geteuid(), "args": os.Args[1:], "env": os.Environ()})
|
|
33
|
-
fmtOutput := append(raw, '\n')
|
|
34
|
-
os.Stdout.Write(fmtOutput)
|
|
35
|
-
if os.Getenv("APP_MODE") == "ignore" {
|
|
36
|
-
signal.Ignore(syscall.SIGTERM, syscall.SIGINT)
|
|
37
|
-
for {
|
|
38
|
-
time.Sleep(time.Second)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
c := make(chan os.Signal, 1)
|
|
42
|
-
signal.Notify(c, syscall.SIGTERM, syscall.SIGINT)
|
|
43
|
-
<-c
|
|
44
|
-
}
|