Complete examples
This commit is contained in:
parent
9fe172e8f2
commit
7724c245d5
10 changed files with 263 additions and 6 deletions
51
examples/resources/tor_obfs4_state/resource.tf
Normal file
51
examples/resources/tor_obfs4_state/resource.tf
Normal file
|
@ -0,0 +1,51 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
tor = {
|
||||
source = "guardianproject/tor"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "tor" {}
|
||||
|
||||
# Example: Generate obfs4 state using existing identity keys
|
||||
resource "tor_relay_identity_rsa" "bridge" {
|
||||
key_size = 2048
|
||||
}
|
||||
|
||||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue