mystack-rig 1.10.0__tar.gz → 1.10.2__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.10.0 → mystack_rig-1.10.2}/PKG-INFO +1 -1
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/encrypt.py +5 -2
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/remote_dev.py +2 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_git/tasks/authorize.yml +4 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/vault_keys.py +92 -5
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/mystack_rig.egg-info/PKG-INFO +1 -1
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/mystack_rig.egg-info/SOURCES.txt +3 -3
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/mystack_rig.egg-info/scm_file_list.json +2 -2
- mystack_rig-1.10.2/src/mystack_rig.egg-info/scm_version.json +8 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_git_credentials_and_author.py +19 -1
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_real_e2e_vpn_tunnel.py +5 -1
- mystack_rig-1.10.2/tests/test_run_remote_decoding.py +33 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_vault_keys.py +86 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_workspace_git_clone.py +5 -2
- mystack_rig-1.10.0/.rig/playbooks/README.md +0 -45
- mystack_rig-1.10.0/src/mystack_rig.egg-info/scm_version.json +0 -8
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/.coveragerc +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/.git-blame-ignore-revs +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/.github/workflows/release.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/.github/workflows/tests.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/.gitignore +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/CLAUDE.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/CLI_STORAGE_SUMMARY.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/Dockerfile +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/GIT_CLONE_FEATURE.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/GLOSSARY.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/HETZNER_STORAGE_GUIDE.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/HETZNER_STORAGE_SECURITY_GUIDE.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/LICENSE +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/Makefile +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/README.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/README_REAL_E2E.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/STORAGE_CLI_GUIDE.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/adr/0001-per-profile-generated-state-bucket.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/adr/0002-outputs-as-separate-object-via-file-handoff.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/adr/0003-mcp-servers-declared-once-rendered-at-authorize.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/adr/0004-agents-run-as-live-agents-in-tmux.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/adr/0005-docker-in-configure-for-devcontainers.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/adr/0006-workspace-user-instead-of-root.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/adr/0007-managed-playbook-content-ships-as-bundled-roles.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/architecture.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/architecture.png +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/architecture.svg +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/roles.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/forged-idea.md +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/pyproject.toml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/pytest.ini +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/requirements.txt +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/sample.env +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/scripts/coverage_badge.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/scripts/pypi_version.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/setup.cfg +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/__init__.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/__init__.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/__main__.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/agents.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/ansible_filters/__init__.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/ansible_filters/rig_live.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/ansible_filters/rig_mcp.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/assets/rig-agent-queue +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/assets/rig-agent-state +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/assets/tmux.conf +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/config.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/devcontainers.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/git.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/git_author.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/last_env.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/last_session.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/last_target.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/live_agent.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/log.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/main.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/mcp.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/outputs.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/repos.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/requirements.txt +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_base/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_base/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_claude_code/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_claude_code/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_claude_code/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_code_server/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_code_server/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_code_server/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_cursor_cli/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_cursor_cli/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_cursor_cli/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_destroy/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_destroy/tasks/destroy.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_git/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_git/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_home_ownership/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_home_ownership/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_home_ownership/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_live_agent/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_live_agent/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_live_agent/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_mcp/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_mcp/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_opencode/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_opencode/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_opencode/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_repos/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_repos/tasks/materialize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_user/defaults/main.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_user/tasks/authorize.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_user/tasks/install.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/snapshots.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/state_bucket.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/storage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/vpn.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/workspace_user.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/mystack_rig.egg-info/dependency_links.txt +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/mystack_rig.egg-info/entry_points.txt +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/mystack_rig.egg-info/requires.txt +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/mystack_rig.egg-info/top_level.txt +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/test_hetzner_integration.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/_roles.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/conftest.py +0 -0
- {mystack_rig-1.10.0/.rig/playbooks → mystack_rig-1.10.2/tests/fixtures}/vpn-gateway.yml +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_agents.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_ansible_galaxy.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_attach_command.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_bundled_roles.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_credential_security.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_destroy_command.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_dev_command.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_devcontainers.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_encrypt_command.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_encrypt_coverage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_firewall_client_ip.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_git_clone_unit.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_git_manager.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_gitignore_init.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_hetzner_storage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_init_command.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_inspect_describe.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_last_env.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_last_session.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_last_target.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_live_agent.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_live_agent_cli.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_log.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_main_coverage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_mcp_command.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_mcp_render.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_outputs.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_outputs_storage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_pypi_version.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_python_floor.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_r2_storage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_real_e2e_integration.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_real_e2e_storage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_real_e2e_vpn.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_remote_dev.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_remote_dev_coverage_extensions.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_repo_command.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_rig_ansible_vars.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_rig_config.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_secret_prompt_hidden.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_setup_provision.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_simulation_storage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_small_module_coverage.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_snapshots.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_state_bucket.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_storage_basic.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_vpn_optional.py +0 -0
- {mystack_rig-1.10.0 → mystack_rig-1.10.2}/tests/test_vpn_unit.py +0 -0
|
@@ -67,11 +67,14 @@ def ensure_data_key(
|
|
|
67
67
|
key. Falls back to legacy prompt-only creation when no identity wraps exist
|
|
68
68
|
and ``path`` was requested explicitly.
|
|
69
69
|
"""
|
|
70
|
+
root = resolve_project_dir(project_dir)
|
|
70
71
|
existing = read_data_key(path)
|
|
71
72
|
if existing is not None:
|
|
72
|
-
|
|
73
|
+
from cli.vault_keys import cached_keys_belong_to_project
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
# /tmp/.rig is shared across projects; ignore keys another project left.
|
|
76
|
+
if cached_keys_belong_to_project(root):
|
|
77
|
+
return existing
|
|
75
78
|
# Prefer unwrapping master-key wraps when present.
|
|
76
79
|
try:
|
|
77
80
|
from cli.vault_keys import personal_vars_path, read_wrap_fields, resolve_identity
|
|
@@ -36,7 +36,10 @@
|
|
|
36
36
|
copy:
|
|
37
37
|
dest: /home/{{ rig_user }}/.config/rig/git-provider.env
|
|
38
38
|
mode: "0600"
|
|
39
|
+
# The header keeps the file non-empty: ansible-core 2.21 rejects empty
|
|
40
|
+
# `content`, and with only per-Repo PATs set neither token renders.
|
|
39
41
|
content: |
|
|
42
|
+
# managed by rig
|
|
40
43
|
{% if _rig_gh_token | length > 0 %}
|
|
41
44
|
GH_TOKEN={{ _rig_gh_token }}
|
|
42
45
|
{% endif %}
|
|
@@ -51,6 +54,7 @@
|
|
|
51
54
|
dest: /home/{{ rig_user }}/.config/rig/git-hosts
|
|
52
55
|
mode: "0600"
|
|
53
56
|
content: |
|
|
57
|
+
# managed by rig
|
|
54
58
|
{% for t in rig_git_repo_tokens | default([]) %}
|
|
55
59
|
{% set _tok = lookup('vars', t.var, default='') %}
|
|
56
60
|
{% if _tok | length > 0 %}
|
|
@@ -171,15 +171,92 @@ def write_data_key_file(data_key: str, path: str) -> None:
|
|
|
171
171
|
pass
|
|
172
172
|
|
|
173
173
|
|
|
174
|
-
def
|
|
174
|
+
def _key_owner_path() -> str:
|
|
175
|
+
return os.path.join(TMP_RIG_DIR, ".key-owner")
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def _store_paths(fingerprint: str) -> tuple[str, str]:
|
|
179
|
+
"""Per-project copies of the data keys, namespaced by wrap fingerprint."""
|
|
180
|
+
base = os.path.join(TMP_RIG_DIR, "keys", fingerprint)
|
|
181
|
+
return os.path.join(base, "personal"), os.path.join(base, "shared")
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def wrap_fingerprint(identity_wrap: str, shared_wrap: str) -> str:
|
|
185
|
+
"""Stable id of a project's key wraps (the wraps are public ciphertext)."""
|
|
186
|
+
blob = f"{identity_wrap}\n{shared_wrap}"
|
|
187
|
+
return hashlib.sha256(blob.encode("utf-8")).hexdigest()[:16]
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def project_wrap_fingerprint(project_dir: str, identity: str | None = None) -> str | None:
|
|
191
|
+
"""Fingerprint of the project's key wraps, or None when it has none."""
|
|
192
|
+
wraps = read_wrap_fields(personal_vars_path(project_dir, identity))
|
|
193
|
+
if IDENTITY_DATA_KEY_VAR not in wraps or SHARED_DATA_KEY_VAR not in wraps:
|
|
194
|
+
return None
|
|
195
|
+
return wrap_fingerprint(wraps[IDENTITY_DATA_KEY_VAR], wraps[SHARED_DATA_KEY_VAR])
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def cached_keys_belong_to_project(project_dir: str, identity: str | None = None) -> bool:
|
|
199
|
+
"""
|
|
200
|
+
True when keys cached under /tmp/.rig may be used for this project.
|
|
201
|
+
|
|
202
|
+
/tmp/.rig is shared by every project of the user, so another project's
|
|
203
|
+
unlock or ``rig init`` can replace the keys. A project with key wraps only
|
|
204
|
+
accepts a cache materialized from those same wraps. A project without
|
|
205
|
+
wraps (legacy / test fallback) accepts any cache.
|
|
206
|
+
"""
|
|
207
|
+
fingerprint = project_wrap_fingerprint(project_dir, identity)
|
|
208
|
+
if fingerprint is None:
|
|
209
|
+
return True
|
|
210
|
+
return read_data_key_file(_key_owner_path()) == fingerprint
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def tmp_keys_match_project(project_dir: str, identity: str | None = None) -> bool:
|
|
214
|
+
"""Both cached keys exist and belong to this project."""
|
|
215
|
+
return tmp_data_keys_present() and cached_keys_belong_to_project(project_dir, identity)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def materialize_data_keys(
|
|
219
|
+
identity_key: str,
|
|
220
|
+
shared_key: str,
|
|
221
|
+
owner_fingerprint: str | None = None,
|
|
222
|
+
) -> tuple[str, str]:
|
|
175
223
|
"""Write both data keys under /tmp/.rig and return their paths."""
|
|
176
224
|
write_data_key_file(identity_key, PERSONAL_DATA_KEY_PATH)
|
|
177
225
|
write_data_key_file(shared_key, SHARED_DATA_KEY_PATH)
|
|
226
|
+
if owner_fingerprint:
|
|
227
|
+
write_data_key_file(owner_fingerprint, _key_owner_path())
|
|
228
|
+
personal_copy, shared_copy = _store_paths(owner_fingerprint)
|
|
229
|
+
write_data_key_file(identity_key, personal_copy)
|
|
230
|
+
write_data_key_file(shared_key, shared_copy)
|
|
231
|
+
else:
|
|
232
|
+
# Keys of unknown origin: no project with wraps may claim them.
|
|
233
|
+
try:
|
|
234
|
+
os.unlink(_key_owner_path())
|
|
235
|
+
except OSError:
|
|
236
|
+
pass
|
|
178
237
|
# Keep legacy path as a copy of the identity key for older call sites.
|
|
179
238
|
write_data_key_file(identity_key, DEFAULT_DATA_KEY_PATH)
|
|
180
239
|
return PERSONAL_DATA_KEY_PATH, SHARED_DATA_KEY_PATH
|
|
181
240
|
|
|
182
241
|
|
|
242
|
+
def restore_project_keys(project_dir: str, identity: str | None = None) -> bool:
|
|
243
|
+
"""
|
|
244
|
+
Reactivate this project's cached keys after another project replaced them.
|
|
245
|
+
|
|
246
|
+
Returns True when the project's own copy existed and is now the active
|
|
247
|
+
key pair, so the master key need not be asked for again.
|
|
248
|
+
"""
|
|
249
|
+
fingerprint = project_wrap_fingerprint(project_dir, identity)
|
|
250
|
+
if fingerprint is None:
|
|
251
|
+
return False
|
|
252
|
+
personal_copy, shared_copy = _store_paths(fingerprint)
|
|
253
|
+
personal, shared = read_data_key_file(personal_copy), read_data_key_file(shared_copy)
|
|
254
|
+
if not (personal and shared):
|
|
255
|
+
return False
|
|
256
|
+
materialize_data_keys(personal, shared, fingerprint)
|
|
257
|
+
return True
|
|
258
|
+
|
|
259
|
+
|
|
183
260
|
def tmp_data_keys_present() -> bool:
|
|
184
261
|
return bool(read_data_key_file(PERSONAL_DATA_KEY_PATH) and read_data_key_file(SHARED_DATA_KEY_PATH))
|
|
185
262
|
|
|
@@ -285,10 +362,12 @@ def unlock_data_keys(
|
|
|
285
362
|
|
|
286
363
|
Returns ``(personal_key_path, shared_key_path)``.
|
|
287
364
|
"""
|
|
288
|
-
|
|
365
|
+
ident = resolve_identity(identity)
|
|
366
|
+
if tmp_keys_match_project(project_dir, ident):
|
|
367
|
+
return PERSONAL_DATA_KEY_PATH, SHARED_DATA_KEY_PATH
|
|
368
|
+
if restore_project_keys(project_dir, ident):
|
|
289
369
|
return PERSONAL_DATA_KEY_PATH, SHARED_DATA_KEY_PATH
|
|
290
370
|
|
|
291
|
-
ident = resolve_identity(identity)
|
|
292
371
|
id_path = personal_vars_path(project_dir, ident)
|
|
293
372
|
wraps = read_wrap_fields(id_path)
|
|
294
373
|
if IDENTITY_DATA_KEY_VAR not in wraps or SHARED_DATA_KEY_VAR not in wraps:
|
|
@@ -309,7 +388,11 @@ def unlock_data_keys(
|
|
|
309
388
|
)
|
|
310
389
|
identity_dk = unwrap_with_master_key(wraps[IDENTITY_DATA_KEY_VAR], key)
|
|
311
390
|
shared_dk = unwrap_with_master_key(wraps[SHARED_DATA_KEY_VAR], key)
|
|
312
|
-
return materialize_data_keys(
|
|
391
|
+
return materialize_data_keys(
|
|
392
|
+
identity_dk,
|
|
393
|
+
shared_dk,
|
|
394
|
+
wrap_fingerprint(wraps[IDENTITY_DATA_KEY_VAR], wraps[SHARED_DATA_KEY_VAR]),
|
|
395
|
+
)
|
|
313
396
|
|
|
314
397
|
|
|
315
398
|
def shared_vault_exists(project_dir: str) -> bool:
|
|
@@ -377,7 +460,11 @@ def bootstrap_identity_keys(
|
|
|
377
460
|
shared_data_key=shared_dk,
|
|
378
461
|
master_key=key,
|
|
379
462
|
)
|
|
380
|
-
personal_path, shared_path = materialize_data_keys(
|
|
463
|
+
personal_path, shared_path = materialize_data_keys(
|
|
464
|
+
identity_dk,
|
|
465
|
+
shared_dk,
|
|
466
|
+
project_wrap_fingerprint(project_dir, ident),
|
|
467
|
+
)
|
|
381
468
|
print(f"Wrote key wraps to {id_path}")
|
|
382
469
|
print(f"Materialized data keys under {TMP_RIG_DIR}")
|
|
383
470
|
return ident, personal_path, shared_path
|
|
@@ -21,8 +21,6 @@ sample.env
|
|
|
21
21
|
test_hetzner_integration.py
|
|
22
22
|
.github/workflows/release.yml
|
|
23
23
|
.github/workflows/tests.yml
|
|
24
|
-
.rig/playbooks/README.md
|
|
25
|
-
.rig/playbooks/vpn-gateway.yml
|
|
26
24
|
docs/architecture.md
|
|
27
25
|
docs/architecture.png
|
|
28
26
|
docs/architecture.svg
|
|
@@ -151,6 +149,7 @@ tests/test_remote_dev_coverage_extensions.py
|
|
|
151
149
|
tests/test_repo_command.py
|
|
152
150
|
tests/test_rig_ansible_vars.py
|
|
153
151
|
tests/test_rig_config.py
|
|
152
|
+
tests/test_run_remote_decoding.py
|
|
154
153
|
tests/test_secret_prompt_hidden.py
|
|
155
154
|
tests/test_setup_provision.py
|
|
156
155
|
tests/test_simulation_storage.py
|
|
@@ -161,4 +160,5 @@ tests/test_storage_basic.py
|
|
|
161
160
|
tests/test_vault_keys.py
|
|
162
161
|
tests/test_vpn_optional.py
|
|
163
162
|
tests/test_vpn_unit.py
|
|
164
|
-
tests/test_workspace_git_clone.py
|
|
163
|
+
tests/test_workspace_git_clone.py
|
|
164
|
+
tests/fixtures/vpn-gateway.yml
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
".github/workflows/release.yml",
|
|
6
6
|
".github/workflows/tests.yml",
|
|
7
7
|
".gitignore",
|
|
8
|
-
".rig/playbooks/README.md",
|
|
9
|
-
".rig/playbooks/vpn-gateway.yml",
|
|
10
8
|
"CLAUDE.md",
|
|
11
9
|
"CLI_STORAGE_SUMMARY.md",
|
|
12
10
|
"Dockerfile",
|
|
@@ -104,6 +102,7 @@
|
|
|
104
102
|
"test_hetzner_integration.py",
|
|
105
103
|
"tests/_roles.py",
|
|
106
104
|
"tests/conftest.py",
|
|
105
|
+
"tests/fixtures/vpn-gateway.yml",
|
|
107
106
|
"tests/test_agents.py",
|
|
108
107
|
"tests/test_ansible_galaxy.py",
|
|
109
108
|
"tests/test_attach_command.py",
|
|
@@ -145,6 +144,7 @@
|
|
|
145
144
|
"tests/test_repo_command.py",
|
|
146
145
|
"tests/test_rig_ansible_vars.py",
|
|
147
146
|
"tests/test_rig_config.py",
|
|
147
|
+
"tests/test_run_remote_decoding.py",
|
|
148
148
|
"tests/test_secret_prompt_hidden.py",
|
|
149
149
|
"tests/test_setup_provision.py",
|
|
150
150
|
"tests/test_simulation_storage.py",
|
|
@@ -281,12 +281,30 @@ def test_authorize_writes_per_repo_tokens_from_their_vars():
|
|
|
281
281
|
{"host": "x.example", "user": "oauth2", "var": "unset"},
|
|
282
282
|
],
|
|
283
283
|
)
|
|
284
|
-
assert rendered.strip() == "gitlab.com oauth2 glpat-1"
|
|
284
|
+
assert [ln for ln in rendered.splitlines() if ln.strip()][1:] == ["gitlab.com oauth2 glpat-1"]
|
|
285
285
|
assert next(t for t in _authorize_tasks() if t["name"] == "Provider tokens for git, gh and glab")["when"].count(
|
|
286
286
|
"rig_git_repo_tokens"
|
|
287
287
|
)
|
|
288
288
|
|
|
289
289
|
|
|
290
|
+
def test_token_files_are_never_empty_when_no_token_is_set():
|
|
291
|
+
# ansible-core 2.21 rejects `copy` with empty content; per-Repo PATs alone
|
|
292
|
+
# (no github_pat / gitlab_pat) used to render the provider env file empty.
|
|
293
|
+
import jinja2
|
|
294
|
+
|
|
295
|
+
block = _provider_block()
|
|
296
|
+
for prefix in ("Write the provider token file", "Write the per-repo token file"):
|
|
297
|
+
task = next(t for t in block if t["name"].startswith(prefix))
|
|
298
|
+
template = jinja2.Environment().from_string(task["copy"]["content"])
|
|
299
|
+
rendered = template.render(
|
|
300
|
+
lookup=lambda _kind, _name, default="": default,
|
|
301
|
+
_rig_gh_token="",
|
|
302
|
+
_rig_gl_token="",
|
|
303
|
+
rig_git_repo_tokens=[{"host": "gitlab.com", "user": "oauth2", "var": "p_git_pat"}],
|
|
304
|
+
)
|
|
305
|
+
assert rendered.strip() == "# managed by rig"
|
|
306
|
+
|
|
307
|
+
|
|
290
308
|
def test_git_repo_token_vars_lists_https_repos_with_their_own_password_var():
|
|
291
309
|
from cli.remote_dev import git_repo_token_vars
|
|
292
310
|
|
|
@@ -29,6 +29,9 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
|
|
|
29
29
|
# Import vpn module for type hints
|
|
30
30
|
import cli.vpn as vpn # type: ignore
|
|
31
31
|
|
|
32
|
+
# cax11 (the default) hits Hetzner placement errors in CI; cpx22 has capacity.
|
|
33
|
+
E2E_SERVER_TYPE = "cpx22"
|
|
34
|
+
|
|
32
35
|
|
|
33
36
|
def test_requires_credentials():
|
|
34
37
|
"""Check if credentials are available for E2E tests"""
|
|
@@ -93,6 +96,7 @@ class TestRealE2EVPTunnel:
|
|
|
93
96
|
env = RemoteDevEnvironment(
|
|
94
97
|
name=vpn_vm_name,
|
|
95
98
|
config={
|
|
99
|
+
"host": {"server_type": E2E_SERVER_TYPE},
|
|
96
100
|
"firewall": {
|
|
97
101
|
"extra_rules": [
|
|
98
102
|
{
|
|
@@ -191,7 +195,7 @@ class TestRealE2EVPTunnel:
|
|
|
191
195
|
inventory_file.write(inventory)
|
|
192
196
|
inventory_path = inventory_file.name
|
|
193
197
|
|
|
194
|
-
playbook_path = os.path.join(os.path.dirname(
|
|
198
|
+
playbook_path = os.path.join(os.path.dirname(__file__), "fixtures", "vpn-gateway.yml")
|
|
195
199
|
try:
|
|
196
200
|
result = subprocess.run(
|
|
197
201
|
[
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""run_remote must survive remote output that is not valid UTF-8 (e.g. a truncated agent log)."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
from cli.remote_dev import RemoteDevEnvironment
|
|
8
|
+
|
|
9
|
+
BAD = b"session id: 0b6f3c1e-1111-2222-3333-444455556666 \x9c tail"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@pytest.fixture
|
|
13
|
+
def env(monkeypatch):
|
|
14
|
+
env = RemoteDevEnvironment(name="demo")
|
|
15
|
+
# Stand in for ssh with a local process that prints the invalid byte.
|
|
16
|
+
monkeypatch.setattr(
|
|
17
|
+
env,
|
|
18
|
+
"_ssh_command",
|
|
19
|
+
lambda *a, **k: [sys.executable, "-c", f"import sys; sys.stdout.buffer.write({BAD!r})"],
|
|
20
|
+
)
|
|
21
|
+
return env
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_run_remote_replaces_undecodable_bytes(env):
|
|
25
|
+
result = env.run_remote("cat log")
|
|
26
|
+
assert result.returncode == 0
|
|
27
|
+
assert "�" in result.stdout
|
|
28
|
+
assert result.stdout.startswith("session id: 0b6f3c1e")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_recover_session_id_survives_undecodable_log(env, monkeypatch):
|
|
32
|
+
monkeypatch.setattr("cli.last_session.parse_session_id", lambda text: text.split()[2])
|
|
33
|
+
assert env.recover_session_id("claude") == "0b6f3c1e-1111-2222-3333-444455556666"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Tests for identity resolution and master-key data-key wraps."""
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
import shutil
|
|
4
5
|
import sys
|
|
5
6
|
|
|
6
7
|
import pytest
|
|
@@ -160,3 +161,88 @@ def test_write_filtered_vars_copy_drops_connection_vars(tmp_path):
|
|
|
160
161
|
only = tmp_path / "only.yml"
|
|
161
162
|
only.write_text("ansible_connection: ssh\n")
|
|
162
163
|
assert write_filtered_vars_copy(str(only), str(tmp_path / "o2.yml")) is None
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def _bootstrap(tmp_path, name, master):
|
|
167
|
+
project = tmp_path / name
|
|
168
|
+
project.mkdir()
|
|
169
|
+
(project / "rig.yml").write_text("kind: workspace\n")
|
|
170
|
+
answers = iter(["tester"])
|
|
171
|
+
secrets = iter([master, master])
|
|
172
|
+
bootstrap_identity_keys(
|
|
173
|
+
str(project),
|
|
174
|
+
input_fn=lambda _p: next(answers),
|
|
175
|
+
secret_fn=lambda _p: next(secrets),
|
|
176
|
+
config=RigConfig(path=str(tmp_path / "cfg")),
|
|
177
|
+
shared_data_key="shared-key",
|
|
178
|
+
)
|
|
179
|
+
return project
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def test_unlock_reunwraps_when_another_project_replaced_tmp_keys(tmp_path, monkeypatch):
|
|
183
|
+
"""/tmp/.rig is global: a rig init elsewhere must not poison this project."""
|
|
184
|
+
monkeypatch.setenv("RIG_CONFIG", str(tmp_path / "cfg"))
|
|
185
|
+
project_a = _bootstrap(tmp_path, "a", "master-a")
|
|
186
|
+
key_a = read_data_key_file(vault_keys.PERSONAL_DATA_KEY_PATH)
|
|
187
|
+
_bootstrap(tmp_path, "b", "master-b") # overwrites the cached keys
|
|
188
|
+
assert read_data_key_file(vault_keys.PERSONAL_DATA_KEY_PATH) != key_a
|
|
189
|
+
|
|
190
|
+
# Switching back restores project A's own copy: no master-key prompt.
|
|
191
|
+
def boom(_prompt):
|
|
192
|
+
raise AssertionError("master key should not be prompted")
|
|
193
|
+
|
|
194
|
+
unlock_data_keys(str(project_a), identity="tester", secret_fn=boom)
|
|
195
|
+
assert read_data_key_file(vault_keys.PERSONAL_DATA_KEY_PATH) == key_a
|
|
196
|
+
assert vault_keys.tmp_keys_match_project(str(project_a), "tester")
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def test_unlock_reunwraps_when_project_copy_is_gone(tmp_path, monkeypatch):
|
|
200
|
+
monkeypatch.setenv("RIG_CONFIG", str(tmp_path / "cfg"))
|
|
201
|
+
project_a = _bootstrap(tmp_path, "a", "master-a")
|
|
202
|
+
key_a = read_data_key_file(vault_keys.PERSONAL_DATA_KEY_PATH)
|
|
203
|
+
_bootstrap(tmp_path, "b", "master-b")
|
|
204
|
+
shutil.rmtree(os.path.join(vault_keys.TMP_RIG_DIR, "keys"))
|
|
205
|
+
|
|
206
|
+
with pytest.raises(ValueError, match="Incorrect master key"):
|
|
207
|
+
unlock_data_keys(str(project_a), identity="tester", master_key="wrong")
|
|
208
|
+
unlock_data_keys(str(project_a), identity="tester", master_key="master-a")
|
|
209
|
+
assert read_data_key_file(vault_keys.PERSONAL_DATA_KEY_PATH) == key_a
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def test_restore_project_keys_without_wraps(tmp_path):
|
|
213
|
+
assert vault_keys.restore_project_keys(str(tmp_path), "tester") is False
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def test_unlock_reprompts_for_cache_without_owner(tmp_path, monkeypatch):
|
|
217
|
+
monkeypatch.setenv("RIG_CONFIG", str(tmp_path / "cfg"))
|
|
218
|
+
project = _bootstrap(tmp_path, "a", "master-a")
|
|
219
|
+
os.unlink(os.path.join(vault_keys.TMP_RIG_DIR, ".key-owner"))
|
|
220
|
+
shutil.rmtree(os.path.join(vault_keys.TMP_RIG_DIR, "keys"))
|
|
221
|
+
with pytest.raises(ValueError, match="Incorrect master key"):
|
|
222
|
+
unlock_data_keys(str(project), identity="tester", master_key="wrong")
|
|
223
|
+
unlock_data_keys(str(project), identity="tester", master_key="master-a")
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def test_cache_without_wraps_is_accepted(tmp_path):
|
|
227
|
+
vault_keys.materialize_data_keys("k", "k")
|
|
228
|
+
project = tmp_path / "legacy"
|
|
229
|
+
project.mkdir()
|
|
230
|
+
assert vault_keys.tmp_keys_match_project(str(project), "tester")
|
|
231
|
+
assert vault_keys.cached_keys_belong_to_project(str(project), "tester")
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def test_ensure_data_key_ignores_keys_of_another_project(tmp_path, monkeypatch):
|
|
235
|
+
from cli.encrypt import ensure_data_key
|
|
236
|
+
|
|
237
|
+
monkeypatch.setenv("RIG_CONFIG", str(tmp_path / "cfg"))
|
|
238
|
+
monkeypatch.setenv("RIG_IDENTITY", "tester")
|
|
239
|
+
project_a = _bootstrap(tmp_path, "a", "master-a")
|
|
240
|
+
key_a = read_data_key_file(vault_keys.PERSONAL_DATA_KEY_PATH)
|
|
241
|
+
_bootstrap(tmp_path, "b", "master-b")
|
|
242
|
+
|
|
243
|
+
got = ensure_data_key(
|
|
244
|
+
vault_keys.PERSONAL_DATA_KEY_PATH,
|
|
245
|
+
secret_fn=lambda _p: "unused",
|
|
246
|
+
project_dir=str(project_a),
|
|
247
|
+
)
|
|
248
|
+
assert got == key_a
|
|
@@ -21,6 +21,9 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
|
|
|
21
21
|
from cli.remote_dev import AnsibleManager, ProjectConfig, RemoteDevEnvironment
|
|
22
22
|
|
|
23
23
|
# Test repository to clone: the rig repository itself
|
|
24
|
+
# cax11 (the default) hits Hetzner placement errors in CI; cpx22 has capacity.
|
|
25
|
+
E2E_SERVER_TYPE = "cpx22"
|
|
26
|
+
|
|
24
27
|
RIG_REPO = "https://github.com/mystack-cloud/rig.git"
|
|
25
28
|
RIG_REPO_NAME = "rig"
|
|
26
29
|
RIG_CLONE_DEST = "/workspace/rig"
|
|
@@ -144,7 +147,7 @@ class TestWorkspaceGitClone:
|
|
|
144
147
|
assert os.path.exists(os.path.join(project_config.rig_dir, "provision.yml"))
|
|
145
148
|
assert os.path.exists(os.path.join(project_config.rig_dir, "materialize.yml"))
|
|
146
149
|
|
|
147
|
-
env = RemoteDevEnvironment(name=unique_env_name)
|
|
150
|
+
env = RemoteDevEnvironment(name=unique_env_name, config={"host": {"server_type": E2E_SERVER_TYPE}})
|
|
148
151
|
env.name = unique_env_name
|
|
149
152
|
env.vm_name = unique_env_name
|
|
150
153
|
assert env.setup(), "Environment setup should succeed"
|
|
@@ -235,7 +238,7 @@ class TestGitAuthentication:
|
|
|
235
238
|
project_config = ProjectConfig(test_workspace_dir)
|
|
236
239
|
project_config.init(name=unique_env_name, ansible_enabled=True)
|
|
237
240
|
|
|
238
|
-
env = RemoteDevEnvironment(name=unique_env_name)
|
|
241
|
+
env = RemoteDevEnvironment(name=unique_env_name, config={"host": {"server_type": E2E_SERVER_TYPE}})
|
|
239
242
|
env.name = unique_env_name
|
|
240
243
|
env.vm_name = unique_env_name
|
|
241
244
|
assert env.setup()
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Ansible Playbooks
|
|
2
|
-
|
|
3
|
-
This directory contains Ansible playbooks for provisioning remote development environments.
|
|
4
|
-
|
|
5
|
-
## Available Playbooks
|
|
6
|
-
|
|
7
|
-
### WireGuard VPN Gateway
|
|
8
|
-
- **File**: `vpn-gateway.yml`
|
|
9
|
-
- **Purpose**: Provisions a remote VM with WireGuard as a VPN gateway
|
|
10
|
-
- **Usage**: Creates a VPN gateway that allows secure access to development services
|
|
11
|
-
|
|
12
|
-
## Structure
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
.rig/playbooks/
|
|
16
|
-
├── vpn-gateway.yml # WireGuard VPN gateway provisioning
|
|
17
|
-
└── README.md # This file
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## How It Works
|
|
21
|
-
|
|
22
|
-
The WireGuard VPN gateway playbook:
|
|
23
|
-
1. Installs WireGuard tools on the remote VM
|
|
24
|
-
2. Generates WireGuard key pair
|
|
25
|
-
3. Creates WireGuard interface configuration
|
|
26
|
-
4. Enables IP forwarding and masquerading
|
|
27
|
-
5. Starts the WireGuard service
|
|
28
|
-
|
|
29
|
-
## Configuration
|
|
30
|
-
|
|
31
|
-
The playbook uses the following variables (can be overridden):
|
|
32
|
-
- `vpn_gateway_ip`: VPN gateway IP address (default: 10.0.0.1/24)
|
|
33
|
-
- `vpn_gateway_port`: WireGuard listen port (default: 51820)
|
|
34
|
-
- `wg_interface_name`: WireGuard interface name (default: wg0)
|
|
35
|
-
|
|
36
|
-
## Usage
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
ansible-playbook .rig/playbooks/vpn-gateway.yml -i <inventory> --private-key ~/.ssh/id_rsa
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## See Also
|
|
43
|
-
|
|
44
|
-
- [VPN CLI Commands](../src/cli/vpn.py) - Management commands for VPN tunnels
|
|
45
|
-
- [VPN E2E Tests](../tests/test_real_e2e_vpn_tunnel.py) - End-to-end VPN tunnel verification
|
|
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.10.0 → mystack_rig-1.10.2}/docs/adr/0001-per-profile-generated-state-bucket.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/docs/adr/0004-agents-run-as-live-agents-in-tmux.md
RENAMED
|
File without changes
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/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
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_home_ownership/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_home_ownership/tasks/authorize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/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.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_repos/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_repos/tasks/materialize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_user/defaults/main.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/src/cli/roles/rig_workspace_user/tasks/authorize.yml
RENAMED
|
File without changes
|
{mystack_rig-1.10.0 → mystack_rig-1.10.2}/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
|