Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# LongBridge Platform - Required Environment Variables

# ── Runtime Target (REQUIRED) ──
# 优先使用 QSL_RUNTIME_TARGET_JSON(跨平台共享),否则使用 RUNTIME_TARGET_JSON
RUNTIME_TARGET_JSON={"platform_id":"longbridge","strategy_profile":"soxl_soxx_trend_income","execution_mode":"live","account_scope":"HK","dry_run_only":true}

# ── LongBridge Account ──
Expand All @@ -15,9 +16,13 @@ LONGBRIDGE_SYMBOL_SUFFIX=.US
LONGBRIDGE_TRADING_CURRENCY=USD

# ── Notification ──
# QSL_GLOBAL_TELEGRAM_CHAT_ID 和 QSL_NOTIFY_LANG 是跨平台共享的 QSL_ 前缀变量,
# 设置后会覆盖 GLOBAL_TELEGRAM_CHAT_ID 和 NOTIFY_LANG。
TELEGRAM_TOKEN=<from-secret-manager>
GLOBAL_TELEGRAM_CHAT_ID=
QSL_GLOBAL_TELEGRAM_CHAT_ID=
NOTIFY_LANG=zh
QSL_NOTIFY_LANG=

# ── Execution Control ──
LONGBRIDGE_DRY_RUN_ONLY=false
Expand All @@ -34,3 +39,4 @@ ORDER_POLL_MAX_ATTEMPTS=36
# ── Execution Report ──
EXECUTION_REPORT_OUTPUT_DIR=/tmp/quant_runtime_reports
EXECUTION_REPORT_GCS_URI=gs://qsl-runtime-logs-shared/execution-reports
QSL_EXECUTION_REPORT_GCS_URI=
3 changes: 3 additions & 0 deletions .github/workflows/sync-cloud-run-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
ENABLE_GITHUB_CLOUD_RUN_DEPLOY: ${{ vars.ENABLE_GITHUB_CLOUD_RUN_DEPLOY }}
ENABLE_GITHUB_ENV_SYNC: ${{ vars.ENABLE_GITHUB_ENV_SYNC }}
ENABLE_MAIN_PUSH_CLOUD_RUN_AUTOMATION: ${{ vars.ENABLE_MAIN_PUSH_CLOUD_RUN_AUTOMATION }}
QSL_ENABLE_CLOUD_RUN_AUTOMATION: ${{ vars.QSL_ENABLE_CLOUD_RUN_AUTOMATION }}
WORKFLOW_TARGET: ${{ inputs.target || 'configured' }}
INPUT_CLOUD_RUN_REGION: ${{ inputs.cloud_run_region }}
INPUT_CLOUD_RUN_SERVICE: ${{ inputs.cloud_run_service }}
Expand Down Expand Up @@ -216,6 +217,8 @@ jobs:
deploy_enabled=false
env_sync_enabled=false

# QSL_ENABLE_CLOUD_RUN_AUTOMATION overrides ENABLE_MAIN_PUSH_CLOUD_RUN_AUTOMATION
ENABLE_MAIN_PUSH_CLOUD_RUN_AUTOMATION="${QSL_ENABLE_CLOUD_RUN_AUTOMATION:-$ENABLE_MAIN_PUSH_CLOUD_RUN_AUTOMATION}"
if [ "${GITHUB_EVENT_NAME:-}" = "push" ] && [ "${ENABLE_MAIN_PUSH_CLOUD_RUN_AUTOMATION:-}" != "true" ]; then
write_github_output \
"deploy_enabled=false" \
Expand Down
8 changes: 5 additions & 3 deletions runtime_config_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ def load_platform_runtime_settings(
)
or DEFAULT_TRADING_CURRENCY
).upper(),
notify_lang=os.getenv("NOTIFY_LANG", "en"),
notify_lang=os.getenv("QSL_NOTIFY_LANG") or os.getenv("NOTIFY_LANG", "en"),
tg_token=os.getenv("TELEGRAM_TOKEN"),
tg_chat_id=os.getenv("GLOBAL_TELEGRAM_CHAT_ID"),
tg_chat_id=os.getenv("QSL_GLOBAL_TELEGRAM_CHAT_ID") or os.getenv("GLOBAL_TELEGRAM_CHAT_ID"),
notification_channel=os.getenv("NOTIFICATION_CHANNEL", "telegram"),
wecom_webhook_url=os.getenv("NOTIFICATION_WECOM_WEBHOOK_URL"),
dingtalk_webhook_url=os.getenv("NOTIFICATION_DINGTALK_WEBHOOK_URL"),
Expand Down Expand Up @@ -409,6 +409,7 @@ def load_platform_runtime_settings(
strategy_config_source=runtime_paths.strategy_config_source,
strategy_plugin_mounts_json=(
os.getenv("LONGBRIDGE_STRATEGY_PLUGIN_MOUNTS_JSON")
or os.getenv("QSL_STRATEGY_PLUGIN_MOUNTS_JSON")
or os.getenv("STRATEGY_PLUGIN_MOUNTS_JSON")
),
strategy_plugin_alert_channels=resolve_split_env_list("STRATEGY_PLUGIN_ALERT_CHANNELS"),
Expand Down Expand Up @@ -449,7 +450,8 @@ def load_platform_runtime_settings(
"STRATEGY_PLUGIN_ALERT_TELEGRAM_CHAT_IDS"
),
strategy_plugin_alert_telegram_bot_token=_first_non_empty(
os.getenv("STRATEGY_PLUGIN_ALERT_TELEGRAM_BOT_TOKEN")
os.getenv("QSL_STRATEGY_PLUGIN_ALERT_TELEGRAM_BOT_TOKEN")
or os.getenv("STRATEGY_PLUGIN_ALERT_TELEGRAM_BOT_TOKEN")
),
strategy_plugin_alert_telegram_api_base_url=_first_non_empty(
os.getenv("STRATEGY_PLUGIN_ALERT_TELEGRAM_API_BASE_URL")
Expand Down
Loading