Commit Graph

10 Commits

Author SHA1 Message Date
macm1 b45d2e685a refactor: remove env vars persistence, only validate and export
Environment variables should NOT be saved to openclaw.json config.
Instead, they are injected directly into the gateway process via run.sh.

Flow:
  options.json (gateway_env_vars) → run.sh (export) → gateway process env

Changes:
- Remove cfg["env"] initialization from apply_gateway_settings
- Only validate env vars format and size limits in oc_config_helper.py
- Log validated vars but don't persist them to config
- run.sh remains responsible for parsing and exporting to process env
- Cleaner separation of concerns: helpers validates, run.sh exports
2026-02-23 06:00:01 +03:00
macm1 47631c1968 fix: store env vars in cfg[env][vars] not cfg[gateway][env] 2026-02-23 05:55:59 +03:00
macm1 30d95b8798 refactor: use YAML map for gateway environment variables instead of string parsing
Benefits:
- More idiomatic configuration format for Home Assistant add-ons
- config.yaml: Change default from empty string to empty YAML map
- config.yaml: Update schema type from str? to map(str)?
- config.yaml: Improve documentation to explain YAML map usage
- run.sh: Parse JSON object from jq using to_entries instead of semicolon splitting
- oc_config_helper.py: Accept JSON string and parse as dict instead of semicolon-separated values
- Better error handling for invalid JSON
- Cleaner and more maintainable parsing logic

This allows users to configure environment variables more naturally:
  gateway_env_vars:
    OPENAI_API_KEY: sk-abc123
    SERVICE_URL: https://api.example.com
2026-02-23 05:40:32 +03:00
macm1 9b402d3130 refactor: improve gateway env vars security and limits
- Add max limits (50 vars, 255 char names, 10000 char values)
- Validate variable names with regex
- Warn about duplicate variables
- Show var names in logs (not just count)
- Improve bash parsing with process substitution
- Better config documentation with examples
2026-02-23 05:36:07 +03:00
macm1 5086b88a00 feat: Add gateway environment variables support
- Add 'gateway_env_vars' configuration option to addon config
- Parse semicolon-separated KEY=VALUE pairs from add-on options
- Export environment variables to gateway process at startup
- Store parsed env vars in openclaw.json (gateway.env)

Allows users to pass custom environment variables to the gateway via
Home Assistant add-on configuration, e.g.:
  gateway_env_vars: 'SERVICE_API_KEY=123;SERVICE2_API=1231'

These variables are exported to the gateway process and can be used
for API authentication, feature flags, or other configuration needs.
2026-02-23 05:28:32 +03:00
techartdev 04a71cbf23 feat: Expand gateway_bind_mode options to include 'auto' and 'tailnet'; update documentation and translations 2026-02-21 18:25:33 +02:00
techartdev 73646113ae Add OpenAI API integration and update translations
- Introduced `enable_openai_api` option in config.yaml to enable OpenAI-compatible Chat Completions endpoint.
- Updated `apply_gateway_settings` function to handle OpenAI API settings.
- Enhanced documentation in DOCS.md for integrating OpenClaw with Home Assistant Assist pipeline.
- Added translations for `enable_openai_api` in English, Bulgarian, German, Spanish, and Polish.
- Bumped version to 0.5.37 in config.yaml.
2026-02-09 20:13:40 +02:00
techartdev ea9c70be5c Update OpenClaw version to 0.5.35 and add gateway mode configuration 2026-02-06 11:58:44 +02:00
techartdev 1db5009f0b Update gateway settings and translations for allow_insecure_auth option 2026-02-02 02:16:59 +02:00
techartdev cb68662eb6 merge new gateway configs from dev build 2026-02-02 02:02:16 +02:00