commit d905ce09c0ace22c386f122e359d60f71369cb1c Author: luyoyu <806406129@qq.com> Date: Sat Sep 9 05:42:24 2023 +0800 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..d01f6d3 --- /dev/null +++ b/README.md @@ -0,0 +1,112 @@ +# shared-pilot 一个简单的web服务器 + + + +### 1.安装 + +``` +git clone https://gitee.com/chuangxxt/share-copilot.git +``` +``` +cd share-copilot +``` +``` +bash install.sh +``` + +### 2.配置 + +##### 2.1 config.json文件说明 + +```js +domain//绑定域名 + +host //ip + +port //端口-必须443 + +certPath//公钥路径-必须 + +keyPath//私钥路径-必须 + +github_api_url//默认不改 + +token//你自己的真实副驾驶token,可放多个,请求时随机使用 + +verification//自定义验证token +``` + +##### 2.2 示例 + +```json +{ + "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/ + +### 3.启动 + +``` +scop r --运行 +scop rb --后台运行 +scop st --停止 +scop v --查看状态 +``` + +### 4.完整示例一: + +config.json + +```json +{ + "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" +} +``` + +运行截图 + +![image-20230909050657331](C:\Users\chiro\Desktop\share-copilot\demo.png) + +本地host.json + +```json +{"github.com":{"user":"suibian","oauth_token":"i_am_free","dev_override":{"copilot_token_url":"https://api.example.com/copilot_internal/v2/token"}}} +``` + +image-20230909050931364 + + + +- [问题反馈](https://t.me/luyouyu) + +qrcode diff --git a/config.json b/config.json new file mode 100644 index 0000000..16dfc45 --- /dev/null +++ b/config.json @@ -0,0 +1,15 @@ +{ + "server": { + "domain": "example.con", + "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" + ]}, + "verification":"" +} \ No newline at end of file diff --git a/demo.png b/demo.png new file mode 100644 index 0000000..9a012e5 Binary files /dev/null and b/demo.png differ diff --git a/demo2.png b/demo2.png new file mode 100644 index 0000000..8e7e4aa Binary files /dev/null and b/demo2.png differ diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..fe977de --- /dev/null +++ b/install.sh @@ -0,0 +1,43 @@ +#!/bin/bash +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +START_SCRIPT_PATH="/usr/local/bin/scop" +cat > "$START_SCRIPT_PATH" </dev/null 2>&1 & + ;; + st) + echo "share-copilot was closed" + pkill -f "\$EXECUTABLE" + ;; + v) + if pgrep -f "\$EXECUTABLE" >/dev/null; then + echo "share-copilot is running" + else + echo "share-copilot was closed" + fi + ;; + *) + echo "command: \$0 {r|rb|st|v}" + exit 1 + ;; +esac +exit 0 +EOF +chmod +x "$START_SCRIPT_PATH" +echo "----------------- +install success! +----------------- +scop r --运行 +scop rb --后台运行 +scop st --停止 +scop v --查看状态 +-----------------" diff --git a/qrcode.jpg b/qrcode.jpg new file mode 100644 index 0000000..7487512 Binary files /dev/null and b/qrcode.jpg differ diff --git a/share-copilot b/share-copilot new file mode 100644 index 0000000..14fa0ee Binary files /dev/null and b/share-copilot differ diff --git a/uninstall.sh b/uninstall.sh new file mode 100644 index 0000000..ad743e3 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,3 @@ +START_SCRIPT_PATH="/usr/local/bin/scop" +rm -f "$START_SCRIPT_PATH" +echo "卸载完成!" diff --git a/version.json b/version.json new file mode 100644 index 0000000..728767d --- /dev/null +++ b/version.json @@ -0,0 +1 @@ +{"version":"0.1"} \ No newline at end of file