Environment Variables¶
This page lists runtime variables used by the current Flask app, local services, mailer, and lambda-resize code. The Makefile supplies the local defaults for normal development and testing.
Required¶
DYNAMODB_TABLE_PREFIXPrefix added to every DynamoDB table name. Local defaults use
demo-.PLANTTRACER_S3_BUCKETExisting S3 bucket name. Do not include
s3://. For local MinIO the Makefile usesplanttracer-local.
AWS And Local Service Selection¶
The Makefile has two storage modes. With AWS_REGION unset or set to
local, Makefile targets use DynamoDB Local and MinIO. With AWS_REGION
set to a real AWS region, remote debug targets use AWS DynamoDB and S3 and
unset local endpoint overrides.
AWS_REGIONAWS region. Use
localfor DynamoDB Local and MinIO.AWS_DEFAULT_REGIONOptional AWS SDK default region. Local Make targets set this to
local.AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYAWS credentials. Local MinIO uses
minioadmin/minioadmin.AWS_ENDPOINT_URL_DYNAMODBDynamoDB endpoint override. Local default:
http://localhost:8000/. Do not set this for remote AWS mode.AWS_ENDPOINT_URL_S3S3 endpoint override. Local default:
http://localhost:9000/. Do not set this for remote AWS mode.AWS_ENDPOINT_URL_SQSOptional SQS endpoint override for lambda-resize if testing against an SQS emulator.
AWS_PROFILEOptional AWS profile for deployed or administrative commands.
Application URLs¶
PLANTTRACER_API_BASEOptional Flask API base injected into browser pages as
API_BASE. Empty means same-origin. If set, include a complete origin/base path; the runtime normalizes a missing trailing slash.PLANTTRACER_STATIC_BASEReserved for a future versioned-asset plan. Static assets are currently served same-origin by Flask/
lambda-webunder/static/*.PLANTTRACER_LAMBDA_API_BASEExplicit lambda-resize HTTP API base injected as
LAMBDA_API_BASE. Local debug targets set this tohttp://127.0.0.1:9811/when the local lambda debug bridge is running. Set it to an explicit empty value to run Flask-only browser tests without probing a resize service. The Lambda-only stack sets this to the same public application origin.HOSTNAME/DOMAINIf
PLANTTRACER_LAMBDA_API_BASEis absent, Flask deriveshttps://{HOSTNAME}.{DOMAIN}/. If those are also absent, Flask uses the current request origin.
Lambda Stack Diagnostics¶
PLANTTRACER_STACK_NAMECloudFormation stack name for a deployed Lambda-only stack. The SAM template passes this to both Lambda functions. It is also the storage deployment identifier in
uploads/{stack}/andmovies/{stack}/keys and the exact prefix matched by that stack’s upload EventBridge rule. Local mode defaults tolocal.PLANTTRACER_BASE_DOMAINBase domain used to create the stack hostname, such as
planttracer.com. The SAM template passes this to both Lambda functions for deployed-stack diagnostics.PLANTTRACER_HOSTED_ZONE_IDRoute53 hosted zone id used by the stack domain mapping. The SAM template passes this to both Lambda functions for deployed-stack diagnostics.
/ver and /api/ver report the configured DYNAMODB_TABLE_PREFIX;
/api/ver and /resize-api/v1/ping also report stack_name. The
/resize-api/v1/ping endpoint also reports a stack_parameters object
with selected CloudFormation parameter values: HostedZoneId, BaseDomain,
ImageBucketName, LogLevel, MailerDryRun, and
DynamoDBTablePrefix. It intentionally does not report
WildcardCertificateArn.
Demo Mode¶
DEMO_MODEEnables demo mode when present.
DEMO_COURSE_IDIdentifies the course containing demo data. This does not enable demo mode by itself.
Mail¶
SERVER_EMAILServer sender address for outgoing mail. Defaults to
admin@planttracer.com. In the Lambda-only stack this is set by the stack and the Lambda role is scoped to that SES sender. The exact address must be verified in AWS SES in the deployment region. This is not the course administrator email; see Identity Management.SERVER_EMAIL_NAMEDisplay name used with
SERVER_EMAILin the MIMEFromheader. Defaults toPlant Tracer. The Lambda-only stack sets this value and passes it tolambda-web.PLANTTRACER_CREDENTIALSPath to an INI file with
[smtp]and optional[imap]sections. Used for local or legacy VM-style SMTP configuration, not by the Lambda-only SAM stack.SMTPCONFIG_JSONJSON SMTP configuration. Local Make targets set this for Mailpit.
SMTPCONFIG_ARNAWS Secrets Manager ARN containing SMTP configuration. The mailer supports this explicit override, but the Lambda-only SAM stack does not set it and does not grant Secrets Manager access by default. Lambda production mail uses SES IAM permissions instead of committed or environment-injected SMTP secrets.
MAILER_DRY_RUNSet to
trueto log email content instead of sending it. The Lambda-only stack exposes this as theMailerDryRunSAM parameter for non-production stacks whose operators cannot send SES mail asSERVER_EMAIL. Dry-run mail includes login links and API keys in Lambda logs, so use it only with test users and test data.
Lambda Queue¶
TRACING_QUEUE_MODESet to
localto use the in-process local retrace queue.TRACING_QUEUE_URLSQS queue URL used by deployed lambda-resize tracing.
Development And Diagnostics¶
LOG_LEVELLogging level. Local Make targets default to
INFO; setLOG_LEVEL=DEBUGfor an explicitly requested diagnostic run.FFMPEG_PATHOptional path used by legacy/local tooling.
COLLECT_JS_COVERAGEWhen true, Flask serves instrumented static files from
static-instrumentedif present.DISABLE_PROXYFIXWhen true, disables Flask
ProxyFixhandling for forwarded headers.AWS_EC2_METADATA_DISABLEDLocal Make targets set this to
trueto avoid AWS metadata lookups.
Local Makefile Defaults¶
The primary local environment is defined by LOCAL_AWS_ENV and
LOCAL_FLASK_ENV in the root Makefile. Prefer these targets over hand-built
commands:
make start-local-services
make make-local-demo
make run-local-debug
make run-local-demo-debug
make run-local-lambda-debug
To configure the current shell for direct local-debug commands, evaluate the
shell assignments emitted by show-local-vars:
eval "$(make show-local-vars)"
This selects DynamoDB Local, MinIO, Mailpit, the demo- table prefix, and the
local resize-lambda debug endpoint. It unsets AWS profile and demo-mode
variables.