File size: 2,999 Bytes
e5e8914
6b66ff8
18338f2
9418cac
b680be3
657c2c4
 
a0a2fe6
14470cb
a6c20e6
e9b1330
a6c20e6
b680be3
9fdb2f5
fe2ce4e
9fdb2f5
9eb93fb
4233f52
bdaedce
 
9eb93fb
 
4233f52
 
9eb93fb
a6c20e6
b680be3
9fdb2f5
 
6b66ff8
18338f2
6b66ff8
c25e656
 
 
feb7464
c25e656
 
 
 
d39b316
685882f
c25e656
37f63d7
 
2369ff4
b07b67c
0c249e6
58e6791
b0387c0
 
fe2ce4e
b0387c0
 
0c249e6
c25e656
6b66ff8
 
 
9707563
9e99f8b
 
476db76
8957ec9
9581d1b
8957ec9
cfc5c9d
65b9a6d
4c1b488
72a4570
683464d
72a4570
683464d
3744638
e9de1a6
3744638
e9de1a6
683464d
0ab69f5
204d762
0ab69f5
9e99f8b
 
3744638
0ab69f5
8957ec9
0ab69f5
 
 
 
 
221b603
 
6fc64b1
 
 
e5e8914
 
 
7e6f125
6fc64b1
 
71003f4
aeb40d4
f9e89b3
58e6791
5121a70
c9fc7cf
2e77236
 
8957ec9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/sh
# 创建配置目录
mkdir -p ~/.nanobot
mkdir -p ~/.nanobot/workspace
mkdir -p /tmp/agent_slots
echo $PATH

#echo "149.154.166.110 api.telegram.org" |  tee -a /etc/hosts
 
#apt install dnsutils -y

#dig api.telegram.org
#dig discord.com/api/v10

cat /dev/null >/etc/resolv.conf


cat <<EOF >> /etc/resolv.conf
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 2606:4700:4700::1111
nameserver 2606:4700:4700::1001
EOF


#dig api.telegram.org
#dig discord.com/api/v10


# 直接写入配置(对接你本地的 PowerServe 或 Ollama API)
cat <<EOF > ~/.nanobot/config.json
{
  "providers": {
    "vllm": {
      "apiKey": "dummy",
      "apiBase": "http://localhost:7860/v1"
    }
  },
  "agents": {
    "defaults": {
      "workspace": "~/.nanobot/workspace",
      "model": "vllm/qwen3-30ba3b"
    }
  },
  "channels": {
   "telegram": {
   "enabled": true ,
   "token": "$TG_TOKEN" ,
   "allowFrom": ["$TG_ID"] 
    },
    "discord": {
      "enabled": false ,
      "token": "$DC_TOKEN",
      "allowFrom": ["$DC_ID"]
    }
  }
}
EOF

curl -Lo /usr/local/bin/ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.x86_64 && \
    chmod +x /usr/local/bin/ttyd

# 修改 entrypoint.sh 中的 ttyd 启动命令
ttyd bash &
#sh /app/test.sh &&sleep 80
apt install wget sudo -y
wget -q https://github.com/v2rayA/v2rayA/releases/download/v2.3.2/installer_debian_x64_2.3.2.deb && \
    wget -q https://raw.githubusercontent.com/v2rayA/v2raya-apt/refs/heads/master/pool/main/x/xray/xray_25.8.3_amd64.deb && \
    apt update && apt-get install -y ./installer_debian_x64_2.3.2.deb ./xray_25.8.3_amd64.deb && \
    rm installer_debian_x64_2.3.2.deb && rm xray_25.8.3_amd64.deb

#bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install

#curl -s https://install.zerotier.com | bash

#zerotier-cli join 8d1c312afaa97775

v2raya --lite &
#curl -I https://discord.com
#curl -Iv https://api.telegram.org

export ALL_PROXY="socks5://20170"


echo "Starting Python bot on port 8888..."
# ~/.local/bin/nanobot gateway -p 8888 & 


~/.local/bin/nanobot status
#~/.local/bin/nanobot --help

# 下载草稿模型 (建议用 Qwen2.5-1.5B-Instruct-GGUF 的 Q4_K_M 版本)
echo "Downloading model..."
# python3 -c "from huggingface_hub import hf_hub_download; \
#    hf_hub_download(repo_id='byteshape/Qwen3-30B-A3B-Instruct-2507-GGUF', \
#    filename='Qwen3-30B-A3B-Instruct-2507-Q4_K_S-3.61bpw.gguf', local_dir='/app')"

# 1. 启动 C++ 服务 (llama-server)
# 将端口改为 8080,并放到后台
 echo "Starting llama-server on port 8080..."
# ./llama-server -m "/app/Qwen3-30B-A3B-Instruct-2507-Q4_K_S-3.61bpw.gguf" --host "localhost" --port "7860" \
# -t "2" -c "16384" --flash-attn "on" --no-mmap -ctk q4_0 -ctv q4_0 &


#date
#echo "Current nanobot version: $(pip show nanobot)"


# 4. 启动 Nginx 作为主进程 (监听 7860)
# daemon off 确保容器不会立即退出
echo "Starting Nginx reverse proxy on port 7860..."
nginx -g "daemon off;"