TypechoJoeTheme

贰狐Blog - 一个笨蛋的博客

统计

贰狐

类目归类

Linux手动安装OlivOS&Dice

2021-11-20
/
0 评论
/
55 阅读
/
正在检测是否收录...
11/20

安装环境Ubuntu 20.04

0.安装环境

#临时root
sudo su
#更新apt列表
apt update
#安装python3 并显示版本信息
apt install -y python3 && python3 -V
#安装pip3 并显示版本信息
apt install -y python3-pip && pip -V
#安装git 并显示版本信息
apt install -y git && git --version

1.获取OlivOS源码

cd /home && git clone https://github.com/OlivOS-Team/OlivOS.git

2.安装依赖

cd OlivOS && pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

3.下载Go-cqhttp

#创建lib目录
mkdir -p lib && chmod +x lib && cd lib
#国内机走镜像站下载
wget --no-check-certificate -O "go-cqhttp.tar.gz" https://ghproxy.com/https://github.com/Mrs4s/go-cqhttp/releases/download/v1.0.0-beta8-fix1/go-cqhttp_linux_amd64.tar.gz 
#国外机走GitHub源站下载
wget --no-check-certificate -O "go-cqhttp.tar.gz" https://github.com/Mrs4s/go-cqhttp/releases/download/v1.0.0-beta8-fix1/go-cqhttp_linux_amd64.tar.gz 
#解压缩Go-cqhttp
tar zxf "go-cqhttp.tar.gz"

4.下载OlivaDiceCore源码

cd /home/OlivOS/plugin/app && git clone https://github.com/OlivOS-Team/OlivaDiceCore.git
#移动核心文件夹到上一级
mv /home/OlivOS/plugin/app/OlivaDiceCore/OlivaDiceCore/* /home/OlivOS/plugin/app/OlivaDiceCore
#删除空白文件夹
rm -rf /home/OlivOS/plugin/app/OlivaDiceCore/OlivaDiceCore

5.运行

cd /home/OlivOS && python3 main.py

修改设置

1.OlivOS的account.json

先运行一次OlivOS,然后按Ctrl+D停止运行程序,即可获得初始配置文件

vi /home/OlivOS/conf/account.json

参照如下注释修改

{
    "account": [
        {
            // QQ号码
            "id": 100000,
            // 由于我们要去Go扫码登录,所以密码设置为空
            "password": "",
            "sdk_type": "onebot",
            "platform_type": "qq",
            // 模式写gocqhttp_show
            "model_type": "gocqhttp_show",
            // 此处服务器指Go-cqhttp开启的Post服务器
            "server": {
                "auto": true,
                "type": "post",
                // 若Go-cqhttp不在本地,请自行替换ip或域名
                "host": "http://127.0.0.1",
                // Go-cqhttp开启的Post服务器的端口
                "port": 58000,
                // Go-cqhttp处设置的token
                "access_token": "tOKeN114514"
            },
            "debug": false
        }
    ]
}

保存文件

2.OlivOS的basic.json

vi /home/OlivOS/conf/basic.json

第107行处可以修改OlivOS端的POST端口,之后在go中需要设置相同端口

3.Go-cqhttp配置

运行一次Go-cqhttp

cd /home/OlivOS/lib && ./go-cqhttp

然后会提示选择输出什么配置,选择1 - HTTP

关闭Go-cqhttp,去修改配置文件

vi /home/OlivOS/lib/config.yml

必须修改第60行的 access-token: '' 与OlivOS的account.json中access-token值相同

如果需要跨域访问(前后端不在同一个服务器,或不同docker中),请修改第95行host值为0.0.0.0

第97行服务端监听端口 port: 5700 需要与OlivOS的account.json中port值相同

第100行反向HTTP超时时间timeout值设置为60

第111行反向HTTP POST URL值 #- url: '' 取消注释,改成如下

url: 'http://127.0.0.1:55001/OlivOSMsgApi/qq/onebot/gocqhttp' # 地址

此处端口55001对应OlivOS的basic.json中第107行处port

至此安装及配置步骤完成

启动程序

我们使用Screen程序来管理两个端

首先安装Screen,如果已经安装则跳过

apt install -y screen

安装完毕后,首先启动OlivOS

#新建Screen窗口
screen - S olivos
#启动olivos
cd /home/OlivOS && python3 main.py

检查程序输出是否正常

退出此Screen

Ctrl + a  d

也就是先按下 Ctrl + a,然后再按下 d,即可退出。此时这个 screen 窗口仍在后台运行。

然后启动Go-cqhttp

#新建Screen窗口
screen - S go
#启动olivos
cd /home/OlivOS/lib && ./go-cqhttp

此时会提示扫码,按步骤登录即可

检查与后端连接是否正常

骰娘Dice!OlivOS青果骰OlivaDice
朗读
赞 · 0
赞赏
感谢您的支持,我会继续努力哒!

三合一收款

下面三种方式都支持哦

微信
QQ
支付宝
打开支付宝/微信/QQ扫一扫,即可进行扫码打赏哦
版权属于:

贰狐Blog - 一个笨蛋的博客

本文链接:

https://www.aobacore.com/archives/OlivOS-OlivaDice-Go-cqhttp.html(转载时请注明本文出处及文章链接)

评论 (0)
15 文章数
37 评论量
本站已存活

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

最新回复

  1. 2021-11-16
  2. cc
    2021-11-11
  3. 2021-11-08

    {!{data:image/webp;base64,UklGRpYPAABXRUJQVlA4WAoAAAAQAAAAAQMAKwEAQUxQSJ0NAAANsABr2+q20SeyZVuOSXGva5B3qoZByyFTGNw4DA7YYSiEOVMMrcOJXYbATqAYZrDLdTONknKr3TrTeKOdKK1cKVbAlub6/+9/75X1a8bfgiIComxbVZtjTYXwODAxwj0nPwAR/4+I/4j4j4j/iPiPiP+I+I+I/4j4j4j/iPiPiP/430hE/EfOGykuo8mv1UQ1uAxGD52KTfS9NRPNMWgFgBlACwB6M0C8NBUzuvzFeTgO23MqKEXN7laM4udOdaz6n8HwGptV0tL68Rtj51AtBebpIMYXk177pRUcktSY7gBguI/eSKygWvINhEbwga8WwMFI5f6BbMkb0BulVL27BYo4keIAvyF3mtxYrQj6gQrU4zeos+6qQlhJuXgPeiOGwK+YE5JX85HbSxNQxwnHxejb6jjhd1m7DQCc6jjhN0xUOa86TpgMNXEms0sdJxzPvqOOU0TabDWuu/tont1crjtUfqf5VlhYnlAHNE+oaUhwYnlCXUMInsD/hnqRcpY6t5q9CZIX0Z/uoypCi954tVAAgD+UPqEigeAttL9sBIDRbynXojG8pvu1RZTzFPW1aJcZABpwX4uLIeUCuK/E+cifJqBGicPzFzXV8PxFhRKH6NnKE61vov5LZwLDfSxv/LYyMjqC6+hcNsi7jGyC3diMYPvu8giOYLMcF+RYq42Uq/sJnRFc310+xQqdyyv1XFCOPMUvlfiM4Hou+tPA/GwL0AnMzx5O8Jsf07OVkvoVMD1bqUJ3TwSaO/K0fqV3ZPIveF4k+q7iXyXgeNl0+kWxQofjqE1Xtc8QN+Z4fugbQOmB6gm0R84bqfd8BD68P9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k5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ycKAAD+/60eAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=}!}

  4. MYXBXiaoba
    2021-10-12
  5. 站元素主机
    2021-08-04

标签云