sing-box-cli 0.0.11__tar.gz → 0.0.13__tar.gz

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.
Files changed (29) hide show
  1. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/.gitignore +3 -0
  2. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/.pre-commit-config.yaml +23 -23
  3. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/CHANGELOG.md +36 -0
  4. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/PKG-INFO +1 -1
  5. sing_box_cli-0.0.13/config/client-android.json +263 -0
  6. sing_box_cli-0.0.13/config/client-linux.json +255 -0
  7. sing_box_cli-0.0.13/config/client-server.json +243 -0
  8. sing_box_cli-0.0.13/config/client-win.json +254 -0
  9. sing_box_cli-0.0.13/config/server.json +177 -0
  10. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/pyproject.toml +2 -1
  11. sing_box_cli-0.0.13/scripts/format.sh +5 -0
  12. sing_box_cli-0.0.13/scripts/pre-commit.sh +9 -0
  13. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/src/sing_box_service/__init__.py +1 -1
  14. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/src/sing_box_service/config.py +42 -2
  15. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/src/sing_box_service/main.py +2 -2
  16. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/src/sing_box_service/service.py +2 -2
  17. sing_box_cli-0.0.13/tests/test_config.py +72 -0
  18. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/uv.lock +56 -0
  19. sing_box_cli-0.0.11/.vscode/PythonImportHelper-v2-Completion.json +0 -412
  20. sing_box_cli-0.0.11/.vscode/settings.json +0 -12
  21. sing_box_cli-0.0.11/scripts/format.sh +0 -5
  22. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/.github/dependabot.yml +0 -0
  23. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/.github/workflows/main.yml +0 -0
  24. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/LICENSE +0 -0
  25. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/README.md +0 -0
  26. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/assets/image.png +0 -0
  27. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/scripts/bump.sh +0 -0
  28. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/scripts/lint.sh +0 -0
  29. {sing_box_cli-0.0.11 → sing_box_cli-0.0.13}/src/sing_box_service/py.typed +0 -0
@@ -161,3 +161,6 @@ cython_debug/
161
161
  # and can be added to the global gitignore or merged into this file. For a more nuclear
162
162
  # option (not recommended) you can uncomment the following to ignore the entire idea folder.
163
163
  .idea/
164
+
165
+ .vscode/settings.json
166
+ .vscode/PythonImportHelper-v2-Completion.json
@@ -2,49 +2,49 @@
2
2
  # `pre-commit install` to set up the git hook scripts
3
3
  # `pre-commit autoupdate` to update repos
4
4
  # `pre-commit run --all-files` run hooks for all file
5
- exclude: (^|/)\..* # exclude hidden files or folder
5
+
6
+ # exclude: (^|/)\..*
7
+
6
8
  repos:
7
9
  - repo: https://github.com/pre-commit/pre-commit-hooks
8
10
  rev: v5.0.0
9
11
  hooks:
10
12
  - id: check-toml
11
13
  - id: check-yaml
12
- args: ["--unsafe"]
14
+ - id: sort-simple-yaml
13
15
  - id: check-json
16
+ - id: pretty-format-json
17
+ args: [--autofix, --no-sort-keys,--no-ensure-ascii]
14
18
  - id: check-added-large-files
15
- args: ["--maxkb=51200"]
16
- - id: debug-statements
19
+ args: [--maxkb=51200]
17
20
  - id: end-of-file-fixer
18
21
  - id: trailing-whitespace
19
22
  - id: detect-private-key
20
- - id: destroyed-symlinks
21
- - id: check-vcs-permalinks
22
- # spell check
23
+
23
24
  - repo: https://github.com/codespell-project/codespell
24
- rev: v2.3.0
25
+ rev: v2.4.1
25
26
  hooks:
26
27
  - id: codespell
27
- files: \.(py|sh|rst|yml|yaml|md)$
28
28
  args: [--write-changes]
