代码拉取完成,页面将自动刷新
同步操作将从 luyoyu/share-copilot 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
测试环境:Linux4.18.0-305.3.1.el8.x86_64 GNU/Linux
需要 go环境 出问题自行chatgpt
wget https://dl.google.com/go/go1.21.1.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.21.1.linux-amd64.tar.gz
vim ~/.bashrc
#添加下列环境
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
#使生效环境变量
source ~/.bashrc
#验证安装
go version
#cd到main.go源码目录
cd /share-copilot/source
go build
git clone https://gitlab.com/luyoyu/share-copilot.git
cd share-copilot
bash install.sh
domain//监听域名或ip 可用nginx反代
host //ip
port //端口 80或443
certPath//公钥路径-443必须
keyPath//私钥路径-443必须
github_api_url//默认不改
token//自己的副驾驶token,可放多个,请求时随机使用
//登录插件后在%userprofile%\AppData\Local\github-copilot\host.json ghu_开头
verification//自定义验证
{
"server": {
"domain": "example.com",
"host": "0.0.0.0",
"port": 443,
"certPath":"./example.pem",
"keyPath":"./example.pem"
},
"copilot_config":{
"github_api_url": "https://api.github.com/copilot_internal/v2/token",
"token":[
"yours_token_1",
"yours_token_2",
"yours_token_3"
]},
"verification":""
}
格式不能错,不确定的去这里验证 ->https://www.json.cn/
scop r --运行 [Esc退出]
scop rb --后台运行
scop st --停止
scop v --查看状态
{
"server": {
"domain": "api.example.com",
"host": "0.0.0.0",
"port": 443,
"certPath":"./example.pem",
"keyPath":"./example.pem"
},
"copilot_config":{
"github_api_url": "https://api.github.com/copilot_internal/v2/token",
"token":[
"ghu_xMNAYLcJAPqAfiGoobrWffkJoNcGMVJtETKA",
"ghu_GZgKFwraHorAxXXUvsUclOhxiYERPsSJeNuF",
"ghu_SPUTCLvkMKoeMstPJmhSlYsYvCojhkFjGubl"
]},
"verification":"i_am_free"
}
正常情况下GithubApi request小于User Request,因为请求的Token 几十分钟才过期
以windows为例
{
"github.com":{
"user":"suibian",//随意填写
"oauth_token":"i_am_free",//与上面verification对应
"dev_override":{
"copilot_token_url":"https://api.example.com/copilot_internal/v2/token"
//你的地址
}
}
}
//添加下列代码,注意vscode插件更新需要重新添加,jetbrains则不用
process.env.GITHUB_TOKEN="i_am_free"; //与上面verification对应
process.env.GITHUB_API_URL="https://api.example.com"; //你的地址
process.env.CODESPACES="true";
process.env.GITHUB_SERVER_URL="https://github.com";
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。