forked from coaidev/coai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0f382b
commit 29efd47
Showing
8 changed files
with
180 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
app/node_modules | ||
app/src-tauri | ||
app/.idea | ||
app/.vscode | ||
app/dist | ||
app/dev-dist | ||
app/dist-ssr | ||
app/target | ||
app/tauri.conf.json | ||
app/tauri.js | ||
|
||
.vscode | ||
.idea | ||
config.yaml | ||
config.dev.yaml | ||
|
||
addition/generation/data/* | ||
!addition/generation/data/.gitkeep | ||
|
||
addition/article/data/* | ||
!addition/article/data/.gitkeep | ||
sdk | ||
logs | ||
|
||
chat | ||
chat.exe | ||
|
||
# for reverse engine | ||
reverse | ||
access.json | ||
access/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
node_modules | ||
app/node_modules | ||
.vscode | ||
.idea | ||
config.yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# ref nodejs v18 and golang v1.20 | ||
|
||
FROM node:18-alpine as builder | ||
FROM golang:1.20-alpine as builder-go | ||
|
||
FROM alpine:3.15 | ||
|
||
# Install nginx | ||
RUN apk add --no-cache nginx && \ | ||
mkdir -p /run/nginx \ | ||
mkdir -p /usr/share/nginx/html | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Install nodejs | ||
COPY --from=builder /usr/local/bin/node /usr/local/bin/node | ||
COPY --from=builder /usr/local/include/node /usr/local/include/node | ||
COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules | ||
COPY --from=builder /usr/local/share/doc/node /usr/local/share/doc/node | ||
|
||
# Install golang | ||
COPY --from=builder-go /usr/local/go /usr/local/go | ||
ENV GOOS=linux GOARCH=amd64 | ||
|
||
WORKDIR / | ||
|
||
# Copy source code | ||
COPY . . | ||
|
||
# Build backend | ||
RUN go build -o chatnio | ||
|
||
# Build frontend | ||
RUN cd /app && \ | ||
npm install -g pnpm && \ | ||
pnpm install && \ | ||
pnpm run build && \ | ||
rm -rf node_modules | ||
|
||
# Copy frontend | ||
RUN ls -la /app | ||
COPY --from=0 /app/dist /usr/share/nginx/html | ||
|
||
# Expose port | ||
EXPOSE 80 | ||
|
||
# Start nginx | ||
CMD ["nginx", "-g", "daemon off;"] | ||
|
||
# Start backend | ||
CMD ["chatnio"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,30 @@ | ||
debug: true | ||
server: | ||
port: 8094 | ||
mysql: | ||
db: chatnio | ||
host: localhost | ||
password: chatnio123456 | ||
port: 3306 | ||
user: root | ||
|
||
redis: | ||
host: localhost | ||
port: 6379 | ||
|
||
mysql: | ||
host: "localhost" | ||
port: 3306 | ||
user: root | ||
password: ... | ||
|
||
db: "chatnio" | ||
secret: SbitdyN5ZH39cNxSrG3kMNZ1GfiyyQ43 | ||
|
||
secret: ... # jwt secret | ||
auth: | ||
access: ... | ||
salt: ... | ||
sign: ... | ||
use_deeptrain: false | ||
|
||
openai: | ||
gpt3: | ||
endpoint: https://api.openai.com | ||
apikey: sk-...|sk-... | ||
|
||
gpt4: | ||
endpoint: https://api.openai.com | ||
apikey: sk-...|sk-... | ||
|
||
slack: | ||
bot_id: ... | ||
token: ... | ||
channel: ... | ||
|
||
claude: | ||
apikey: ... | ||
endpoint: ... | ||
|
||
sparkdesk: | ||
app_id: ... | ||
api_secret: ... | ||
api_key: ... | ||
model: generalv2 | ||
endpoint: wss://spark-api.xf-yun.com/v2.1/chat | ||
|
||
palm2: | ||
endpoint: ... | ||
apikey: ... | ||
|
||
bing: | ||
# learn more at https://github.com/Deeptrain-Community/chatnio-bing-service | ||
endpoint: ... | ||
secret: ... | ||
|
||
zhipuai: | ||
endpoint: https://open.bigmodel.cn | ||
apikey: ... | ||
server: | ||
port: 8094 | ||
system: | ||
general: | ||
backend: "" | ||
mail: | ||
host: "" | ||
port: 465 | ||
username: "" | ||
password: "" | ||
from: "" | ||
search: | ||
endpoint: https://duckduckgo-api.vercel.app | ||
query: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 8192; | ||
multi_accept on; | ||
use epoll; | ||
} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
|
||
location /api/ { | ||
proxy_pass http://127.0.0.1:8094/; | ||
proxy_set_header Host 127.0.0.1:$server_port; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header REMOTE-HOST $remote_addr; | ||
proxy_set_header X-Host $host:$server_port; | ||
proxy_set_header X-Scheme $scheme; | ||
proxy_connect_timeout 30s; | ||
proxy_read_timeout 86400s; | ||
proxy_send_timeout 30s; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
} | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
try_files $uri $uri/ /index.html; | ||
error_page 404 =200 /index.html; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package utils |