terraform-provider-tor/CONTRIBUTING.md

2.3 KiB

Contributing to terraform-provider-tor

Thank you for your interest in contributing to the terraform-provider-tor project! This document provides guidelines for contributing to this Terraform/OpenTofu provider that manages Tor bridge infrastructure.

Development Setup

Prerequisites

  • Go >= 1.23
  • Terraform >= 1.0 or OpenTofu
  • Git

Building the Provider

git clone https://github.com/guardianproject/terraform-provider-tor
cd terraform-provider-tor
make build

Development Commands

# Build and install
go install

# Add dependencies
go get <package>
go mod tidy

# Generate documentation
make generate

# Run linter
make lint

# Run acceptance tests (creates real resources)
make testacc

# Run e2e tests
make clean build e2e/tor-family  # Run the tor-family test with latest binary
make clean build e2e/obfs4       # Run the obfs4 e2e test with latest binary
make e2e                         # Run all e2e tests

# Important: Always use 'make clean build' before e2e tests to ensure
# the test uses the latest provider binary

Project Structure

├── internal/provider/     # Resources and data sources
├── examples/             # Usage examples
│   ├── data-sources/     # Data source examples
│   ├── provider/         # Provider configuration examples
│   └── resources/        # Resource examples
├── docs/                 # Generated documentation
├── e2e-tests/            # End-to-end tests

Security Considerations

This provider handles cryptographic keys and sensitive data:

  • Never log or expose private keys in plaintext
  • Follow security best practices for key generation
  • Be mindful of state file security in examples and documentation
  • Report security issues responsibly

Resources

License

This project is licensed under GPL-3.0-or-later. By contributing, you agree to license your contributions under the same license.

Getting Help

  • Open an issue for bugs or feature requests
  • Check existing issues and documentation first
  • Be respectful and constructive in all interactions