mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-14 21:23:44 +08:00
merge v4.2.0
This commit is contained in:
5
deploy/.gitignore
vendored
5
deploy/.gitignore
vendored
@@ -1,5 +0,0 @@
|
||||
data/mysql/data
|
||||
data/leveldb
|
||||
logs
|
||||
static/*
|
||||
redis/redis
|
||||
@@ -1,112 +0,0 @@
|
||||
Listen = "0.0.0.0:5678"
|
||||
ProxyURL = ""
|
||||
MysqlDns = "root:mhSCk0NheGhmtsha@tcp(geekai-mysql:3306)/geekai_plus?charset=utf8mb4&collation=utf8mb4_unicode_ci&parseTime=True&loc=Local"
|
||||
StaticDir = "./static"
|
||||
StaticUrl = "/static"
|
||||
TikaHost = "http://tika:9998"
|
||||
|
||||
[Session]
|
||||
SecretKey = "azyehq3ivunjhbntz78isj00i4hz2mt9xtddysfucxakadq4qbfrt0b7q3lnvg80"
|
||||
MaxAge = 86400
|
||||
|
||||
[AdminSession]
|
||||
SecretKey = "wr1uzwz2meai4z9j0e0tsyf6x523ui6zpnyaim4x2x37meakv13349llqpipyk40"
|
||||
MaxAge = 8640000
|
||||
|
||||
[Redis]
|
||||
Host = "geekai-redis"
|
||||
Port = 6379
|
||||
Password = "mhSCk0NheGhmtsha"
|
||||
DB = 0
|
||||
|
||||
[ApiConfig]
|
||||
ApiURL = "https://sapi.geekai.me"
|
||||
AppId = ""
|
||||
Token = ""
|
||||
|
||||
[SMS]
|
||||
Active = "Ali"
|
||||
[SMS.Ali]
|
||||
AccessKey = ""
|
||||
AccessSecret = ""
|
||||
Product = "Dysmsapi"
|
||||
Domain = "dysmsapi.aliyuncs.com"
|
||||
Sign = ""
|
||||
CodeTempId = ""
|
||||
[SMS.Bao]
|
||||
Username = ""
|
||||
Password = ""
|
||||
Domain = "api.smsbao.com"
|
||||
Sign = "【极客学长】"
|
||||
CodeTemplate = "您的验证码是{code}。5分钟有效,若非本人操作,请忽略本短信。"
|
||||
|
||||
[OSS]
|
||||
Active = "Local"
|
||||
[OSS.Local]
|
||||
BasePath = "./static/upload"
|
||||
BaseURL = "/static/upload"
|
||||
[OSS.Minio]
|
||||
Endpoint = ""
|
||||
AccessKey = ""
|
||||
AccessSecret = ""
|
||||
Bucket = "geekai"
|
||||
SubDir = ""
|
||||
UseSSL = false
|
||||
Domain = ""
|
||||
[OSS.QiNiu]
|
||||
Zone = "z2"
|
||||
AccessKey = ""
|
||||
AccessSecret = ""
|
||||
Bucket = ""
|
||||
SubDir = ""
|
||||
Domain = ""
|
||||
[OSS.AliYun]
|
||||
Endpoint = "oss-cn-hangzhou.aliyuncs.com"
|
||||
AccessKey = ""
|
||||
AccessSecret = ""
|
||||
Bucket = "geekai"
|
||||
SubDir = ""
|
||||
Domain = ""
|
||||
|
||||
[XXLConfig] # xxl-job 配置,需要你部署 XXL-JOB 定时任务工具,用来定期清理未支付订单和清理过期 VIP,如果你没有启用支付服务,则该服务也无需启动
|
||||
Enabled = false # 是否启用 XXL JOB 服务
|
||||
ServerAddr = "http://geekai-xxl-job-admin:8080/xxl-job-admin" # xxl-job-admin 管理地址
|
||||
ExecutorIp = "geekai-api" # 执行器 IP 地址
|
||||
ExecutorPort = "9999" # 执行器服务端口
|
||||
AccessToken = "GeekMaster" # 执行器 API 通信 token
|
||||
RegistryKey = "chatgpt-plus" # 任务注册 key,需要与 xxl-job 管理后台配置一致,请不要随意改动
|
||||
|
||||
# 支付宝商户支付
|
||||
[AlipayConfig]
|
||||
Enabled = false # 启用支付宝支付通道
|
||||
SandBox = false # 是否启用沙盒模式
|
||||
UserId = "2088721020750581" # 商户ID
|
||||
AppId = "9021000131658023" # App Id
|
||||
PrivateKey = "certs/alipay/privateKey.txt" # 应用私钥
|
||||
PublicKey = "certs/alipay/appPublicCert.crt" # 应用公钥证书
|
||||
AlipayPublicKey = "certs/alipay/alipayPublicCert.crt" # 支付宝公钥证书
|
||||
RootCert = "certs/alipay/alipayRootCert.crt" # 支付宝根证书
|
||||
|
||||
# 虎皮椒支付
|
||||
[HuPiPayConfig]
|
||||
Enabled = false
|
||||
AppId = ""
|
||||
AppSecret = ""
|
||||
ApiURL = "https://api.xunhupay.com"
|
||||
|
||||
# 微信商户支付
|
||||
[WechatPayConfig]
|
||||
Enabled = false
|
||||
AppId = "" # 商户应用ID
|
||||
MchId = "" # 商户号
|
||||
SerialNo = "" # API 证书序列号
|
||||
PrivateKey = "certs/alipay/privateKey.txt" # API 证书私钥文件路径,跟支付宝一样,把私钥文件拷贝到对应的路径,证书路径要映射到容器内
|
||||
ApiV3Key = "" # APIV3 私钥,这个是你自己在微信支付平台设置的
|
||||
|
||||
# 易支付
|
||||
[GeekPayConfig]
|
||||
Enabled = true
|
||||
AppId = "" # 商户ID
|
||||
PrivateKey = "" # 商户私钥
|
||||
ApiURL = "https://pay.geekai.cn"
|
||||
Methods = ["alipay", "wxpay", "qqpay", "jdpay", "douyin", "paypal"] # 支持的支付方式
|
||||
@@ -1,17 +0,0 @@
|
||||
mj:
|
||||
task-store:
|
||||
type: in_memory
|
||||
timeout: 30d
|
||||
translate-way: null
|
||||
api-secret: "sk-geekmaster" # API 密钥,要跟 chatgpt-plus 应用 config.toml 配置对应上,否则 API 调用会失败
|
||||
|
||||
ng-discord: # 这里必须配置反代,否则无法访问 Discord API
|
||||
server: "" # Discord API 反代
|
||||
cdn: "" # Discord 图片 CDN 反代
|
||||
wss: "" # Discord 网关反代
|
||||
|
||||
accounts: # MJ 账号,配置配置多个
|
||||
- guild-id: ""
|
||||
channel-id: ""
|
||||
user-token: ""
|
||||
user-agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
|
||||
@@ -1,44 +0,0 @@
|
||||
#
|
||||
# The MySQL database server configuration file.
|
||||
#
|
||||
# One can use all long options that the program supports.
|
||||
# Run program with --help to get a list of available options and with
|
||||
# --print-defaults to see which it would actually understand and use.
|
||||
#
|
||||
# For explanations see
|
||||
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
||||
|
||||
# Here is entries for some specific programs
|
||||
# The following values assume you have at least 32M ram
|
||||
|
||||
[mysqld]
|
||||
#
|
||||
# * Basic Settings
|
||||
#
|
||||
#user = mysql
|
||||
# pid-file = /var/run/mysqld/mysqld.pid
|
||||
# socket = /var/run/mysqld/mysqld.sock
|
||||
# port = 3306
|
||||
# datadir = /var/lib/mysql
|
||||
|
||||
|
||||
# If MySQL is running as a replication slave, this should be
|
||||
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
|
||||
# tmpdir = /tmp
|
||||
#
|
||||
# Instead of skip-networking the default is now to listen only on
|
||||
# localhost which is more compatible and is not less secure.
|
||||
bind-address = 0.0.0.0
|
||||
mysqlx-bind-address = 0.0.0.0
|
||||
|
||||
performance_schema_max_table_instances=400
|
||||
# 缓存
|
||||
table_definition_cache=400
|
||||
# 关闭监控
|
||||
performance_schema=off
|
||||
# 打开表的缓存
|
||||
table_open_cache=64
|
||||
# InnoDB缓冲池大小调整操作的块大小
|
||||
innodb_buffer_pool_chunk_size=64M
|
||||
# InnoDB 存储引擎的表数据和索引数据的最大内存缓冲区大小
|
||||
innodb_buffer_pool_size=64M
|
||||
@@ -1,46 +0,0 @@
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'websocket' upgrade;
|
||||
}
|
||||
server {
|
||||
# listen 443 ssl;
|
||||
listen 8080;
|
||||
# server_name www.chatgpt.com; #替换成你自己的域名
|
||||
|
||||
# ssl_certificate xxx.pem; # 替换成自己的 SSL 证书
|
||||
# ssl_certificate_key xxx.key;
|
||||
# ssl_session_timeout 5m;
|
||||
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
|
||||
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
# ssl_prefer_server_ciphers on;
|
||||
|
||||
# 日志地址
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
index index.html;
|
||||
root /var/www/app/dist; # 这里改成前端静态页面的地址
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
|
||||
# 后端 API 的转发
|
||||
location /api/ {
|
||||
proxy_http_version 1.1;
|
||||
proxy_connect_timeout 300s;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_send_timeout 12s;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_pass http://geekai-api:5678;
|
||||
}
|
||||
|
||||
# 静态资源转发
|
||||
location /static/ {
|
||||
proxy_pass http://geekai-api:5678;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
user www-data;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections 768;
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
##
|
||||
# Basic Settings
|
||||
##
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
types_hash_max_size 2048;
|
||||
# server_tokens off;
|
||||
client_max_body_size 100M;
|
||||
|
||||
# server_names_hash_bucket_size 64;
|
||||
# server_name_in_redirect off;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
##
|
||||
# SSL Settings
|
||||
##
|
||||
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
##
|
||||
# Logging Settings
|
||||
##
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log;
|
||||
|
||||
##
|
||||
# Gzip Settings
|
||||
##
|
||||
|
||||
gzip on;
|
||||
gzip_min_length 1k;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_buffers 16 8k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
### web
|
||||
server.port=8080
|
||||
server.servlet.context-path=/xxl-job-admin
|
||||
|
||||
### actuator
|
||||
management.server.servlet.context-path=/actuator
|
||||
management.health.mail.enabled=false
|
||||
|
||||
### resources
|
||||
spring.mvc.servlet.load-on-startup=0
|
||||
spring.mvc.static-path-pattern=/static/**
|
||||
spring.resources.static-locations=classpath:/static/
|
||||
|
||||
### freemarker
|
||||
spring.freemarker.templateLoaderPath=classpath:/templates/
|
||||
spring.freemarker.suffix=.ftl
|
||||
spring.freemarker.charset=UTF-8
|
||||
spring.freemarker.request-context-attribute=request
|
||||
spring.freemarker.settings.number_format=0.##########
|
||||
|
||||
### mybatis
|
||||
mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
|
||||
#mybatis.type-aliases-package=com.xxl.job.admin.core.model
|
||||
|
||||
### xxl-job, datasource
|
||||
spring.datasource.url=jdbc:mysql://geekai-mysql:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=12345678
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
|
||||
### datasource-pool
|
||||
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||
spring.datasource.hikari.minimum-idle=10
|
||||
spring.datasource.hikari.maximum-pool-size=30
|
||||
spring.datasource.hikari.auto-commit=true
|
||||
spring.datasource.hikari.idle-timeout=30000
|
||||
spring.datasource.hikari.pool-name=HikariCP
|
||||
spring.datasource.hikari.max-lifetime=900000
|
||||
spring.datasource.hikari.connection-timeout=10000
|
||||
spring.datasource.hikari.connection-test-query=SELECT 1
|
||||
spring.datasource.hikari.validation-timeout=1000
|
||||
|
||||
### xxl-job, email
|
||||
spring.mail.host=smtp.qq.com
|
||||
spring.mail.port=25
|
||||
spring.mail.username=xxx@qq.com
|
||||
spring.mail.from=xxx@qq.com
|
||||
spring.mail.password=xxx
|
||||
spring.mail.properties.mail.smtp.auth=true
|
||||
spring.mail.properties.mail.smtp.starttls.enable=true
|
||||
spring.mail.properties.mail.smtp.starttls.required=true
|
||||
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
|
||||
|
||||
### xxl-job, access token
|
||||
xxl.job.accessToken=GeekMaster
|
||||
|
||||
### xxl-job, i18n (default is zh_CN, and you can choose "zh_CN", "zh_TC" and "en")
|
||||
xxl.job.i18n=zh_CN
|
||||
|
||||
## xxl-job, triggerpool max size
|
||||
xxl.job.triggerpool.fast.max=200
|
||||
xxl.job.triggerpool.slow.max=100
|
||||
|
||||
### xxl-job, log retention days
|
||||
xxl.job.logretentiondays=3
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
version: '3'
|
||||
services:
|
||||
# mysql
|
||||
geekai-mysql:
|
||||
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/mysql:8.0.33
|
||||
container_name: geekai-mysql
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
restart: always
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=mhSCk0NheGhmtsha
|
||||
ports:
|
||||
- '3307:3306'
|
||||
volumes:
|
||||
- ./conf/mysql/my.cnf:/etc/mysql/my.cnf
|
||||
- ./data/mysql/data:/var/lib/mysql
|
||||
- ./logs/mysql:/var/log/mysql
|
||||
- ./data/mysql/init.d:/docker-entrypoint-initdb.d/
|
||||
healthcheck:
|
||||
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
|
||||
# redis
|
||||
geekai-redis:
|
||||
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/redis:6.0.6
|
||||
restart: always
|
||||
container_name: geekai-redis
|
||||
command: redis-server --requirepass mhSCk0NheGhmtsha
|
||||
volumes:
|
||||
- ./data/redis:/data
|
||||
ports:
|
||||
- '6380:6379'
|
||||
healthcheck:
|
||||
test: ['CMD', 'redis-cli', 'ping']
|
||||
interval: 3s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
# xxl-job-admin:
|
||||
# container_name: geekai-xxl-job-admin
|
||||
# image: registry.cn-shenzhen.aliyuncs.com/geekmaster/xxl-job-admin:2.4.0
|
||||
# restart: always
|
||||
# ports:
|
||||
# - "8081:8080"
|
||||
# environment:
|
||||
# - PARAMS=--spring.config.location=/application.properties
|
||||
# volumes:
|
||||
# - ./logs/xxl-job:/data/applogs
|
||||
# - ./conf/xxl-job/application.properties:/application.properties
|
||||
|
||||
tika:
|
||||
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/tika:latest
|
||||
container_name: tika
|
||||
restart: always
|
||||
ports:
|
||||
- '9998:9998'
|
||||
|
||||
# midjourney-proxy:
|
||||
# image: registry.cn-shenzhen.aliyuncs.com/geekmaster/midjourney-proxy:2.6.2
|
||||
# container_name: geekai-midjourney-proxy
|
||||
# restart: always
|
||||
# ports:
|
||||
# - "8082:8080"
|
||||
# volumes:
|
||||
# - ./conf/mj-proxy:/home/spring/config
|
||||
|
||||
# 后端 API 程序
|
||||
geekai-api:
|
||||
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-api:v4.1.8-amd64
|
||||
container_name: geekai-api
|
||||
restart: always
|
||||
depends_on:
|
||||
geekai-mysql:
|
||||
condition: service_healthy
|
||||
geekai-redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- DEBUG=false
|
||||
- LOG_LEVEL=info
|
||||
- CONFIG_FILE=config.toml
|
||||
ports:
|
||||
- '5678:5678'
|
||||
- '9999:9999'
|
||||
volumes:
|
||||
- /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime
|
||||
- ./conf/config.toml:/var/www/app/config.toml
|
||||
- ./logs/app:/var/www/app/logs
|
||||
- ./static:/var/www/app/static
|
||||
- ./data/leveldb:/var/www/app/data
|
||||
|
||||
# 前端应用
|
||||
geekai-web:
|
||||
image: registry.cn-shenzhen.aliyuncs.com/geekmaster/geekai-web:v4.1.8-amd64
|
||||
container_name: geekai-web
|
||||
restart: always
|
||||
depends_on:
|
||||
- geekai-api
|
||||
ports:
|
||||
- '8080:8080'
|
||||
volumes:
|
||||
- ./logs/nginx:/var/log/nginx
|
||||
- ./conf/nginx/conf.d:/etc/nginx/conf.d
|
||||
- ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./conf/nginx/ssl:/etc/nginx/ssl
|
||||
Reference in New Issue
Block a user