29
- # lint and format
29
+ files: \.(py|sh|json|yml|yaml|md)$
30
+
30
31
  - repo: https://github.com/astral-sh/ruff-pre-commit
31
- rev: v0.8.6
32
+ rev: v0.9.9
32
33
  hooks:
33
34
  - id: ruff
34
- args: [ --fix ]
35
+ args: [--fix]
35
36
  - id: ruff-format
36
- # - repo: https://github.com/hadolint/hadolint
37
- # rev: v2.12.0
38
- # hooks:
39
- # - id: hadolint
40
- # name: Lint Dockerfiles
41
- # description: Runs hadolint to lint Dockerfiles
42
- # language: system
43
- # types: ["dockerfile"]
44
- # entry: hadolint
37
+
38
+ - repo: https://github.com/astral-sh/uv-pre-commit
39
+ # uv version.
40
+ rev: 0.6.3
41
+ hooks:
42
+ # Update the uv lockfile
43
+ - id: uv-lock
44
+
45
45
  ci:
46
- # Settings for the https://pre-commit.ci/ continuous integration service
47
- autofix_prs: True
48
46
  autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
47
+ # Settings for the https://pre-commit.ci/ continuous integration service
48
+ autofix_prs: true
49
49
  autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate
50
50
  autoupdate_schedule: monthly
@@ -2,6 +2,42 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.0.13 - 2025-03-08
6
+
7
+ ### 🚀 Features
8
+
9
+ - Show diff after updating config
10
+
11
+ ### 📚 Documentation
12
+
13
+ - Add sniff action
14
+ - Update cloudflare ip
15
+ - Client-server config
16
+ - Update config
17
+ - Update ntp server
18
+
19
+ ### 🧪 Testing
20
+
21
+ - Add tests as scripts target
22
+
23
+ ## 0.0.12 - 2025-02-28
24
+
25
+ ### 🐛 Bug Fixes
26
+
27
+ - Pre-commit pretty json replace unicode emoji with ascii
28
+ - Increase hop interval
29
+ - Add RunOnlyIfNetworkAvailable
30
+ - Dashboard url
31
+
32
+ ### ⚙️ Miscellaneous Tasks
33
+
34
+ - Update pre-commit and gitignore
35
+ - Add configs template
36
+ - Add server client config
37
+ - Update brutal limit
38
+ - Add microsoft rules
39
+ - Add rule
40
+
5
41
  ## 0.0.11 - 2025-01-20
6
42
 
7
43
  ### 🐛 Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sing-box-cli
3
- Version: 0.0.11
3
+ Version: 0.0.13
4
4
  Summary: cross-platform sing-box-service manager.
5
5
  Project-URL: Homepage, https://github.com/aittcuszz/sing-box-service
6
6
  Project-URL: Issues, https://github.com/atticuszz/sing-box-service/issues
