mystack-rig 1.11.2__tar.gz → 1.11.3__tar.gz
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.
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/PKG-INFO +3 -3
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/README.md +2 -2
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/main.py +6 -5
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/remote_dev.py +19 -17
- mystack_rig-1.11.3/src/cli/ssh_keys.py +37 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/mystack_rig.egg-info/PKG-INFO +3 -3
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/mystack_rig.egg-info/SOURCES.txt +2 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/mystack_rig.egg-info/scm_file_list.json +2 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/mystack_rig.egg-info/scm_version.json +2 -2
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/conftest.py +6 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_dev_command.py +2 -1
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_real_e2e_vpn_tunnel.py +3 -1
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_remote_dev_coverage_extensions.py +2 -1
- mystack_rig-1.11.3/tests/test_ssh_keys.py +36 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_workspace_git_clone.py +4 -2
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/.coveragerc +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/.git-blame-ignore-revs +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/.github/workflows/release.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/.github/workflows/tests.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/.gitignore +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/CLAUDE.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/CLI_STORAGE_SUMMARY.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/Dockerfile +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/GIT_CLONE_FEATURE.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/GLOSSARY.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/HETZNER_STORAGE_GUIDE.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/HETZNER_STORAGE_SECURITY_GUIDE.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/LICENSE +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/Makefile +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/README_REAL_E2E.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/STORAGE_CLI_GUIDE.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0001-per-profile-generated-state-bucket.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0002-outputs-as-separate-object-via-file-handoff.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0003-mcp-servers-declared-once-rendered-at-authorize.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0004-agents-run-as-live-agents-in-tmux.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0005-docker-in-configure-for-devcontainers.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0006-workspace-user-instead-of-root.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0007-managed-playbook-content-ships-as-bundled-roles.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/architecture.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/architecture.png +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/architecture.svg +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/roles.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/forged-idea.md +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/pyproject.toml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/pytest.ini +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/requirements.txt +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/sample.env +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/scripts/coverage_badge.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/scripts/pypi_version.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/setup.cfg +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/__init__.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/__init__.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/__main__.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/agents.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/ansible_filters/__init__.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/ansible_filters/rig_live.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/ansible_filters/rig_mcp.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/assets/rig-agent-queue +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/assets/rig-agent-state +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/assets/tmux.conf +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/config.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/devcontainers.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/encrypt.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/git.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/git_author.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/last_env.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/last_session.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/last_target.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/live_agent.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/log.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/mcp.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/outputs.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/repos.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/requirements.txt +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_base/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_base/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_claude_code/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_claude_code/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_claude_code/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_code_server/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_code_server/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_code_server/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_cursor_cli/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_cursor_cli/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_cursor_cli/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_destroy/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_destroy/tasks/destroy.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_git/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_git/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_git/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_home_ownership/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_home_ownership/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_home_ownership/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_live_agent/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_live_agent/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_live_agent/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_mcp/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_mcp/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_opencode/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_opencode/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_opencode/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_repos/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_repos/tasks/materialize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_user/defaults/main.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_user/tasks/authorize.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_user/tasks/install.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/snapshots.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/state_bucket.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/storage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/vault_keys.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/vpn.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/workspace_user.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/mystack_rig.egg-info/dependency_links.txt +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/mystack_rig.egg-info/entry_points.txt +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/mystack_rig.egg-info/requires.txt +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/mystack_rig.egg-info/top_level.txt +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/test_hetzner_integration.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/_roles.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/fixtures/vpn-gateway.yml +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_agents.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_ansible_galaxy.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_attach_command.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_bundled_roles.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_credential_security.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_destroy_command.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_devcontainers.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_encrypt_command.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_encrypt_coverage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_firewall_client_ip.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_git_clone_unit.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_git_credentials_and_author.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_git_manager.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_gitignore_init.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_hetzner_storage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_init_command.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_inspect_describe.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_last_env.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_last_session.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_last_target.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_live_agent.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_live_agent_cli.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_log.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_main_coverage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_mcp_command.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_mcp_render.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_outputs.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_outputs_storage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_pypi_version.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_python_floor.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_r2_storage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_real_e2e_integration.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_real_e2e_storage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_real_e2e_vpn.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_remote_dev.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_repo_command.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_rig_ansible_vars.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_rig_config.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_run_remote_decoding.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_secret_prompt_hidden.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_setup_provision.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_simulation_storage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_small_module_coverage.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_snapshots.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_state_bucket.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_storage_basic.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_vault_keys.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_vpn_optional.py +0 -0
- {mystack_rig-1.11.2 → mystack_rig-1.11.3}/tests/test_vpn_unit.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mystack-rig
|
|
3
|
-
Version: 1.11.
|
|
3
|
+
Version: 1.11.3
|
|
4
4
|
Summary: Ephemeral remotes with full local parity for coding agents
|
|
5
5
|
Author: mystack-cloud
|
|
6
6
|
License-Expression: MIT
|
|
@@ -394,7 +394,7 @@ Playbooks load `.rig/vars.yml` then `.rig/vars.{identity}.yml` (personal wins),
|
|
|
394
394
|
| `rig_boot_source` | `base` \| `system` \| `workspace` |
|
|
395
395
|
| `rig_action` | `create` \| `apply` \| `destroy` (`rig delete` still sets `destroy`) |
|
|
396
396
|
| `rig_project_dir` | Local project path |
|
|
397
|
-
| `rig_ssh_key_name` / `rig_ssh_key_path` | Local key under
|
|
397
|
+
| `rig_ssh_key_name` / `rig_ssh_key_path` | Local key under `~/.local/state/rig/keys` |
|
|
398
398
|
| `rig_firewall_name` | Firewall resource name |
|
|
399
399
|
| `rig_repos` | `[{name, url, path}, …]` (no secrets) |
|
|
400
400
|
| `rig_git_providers` | e.g. `github`, `gitlab` |
|
|
@@ -438,7 +438,7 @@ See `docs/adr/0002-outputs-as-separate-object-via-file-handoff.md`.
|
|
|
438
438
|
| Personal master key | Prompted on init/unlock; **never stored**. Unwraps data keys from `vars.{identity}.yml`. |
|
|
439
439
|
| `rig_identity_data_key` / `rig_shared_data_key` | Master-key wraps inside `vars.{identity}.yml` (committed). |
|
|
440
440
|
| `/tmp/.rig/.personal-data-key` / `.shared-data-key` | Materialized Ansible vault passwords after unlock (tmpfs). |
|
|
441
|
-
|
|
|
441
|
+
| `~/.local/state/rig/keys/<env>-key` | Per-env SSH private key (attach / apply / delete finalizers). Survives reboot; `RIG_STATE_DIR` or `XDG_STATE_HOME` relocates it. A key left in the old `/tmp/<env>-key` is still used. |
|
|
442
442
|
|
|
443
443
|
### State backend: Hetzner Object Storage or Cloudflare R2
|
|
444
444
|
|
|
@@ -372,7 +372,7 @@ Playbooks load `.rig/vars.yml` then `.rig/vars.{identity}.yml` (personal wins),
|
|
|
372
372
|
| `rig_boot_source` | `base` \| `system` \| `workspace` |
|
|
373
373
|
| `rig_action` | `create` \| `apply` \| `destroy` (`rig delete` still sets `destroy`) |
|
|
374
374
|
| `rig_project_dir` | Local project path |
|
|
375
|
-
| `rig_ssh_key_name` / `rig_ssh_key_path` | Local key under
|
|
375
|
+
| `rig_ssh_key_name` / `rig_ssh_key_path` | Local key under `~/.local/state/rig/keys` |
|
|
376
376
|
| `rig_firewall_name` | Firewall resource name |
|
|
377
377
|
| `rig_repos` | `[{name, url, path}, …]` (no secrets) |
|
|
378
378
|
| `rig_git_providers` | e.g. `github`, `gitlab` |
|
|
@@ -416,7 +416,7 @@ See `docs/adr/0002-outputs-as-separate-object-via-file-handoff.md`.
|
|
|
416
416
|
| Personal master key | Prompted on init/unlock; **never stored**. Unwraps data keys from `vars.{identity}.yml`. |
|
|
417
417
|
| `rig_identity_data_key` / `rig_shared_data_key` | Master-key wraps inside `vars.{identity}.yml` (committed). |
|
|
418
418
|
| `/tmp/.rig/.personal-data-key` / `.shared-data-key` | Materialized Ansible vault passwords after unlock (tmpfs). |
|
|
419
|
-
|
|
|
419
|
+
| `~/.local/state/rig/keys/<env>-key` | Per-env SSH private key (attach / apply / delete finalizers). Survives reboot; `RIG_STATE_DIR` or `XDG_STATE_HOME` relocates it. A key left in the old `/tmp/<env>-key` is still used. |
|
|
420
420
|
|
|
421
421
|
### State backend: Hetzner Object Storage or Cloudflare R2
|
|
422
422
|
|
|
@@ -44,6 +44,7 @@ from cli.remote_dev import (
|
|
|
44
44
|
interactive_env_init,
|
|
45
45
|
normalize_cloud_provider,
|
|
46
46
|
)
|
|
47
|
+
from cli.ssh_keys import ssh_key_path as ssh_key_path_for
|
|
47
48
|
from cli.storage import StorageManager
|
|
48
49
|
|
|
49
50
|
|
|
@@ -226,7 +227,7 @@ def _cmd_attach(args: argparse.Namespace) -> int:
|
|
|
226
227
|
log.error("Could not resolve environment '%s' (no VM IP found)", name)
|
|
227
228
|
return 1
|
|
228
229
|
|
|
229
|
-
ssh_key_path =
|
|
230
|
+
ssh_key_path = ssh_key_path_for(env.ssh_key_name)
|
|
230
231
|
if not os.path.exists(ssh_key_path):
|
|
231
232
|
log.error("SSH private key not found at %s", ssh_key_path)
|
|
232
233
|
log.error("Re-run create on this machine, or restore the key before attaching")
|
|
@@ -364,8 +365,8 @@ def _cmd_exec(args: argparse.Namespace) -> int:
|
|
|
364
365
|
if not env.resolve_resources() or not env.vm_ip:
|
|
365
366
|
log.error("Could not resolve environment '%s' (no VM IP found)", name)
|
|
366
367
|
return 1
|
|
367
|
-
if not os.path.exists(
|
|
368
|
-
log.error("SSH private key not found at
|
|
368
|
+
if not os.path.exists(ssh_key_path_for(env.ssh_key_name)):
|
|
369
|
+
log.error("SSH private key not found at %s", ssh_key_path_for(env.ssh_key_name))
|
|
369
370
|
log.error("Re-run create on this machine, or restore the key before using exec")
|
|
370
371
|
return 1
|
|
371
372
|
|
|
@@ -471,7 +472,7 @@ def _cmd_ssh(args: argparse.Namespace) -> int:
|
|
|
471
472
|
log.error("Could not resolve environment '%s' (no VM IP found)", name)
|
|
472
473
|
return 1
|
|
473
474
|
|
|
474
|
-
ssh_key_path =
|
|
475
|
+
ssh_key_path = ssh_key_path_for(env.ssh_key_name)
|
|
475
476
|
if not os.path.exists(ssh_key_path):
|
|
476
477
|
log.error("SSH private key not found at %s", ssh_key_path)
|
|
477
478
|
log.error("Re-run create on this machine, or restore the key before connecting")
|
|
@@ -662,7 +663,7 @@ def _cmd_apply(args: argparse.Namespace) -> int:
|
|
|
662
663
|
log.error("Could not resolve environment '%s' (no VM IP found)", name)
|
|
663
664
|
return 1
|
|
664
665
|
|
|
665
|
-
ssh_key_path =
|
|
666
|
+
ssh_key_path = ssh_key_path_for(env.ssh_key_name)
|
|
666
667
|
if not os.path.exists(ssh_key_path):
|
|
667
668
|
log.error("SSH private key not found at %s", ssh_key_path)
|
|
668
669
|
log.error("Re-run create on this machine, or restore the key before applying")
|
|
@@ -20,6 +20,8 @@ import requests
|
|
|
20
20
|
|
|
21
21
|
from cli import log as log
|
|
22
22
|
from cli.live_agent import ASSETS_DIR, LiveAgent
|
|
23
|
+
from cli.ssh_keys import new_ssh_key_path
|
|
24
|
+
from cli.ssh_keys import ssh_key_path as _ssh_key_path
|
|
23
25
|
from cli.state_bucket import StateBucketError
|
|
24
26
|
from cli.workspace_user import workspace_home, workspace_user # (ADR 0006)
|
|
25
27
|
|
|
@@ -663,7 +665,7 @@ def build_rig_ansible_vars(
|
|
|
663
665
|
|
|
664
666
|
workspace_name = cfg.get("name") or (env.name if env else "")
|
|
665
667
|
ssh_key_name = (env.ssh_key_name if env else None) or ""
|
|
666
|
-
ssh_key_path =
|
|
668
|
+
ssh_key_path = _ssh_key_path(ssh_key_name) if ssh_key_name else ""
|
|
667
669
|
installed_agents, default_agent = configured_agents(project)
|
|
668
670
|
|
|
669
671
|
vars_out: dict[str, Any] = {
|
|
@@ -2076,7 +2078,7 @@ class RemoteDevEnvironment:
|
|
|
2076
2078
|
|
|
2077
2079
|
def generate_ssh_keys(self):
|
|
2078
2080
|
"""Generate an SSH key pair that can actually log in to the VM."""
|
|
2079
|
-
key_path =
|
|
2081
|
+
key_path = new_ssh_key_path(self.ssh_key_name)
|
|
2080
2082
|
try:
|
|
2081
2083
|
for path in (key_path, f"{key_path}.pub"):
|
|
2082
2084
|
if os.path.exists(path):
|
|
@@ -2150,7 +2152,7 @@ class RemoteDevEnvironment:
|
|
|
2150
2152
|
details["connection"] = {
|
|
2151
2153
|
"host": details["ip"],
|
|
2152
2154
|
"user": self.work_user,
|
|
2153
|
-
"ssh_key_path":
|
|
2155
|
+
"ssh_key_path": _ssh_key_path(self.ssh_key_name),
|
|
2154
2156
|
}
|
|
2155
2157
|
if details.get("status") == "running":
|
|
2156
2158
|
live = self.live_agents(connect_timeout=5)
|
|
@@ -2282,7 +2284,7 @@ class RemoteDevEnvironment:
|
|
|
2282
2284
|
|
|
2283
2285
|
log.debug("Waiting for SSH")
|
|
2284
2286
|
self.vm_ip = self.manager.get_vm_ip(str(self.vm_id))
|
|
2285
|
-
identity_file =
|
|
2287
|
+
identity_file = _ssh_key_path(self.ssh_key_name)
|
|
2286
2288
|
if self.vm_ip and self.manager.wait_for_ssh(self.vm_ip, timeout=300, identity_file=identity_file):
|
|
2287
2289
|
log.debug("SSH available at %s", self.vm_ip)
|
|
2288
2290
|
else:
|
|
@@ -2426,7 +2428,7 @@ class RemoteDevEnvironment:
|
|
|
2426
2428
|
except Exception as exc:
|
|
2427
2429
|
log.warning("Could not ensure vscode_browser_password: %s", exc)
|
|
2428
2430
|
|
|
2429
|
-
ssh_key_path =
|
|
2431
|
+
ssh_key_path = _ssh_key_path(self.ssh_key_name)
|
|
2430
2432
|
if not os.path.exists(ssh_key_path):
|
|
2431
2433
|
log.error("SSH private key not found at %s", ssh_key_path)
|
|
2432
2434
|
return False
|
|
@@ -2787,7 +2789,7 @@ class RemoteDevEnvironment:
|
|
|
2787
2789
|
log.debug("Skipping destroy playbooks (no VM IP)")
|
|
2788
2790
|
return False
|
|
2789
2791
|
|
|
2790
|
-
ssh_key_path =
|
|
2792
|
+
ssh_key_path = _ssh_key_path(self.ssh_key_name)
|
|
2791
2793
|
if not os.path.exists(ssh_key_path):
|
|
2792
2794
|
log.warning(
|
|
2793
2795
|
"Skipping destroy playbooks (SSH key missing at %s)",
|
|
@@ -2883,8 +2885,8 @@ class RemoteDevEnvironment:
|
|
|
2883
2885
|
self.manager._delete_state(self.name)
|
|
2884
2886
|
|
|
2885
2887
|
log.debug("Cleaning up local SSH keys and config host")
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
+
for key_file in {_ssh_key_path(self.ssh_key_name), f"/tmp/{self.ssh_key_name}"}:
|
|
2889
|
+
subprocess.run(["rm", "-f", key_file, f"{key_file}.pub"], capture_output=True)
|
|
2888
2890
|
try:
|
|
2889
2891
|
self.remove_ssh_config_host()
|
|
2890
2892
|
except OSError:
|
|
@@ -2894,7 +2896,7 @@ class RemoteDevEnvironment:
|
|
|
2894
2896
|
"""Get information needed to connect to the VM"""
|
|
2895
2897
|
return {
|
|
2896
2898
|
"vm_ip": self.vm_ip,
|
|
2897
|
-
"ssh_key_path":
|
|
2899
|
+
"ssh_key_path": _ssh_key_path(self.ssh_key_name),
|
|
2898
2900
|
"username": "root", # Hetzner uses root by default for Ubuntu
|
|
2899
2901
|
"vm_name": self.vm_name,
|
|
2900
2902
|
"region": self.region,
|
|
@@ -3014,7 +3016,7 @@ class RemoteDevEnvironment:
|
|
|
3014
3016
|
print(f"\n=== Installing {agent_type} agent on remote VM ===")
|
|
3015
3017
|
|
|
3016
3018
|
# SSH key path
|
|
3017
|
-
ssh_key_path =
|
|
3019
|
+
ssh_key_path = _ssh_key_path(self.ssh_key_name)
|
|
3018
3020
|
|
|
3019
3021
|
# Agent installation script
|
|
3020
3022
|
install_script = f"""
|
|
@@ -3229,7 +3231,7 @@ echo "Agent installation complete!"
|
|
|
3229
3231
|
project.load()
|
|
3230
3232
|
_installed, agent_type = configured_agents(project)
|
|
3231
3233
|
|
|
3232
|
-
ssh_key_path =
|
|
3234
|
+
ssh_key_path = _ssh_key_path(self.ssh_key_name)
|
|
3233
3235
|
remote_cmd = self.agent_remote_command(agent_type, extra_args=agent_args, home=self.work_home)
|
|
3234
3236
|
if persist:
|
|
3235
3237
|
from cli.agents import normalize_agent_type
|
|
@@ -3281,7 +3283,7 @@ echo "Agent installation complete!"
|
|
|
3281
3283
|
self, remote_cmd: str, *, tty: bool, connect_timeout: int | None = None, user: str | None = None
|
|
3282
3284
|
) -> list[str]:
|
|
3283
3285
|
"""SSH argv as the workspace user (or ``user``). ``tty`` allocates a terminal; otherwise the call is batch-mode."""
|
|
3284
|
-
ssh_key_path =
|
|
3286
|
+
ssh_key_path = _ssh_key_path(self.ssh_key_name)
|
|
3285
3287
|
cmd = ["ssh"]
|
|
3286
3288
|
if tty:
|
|
3287
3289
|
cmd.append("-tt")
|
|
@@ -3357,7 +3359,7 @@ echo "Agent installation complete!"
|
|
|
3357
3359
|
"""Live agents on the VM, or None when the VM cannot be reached."""
|
|
3358
3360
|
from cli.live_agent import list_script, parse_live_agents
|
|
3359
3361
|
|
|
3360
|
-
if not self.vm_ip or not self.ssh_key_name or not os.path.exists(
|
|
3362
|
+
if not self.vm_ip or not self.ssh_key_name or not os.path.exists(_ssh_key_path(self.ssh_key_name)):
|
|
3361
3363
|
return None
|
|
3362
3364
|
try:
|
|
3363
3365
|
result = self.run_remote(list_script(), timeout=connect_timeout + 15, connect_timeout=connect_timeout)
|
|
@@ -3426,7 +3428,7 @@ echo "Agent installation complete!"
|
|
|
3426
3428
|
remote_cmd = f"mkdir -p {REMOTE_WORKSPACE_ROOT} && cd {REMOTE_WORKSPACE_ROOT} && exec bash -l"
|
|
3427
3429
|
ssh_cmd = self._interactive_ssh_command(remote_cmd)
|
|
3428
3430
|
log.info("Connecting to %s", self.name)
|
|
3429
|
-
log.debug("SSH key=%s",
|
|
3431
|
+
log.debug("SSH key=%s", _ssh_key_path(self.ssh_key_name))
|
|
3430
3432
|
log.debug("Remote command=%s", remote_cmd)
|
|
3431
3433
|
|
|
3432
3434
|
session_log = os.path.join("/tmp/.rig", f"ssh-{self.name}.log")
|
|
@@ -3491,7 +3493,7 @@ echo "Agent installation complete!"
|
|
|
3491
3493
|
raise RuntimeError("VM IP and SSH key are required for SSH config")
|
|
3492
3494
|
|
|
3493
3495
|
alias = self.ssh_host_alias()
|
|
3494
|
-
key_path =
|
|
3496
|
+
key_path = _ssh_key_path(self.ssh_key_name)
|
|
3495
3497
|
config_path = os.path.expanduser(ssh_config_path or "~/.ssh/config")
|
|
3496
3498
|
os.makedirs(os.path.dirname(config_path), mode=0o700, exist_ok=True)
|
|
3497
3499
|
|
|
@@ -3622,7 +3624,7 @@ echo "Agent installation complete!"
|
|
|
3622
3624
|
log.error("VM not ready for VS Code")
|
|
3623
3625
|
return 1
|
|
3624
3626
|
|
|
3625
|
-
ssh_key_path =
|
|
3627
|
+
ssh_key_path = _ssh_key_path(self.ssh_key_name)
|
|
3626
3628
|
if not os.path.exists(ssh_key_path):
|
|
3627
3629
|
log.error("SSH private key not found at %s", ssh_key_path)
|
|
3628
3630
|
log.error("Re-run create on this machine, or restore the key before opening VS Code")
|
|
@@ -3711,7 +3713,7 @@ echo "Agent installation complete!"
|
|
|
3711
3713
|
installed_agents, agent_type = configured_agents(project)
|
|
3712
3714
|
return {
|
|
3713
3715
|
"vm_ip": self.vm_ip,
|
|
3714
|
-
"ssh_key_path":
|
|
3716
|
+
"ssh_key_path": _ssh_key_path(self.ssh_key_name),
|
|
3715
3717
|
"agent_type": agent_type,
|
|
3716
3718
|
"agent_types": installed_agents,
|
|
3717
3719
|
"remote_command": self.agent_remote_command(agent_type, home=self.work_home),
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Where a workspace's local SSH private key lives.
|
|
2
|
+
|
|
3
|
+
Keys used to sit in ``/tmp/<env>-key``, which a reboot or tmp cleaner wipes,
|
|
4
|
+
leaving a live VM nobody can attach to. They now live in a per-user state
|
|
5
|
+
directory. A key still in the legacy ``/tmp`` location keeps working.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import os
|
|
11
|
+
|
|
12
|
+
LEGACY_KEY_DIR = "/tmp"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def key_dir() -> str:
|
|
16
|
+
"""Per-user directory for workspace SSH keys (``RIG_STATE_DIR`` overrides)."""
|
|
17
|
+
base = os.environ.get("RIG_STATE_DIR")
|
|
18
|
+
if not base:
|
|
19
|
+
state = os.environ.get("XDG_STATE_HOME") or os.path.expanduser("~/.local/state")
|
|
20
|
+
base = os.path.join(state, "rig")
|
|
21
|
+
return os.path.join(base, "keys")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def ssh_key_path(key_name: str) -> str:
|
|
25
|
+
"""Path of the private key *key_name*; falls back to a surviving legacy /tmp key."""
|
|
26
|
+
path = os.path.join(key_dir(), key_name)
|
|
27
|
+
legacy = os.path.join(LEGACY_KEY_DIR, key_name)
|
|
28
|
+
if not os.path.exists(path) and os.path.exists(legacy):
|
|
29
|
+
return legacy
|
|
30
|
+
return path
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def new_ssh_key_path(key_name: str) -> str:
|
|
34
|
+
"""Path for a key about to be generated; creates the private directory."""
|
|
35
|
+
directory = key_dir()
|
|
36
|
+
os.makedirs(directory, mode=0o700, exist_ok=True)
|
|
37
|
+
return os.path.join(directory, key_name)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mystack-rig
|
|
3
|
-
Version: 1.11.
|
|
3
|
+
Version: 1.11.3
|
|
4
4
|
Summary: Ephemeral remotes with full local parity for coding agents
|
|
5
5
|
Author: mystack-cloud
|
|
6
6
|
License-Expression: MIT
|
|
@@ -394,7 +394,7 @@ Playbooks load `.rig/vars.yml` then `.rig/vars.{identity}.yml` (personal wins),
|
|
|
394
394
|
| `rig_boot_source` | `base` \| `system` \| `workspace` |
|
|
395
395
|
| `rig_action` | `create` \| `apply` \| `destroy` (`rig delete` still sets `destroy`) |
|
|
396
396
|
| `rig_project_dir` | Local project path |
|
|
397
|
-
| `rig_ssh_key_name` / `rig_ssh_key_path` | Local key under
|
|
397
|
+
| `rig_ssh_key_name` / `rig_ssh_key_path` | Local key under `~/.local/state/rig/keys` |
|
|
398
398
|
| `rig_firewall_name` | Firewall resource name |
|
|
399
399
|
| `rig_repos` | `[{name, url, path}, …]` (no secrets) |
|
|
400
400
|
| `rig_git_providers` | e.g. `github`, `gitlab` |
|
|
@@ -438,7 +438,7 @@ See `docs/adr/0002-outputs-as-separate-object-via-file-handoff.md`.
|
|
|
438
438
|
| Personal master key | Prompted on init/unlock; **never stored**. Unwraps data keys from `vars.{identity}.yml`. |
|
|
439
439
|
| `rig_identity_data_key` / `rig_shared_data_key` | Master-key wraps inside `vars.{identity}.yml` (committed). |
|
|
440
440
|
| `/tmp/.rig/.personal-data-key` / `.shared-data-key` | Materialized Ansible vault passwords after unlock (tmpfs). |
|
|
441
|
-
|
|
|
441
|
+
| `~/.local/state/rig/keys/<env>-key` | Per-env SSH private key (attach / apply / delete finalizers). Survives reboot; `RIG_STATE_DIR` or `XDG_STATE_HOME` relocates it. A key left in the old `/tmp/<env>-key` is still used. |
|
|
442
442
|
|
|
443
443
|
### State backend: Hetzner Object Storage or Cloudflare R2
|
|
444
444
|
|
|
@@ -55,6 +55,7 @@ src/cli/remote_dev.py
|
|
|
55
55
|
src/cli/repos.py
|
|
56
56
|
src/cli/requirements.txt
|
|
57
57
|
src/cli/snapshots.py
|
|
58
|
+
src/cli/ssh_keys.py
|
|
58
59
|
src/cli/state_bucket.py
|
|
59
60
|
src/cli/storage.py
|
|
60
61
|
src/cli/vault_keys.py
|
|
@@ -155,6 +156,7 @@ tests/test_setup_provision.py
|
|
|
155
156
|
tests/test_simulation_storage.py
|
|
156
157
|
tests/test_small_module_coverage.py
|
|
157
158
|
tests/test_snapshots.py
|
|
159
|
+
tests/test_ssh_keys.py
|
|
158
160
|
tests/test_state_bucket.py
|
|
159
161
|
tests/test_storage_basic.py
|
|
160
162
|
tests/test_vault_keys.py
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"src/cli/roles/rig_workspace_user/tasks/authorize.yml",
|
|
95
95
|
"src/cli/roles/rig_workspace_user/tasks/install.yml",
|
|
96
96
|
"src/cli/snapshots.py",
|
|
97
|
+
"src/cli/ssh_keys.py",
|
|
97
98
|
"src/cli/state_bucket.py",
|
|
98
99
|
"src/cli/storage.py",
|
|
99
100
|
"src/cli/vault_keys.py",
|
|
@@ -150,6 +151,7 @@
|
|
|
150
151
|
"tests/test_simulation_storage.py",
|
|
151
152
|
"tests/test_small_module_coverage.py",
|
|
152
153
|
"tests/test_snapshots.py",
|
|
154
|
+
"tests/test_ssh_keys.py",
|
|
153
155
|
"tests/test_state_bucket.py",
|
|
154
156
|
"tests/test_storage_basic.py",
|
|
155
157
|
"tests/test_vault_keys.py",
|
|
@@ -175,3 +175,9 @@ def _isolate_rig_tmp_keys(tmp_path, monkeypatch):
|
|
|
175
175
|
monkeypatch.setattr(encrypt_mod, "DEFAULT_DATA_KEY_PATH", legacy)
|
|
176
176
|
except ImportError:
|
|
177
177
|
pass
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
@pytest.fixture(autouse=True)
|
|
181
|
+
def _isolate_rig_state_dir(tmp_path, monkeypatch):
|
|
182
|
+
"""Keep workspace SSH keys out of the developer's real ~/.local/state/rig."""
|
|
183
|
+
monkeypatch.setenv("RIG_STATE_DIR", str(tmp_path / "rig-state"))
|
|
@@ -14,6 +14,7 @@ from cli.remote_dev import (
|
|
|
14
14
|
RemoteDevEnvironment,
|
|
15
15
|
remote_workspace_path,
|
|
16
16
|
)
|
|
17
|
+
from cli.ssh_keys import ssh_key_path
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
def test_remote_workspace_path_helpers():
|
|
@@ -44,7 +45,7 @@ def test_ensure_ssh_config_host_upserts_block(tmp_path):
|
|
|
44
45
|
text = open(config_path, encoding="utf-8").read()
|
|
45
46
|
assert "Host rig-dev-ssh1" in text
|
|
46
47
|
assert "HostName 203.0.113.50" in text
|
|
47
|
-
assert f"IdentityFile
|
|
48
|
+
assert f"IdentityFile {ssh_key_path(env.ssh_key_name)}" in text
|
|
48
49
|
|
|
49
50
|
env.vm_ip = "203.0.113.51"
|
|
50
51
|
env.ensure_ssh_config_host(ssh_config_path=config_path)
|
|
@@ -23,6 +23,8 @@ import uuid
|
|
|
23
23
|
|
|
24
24
|
import pytest
|
|
25
25
|
|
|
26
|
+
from cli.ssh_keys import ssh_key_path as ssh_key_path_for
|
|
27
|
+
|
|
26
28
|
# Add src to path
|
|
27
29
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
|
|
28
30
|
|
|
@@ -117,7 +119,7 @@ class TestRealE2EVPTunnel:
|
|
|
117
119
|
try:
|
|
118
120
|
assert env.setup(), "VPN gateway VM setup should succeed"
|
|
119
121
|
assert env.vm_ip is not None
|
|
120
|
-
ssh_key_path =
|
|
122
|
+
ssh_key_path = ssh_key_path_for(env.ssh_key_name)
|
|
121
123
|
self._provision_wireguard_gateway(env.vm_ip, ssh_key_path)
|
|
122
124
|
|
|
123
125
|
gateway_public_key = self._ssh(env.vm_ip, ssh_key_path, "wg show wg0 public-key").stdout.strip()
|
|
@@ -41,6 +41,7 @@ from cli.remote_dev import ( # noqa: E402
|
|
|
41
41
|
resolve_firewall_mode,
|
|
42
42
|
resolve_init_context,
|
|
43
43
|
)
|
|
44
|
+
from cli.ssh_keys import ssh_key_path
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
def _mock_response(
|
|
@@ -647,7 +648,7 @@ class TestRemoteDevEnvironmentCoverage:
|
|
|
647
648
|
|
|
648
649
|
def test_generate_ssh_keys_paths(self, tmp_path, monkeypatch):
|
|
649
650
|
env = RemoteDevEnvironment(name="gkeys")
|
|
650
|
-
key_path =
|
|
651
|
+
key_path = ssh_key_path(env.ssh_key_name)
|
|
651
652
|
|
|
652
653
|
class Ret:
|
|
653
654
|
returncode = 0
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from cli import ssh_keys
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_key_path_is_per_user_not_tmp(tmp_path, monkeypatch):
|
|
7
|
+
monkeypatch.setenv("RIG_STATE_DIR", str(tmp_path))
|
|
8
|
+
path = ssh_keys.ssh_key_path("dev-aaa-key")
|
|
9
|
+
assert path == str(tmp_path / "keys" / "dev-aaa-key")
|
|
10
|
+
assert os.path.basename(os.path.dirname(path)) == "keys"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_new_key_path_creates_private_dir(tmp_path, monkeypatch):
|
|
14
|
+
monkeypatch.setenv("RIG_STATE_DIR", str(tmp_path))
|
|
15
|
+
path = ssh_keys.new_ssh_key_path("dev-aaa-key")
|
|
16
|
+
assert os.path.isdir(os.path.dirname(path))
|
|
17
|
+
assert (os.stat(os.path.dirname(path)).st_mode & 0o777) == 0o700
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def test_legacy_tmp_key_still_found(tmp_path, monkeypatch):
|
|
21
|
+
monkeypatch.setenv("RIG_STATE_DIR", str(tmp_path / "state"))
|
|
22
|
+
legacy_dir = tmp_path / "legacy"
|
|
23
|
+
legacy_dir.mkdir()
|
|
24
|
+
(legacy_dir / "dev-old-key").write_text("k")
|
|
25
|
+
monkeypatch.setattr(ssh_keys, "LEGACY_KEY_DIR", str(legacy_dir))
|
|
26
|
+
assert ssh_keys.ssh_key_path("dev-old-key") == str(legacy_dir / "dev-old-key")
|
|
27
|
+
new = tmp_path / "state" / "keys"
|
|
28
|
+
new.mkdir(parents=True)
|
|
29
|
+
(new / "dev-old-key").write_text("k")
|
|
30
|
+
assert ssh_keys.ssh_key_path("dev-old-key") == str(new / "dev-old-key")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_xdg_state_home_used(tmp_path, monkeypatch):
|
|
34
|
+
monkeypatch.delenv("RIG_STATE_DIR", raising=False)
|
|
35
|
+
monkeypatch.setenv("XDG_STATE_HOME", str(tmp_path))
|
|
36
|
+
assert ssh_keys.key_dir() == str(tmp_path / "rig" / "keys")
|
|
@@ -15,6 +15,8 @@ import uuid
|
|
|
15
15
|
|
|
16
16
|
import pytest
|
|
17
17
|
|
|
18
|
+
from cli.ssh_keys import ssh_key_path as ssh_key_path_for
|
|
19
|
+
|
|
18
20
|
# Add src to path
|
|
19
21
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
|
|
20
22
|
|
|
@@ -157,7 +159,7 @@ class TestWorkspaceGitClone:
|
|
|
157
159
|
try:
|
|
158
160
|
ansible_manager = AnsibleManager(project_config)
|
|
159
161
|
ansible_manager.configure(test_workspace_dir)
|
|
160
|
-
ssh_key_path =
|
|
162
|
+
ssh_key_path = ssh_key_path_for(env.ssh_key_name)
|
|
161
163
|
ansible_manager.setup_inventory(vm_ip=env.vm_ip, ssh_key_path=ssh_key_path, username="root")
|
|
162
164
|
ansible_manager.setup_playbook(custom_tasks=_clone_tasks())
|
|
163
165
|
assert os.path.exists(ansible_manager.playbook_path)
|
|
@@ -246,7 +248,7 @@ class TestGitAuthentication:
|
|
|
246
248
|
try:
|
|
247
249
|
ansible_manager = AnsibleManager(project_config)
|
|
248
250
|
ansible_manager.configure(test_workspace_dir)
|
|
249
|
-
ssh_key_path =
|
|
251
|
+
ssh_key_path = ssh_key_path_for(env.ssh_key_name)
|
|
250
252
|
ansible_manager.setup_inventory(vm_ip=env.vm_ip, ssh_key_path=ssh_key_path, username="root")
|
|
251
253
|
ansible_manager.setup_playbook(custom_tasks=_clone_tasks())
|
|
252
254
|
playbook_ok = ansible_manager.run_playbook(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0001-per-profile-generated-state-bucket.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0004-agents-run-as-live-agents-in-tmux.md
RENAMED
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/docs/adr/0005-docker-in-configure-for-devcontainers.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_home_ownership/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_home_ownership/tasks/authorize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_home_ownership/tasks/install.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_repos/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_repos/tasks/materialize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_user/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_user/tasks/authorize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.11.2 → mystack_rig-1.11.3}/src/cli/roles/rig_workspace_user/tasks/install.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|