-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
developer-config.php
463 lines (370 loc) · 24.4 KB
/
developer-config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
<?php
/*
* Copyright 2014-2024 GPLv3, Open Crypto Tracker by Mike Kilday: Mike@DragonFrugal.com (leave this copyright / attribution intact in ALL forks / copies!)
*/
///////////////////////////////////////////////////
// **START** DEVELOPER-ONLY CONFIGS
///////////////////////////////////////////////////
// ***************************************************************
// Runs in /app-lib/php/init.php
// ***************************************************************
if ( $dev_only_configs_mode == 'init' ) {
// Application version
// PLEASE UPDATE TIMESTAMP HERE, TO DATE OF LATEST VERSION BUMP: 2024/OCTOBER/26TH
$ct['app_version'] = '6.00.40';
// #PHP# ERROR LOGGING
// Can take any setting shown here: https://www.php.net/manual/en/function.error-reporting.php
// 0 = off, -1 = on (IF *NOT* SET TO ZERO HERE, THIS #OVERRIDES# PHP ERROR DEBUG SETTINGS IN THE APP'S USER CONFIG SETTINGS)
// WRAP VALUE(S) IN PARENTHESIS, SO MULTIPLE VALUES CAN BE USED: (0) / (-1) / (E_ERROR | E_PARSE)
$ct['dev']['debug_php_errors'] = (0);
// Time offset (IN MINUTES) on daily background tasks
// (so they run at the same time everyday [without 'creeping' up / down for it's time-of-day run])
$ct['dev']['tasks_time_offset'] = -4; // Auto-adjusts (higher) for systems with LOW CORE COUNTS in config-init.php
// min / max font RESIZE percentages allowed (as decimal representing 100% @ 1.00)
$ct['dev']['min_font_resize'] = 0.5; // 50%
////
$ct['dev']['max_font_resize'] = 2.0; // 200%
// FONT WEIGHT for ALL text in app (as a CSS value)
$ct['dev']['global_font_weight'] = 400; // 400 for ANY font size
// LINE HEIGHT PERCENTAGE for ALL text in app (as a decimal)
$ct['dev']['global_line_height_percent'] = 1.50; // 150% line height for ANY font size
// info icon size CSS configs
$ct['dev']['info_icon_size_css_selector'] = "img.tooltip_style_control";
// ajax loading size CSS configs
$ct['dev']['ajax_loading_size_css_selector'] = "img.ajax_loader_image";
// password eye icon size CSS configs
$ct['dev']['password_eye_size_css_selector'] = "i.gg-eye, i.gg-eye-alt";
// standard font size CSS configs
$ct['dev']['font_size_css_selector'] = "#sidebar_menu, #header_size_warning, #alert_bell_area, #background_loading, radio, .full_width_wrapper:not(.custom-select), .iframe_wrapper:not(.custom-select), .footer_content, .footer_banner, .countdown_notice, .sidebar-slogan, .pw_prompt";
// medium font size CSS configs
$ct['dev']['medium_font_size_css_selector'] = ".unused_for_appending";
// small font size CSS configs
$ct['dev']['small_font_size_css_selector'] = ".unused_for_appending, .gain, .loss, .crypto_worth, .extra_data";
// tiny font size CSS configs
$ct['dev']['tiny_font_size_css_selector'] = ".accordion-button";
// These selector(s) are wonky for some reason in LINUX PHPDESKTOP (but work fine in all modern browsers)
// (dynamically appended conditionally in primary-init.php)
$ct['dev']['small_font_size_css_selector_adjusted'] = ", #admin_conf_quick_links a:link, #admin_conf_quick_links legend, td.data";
////
$ct['dev']['tiny_font_size_css_selector_adjusted'] = ", .crypto_worth";
// PERCENT of MEDIUM font size (as a decimal)
$ct['dev']['medium_font_size_css_percent'] = 0.90; // 90% of $set_font_size
////
// PERCENT of SMALL font size (as a decimal)
$ct['dev']['small_font_size_css_percent'] = 0.75; // 75% of $set_font_size
////
// PERCENT of TINY font size (as a decimal)
$ct['dev']['tiny_font_size_css_percent'] = 0.60; // 60% of $set_font_size
// Default charset used
$ct['dev']['charset_default'] = 'UTF-8';
////
// Unicode charset used (if needed)
// UCS-2 is outdated as it only covers 65536 characters of Unicode
// UTF-16BE / UTF-16LE / UTF-16 / UCS-2BE can represent ALL Unicode characters
$ct['dev']['charset_unicode'] = 'UTF-16';
// Cache directories / files and .htaccess / index.php files permissions
// (CHANGE WITH #EXTREME# CARE, to adjust security for your PARTICULAR setup)
// THESE PERMISSIONS ARE !ALREADY! CALLED THROUGH THE octdec() FUNCTION *WITHIN THE APP WHEN USED*
////
// Cache directories permissions
$ct['dev']['chmod_cache_dir'] = '0770'; // (default = '0770' [owner/group read/write/exec])
////
// Cache files permissions
$ct['dev']['chmod_cache_file'] = '0660'; // (default = '0660' [owner/group read/write])
////
// .htaccess / index.php index security files permissions
$ct['dev']['chmod_index_sec'] = '0660'; // (default = '0660' [owner/group read/write])
// !!!!! BE #VERY CAREFUL# LOWERING MAXIMUM EXECUTION TIMES BELOW, #OR YOU MAY CRASH THE RUNNING PROCESSES EARLY,
// OR CAUSE MEMORY LEAKS THAT ALSO CRASH YOUR !ENTIRE SYSTEM!#
// (ALL maximum execution times are automatically 900 seconds [15 minutes] IN DEBUG MODE)
////
// Maximum execution time for interface runtime in seconds (how long it's allowed to run before automatically killing the process)
$ct['dev']['ui_max_exec_time'] = 350; // (default = 350)
////
// Maximum execution time for ajax runtime in seconds (how long it's allowed to run before automatically killing the process)
$ct['dev']['ajax_max_exec_time'] = 1000; // (default = 1000)
////
// Maximum execution time for cron job runtime in seconds (how long it's allowed to run before automatically killing the process)
$ct['dev']['cron_max_exec_time'] = 1320; // (default = 1320)
////
// Maximum execution time for internal API runtime in seconds (how long it's allowed to run before automatically killing the process)
$ct['dev']['int_api_max_exec_time'] = 120; // (default = 120)
////
// Maximum execution time for webhook runtime in seconds (how long it's allowed to run before automatically killing the process)
$ct['dev']['webhook_max_exec_time'] = 120; // (default = 120)
// CAPTCHA text settings...
// Text size
$ct['dev']['captcha_text_size'] = 50; // Text size (default = 50)
////
// Number of characters
$ct['dev']['captcha_chars_length'] = 7; // Number of characters in captcha image (default = 7)
////
// Configuration for advanced CAPTCHA image settings on all admin login / reset pages
$ct['dev']['captcha_image_width'] = 525; // Image width (default = 525)
////
$ct['dev']['captcha_image_height'] = 135; // Image height (default = 135)
////
$ct['dev']['captcha_text_margin'] = 10; // MINIMUM margin of text from edge of image (approximate / average) (default = 10)
////
// Only allow the MOST READABLE characters for use in captcha image
// (DON'T SET TOO LOW, OR BOTS CAN GUESS THE CAPTCHA CODE EASIER)
$ct['dev']['captcha_permitted_chars'] = 'ABCDEFHJKMNPRSTUVWXYZ23456789'; // (default = 'ABCDEFHJKMNPRSTUVWXYZ23456789')
// Servers requiring TRACKED THROTTLE-LIMITING, due to limited-allowed minute / hour / daily requests
// (are processed by ct_cache->api_throttling(), to avoid using up daily request limits)
// ADDITIONAL (CORRESPONDING) LOGIC MUST BE ADDED IN /inline/config/throttled-markets-config.php
$ct['dev']['tracked_throttle_limited_servers'] = array(
// 'tld_domain_name' => 'corresponding_exchange_identifier_OR_BOOLEAN_TRUE',
'alphavantage.co' => 'alphavantage_stock',
);
// Servers which are known to block API access by location / jurisdiction
// (we alert end-users in error logs, when a corresponding API server connection fails [one-time notice per-runtime])
$ct['dev']['location_blocked_servers'] = array(
// 'tld_domain_name',
'binance.com',
'bybit.com',
);
// Market ID delimiters (for coin exchange market IDs)
// (USED FOR PARSING OUT PAIRING VALUE, WHEN ADDING NEW MARKETS IN ADMIN 'PORTFOLIO ASSETS' INTERFACE)
$ct['dev']['hyphen_delimited_markets'] = array(
'coinbase',
'okex',
'kucoin',
'okcoin',
'loopring',
'idex',
'zebpay',
'aevo',
);
$ct['dev']['reverse_hyphen_delimited_markets'] = array(
'upbit',
'buyucoin',
);
$ct['dev']['underscore_delimited_markets'] = array(
'bitflyer',
'korbit',
'bitso',
'poloniex',
'crypto.com',
'gateio',
'bitmart',
);
$ct['dev']['forwardlash_delimited_markets'] = array(
'btcmarkets',
'jupiter_ag',
);
$ct['dev']['colon_delimited_markets'] = array(
'cex',
);
// Market IDs HAVE PAIRING IN FRONT OF ASSET
$ct['dev']['reverse_id_markets'] = array(
'upbit',
'buyucoin',
);
// Auto-correct for end user market searches, when adding new markets
$ct['dev']['markets_uppercase_search'] = array(
'alphavantage_stock',
'binance',
'binance_us',
'bitbns',
'bitflyer',
'bitmex',
'btcmarkets',
'btcturk',
'buyucoin',
'cex',
'coinbase',
'coindcx',
'hitbtc',
'jupiter_ag',
'kraken',
'loopring',
'luno',
'okcoin',
'okex',
'unocoin',
'upbit',
);
$ct['dev']['markets_lowercase_search'] = array(
'bitstamp',
'coingecko',
'gemini',
'huobi',
'wazirx',
'bitso',
'korbit',
'coinspot',
);
// MAIN CONFIG settings subarray keys to ALLOW cached config RESETS on (during cached config upgrades)
// (can manipulate later on, based on app version number / user input / etc)
// THIS ALWAYS OVERRIDES 'config_deny_additions' AND 'config_deny_removals'
$ct['dev']['config_allow_resets'] = array();
// MAIN CONFIG settings subarray keys to DENY cached config settings ADDITIONS on (during cached config upgrades)
// (can manipulate later on, based on app version number / user input / etc)
// INCLUDE NUMERIC / AUTO-INDEXING KEYED ARRAYS, EVEN THOUGH WE DON'T SUPPORT THEM WELL *YET*
$ct['dev']['config_deny_additions'] = array(
//////// STANDARD LIST //////////////////////
'strict_consecutive_connect_servers', // Subarray setting (power user)
'strict_news_feed_servers', // Subarray setting (strict news feed servers)
'feeds', // Subarray setting (news feeds)
'anti_proxy_servers', // Subarray setting (anti-proxy servers)
'proxy_list', // Subarray setting (proxy servers)
'tracked_markets', // Subarray setting (asset charts / price alerts)
'conversion_currency_symbols', // Subarray setting (currency support)
'bitcoin_preferred_currency_markets', // Subarray setting (currency support)
'crypto_pair', // Subarray setting (currency support)
'crypto_pair_preferred_markets', // Subarray setting (currency support)
'token_presales_usd', // Subarray setting (currency support)
'text_gateways', // Subarray setting (mobile text gateways)
'assets', // Main category (portfolio assets)
);
// MAIN CONFIG settings subarray keys to DENY cached config settings REMOVALS on (during cached config upgrades)
// (can manipulate later on, based on app version number / user input / etc)
// INCLUDE NUMERIC / AUTO-INDEXING KEYED ARRAYS, EVEN THOUGH WE DON'T SUPPORT THEM WELL *YET*
$ct['dev']['config_deny_removals'] = array(
//////// STANDARD LIST //////////////////////
'strict_consecutive_connect_servers', // Subarray setting (power user)
'strict_news_feed_servers', // Subarray setting (strict news feed servers)
'feeds', // Subarray setting (news feeds)
'anti_proxy_servers', // Subarray setting (anti-proxy servers)
'proxy_list', // Subarray setting (proxy servers)
'tracked_markets', // Subarray setting (asset charts / price alerts)
'conversion_currency_symbols', // Subarray setting (currency support)
'bitcoin_preferred_currency_markets', // Subarray setting (currency support)
'crypto_pair', // Subarray setting (currency support)
'crypto_pair_preferred_markets', // Subarray setting (currency support)
'token_presales_usd', // Subarray setting (currency support)
'text_gateways', // Subarray setting (mobile text gateways)
'assets', // Main category (portfolio assets)
);
// PLUGIN setting keys to ALLOW cached config RESETS on (during cached config upgrades)
// (can manipulate later on, based on app version number / user input / etc)
$ct['dev']['plugin_allow_resets'] = array(
// Format example (dynamically add at top of plugin's plug-conf.php file)
'my-plugin-name' => array(
'plugin-setting-key',
),
);
// Exchange APIs that have NO TRADE VOLUME DATA (for UX on trade volume data in interface)
$ct['dev']['no_trade_volume_api_data'] = array(
// 'exchange-config-key-name-here',
'misc_assets',
'presale_usd_value',
'btc_nfts',
'eth_nfts',
'sol_nfts',
'alt_nfts',
'coinspot',
'unocoin',
);
// PRIMARY Domain only (NO SUBDOMAINS), for each API service that requires multiple calls (for each data set)
// Used to throttle these market calls a tiny bit (0.55 seconds), so we don't get easily blocked / throttled by external APIs etc
// (ANY EXCHANGES LISTED HERE ARE FLAGGED IN THE INTERFACE AS !NOT! RECOMMENDED TO BE USED AS THE PRIMARY CURRENCY MARKET IN THIS APP,
// AS ON OCCASION THEY CAN BE !UNRELIABLE! IF HIT WITH TOO MANY SEPARATE API CALLS FOR MULTIPLE COINS / ASSETS)
// !MUST BE LOWERCASE!
// #DON'T ADD ANY WEIRD TLD HERE LIKE 'xxxxx.co.il'#, AS DETECTING TLD DOMAINS WITH MORE THAN ONE PERIOD IN THEM ISN'T SUPPORTED
// WE DON'T WANT THE REQUIRED EXTRA LOGIC TO PARSE THESE DOUBLE-PERIOD TLDs BOGGING DOWN / CLUTTERING APP CODE, FOR JUST ONE TINY ENHANCEMENT
$ct['dev']['limited_apis'] = array(
'aevo.xyz',
'alphavantage.co',
'anchor.fm',
'bitflyer.com',
'bitmex.com',
'bitso.com',
'bitstamp.net',
'blockchain.info',
'btcmarkets.net',
'coinbase.com',
// (coingecko #ABSOLUTELY HATES# DATA CENTER IPS [DEDICATED / VPS SERVERS], BUT GOES EASY ON RESIDENTIAL IPS)
'coingecko.com',
'geckoterminal.com',
'etherscan.io',
'gemini.com',
'medium.com',
'megaphone.fm',
'reddit.com',
'solana.com',
'substack.com',
'stackexchange.com',
'youtube.com',
);
// Attack signatures, used when scanning for script / HTML injection attacks
// (via sanitize_string() [which is called in sanitize_requests()] in early-security-logic.php, when scanning all POST / GET data submissions)
// (NOT CASE SENSITIVE, JUST GET THE SIGNATURES RIGHT)
$ct['dev']['script_injection_checks'] = array(
"base64", // base64 PHP ENCODE / DECODE
"btoa(", // base64 javascript ENCODE
"atob(", // base64 javascript DECODE
"bin2hex", // hex PHP ENCODE
"hex2bin", // hex PHP DECODE
"char(", // SQL CHAR() function
"javascript", // Javascript
"script", // Javascript
"href=", // HTML
"src=", // HTML
// ALL javascript 'on' events
"onclick",
"onmouse",
"onresize",
"onchange",
"onabort",
"onblur",
"ondblclick",
"ondragdrop",
"onerror",
"onfocus",
"onkey",
"onload",
"onmove",
"onreset",
"onselect",
"onsubmit",
"onunload",
);
}
// ***************************************************************
// ***************************************************************
// ***************************************************************
// Runs in /app-lib/php/inline/init/config-init.php, within the logic that runs during upgrade checks
// ***************************************************************
elseif ( $dev_only_configs_mode == 'config-init-upgrade-check' ) {
// v6.00.30:
// RESET the 'assets' and 'tracked_markets' cached config values
// (bittrex is going out of business GLOBALLY on 2023/12/4, AND WE HAVE TONS OF BITTREX MARKETS IN OUR PREVIOUS DEMO DATA WE NEED TO PURGE)
if ( $ct['app_version'] == '6.00.30' ) {
$ct['dev']['config_allow_resets'][] = 'tracked_markets'; // Subarray setting (asset charts / price alerts)
$ct['dev']['config_allow_resets'][] = 'assets'; // Main category (portfolio assets)
}
}
// ***************************************************************
// ***************************************************************
// ***************************************************************
// Runs in /app-lib/php/inline/config/after-load-config.php (because user config values are used)
// ***************************************************************
elseif ( $dev_only_configs_mode == 'after-load-config' ) {
// MAKE SURE **ANYTHING** RUN IN HERE --IS ENGINEERED TO-- BE CLEANLY RELOADED!!
// Obfuscate these matches in ALL error / debugging logs
// (ONLY ADD SENSITIVE VALUES HERE THAT COULD SHOW IN URL GET REQUEST DATA / ERROR NOTICES / ETC)
$ct['dev']['data_obfuscating'] = array(
// 'hide_this',
$ct['conf']['comms']['from_email'],
$ct['conf']['comms']['to_email'],
$ct['conf']['ext_apis']['telegram_your_username'],
$ct['conf']['ext_apis']['telegram_bot_username'],
$ct['conf']['ext_apis']['telegram_bot_token'],
$ct['conf']['ext_apis']['twilio_number'],
$ct['conf']['ext_apis']['twilio_sid'],
$ct['conf']['ext_apis']['twilio_token'],
$ct['conf']['ext_apis']['textbelt_api_key'],
$ct['conf']['ext_apis']['textlocal_api_key'],
$ct['conf']['ext_apis']['google_fonts_api_key'],
$ct['conf']['ext_apis']['etherscan_api_key'],
$ct['conf']['ext_apis']['alphavantage_api_key'],
);
}
// ***************************************************************
// ***************************************************************
///////////////////////////////////////////////////
// **END** DEVELOPER-ONLY CONFIGS
///////////////////////////////////////////////////
// DON'T CREATE ANY WHITESPACE AFTER CLOSING PHP TAG, A WE ARE STILL IN INIT! (NO HEADER ESTABLISHED YET)
?>