49 lines
No EOL
1.4 KiB
HCL
49 lines
No EOL
1.4 KiB
HCL
terraform {
|
|
required_providers {
|
|
tor = {
|
|
source = "guardianproject/tor"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "tor" {}
|
|
|
|
# Example: Generate obfs4 state using existing identity keys
|
|
resource "tor_relay_identity_rsa" "bridge" {}
|
|
|
|
resource "tor_relay_identity_ed25519" "bridge" {}
|
|
|
|
resource "tor_obfs4_state" "example" {
|
|
rsa_identity_private_key = tor_relay_identity_rsa.bridge.private_key_pem
|
|
ed25519_identity_private_key = tor_relay_identity_ed25519.bridge.private_key_pem
|
|
}
|
|
|
|
output "certificate" {
|
|
description = "obfs4 certificate for bridge line generation"
|
|
value = tor_obfs4_state.example.certificate
|
|
}
|
|
|
|
output "iat_mode" {
|
|
description = "obfs4 IAT mode setting"
|
|
value = tor_obfs4_state.example.iat_mode
|
|
}
|
|
|
|
output "state_json" {
|
|
description = "Complete obfs4 state in JSON format"
|
|
value = tor_obfs4_state.example.state_json
|
|
sensitive = true
|
|
}
|
|
|
|
# Example: Generate complete bridge line using all components
|
|
data "tor_obfs4_bridge_line" "example" {
|
|
ip_address = "203.0.113.1"
|
|
port = 9001
|
|
identity_fingerprint_sha1 = tor_relay_identity_rsa.bridge.public_key_fingerprint_sha1
|
|
obfs4_state_certificate = tor_obfs4_state.example.certificate
|
|
obfs4_state_iat_mode = tor_obfs4_state.example.iat_mode
|
|
}
|
|
|
|
output "bridge_line" {
|
|
description = "Complete bridge line for clients"
|
|
value = data.tor_obfs4_bridge_line.example.bridge_line
|
|
} |