@@ -0,0 +1,263 @@
1
+ {
2
+ "log": {
3
+ "level": "warning",
4
+ "timestamp": true
5
+ },
6
+ "dns": {
7
+ "servers": [
8
+ {
9
+ "tag": "dns_resolver",
10
+ "address": "h3://223.6.6.6/dns-query",
11
+ "detour": "direct"
12
+ },
13
+ {
14
+ "tag": "dns_direct",
15
+ "address": "h3://dns.atticux.me/dns-query/asfljsndfaoifa",
16
+ "address_resolver": "dns_resolver",
17
+ "detour": "direct"
18
+ },
19
+ {
20
+ "tag": "dns_proxy",
21
+ "address": "h3://dns.atticux.me/dns-query/asfljsndfaoifa",
22
+ "address_resolver": "dns_resolver",
23
+ "client_subnet": "137.184.125.132",
24
+ "detour": "proxy"
25
+ },
26
+ {
27
+ "tag": "dns_fakeip",
28
+ "address": "fakeip"
29
+ }
30
+ ],
31
+ "rules": [
32
+ {
33
+ "outbound": "any",
34
+ "server": "dns_direct"
35
+ },
36
+ {
37
+ "rule_set": "dns-filter",
38
+ "action": "reject"
39
+ },
40
+ {
41
+ "query_type": [
42
+ "A",
43
+ "AAAA"
44
+ ],
45
+ "server": "dns_fakeip"
46
+ },
47
+ {
48
+ "rule_set": "proxy-rule",
49
+ "server": "dns_proxy"
50
+ },
51
+ {
52
+ "rule_set": "direct-rule",
53
+ "server": "dns_direct"
54
+ }
55
+ ],
56
+ "final": "dns_proxy",
57
+ "reverse_mapping": true,
58
+ "cache_capacity": 4096,
59
+ "strategy": "prefer_ipv4",
60
+ "client_subnet": "180.110.148.0/24",
61
+ "fakeip": {
62
+ "enabled": true,
63
+ "inet4_range": "198.18.0.0/15",
64
+ "inet6_range": "fc00::/18"
65
+ },
66
+ "independent_cache": true
67
+ },
68
+ "inbounds": [
69
+ {
70
+ "type": "tun",
71
+ "tag": "tun-in",
72
+ "mtu": 1492,
73
+ "address": [
74
+ "172.16.0.1/30",
75
+ "fd00::1/126"
76
+ ],
77
+ "auto_route": true,
78
+ "strict_route": true,
79
+ "stack": "system",
80
+ "platform": {
81
+ "http_proxy": {
82
+ "enabled": true,
83
+ "server": "127.0.0.1",
84
+ "server_port": 30327
85
+ }
86
+ }
87
+ },
88
+ {
89
+ "type": "mixed",
90
+ "tag": "mixed-in",
91
+ "tcp_fast_open": true,
92
+ "tcp_multi_path": true,
93
+ "udp_fragment": true,
94
+ "listen": "127.0.0.1",
95
+ "listen_port": 30327
96
+ }
97
+ ],
98
+ "outbounds": [
99
+ {
100
+ "type": "selector",
101
+ "tag": "proxy",
102
+ "outbounds": [
103
+ "⚡San Francisco Hy2",
104
+ "🌩️San Francisco WS",
105
+ "🌟San Francisco WS",
106
+ "direct"
107
+ ],
108
+ "default": "⚡San Francisco Hy2"
109
+ },
110
+ {
111
+ "type": "direct",
112
+ "tag": "direct"
113
+ },
114
+ {
115
+ "type": "vless",
116
+ "tag": "🌟San Francisco WS",
117
+ "tcp_fast_open": true,
118
+ "udp_fragment": true,
119
+ "server": "104.19.255.210",
120
+ "server_port": 2053,
121
+ "uuid": "6a5f528d-1641-406f-95b8-ee9c574d79b3",
122
+ "tls": {
123
+ "enabled": true,
124
+ "server_name": "cdn.atticux.me",
125
+ "min_version": "1.3",
126
+ "alpn": "h3"
127
+ },
128
+ "transport": {
129
+ "type": "ws",
130
+ "path": "/ws",
131
+ "max_early_data": 2048,
132
+ "headers": {
133
+ "Host": "cdn.atticux.me"
134
+ }
135
+ }
136
+ },
137
+ {
138
+ "type": "vless",
139
+ "tag": "🌩️San Francisco WS",
140
+ "server": "104.24.13.124",
141
+ "server_port": 443,
142
+ "uuid": "717f9e5c-9922-49a0-aa12-3fa17d63a7a8",
143
+ "tls": {
144
+ "enabled": true,
145
+ "server_name": "worker.proxy.atticux.me"
146
+ },
147
+ "transport": {
148
+ "type": "ws",
149
+ "path": "/?ed=2560",
150
+ "headers": {
151
+ "Host": "worker.proxy.atticux.me"
152
+ }
153
+ }
154
+ },
155
+ {
156
+ "type": "hysteria2",
157
+ "tag": "⚡San Francisco Hy2",
158
+ "tcp_fast_open": true,
159
+ "tcp_multi_path": false,
160
+ "udp_fragment": true,
161
+ "server": "magic.atticux.me",
162
+ "server_ports": [
163
+ "40000:60000"
164
+ ],
165
+ "hop_interval": "300s",
166
+ "up_mbps": 150,
167
+ "down_mbps": 400,
168
+ "password": "UptVghIUI1djt/K2wwfrYQ==",
169
+ "tls": {
170
+ "enabled": true,
171
+ "server_name": "magic.atticux.me",
172
+ "min_version": "1.3",
173
+ "alpn": "h3"
174
+ }
175
+ }
176
+ ],
177
+ "route": {
178
+ "rules": [
179
+ {
180
+ "inbound": "tun-in",
181
+ "action": "sniff"
182
+ },
183
+ {
184
+ "protocol": "dns",
185
+ "action": "hijack-dns"
186
+ },
187
+ {
188
+ "ip_is_private": true,
189
+ "outbound": "direct"
190
+ },
191
+ {
192
+ "rule_set": "proxy-rule",
193
+ "outbound": "proxy"
194
+ },
195
+ {
196
+ "protocol": "ssh",
197
+ "outbound": "direct"
198
+ },
199
+ {
200
+ "rule_set": "direct-rule",
201
+ "outbound": "direct"
202
+ },
203
+ {
204
+ "rule_set": "geoip-cn",
205
+ "outbound": "direct"
206
+ }
207
+ ],
208
+ "rule_set": [
209
+ {
210
+ "type": "remote",
211
+ "tag": "proxy-rule",
212
+ "format": "binary",
213
+ "url": "https://raw.gh.atticux.me/AtticusZeller/rule-sets/main/binary/proxy.srs",
214
+ "download_detour": "direct",
215
+ "update_interval": "1d"
216
+ },
217
+ {
218
+ "type": "remote",
219
+ "tag": "direct-rule",
220
+ "format": "binary",
221
+ "url": "https://raw.gh.atticux.me/AtticusZeller/rule-sets/main/binary/direct.srs",
222
+ "download_detour": "direct",
223
+ "update_interval": "1d"
224
+ },
225
+ {
226
+ "type": "remote",
227
+ "tag": "geoip-cn",
228
+ "format": "binary",
229
+ "url": "https://raw.gh.atticux.me/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
230
+ "download_detour": "direct",
231
+ "update_interval": "1d"
232
+ },
233
+ {
234
+ "type": "remote",
235
+ "tag": "dns-filter",
236
+ "format": "binary",
237
+ "url": "https://raw.gh.atticux.me/REIJI007/AdBlock_Rule_For_Sing-box/main/adblock_reject.srs",
238
+ "download_detour": "direct",
239
+ "update_interval": "1d"
240
+ }
241
+ ],
242
+ "final": "proxy",
243
+ "auto_detect_interface": true,
244
+ "override_android_vpn": true
245
+ },
246
+ "experimental": {
247
+ "cache_file": {
248
+ "enabled": true,
249
+ "path": "cache.db",
250
+ "store_fakeip": true,
251
+ "store_rdrc": true
252
+ },
253
+ "clash_api": {
254
+ "external_controller": "127.0.0.1:9090",
255
+ "default_mode": "Rule",
256
+ "access_control_allow_origin": [
257
+ "http://127.0.0.1",
258
+ "https://metacubexd.atticux.me"
259
+ ],
260
+ "access_control_allow_private_network": true
261
+ }
262
+ }
263
+ }
@@ -0,0 +1,255 @@
1
+ {
2
+ "log": {
3
+ "level": "warning",
4
+ "timestamp": true
5
+ },
6
+ "dns": {
7
+ "servers": [
8
+ {
9
+ "tag": "dns_resolver",
10
+ "address": "h3://223.6.6.6/dns-query",
11
+ "detour": "direct"
12
+ },
13
+ {
14
+ "tag": "dns_direct",
15
+ "address": "h3://dns.atticux.me/dns-query/asfljsndfaoifa",
16
+ "address_resolver": "dns_resolver",
17
+ "detour": "direct"
18
+ },
19
+ {
20
+ "tag": "dns_proxy",
21
+ "address": "h3://dns.atticux.me/dns-query/asfljsndfaoifa",
22
+ "address_resolver": "dns_resolver",
23
+ "client_subnet": "137.184.125.132",
24
+ "detour": "proxy"
25
+ },
26
+ {
27
+ "tag": "dns_fakeip",
28
+ "address": "fakeip"
29
+ }
30
+ ],
31
+ "rules": [
32
+ {
33
+ "outbound": "any",
34
+ "server": "dns_direct"
35
+ },
36
+ {
37
+ "rule_set": "dns-filter",
38
+ "action": "reject"
39
+ },
40
+ {
41
+ "query_type": [
42
+ "A",
43
+ "AAAA"
44
+ ],
45
+ "server": "dns_fakeip"
46
+ },
47
+ {
48
+ "rule_set": "proxy-rule",
49
+ "server": "dns_proxy"
50
+ },
51
+ {
52
+ "rule_set": "direct-rule",
53
+ "server": "dns_direct"
54
+ }
55
+ ],
56
+ "final": "dns_proxy",
57
+ "reverse_mapping": true,
58
+ "cache_capacity": 4096,
59
+ "strategy": "prefer_ipv4",
60
+ "client_subnet": "180.110.148.0/24",
61
+ "fakeip": {
62
+ "enabled": true,
63
+ "inet4_range": "198.18.0.0/15",
64
+ "inet6_range": "fc00::/18"
65
+ },
66
+ "independent_cache": true
67
+ },
68
+ "ntp": {
69
+ "enabled": true,
70
+ "interval": "30m0s",
71
+ "server": "time.cloudflare.com",
72
+ "write_to_system": true,
73
+ "server_port": 123
74
+ },
75
+ "inbounds": [
76
+ {
77
+ "type": "tun",
78
+ "tag": "tun-in",
79
+ "mtu": 1492,
80
+ "address": [
81
+ "172.16.0.1/30",
82
+ "fd00::1/126"
83
+ ],
84
+ "auto_route": true,
85
+ "strict_route": true,
86
+ "auto_redirect": true,
87
+ "route_exclude_address_set": "geoip-cn",
88
+ "stack": "system"
89
+ }
90
+ ],
91
+ "outbounds": [
92
+ {
93
+ "type": "selector",
94
+ "tag": "proxy",
95
+ "outbounds": [
96
+ "⚡San Francisco Hy2",
97
+ "🌩️San Francisco WS",
98
+ "🌟San Francisco WS",
99
+ "direct"
100
+ ],
101
+ "default": "⚡San Francisco Hy2"
102
+ },
103
+ {
104
+ "type": "direct",
105
+ "tag": "direct"
106
+ },
107
+ {
108
+ "type": "vless",
109
+ "tag": "🌟San Francisco WS",
110
+ "tcp_fast_open": true,
111
+ "udp_fragment": true,
112
+ "server": "104.19.255.210",
113
+ "server_port": 2053,
114
+ "uuid": "6a5f528d-1641-406f-95b8-ee9c574d79b3",
115
+ "tls": {
116
+ "enabled": true,
117
+ "server_name": "cdn.atticux.me",
118
+ "min_version": "1.3",
119
+ "alpn": "h3"
120
+ },
121
+ "transport": {
122
+ "type": "ws",
123
+ "path": "/ws",
124
+ "max_early_data": 2048,
125
+ "headers": {
126
+ "Host": "cdn.atticux.me"
127
+ }
128
+ }
129
+ },
130
+ {
131
+ "type": "vless",
132
+ "tag": "🌩️San Francisco WS",
133
+ "server": "104.24.13.124",
134
+ "server_port": 443,
135
+ "uuid": "717f9e5c-9922-49a0-aa12-3fa17d63a7a8",
136
+ "tls": {
137
+ "enabled": true,
138
+ "server_name": "worker.proxy.atticux.me"
139
+ },
140
+ "transport": {
141
+ "type": "ws",
142
+ "path": "/?ed=2560",
143
+ "headers": {
144
+ "Host": "worker.proxy.atticux.me"
145
+ }
146
+ }
147
+ },
148
+ {
149
+ "type": "hysteria2",
150
+ "tag": "⚡San Francisco Hy2",
151
+ "tcp_fast_open": true,
152
+ "tcp_multi_path": false,
153
+ "udp_fragment": true,
154
+ "server": "magic.atticux.me",
155
+ "server_ports": [
156
+ "40000:60000"
157
+ ],
158
+ "hop_interval": "300s",
159
+ "up_mbps": 150,
160
+ "down_mbps": 400,
161
+ "password": "UptVghIUI1djt/K2wwfrYQ==",
162
+ "tls": {
163
+ "enabled": true,
164
+ "server_name": "magic.atticux.me",
165
+ "min_version": "1.3",
166
+ "alpn": "h3"
167
+ }
168
+ }
169
+ ],
170
+ "route": {
171
+ "rules": [
172
+ {
173
+ "inbound": "tun-in",
174
+ "action": "sniff"
175
+ },
176
+ {
177
+ "protocol": "dns",
178
+ "action": "hijack-dns"
179
+ },
180
+ {
181
+ "ip_is_private": true,
182
+ "outbound": "direct"
183
+ },
184
+ {
185
+ "rule_set": "proxy-rule",
186
+ "outbound": "proxy"
187
+ },
188
+ {
189
+ "protocol": "ssh",
190
+ "outbound": "direct"
191
+ },
192
+ {
193
+ "rule_set": "direct-rule",
194
+ "outbound": "direct"
195
+ },
196
+ {
197
+ "rule_set": "geoip-cn",
198
+ "outbound": "direct"
199
+ }
200
+ ],
201
+ "rule_set": [
202
+ {
203
+ "type": "remote",
204
+ "tag": "proxy-rule",
205
+ "format": "binary",
206
+ "url": "https://raw.gh.atticux.me/AtticusZeller/rule-sets/main/binary/proxy.srs",
207
+ "download_detour": "direct",
208
+ "update_interval": "1d"
209
+ },
210
+ {
211
+ "type": "remote",
212
+ "tag": "direct-rule",
213
+ "format": "binary",
214
+ "url": "https://raw.gh.atticux.me/AtticusZeller/rule-sets/main/binary/direct.srs",
215
+ "download_detour": "direct",
216
+ "update_interval": "1d"
217
+ },
218
+ {
219
+ "type": "remote",
220
+ "tag": "geoip-cn",
221
+ "format": "binary",
222
+ "url": "https://raw.gh.atticux.me/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
223
+ "download_detour": "direct",
224
+ "update_interval": "1d"
225
+ },
226
+ {
227
+ "type": "remote",
228
+ "tag": "dns-filter",
229
+ "format": "binary",
230
+ "url": "https://raw.gh.atticux.me/REIJI007/AdBlock_Rule_For_Sing-box/main/adblock_reject.srs",
231
+ "download_detour": "direct",
232
+ "update_interval": "1d"
233
+ }
234
+ ],
235
+ "final": "proxy",
236
+ "auto_detect_interface": true
237
+ },
238
+ "experimental": {
239
+ "cache_file": {
240
+ "enabled": true,
241
+ "path": "cache.db",
242
+ "store_fakeip": true,
243
+ "store_rdrc": true
244
+ },
245
+ "clash_api": {
246
+ "external_controller": "127.0.0.1:9090",
247
+ "default_mode": "Rule",
248
+ "access_control_allow_origin": [
249
+ "http://127.0.0.1",
250
+ "https://metacubexd.atticux.me"
251
+ ],
252
+ "access_control_allow_private_network": true
253
+ }
254
+ }
255
+ }