Skip to content

Commit 129b3ed

Browse files
committed
broken changes | 8448 -> 443
1 parent 61085f4 commit 129b3ed

File tree

17 files changed

+170
-28
lines changed

17 files changed

+170
-28
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build aarch64 .deb
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch: {}
7+
8+
jobs:
9+
build-deb:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Build aarch64 binary and .deb using cross Docker image
16+
run: |
17+
set -euo pipefail
18+
# Use the cross Docker image to build for aarch64
19+
docker run --rm -v "${{ github.workspace }}:/work" -w /work cross-rs/cross:latest \
20+
sh -lc "cargo install cargo-deb --force && cross build --release --target aarch64-unknown-linux-gnu -p tuwunel && cp target/aarch64-unknown-linux-gnu/release/tuwunel target/release/tuwunel && cargo deb --no-build --target aarch64-unknown-linux-gnu -p tuwunel"
21+
22+
- name: Find .deb and upload
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: tuwunel-deb-aarch64
26+
path: |
27+
target/debian/**/*.deb
28+
target/**/*.deb

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ using the configuration and Tuwunel can be deployed without a reverse proxy. Exa
5757
`/etc/caddy/Caddyfile` configuration with [Element](https://github.com/element-hq/element-web/releases)
5858
unzipped to `/var/www/element`:
5959
```
60-
tuwunel.me, tuwunel.me:8448 {
60+
tuwunel.me, tuwunel.me:443 {
6161
reverse_proxy localhost:8008
6262
}
6363
web.tuwunel.me {

docker/Dockerfile.complement

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ COPY <<EOF complement.toml
7272
log_thread_ids = true
7373
media_compat_file_link = false
7474
media_startup_check = true
75-
port = [8008, 8448]
75+
port = [8008, 443]
7676
prune_missing_media = true
7777
query_trusted_key_servers_first = false
7878
query_trusted_key_servers_first_on_join = false

docker/bake.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ target "docker" {
790790
dockerfile-inline =<<EOF
791791
FROM scratch AS install
792792
COPY --from=input . .
793-
EXPOSE 8008 8448
793+
EXPOSE 8008 443
794794
ENTRYPOINT ["tuwunel"]
795795
EOF
796796
}

docs/build-aarch64-deb.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
如何为 aarch64 (arm64) 架构构建 tuwunel 的 Debian (.deb) 包
2+
3+
概述
4+
- 本文档说明如何在 x86_64 或任意 Linux 主机上,生成适用于 aarch64-unknown-linux-gnu 的 .deb 包。
5+
- 推荐使用 cross(基于 Docker + QEMU),可以避免在宿主机安装交叉编译工具链。
6+
7+
先决条件
8+
- Rust(建议使用 rustup 管理 toolchain)
9+
- Docker(如果使用 cross)
10+
- cross(可选,但推荐):cargo install cross 或 apt 安装含包
11+
- cargo-deb:cargo install cargo-deb
12+
- 如果不使用 cross,需要安装目标与交叉链接器:
13+
- rustup target add aarch64-unknown-linux-gnu
14+
- 在 Debian/Ubuntu 上安装: gcc-aarch64-linux-gnu 或 aarch64-linux-gnu-gcc
15+
16+
使用脚本构建
17+
18+
仓库中提供了脚本: `scripts/build-deb-aarch64.sh`
19+
20+
用法:
21+
22+
```
23+
./scripts/build-deb-aarch64.sh
24+
```
25+
26+
脚本逻辑
27+
- 优先使用 `cross build --target aarch64-unknown-linux-gnu --release`
28+
- 若没有 cross,会尝试用 `cargo build --target aarch64-unknown-linux-gnu --release`(需本地交叉工具链)。
29+
- 将生成的二进制复制到 `target/release/tuwunel`,然后运行 `cargo deb --no-build` 生成 .deb。
30+
- 最终输出放在 `out/` 目录下。
31+
32+
常见问题
33+
- 找不到 cross:安装 `cargo install cross`,或在仓库根使用 Docker(需可用的 Docker)。
34+
- cargo-deb 未安装: `cargo install cargo-deb`
35+
- 本地交叉构建失败:建议使用 cross;若必须本地构建,请确保交叉链接器已安装并在 PATH 中。
36+
37+
进阶:在 CI 中使用
38+
- 在 CI(例如 GitHub Actions)中,可使用官方 cross 镜像并运行脚本,或使用 QEMU + Docker runner。
39+
40+
其他说明
41+
- 打包元数据位于 `src/main/Cargo.toml``[package.metadata.deb]` 部分,包含了 systemd unit、配置文件、维护脚本路径等信息。

docs/deploying/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
image: jevolk/tuwunel:latest
88
restart: unless-stopped
99
ports:
10-
- 8448:6167
10+
- 443:6167
1111
volumes:
1212
- db:/var/lib/tuwunel
1313
#- ./tuwunel.toml:/etc/tuwunel.toml

docs/deploying/docker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ OCI images for tuwunel are available in the registries listed below.
2626
When you have the image you can simply run it with
2727

2828
```bash
29-
docker run -d -p 8448:6167 \
29+
docker run -d -p 443:6167 \
3030
-v db:/var/lib/tuwunel/ \
3131
-e TUWUNEL_SERVER_NAME="your.server.name" \
3232
-e TUWUNEL_ALLOW_REGISTRATION=false \
@@ -127,7 +127,7 @@ to deploy and use tuwunel, with a little caveat. If you already took a look at
127127
the files, then you should have seen the `well-known` service, and that is the
128128
little caveat. Traefik is simply a proxy and loadbalancer and is not able to
129129
serve any kind of content, but for tuwunel to federate, we need to either
130-
expose ports `443` and `8448` or serve two endpoints `.well-known/matrix/client`
130+
expose ports `443` and `443` or serve two endpoints `.well-known/matrix/client`
131131
and `.well-known/matrix/server`.
132132

133133
With the service `well-known` we use a single `nginx` container that will serve

docs/deploying/generic.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ sudo useradd -r --shell /usr/bin/nologin --no-create-home tuwunel
6969

7070
## Forwarding ports in the firewall or the router
7171

72-
Matrix's default federation port is port 8448, and clients must be using port 443.
72+
Matrix's default federation port is port 443, and clients must be using port 443.
7373
If you would like to use only port 443, or a different port, you will need to setup
7474
delegation. Tuwunel has config options for doing delegation, or you can configure
7575
your reverse proxy to manually serve the necessary JSON files to do delegation
@@ -207,17 +207,17 @@ You can also use these commands as a quick health check (replace
207207
```bash
208208
curl https://your.server.name/_tuwunel/server_version
209209

210-
# If using port 8448
211-
curl https://your.server.name:8448/_tuwunel/server_version
210+
# If using port 443
211+
curl https://your.server.name:443/_tuwunel/server_version
212212

213213
# If federation is enabled
214-
curl https://your.server.name:8448/_matrix/federation/v1/version
214+
curl https://your.server.name:443/_matrix/federation/v1/version
215215
```
216216

217217
- To check if your server can talk with other homeservers, you can use the
218218
[Matrix Federation Tester](https://federationtester.matrix.org/). If you can
219219
register but cannot join federated rooms check your config again and also check
220-
if the port 8448 is open and forwarded correctly.
220+
if the port 443 is open and forwarded correctly.
221221

222222
# What's next?
223223

docs/deploying/tuwunel.container

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Container]
22
Environment=TUWUNEL_SERVER_NAME=your.domain.here TUWUNEL_DATABASE_PATH=/var/lib/tuwunel TUWUNEL_PORT=6167 TUWUNEL_MAX_REQUEST_SIZE=20000000 TUWUNEL_ALLOW_REGISTRATION=true TUWUNEL_REGISTRATION_TOKEN=YOUR_TOKEN TUWUNEL_ALLOW_FEDERATION=true TUWUNEL_TRUSTED_SERVERS=["matrix.org"] TUWUNEL_ADDRESS=0.0.0.0 # Add TUWUNEL_CONFIG: '/etc/tuwunel.toml' if the config is mapped
33
Image=docker.io/jevolk/tuwunel:latest
4-
PublishPort=8448:6167
4+
PublishPort=443:6167
55
Volume=/path/to/db:/var/lib/tuwunel
66
#Volume=/path/to/tuwunel.toml:/etc/tuwunel.toml #Uncomment to use the config file
77

nix/pkgs/complement/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ allow_public_room_directory_without_auth = true
77
allow_registration = true
88
database_path = "/database"
99
log = "trace,h2=debug,hyper=debug"
10-
port = [8008, 8448]
10+
port = [8008, 443]
1111
trusted_servers = []
1212
only_query_trusted_key_servers = false
1313
query_trusted_key_servers_first = false

0 commit comments

Comments
 (0)