This commit is contained in:
InkerBot
2026-03-05 13:58:29 +08:00
parent 8d9f52a180
commit 07f086b55d
4 changed files with 212 additions and 0 deletions
@@ -0,0 +1,58 @@
--- /dev/null
+++ b/docs/configuration/omv.md
@@ -0,0 +1,55 @@
+# OMV Modifications
+
+This page documents all modifications made by OMV (omv-dijiang) on top of upstream sing-box.
+
+## MySQL Protocol
+
+A custom proxy protocol that disguises traffic as MySQL TLS connections.
+
+- [MySQL Inbound](/configuration/inbound/mysql/)
+- [MySQL Outbound](/configuration/outbound/mysql/)
+
+### How it works
+
+1. The client and server perform a standard MySQL handshake using [go-mysql](https://github.com/go-mysql-org/go-mysql)
+2. TLS is negotiated as part of the MySQL protocol (the same way a real MySQL client upgrades to TLS)
+3. After the handshake, [smux](https://github.com/sagernet/smux) multiplexing runs over the encrypted connection
+4. Each smux stream carries a command byte and destination address, then proxies the connection
+
+To network observers, the traffic appears as a normal MySQL TLS session on port 3306.
+
+## Subscription Support
+
+The `sing-box run` command supports fetching configuration from a remote URL via environment variables.
+
+### Usage
+
+```bash
+SING_SUBSCRIPTION_LINK="https://example.com/config.json" \
+SING_SUBSCRIPTION_CACHE="/path/to/cache.json" \
+sing-box run -c env
+```
+
+### Environment Variables
+
+#### `SING_SUBSCRIPTION_LINK`
+
+The URL to fetch the configuration from. Only used when the config path is set to `env` (i.e. `-c env`).
+
+#### `SING_SUBSCRIPTION_CACHE`
+
+Optional. Path to a local file for caching the fetched configuration.
+
+- On successful fetch, the configuration is saved to this file
+- If the fetch fails (network error or non-200 status), the cached file is used as a fallback
+- If not set and the fetch fails, the command returns an error
+
+## URLTest Costs
+
+The `urltest` outbound group supports a `costs` field to add artificial latency penalties to specific outbounds.
+
+See [URLTest Outbound](/configuration/outbound/urltest/#costs) for details.
+
+## Log Level Adjustments
+
+Process path lookup logs (e.g. "found process path: ...", "found user: ...") are demoted from `info` to `debug` level to reduce log noise.