HUB
Sign inSign up

lsposed/aliyun-cdt-check

By lsposed

•Updated about 2 years ago

阿里流量监测Alibaba Cloud CDT Public Network Traffic Monitoring and Disconnection

Image
0

1.2K

lsposed/aliyun-cdt-check repository overview

# 阿里云cdt流量检测
version: '2.4'

services:
  app:
    container_name: aliyun-cdt-check 
    image: lsposed/aliyun-cdt-check
    volumes:
      - ./config.php:/app/config.php 
    restart: always
    networks:
      - mynetworks1
      - mynetworks2
    mem_limit: 50M
    cpu_shares: 50

networks:
  mynetworks1:
    external: true
  mynetworks2:
    external: true

执行docker exec -ti aliyun-cdt-check sh 进入容器

输入命令php aliyun-cdt-check.php检测是否执行成功

docker exec -ti aliyun-cdt-check php aliyun-cdt-check.php

5分钟检测一次,当使用流量达到95%时,自动禁用安全组的0.0.0.0/0入站规则,当流量重置时,自动恢复启用

⁠config.php

<?php
return [
    'Accounts' => [
        [
            'accountName' => 'xxxx',
            'AccessKeyId' => 'AK',
            'AccessKeySecret' => 'AS',
            'regionId' => 'cn-hongkong',
            'instanceId' => 'i-j6cj3uXXX',
            'maxTraffic' => 200 // 设置流量限制
        ],
        [
            'accountName' => 'xxxx',
            'AccessKeyId' => 'AK',
            'AccessKeySecret' => 'AS',
            'regionId' => 'cn-hongkong',
            'instanceId' => 'i-j6cj3uXXX',
            'maxTraffic' => 200 // 设置流量限制
        ]
		//可配置多个账户,不用请删掉
    ],
    'Notification' => [

        'enableEmail' => false,         // 邮件通知开关
        'email' => '[email protected]',
        'title' => '流量使用警告',
        'host' => 'smtp.example.com',
        'username' => 'your-email-username',
        'password' => 'your-email-password',
        'port' => 587,
        'secure' => 'tls',
       
        'enableBark' => false,          // Bark 通知开关
        'barkUrl' => 'https://api.day.app/XXXXXXXX', 


        'enableTG' => false,            // Telegram 通知开关
        'tgBotToken' => 'your-telegram-bot-token',
        'tgChatId' => 'your-telegram-chat-id'
    ]
];
Tag summary
Recent tags
Content type
Image
Digest
sha256:ca0c24b58…
Size
28.5 MB
Last updated
about 2 years ago
docker pull lsposed/aliyun-cdt-check:latest