daed编译部署

Youtube视频


相关链接

daed官方仓库

dae基本配置使用

安装编译工具

Centos/Fedora

# basic
sudo yum -y update && yum -y install epel-release git make clang

# golang
sudo yum -y install golang

# nodejs
update-crypto-policies --set DEFAULT:SHA1
sudo yum install https://rpm.nodesource.com/pub_21.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y
sudo yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1
update-crypto-policies --set DEFAULT
sudo npm install -g pnpm

Debian/Ubuntu

# basic
sudo apt update
sudo apt -y install git make clang

# golang
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt -y install golang-go

# nodejs
sudo apt install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt update
sudo apt -y install nodejs
sudo npm install -g pnpm

验证

go version
node -v
npm -v
pnpm -v

拉取源码

git clone https://github.com/daeuniverse/daed-revived-next.git /opt/daed
cd /opt/daed

git submodule update --init --recursive

dae-wing

编译

cd /opt/daed/wing
go mod tidy
make deps
go build -v -o dae-wing

mv dae-wing /usr/bin/

配置系统服务

  • 新增dae-wing服务文件

    cat <<EOF> /etc/systemd/system/dae-wing.service
    [Unit]
    Description=dae-wing Service
    Documentation=https://github.com/daeuniverse/dae-wing
    After=network-online.target docker.service systemd-sysctl.service
    Wants=network-online.target
    
    [Service]
    Type=simple
    User=root
    LimitNPROC=512
    LimitNOFILE=1048576
    ExecStart=/usr/bin/dae-wing run -c /etc/dae-wing/
    Restart=on-abnormal
    
    [Install]
    WantedBy=multi-user.target
    
    EOF
  • 刷新服务

    systemctl daemon-reload

服务管理

  • 启动+自启

    systemctl enable dae-wing.service --now
  • 启动

    systemctl start dae-wing.service
  • 停止

    systemctl stop dae-wing.service

    下载Geo数据库文件

wget -O /etc/dae-wing/geoip.dat https://github.com/v2rayA/dist-v2ray-rules-dat/raw/master/geoip.dat
wget -O /etc/dae-wing/geosite.dat https://github.com/v2rayA/dist-v2ray-rules-dat/raw/master/geosite.dat

daed

配置daed环境变量(可选)

若需要修改dae-wing端点以及daed监听的地址和端口,可配置如下环境变量文件
cd /opt/daed/

cat <<EOF> .env.local
# 指定dae-wing API端点地址
WING_API_URL=http://<your_server_ip>:2023
# daed监听的主机地址
HOSTNAME=0.0.0.0
# daed监听的端口
PORT=3000

EOF

编译

cd /opt/daed
pnpm install
pnpm run build

配置系统服务

  • 新增daed.service服务文件

    cat <<EOF> /etc/systemd/system/daed.service
    [Unit]
    Description=daed Service
    Documentation=https://github.com/daeuniverse/daed-revived-next
    After=network.target
    
    [Service]
    WorkingDirectory=/opt/daed
    ExecStart=/usr/bin/pnpm start
    StandardOutput=file:/var/log/daed_stdout.log
    StandardError=file:/var/log/daed_stderr.log
    ExecReload=/bin/kill -HUP $MAINPID
    KillMode=process
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
    EOF
  • 刷新服务

    systemctl daemon-reload

服务管理

  • 启动+自启

    systemctl enable daed.service --now
  • 启动

    systemctl start daed.service
  • 停止

    systemctl stop daed.service
如果觉得我的文章对你有用,请随意赞赏