- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
3.0 KiB
Environment Variable Standardization
Last Updated: 2026-01-31
Document Version: 1.0
Status: Active Documentation
All scripts and configurations now use a single standardized .env file location: ~/.env
Standard Variable Names
All scripts use these consistent variable names from ~/.env:
PROXMOX_HOST- Proxmox host IP or hostnamePROXMOX_PORT- Proxmox API port (default: 8006)PROXMOX_USER- Proxmox API user (e.g., root@pam)PROXMOX_TOKEN_NAME- API token namePROXMOX_TOKEN_VALUE- API token secret value
Backwards Compatibility
For backwards compatibility with existing code that uses PROXMOX_TOKEN_SECRET, the scripts automatically map:
PROXMOX_TOKEN_SECRET = PROXMOX_TOKEN_VALUE(if TOKEN_SECRET is not set)
Files Updated
-
MCP Server (
mcp-proxmox/index.js)- Now loads from
~/.envinstead of../.env - Falls back to
../.envfor backwards compatibility
- Now loads from
-
Deployment Scripts (
smom-dbis-138-proxmox/lib/common.sh)load_config()now automatically loads~/.envfirst- Then loads
config/proxmox.confwhich can override or add settings
-
Proxmox API Library (
smom-dbis-138-proxmox/lib/proxmox-api.sh)init_proxmox_api()now loads from~/.envfirst- Maps
PROXMOX_TOKEN_VALUEtoPROXMOX_TOKEN_SECRETfor compatibility
-
Configuration File (
smom-dbis-138-proxmox/config/proxmox.conf)- Updated to reference
PROXMOX_TOKEN_VALUEfrom~/.env - Maintains backwards compatibility with
PROXMOX_TOKEN_SECRET
- Updated to reference
-
Standard Loader (
load-env.sh)- New utility script for consistent .env loading
- Can be sourced by any script:
source load-env.sh
Config validation (CI/pre-deploy): Run scripts/validation/validate-config-files.sh to check required config files and optional env; see README.md and project root .env.example.
Usage
In Bash Scripts
# Option 1: Use load_env_file() from common.sh (recommended)
source lib/common.sh
load_config # Automatically loads ~/.env first
# Option 2: Use standalone loader
source load-env.sh
load_env_file
In Node.js (MCP Server)
The MCP server automatically loads from ~/.env on startup.
Configuration Files
The config/proxmox.conf file will:
- First load values from
~/.env(viaload_env_file()) - Then apply any overrides or additional settings from the config file
Example ~/.env File
# Proxmox MCP Server Configuration
PROXMOX_HOST=192.168.11.10
PROXMOX_USER=root@pam
PROXMOX_TOKEN_NAME=mcp-server
PROXMOX_TOKEN_VALUE=your-actual-token-secret-here
PROXMOX_PORT=8006
PROXMOX_ALLOW_ELEVATED=false
Validation
All validation scripts use the same ~/.env file:
validate-ml110-deployment.shtest-connection.shverify-setup.sh
Benefits
- Single Source of Truth: One
.envfile for all scripts - Consistency: All scripts use the same variable names
- Easier Management: Update credentials in one place
- Backwards Compatible: Existing code using
PROXMOX_TOKEN_SECRETstill works