This commit is contained in:
parent
ec57a47ba2
commit
ba5761e973
3 changed files with 28 additions and 11 deletions
|
@ -4,12 +4,18 @@ page_title: "tor_family_identity Resource - tor"
|
||||||
subcategory: ""
|
subcategory: ""
|
||||||
description: |-
|
description: |-
|
||||||
Generates a Tor family identity key as described in proposal 321 (Happy Families).
|
Generates a Tor family identity key as described in proposal 321 (Happy Families).
|
||||||
|
References
|
||||||
|
https://community.torproject.org/relay/setup/post-install/family-ids/https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/proposals/321-happy-families.md
|
||||||
---
|
---
|
||||||
|
|
||||||
# tor_family_identity (Resource)
|
# tor_family_identity (Resource)
|
||||||
|
|
||||||
Generates a Tor family identity key as described in proposal 321 (Happy Families).
|
Generates a Tor family identity key as described in proposal 321 (Happy Families).
|
||||||
|
|
||||||
|
### References
|
||||||
|
- https://community.torproject.org/relay/setup/post-install/family-ids/
|
||||||
|
- https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/proposals/321-happy-families.md
|
||||||
|
|
||||||
## Example Usage
|
## Example Usage
|
||||||
|
|
||||||
```terraform
|
```terraform
|
||||||
|
@ -17,16 +23,19 @@ resource "tor_family_identity" "example" {
|
||||||
family_name = "MyFamily"
|
family_name = "MyFamily"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Access the generated family identity
|
|
||||||
output "family_id" {
|
|
||||||
value = tor_family_identity.example.id
|
|
||||||
}
|
|
||||||
|
|
||||||
# Use the secret key to configure your Tor relay
|
|
||||||
resource "local_sensitive_file" "family_key" {
|
resource "local_sensitive_file" "family_key" {
|
||||||
content_base64 = tor_family_identity.example.secret_key
|
content_base64 = tor_family_identity.example.secret_key
|
||||||
filename = "MyFamily.secret_family_key"
|
filename = "MyFamily.secret_family_key"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "local_file" "torrc" {
|
||||||
|
filename = "./torrc"
|
||||||
|
content = <<EOF
|
||||||
|
FamilyId ${tor_family_identity.example.id}
|
||||||
|
... other torrc configuration ...
|
||||||
|
EOF
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- schema generated by tfplugindocs -->
|
<!-- schema generated by tfplugindocs -->
|
||||||
|
|
|
@ -2,13 +2,16 @@ resource "tor_family_identity" "example" {
|
||||||
family_name = "MyFamily"
|
family_name = "MyFamily"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Access the generated family identity
|
|
||||||
output "family_id" {
|
|
||||||
value = tor_family_identity.example.id
|
|
||||||
}
|
|
||||||
|
|
||||||
# Use the secret key to configure your Tor relay
|
|
||||||
resource "local_sensitive_file" "family_key" {
|
resource "local_sensitive_file" "family_key" {
|
||||||
content_base64 = tor_family_identity.example.secret_key
|
content_base64 = tor_family_identity.example.secret_key
|
||||||
filename = "MyFamily.secret_family_key"
|
filename = "MyFamily.secret_family_key"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "local_file" "torrc" {
|
||||||
|
filename = "./torrc"
|
||||||
|
content = <<EOF
|
||||||
|
FamilyId ${tor_family_identity.example.id}
|
||||||
|
... other torrc configuration ...
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
|
@ -39,7 +39,12 @@ func (r *TorFamilyIdentityResource) Metadata(ctx context.Context, req resource.M
|
||||||
|
|
||||||
func (r *TorFamilyIdentityResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
|
func (r *TorFamilyIdentityResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
|
||||||
resp.Schema = schema.Schema{
|
resp.Schema = schema.Schema{
|
||||||
MarkdownDescription: "Generates a Tor family identity key as described in proposal 321 (Happy Families).",
|
MarkdownDescription: `Generates a Tor family identity key as described in proposal 321 (Happy Families).
|
||||||
|
|
||||||
|
### References
|
||||||
|
- https://community.torproject.org/relay/setup/post-install/family-ids/
|
||||||
|
- https://gitlab.torproject.org/tpo/core/torspec/-/blob/main/proposals/321-happy-families.md
|
||||||
|
`,
|
||||||
|
|
||||||
Attributes: map[string]schema.Attribute{
|
Attributes: map[string]schema.Attribute{
|
||||||
"id": schema.StringAttribute{
|
"id": schema.StringAttribute{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue