tweb/src/config/app.ts

41 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-04-08 15:52:31 +02:00
/*
* https://github.com/morethanwords/tweb
* Copyright (C) 2019-2021 Eduard Kuzmenko
* https://github.com/morethanwords/tweb/blob/master/LICENSE
2022-08-04 08:49:54 +02:00
*
2021-04-08 15:52:31 +02:00
* Originally from:
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/
2022-08-04 08:49:54 +02:00
import type {DcId} from '../types';
2021-06-20 19:07:20 +02:00
2023-01-06 20:27:29 +01:00
export const MAIN_DOMAINS = ['web.telegram.org', 'webk.telegram.org'];
2021-06-28 15:41:42 +02:00
2022-11-01 18:39:23 +01:00
const threads = Math.min(4, navigator.hardwareConcurrency ?? 4);
2021-02-13 16:32:10 +01:00
const App = {
id: +process.env.API_ID,
hash: process.env.API_HASH,
version: process.env.VERSION,
versionFull: process.env.VERSION_FULL,
2021-10-21 15:16:43 +02:00
build: +process.env.BUILD,
2023-03-01 11:20:49 +01:00
langPackVersion: '0.9.7',
2022-12-13 16:23:03 +01:00
langPack: 'webk',
langPackCode: 'en',
2023-01-06 20:27:29 +01:00
domains: MAIN_DOMAINS,
2021-06-20 19:07:20 +02:00
baseDcId: 2 as DcId,
2023-01-06 20:27:29 +01:00
isMainDomain: MAIN_DOMAINS.includes(location.hostname),
suffix: 'K',
2022-11-01 18:39:23 +01:00
threads,
cryptoWorkers: threads
2021-02-13 16:32:10 +01:00
};
2021-06-11 14:15:28 +02:00
if(App.isMainDomain) { // use Webogram credentials then
App.id = 2496;
App.hash = '8da85b0d5bfe62527e5b244c209159c3';
}
2021-02-13 16:32:10 +01:00
export default App;