首页
关于我们
友链链接
壁纸下载
更多
统计中心
热点搜索
图床上传
推荐
剩余价值
磁链清理
IP定位
Search
1
[Win DD包] wes7-x86-cn-精简,安装后仅占用1.55G存储空间
25,593 阅读
2
v2rayN基础使用教程、配置说明、添加订阅、路由选择
10,972 阅读
3
保姆级教程!甲骨文ARM DD成Debian10并升级内核成5.10
6,247 阅读
4
N1教程:Openwrt安装docker webui界面(基于flippy openwrt n1固件)
5,314 阅读
5
鸿蒙Next也能科学上网?Clash Meta for harmorny next os
5,217 阅读
Linux学堂
网站建设
网络资源
主题插件
固件工具
主机评测
MV频道
登录
Search
标签搜索
vps
typecho
linux
bench
mysql
cloudflare
nginx
lnmp
ssl
empirecms
openwrt
google
centos
docker
n1
301
qbittorrent
telegram
free
onedrive
V+变量
累计撰写
291
篇文章
累计收到
220
条评论
首页
栏目
Linux学堂
网站建设
网络资源
主题插件
固件工具
主机评测
MV频道
页面
关于我们
友链链接
壁纸下载
统计中心
热点搜索
图床上传
推荐
剩余价值
磁链清理
IP定位
搜索到
291
篇与
的结果
2024-11-30
解决 nginx报错: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /usr/local/nginx/conf/vhost/xxx.com.conf:18
在 1.25.1 版本后的 nginx 运行日志中,可能会发现以下警告信息: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /usr/local/nginx/conf/vhost/xxx.com.conf:18原配置:listen 443 ssl http2;修改配置为:`listen 443 ssl;http2 on;`重启 nginx 即可。参考:https://github.com/nginxinc/kubernetes-ingress/issues/4237
2024年11月30日
53 阅读
0 评论
0 点赞
2024-11-29
sing-box 基础教程:sing-box 的配置方法和使用教程
sing-box 是什么sing-box 是新一代超强通用代理工具,对标 ray core 与 clash,而且它的性能以及支持的协议类型已经超过了 ray core 与 clash。目前支持以下协议:入站:Shadowsocks(including shadowsocks2022) Vmess Trojan Naive Hysteria ShadowTLS Vless Tuic Tun Redirect TProxy Socks HTTP出站:Shadowsocks(including shadowsocks2022) Vmess Trojan Wireguard Hysteria ShadowTLS ShadowsocksR VLESS Tuic Hysteria2 Tor SSH DNS关于如何在VPS安装Singbox服务器端可以查阅之前教程:233boy sing-box 一键安装脚本除了命令行客户端以外,还提供了图形界面客户端,图形界面支持 Android、iOS、macOS 以及 Apple tvOS,Windows 暂时不支持,还在施工中 这简直就是魔法上网界的瑞士军刀啊!而且所有的客户端都是免费的,iOS 端也不用再买 Shadowrocket 小火箭等付费 App 了。再看看隔壁 Surge 的价格,你玩我呢??还是 sing-box 香。本文将会手把手教大家如何使用 sing-box 来实现任意机器的全局透明代理。sing-box 客户端下载第一步先解决客户端下载的问题。AndroidAndroid 客户端可以到 Play Store 中去下载,也可以直接到 GitHub Releases 页面下载。如果你是 Android 的 Magisk/KernelSU 玩家,可以选择刷入 box_for_magisk模块。Apple 平台iOS/macOS/Apple tvOS 用户可以到 App Store 中下载(前提是你得有个美区 ID),也可以使用 Homebrew 直接安装:$ brew install sfm除此之外你也可以直接到 GitHub Releases 页面下载客户端或者命令行版本。WindowsWindows 没有图形界面客户端,官方还正在开发中,不过可以直接使用包管理器 Sccop 或者 Chocolatey 安装命令行版本:# Sccop $ scoop install sing-box # Chocolatey $ choco install sing-box你也可以选择第三方开发者开发的图形界面客户端: GUI.for.SingBox还有一个更加成熟的第三方客户端: Hiddify-NextLinuxLinux 就很简单了,直接到 GitHub Releases 页面下载命令行版本即可。sing-box 配置解析sing-box 的核心就是它的配置,所有的配置都在一个 JSON 文件里,每个配置参数的含义可参考 sing-box 官方文档。但是为了能够快速使用起来,我们需要一个示例模板。没问题,我这就给你一个比较完美的透明代理模板:sing-box 透明代理示例模板下面我来给大家解析一下里面的配置,首先来看 DNS 部分。如果你嫌下面的解析太长不看,那就直接使用我的示例模板配置好了。DNS 配置sing-box 对 DNS 的处理比 Clash 强太多了,支持各种分流规则,结构如下:{ "dns": { "servers": [], "rules": [], "final": "", "strategy": "", "disable_cache": false, "disable_expire": false, "independent_cache": false, "reverse_mapping": false, "fakeip": {} } }其中 servers 定义了 DNS 服务器,具体参数含义我就不解释了,自己看官方文档。我给出的 DNS 服务器配置是:{ "dns": { "servers": [ { "tag": "dns_proxy", "address": "https://1.1.1.1/dns-query", "address_resolver": "dns_resolver", "strategy": "ipv4_only", "detour": "select" }, { "tag": "dns_direct", "address": "h3://dns.alidns.com/dns-query", "address_resolver": "dns_resolver", "strategy": "ipv4_only", "detour": "direct" }, { "tag": "dns_block", "address": "rcode://refused" }, { "tag": "dns_resolver", "address": "223.5.5.5", "strategy": "ipv4_only", "detour": "direct" } ] } }这里定义了 3 个 DNS 服务器,当你发起一个域名解析请求时,这些服务器会被用来查找对应的 IP 地址。同时还定义了一个 RCode 协议用来屏蔽请求。rules 定义了 DNS 规则,这些规则用于定义哪些域名应该使用哪个 DNS 服务器解析。它可以让你根据域名的特定模式选择不同的 DNS 服务器。DNS 规则如下:{ "dns": { "rules": [ { "outbound": "any", "server": "dns_resolver" // 注释:对于任何出站连接(不管是直接连接还是通过代理),使用 "dns_resolver" 服务器进行 DNS 解析(这一句主要用来解析代理节点本身的 IP 地址)。 }, { "clash_mode": "direct", "server": "dns_direct" // 注释:在直连模式(不经过代理)下,使用 "dns_direct" 服务器进行 DNS 解析。 }, { "clash_mode": "global", "server": "dns_proxy" // 注释:在全局代理模式下,使用 "dns_proxy" 服务器进行 DNS 解析。 }, { "process_name": [ "TencentMeeting", "NemoDesktop", "ToDesk", "ToDesk_Service", "WeChat", "Tailscale", "wireguard-go", "Tunnelblick", "softwareupdated", "kubectl" ], "server": "dns_direct" // 注释:当特定的进程(如 TencentMeeting、WeChat 等)发起 DNS 请求时,使用 "dns_direct" 服务器进行直连 DNS 解析。 }, { "domain_suffix": [ "icloudnative.io", "fuckcloudnative.io", "sealos.io", "cdn.jsdelivr.net" ], "server": "dns_direct" // 注释:对于特定后缀的域名(如 icloudnative.io 等),使用 "dns_direct" 服务器进行直连 DNS 解析。 }, { "process_name": ["DropboxMacUpdate", "Dropbox"], "server": "dns_proxy" // 注释:当 Dropbox 相关进程发起 DNS 请求时,使用 "dns_proxy" 服务器通过代理进行 DNS 解析。 }, { "package_name": [ "com.google.android.youtube", "com.android.vending", "org.telegram.messenger", "org.telegram.plus" ], "server": "dns_proxy" // 注释:对于特定的 Android 应用包名(如 YouTube、Telegram 等),使用 "dns_proxy" 服务器通过代理进行 DNS 解析。 }, { "rule_set": "geosite-geolocation-!cn", "server": "dns_proxy" // 注释:对于 geosite 数据库中定义的非中国地区的地理位置相关的域名,使用 "dns_proxy" 服务器通过代理进行 DNS 解析。 }, { "rule_set": "Global", "server": "dns_proxy" // 注释:对于定义在 "Global" 规则集中的域名,使用 "dns_proxy" 服务器通过代理进行 DNS 解析。 }, { "rule_set": [ "YouTube", "Telegram", "Netflix", "geoip-google", "geoip-telegram", "geoip-twitter", "geoip-netflix" ], "server": "dns_proxy" // 注释:对于特定的服务和地理位置相关的域名(如 YouTube、Netflix、谷歌、Telegram 相关的域名),使用 "dns_proxy" 服务器通过代理进行 DNS 解析。 } ], "final": "dns_direct" // 注释:如果上述规则都不适用,则默认使用 "dns_direct" 服务器进行直连 DNS 解析。 } }入站配置接下来比较重要的就是入站规则了,入站(Inbound)在网络领域,特别是在代理和网络路由配置中,通常指的是进入某个系统或网络的数据流。在 sing-box 中,入站配置定义了如何处理进入代理服务器的数据。入站配置示例如下:{ "inbounds": [ { "type": "tun", "inet4_address": "198.18.0.1/16", "auto_route": true, "exclude_package": [ "cmb.pb", "cn.gov.pbc.dcep", "com.MobileTicket", "com.adguard.android", "com.ainemo.dragoon", "com.alibaba.android.rimet", "com.alicloud.databox", "com.amazing.cloudisk.tv", "com.autonavi.minimap", "com.bilibili.app.in", "com.bishua666.luxxx1", "com.cainiao.wireless", "com.chebada", "com.chinamworld.main", "com.cmbchina.ccd.pluto.cmbActivity", "com.coolapk.market", "com.ctrip.ct", "com.dianping.v1", "com.douban.frodo", "com.eg.android.AlipayGphone", "com.farplace.qingzhuo", "com.hanweb.android.zhejiang.activity", "com.leoao.fitness", "com.lucinhu.bili_you", "com.mikrotik.android.tikapp", "com.moji.mjweather", "com.motorola.cn.calendar", "com.motorola.cn.lrhealth", "com.netease.cloudmusic", "com.sankuai.meituan", "com.sina.weibo", "com.smartisan.notes", "com.sohu.inputmethod.sogou.moto", "com.sonelli.juicessh", "com.ss.android.article.news", "com.ss.android.lark", "com.ss.android.ugc.aweme", "com.tailscale.ipn", "com.taobao.idlefish", "com.taobao.taobao", "com.tencent.mm", "com.tencent.mp", "com.tencent.soter.soterserver", "com.tencent.wemeet.app", "com.tencent.weread", "com.tencent.wework", "com.ttxapps.wifiadb", "com.unionpay", "com.unnoo.quan", "com.wireguard.android", "com.xingin.xhs", "com.xunmeng.pinduoduo", "com.zui.zhealthy", "ctrip.android.view", "io.kubenav.kubenav", "org.geekbang.geekTime", "tv.danmaku.bili" ], "stack": "mixed", "sniff": true }, { "type": "socks", "tag": "socks-in", "listen": "::", "listen_port": 5353 } ] }下面是对每个字段的详细注释:第一个入站连接的配置:type: "tun" 表示这是一个 tun 虚拟网络接口的配置。 inet4_address: "198.18.0.1/16" 设定了虚拟网络接口的 IPv4 地址和子网掩码。 auto_route: true 表示将自动处理路由,确保数据包正确传输。 exclude_package: 这是一个数组,包含了不通过此虚拟网络接口处理的 Android 应用程序包名列表。列出的 Android 应用程序将使用常规网络接口而不是虚拟接口。 stack: "mixed" 表示混合 system TCP 栈与 gvisor UDP 栈。 sniff: true 表示启用流量嗅探功能,以便自动检测和处理传入的数据流类型。第二个入站连接的配置:type: "socks" 表示这是一个 SOCKS 代理配置。 tag: "socks-in" 为这个入站连接定义了一个标签,方便在其它配置中引用。 listen: "::" 表示监听所有 IPv6 地址。如果需要监听所有 IPv4 地址,可以使用 "0.0.0.0"。 listen_port: 5353 定义了 SOCKS 代理监听的端口号。 其中 tun 接口是核心部分,我们将利用 tun 接口来实现全局透明代理。出站配置出站(Outbound)是指从本地网络或设备发出,向外部网络、服务或互联网发送的数据流量。示例出站配置如下:{ "outbounds": [ { "type": "selector", // 类型为选择器,用于在多个出站中选择一个 "tag": "select", // 标签名为 "select" "outbounds": [ "trojan-out" // 可选择的出站列表,这里只有 "trojan-out" ], "default": "trojan-out" // 默认选择的出站为 "trojan-out" }, { "type": "selector", // 同样是选择器类型 "tag": "openai", // 标签名为 "openai" "outbounds": [ "trojan-out" // 可选择的出站仍然是 "trojan-out" ], "default": "trojan-out" // 默认选择的出站同样是 "trojan-out" }, { "type": "selector", // 选择器类型 "tag": "tiktok", // 标签名为 "tiktok" "outbounds": [ "trojan-out" // 可选择的出站是 "trojan-out" ], "default": "trojan-out" // 默认选择的出站为 "trojan-out" }, { "type": "trojan", // 类型为 Trojan "tag": "trojan-out", // 标签名为 "trojan-out" "server": "xxxxxxxx", // Trojan 服务器地址 "server_port": 9443, // Trojan 服务器端口 "password": "xxxxxxxx", // Trojan 连接密码 "tls": { "enabled": true, // 启用 TLS 加密 "server_name": "xxxxxxxx", // TLS 服务器名称 "insecure": true, // 不验证 TLS 证书,用于自签名证书 "utls": { "fingerprint": "chrome" // 使用 Chrome 的 TLS 指纹 } }, "multiplex": { "protocol": "h2mux", // 使用 h2mux 多路复用协议 "max_connections": 4, // 最大连接数为 4 "min_streams": 4 // 每个连接的最小流数为 4 }, "transport": { "type": "grpc", // 传输协议为 gRPC "service_name": "TunService" // gRPC 服务名称 } }, { "type": "direct", // 直连类型,不通过代理直接访问 "tag": "direct" // 标签名为 "direct" }, { "type": "block", // 阻止类型,用于拦截流量 "tag": "block" // 标签名为 "block" }, { "type": "dns", // DNS 类型,用于 DNS 查询 "tag": "dns-out" // 标签名为 "dns-out" } ] }这个配置定义了不同类型的出站连接方式,包括选择器、Trojan、直连、阻止和 DNS 类型。每种类型都通过标签进行标识,便于在后续的路由规则中引用。路由配置路由部分才是 sing-box 的核心配置,这个部分定义了一系列规则和参数,用于决定如何处理不同的网络请求。通过这些规则和参数,sing-box 可以非常灵活地处理复杂的路由需求,包括基于地理位置、IP 地址、端口号、域名等多种条件的流量分流。配置结构如下:{ "route": { "rules": [], "rule_set": [], "final": "direct", // "final" 字段定义了默认的路由行为。这里设置为 "direct",意味着如果没有匹配任何规则,流量将直接(不经代理)发送。 "auto_detect_interface": true // 表示自动检测网络接口。这有助于自动适应网络变化,确保路由正确。 } }其中的核心配置:路由规则 (rules): 这些规则定义了如何根据不同的条件将流量定向到不同的出站连接。每个规则可以包括多个条件,如域名、IP 地址、端口号、网络协议等。规则集 (rule_set): 从 sing-box 1.8.0 版本开始,规则可以组合成规则集,这使得配置更加灵活和模块化。路由规则以下是我给出的路由规则示例:{ "route": { "rules": [ { "protocol": "dns", // 使用DNS协议的流量 "outbound": "dns-out" // 将通过'dns-out'出口转发 }, { "clash_mode": "direct", // Clash模式为直连 "outbound": "direct" // 将通过'direct'出口直接连接 }, { "clash_mode": "global", // Clash模式为全局 "outbound": "select" // 将通过'select'出口选择转发 }, { "domain_suffix": [ // 特定后缀的域名 "icloudnative.io", "fuckcloudnative.io", "sealos.io", "cdn.jsdelivr.net" ], "outbound": "direct" // 将通过'direct'出口直接连接 }, { "process_name": [ // 特定进程名称 "TencentMeeting", "NemoDesktop", ... ], "outbound": "direct" // 将通过'direct'出口直接连接 }, { "rule_set": [ // 特定的规则集 "WeChat", "Bilibili" ], "outbound": "direct" // 将通过'direct'出口直接连接 }, { "protocol": "quic", // 使用QUIC协议的流量 "outbound": "block" // 将被阻止 }, { "inbound": "socks-in", // 来自'socks-in'入口的流量 "outbound": "select" // 将通过'select'出口选择转发 }, { "rule_set": "OpenAI", // OpenAI规则集 "outbound": "openai" // 将通过'openai'出口转发 }, { "domain_suffix": [ // OpenAI相关的域名后缀 "openai.com", "oaistatic.com", "oaiusercontent.com" ], "outbound": "openai" // 将通过'openai'出口转发 }, { "package_name": "com.openai.chatgpt", // OpenAI ChatGPT应用包名 "outbound": "openai" // 将通过'openai'出口转发 }, { "rule_set": "TikTok", // TikTok规则集 "outbound": "tiktok" // 将通过'tiktok'出口转发 }, { "package_name": "com.zhiliaoapp.musically", // TikTok应用包名 "outbound": "tiktok" // 将通过'tiktok'出口转发 }, { "domain_suffix": [ // 特定的域名后缀 "depay.one", "orbstack.dev" ], "outbound": "select" // 将通过'select'出口选择转发 }, { "process_name": [ // 特定的进程名称 "DropboxMacUpdate", "Dropbox" ], "outbound": "select" // 将通过'select'出口选择转发 }, { "package_name": [ // 特定应用包名 "com.google.android.youtube", ... ], "outbound": "select" // 将通过'select'出口选择转发 }, { "domain": "accounts.google.com", // 特定的域名 "domain_suffix": [ // 特定的域名后缀 "sourceforge.net", "fhjasokiwq.com" ], "outbound": "select" // 将通过'select'出口选择转发 }, { "domain_suffix": "cloud.sealos.io", // 特定的域名后缀 "outbound": "direct" // 将通过'direct'出口直接连接 }, { "type": "logical", // 逻辑类型规则 "mode": "and", // 使用'and'模式 "rules": [ // 组合规则 { "rule_set": "geosite-geolocation-!cn" }, { "rule_set": "geoip-cn", "invert": true } ], "outbound": "select" // 将通过'select'出口选择转发 }, { "rule_set": "Global", // Global规则集 "outbound": "select" // 将通过'select'出口选择转发 }, { "rule_set": "geoip-cn", // 中国地理位置IP规则集 "outbound": "direct" // 将通过'direct'出口直接连接 }, { "ip_is_private": true, // 私有IP地址 "outbound": "direct" // 将通过'direct'出口直接连接 }, { "rule_set": [ // 特定的规则集 "YouTube", "Telegram", "Netflix", "geoip-google", "geoip-telegram", "geoip-twitter", "geoip-netflix" ], "outbound": "select" // 将通过'select'出口选择转发 } ] } }这个配置定义了不同类型的流量(如基于协议、域名后缀、应用包名、进程名称等)如何被路由。每条规则都指定了一种流量类型和相应的“出口”,即流量应该如何被处理或转发。这种灵活的路由配置可以非常精确地控制网络流量。规则集以下是我给出的规则集示例:{ "route": { "rule_set": [ { "type": "remote", "tag": "geosite-geolocation-!cn", "format": "binary", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs", "download_detour": "direct" }, { "type": "remote", "tag": "geoip-cn", "format": "binary", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/CHIZI-0618/v2ray-rules-dat/release/singbox_ip_rule_set/geoip-cn.srs", "download_detour": "direct" }, { "type": "remote", "tag": "geoip-google", "format": "binary", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/CHIZI-0618/v2ray-rules-dat/release/singbox_ip_rule_set/geoip-google.srs", "download_detour": "direct" }, { "type": "remote", "tag": "geoip-telegram", "format": "binary", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/CHIZI-0618/v2ray-rules-dat/release/singbox_ip_rule_set/geoip-telegram.srs", "download_detour": "direct" }, { "type": "remote", "tag": "geoip-twitter", "format": "binary", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/CHIZI-0618/v2ray-rules-dat/release/singbox_ip_rule_set/geoip-twitter.srs", "download_detour": "direct" }, { "type": "remote", "tag": "geoip-netflix", "format": "binary", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/CHIZI-0618/v2ray-rules-dat/release/singbox_ip_rule_set/geoip-netflix.srs", "download_detour": "direct" }, { "type": "remote", "tag": "Global", "format": "source", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/yangchuansheng/sing-box-geosite/main/rule/Global.json", "download_detour": "direct" }, { "type": "remote", "tag": "YouTube", "format": "source", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/yangchuansheng/sing-box-geosite/main/rule/YouTube.json", "download_detour": "direct" }, { "type": "remote", "tag": "OpenAI", "format": "source", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/yangchuansheng/sing-box-geosite/main/rule/OpenAI.json", "download_detour": "direct" }, { "type": "remote", "tag": "TikTok", "format": "source", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/yangchuansheng/sing-box-geosite/main/rule/TikTok.json", "download_detour": "direct" }, { "type": "remote", "tag": "Telegram", "format": "source", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/yangchuansheng/sing-box-geosite/main/rule/Telegram.json", "download_detour": "direct" }, { "type": "remote", "tag": "Netflix", "format": "source", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/yangchuansheng/sing-box-geosite/main/rule/Netflix.json", "download_detour": "direct" }, { "type": "remote", "tag": "WeChat", "format": "source", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/yangchuansheng/sing-box-geosite/main/rule/WeChat.json", "download_detour": "direct" }, { "type": "remote", "tag": "Bilibili", "format": "source", "url": "https://mirror.ghproxy.com/https://raw.githubusercontent.com/yangchuansheng/sing-box-geosite/main/rule/Bilibili.json", "download_detour": "direct" } ] } }这里有两种不同类型的规则集,一种是 binary,另外一种是 source。binary 规则集一般都是利用 GEOSITE 或者 GEOIP 直接编译好的二进制规则,它们被直接嵌入到应用程序中。而 source 规则集就和 Clash 的 ruleset 比较类似,它是一个文本文件,而不是二进制。目前已经有相关项目可以自动将网络上的 Clash Ruleset 规则自动转换为 sing-box 的 source 规则集,感兴趣的同学可以参考这个项目: sing-box-geositeClash API最后的实验性配置用来开启 Clash API。没错,sing-box 是兼容 Clash API 滴!那么我们就可以使用 Clash 的 dashboard 来管理 sing-box 了,直接用这个项目好了: metacubexd示例配置如下:{ "experimental": { "cache_file": { "enabled": true // 启用缓存文件功能。当此项设置为true时,启用 DNS 查询的缓存,以便加快后续相同查询的响应速度。 }, "clash_api": { "external_controller": "0.0.0.0:9090", // 定义 Clash API 的外部控制器地址。"0.0.0.0:9090" 表示在本机的9090端口上监听外部的连接请求。 "external_ui": "metacubexd", // 指定外部用户界面(UI)的名称。这里的 "metacubexd" 是一个自定义 UI 的名称。 "external_ui_download_url": "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip", // 提供外部 UI 的下载 URL。这个 URL 是从 GitHub 上下载 "metacubexd" UI 的压缩包。 "external_ui_download_detour": "select", // 定义下载外部 UI 时使用的转发策略。"select" 表示将通过'select'出口选择转发 "default_mode": "rule" // 设置 Clash API 的默认模式。"rule" 模式意味着流量将根据用户定义的规则进行路由。 } } }最终启动 sing-box 之后就可以通过 Clash dashboard 来查看和管理流量啦:注意: 图形界面客户端会自动把外部控制器相关的配置给屏蔽掉,如果你想使用 Dashboard,只能使用命令行来启动 sing-box。订阅转换我想大部分小伙伴使用的还是订阅链接,不可能傻乎乎的自己写配置和规则。但是目前大部分ji场都不提供 sing-box 的配置格式,仅有少量ji场提供支持,其他ji场可使用下面这个项目将常见订阅转换为 sing-box 订阅格式: sing-box-subscribe你可以将这个项目部署到自己的 Vercel 中,然后使用以下的链接格式来将常见订阅转换为 sing-box 订阅格式:<URL>/url=<subscription_url>/&file=<sing-box_template_url> <URL>:这是你的 sing-box-subscribe 访问链接; <subscription_url>:这是你的订阅链接; <sing-box_template_url>:这是你的 sing-box 模板配置链接,你可以直接使用 我的模板。例如:https://sing-box-subscribe.vercel.app/config/url=https://xxxxxx?clash=1/&file=https://gist.githubusercontent.com/yangchuansheng/5182974442015feeeeb058de543a00fd/raw/45b11ff08188af021da98e7174923d719dc42dd9/gistfile1.txt如果你有多个订阅链接,需要先将订阅链接合并为一个链接,然后再进行转换,具体看参考 sing-box-subscribe 的官方文档。更多配置示例更多的配置示例可以参考这个项目: sing-box-examples这个项目针对每一个代理协议都提供了详细的配置示例,还有很多的骚操作,比如 将 Cloudflare 的 Warp 节点信息直接提取出来加到 sing-box 出站配置中去,妙啊!透明网关如果你想让局域网中的所有机器都能够根据规则智能分流,那就在局域网中找一台机器作为透明网关,在这台机器上运行一个 sing-box 就行了,不需要像 Clash 一样写什么乱七八糟的 iptables 规则,直接一个配置文件就行了,非常简单。通常我们使用软路由来完成这个任务,如果你不想使用软路由,那随便找一台机器就行了,当然最好还是使用 Linux 比较靠谱。在网关上运行 sing-box 之后,其他机器只需要将网关指向这台机器,便可以无痛开启魔法智能分流了。注意: 其他机器的 DNS 必须是公网 DNS,不能使用内网 DNS!你的 DNS 可以指向任意的公网 DNS,反正只要是公网就行,比如:114.114.114.114,因为 sing-box 会劫持局域网中的所有 DNS 请求。当然,如果你不想让 sing-box 劫持局域网中的所有 DNS 请求,可以使用如下的方案:首先在入站配置中添加一个监听端口:{ "inbounds": [ { "type": "direct", "tag": "dns-in", "listen": "0.0.0.0", "listen_port": 53 } ] }然后在路由规则中将 DNS 的规则改成如下的配置: { "route": { "rules": [ { "inbound": "dns-in", "outbound": "dns-out" } ] } }这样就保证了只有从 53 端口进来的流量才会进入 DNS 解析。重启生效后,将其他机器的网关和 DNS 均指向这台机器就可以了。如果你使用的是 DHCP,只需要在 DHCP 服务器中将 DHCP 分配的网关和 DNS 改成 sing-box 所在的机器 IP 即可。
2024年11月29日
1,142 阅读
1 评论
0 点赞
2024-11-29
Nginx反向代理教程
最近趁着黑五买了一个大盘鸡,但是直接访问速度很慢,于是决定利用快速访问的小鸡来反代比较好,网上找了半天,下面的代码好用。 location / { proxy_pass https://www.xboy.uk:80; # 后端服务器的地址 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # 可选:处理WebSocket(如果需要) proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # 可选:设置超时时间 proxy_read_timeout 60s; proxy_connect_timeout 60s; proxy_send_timeout 60s; }
2024年11月29日
108 阅读
17 评论
0 点赞
2024-11-29
LNMP添加ssl证书不成功的问题
最近重新做网站,结果发现SSL创建失败,经排查发现是LNMP带的创建SSL脚本acme.sh更换了证书提供商,从LETS encrypt 改为ZEROssl,查询教程,最终解决了该问题,整理如下。注意:由于v3,acme.sh使用 Zerossl 作为默认证书颁发机构 (CA)。需要先注册账户(一次性),然后才能颁发新证书。另请参阅: https: //github.com/acmesh-official/acme.sh/wiki/Change-default-CA-to-ZeroSSL1.注册您的账户。1a. 使用电子邮件地址acme.sh --register-account -m
[email protected]
--server zerossl1b. 持有 EAB 凭证或者,如果您注册了一个ZeroSSL 帐户,acme.sh请使用外部帐户绑定(EAB)凭据进行引导,如下所示:从https://app.zerossl.com/developer生成您的 EAB 凭证注册您的 EAB 凭证。acme.sh --register-account --server zerossl \ --eab-kid xxxxxxxxxxxx \ --eab-hmac-key xxxxxxxxx拥有 ZeroSSL 账户的用户可以从开发者控制台管理颁发的证书。2.颁发证书使用 Zerossl.com 进行以下操作--server zerossl:acme.sh --server zerossl \ --issue -d example.com \ --dns dns_cf如果不想--server zerossl每次颁发证书时都指定,可以设置zerossl为默认CA:acme.sh --set-default-ca --server zerossl阅读:https ://github.com/acmesh-official/acme.sh/wiki/Server从zerossl颁发任何证书,无需指定--server:acme.sh --issue -d example.com --dns dns_cf故障排除Le_OrderFinalize:必须指定 KeyID如果证书颁发失败,并且您在日志中看到类似这样的内容[XYZ 18 09:50:07 -02 2020] Create new order error. Le_OrderFinalize not found. {"type":"urn:ietf:params:acme:error:malformed","status":400,"detail":"A Key ID MUST be specified"}然后,重新生成您的 EAB 凭证(参考步骤 2)并重新运行证书颁发。请参阅:acme.sh/issues/3310。
2024年11月29日
88 阅读
0 评论
0 点赞
2021-06-25
ZFAKA小店Docker版之 数据的备份和迁移
ZFAKA 程序因为要使用 MYSQL,对VPS还是有一定要求,至少1H1G才能跑,官方推荐是 2H2G。所以之前也只是在本地群晖上搞了Debian学习设置玩下。这次购买了 6.18元的阿里云MYSQL,准备里折腾玩一下,零成本把 ZFAKA 放到网上折腾一下ZFAKA小店Docker版之 数据的备份和迁移使用 HeidiSQL 远程连接 mysql 如图运行 sql 就可以方便恢复原来的数据了阿里云的 mysql 说做任务送20优惠券,也不知道送到哪里了修改数据库链接配置 vim code/conf/application.ini如图修改,停掉本地的MYSQL服务,测试阿里云SQL连接正常
2021年06月25日
5,195 阅读
4 评论
0 点赞
2021-05-31
保姆级教程!甲骨文ARM DD成Debian10并升级内核成5.10
香喷喷的4核24G 100G。Debian10系统,内核版本5.10分享一下操作流程,希望能够对mjj们有所帮助~安装Debian 10参考:https://www.vvars.com/package-tool/Oracle-oracle-ARM-reinstall-Debian-10.html新建实例时选的 ubuntu 20.4,非 mini 版用到的脚本来自https://github.com/bohanyang/debiDownloadDownload the script with curl:curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.shchmod a+rx debi.shsudo ./debi.sh --architecture arm64 --user root --password password设置默认root的密码为password,登陆成功之后记得自己输入passwd修改密码!!!没报错的话继续运行:sudo shutdown -r now更新内核至5.10 参考:https://p3terx.com/archives/debian-linux-vps-server-wireguard-installation-tutorial.html1、添加 backports 源echo "deb http://deb.debian.org/debian $(lsb_release -sc)-backports main" | sudo tee /etc/apt/sources.list.d/backports.listsudo apt updateuname -r此时看到的版本应该是4.19的,为了之后安装warp方便,我们可以更新内核到新版,5.6以上就自带了wireguard了,现在最新的是5.10sudo apt -t $(lsb_release -sc)-backports install linux-image-$(dpkg --print-architecture) linux-headers-$(dpkg --print-architecture) --install-recommends -y安装完重启,执行 uname -r 命令,现在已经是5.10了。PS:1、安装宝塔面板,nginx和php可以选择编译安装,我一键安装会报错;2、wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/armbox.sh && chmod +x box.sh && clear && ./box.shARM适配的一些脚本,来源https://t.me/blueskyxnblog3、Mac用户可以不用putty,用更简单的方法来登陆甲骨文,参考:https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/accessinginstance.htm
2021年05月31日
6,247 阅读
0 评论
1 点赞
2021-05-31
甲骨文oracle ARM 重装 Debian 10
用到的脚本来自https://github.com/bohanyang/debiDownloadDownload the script with curl:curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.shfor IPv6-only machinescurl -fLO --resolve 'raw.githubusercontent.com:443:2a04:4e42::133' https://raw.githubusercontent.com/bohanyang/debi/master/debi.shRunRun the script under root or using sudo:chmod a+rx debi.shsudo ./debi.sh --architecture arm64RebootIf everything looks good, reboot the machine:sudo shutdown -r now实测成功,新建实例时选的 ubuntu 20.4,非 mini 版
2021年05月31日
4,731 阅读
0 评论
1 点赞
2021-05-23
Linux部署轻量级网盘Filebrowser简明教程
FileBrowser 文件浏览器,是一个能管理手机本地、局域网共享、FTP和蓝牙文件的管理器,可以作为轻量级网盘使用。经过一番折腾,终于解决filebrowser的安装,记录如下:(1)安装Filebrowser程序curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash(2)创建配置数据库:filebrowser -d /etc/filemanager/filebrowser.db config init(3)设置监听地址:filebrowser -d /etc/filemanager/filebrowser.db config set --address 0.0.0.0 (这个地方可以改成自己服务器地址如172.x.x.x)(4)设置监听端口:filebrowser -d /etc/filemanager/filebrowser.db config set --port 8082 (端口配置的时候,首先查询一下端口是否被占用,使用一个没有被占用的端口)(5)设置语言环境:filebrowser -d /etc/filemanager/filebrowser.db config set --locale zh-cn (不设置的话直接默认英文,当然也可以先不设置,待所有配置好后登陆系统之后再进行语言修改)(6)设置默认目录filebrowser -d /etc/filemanager/filebrowser.db config set --root /home/wwwroot(7)设置日志位置:filebrowser -d /etc/filemanager/filebrowser.db config set --log /var/log/filebrowser.log(8)添加一个用户:filebrowser -d /etc/filemanager/filebrowser.db users add root password --perm.admin,其中的root和password分别是用户名和密码,根据自己的需求更改。(9)设置后台运行nohup filebrowser -d /etc/filemanager/filebrowser.db > /dev/null 2>&1至此大功告成了。下面的方法适用于偷懒的,即不创建数据库只想登录一次或者每次运行的#制定可以访问的IP和端口号 filebrowser -a 0.0.0.0 -r /home/wwwroot -p 8082
2021年05月23日
4,213 阅读
0 评论
0 点赞
2021-05-22
Linux下cp -rf总是提示覆盖的解决办法
通常情况下使用cp -rf进行文件或者文件夹的管理时一般就不再提醒是否覆盖。然而在内网的一台机器上使用cp -rf却提示是否覆盖。难道和常用的命令不同?后来发现是别名引起的问题。[root@xxxx test]# alias alias cp='cp -i' alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias grep='grep --color=auto' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias mv='mv -i' alias rm='rm -i' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'发现每次执行cp命令,其实是执行了cp -i命令的别名,因此无论怎么输入都提示是否覆盖。方法一、修改~/.bashrc,在“alias cp='cp -i'”前添加#号注释后即可。[root@xxxx test]# vi ~/.bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' #alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi让命令生效:source ~/.bashrc方法二、直接用源命令 /bin/cp -rf /home/wwwroot/Backup/Download/* /home/wwwroot/sharepoint/Downloads
2021年05月22日
3,755 阅读
0 评论
0 点赞
2021-05-14
[Win DD包] wes7-x86-cn-精简,安装后仅占用1.55G存储空间
系统配置要求系统极限配置:CPU => 1核内存 => 256M硬盘 => 2G系统建议配置:CPU => 1核——以上内存 => 512M——以上硬盘 => 5G——以上自述镜像: 采用Windows Embedded Standard 7原版母盘封装制作 Windows 嵌入式 标准 7 Standard 7 SP1 32bit IBW.iso SHA1:828311930602A92278E6857AE5CF1338C021AD09 使用Standard 7 SP1 Toolkit.iso Image Configuration Editor 以最小组件定制 ----------------------------------------------- DD文件: wes7-x86-cn-lite.vhd.gz 大小: (543MB)569916428 字节 修改时间: 2021年5月11日, 18:52:14 MD5: 134AA6AC009E17DABE1658E1F2CE49B8 SHA1: F70E87F1005EE6E2D82DBBC7EA1E582A48AA523A CRC32: 5C25F401 账户:Administrator 密码:nat.ee 支持:部署安装时,自动扩展硬盘。 无人值守: 自动安装应答 远程桌面: 默认开启,端口:3389 虚拟内存: 默认开启 声音: 默认关闭,若需要请到服务里把两个Audio启动并设置为自动 主题: 经典 ----------------------------------------------- ESD文件: WES7-x86-cn-lite.esd 大小: (379MB)398204474 字节 修改时间: 2021年5月10日, 23:22:12 MD5: 7D36EC82A1F879DDCB75AD759C1871DC SHA1: 42A06077E530F960FCFFDD42FC737C2F8327E3E3 CRC32: D36D9788 账户:Administrator 密码:空 默认:以 Administrator 账户 空密码 自动登录。 无人值守: 自动安装应答 远程桌面: 默认关闭 虚拟内存: 默认关闭 声音: 默认启用 主题: 默认Windows 7 ----------------------------------------------- ISO文件: WES7-x86-cn-lite.iso 大小: (646MB)678297600 字节 修改时间: 2021年5月13日, 18:31:28 MD5: 4C35322C1CE08828A2BFA303E08ED8DA SHA1: C44AAE4B6B596F864D8AECAFD7210DB44633235B CRC32: 6F5E87F7 账户:Administrator 密码:空 默认:以 Administrator 账户 空密码 自动登录。 无人值守: 自动安装应答 远程桌面: 默认关闭 虚拟内存: 默认关闭 声音: 默认启用 主题: 默认Windows 7 ----------------------------------------------- 已移除 打印 蓝牙 红外 小工具 PowerShell 不保证实体机通用,因为没有大量内置通用驱动。更新:永恒之蓝、远程桌面、NET环境必须、IE浏览器必须,补丁如下:kb4012212 kb4499175 kb4019990 kb2670838 kb2729094 kb2731771 kb2786081 kb2834140文件内容:(DD包默认开启虚拟内存,实际大于此1.55GG,由于虚拟内存文件占用)注意:【首次进入,请先使用tool.cmd脚本修改远程桌面端口和用户密码】tool.cmd 在桌面,用来修改远程桌面端口和用户密码的。重启按钮 在桌面,由于远程桌面无法使用开始菜单的重启功能,添加一个有效改善。DD包自带 nat.cmd 在系统盘根目录,是用来给VPS服务器设置静态IP网关的,若你的VPS服务器需要,请在DD完成,挂载进去修改此脚本,无论你是否设置,安装完成进入桌面后此脚本都会自动删除。修复:2021/5/13,紧急修复iso镜像导致安装后无法自动登录进入到桌面问题,如果你是这之前下载的,请重新下载!注意效验SHA1精简的意义就是把不需要的功能删除掉,请不要以使用原版的目光对待。没有绝对的精简适合每个人,如果你在使用过程中,没有你需要的功能或者运行错误,那就是被精简了,无法恢复或修复,切记。当你需要的功能被精减掉了,再好的版本你都会觉得不行,适合自己的就是最好的。声明:如有报毒,请不要使用!如造成损失,本人不负任何责任,请谨慎使用!任何形式发布/转载/修改,请保留本文!可再次修改私下使用,禁止再次修改发布到网上分享。荣耀&制作网站:nat.eeQQ群:6281379TG群:https://t.me/nat_ee预览如下:修改:保留 NET(2.0-3.0-3.5)环境,可自行安装到更高NET版本! 保留 Wifi 移除 打印 蓝牙 红外 小工具 PowerShell 默认系统语言:中文,并没有装任何输入法,请自行安装。 防火墙 开启PING,禁用TCP/UDP高危端口:135 137 138 139 445 支持 KVM 虚拟化 支持 VHD装载 更新 IE至IE11,默认打开就是空白页,没锁,没设置任何网址。 适度精简 功能组件/注册表优化/组策略优化/服务优化 纯净 精简 无添加 全新安装 自动激活 默认禁用Windows更新,但你可以手动打补丁升级 系统文件安装展开后1.55G左右 此系统仅适合虚拟机、云服务器、工控机,使用。 由于使用最小组件定制出来的系统,所以很多通用驱动并没有内置,并不适合实体机使用,或者你自备驱动导入可使用。Linux dd安装命令这里以安装natee win10为例wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh bash InstallNET.sh -dd 'http://natee.l-api.com/natee/win/guajibao/guajibao-win10-ent-ltsc-2021-x64-cn/guajibao-win10-ent-ltsc-2021-x64-cn.vhd.gz'其中http://natee.l-api.com/natee/win/guajibao/guajibao-win10-ent-ltsc-2021-x64-cn/guajibao-win10-ent-ltsc-2021-x64-cn.vhd.gz是nat.ee大佬制作的dd包,初始密码是nat.ee更多系统选择可以选择大佬地址链接里对应系统http://natee.l-api.com/natee/win/下载链接:网盘地址提取码百度云https://pan.baidu.com/s/1ng39GCL2POfyngZ6SPJIqw?pwd=fqi4fqi4Teraboxhttps://ouo.io/wSYWcP/123云盘https://www.123865.com/s/jiEmjv-WJ0xd https://www.123684.com/s/jiEmjv-WJ0xdBvGmNatee直链http://natee.l-api.com/natee//
2021年05月14日
25,593 阅读
1 评论
0 点赞
1
...
23
24
25
...
30