devs-common 2.0.5__tar.gz → 2.0.6__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.
Files changed (41) hide show
  1. {devs_common-2.0.5 → devs_common-2.0.6}/PKG-INFO +1 -1
  2. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/core/container.py +60 -1
  3. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/Dockerfile +1 -0
  4. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/devcontainer.json +2 -1
  5. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common.egg-info/PKG-INFO +1 -1
  6. {devs_common-2.0.5 → devs_common-2.0.6}/pyproject.toml +1 -1
  7. {devs_common-2.0.5 → devs_common-2.0.6}/LICENSE +0 -0
  8. {devs_common-2.0.5 → devs_common-2.0.6}/README.md +0 -0
  9. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/__init__.py +0 -0
  10. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/config.py +0 -0
  11. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/core/__init__.py +0 -0
  12. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/core/project.py +0 -0
  13. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/core/workspace.py +0 -0
  14. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/devs_config.py +0 -0
  15. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/exceptions.py +0 -0
  16. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/scripts/copy-ssh.sh +0 -0
  17. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/scripts/post-create-wrapper.sh +0 -0
  18. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/scripts/python-venv-integration.sh +0 -0
  19. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/scripts/screenshot-webapp.sh +0 -0
  20. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/scripts/setup-workspace.sh +0 -0
  21. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/scripts/start-tunnel.sh +0 -0
  22. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/scripts/tunnel-status.sh +0 -0
  23. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/scripts/webapp-screenshot.py +0 -0
  24. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/sudo-scripts/init-firewall.sh +0 -0
  25. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/sudo-scripts/setup-devs-env.sh +0 -0
  26. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/sudo-scripts/setup-vscode-cache.sh +0 -0
  27. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/sudo-scripts/start-services.sh +0 -0
  28. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/templates/vscode-settings-reference.md +0 -0
  29. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/utils/__init__.py +0 -0
  30. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/utils/config_hash.py +0 -0
  31. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/utils/console.py +0 -0
  32. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/utils/devcontainer.py +0 -0
  33. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/utils/devcontainer_template.py +0 -0
  34. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/utils/docker_client.py +0 -0
  35. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/utils/file_utils.py +0 -0
  36. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common/utils/git_utils.py +0 -0
  37. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common.egg-info/SOURCES.txt +0 -0
  38. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common.egg-info/dependency_links.txt +0 -0
  39. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common.egg-info/requires.txt +0 -0
  40. {devs_common-2.0.5 → devs_common-2.0.6}/devs_common.egg-info/top_level.txt +0 -0
  41. {devs_common-2.0.5 → devs_common-2.0.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devs-common
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Summary: Shared utilities for devs package ecosystem
5
5
  Author: Dan Lester
6
6
  License-Expression: MIT
@@ -841,6 +841,65 @@ class ContainerManager:
841
841
 
842
842
  return tunnel_name
843
843
 
844
+ def tunnel_auth(self, dev_name: str, workspace_dir: Path, debug: bool = False, live: bool = False, extra_env: Optional[Dict[str, str]] = None) -> None:
845
+ """Authenticate VS Code tunnel (interactive, one-time setup).
846
+
847
+ Runs the device code flow interactively inside the container. Auth is
848
+ stored in a bind-mounted directory (~/.devs/vscode-cli/) so it persists
849
+ across container recreations and is shared across all containers.
850
+
851
+ Args:
852
+ dev_name: Development environment name
853
+ workspace_dir: Workspace directory path
854
+ debug: Show debug output for devcontainer operations
855
+ live: Whether the container is in live mode
856
+ extra_env: Additional environment variables to pass to container
857
+
858
+ Raises:
859
+ ContainerError: If authentication fails
860
+ """
861
+ try:
862
+ container_name, container_workspace_dir = self._prepare_container_exec(
863
+ dev_name, workspace_dir, debug=debug, live=live, extra_env=extra_env
864
+ )
865
+
866
+ tunnel_name = self._get_tunnel_name(dev_name)
867
+
868
+ console.print("🔐 Setting up VS Code tunnel authentication...")
869
+ console.print(f" Container: {container_name}")
870
+ console.print("")
871
+ console.print("[yellow]Follow the prompts to authenticate:[/yellow]")
872
+ console.print(" 1. A URL and code will be displayed")
873
+ console.print(" 2. Open the URL in your browser")
874
+ console.print(" 3. Enter the code to authenticate with GitHub/Microsoft")
875
+ console.print("")
876
+
877
+ cmd = [
878
+ 'docker', 'exec', '-it',
879
+ container_name,
880
+ '/usr/local/bin/code', 'tunnel', 'user', 'login',
881
+ '--provider', 'github'
882
+ ]
883
+
884
+ if debug:
885
+ console.print(f"[dim]Running: {' '.join(cmd)}[/dim]")
886
+
887
+ result = subprocess.run(cmd, check=False)
888
+
889
+ if result.returncode == 0:
890
+ console.print("")
891
+ console.print("[bold green]Authentication successful![/bold green]")
892
+ console.print(" Auth is shared across all containers on this machine.")
893
+ console.print("")
894
+ console.print(f" Start a tunnel: devs tunnel {dev_name}")
895
+ console.print(f" Then connect: code --remote tunnel+{tunnel_name} {container_workspace_dir}")
896
+ else:
897
+ console.print("")
898
+ console.print("[yellow]Authentication was cancelled or failed.[/yellow]")
899
+
900
+ except (DockerError, subprocess.SubprocessError) as e:
901
+ raise ContainerError(f"Failed to authenticate tunnel in {dev_name}: {e}")
902
+
844
903
  def start_tunnel(self, dev_name: str, workspace_dir: Path, debug: bool = False, live: bool = False, extra_env: Optional[Dict[str, str]] = None) -> None:
845
904
  """Start a VS Code tunnel in the background.
846
905
 
@@ -877,7 +936,7 @@ class ContainerManager:
877
936
  'docker', 'exec', '-d',
878
937
  container_name,
879
938
  '/bin/sh', '-c',
880
- f'{tunnel_cmd} > {log_file} 2>&1'
939
+ f'VSCODE_CLI_DATA_DIR=/home/node/.vscode/cli {tunnel_cmd} > {log_file} 2>&1'
881
940
  ]
882
941
 
883
942
  if debug:
@@ -139,6 +139,7 @@ RUN ARCH=$(dpkg --print-architecture) && \
139
139
  RUN for shell_rc in /home/node/.zshrc /home/node/.bashrc; do \
140
140
  echo "export CLAUDE_CONFIG_DIR=\"/home/node/claudeconfig\"" >> "$shell_rc" && \
141
141
  echo "export CODEX_CONFIG_HOME=\"/home/node/codexconfig\"" >> "$shell_rc" && \
142
+ echo "export VSCODE_CLI_DATA_DIR=\"/home/node/.vscode/cli\"" >> "$shell_rc" && \
142
143
  echo "alias claude=\"/usr/local/share/npm-global/bin/claude --dangerously-skip-permissions\"" >> "$shell_rc" && \
143
144
  echo "alias codex=\"/usr/local/share/npm-global/bin/codex --full-auto\"" >> "$shell_rc" && \
144
145
  echo "" >> "$shell_rc" && \
@@ -96,7 +96,8 @@
96
96
  "DEVS_DEBUG": "${localEnv:DEVS_DEBUG}",
97
97
  "DEVS_LIVE_MODE": "${localEnv:DEVS_LIVE_MODE}",
98
98
  "DEVS_ENV_MOUNT_PATH": "${localEnv:DEVS_ENV_MOUNT_PATH}",
99
- "DEVS_BRIDGE_MOUNT_PATH": "${localEnv:DEVS_BRIDGE_MOUNT_PATH}"
99
+ "DEVS_BRIDGE_MOUNT_PATH": "${localEnv:DEVS_BRIDGE_MOUNT_PATH}",
100
+ "VSCODE_CLI_DATA_DIR": "/home/node/.vscode/cli"
100
101
  },
101
102
  "workspaceFolder": "/workspaces/${localEnv:WORKSPACE_FOLDER_NAME}",
102
103
  "postCreateCommand": "/usr/local/bin/post-create-wrapper.sh",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devs-common
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Summary: Shared utilities for devs package ecosystem
5
5
  Author: Dan Lester
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devs-common"
7
- version = "2.0.5"
7
+ version = "2.0.6"
8
8
  description = "Shared utilities for devs package ecosystem"
9
9
  authors = [
10
10
  {name = "Dan Lester"},
File without changes
File without changes
File without changes