Anonymous
9/10/2025, 7:57:26 AM
No.106543254
>>106542848
keep mistyping, sorry. If you're doing >>106542848, it'll work, but you should consider managing lifecycles w/ Terraform/Opentofu, those scripts lack idempotent creates so if you run create.sh twice you'll being paying for orphaned infra; tf is good for avoiding this. too lazy to clean up mine but dumping from chatgpt It'll look a bit like
# main.tf
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.0"
}
}
}
provider "digitalocean" {
token = var.do_token
}
variable "do_token" {
description = "DigitalOcean API token (can come from env DIGITALOCEAN_TOKEN)"
type = string
sensitive = true
default = null
}
variable "name" {
description = "Droplet name"
type = string
default = "NAME"
}
variable "ssh_key_id" {
description = "DigitalOcean SSH key ID or fingerprint (matches your KEYID)"
type = string
}
variable "keyfile" {
description = "Path to your private key used for SSH -i"
type = string
default = "~/.ssh/id_ed25519"
}
variable "socks5_port" {
description = "Local SOCKS5 port for ssh -D"
type = number
default = 1080
}
resource "digitalocean_droplet" "box" {
name = var.name
region = "sfo3"
size = "s-1vcpu-512mb-10gb"
image = "debian-12-x64"
# Accepts IDs or fingerprints
ssh_keys = [var.ssh_key_id]
}
output "ipv4" {
value = digitalocean_droplet.box.ipv4_address
description = "Droplet IPv4 address"
}
output "ssh_socks5_command" {
description = "Copy-paste to connect with a SOCKS5 proxy"
value = "ssh -i ${var.keyfile} -D ${var.socks5_port} root@${digitalocean_droplet.box.ipv4_address}"
}
You'd throw export DIGITALOCEAN_TOKEN=YOUR_TOKEN into your env vars, then use
>terraform init && terraform apply -auto-approve
to set up,
>terraform output -raw ssh_socks5_command
then paste to connect, and
>terraform destroy -auto-approve
would clean up.
keep mistyping, sorry. If you're doing >>106542848, it'll work, but you should consider managing lifecycles w/ Terraform/Opentofu, those scripts lack idempotent creates so if you run create.sh twice you'll being paying for orphaned infra; tf is good for avoiding this. too lazy to clean up mine but dumping from chatgpt It'll look a bit like
# main.tf
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.0"
}
}
}
provider "digitalocean" {
token = var.do_token
}
variable "do_token" {
description = "DigitalOcean API token (can come from env DIGITALOCEAN_TOKEN)"
type = string
sensitive = true
default = null
}
variable "name" {
description = "Droplet name"
type = string
default = "NAME"
}
variable "ssh_key_id" {
description = "DigitalOcean SSH key ID or fingerprint (matches your KEYID)"
type = string
}
variable "keyfile" {
description = "Path to your private key used for SSH -i"
type = string
default = "~/.ssh/id_ed25519"
}
variable "socks5_port" {
description = "Local SOCKS5 port for ssh -D"
type = number
default = 1080
}
resource "digitalocean_droplet" "box" {
name = var.name
region = "sfo3"
size = "s-1vcpu-512mb-10gb"
image = "debian-12-x64"
# Accepts IDs or fingerprints
ssh_keys = [var.ssh_key_id]
}
output "ipv4" {
value = digitalocean_droplet.box.ipv4_address
description = "Droplet IPv4 address"
}
output "ssh_socks5_command" {
description = "Copy-paste to connect with a SOCKS5 proxy"
value = "ssh -i ${var.keyfile} -D ${var.socks5_port} root@${digitalocean_droplet.box.ipv4_address}"
}
You'd throw export DIGITALOCEAN_TOKEN=YOUR_TOKEN into your env vars, then use
>terraform init && terraform apply -auto-approve
to set up,
>terraform output -raw ssh_socks5_command
then paste to connect, and
>terraform destroy -auto-approve
would clean up.