Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

3.6 KB
Raw Blame
# Decrypts the root .env-local.enc into a .env file here
get_environment:
  @echo "Getting base .env file"
  just ../../get_environment
  @echo "Adding in Fusionauth values"
  just ../../infra/stacks/fusionauth-instance/insert_local_fusionauth_variables
  @echo "Copying env file"
  cp ../../.env ./
  @echo "Overriding FUSIONAUTH_BASE_URL"
  sed -i '' 's|^FUSIONAUTH_BASE_URL=.*|FUSIONAUTH_BASE_URL="http://localhost:9011"|' .env
  @echo "Overriding LOCAL_AWS_URL"
  sed -i '' 's|^LOCAL_AWS_URL=.*|LOCAL_AWS_URL="http://localhost:4566"|' .env

[positional-arguments]
seed *ARGS:
  cargo r "$@"

# Seed/reset/status a REAL @macro-test.com Gmail test mailbox via the Gmail
# API. Credentials come from AWS Secrets Manager, so an authenticated `aws` CLI is required.
#   just gmail seed --account [email protected] --count 10000
#   just gmail reset --account [email protected]
#   just gmail status --account [email protected]
[positional-arguments]
gmail *ARGS:
  @GOOGLE_CLIENT_ID="${GOOGLE_CLIENT_ID:-$(aws secretsmanager get-secret-value --secret-id google-client-id-local --query SecretString --output text)}" \
  GOOGLE_CLIENT_SECRET_KEY="${GOOGLE_CLIENT_SECRET_KEY:-$(aws secretsmanager get-secret-value --secret-id google-client-secret-local --query SecretString --output text)}" \
  GMAIL_TEST_ACCOUNT_TOKENS="${GMAIL_TEST_ACCOUNT_TOKENS:-$(aws secretsmanager get-secret-value --secret-id gmail-test-account-tokens --query SecretString --output text)}" \
  GMAIL_FORWARDER_SA_KEY="${GMAIL_FORWARDER_SA_KEY:-$(aws secretsmanager get-secret-value --secret-id gmail-local-watch-forwarder-sa --query SecretString --output text)}" \
  SQLX_OFFLINE="true" \
  cargo r -- gmail "$@"

# Reset and seed deterministic data for the local Playwright smoke suite.
local-e2e-smoke:
  LOCAL_E2E_SEED="true" \
  DATABASE_URL="postgres://user:password@localhost:5432/macrodb" \
  LOCAL_AWS_URL="http://localhost:4566" \
  DOCUMENT_STORAGE_BUCKET="doc-storage" \
  AWS_ACCESS_KEY_ID="test" \
  AWS_SECRET_ACCESS_KEY="test" \
  SQLX_OFFLINE="true" \
  ENVIRONMENT="local" \
  FUSIONAUTH_BASE_URL="http://localhost:9011" \
  FUSIONAUTH_API_KEY_SECRET_KEY="local" \
  FUSIONAUTH_CLIENT_ID="local" \
  FUSIONAUTH_CLIENT_SECRET_KEY="local" \
  FUSIONAUTH_OAUTH_REDIRECT_URI="http://localhost:8080/oauth/redirect" \
  cargo r -- scenario local-e2e-smoke

# Run a scenario subcommand (apply/reset/matrix) against the local stack,
# e.g. `just scenario apply --file seed/scenarios/team-perms.json`.
# The FusionAuth values default to the deterministic `run_local` identity
# (tooling/xtask/crates/xtask_local/src/local/identity.rs).
[positional-arguments]
scenario *ARGS:
  @LOCAL_SEED="true" \
  DATABASE_URL="${DATABASE_URL:-postgres://user:password@localhost:5432/macrodb}" \
  LOCAL_AWS_URL="${LOCAL_AWS_URL:-http://localhost:4566}" \
  DOCUMENT_STORAGE_BUCKET="${DOCUMENT_STORAGE_BUCKET:-doc-storage}" \
  AWS_ACCESS_KEY_ID="test" \
  AWS_SECRET_ACCESS_KEY="test" \
  SQLX_OFFLINE="true" \
  ENVIRONMENT="local" \
  FUSIONAUTH_BASE_URL="${FUSIONAUTH_BASE_URL:-http://localhost:9011}" \
  FUSIONAUTH_API_KEY_SECRET_KEY="${FUSIONAUTH_API_KEY_SECRET_KEY:-bf69486b-4733-4954-a44e-2e1b5f2c8a91}" \
  FUSIONAUTH_CLIENT_ID="${FUSIONAUTH_CLIENT_ID:-22222222-2222-4222-8222-222222222222}" \
  FUSIONAUTH_CLIENT_SECRET_KEY="${FUSIONAUTH_CLIENT_SECRET_KEY:-local}" \
  FUSIONAUTH_OAUTH_REDIRECT_URI="http://localhost:8080/oauth/redirect" \
  SYNC_SERVICE_URL="${SYNC_SERVICE_URL:-http://localhost:8787}" \
  LEXICAL_SERVICE_URL="${LEXICAL_SERVICE_URL:-http://localhost:8096}" \
  INTERNAL_API_SECRET_KEY="${INTERNAL_API_SECRET_KEY:-local}" \
  FRONTEND_PORT="${FRONTEND_PORT:-3000}" \
  cargo r -- scenario "$@"