Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dropkit/_version.txt

# Git worktrees
.worktrees/
.claude/worktrees

# Claude Code local settings
.claude/settings.local.json
21 changes: 18 additions & 3 deletions dropkit/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3914,6 +3914,9 @@ def wake(
..., autocompletion=complete_snapshot_name, help="Name of the hibernated droplet to restore"
),
no_tailscale: bool = typer.Option(False, "--no-tailscale", help="Skip Tailscale VPN re-setup"),
region: str | None = typer.Option(
None, "--region", "-r", help="Region slug (default: snapshot's original region)"
),
):
"""
Wake a hibernated droplet (restore from snapshot).
Expand Down Expand Up @@ -3979,8 +3982,17 @@ def wake(
elif tag == "tailscale-lockdown":
was_tailscale_locked = True

if not original_region:
# Determine region: explicit flag > snapshot metadata > error
if region:
restore_region = region
elif original_region:
restore_region = original_region
else:
console.print("[red]Error: Could not determine original region from snapshot[/red]")
console.print(
f"[dim]Specify a region explicitly: "
f"[cyan]dropkit wake {droplet_name} --region <slug>[/cyan][/dim]"
)
raise typer.Exit(1)

if not original_size:
Expand All @@ -3992,9 +4004,12 @@ def wake(

# Display snapshot info
console.print(f"Found hibernated snapshot: [cyan]{snapshot_name}[/cyan] ({size_gb} GB)")
original_display = original_region or "[yellow]unknown[/yellow]"
console.print(
f"Original config: [cyan]{original_region}[/cyan], [cyan]{original_size}[/cyan]"
f"Original config: [cyan]{original_display}[/cyan], [cyan]{original_size}[/cyan]"
)
if region and region != original_region:
console.print(f"Region override: [cyan]{region}[/cyan]")
console.print()

# Create droplet from snapshot
Expand All @@ -4005,7 +4020,7 @@ def wake(

droplet = api.create_droplet_from_snapshot(
name=droplet_name,
region=original_region,
region=restore_region,
size=original_size,
snapshot_id=snapshot_id,
tags=tags_list,
Expand Down