跳至正文

從原始碼建置

建置

建置相依套件

text
clang >= 10
llvm >= 10 (optional)
golang >= 1.26.0
make

工具鏈需求取決於原始碼版本。本次收錄版本使用 Go 1.26.0,請核對對應的 go.mod建置工作流程

編譯

shell
git clone https://github.com/daeuniverse/dae.git
cd dae
git submodule update --init

選擇一種建置方式:

shell
## Minimal dependency build
make GOFLAGS="-buildvcs=false" \
  CLANG=clang
shell
## Normal build
make
shell
## Cross compile
# To armv7 CPU architect:
make CGO_ENABLED=0 GOARCH=arm GOARM=7
shell
# To mips CPU architect:
make CGO_ENABLED=0 GOARCH=mips

執行

執行階段相依套件

為了進行流量分流,dae 仰賴下列資料來源:geoip.datgeosite.dat

shell
sudo mkdir -p /usr/local/share/dae/
pushd /usr/local/share/dae/
sudo curl -L -o geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
sudo curl -L -o geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
popd
shell
mkdir -p /usr/local/share/dae/
pushd /usr/local/share/dae/
curl -L -o geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
curl -L -o geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
popd

執行

下載範例設定檔:

shell
curl -L -o example.dae https://github.com/daeuniverse/dae/raw/main/example.dae

請參閱 example.dae

完成微調後,執行 dae:

shell
sudo ./dae run -c example.dae
shell
./dae run -c example.dae

注意:或者,你可以將 dae 作為常駐程式(systemd)服務執行。請查看常駐程式服務指南瞭解詳情。


來源:dae 上游文件 · AGPL-3.0 授權條款