github.com/sagernet/sing-box@v1.9.0-rc.20/docs/migration.zh.md (about)

     1  ---
     2  icon: material/arrange-bring-forward
     3  ---
     4  
     5  ## 1.9.0
     6  
     7  !!! warning "不稳定的"
     8  
     9      该版本仍在开发中,迁移指南可能将在未来更改。
    10  
    11  ### `domain_suffix` 行为更新
    12  
    13  由于历史原因,sing-box 的 `domain_suffix` 规则匹配字面前缀,而不与其他项目相同。
    14  
    15  sing-box 1.9.0 修改了 `domain_suffix` 的行为:如果规则值以 `.` 为前缀则行为不变,否则改为匹配 `(domain|.+\.domain)`。
    16  
    17  ### 对 Windows 上 `process_path` 格式的更新
    18  
    19  sing-box 的 `process_path` 规则继承自Clash,
    20  原始代码使用本地系统的路径格式(例如 `\Device\HarddiskVolume1\folder\program.exe`),
    21  但是当设备有多个硬盘时,该 HarddiskVolume 系列号并不稳定。
    22  
    23  sing-box 1.9.0 使 QueryFullProcessImageNameW 输出 Win32 路径(如 `C:\folder\program.exe`),
    24  这将会破坏现有的 Windows `process_path` 用例。
    25  
    26  ## 1.8.0
    27  
    28  ### :material-close-box: 将缓存文件从 Clash API 迁移到独立选项
    29  
    30  !!! info "参考"
    31  
    32      [Clash API](/zh/configuration/experimental/clash-api/) / 
    33      [Cache File](/zh/configuration/experimental/cache-file/)
    34  
    35  === ":material-card-remove: 弃用的"
    36  
    37      ```json
    38      {
    39        "experimental": {
    40          "clash_api": {
    41            "cache_file": "cache.db", // 默认值
    42            "cahce_id": "my_profile2",
    43            "store_mode": true,
    44            "store_selected": true,
    45            "store_fakeip": true
    46          }
    47        }
    48      }
    49      ```
    50  
    51  === ":material-card-multiple: 新的"
    52  
    53      ```json
    54      {
    55        "experimental"  : {
    56          "cache_file": {
    57            "enabled": true,
    58            "path": "cache.db", // 默认值
    59            "cache_id": "my_profile2",
    60            "store_fakeip": true
    61          }
    62        }
    63      }
    64      ```
    65  
    66  ### :material-checkbox-intermediate: 迁移 GeoIP 到规则集
    67  
    68  !!! info "参考"
    69  
    70      [GeoIP](/zh/configuration/route/geoip/) / 
    71      [路由](/zh/configuration/route/) / 
    72      [路由规则](/zh/configuration/route/rule/) / 
    73      [DNS 规则](/zh/configuration/dns/rule/) / 
    74      [规则集](/zh/configuration/rule-set/)
    75  
    76  !!! tip
    77  
    78      `sing-box geoip` 命令可以帮助您将自定义 GeoIP 转换为规则集。
    79  
    80  === ":material-card-remove: 弃用的"
    81  
    82      ```json
    83      {
    84        "route": {
    85          "rules": [
    86            {
    87              "geoip": "private",
    88              "outbound": "direct"
    89            },
    90            {
    91              "geoip": "cn",
    92              "outbound": "direct"
    93            },
    94            {
    95              "source_geoip": "cn",
    96              "outbound": "block"
    97            }
    98          ],
    99          "geoip": {
   100            "download_detour": "proxy"
   101          }
   102        }
   103      }
   104      ```
   105  
   106  === ":material-card-multiple: 新的"
   107  
   108      ```json
   109      {
   110        "route": {
   111          "rules": [
   112            {
   113              "ip_is_private": true,
   114              "outbound": "direct"
   115            },
   116            {
   117              "rule_set": "geoip-cn",
   118              "outbound": "direct"
   119            },
   120            {
   121              "rule_set": "geoip-us",
   122              "rule_set_ipcidr_match_source": true,
   123              "outbound": "block"
   124            }
   125          ],
   126          "rule_set": [
   127            {
   128              "tag": "geoip-cn",
   129              "type": "remote",
   130              "format": "binary",
   131              "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
   132              "download_detour": "proxy"
   133            },
   134            {
   135              "tag": "geoip-us",
   136              "type": "remote",
   137              "format": "binary",
   138              "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-us.srs",
   139              "download_detour": "proxy"
   140            }
   141          ]
   142        },
   143        "experimental": {
   144          "cache_file": {
   145            "enabled": true // required to save Rule Set cache
   146          }
   147        }
   148      }
   149      ```
   150  
   151  ### :material-checkbox-intermediate: 迁移 Geosite 到规则集
   152  
   153  !!! info "参考"
   154  
   155      [Geosite](/zh/configuration/route/geosite/) / 
   156      [路由](/zh/configuration/route/) / 
   157      [路由规则](/zh/configuration/route/rule/) / 
   158      [DNS 规则](/zh/configuration/dns/rule/) / 
   159      [规则集](/zh/configuration/rule-set/)
   160  
   161  !!! tip
   162  
   163      `sing-box geosite` 命令可以帮助您将自定义 Geosite 转换为规则集。
   164  
   165  === ":material-card-remove: 弃用的"
   166  
   167      ```json
   168      {
   169        "route": {
   170          "rules": [
   171            {
   172              "geosite": "cn",
   173              "outbound": "direct"
   174            }
   175          ],
   176          "geosite": {
   177            "download_detour": "proxy"
   178          }
   179        }
   180      }
   181      ```
   182  
   183  === ":material-card-multiple: 新的"
   184  
   185      ```json
   186      {
   187        "route": {
   188          "rules": [
   189            {
   190              "rule_set": "geosite-cn",
   191              "outbound": "direct"
   192            }
   193          ],
   194          "rule_set": [
   195            {
   196              "tag": "geosite-cn",
   197              "type": "remote",
   198              "format": "binary",
   199              "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs",
   200              "download_detour": "proxy"
   201            }
   202          ]
   203        },
   204        "experimental": {
   205          "cache_file": {
   206            "enabled": true // required to save Rule Set cache
   207          }
   208        }
   209      }
   210      ```