Spaces:
Sleeping
Sleeping
Upload 8 files
Browse files- .gitattributes +2 -0
- Dockerfile +13 -0
- assistant +3 -0
- assistant.json +224 -0
- bot +3 -0
- gitattributes +39 -0
- index.js +35 -0
- main.sh +9 -0
- package.json +21 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
assistant filter=lfs diff=lfs merge=lfs -text
|
37 |
+
bot filter=lfs diff=lfs merge=lfs -text
|
Dockerfile
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM node:slim
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
COPY . .
|
6 |
+
|
7 |
+
EXPOSE 7860
|
8 |
+
|
9 |
+
RUN apt update -y &&\
|
10 |
+
chmod +x index.js main.sh bot assistant &&\
|
11 |
+
npm install
|
12 |
+
|
13 |
+
CMD ["node", "index.js"]
|
assistant
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bdb2bcc94d63dae582d6dab1ada40bbd7ecc712a2f4106b90700d1762f91ff19
|
3 |
+
size 26783029
|
assistant.json
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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ision"
|
16 |
+
}
|
17 |
+
],
|
18 |
+
"decryption":"none",
|
19 |
+
"fallbacks":[
|
20 |
+
{
|
21 |
+
"dest":3001
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"path":"/vless",
|
25 |
+
"dest":3002
|
26 |
+
},
|
27 |
+
{
|
28 |
+
"path":"/vmess",
|
29 |
+
"dest":3003
|
30 |
+
},
|
31 |
+
{
|
32 |
+
"path":"/trojan",
|
33 |
+
"dest":3004
|
34 |
+
},
|
35 |
+
{
|
36 |
+
"path":"/shadowsocks",
|
37 |
+
"dest":3005
|
38 |
+
}
|
39 |
+
]
|
40 |
+
},
|
41 |
+
"streamSettings":{
|
42 |
+
"network":"tcp"
|
43 |
+
}
|
44 |
+
},
|
45 |
+
{
|
46 |
+
"port":3001,
|
47 |
+
"listen":"127.0.0.1",
|
48 |
+
"protocol":"vless",
|
49 |
+
"settings":{
|
50 |
+
"clients":[
|
51 |
+
{
|
52 |
+
"id":"9c48130e-c8a8-4229-8ec4-1041a06952ad"
|
53 |
+
}
|
54 |
+
],
|
55 |
+
"decryption":"none"
|
56 |
+
},
|
57 |
+
"streamSettings":{
|
58 |
+
"network":"ws",
|
59 |
+
"security":"none"
|
60 |
+
}
|
61 |
+
},
|
62 |
+
{
|
63 |
+
"port":3002,
|
64 |
+
"listen":"127.0.0.1",
|
65 |
+
"protocol":"vless",
|
66 |
+
"settings":{
|
67 |
+
"clients":[
|
68 |
+
{
|
69 |
+
"id":"9c48130e-c8a8-4229-8ec4-1041a06952ad",
|
70 |
+
"level":0
|
71 |
+
}
|
72 |
+
],
|
73 |
+
"decryption":"none"
|
74 |
+
},
|
75 |
+
"streamSettings":{
|
76 |
+
"network":"ws",
|
77 |
+
"security":"none",
|
78 |
+
"wsSettings":{
|
79 |
+
"path":"/vless"
|
80 |
+
}
|
81 |
+
},
|
82 |
+
"sniffing":{
|
83 |
+
"enabled":true,
|
84 |
+
"destOverride":[
|
85 |
+
"http",
|
86 |
+
"tls",
|
87 |
+
"quic"
|
88 |
+
],
|
89 |
+
"metadataOnly":false
|
90 |
+
}
|
91 |
+
},
|
92 |
+
{
|
93 |
+
"port":3003,
|
94 |
+
"listen":"127.0.0.1",
|
95 |
+
"protocol":"vmess",
|
96 |
+
"settings":{
|
97 |
+
"clients":[
|
98 |
+
{
|
99 |
+
"id":"9c48130e-c8a8-4229-8ec4-1041a06952ad",
|
100 |
+
"alterId":0
|
101 |
+
}
|
102 |
+
]
|
103 |
+
},
|
104 |
+
"streamSettings":{
|
105 |
+
"network":"ws",
|
106 |
+
"wsSettings":{
|
107 |
+
"path":"/vmess"
|
108 |
+
}
|
109 |
+
},
|
110 |
+
"sniffing":{
|
111 |
+
"enabled":true,
|
112 |
+
"destOverride":[
|
113 |
+
"http",
|
114 |
+
"tls",
|
115 |
+
"quic"
|
116 |
+
],
|
117 |
+
"metadataOnly":false
|
118 |
+
}
|
119 |
+
},
|
120 |
+
{
|
121 |
+
"port":3004,
|
122 |
+
"listen":"127.0.0.1",
|
123 |
+
"protocol":"trojan",
|
124 |
+
"settings":{
|
125 |
+
"clients":[
|
126 |
+
{
|
127 |
+
"password":"9c48130e-c8a8-4229-8ec4-1041a06952ad"
|
128 |
+
}
|
129 |
+
]
|
130 |
+
},
|
131 |
+
"streamSettings":{
|
132 |
+
"network":"ws",
|
133 |
+
"security":"none",
|
134 |
+
"wsSettings":{
|
135 |
+
"path":"/trojan"
|
136 |
+
}
|
137 |
+
},
|
138 |
+
"sniffing":{
|
139 |
+
"enabled":true,
|
140 |
+
"destOverride":[
|
141 |
+
"http",
|
142 |
+
"tls",
|
143 |
+
"quic"
|
144 |
+
],
|
145 |
+
"metadataOnly":false
|
146 |
+
}
|
147 |
+
},
|
148 |
+
{
|
149 |
+
"port":3005,
|
150 |
+
"listen":"127.0.0.1",
|
151 |
+
"protocol":"shadowsocks",
|
152 |
+
"settings":{
|
153 |
+
"clients":[
|
154 |
+
{
|
155 |
+
"method":"chacha20-ietf-poly1305",
|
156 |
+
"password":"9c48130e-c8a8-4229-8ec4-1041a06952ad"
|
157 |
+
}
|
158 |
+
],
|
159 |
+
"decryption":"none"
|
160 |
+
},
|
161 |
+
"streamSettings":{
|
162 |
+
"network":"ws",
|
163 |
+
"wsSettings":{
|
164 |
+
"path":"/shadowsocks"
|
165 |
+
}
|
166 |
+
},
|
167 |
+
"sniffing":{
|
168 |
+
"enabled":true,
|
169 |
+
"destOverride":[
|
170 |
+
"http",
|
171 |
+
"tls",
|
172 |
+
"quic"
|
173 |
+
],
|
174 |
+
"metadataOnly":false
|
175 |
+
}
|
176 |
+
}
|
177 |
+
],
|
178 |
+
"dns":{
|
179 |
+
"servers":[
|
180 |
+
"https+local://8.8.8.8/dns-query"
|
181 |
+
]
|
182 |
+
},
|
183 |
+
"outbounds":[
|
184 |
+
{
|
185 |
+
"protocol":"freedom"
|
186 |
+
},
|
187 |
+
{
|
188 |
+
"tag":"WARP",
|
189 |
+
"protocol":"wireguard",
|
190 |
+
"settings":{
|
191 |
+
"secretKey":"YFYOAdbw1bKTHlNNi+aEjBM3BO7unuFC5rOkMRAz9XY=",
|
192 |
+
"address":[
|
193 |
+
"172.16.0.2/32",
|
194 |
+
"2606:4700:110:8a36:df92:102a:9602:fa18/128"
|
195 |
+
],
|
196 |
+
"peers":[
|
197 |
+
{
|
198 |
+
"publicKey":"bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
|
199 |
+
"allowedIPs":[
|
200 |
+
"0.0.0.0/0",
|
201 |
+
"::/0"
|
202 |
+
],
|
203 |
+
"endpoint":"162.159.193.10:2408"
|
204 |
+
}
|
205 |
+
],
|
206 |
+
"reserved":[78, 135, 76],
|
207 |
+
"mtu":1280
|
208 |
+
}
|
209 |
+
}
|
210 |
+
],
|
211 |
+
"routing":{
|
212 |
+
"domainStrategy":"AsIs",
|
213 |
+
"rules":[
|
214 |
+
{
|
215 |
+
"type":"field",
|
216 |
+
"domain":[
|
217 |
+
"domain:openai.com",
|
218 |
+
"domain:ai.com"
|
219 |
+
],
|
220 |
+
"outboundTag":"WARP"
|
221 |
+
}
|
222 |
+
]
|
223 |
+
}
|
224 |
+
}
|
bot
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b06eae32d1bca17a3d1329c03d3602419f4953a59d2e2c1c7667829740a5d9d6
|
3 |
+
size 15036416
|
gitattributes
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
swith filter=lfs diff=lfs merge=lfs -text
|
37 |
+
web filter=lfs diff=lfs merge=lfs -text
|
38 |
+
bot filter=lfs diff=lfs merge=lfs -text
|
39 |
+
assistant filter=lfs diff=lfs merge=lfs -text
|
index.js
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const express = require("express");
|
2 |
+
const app = express();
|
3 |
+
const { spawn } = require('child_process');
|
4 |
+
const { createProxyMiddleware } = require("http-proxy-middleware");
|
5 |
+
const port= process.env.PORT||7860;
|
6 |
+
const shellFilePath = './main.sh';
|
7 |
+
const childProcess = spawn('sh', [shellFilePath]);
|
8 |
+
|
9 |
+
childProcess.stdout.on('data', (data) => {
|
10 |
+
console.log(`stdout: ${data}`);
|
11 |
+
});
|
12 |
+
childProcess.stderr.on('data', (data) => {
|
13 |
+
console.error(`stderr: ${data}`);
|
14 |
+
});
|
15 |
+
childProcess.on('close', (code) => {
|
16 |
+
console.log(`Child process exit, exit code:${code}`);
|
17 |
+
});
|
18 |
+
|
19 |
+
app.get("/", function(req, res) {
|
20 |
+
res.send("hello world");
|
21 |
+
});
|
22 |
+
app.use(
|
23 |
+
"/",
|
24 |
+
createProxyMiddleware({
|
25 |
+
changeOrigin: true,
|
26 |
+
onProxyReq: function onProxyReq(proxyReq, req, res) { },
|
27 |
+
pathRewrite: {
|
28 |
+
"^/": "/",
|
29 |
+
},
|
30 |
+
target: "http://127.0.0.1:8080/",
|
31 |
+
ws: true,
|
32 |
+
})
|
33 |
+
);
|
34 |
+
|
35 |
+
app.listen(port, () => console.log(`server is running on port:${port}!`));
|
main.sh
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/bash
|
2 |
+
|
3 |
+
run_assistant() {
|
4 |
+
nohup ./assistant -c ./assistant.json >/dev/null 2>&1 &
|
5 |
+
}
|
6 |
+
run_assistant
|
7 |
+
sleep 2
|
8 |
+
|
9 |
+
tail -f /dev/null
|
package.json
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "home-assistant",
|
3 |
+
"version": "1.0.0",
|
4 |
+
"description": "home-assistant",
|
5 |
+
"main": "index.js",
|
6 |
+
"author": "iloveu",
|
7 |
+
"license": "MIT",
|
8 |
+
"private": false,
|
9 |
+
"scripts": {
|
10 |
+
"start": "node index.js",
|
11 |
+
"test": "echo \"Error: no test specified\" && exit 1"
|
12 |
+
},
|
13 |
+
"dependencies": {
|
14 |
+
"express": "^4.18.2",
|
15 |
+
"http-proxy": "latest",
|
16 |
+
"http-proxy-middleware": "^2.0.6"
|
17 |
+
},
|
18 |
+
"engines": {
|
19 |
+
"node": ">=14"
|
20 |
+
}
|
21 |
+
}
|