diff --git a/CF-Under-Attack.sh b/CF-Under-Attack.sh deleted file mode 100644 index 42291e4..0000000 --- a/CF-Under-Attack.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -# 设置变量 -EMAIL="AAAA" -API_KEY="BBBB" -ZONE_ID="CCCC" -LOAD_THRESHOLD=5.0 # 设置高负载阈值 - -TELEGRAM_BOT_TOKEN="输入TG机器人API" -CHAT_ID="输入TG用户ID" - - -# 获取当前系统负载 -CURRENT_LOAD=$(uptime | awk -F'load average:' '{ print $2 }' | cut -d, -f1 | awk '{print $1}') - -echo "当前系统负载: $CURRENT_LOAD" - - -send_tg_notification() { - local MESSAGE=$1 - curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" -d "chat_id=$CHAT_ID" -d "text=$MESSAGE" -} - - - -# 获取当前的“Under Attack”模式状态 -STATUS=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/settings/security_level" \ - -H "X-Auth-Email: $EMAIL" \ - -H "X-Auth-Key: $API_KEY" \ - -H "Content-Type: application/json" | jq -r '.result.value') - -echo "当前的Under Attack模式状态: $STATUS" - -# 检查系统负载是否高于阈值 -if (( $(echo "$CURRENT_LOAD > $LOAD_THRESHOLD" | bc -l) )); then - if [ "$STATUS" != "under_attack" ]; then - echo "系统负载高于阈值,开启Under Attack模式" - # send_tg_notification "系统负载高于阈值,开启Under Attack模式" - NEW_STATUS="under_attack" - else - echo "系统负载高,但Under Attack模式已经开启" - exit 0 - fi -else - if [ "$STATUS" == "under_attack" ]; then - echo "系统负载低于阈值,关闭Under Attack模式" - # send_tg_notification "系统负载低于阈值,关闭Under Attack模式" - NEW_STATUS="high" - else - echo "系统负载低,Under Attack模式已经关闭" - exit 0 - fi -fi - -# 更新“Under Attack”模式状态 -RESPONSE=$(curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/settings/security_level" \ - -H "X-Auth-Email: $EMAIL" \ - -H "X-Auth-Key: $API_KEY" \ - -H "Content-Type: application/json" \ - --data "{\"value\":\"$NEW_STATUS\"}") - -if [[ $(echo $RESPONSE | jq -r '.success') == "true" ]]; then - echo "成功更新Under Attack模式状态为: $NEW_STATUS" -else - echo "更新Under Attack模式状态失败" - echo "响应: $RESPONSE" -fi diff --git a/Limiting_Shut_down.sh b/Limiting_Shut_down.sh index bda347a..20cc015 100644 --- a/Limiting_Shut_down.sh +++ b/Limiting_Shut_down.sh @@ -1,32 +1,83 @@ #!/bin/bash -# 获取总的接收和发送流量 -output=$(awk 'BEGIN { rx_total = 0; tx_total = 0 } - NR > 2 { rx_total += $2; tx_total += $10 } - END { - printf("%.0f Bytes %.0f Bytes", rx_total, tx_total); - }' /proc/net/dev) - -# 获取接收和发送的流量数据 -rx=$(echo "$output" | awk '{print $1}') -tx=$(echo "$output" | awk '{print $3}') - -# 显示当前流量使用情况 -echo "当前接收流量: $rx" -echo "当前发送流量: $tx" +PATH=/usr/sbin:/usr/bin:/sbin:/bin +# 流量阈值(单位 GB),由 kejilion.sh 菜单写入 threshold_gb=110 -# 将GB转换为字节 -threshold=$((threshold_gb * 1024 * 1024 * 1024)) - -# 检查是否达到流量阈值 -if (( $rx > $threshold || $tx > $threshold )); then - echo "流量达到${threshold},正在关闭服务器..." - # 在此处执行关闭服务器的命令,例如: - shutdown -h now - # 或者 - # systemctl poweroff +if [ ! -r /proc/net/dev ]; then + echo "无法读取 /proc/net/dev,跳过本次流量检查。" >&2 + exit 1 +fi + +# 统计外部网卡的累计收发流量(排除回环和常见容器/隧道接口) +output=$(awk 'BEGIN { rx_total = 0; tx_total = 0 } + NR > 2 { + idx = index($0, ":"); + if (idx == 0) next; + iface = substr($0, 1, idx - 1); + gsub(/[ \t]/, "", iface); + if (iface == "lo" || iface ~ /^(docker|veth|br-|virbr|tun|tap|wg|tailscale|zt)/) next; + split(substr($0, idx + 1), f, " "); + rx_total += f[1]; + tx_total += f[9]; + } + END { + printf("%.0f %.0f", rx_total, tx_total); + }' /proc/net/dev) + +# 获取接收和发送的流量数据(单位:字节) +rx=$(echo "$output" | awk '{print $1}') +tx=$(echo "$output" | awk '{print $2}') + +# 取值异常时直接退出,避免把空值带进整数比较导致误判。 +# 必须分开校验:拼接后 rx 为空、tx 非空的情况会被误判为合法。 +case "$rx" in + ''|*[!0-9]*) + echo "流量统计结果异常,跳过本次检查。" >&2 + exit 1 + ;; +esac +case "$tx" in + ''|*[!0-9]*) + echo "流量统计结果异常,跳过本次检查。" >&2 + exit 1 + ;; +esac + +# 显示当前流量使用情况 +awk -v rx="$rx" -v tx="$tx" 'BEGIN { + printf("当前接收流量: %.2f GB\n当前发送流量: %.2f GB\n", rx / 1073741824, tx / 1073741824); +}' + +# 配置可能被手动修改,执行关机前再次校验阈值 +case "$threshold_gb" in + ''|*[!0-9]*) + echo "流量阈值配置不合法: ${threshold_gb}" >&2 + exit 1 + ;; +esac +# 用整数比较而非匹配字面量 0,否则 00/000 会漏网并让阈值变成 0(每分钟关机) +if [ "$threshold_gb" -le 0 ]; then + echo "流量阈值必须大于 0: ${threshold_gb}" >&2 + exit 1 +fi + +# 任一方向达到阈值即触发。主流 VPS(Vultr/DO/Linode/Hetzner)只计出站, +# 按单向最大值判断更贴近实际配额,也与旧版行为保持一致。 +if awk -v rx="$rx" -v tx="$tx" -v threshold_gb="$threshold_gb" 'BEGIN { + threshold = threshold_gb * 1073741824; + exit !(rx >= threshold || tx >= threshold); +}'; then + echo "单向流量已达到 ${threshold_gb}GB,正在关闭服务器..." + if command -v systemctl >/dev/null 2>&1 && systemctl poweroff; then + exit 0 + fi + if command -v shutdown >/dev/null 2>&1 && shutdown -h now; then + exit 0 + fi + echo "提交关机请求失败,未找到可用命令或命令执行失败。" >&2 + exit 1 else - echo "当前流量未达到${threshold},继续监视..." + echo "当前单向流量未达到 ${threshold_gb}GB,继续监视..." fi diff --git a/PandoraNext/config.json b/PandoraNext/config.json deleted file mode 100644 index 85a307c..0000000 --- a/PandoraNext/config.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "bind": "0.0.0.0:8181", - "tls": { - "enabled": false, - "cert_file": "", - "key_file": "" - }, - "timeout": 600, - "proxy_url": "", - "license_id": "github", - "public_share": false, - "site_password": "", - "setup_password": "webgptpasswd", - "server_tokens": true, - "proxy_api_prefix": "", - "isolated_conv_title": "*", - "disable_signup": false, - "auto_conv_arkose": false, - "proxy_file_service": false, - "custom_doh_host": "", - "captcha": { - "provider": "", - "site_key": "", - "site_secret": "", - "site_login": false, - "setup_login": false, - "oai_username": false, - "oai_password": false, - "oai_signup": false - }, - "whitelist": null -} diff --git a/PandoraNext/tokens.json b/PandoraNext/tokens.json deleted file mode 100644 index 8a7428e..0000000 --- a/PandoraNext/tokens.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "test-1": { - "token": "access token / session token / refresh token", - "shared": true, - "show_user_info": false - }, - "test-2": { - "token": "access token / session token / refresh token", - "shared": true, - "show_user_info": true, - "plus": true - }, - "test2": { - "token": "access token / session token / refresh token / share token / username & password", - "password": "12345" - } -} diff --git a/README.md b/README.md index bcbf47b..ac43548 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,43 @@ # 科技lion一键脚本工具 ## 介绍 -科技Lion 的 Shell 脚本工具是一款全能脚本工具箱,专为 VPS 监控、测试和管理而设计。无论您是初学者还是经验丰富的用户,该工具都能为您提供便捷的解决方案。集成了独创的 Docker 管理功能,让您轻松管理容器化应用;LNMP建站解决方案 能帮助您快速搭建网站,站点优化,防御,备份还原迁移一应俱全;并且整合了各类系统工具面板的安装及使用,使系统维护变得更加简单。我们的目标是成为全网最优秀的 VPS 一键脚本工具,为用户提供高效、便捷的科技支持。 +科技Lion 的 Shell 脚本工具是一款面向 Debian / Ubuntu VPS 的交互式管理工具箱,聚焦系统信息与维护、网络测试与调优、SSH 安全防护、流量限额控制和 VPS 集群批量运维。无论您是初学者还是经验丰富的用户,都可以通过菜单快速执行常见服务器管理任务。 [视频介绍](https://www.youtube.com/watch?v=0o7oH3Dit70&t=211s) *** -### 科技lion一键脚本工具 的支持列表: ->Debian ->Ubuntu ->Cent OS +### 科技lion一键脚本工具的支持列表 + +> Debian +> Ubuntu + +其他 Linux 发行版不在支持范围内,脚本启动时会拒绝运行。 + *** ## 使用方法 ### Debian / Ubuntu 安装下载工具 ```bash -apt update -y && apt install -y curl -``` -### CentOS 安装下载工具 -```bash -apt update -y && apt install -y curl +apt update -y && apt install -y curl ``` *** ### 一键脚本 ```bash -curl -sS -O https://kejilion.pro/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh +curl -sS -O https://gitea.tohub.top/Share/kejilion/raw/branch/main/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh ``` -or +*** +### 下载源配置 + +脚本内通过 GitHub Raw 下载的资源默认走官方地址,脚本自身更新走本仓库 `main` 分支,均可用环境变量覆盖。部分测试工具使用其项目提供的独立域名,不受 `GITHUB_RAW_URL` 控制: + ```bash -curl -sS -O https://raw.githubusercontent.com/kejilion/sh/main/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh +# 自定义第三方脚本下载源(例如自建 GitHub 反代) +GITHUB_RAW_URL="https://your-mirror.example.com" ./kejilion.sh + +# 自定义脚本自身的更新源 +UPDATE_RAW_URL="https://gitea.tohub.top/Share/kejilion/raw/branch/main" ./kejilion.sh ``` *** ### 觉得脚本还可以USTD TRC20打赏 ![Snipaste_2024-01-17_18-01-52](https://github.com/kejilion/sh/assets/131984541/98cf2762-1bfb-4c33-af10-af0eda29fc20) - diff --git a/TG-SSH-check-notify.sh b/TG-SSH-check-notify.sh deleted file mode 100644 index bf9030b..0000000 --- a/TG-SSH-check-notify.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - - - - -# 获取登录信息 -country=$(curl -s ipinfo.io/$public_ip/country) -isp_info=$(curl -s ipinfo.io/org | sed -e 's/\"//g' | awk -F' ' '{print $2}') - -ipv4_address=$(curl -s ipv4.ip.sb) -masked_ip=$(echo $ipv4_address | awk -F'.' '{print "*."$3"."$4}') - - -IP=$(echo $SSH_CONNECTION | awk '{print $1}') -TIME=$(date +"%Y年%m月%d日 %H:%M:%S") -# 查询IP地址对应的地区信息 -#LOCATION=$(curl -s https://ipapi.co/$IP/json/ | jq -r '.city') - LOCATION=$(curl -s "http://opendata.baidu.com/api.php?query=$IP&co=&resource_id=6006&oe=utf8&format=json" | jq -r '.data[0].location') -# 获取当前用户名 - USERNAME=$(whoami) -# 发送Telegram消息 -MESSAGE="ℹ️ 登录信息: -登录机器:${isp_info}-${country}-${masked_ip} -登录名:$USERNAME -登录IP:$IP -登录时间:$TIME -登录地区:$LOCATION" - -curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" -d "chat_id=$CHAT_ID&text=$MESSAGE" > /dev/null 2>&1 \ No newline at end of file diff --git a/TG-check-notify.sh b/TG-check-notify.sh deleted file mode 100644 index 478affd..0000000 --- a/TG-check-notify.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash - -# 你需要配置Telegram Bot Token和Chat ID -TELEGRAM_BOT_TOKEN="输入TG的机器人API" -CHAT_ID="输入TG的接收通知的账号ID" - - -# 你可以修改监控阈值设置 -CPU_THRESHOLD=70 -MEMORY_THRESHOLD=70 -DISK_THRESHOLD=70 -NETWORK_THRESHOLD_GB=1000 - - - -# 获取设备信息的变量 -country=$(curl -s ipinfo.io/$public_ip/country) -isp_info=$(curl -s ipinfo.io/org | sed -e 's/\"//g' | awk -F' ' '{print $2}') - -ipv4_address=$(curl -s ipv4.ip.sb) -masked_ip=$(echo $ipv4_address | awk -F'.' '{print "*."$3"."$4}') - -# 发送Telegram通知的函数 -send_tg_notification() { - local MESSAGE=$1 - curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" -d "chat_id=$CHAT_ID" -d "text=$MESSAGE" -} - - -# 获取CPU使用率 -get_cpu_usage() { - awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else printf "%.0f\n", (($2+$4-u1) * 100 / (t-t1))}' \ - <(grep 'cpu ' /proc/stat) <(sleep 1; grep 'cpu ' /proc/stat) -} - -# 获取内存使用率 -get_memory_usage() { - free | awk '/Mem/ {printf("%.0f"), $3/$2 * 100}' -} - -# 获取硬盘使用率 -get_disk_usage() { - df / | awk 'NR==2 {print $5}' | sed 's/%//' -} - -# 获取总的接收流量(字节数) -get_rx_bytes() { - awk 'BEGIN { rx_total = 0 } - NR > 2 { rx_total += $2 } - END { - printf("%.2f", rx_total / (1024 * 1024 * 1024)); - }' /proc/net/dev -} - -# 获取总的发送流量(字节数) -get_tx_bytes() { - awk 'BEGIN { tx_total = 0 } - NR > 2 { tx_total += $10 } - END { - printf("%.2f", tx_total / (1024 * 1024 * 1024)); - }' /proc/net/dev -} - -# 检查并发送通知 -check_and_notify() { - local USAGE=$1 - local TYPE=$2 - local THRESHOLD=$3 - local CURRENT_VALUE=$4 - - if (( $(echo "$USAGE > $THRESHOLD" | bc -l) )); then - send_tg_notification "警告: ${isp_info}-${country}-${masked_ip} 的 $TYPE 使用率已达到 $USAGE%,超过阈值 $THRESHOLD%。" - fi -} - -# 主循环 -while true; do - CPU_USAGE=$(get_cpu_usage) - MEMORY_USAGE=$(get_memory_usage) - DISK_USAGE=$(get_disk_usage) - RX_GB=$(get_rx_bytes) - TX_GB=$(get_tx_bytes) - - check_and_notify $CPU_USAGE "CPU" $CPU_THRESHOLD $CPU_USAGE - check_and_notify $MEMORY_USAGE "内存" $MEMORY_THRESHOLD $MEMORY_USAGE - check_and_notify $DISK_USAGE "硬盘" $DISK_THRESHOLD $DISK_USAGE - - # 检查入站流量是否超过阈值 - if (( $(echo "$RX_GB > $NETWORK_THRESHOLD_GB" | bc -l) )); then - send_tg_notification "警告: ${isp_info}-${country}-${masked_ip} 的入站流量已达到 ${RX_GB}GB,超过阈值 ${NETWORK_THRESHOLD_GB}GB。" - fi - - # 检查出站流量是否超过阈值 - if (( $(echo "$TX_GB > $NETWORK_THRESHOLD_GB" | bc -l) )); then - send_tg_notification "警告: ${isp_info}-${country}-${masked_ip} 的出站流量已达到 ${TX_GB}GB,超过阈值 ${NETWORK_THRESHOLD_GB}GB。" - fi - - # 休眠5分钟 - sleep 300 -done diff --git a/app.md b/app.md new file mode 100644 index 0000000..ab44f52 --- /dev/null +++ b/app.md @@ -0,0 +1,95 @@ +本项目是一套面向 **Debian / Ubuntu VPS 的交互式服务器管理脚本工具箱**,核心程序是 `kejilion.sh`。当前功能聚焦于系统管理、网络测试与调优、安全防护、流量限额控制和 VPS 集群运维。 + +## 1. VPS 系统管理 + +- 查看 CPU、内存、Swap、磁盘、流量和系统负载 +- 查看操作系统、内核、主机名、IP、运营商和地理位置 +- 查看 TCP 拥塞算法、系统时间及运行时长 +- 更新系统、清理系统垃圾 +- 修改主机名、时区、DNS 和登录密码 +- 管理 Swap、用户和 sudo 权限 +- IPv4/IPv6 优先级切换 +- 查看端口占用 +- 管理 `/etc/hosts` +- 管理 Crontab 定时任务 +- 切换系统更新源(阿里云 / 官方 / 备份初始源 / 还原初始源) +- 安装 Python 指定版本(基于 pyenv) +- 重启服务器 + +> 说明:一键重装系统(dd)功能已移除。 + +## 2. 网络与 VPS 测试 + +- WARP 管理 +- ChatGPT 解锁测试 +- 流媒体解锁检测 +- IP 质量检测 +- 三网回程路由测试 +- MTR 线路测试 +- NextTrace 路由测试 +- SuperSpeed 和 i-abc 多功能测速 +- YABS 性能测试 +- Geekbench 5 CPU 测试 +- Bench 综合测试 +- 融合怪综合测评 + +## 3. 网络加速与系统调优 + +- 开启或关闭 BBR +- BBRv3/XanMod 内核管理 +- 设置 Swap +- 配置国内或国外 DNS +- 优化时区和系统软件 + +## 4. 安全防护 + +### SSH Fail2Ban + +- SSH 防暴力破解 +- 查看 SSH 封禁状态和拦截记录 +- 实时查看 Fail2Ban 日志 +- 安装或卸载 SSH 防护 + +相关配置文件:`/path/to/fail2ban/config/fail2ban/jail.d/linux-ssh.conf` + +### 账户安全 + +- 用户管理 +- 用户和密码生成 +- 登录密码管理 + +## 5. 流量限额自动关机 + +- 设置每月流量额度 +- 定期统计接收和发送流量 +- 接收或发送任意一个方向达到阈值后自动关机(多数 VPS 只计出站,按单向判断更贴近实际配额) +- 每月重新开始统计 +- 支持启用和停用 + +相关文件:`Limiting_Shut_down.sh` + +## 6. VPS 集群批量管理 + +可以维护多台服务器列表,并批量执行: + +- 安装本项目脚本 +- 更新或清理系统 +- 安装 BBR3 +- 设置 Swap 和时区 +- 开放端口 +- 执行自定义命令 +- 导入或导出服务器列表 + +--- + +总体而言,这个项目可以概括为: + +> **VPS 系统管理 + 网络测试与调优 + SSH 安全防护 + 流量限额控制 + 集群运维。** + +部分功能会在运行时从 GitHub 或第三方站点下载脚本和配置,因此实际可用性取决于外部资源以及目标 Debian / Ubuntu 版本。 + +## 下载源说明 + +- 通过 GitHub Raw 下载的第三方脚本默认走官方地址,可通过环境变量 `GITHUB_RAW_URL` 覆盖(例如自建反代);使用项目独立域名的测试工具不受该变量控制。 +- 脚本自身的更新源由环境变量 `UPDATE_RAW_URL` 控制,默认指向本仓库的 `main` 分支。 +- 已移除按地区自动切换国内镜像的逻辑(原镜像域名已失效)。 diff --git a/auto_cert_renewal-1.sh b/auto_cert_renewal-1.sh deleted file mode 100644 index bf1a90c..0000000 --- a/auto_cert_renewal-1.sh +++ /dev/null @@ -1,66 +0,0 @@ -# 定义证书存储目录 -certs_directory="/etc/letsencrypt/live/" - -days_before_expiry=5 # 设置在证书到期前几天触发续签 - -# 遍历所有证书文件 -for cert_dir in $certs_directory*; do - # 获取域名 - domain=$(basename "$cert_dir") - - # 忽略 README 目录 - if [ "$domain" = "README" ]; then - continue - fi - - # 输出正在检查的证书信息 - echo "检查证书过期日期: ${domain}" - - # 获取fullchain.pem文件路径 - cert_file="${cert_dir}/fullchain.pem" - - # 获取证书过期日期 - expiration_date=$(openssl x509 -enddate -noout -in "${cert_file}" | cut -d "=" -f 2-) - - # 输出证书过期日期 - echo "过期日期: ${expiration_date}" - - # 将日期转换为时间戳 - expiration_timestamp=$(date -d "${expiration_date}" +%s) - current_timestamp=$(date +%s) - - # 计算距离过期还有几天 - days_until_expiry=$(( ($expiration_timestamp - $current_timestamp) / 86400 )) - - # 检查是否需要续签(在满足续签条件的情况下) - if [ $days_until_expiry -le $days_before_expiry ]; then - echo "证书将在${days_before_expiry}天内过期,正在进行自动续签。" - - # 停止 Nginx - docker stop nginx - - iptables -P INPUT ACCEPT - iptables -P FORWARD ACCEPT - iptables -P OUTPUT ACCEPT - iptables -F - - ip6tables -P INPUT ACCEPT - ip6tables -P FORWARD ACCEPT - ip6tables -P OUTPUT ACCEPT - ip6tables -F - - # 续签证书 - certbot certonly --standalone -d $domain --email your@email.com --agree-tos --no-eff-email --force-renewal - - # 启动 Nginx - docker start nginx - - echo "证书已成功续签。" - else - # 若未满足续签条件,则输出证书仍然有效 - echo "证书仍然有效,距离过期还有 ${days_until_expiry} 天。" - fi - - # 输出分隔线 - echo "--------------------------" -done diff --git a/auto_cert_renewal.sh b/auto_cert_renewal.sh deleted file mode 100644 index b7198a3..0000000 --- a/auto_cert_renewal.sh +++ /dev/null @@ -1,62 +0,0 @@ -# 定义证书存储目录 -certs_directory="/home/web/certs/" -days_before_expiry=5 # 设置在证书到期前几天触发续签 - -# 遍历所有证书文件 -for cert_file in $certs_directory*_cert.pem; do - # 获取域名 - domain=$(basename "$cert_file" "_cert.pem") - - # 输出正在检查的证书信息 - echo "检查证书过期日期: ${domain}" - - # 获取证书过期日期 - expiration_date=$(openssl x509 -enddate -noout -in "${certs_directory}${domain}_cert.pem" | cut -d "=" -f 2-) - - # 输出证书过期日期 - echo "过期日期: ${expiration_date}" - - # 将日期转换为时间戳 - expiration_timestamp=$(date -d "${expiration_date}" +%s) - current_timestamp=$(date +%s) - - # 计算距离过期还有几天 - days_until_expiry=$(( ($expiration_timestamp - $current_timestamp) / 86400 )) - - # 检查是否需要续签(在满足续签条件的情况下) - if [ $days_until_expiry -le $days_before_expiry ]; then - echo "证书将在${days_before_expiry}天内过期,正在进行自动续签。" - - # 停止 Nginx - docker stop nginx - - iptables -P INPUT ACCEPT - iptables -P FORWARD ACCEPT - iptables -P OUTPUT ACCEPT - iptables -F - - ip6tables -P INPUT ACCEPT - ip6tables -P FORWARD ACCEPT - ip6tables -P OUTPUT ACCEPT - ip6tables -F - - # 续签证书 - # certbot certonly --standalone -d $domain --email your@email.com --agree-tos --no-eff-email --force-renewal - certbot certonly --standalone -d $domain --email your@email.com --agree-tos --no-eff-email --force-renewal --key-type ecdsa - - # 复制续签后的证书和私钥 - cp /etc/letsencrypt/live/$domain/fullchain.pem ${certs_directory}${domain}_cert.pem - cp /etc/letsencrypt/live/$domain/privkey.pem ${certs_directory}${domain}_key.pem - - # 启动 Nginx - docker start nginx - - echo "证书已成功续签。" - else - # 若未满足续签条件,则输出证书仍然有效 - echo "证书仍然有效,距离过期还有 ${days_until_expiry} 天。" - fi - - # 输出分隔线 - echo "--------------------------" -done diff --git a/beifen.sh b/beifen.sh deleted file mode 100644 index d54de85..0000000 --- a/beifen.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Create a tar archive of the web directory -cd /home/ && tar czvf web_$(date +"%Y%m%d%H%M%S").tar.gz web - -# Transfer the tar archive to another VPS -cd /home/ && ls -t /home/*.tar.gz | head -1 | xargs -I {} sshpass -p 123456 scp -o StrictHostKeyChecking=no -P 22 {} root@0.0.0.0:/home/ - -# Keep only 5 tar archives and delete the rest -cd /home/ && ls -t /home/*.tar.gz | tail -n +4 | xargs -I {} rm {} diff --git a/client_config b/client_config deleted file mode 100644 index 9c041b3..0000000 --- a/client_config +++ /dev/null @@ -1,54 +0,0 @@ -#在oci=begin和oci=end之间放入你的API配置信息 支持多个配置文件 机器人切换profile可更换操作配置 -oci=begin - -[DEFAULT] -user=ocid1.user.oc1..aaaaaaaaxxxxgwlg3xuzwgsaazxtzbozqq -fingerprint=b8:33:6f:xxxx:45:43:33 -tenancy=ocid1.tenancy.oc1..aaaaaaaaxxx7x7h4ya -region=ap-singapore-1 -key_file=写你的API密钥文件路径 - -[DEFAULT2] -user=ocid1.user.oc1..aaaaaaaaxxxxgwlg3xuzwgsaazxtzbozqq -fingerprint=b8:33:6f:xxxx:45:43:33 -tenancy=ocid1.tenancy.oc1..aaaaaaaaxxx7x7h4ya -region=ap-singapore-1 -key_file=写你的API密钥文件路径 - -oci=end - - - -#用户信息 从 https://t.me/radiance_helper_bot 配置(bot可使用/raninfo命令随机生成) -#必传 -username= -#必传 -password= - - -#cloudflare 功能参数 非必传 -#非必传 cloudflare邮箱 -cf_email= -#非必传 cloudflare key 在我的个人资料->API令牌处->API密钥->Global API Key 获取 -cf_account_key= - - -#非必填 本机ip和端口号 (进阶玩家选项 可填写域名) 不写将自动获取本机ip 并使用默认端口号9527 (小白用户建议不填) 如填写 格式为:https://xxx.xx:9527 -local_address= -#非必填 url名称(默认为address 可在bot上修改) -local_url_name= - -#非必填 启动模式 填写local为启动本地无公网IP模式(只要能联网即可) 不填或填其他 则启动端口模式 -model= - - - -#在azure=begin和azure=end之间放入你的azure的API配置信息 支持多个配置文件 机器人切换profile可更换操作配置 上传配置支持使用原格式({"appId":"xxx","password":"xxx"...})上传 -azure=begin - -[az001] -appId=551xxxx7-xxxx-xxxx-xxxx-b9xxxx60cc65 -password=T618Q~.LIy_xxxxx~jm~xxxxxx -tenant=xxxx3713-xxxx-4cb5-xxxx-3001060xxxxx - -azure=end \ No newline at end of file diff --git a/cloudflare.conf b/cloudflare.conf deleted file mode 100644 index 633bb83..0000000 --- a/cloudflare.conf +++ /dev/null @@ -1,88 +0,0 @@ -# -# Author: Mike Rushton -# -# IMPORTANT -# -# Please set jail.local's permission to 640 because it contains your CF API key. -# -# This action depends on curl (and optionally jq). -# Referenced from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE -# -# To get your CloudFlare API Key: https://www.cloudflare.com/a/account/my-account -# -# CloudFlare API error codes: https://www.cloudflare.com/docs/host-api.html#s4.2 - -[Definition] - -# Option: actionstart -# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false). -# Values: CMD -# -actionstart = - -# Option: actionstop -# Notes.: command executed at the stop of jail (or at the end of Fail2Ban) -# Values: CMD -# -actionstop = - -# Option: actioncheck -# Notes.: command executed once before each actionban command -# Values: CMD -# -actioncheck = - -# Option: actionban -# Notes.: command executed when banning an IP. Take care that the -# command is executed with Fail2Ban user rights. -# Tags: IP address -# number of failures -#