mtproto-checker 0.3.1 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +116 -1
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|
package/README.md
CHANGED
|
@@ -276,6 +276,121 @@ https://t.me/proxy?server=1.2.3.4&port=443&secret=ee...
|
|
|
276
276
|
|
|
277
277
|
Secrets: hex (`ee...`, `dd...`), plain hex, or base64url — auto-detected. `tg://socks` links are ignored.
|
|
278
278
|
|
|
279
|
+
## 🐳 Docker Deployment
|
|
280
|
+
|
|
281
|
+
Structure on the server:
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
/etc/mtproto-checker/ ← source code (auto-pulled)
|
|
285
|
+
├── check.js
|
|
286
|
+
├── Dockerfile
|
|
287
|
+
├── package.json
|
|
288
|
+
└── ...
|
|
289
|
+
|
|
290
|
+
/opt/mtproto-checker/ ← configs & certs (manual)
|
|
291
|
+
├── docker-compose.yml
|
|
292
|
+
├── default.conf
|
|
293
|
+
├── fullchain.pem
|
|
294
|
+
└── privkey.key
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### `docker-compose.yml`
|
|
298
|
+
|
|
299
|
+
```yaml
|
|
300
|
+
services:
|
|
301
|
+
app:
|
|
302
|
+
container_name: mtproto-checker
|
|
303
|
+
build: /etc/mtproto-checker
|
|
304
|
+
restart: unless-stopped
|
|
305
|
+
environment:
|
|
306
|
+
- TG_API_ID=your_api_id
|
|
307
|
+
- TG_API_HASH=your_api_hash
|
|
308
|
+
- CHECK_AUTH_USER=admin
|
|
309
|
+
- CHECK_AUTH_PASSWORD=your_password
|
|
310
|
+
- PORT=8080
|
|
311
|
+
expose:
|
|
312
|
+
- "8080"
|
|
313
|
+
|
|
314
|
+
nginx:
|
|
315
|
+
container_name: mtproto-checker-nginx
|
|
316
|
+
image: nginx:alpine
|
|
317
|
+
restart: unless-stopped
|
|
318
|
+
ports:
|
|
319
|
+
- "443:443"
|
|
320
|
+
- "80:80"
|
|
321
|
+
volumes:
|
|
322
|
+
- ./default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
323
|
+
- ./privkey.key:/etc/nginx/ssl/privkey.key:ro
|
|
324
|
+
- ./fullchain.pem:/etc/nginx/ssl/fullchain.pem:ro
|
|
325
|
+
depends_on:
|
|
326
|
+
- app
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### `default.conf`
|
|
330
|
+
|
|
331
|
+
```nginx
|
|
332
|
+
server {
|
|
333
|
+
listen 443 ssl;
|
|
334
|
+
server_name _;
|
|
335
|
+
|
|
336
|
+
ssl_certificate /etc/nginx/ssl/fullchain.pem;
|
|
337
|
+
ssl_certificate_key /etc/nginx/ssl/privkey.key;
|
|
338
|
+
|
|
339
|
+
ssl_protocols TLSv1.2 TLSv1.3;
|
|
340
|
+
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
341
|
+
|
|
342
|
+
location / {
|
|
343
|
+
proxy_pass http://app:8080;
|
|
344
|
+
proxy_set_header Host $host;
|
|
345
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
346
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
347
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
348
|
+
|
|
349
|
+
# Объявляем переменную с таймаутом (600s = 10 минут)
|
|
350
|
+
set $custom_timeout 600s;
|
|
351
|
+
|
|
352
|
+
# Используем переменную для всех таймаутов
|
|
353
|
+
proxy_read_timeout $custom_timeout;
|
|
354
|
+
proxy_connect_timeout $custom_timeout;
|
|
355
|
+
proxy_send_timeout $custom_timeout;
|
|
356
|
+
send_timeout $custom_timeout;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
server {
|
|
361
|
+
listen 80;
|
|
362
|
+
server_name _;
|
|
363
|
+
return 301 https://$host$request_uri;
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### SSL Certificate
|
|
368
|
+
|
|
369
|
+
Install acme.sh:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
sudo apt-get install cron socat
|
|
373
|
+
curl https://get.acme.sh | sh -s email=your@email.com && source ~/.bashrc
|
|
374
|
+
acme.sh --set-default-ca --server letsencrypt
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Issue certificate:
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
acme.sh --issue --standalone -d 'your-domain.example.com' \
|
|
381
|
+
--key-file /opt/mtproto-checker/privkey.key \
|
|
382
|
+
--fullchain-file /opt/mtproto-checker/fullchain.pem
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Auto-renewal is set up via cron automatically. Verify with `crontab -l | grep acme`.
|
|
386
|
+
|
|
387
|
+
### Deploy
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
docker compose build --no-cache
|
|
391
|
+
docker compose up -d
|
|
392
|
+
```
|
|
393
|
+
|
|
279
394
|
## 🛠 Troubleshooting
|
|
280
395
|
|
|
281
396
|
| Problem | Fix |
|
|
@@ -287,4 +402,4 @@ Secrets: hex (`ee...`, `dd...`), plain hex, or base64url — auto-detected. `tg:
|
|
|
287
402
|
|
|
288
403
|
## 📜 License
|
|
289
404
|
|
|
290
|
-
|
|
405
|
+
[Unlicense](LICENSE) — completely free to use, no restrictions.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mtproto-checker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Check Telegram MTProto proxies via a real TDLib handshake (testProxy), like tdesktop does",
|
|
5
5
|
"main": "check.js",
|
|
6
6
|
"exports": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"start": "node check.js"
|
|
27
27
|
},
|
|
28
|
+
"license": "Unlicense",
|
|
28
29
|
"engines": {
|
|
29
30
|
"node": ">=18"
|
|
30
31
|
},
|