ikuaiapp/sing-box

By ikuaiapp

Updated 4 months ago

sing-box

Image
Networking
Security
0

979

ikuaiapp/sing-box repository overview

sing-box 通用代理服务

sing-box 是一款多功能的通用代理平台,支持包括 TUIC, Hysteria2, Shadowsocks, VLESS, NaiveProxy 在内的多种协议。本镜像针对爱快 (iKuai) 路由器的 Docker 环境进行了优化封装。

官方项目地址:https://github.com/SagerNet/sing-box

🚀 Docker Compose 使用示例

推荐使用 portainer 进行部署管理。创建一个 stacks 填入以下配置:

version: '3.8'

services:
  sing-box:
    image: ikuaiapp/sing-box:latest
    container_name: sing-box
    restart: always
    privileged: true
    network_mode: "host"
    environment:
      - NO="" # 授权码 (留空则由系统在线自动获取)
      - TYPE=server_game     # 运行模式:server_game, server_tuic5, client_rule 等
      - PORT=1080            # 监听端口
      - USER=admin           # 用户名
      - PASSWD=password      # 密码/UUID
      - LOG_LEVEL=warn       # 日志级别
    networks:
      vlan:
        ipv4_address: 172.19.0.1             # 修改不同的 IP 地址 【*】
networks:
  vlan:
    external: true

🛠️ 实用工具命令

1. 生成 REALITY 密钥对
docker run --rm ikuaiapp/sing-box:latest sing-box generate reality-keypair
2. 生成随机 UUID
docker run --rm ikuaiapp/sing-box:latest /usr/bin/python3 -c 'import uuid; print(uuid.uuid4())'
3. 证书转换(用于粘贴到客户端)

若需将证书文件的内容转换为单行字符串(包含 \n),可执行:

# 转换证书 (tuic.crt)
awk 'NR > 1 {printf "\\n"} {printf "%s", $0}' /etc/sing-box/tuic.crt

# 转换私钥 (tuic.key)
awk 'NR > 1 {printf "\\n"} {printf "%s", $0}' /etc/sing-box/tuic.key

Powered by GitHub Actions

Tag summary

Content type

Image

Digest

sha256:186328094

Size

68.6 MB

Last updated

4 months ago

docker pull ikuaiapp/sing-box:1.13.2