紀錄一下:
整個系統的背景是:
- proxmox VM, 要用Linux 版本 ,但考慮到 ubuntu 太大, 所以改用 budhi linux.
- 整個網路拓撲是這樣 : 192.168.8.91 龍蝦的家 –> 192.168.8.203 Nginx Proxy Manager –> Router 192.168.8.3 : xxx.xxx.xxx.xxx : domain.
也可以直接接到 router。我中間加個 NPM,容易管理些。
- vm : 4 cores, 16G ram, 32G hdd.
- 花了 25 美金,買了 x-ai ,取得 api-key
- 弄個 telegram 帳號。
開始:
安裝好 budhi linux
更新:
sudo apt update
sudo apt dist-upgrade
裝必要軟體:
sudo apt install git
sudo apt install nodejs
sudo apt install curl
安裝遠端連線 (給 windows 遠端桌面用的,比較方便)
sudo apt install xrdp
如果有防火牆, 要開: 3389/tcp
安裝 google chrome:
cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb -y
到此,建議將整個 vm 備份起來,方便重生。
我是雙開:
終端機 ssh 到主機,主要操作安裝及設定。
windows 遠端桌面連到同一主機,等一下用 chrome 接網頁。
開始:ssh 終端:
curl -fsSL https://openclaw.ai/install.sh | bash
過程:
- Yes.
- QuickStart
- 選你有 api-key 的 Model,輸入 api-key
- Select channel : Skip for now 跳過 (稍後設定)
- Skills : Yes, Yes, Skip for now 跳過 (以後設定)
- 接下來一堆 No.
- Hooks : Skip for now 跳過
- How do you want to batch your bot? : Do this later
在 Control UI 框裡面,有個 : http://127.0.0.1:18789/?token=xxxxxxxxxxxxx 這是你網路介面的網址及 token, copy 下來。等一下憑此進入網頁介面。
windows 遠端桌面:
chrome,輸入 前面那段: http://127.0.0.1:18789/?token=xxxxxxxxxxxxx
進入 openclaw 網頁。
龍蝦裝好了。
下一個 telegram 連接:
1. 到 telegram,
搜尋 : BotFather
輸入: /newbot
1 問你機器人要叫啥,輸入名稱,結尾要帶 bot. (ex. : abc-bot)
2 問你的用戶名
然後它會自動產生一個 TOKEN Key,copy 下來。
2. 回到 ssh 終端機,
openclaw channels add
選 Telegram
default (primary)
輸入 Telegram 給的 TOKEN Key
接下來 :
Configure DM. …..
YES
Pairing
No
此段完成,
檢查
openclaw channels list
會顯示 telegram default: configured …..
3. 到 telegram,
找到你的 abc-bot,按 start
會跑出:
你的 telegram user id : xxxxxxxx
Pairing code:xpxpxpxpxpx
兩個都要記下來。
4. 回到 ssh 終端機
openclaw pairing approve telegram xpxpxpxpx
檢查
openclaw status :
Channels 框:
可以看到 : Telegram ON OK token config ( 123esdr…, len 46), accounts 1/1
5. 到 telegram, 你的bot abc-bot
輸入你想要問的 …. 報上名來!
你的龍蝦就會回答你了。
你的龍蝦誕生了。
關機,先備分。
接下來要進行權限設定。下一篇再說。