mtproto-checker 0.3.1 → 0.4.0
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/README.md +107 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -276,6 +276,113 @@ 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
|
+
proxy_read_timeout 120s;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
server {
|
|
353
|
+
listen 80;
|
|
354
|
+
server_name _;
|
|
355
|
+
return 301 https://$host$request_uri;
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### SSL Certificate
|
|
360
|
+
|
|
361
|
+
Install acme.sh:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
sudo apt-get install cron socat
|
|
365
|
+
curl https://get.acme.sh | sh -s email=your@email.com && source ~/.bashrc
|
|
366
|
+
acme.sh --set-default-ca --server letsencrypt
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Issue certificate:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
acme.sh --issue --standalone -d 'your-domain.example.com' \
|
|
373
|
+
--key-file /opt/mtproto-checker/privkey.key \
|
|
374
|
+
--fullchain-file /opt/mtproto-checker/fullchain.pem
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Auto-renewal is set up via cron automatically. Verify with `crontab -l | grep acme`.
|
|
378
|
+
|
|
379
|
+
### Deploy
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
docker compose build --no-cache
|
|
383
|
+
docker compose up -d
|
|
384
|
+
```
|
|
385
|
+
|
|
279
386
|
## 🛠 Troubleshooting
|
|
280
387
|
|
|
281
388
|
| Problem | Fix |
|