config

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config loads and validates service configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppName string
	Stage   string

	StateTableName string

	// PublicBaseURL is the externally reachable origin (scheme + host) for this deployment,
	// used when generating absolute URLs in API responses. If empty, handlers should prefer
	// relative URLs or derive a best-effort base from request headers.
	PublicBaseURL string

	// SoulEmailInboundDomain is the SES-backed bridge domain that receives inbound mail
	// for soul email channels before it is normalized into comm-worker notifications.
	SoulEmailInboundDomain string

	// InboundEmailBucketName stores raw SES-received messages for the email ingress Lambda.
	InboundEmailBucketName string

	// InboundEmailS3Prefix is the prefix under InboundEmailBucketName where SES stores raw mail.
	InboundEmailS3Prefix string

	// SoulCommMailboxBucketName stores bounded canonical mailbox content for soul comm deliveries.
	SoulCommMailboxBucketName string

	// SoulCommMailboxRetentionDays is the content/object lifecycle window for mailbox bodies.
	SoulCommMailboxRetentionDays int64

	// CommWebhookSharedSecretSSMParam stores the HMAC shared secret for
	// first-party comm webhook adapters that cannot use provider-native
	// signatures.
	CommWebhookSharedSecretSSMParam string

	// TelnyxWebhookPublicKey is Telnyx's Ed25519 webhook verification public
	// key. It is public key material, not a secret; deployments may also store it
	// in the `/lesser-host/telnyx` JSON parameter as `webhook_public_key`.
	TelnyxWebhookPublicKey string

	// ENS gateway (CCIP-Read) configuration.
	ENSGatewayResolverAddress     string
	ENSGatewaySigningKeyID        string
	ENSGatewaySigningPrivateKey   string
	ENSGatewaySignatureTTLSeconds int64

	ArtifactBucketName string
	PreviewQueueURL    string
	SafetyQueueURL     string
	ProvisionQueueURL  string
	CommQueueURL       string

	BootstrapWalletAddress string

	AttestationSigningKeyID string
	AttestationPublicKeyIDs []string

	WebAuthnRPID    string
	WebAuthnOrigins []string

	// Tip registry (EVM).
	TipEnabled                  bool
	TipChainID                  int64
	TipRPCURL                   string
	TipRPCURLSSMParam           string
	TipContractAddress          string
	TipAdminSafeAddress         string
	TipDefaultHostWalletAddress string
	TipDefaultHostFeeBps        uint16
	TipTxMode                   string // safe|direct

	// Soul registry (EVM).
	SoulEnabled                              bool
	SoulChainID                              int64
	SoulRPCURL                               string
	SoulRPCURLSSMParam                       string
	SoulRegistryContractAddress              string
	SoulReputationAttestationContractAddress string
	SoulValidationAttestationContractAddress string
	SoulAdminSafeAddress                     string
	SoulTxMode                               string // safe|direct
	SoulSupportedCapabilities                []string
	SoulPackBucketName                       string
	SoulPackBucketNameSSMParam               string // optional override; default is /soul/<stage>/packBucketName
	SoulMintSignerKeySSMParam                string
	SoulMintSignerKey                        string
	SoulPublicCORSOrigins                    []string
	SoulPublicOnChainAvatarEnabled           bool // opt-in public tokenURI enrichment; default off to avoid EVM fanout on reads
	SoulV2StrictIntegrity                    bool // harden signature + artifact integrity checks

	// Soul reputation (v0).
	SoulReputationTipStartBlock       uint64
	SoulReputationTipBlockChunkSize   uint64
	SoulReputationTipScale            float64
	SoulReputationWeightEconomic      float64
	SoulReputationWeightSocial        float64
	SoulReputationWeightValidation    float64
	SoulReputationWeightTrust         float64
	SoulReputationWeightIntegrity     float64
	SoulReputationWeightCommunication float64

	// Soul validation (v0).
	SoulValidationDecayEpochHours int64
	SoulValidationDecayRate       float64

	// Managed hosting (M9 provisioning).
	ManagedProvisioningEnabled        bool
	ManagedOrgVendingRoleARN          string // optional; assume this role for Organizations + instance-account role assumptions
	ManagedParentDomain               string // e.g. greater.website
	ManagedParentHostedZoneID         string // Route53 hosted zone id for greater.website (central account)
	ManagedInstanceRoleName           string // role to assume into instance accounts
	ManagedTargetOrganizationalUnitID string // optional OU id for instance accounts
	ManagedAccountEmailTemplate       string // e.g. "lesser+{slug}@example.com"
	ManagedAccountNamePrefix          string // e.g. "lesser-"
	ManagedDefaultRegion              string // e.g. us-east-1
	ManagedLesserDefaultVersion       string // release tag or "latest", optional
	ManagedProvisionRunnerProjectName string // CodeBuild project name used to run lesser up
	ManagedProvisionRunnerRoleARN     string // CodeBuild service role allowed in per-instance assume-role trust
	ManagedLesserGitHubOwner          string // GitHub org/user for the lesser repo
	ManagedLesserGitHubRepo           string // GitHub repo name for lesser
	ManagedLesserGitHubTokenSSMParam  string // optional SSM param name for a GitHub token (CodeBuild)
	ManagedLesserBodyDefaultVersion   string // release tag or "latest", optional
	ManagedLesserBodyGitHubOwner      string // GitHub org/user for the lesser-body repo
	ManagedLesserBodyGitHubRepo       string // GitHub repo name for lesser-body

	// ManagedProvisionConsentEncryptionKeyHex is a hex-encoded 32-byte
	// AES-256 key used to encrypt provisioning consent payloads at rest
	// in the DynamoDB ProvisionJob record (CSR-017).
	ManagedProvisionConsentEncryptionKeyHex string

	// Payments (M10).
	PaymentsProvider            string // stripe|mock|none
	PaymentsCheckoutSuccessURL  string // redirect target after checkout completion
	PaymentsCheckoutCancelURL   string // redirect target after checkout cancel
	PaymentsCentsPer1000Credits int64  // pricing policy: cents per 1000 credits
}

Config holds runtime configuration loaded from environment variables.

func Load

func Load() Config

Load reads environment variables and returns a Config with defaults applied.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL