Skip to content

Commit

Permalink
v3.10.0 release
Browse files Browse the repository at this point in the history
1. Fix a deadlock in network connection (bug #171, bug #173).
2. Add `mieru export config simple` command (issue #176).
  • Loading branch information
enfein committed Jan 1, 2025
1 parent 40d437d commit 3d41cce
Show file tree
Hide file tree
Showing 17 changed files with 202 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PROJECT_NAME=$(shell basename "${ROOT}")
# - pkg/version/current.go
#
# Use `tools/bump_version.sh` script to change all those files at one shot.
VERSION="3.9.0"
VERSION="3.10.0"

# Build binaries and installation packages.
.PHONY: build
Expand Down
2 changes: 1 addition & 1 deletion build/package/mieru/amd64/debian/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: mieru
Version: 3.9.0
Version: 3.10.0
Section: net
Priority: optional
Architecture: amd64
Expand Down
2 changes: 1 addition & 1 deletion build/package/mieru/amd64/rpm/mieru.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: mieru
Version: 3.9.0
Version: 3.10.0
Release: 1%{?dist}
Summary: Mieru proxy client
License: GPLv3+
Expand Down
2 changes: 1 addition & 1 deletion build/package/mieru/arm64/debian/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: mieru
Version: 3.9.0
Version: 3.10.0
Section: net
Priority: optional
Architecture: arm64
Expand Down
2 changes: 1 addition & 1 deletion build/package/mieru/arm64/rpm/mieru.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: mieru
Version: 3.9.0
Version: 3.10.0
Release: 1%{?dist}
Summary: Mieru proxy client
License: GPLv3+
Expand Down
2 changes: 1 addition & 1 deletion build/package/mita/amd64/debian/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: mita
Version: 3.9.0
Version: 3.10.0
Section: net
Priority: optional
Architecture: amd64
Expand Down
2 changes: 1 addition & 1 deletion build/package/mita/amd64/rpm/mita.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: mita
Version: 3.9.0
Version: 3.10.0
Release: 1%{?dist}
Summary: Mieru proxy server
License: GPLv3+
Expand Down
2 changes: 1 addition & 1 deletion build/package/mita/arm64/debian/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: mita
Version: 3.9.0
Version: 3.10.0
Section: net
Priority: optional
Architecture: arm64
Expand Down
2 changes: 1 addition & 1 deletion build/package/mita/arm64/rpm/mita.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: mita
Version: 3.9.0
Version: 3.10.0
Release: 1%{?dist}
Summary: Mieru proxy server
License: GPLv3+
Expand Down
83 changes: 83 additions & 0 deletions docs/client-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,86 @@ Applications can choose any user and password in the `socks5Authentication` list
**socks5 username and password authentication is not compatible with HTTP / HTTPS proxy.** Since HTTP / HTTPS proxy does not require username and password authentication, based on threat model, mieru prohibits the use of HTTP / HTTPS proxy in conjunction with socks5 username and password authentication.

If you need to delete an existing HTTP / HTTPS proxy configuration, please run the `mieru delete http proxy` command. If you want to delete the socks5 username and password authentication settings, please run the `mieru delete socks5 authentication` command.

## Sharing Client Settings

Users can use commands `mieru export config` or `mieru export config simple` to generate URL links to share the client's configuration. These URL links can be imported into other clients using command `mieru import config <URL>`.

### Standard Sharing Link

Use command `mieru export config` to generate a standard sharing link. For example:

```
mieru://CpsBCgdkZWZhdWx0ElgKBWJhb3ppEg1tYW5saWFucGVuZmVuGkA0MGFiYWM0MGY1OWRhNTVkYWQ2YTk5ODMxYTUxMTY1MjJmYmM4MGUzODViYjFhYjE0ZGM1MmRiMzY4ZjczOGE0Gi8SCWxvY2FsaG9zdBoFCIo0EAIaDRACGgk5OTk5LTk5OTkaBQjZMhABGgUIoCYQASD4CioCCAQSB2RlZmF1bHQYnUYguAgwBTgA
```

A standard sharing link starts with `mieru://` and uses base64 encoding for the full client configuration. Users can use the standard sharing link to replicate the client configuration on a brand new device.

### Simple Sharing Link

Use command `mieru export config simple` to generate human-readable simple sharing links. For example:

```
mierus://baozi:[email protected]?mtu=1400&multiplexing=MULTIPLEXING_HIGH&port=6666&port=9998-9999&port=6489&port=4896&profile=default&protocol=TCP&protocol=TCP&protocol=UDP&protocol=UDP
```

The format of the simple sharing link is as follows:

`mierus://username:password@server_address?parameter_list`

A simple sharing link starts with `mierus://`, where `s` stands for `simple`.

The username and password can only use uppercase letters `A-Z`, lowercase letters `a-z`, numbers `0-9`, underscores `_`, and hyphens `-`. Otherwise, a simple sharing link cannot be generated.

There is only one server address in a simple sharing link. If the client's configuration contains multiple servers, multiple links will be generated.

The supported parameters are:

- `profile`
- `mtu`
- `multiplexing`
- `port`
- `protocol`

Among them, `profile` must appear once, `mtu` and `multiplexing` can appear at most once, `port` and `protocol` can appear multiple times, and they must appear the same number of times, such that the `port` and `protocol` at the same position can be associated. Additionally, `port` can also be used to specify a port range.

The simple sharing link above is equivalent to the following client configuration fragment:

```json
{
"profileName": "default",
"user": {
"name": "baozi",
"password": "manlianpenfen"
},
"servers": [
{
"ipAddress": "1.2.3.4",
"portBindings": [
{
"port": 6666,
"protocol": "TCP"
},
{
"protocol": "TCP",
"portRange": "9998-9999"
},
{
"port": 6489,
"protocol": "UDP"
},
{
"port": 4896,
"protocol": "UDP"
}
]
}
],
"mtu": 1400,
"multiplexing": {
"level": "MULTIPLEXING_HIGH"
}
}
```

Note: a simple sharing link does not contain necessary client configurations such as `socks5Port`. Therefore, importing a simple sharing link on a brand new device will fail.
83 changes: 83 additions & 0 deletions docs/client-install.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,86 @@ mieru 不使用 socks5 用户名和密码进行身份验证。
**socks5 用户名和密码验证与 HTTP / HTTPS 代理不兼容。** 因为 HTTP / HTTPS 代理不需要用户名和密码验证,根据威胁模型,mieru 禁止在使用 socks5 用户名和密码验证的同时使用 HTTP / HTTPS 代理。

如果需要删除已有的 HTTP / HTTPS 代理配置,请运行 `mieru delete http proxy` 指令。如果想要删除 socks5 用户名和密码验证的设置,请运行 `mieru delete socks5 authentication` 指令。

## 分享客户端的设置

用户可以使用 `mieru export config` 或者 `mieru export config simple` 指令生成 URL 链接,来分享客户端的配置。这些 URL 链接可以使用 `mieru import config <URL>` 指令导入至其他客户端。

### 标准分享链接

使用指令 `mieru export config` 生成一个标准分享链接。例如:

```
mieru://CpsBCgdkZWZhdWx0ElgKBWJhb3ppEg1tYW5saWFucGVuZmVuGkA0MGFiYWM0MGY1OWRhNTVkYWQ2YTk5ODMxYTUxMTY1MjJmYmM4MGUzODViYjFhYjE0ZGM1MmRiMzY4ZjczOGE0Gi8SCWxvY2FsaG9zdBoFCIo0EAIaDRACGgk5OTk5LTk5OTkaBQjZMhABGgUIoCYQASD4CioCCAQSB2RlZmF1bHQYnUYguAgwBTgA
```

标准分享链接以 `mieru://` 开始,使用 base64 编码完整的客户端配置。用户可以使用标准分享链接在一台全新的设备上复刻客户端配置。

### 简单分享链接

使用指令 `mieru export config simple` 生成人类可读的简单分享链接。例如:

```
mierus://baozi:[email protected]?mtu=1400&multiplexing=MULTIPLEXING_HIGH&port=6666&port=9998-9999&port=6489&port=4896&profile=default&protocol=TCP&protocol=TCP&protocol=UDP&protocol=UDP
```

简单分享链接的格式如下:

`mierus://用户名:密码@服务器地址?参数列表`

简单分享链接以 `mierus://` 开始,其中 `s` 表示 `simple`

用户名和密码只能使用大写字母 `A-Z`,小写字母 `a-z`,数字 `0-9`,下划线 `_` 和横杠 `-`,否则将无法生成简单分享链接。

简单分享链接中只有一个服务器地址。如果客户端的设置含有多台服务器,则会生成多个链接。

链接中支持的参数列表如下:

- `profile`
- `mtu`
- `multiplexing`
- `port`
- `protocol`

其中 `profile` 必须出现一次,`mtu` 以及 `multiplexing` 最多出现一次,`port``protocol` 可以出现多次,且他们出现的次数必须相同,以便将同一位置上的 `port``protocol` 联系起来。另外 `port` 也可以用来指定一段连续的端口。

上面的简单分享链接等同于如下的客户端配置片段:

```json
{
"profileName": "default",
"user": {
"name": "baozi",
"password": "manlianpenfen"
},
"servers": [
{
"ipAddress": "1.2.3.4",
"portBindings": [
{
"port": 6666,
"protocol": "TCP"
},
{
"protocol": "TCP",
"portRange": "9998-9999"
},
{
"port": 6489,
"protocol": "UDP"
},
{
"port": 4896,
"protocol": "UDP"
}
]
}
],
"mtu": 1400,
"multiplexing": {
"level": "MULTIPLEXING_HIGH"
}
}
```

注意,简单分享链接不含有 `socks5Port` 等必要的客户端配置。因此,在全新的设备上导入简单分享链接会失败。
6 changes: 3 additions & 3 deletions docs/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ The `make` command will only generate the officially supported executables. If y

```sh
# Compile the mita server software, which runs on a Linux system with Loongson processor
env GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go build -ldflags="-s -w" -o mita cmd/mita/mita.go
env GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o mita cmd/mita/mita.go

# Compile the mieru client software, which runs on a FreeBSD system with x86_64 processor
env GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o mieru cmd/mieru/mieru.go
env GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o mieru cmd/mieru/mieru.go

# Compile the mieru client software, which runs on an OpenWRT system with MIPS processor
env GOOS=linux GOARCH=mips CGO_ENABLED=0 go build -ldflags="-s -w" -o mieru cmd/mieru/mieru.go
env GOOS=linux GOARCH=mips CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o mieru cmd/mieru/mieru.go
```

**Note: The `mita` server software may not run on operating systems other than Linux.**
6 changes: 3 additions & 3 deletions docs/compile.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@

```sh
# 编译可以在龙芯处理器 Linux 系统上运行的 mita 服务器软件
env GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go build -ldflags="-s -w" -o mita cmd/mita/mita.go
env GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o mita cmd/mita/mita.go

# 编译可以在 x86_64 处理器 FreeBSD 系统上运行的 mieru 客户端软件
env GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o mieru cmd/mieru/mieru.go
env GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o mieru cmd/mieru/mieru.go

# 编译可以在 MIPS 处理器 OpenWRT 系统上运行的 mieru 客户端软件
env GOOS=linux GOARCH=mips CGO_ENABLED=0 go build -ldflags="-s -w" -o mieru cmd/mieru/mieru.go
env GOOS=linux GOARCH=mips CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o mieru cmd/mieru/mieru.go
```

**注意,`mita` 服务器软件可能无法在 Linux 之外的操作系统中运行。**
16 changes: 8 additions & 8 deletions docs/server-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ Before installation and configuration, connect to the server via SSH and then ex

```sh
# Debian / Ubuntu - X86_64
curl -LSO https://github.com/enfein/mieru/releases/download/v3.9.0/mita_3.9.0_amd64.deb
curl -LSO https://github.com/enfein/mieru/releases/download/v3.10.0/mita_3.10.0_amd64.deb

# Debian / Ubuntu - ARM 64
curl -LSO https://github.com/enfein/mieru/releases/download/v3.9.0/mita_3.9.0_arm64.deb
curl -LSO https://github.com/enfein/mieru/releases/download/v3.10.0/mita_3.10.0_arm64.deb

# RedHat / CentOS / Rocky Linux - X86_64
curl -LSO https://github.com/enfein/mieru/releases/download/v3.9.0/mita-3.9.0-1.x86_64.rpm
curl -LSO https://github.com/enfein/mieru/releases/download/v3.10.0/mita-3.10.0-1.x86_64.rpm

# RedHat / CentOS / Rocky Linux - ARM 64
curl -LSO https://github.com/enfein/mieru/releases/download/v3.9.0/mita-3.9.0-1.aarch64.rpm
curl -LSO https://github.com/enfein/mieru/releases/download/v3.10.0/mita-3.10.0-1.aarch64.rpm
```

## Install mita package

```sh
# Debian / Ubuntu - X86_64
sudo dpkg -i mita_3.9.0_amd64.deb
sudo dpkg -i mita_3.10.0_amd64.deb

# Debian / Ubuntu - ARM 64
sudo dpkg -i mita_3.9.0_arm64.deb
sudo dpkg -i mita_3.10.0_arm64.deb

# RedHat / CentOS / Rocky Linux - X86_64
sudo rpm -Uvh --force mita-3.9.0-1.x86_64.rpm
sudo rpm -Uvh --force mita-3.10.0-1.x86_64.rpm

# RedHat / CentOS / Rocky Linux - ARM 64
sudo rpm -Uvh --force mita-3.9.0-1.aarch64.rpm
sudo rpm -Uvh --force mita-3.10.0-1.aarch64.rpm
```

Those instructions can also be used to upgrade the version of mita software package.
Expand Down
16 changes: 8 additions & 8 deletions docs/server-install.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@

```sh
# Debian / Ubuntu - X86_64
curl -LSO https://github.com/enfein/mieru/releases/download/v3.9.0/mita_3.9.0_amd64.deb
curl -LSO https://github.com/enfein/mieru/releases/download/v3.10.0/mita_3.10.0_amd64.deb

# Debian / Ubuntu - ARM 64
curl -LSO https://github.com/enfein/mieru/releases/download/v3.9.0/mita_3.9.0_arm64.deb
curl -LSO https://github.com/enfein/mieru/releases/download/v3.10.0/mita_3.10.0_arm64.deb

# RedHat / CentOS / Rocky Linux - X86_64
curl -LSO https://github.com/enfein/mieru/releases/download/v3.9.0/mita-3.9.0-1.x86_64.rpm
curl -LSO https://github.com/enfein/mieru/releases/download/v3.10.0/mita-3.10.0-1.x86_64.rpm

# RedHat / CentOS / Rocky Linux - ARM 64
curl -LSO https://github.com/enfein/mieru/releases/download/v3.9.0/mita-3.9.0-1.aarch64.rpm
curl -LSO https://github.com/enfein/mieru/releases/download/v3.10.0/mita-3.10.0-1.aarch64.rpm
```

## 安装 mita 软件包

```sh
# Debian / Ubuntu - X86_64
sudo dpkg -i mita_3.9.0_amd64.deb
sudo dpkg -i mita_3.10.0_amd64.deb

# Debian / Ubuntu - ARM 64
sudo dpkg -i mita_3.9.0_arm64.deb
sudo dpkg -i mita_3.10.0_arm64.deb

# RedHat / CentOS / Rocky Linux - X86_64
sudo rpm -Uvh --force mita-3.9.0-1.x86_64.rpm
sudo rpm -Uvh --force mita-3.10.0-1.x86_64.rpm

# RedHat / CentOS / Rocky Linux - ARM 64
sudo rpm -Uvh --force mita-3.9.0-1.aarch64.rpm
sudo rpm -Uvh --force mita-3.10.0-1.aarch64.rpm
```

上述指令也可以用来升级 mita 软件包的版本。
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/current.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
package version

const (
AppVersion = "3.9.0"
AppVersion = "3.10.0"
)
4 changes: 4 additions & 0 deletions test/deploy/httptest/test_mix_udp_associate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ sleep 1
sleep 1
./mieru export config > client.url.txt
rm ~/.config/mieru/client.conf.pb
sleep 1
echo "mieru client config before import:"
./mieru describe config
sleep 1
echo "mieru client config URL:"
cat client.url.txt
sleep 1
./mieru import config $(cat client.url.txt)
echo "mieru client config after import:"
./mieru describe config
Expand Down

0 comments on commit 3d41cce

Please sign in to comment.