827
This commit is contained in:
8
.vscode/sftp.json
vendored
8
.vscode/sftp.json
vendored
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "common-server",
|
"name": "common-server",
|
||||||
"host": "10.0.3.14",
|
"host": "10.0.3.148",
|
||||||
"protocol": "sftp",
|
"protocol": "sftp",
|
||||||
"port": 22,
|
"port": 22,
|
||||||
"username": "root",
|
"username": "awei",
|
||||||
"password": "Awei@sxf01",
|
"password": "123456",
|
||||||
"remotePath": "/root/common-server",
|
"remotePath": "/home/awei/common-server",
|
||||||
"uploadOnSave": true
|
"uploadOnSave": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
navidrome:
|
navidrome:
|
||||||
container_name: navidrome
|
container_name: navidrome
|
||||||
image: deluan/navidrome:latest
|
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/deluan/navidrome:pr-4181
|
||||||
ports:
|
ports:
|
||||||
- "4533:4533"
|
- "4533:4533"
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
# 扫描音乐库的计划
|
# 扫描音乐库的计划
|
||||||
ND_SCANSCHEDULE: "@every 1h"
|
ND_SCANSCHEDULE: "@every 1h"
|
||||||
# 日志级别
|
# 日志级别
|
||||||
ND_LOGLEVEL: "info"
|
ND_LOGLEVEL: "info"
|
||||||
# 默认语言
|
# 默认语言
|
||||||
ND_DEFAULTLANGUAGE: "zh"
|
ND_DEFAULTLANGUAGE: "zh"
|
||||||
# 会话超时时间
|
# 会话超时时间
|
||||||
ND_SESSIONTIMEOUT: "24h"
|
ND_SESSIONTIMEOUT: "24h"
|
||||||
# 启用下载功能
|
# 启用下载功能
|
||||||
ND_ENABLEDOWNLOADS: "true"
|
ND_ENABLEDOWNLOADS: "true"
|
||||||
# 启用收藏夹
|
# 启用收藏夹
|
||||||
ND_ENABLEFAVOURITES: "true"
|
ND_ENABLEFAVOURITES: "true"
|
||||||
# 启用共享功能
|
# 启用共享功能
|
||||||
ND_ENABLESHARING: "false"
|
ND_ENABLESHARING: "false"
|
||||||
# 在 UI 中启用5星评级
|
# 在 UI 中启用5星评级
|
||||||
ND_ENABLESTARRATING: "true"
|
ND_ENABLESTARRATING: "true"
|
||||||
# 启用转码配置
|
# 启用转码配置
|
||||||
ND_ENABLETRANSCODINGCONFIG: "true"
|
ND_ENABLETRANSCODINGCONFIG: "true"
|
||||||
# 转码缓存大小
|
# 转码缓存大小
|
||||||
ND_TRANSCODINGCACHESIZE: "2000M"
|
ND_TRANSCODINGCACHESIZE: "2000M"
|
||||||
# 图片缓存大小
|
# 图片缓存大小
|
||||||
ND_IMAGECACHESIZE: "1000M"
|
ND_IMAGECACHESIZE: "1000M"
|
||||||
# 音乐文件路径
|
# 音乐文件路径
|
||||||
ND_MUSICFOLDER: "/music"
|
ND_MUSICFOLDER: "/music"
|
||||||
# 数据路径
|
# 数据路径
|
||||||
ND_DATAFOLDER: "/data"
|
ND_DATAFOLDER: "/data"
|
||||||
volumes:
|
volumes:
|
||||||
# 将宿主机的数据目录挂载到容器的数据目录,用于数据持久化
|
# 将宿主机的数据目录挂载到容器的数据目录,用于数据持久化
|
||||||
- "./data:/data"
|
- "./data:/data"
|
||||||
# 将宿主机的音乐目录挂载到容器的音乐目录,只读模式
|
# 将宿主机的音乐目录挂载到容器的音乐目录,只读模式
|
||||||
- "./music:/music:ro"
|
- "./music:/music:ro"
|
||||||
networks:
|
networks:
|
||||||
- navidrome-net
|
- navidrome-net
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
navidrome-net:
|
navidrome-net:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
@@ -1,26 +1,26 @@
|
|||||||
name: bbs-go-server
|
name: bbs-go-server
|
||||||
|
|
||||||
on: [ push ]
|
on: [ push ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.21
|
go-version: 1.21
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: ./server
|
working-directory: ./server
|
||||||
run: |
|
run: |
|
||||||
go mod download
|
go mod download
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ./server
|
working-directory: ./server
|
||||||
run: |
|
run: |
|
||||||
make build
|
make build
|
||||||
|
|||||||
62
bbs-go-active/.github/workflows/bbs-go-site.yml
vendored
62
bbs-go-active/.github/workflows/bbs-go-site.yml
vendored
@@ -1,32 +1,32 @@
|
|||||||
name: bbs-go-site
|
name: bbs-go-site
|
||||||
|
|
||||||
on: [ push ]
|
on: [ push ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [ 20.x ]
|
node-version: [ 20.x ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: pnpm/action-setup@v3
|
- uses: pnpm/action-setup@v3
|
||||||
with:
|
with:
|
||||||
version: 8
|
version: 8
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
cache-dependency-path: site/pnpm-lock.yaml
|
cache-dependency-path: site/pnpm-lock.yaml
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: ./site
|
working-directory: ./site
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ./site
|
working-directory: ./site
|
||||||
run: |
|
run: |
|
||||||
pnpm build
|
pnpm build
|
||||||
12
bbs-go-active/.gitignore
vendored
12
bbs-go-active/.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
.idea
|
.idea
|
||||||
dist
|
dist
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
.nuxt
|
.nuxt
|
||||||
.docker-compose/mysql/data
|
.docker-compose/mysql/data
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,85 +1,85 @@
|
|||||||
## 项目地址
|
## 项目地址
|
||||||
|
|
||||||
- 演示站:[https://bbs.bbs-go.com](https://bbs.bbs-go.com)
|
- 演示站:[https://bbs.bbs-go.com](https://bbs.bbs-go.com)
|
||||||
- 文档地址:[https://bbs-go.com](https://bbs-go.com)
|
- 文档地址:[https://bbs-go.com](https://bbs-go.com)
|
||||||
- 问题反馈: [https://mlog.club/topics/node/3](https://mlog.club/topics/node/3)
|
- 问题反馈: [https://mlog.club/topics/node/3](https://mlog.club/topics/node/3)
|
||||||
- Github: [https://github.com/mlogclub/bbs-go](https://github.com/mlogclub/bbs-go)
|
- Github: [https://github.com/mlogclub/bbs-go](https://github.com/mlogclub/bbs-go)
|
||||||
- Gitee: [https://gitee.com/mlogclub/bbs-go](https://gitee.com/mlogclub/bbs-go)
|
- Gitee: [https://gitee.com/mlogclub/bbs-go](https://gitee.com/mlogclub/bbs-go)
|
||||||
|
|
||||||
## 联系我
|
## 联系我
|
||||||
|
|
||||||
### 用户交流群
|
### 用户交流群
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 加我微信
|
### 加我微信
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 介绍
|
## 介绍
|
||||||
|
|
||||||
`bbs-go` 是一个基于 Go 语言开发的开源社区论坛系统。它的设计旨在提供轻量、高效的社区讨论平台,支持现代化的 Web 技术栈,并且易于扩展和部署。bbs-go 项目采用模块化架构,能够与其他服务和前端框架无缝集成,适合各种规模的在线社区。
|
`bbs-go` 是一个基于 Go 语言开发的开源社区论坛系统。它的设计旨在提供轻量、高效的社区讨论平台,支持现代化的 Web 技术栈,并且易于扩展和部署。bbs-go 项目采用模块化架构,能够与其他服务和前端框架无缝集成,适合各种规模的在线社区。
|
||||||
|
|
||||||
项目的主要特点包括:
|
项目的主要特点包括:
|
||||||
|
|
||||||
- **高性能**:基于 Go 语言的并发特性,能够在高负载下保持良好的性能表现。
|
- **高性能**:基于 Go 语言的并发特性,能够在高负载下保持良好的性能表现。
|
||||||
- **灵活性**:支持自定义配置、插件扩展,易于适应不同需求。
|
- **灵活性**:支持自定义配置、插件扩展,易于适应不同需求。
|
||||||
- **简单易用**:提供简洁的管理后台,方便社区管理员管理论坛内容和用户。
|
- **简单易用**:提供简洁的管理后台,方便社区管理员管理论坛内容和用户。
|
||||||
- **支持 MySQL 数据库**:提供对常见数据库的支持,确保数据存储的可靠性和稳定性。
|
- **支持 MySQL 数据库**:提供对常见数据库的支持,确保数据存储的可靠性和稳定性。
|
||||||
- **响应式设计**:前端使用现代化的技术,能够在移动设备和桌面设备上提供良好的用户体验。
|
- **响应式设计**:前端使用现代化的技术,能够在移动设备和桌面设备上提供良好的用户体验。
|
||||||
|
|
||||||
项目主要面向开发者和社区管理者,适合搭建技术讨论、兴趣分享等类型的社区论坛。
|
项目主要面向开发者和社区管理者,适合搭建技术讨论、兴趣分享等类型的社区论坛。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 模块
|
## 模块
|
||||||
|
|
||||||
### server
|
### server
|
||||||
|
|
||||||
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml)
|
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml)
|
||||||
|
|
||||||
> 基于`Golang`搭建,提供接口数据支撑。
|
> 基于`Golang`搭建,提供接口数据支撑。
|
||||||
|
|
||||||
技术栈
|
技术栈
|
||||||
|
|
||||||
- iris ([https://github.com/kataras/iris](https://github.com/kataras/iris)) Go语言 mvc 框架
|
- iris ([https://github.com/kataras/iris](https://github.com/kataras/iris)) Go语言 mvc 框架
|
||||||
- gorm ([http://gorm.io](http://gorm.io)) 最好用的Go语言数据库orm框架
|
- gorm ([http://gorm.io](http://gorm.io)) 最好用的Go语言数据库orm框架
|
||||||
- resty ([https://github.com/go-resty/resty](https://github.com/go-resty/resty)) Go语言好用的 http-client
|
- resty ([https://github.com/go-resty/resty](https://github.com/go-resty/resty)) Go语言好用的 http-client
|
||||||
- cron ([https://github.com/robfig/cron](https://github.com/robfig/cron)) 定时任务框架
|
- cron ([https://github.com/robfig/cron](https://github.com/robfig/cron)) 定时任务框架
|
||||||
- goquery ([https://github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)) html dom 元素解析
|
- goquery ([https://github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)) html dom 元素解析
|
||||||
|
|
||||||
### site
|
### site
|
||||||
|
|
||||||
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml)
|
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml)
|
||||||
|
|
||||||
> 前端页面渲染服务,基于`nuxt.js`搭建。
|
> 前端页面渲染服务,基于`nuxt.js`搭建。
|
||||||
|
|
||||||
技术栈
|
技术栈
|
||||||
|
|
||||||
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
|
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
|
||||||
- nuxt.js ([https://nuxtjs.org](https://nuxtjs.org)) 基于Vue的服务端渲染框架,效率高到爆
|
- nuxt.js ([https://nuxtjs.org](https://nuxtjs.org)) 基于Vue的服务端渲染框架,效率高到爆
|
||||||
|
|
||||||
### admin
|
### admin
|
||||||
|
|
||||||
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml)
|
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml)
|
||||||
|
|
||||||
> 管理后台系统,基于`vue.js + element-ui`搭建。
|
> 管理后台系统,基于`vue.js + element-ui`搭建。
|
||||||
|
|
||||||
技术栈
|
技术栈
|
||||||
|
|
||||||
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
|
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
|
||||||
- element-ui ([https://element.eleme.cn](https://element.eleme.cn)) 饿了么开源的基于 vue.js 的前端库
|
- element-ui ([https://element.eleme.cn](https://element.eleme.cn)) 饿了么开源的基于 vue.js 的前端库
|
||||||
|
|
||||||
## 功能预览
|
## 功能预览
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
<a href="https://github.com/mlogclub/bbs-go/graphs/contributors"><img src="https://opencollective.com/bbs-go/contributors.svg?width=890&button=false" /></a>
|
<a href="https://github.com/mlogclub/bbs-go/graphs/contributors"><img src="https://opencollective.com/bbs-go/contributors.svg?width=890&button=false" /></a>
|
||||||
|
|||||||
82
bbs-go-active/server/.gitignore
vendored
82
bbs-go-active/server/.gitignore
vendored
@@ -1,41 +1,41 @@
|
|||||||
# Binaries for programs and plugins
|
# Binaries for programs and plugins
|
||||||
*.exe
|
*.exe
|
||||||
*.exe~
|
*.exe~
|
||||||
*.dll
|
*.dll
|
||||||
*.so
|
*.so
|
||||||
*.dylib
|
*.dylib
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# Test binary, build with `go test -c`
|
# Test binary, build with `go test -c`
|
||||||
*.test
|
*.test
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
*.out
|
*.out
|
||||||
|
|
||||||
bbs-go
|
bbs-go
|
||||||
|
|
||||||
bbs-go.yaml
|
bbs-go.yaml
|
||||||
bbs-go.prod.yaml
|
bbs-go.prod.yaml
|
||||||
bbs-go.dev.yaml
|
bbs-go.dev.yaml
|
||||||
bbs-go.test.yaml
|
bbs-go.test.yaml
|
||||||
|
|
||||||
.idea/*
|
.idea/*
|
||||||
build/*
|
build/*
|
||||||
|
|
||||||
cscope.files
|
cscope.files
|
||||||
tags
|
tags
|
||||||
|
|
||||||
logs/*.log
|
logs/*.log
|
||||||
web/*
|
web/*
|
||||||
tmp/*
|
tmp/*
|
||||||
admin/*
|
admin/*
|
||||||
|
|
||||||
internal/web*
|
internal/web*
|
||||||
|
|
||||||
cmd/generator/*
|
cmd/generator/*
|
||||||
go.work
|
go.work
|
||||||
go.work.sum
|
go.work.sum
|
||||||
|
|
||||||
ip2region.xdb
|
ip2region.xdb
|
||||||
|
|
||||||
__debug_bin*
|
__debug_bin*
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,2 +1,2 @@
|
|||||||
## 介绍
|
## 介绍
|
||||||
该项目使用Golang进行构建,具体参见:https://mlog.club
|
该项目使用Golang进行构建,具体参见:https://mlog.club
|
||||||
|
|||||||
@@ -1,65 +1,65 @@
|
|||||||
Port: 8082 # 端口
|
Port: 8082 # 端口
|
||||||
BaseUrl: https://mlog.club # 网站域名
|
BaseUrl: https://mlog.club # 网站域名
|
||||||
IpDataPath: # IP数据文件,默认读取当前目录下ip2region.xdb文件,最新数据文件请从这里下载:https://github.com/lionsoul2014/ip2region/tree/master/data
|
IpDataPath: # IP数据文件,默认读取当前目录下ip2region.xdb文件,最新数据文件请从这里下载:https://github.com/lionsoul2014/ip2region/tree/master/data
|
||||||
AllowedOrigins:
|
AllowedOrigins:
|
||||||
- "*"
|
- "*"
|
||||||
|
|
||||||
# 日志配置
|
# 日志配置
|
||||||
Logger:
|
Logger:
|
||||||
Filename: /data/logs/bbs-go.log # 日志文件的位置
|
Filename: /data/logs/bbs-go.log # 日志文件的位置
|
||||||
MaxSize: 100 # 文件最大尺寸(以MB为单位)
|
MaxSize: 100 # 文件最大尺寸(以MB为单位)
|
||||||
MaxAge: 10 # 保留旧文件的最大天数
|
MaxAge: 10 # 保留旧文件的最大天数
|
||||||
MaxBackups: 10 # 保留的最大旧文件数量
|
MaxBackups: 10 # 保留的最大旧文件数量
|
||||||
|
|
||||||
|
|
||||||
# 数据库连接
|
# 数据库连接
|
||||||
DB:
|
DB:
|
||||||
Url: username:password@tcp(localhost:3306)/bbsgo_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
|
Url: username:password@tcp(localhost:3306)/bbsgo_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
|
||||||
MaxIdleConns: 50
|
MaxIdleConns: 50
|
||||||
MaxOpenConns: 200
|
MaxOpenConns: 200
|
||||||
|
|
||||||
# 上传配置
|
# 上传配置
|
||||||
Uploader:
|
Uploader:
|
||||||
# 启用上传方式
|
# 启用上传方式
|
||||||
Enable: Oss
|
Enable: Oss
|
||||||
# 阿里云oss配置
|
# 阿里云oss配置
|
||||||
AliyunOss:
|
AliyunOss:
|
||||||
Host: # 阿里云OSS资源外网访问地址
|
Host: # 阿里云OSS资源外网访问地址
|
||||||
Bucket: # 阿里云OSS bucket名称
|
Bucket: # 阿里云OSS bucket名称
|
||||||
Endpoint: # 阿里云OSS Endpoint
|
Endpoint: # 阿里云OSS Endpoint
|
||||||
AccessId: # 阿里云OSS accessID
|
AccessId: # 阿里云OSS accessID
|
||||||
AccessSecret: # 阿里云OSS accessKey
|
AccessSecret: # 阿里云OSS accessKey
|
||||||
StyleSplitter: # 阿里云oss图片样式分隔符
|
StyleSplitter: # 阿里云oss图片样式分隔符
|
||||||
StyleAvatar: # 头像图片样式名称
|
StyleAvatar: # 头像图片样式名称
|
||||||
StylePreview: # 预览图片样式名称
|
StylePreview: # 预览图片样式名称
|
||||||
StyleSmall: # 小图样式名称
|
StyleSmall: # 小图样式名称
|
||||||
StyleDetail: # 详情图片样式名称
|
StyleDetail: # 详情图片样式名称
|
||||||
# 本地文件上传
|
# 本地文件上传
|
||||||
Local:
|
Local:
|
||||||
Host: https://st.mlog.club/ # 上传文件域名
|
Host: https://st.mlog.club/ # 上传文件域名
|
||||||
Path: /data/www/st.mlog.club # 上传目录
|
Path: /data/www/st.mlog.club # 上传目录
|
||||||
|
|
||||||
# 邮件服务器配置,用于邮件通知
|
# 邮件服务器配置,用于邮件通知
|
||||||
Smtp:
|
Smtp:
|
||||||
Host: # smtp服务地址,请设置成你自己的,例如:smtp.qq.com
|
Host: # smtp服务地址,请设置成你自己的,例如:smtp.qq.com
|
||||||
Port: # smtp服务端口,请设置成你自己额,例如:25
|
Port: # smtp服务端口,请设置成你自己额,例如:25
|
||||||
Username: # 请配置成你自己的
|
Username: # 请配置成你自己的
|
||||||
Password: # 请配置成你自己的
|
Password: # 请配置成你自己的
|
||||||
SSL: true
|
SSL: true
|
||||||
|
|
||||||
# 百度SEO相关配置
|
# 百度SEO相关配置
|
||||||
# 文档:https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14
|
# 文档:https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14
|
||||||
BaiduSEO:
|
BaiduSEO:
|
||||||
Site:
|
Site:
|
||||||
Token:
|
Token:
|
||||||
|
|
||||||
# 神马搜索SEO相关
|
# 神马搜索SEO相关
|
||||||
# 文档:https://zhanzhang.sm.cn/open/mip
|
# 文档:https://zhanzhang.sm.cn/open/mip
|
||||||
SmSEO:
|
SmSEO:
|
||||||
Site:
|
Site:
|
||||||
UserName:
|
UserName:
|
||||||
Token:
|
Token:
|
||||||
|
|
||||||
# search
|
# search
|
||||||
Search:
|
Search:
|
||||||
IndexPath: # 索引路径
|
IndexPath: # 索引路径
|
||||||
52
bbs-go/.github/workflows/bbs-go-server.yml
vendored
52
bbs-go/.github/workflows/bbs-go-server.yml
vendored
@@ -1,26 +1,26 @@
|
|||||||
name: bbs-go-server
|
name: bbs-go-server
|
||||||
|
|
||||||
on: [ push ]
|
on: [ push ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.21
|
go-version: 1.21
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: ./server
|
working-directory: ./server
|
||||||
run: |
|
run: |
|
||||||
go mod download
|
go mod download
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ./server
|
working-directory: ./server
|
||||||
run: |
|
run: |
|
||||||
make build
|
make build
|
||||||
|
|||||||
62
bbs-go/.github/workflows/bbs-go-site.yml
vendored
62
bbs-go/.github/workflows/bbs-go-site.yml
vendored
@@ -1,32 +1,32 @@
|
|||||||
name: bbs-go-site
|
name: bbs-go-site
|
||||||
|
|
||||||
on: [ push ]
|
on: [ push ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [ 20.x ]
|
node-version: [ 20.x ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: pnpm/action-setup@v3
|
- uses: pnpm/action-setup@v3
|
||||||
with:
|
with:
|
||||||
version: 8
|
version: 8
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
cache-dependency-path: site/pnpm-lock.yaml
|
cache-dependency-path: site/pnpm-lock.yaml
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: ./site
|
working-directory: ./site
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ./site
|
working-directory: ./site
|
||||||
run: |
|
run: |
|
||||||
pnpm build
|
pnpm build
|
||||||
12
bbs-go/.gitignore
vendored
12
bbs-go/.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
.idea
|
.idea
|
||||||
dist
|
dist
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
.nuxt
|
.nuxt
|
||||||
.docker-compose/mysql/data
|
.docker-compose/mysql/data
|
||||||
1348
bbs-go/LICENSE
1348
bbs-go/LICENSE
File diff suppressed because it is too large
Load Diff
170
bbs-go/README.md
170
bbs-go/README.md
@@ -1,85 +1,85 @@
|
|||||||
## 项目地址
|
## 项目地址
|
||||||
|
|
||||||
- 演示站:[https://bbs.bbs-go.com](https://bbs.bbs-go.com)
|
- 演示站:[https://bbs.bbs-go.com](https://bbs.bbs-go.com)
|
||||||
- 文档地址:[https://bbs-go.com](https://bbs-go.com)
|
- 文档地址:[https://bbs-go.com](https://bbs-go.com)
|
||||||
- 问题反馈: [https://mlog.club/topics/node/3](https://mlog.club/topics/node/3)
|
- 问题反馈: [https://mlog.club/topics/node/3](https://mlog.club/topics/node/3)
|
||||||
- Github: [https://github.com/mlogclub/bbs-go](https://github.com/mlogclub/bbs-go)
|
- Github: [https://github.com/mlogclub/bbs-go](https://github.com/mlogclub/bbs-go)
|
||||||
- Gitee: [https://gitee.com/mlogclub/bbs-go](https://gitee.com/mlogclub/bbs-go)
|
- Gitee: [https://gitee.com/mlogclub/bbs-go](https://gitee.com/mlogclub/bbs-go)
|
||||||
|
|
||||||
## 联系我
|
## 联系我
|
||||||
|
|
||||||
### 用户交流群
|
### 用户交流群
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 加我微信
|
### 加我微信
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 介绍
|
## 介绍
|
||||||
|
|
||||||
`bbs-go` 是一个基于 Go 语言开发的开源社区论坛系统。它的设计旨在提供轻量、高效的社区讨论平台,支持现代化的 Web 技术栈,并且易于扩展和部署。bbs-go 项目采用模块化架构,能够与其他服务和前端框架无缝集成,适合各种规模的在线社区。
|
`bbs-go` 是一个基于 Go 语言开发的开源社区论坛系统。它的设计旨在提供轻量、高效的社区讨论平台,支持现代化的 Web 技术栈,并且易于扩展和部署。bbs-go 项目采用模块化架构,能够与其他服务和前端框架无缝集成,适合各种规模的在线社区。
|
||||||
|
|
||||||
项目的主要特点包括:
|
项目的主要特点包括:
|
||||||
|
|
||||||
- **高性能**:基于 Go 语言的并发特性,能够在高负载下保持良好的性能表现。
|
- **高性能**:基于 Go 语言的并发特性,能够在高负载下保持良好的性能表现。
|
||||||
- **灵活性**:支持自定义配置、插件扩展,易于适应不同需求。
|
- **灵活性**:支持自定义配置、插件扩展,易于适应不同需求。
|
||||||
- **简单易用**:提供简洁的管理后台,方便社区管理员管理论坛内容和用户。
|
- **简单易用**:提供简洁的管理后台,方便社区管理员管理论坛内容和用户。
|
||||||
- **支持 MySQL 数据库**:提供对常见数据库的支持,确保数据存储的可靠性和稳定性。
|
- **支持 MySQL 数据库**:提供对常见数据库的支持,确保数据存储的可靠性和稳定性。
|
||||||
- **响应式设计**:前端使用现代化的技术,能够在移动设备和桌面设备上提供良好的用户体验。
|
- **响应式设计**:前端使用现代化的技术,能够在移动设备和桌面设备上提供良好的用户体验。
|
||||||
|
|
||||||
项目主要面向开发者和社区管理者,适合搭建技术讨论、兴趣分享等类型的社区论坛。
|
项目主要面向开发者和社区管理者,适合搭建技术讨论、兴趣分享等类型的社区论坛。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 模块
|
## 模块
|
||||||
|
|
||||||
### server
|
### server
|
||||||
|
|
||||||
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml)
|
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml)
|
||||||
|
|
||||||
> 基于`Golang`搭建,提供接口数据支撑。
|
> 基于`Golang`搭建,提供接口数据支撑。
|
||||||
|
|
||||||
技术栈
|
技术栈
|
||||||
|
|
||||||
- iris ([https://github.com/kataras/iris](https://github.com/kataras/iris)) Go语言 mvc 框架
|
- iris ([https://github.com/kataras/iris](https://github.com/kataras/iris)) Go语言 mvc 框架
|
||||||
- gorm ([http://gorm.io](http://gorm.io)) 最好用的Go语言数据库orm框架
|
- gorm ([http://gorm.io](http://gorm.io)) 最好用的Go语言数据库orm框架
|
||||||
- resty ([https://github.com/go-resty/resty](https://github.com/go-resty/resty)) Go语言好用的 http-client
|
- resty ([https://github.com/go-resty/resty](https://github.com/go-resty/resty)) Go语言好用的 http-client
|
||||||
- cron ([https://github.com/robfig/cron](https://github.com/robfig/cron)) 定时任务框架
|
- cron ([https://github.com/robfig/cron](https://github.com/robfig/cron)) 定时任务框架
|
||||||
- goquery ([https://github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)) html dom 元素解析
|
- goquery ([https://github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)) html dom 元素解析
|
||||||
|
|
||||||
### site
|
### site
|
||||||
|
|
||||||
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml)
|
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml)
|
||||||
|
|
||||||
> 前端页面渲染服务,基于`nuxt.js`搭建。
|
> 前端页面渲染服务,基于`nuxt.js`搭建。
|
||||||
|
|
||||||
技术栈
|
技术栈
|
||||||
|
|
||||||
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
|
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
|
||||||
- nuxt.js ([https://nuxtjs.org](https://nuxtjs.org)) 基于Vue的服务端渲染框架,效率高到爆
|
- nuxt.js ([https://nuxtjs.org](https://nuxtjs.org)) 基于Vue的服务端渲染框架,效率高到爆
|
||||||
|
|
||||||
### admin
|
### admin
|
||||||
|
|
||||||
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml)
|
[](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml)
|
||||||
|
|
||||||
> 管理后台系统,基于`vue.js + element-ui`搭建。
|
> 管理后台系统,基于`vue.js + element-ui`搭建。
|
||||||
|
|
||||||
技术栈
|
技术栈
|
||||||
|
|
||||||
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
|
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
|
||||||
- element-ui ([https://element.eleme.cn](https://element.eleme.cn)) 饿了么开源的基于 vue.js 的前端库
|
- element-ui ([https://element.eleme.cn](https://element.eleme.cn)) 饿了么开源的基于 vue.js 的前端库
|
||||||
|
|
||||||
## 功能预览
|
## 功能预览
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
<a href="https://github.com/mlogclub/bbs-go/graphs/contributors"><img src="https://opencollective.com/bbs-go/contributors.svg?width=890&button=false" /></a>
|
<a href="https://github.com/mlogclub/bbs-go/graphs/contributors"><img src="https://opencollective.com/bbs-go/contributors.svg?width=890&button=false" /></a>
|
||||||
|
|||||||
82
bbs-go/server/.gitignore
vendored
82
bbs-go/server/.gitignore
vendored
@@ -1,41 +1,41 @@
|
|||||||
# Binaries for programs and plugins
|
# Binaries for programs and plugins
|
||||||
*.exe
|
*.exe
|
||||||
*.exe~
|
*.exe~
|
||||||
*.dll
|
*.dll
|
||||||
*.so
|
*.so
|
||||||
*.dylib
|
*.dylib
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
# Test binary, build with `go test -c`
|
# Test binary, build with `go test -c`
|
||||||
*.test
|
*.test
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
*.out
|
*.out
|
||||||
|
|
||||||
bbs-go
|
bbs-go
|
||||||
|
|
||||||
bbs-go.yaml
|
bbs-go.yaml
|
||||||
bbs-go.prod.yaml
|
bbs-go.prod.yaml
|
||||||
bbs-go.dev.yaml
|
bbs-go.dev.yaml
|
||||||
bbs-go.test.yaml
|
bbs-go.test.yaml
|
||||||
|
|
||||||
.idea/*
|
.idea/*
|
||||||
build/*
|
build/*
|
||||||
|
|
||||||
cscope.files
|
cscope.files
|
||||||
tags
|
tags
|
||||||
|
|
||||||
logs/*.log
|
logs/*.log
|
||||||
web/*
|
web/*
|
||||||
tmp/*
|
tmp/*
|
||||||
admin/*
|
admin/*
|
||||||
|
|
||||||
internal/web*
|
internal/web*
|
||||||
|
|
||||||
cmd/generator/*
|
cmd/generator/*
|
||||||
go.work
|
go.work
|
||||||
go.work.sum
|
go.work.sum
|
||||||
|
|
||||||
ip2region.xdb
|
ip2region.xdb
|
||||||
|
|
||||||
__debug_bin*
|
__debug_bin*
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,2 +1,2 @@
|
|||||||
## 介绍
|
## 介绍
|
||||||
该项目使用Golang进行构建,具体参见:https://mlog.club
|
该项目使用Golang进行构建,具体参见:https://mlog.club
|
||||||
|
|||||||
@@ -1,65 +1,65 @@
|
|||||||
Port: 8082 # 端口
|
Port: 8082 # 端口
|
||||||
BaseUrl: https://mlog.club # 网站域名
|
BaseUrl: https://mlog.club # 网站域名
|
||||||
IpDataPath: # IP数据文件,默认读取当前目录下ip2region.xdb文件,最新数据文件请从这里下载:https://github.com/lionsoul2014/ip2region/tree/master/data
|
IpDataPath: # IP数据文件,默认读取当前目录下ip2region.xdb文件,最新数据文件请从这里下载:https://github.com/lionsoul2014/ip2region/tree/master/data
|
||||||
AllowedOrigins:
|
AllowedOrigins:
|
||||||
- "*"
|
- "*"
|
||||||
|
|
||||||
# 日志配置
|
# 日志配置
|
||||||
Logger:
|
Logger:
|
||||||
Filename: /data/logs/bbs-go.log # 日志文件的位置
|
Filename: /data/logs/bbs-go.log # 日志文件的位置
|
||||||
MaxSize: 100 # 文件最大尺寸(以MB为单位)
|
MaxSize: 100 # 文件最大尺寸(以MB为单位)
|
||||||
MaxAge: 10 # 保留旧文件的最大天数
|
MaxAge: 10 # 保留旧文件的最大天数
|
||||||
MaxBackups: 10 # 保留的最大旧文件数量
|
MaxBackups: 10 # 保留的最大旧文件数量
|
||||||
|
|
||||||
|
|
||||||
# 数据库连接
|
# 数据库连接
|
||||||
DB:
|
DB:
|
||||||
Url: username:password@tcp(localhost:3306)/bbsgo_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
|
Url: username:password@tcp(localhost:3306)/bbsgo_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
|
||||||
MaxIdleConns: 50
|
MaxIdleConns: 50
|
||||||
MaxOpenConns: 200
|
MaxOpenConns: 200
|
||||||
|
|
||||||
# 上传配置
|
# 上传配置
|
||||||
Uploader:
|
Uploader:
|
||||||
# 启用上传方式
|
# 启用上传方式
|
||||||
Enable: Oss
|
Enable: Oss
|
||||||
# 阿里云oss配置
|
# 阿里云oss配置
|
||||||
AliyunOss:
|
AliyunOss:
|
||||||
Host: # 阿里云OSS资源外网访问地址
|
Host: # 阿里云OSS资源外网访问地址
|
||||||
Bucket: # 阿里云OSS bucket名称
|
Bucket: # 阿里云OSS bucket名称
|
||||||
Endpoint: # 阿里云OSS Endpoint
|
Endpoint: # 阿里云OSS Endpoint
|
||||||
AccessId: # 阿里云OSS accessID
|
AccessId: # 阿里云OSS accessID
|
||||||
AccessSecret: # 阿里云OSS accessKey
|
AccessSecret: # 阿里云OSS accessKey
|
||||||
StyleSplitter: # 阿里云oss图片样式分隔符
|
StyleSplitter: # 阿里云oss图片样式分隔符
|
||||||
StyleAvatar: # 头像图片样式名称
|
StyleAvatar: # 头像图片样式名称
|
||||||
StylePreview: # 预览图片样式名称
|
StylePreview: # 预览图片样式名称
|
||||||
StyleSmall: # 小图样式名称
|
StyleSmall: # 小图样式名称
|
||||||
StyleDetail: # 详情图片样式名称
|
StyleDetail: # 详情图片样式名称
|
||||||
# 本地文件上传
|
# 本地文件上传
|
||||||
Local:
|
Local:
|
||||||
Host: https://st.mlog.club/ # 上传文件域名
|
Host: https://st.mlog.club/ # 上传文件域名
|
||||||
Path: /data/www/st.mlog.club # 上传目录
|
Path: /data/www/st.mlog.club # 上传目录
|
||||||
|
|
||||||
# 邮件服务器配置,用于邮件通知
|
# 邮件服务器配置,用于邮件通知
|
||||||
Smtp:
|
Smtp:
|
||||||
Host: # smtp服务地址,请设置成你自己的,例如:smtp.qq.com
|
Host: # smtp服务地址,请设置成你自己的,例如:smtp.qq.com
|
||||||
Port: # smtp服务端口,请设置成你自己额,例如:25
|
Port: # smtp服务端口,请设置成你自己额,例如:25
|
||||||
Username: # 请配置成你自己的
|
Username: # 请配置成你自己的
|
||||||
Password: # 请配置成你自己的
|
Password: # 请配置成你自己的
|
||||||
SSL: true
|
SSL: true
|
||||||
|
|
||||||
# 百度SEO相关配置
|
# 百度SEO相关配置
|
||||||
# 文档:https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14
|
# 文档:https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14
|
||||||
BaiduSEO:
|
BaiduSEO:
|
||||||
Site:
|
Site:
|
||||||
Token:
|
Token:
|
||||||
|
|
||||||
# 神马搜索SEO相关
|
# 神马搜索SEO相关
|
||||||
# 文档:https://zhanzhang.sm.cn/open/mip
|
# 文档:https://zhanzhang.sm.cn/open/mip
|
||||||
SmSEO:
|
SmSEO:
|
||||||
Site:
|
Site:
|
||||||
UserName:
|
UserName:
|
||||||
Token:
|
Token:
|
||||||
|
|
||||||
# search
|
# search
|
||||||
Search:
|
Search:
|
||||||
IndexPath: # 索引路径
|
IndexPath: # 索引路径
|
||||||
@@ -1,23 +1,28 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# 定义变量
|
# 定义变量
|
||||||
DOMAIN="registry.deepseak.icu" # 请替换为你的域名
|
DOMAIN="registry.deepseak.icu" # 主域名
|
||||||
|
ADDITIONAL_DOMAINS=("active.deepseak.icu" "bbs.deepseak.icu" "image.deepseak.icu" "gitea.deepseak.icu") # 额外域名
|
||||||
EMAIL="hpuzhagnwei@163.com" # 请替换为你的邮箱地址
|
EMAIL="hpuzhagnwei@163.com" # 请替换为你的邮箱地址
|
||||||
|
|
||||||
# 检查 Certbot 是否安装
|
# 检查 Certbot 是否安装
|
||||||
if ! command -v certbot &> /dev/null
|
if ! command -v certbot &> /dev/null
|
||||||
then
|
then
|
||||||
echo "Certbot 未安装,开始安装..."
|
echo "Certbot 未安装,开始安装..."
|
||||||
sudo dnf install epel-release -y
|
sudo apt update
|
||||||
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
|
sudo apt install -y certbot python3-certbot-nginx
|
||||||
sudo dnf config-manager --set-enabled crb
|
|
||||||
sudo dnf update
|
|
||||||
sudo dnf install certbot python3-certbot-nginx -y
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 申请证书
|
# 申请证书
|
||||||
echo "开始申请证书..."
|
echo "开始申请证书..."
|
||||||
sudo certbot certonly --nginx -d $DOMAIN --email $EMAIL --agree-tos --no-eff-email
|
|
||||||
|
# 构建域名参数
|
||||||
|
DOMAIN_ARGS="-d $DOMAIN"
|
||||||
|
for domain in "${ADDITIONAL_DOMAINS[@]}"; do
|
||||||
|
DOMAIN_ARGS="$DOMAIN_ARGS -d $domain"
|
||||||
|
done
|
||||||
|
|
||||||
|
sudo certbot certonly --nginx $DOMAIN_ARGS --email $EMAIL --agree-tos --no-eff-email
|
||||||
|
|
||||||
# 检查证书是否申请成功
|
# 检查证书是否申请成功
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=frpc
|
Description=frpc
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5s
|
RestartSec=5s
|
||||||
ExecStart=/usr/local/bin/frpc -c /etc/frpc/frpc.toml
|
ExecStart=/usr/local/bin/frpc -c /etc/frpc/frpc.toml
|
||||||
LimitNOFILE=1048576
|
LimitNOFILE=1048576
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
# frpc 基础配置
|
# frpc 基础配置
|
||||||
serverAddr = "47.239.121.24"
|
serverAddr = "47.239.121.24"
|
||||||
serverPort = 7000
|
serverPort = 7000
|
||||||
auth.method = "token"
|
auth.method = "token"
|
||||||
auth.token = "8f3c9b7d5e2a4f6h1i0j"
|
auth.token = "8f3c9b7d5e2a4f6h1i0j"
|
||||||
|
|
||||||
[[proxies]]
|
[[proxies]]
|
||||||
name = "http"
|
name = "http"
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
localIP = "127.0.0.1"
|
localIP = "127.0.0.1"
|
||||||
localPort = 80
|
localPort = 80
|
||||||
remotePort = 80
|
remotePort = 80
|
||||||
|
|
||||||
[[proxies]]
|
[[proxies]]
|
||||||
name = "https"
|
name = "https"
|
||||||
type = "tcp"
|
type = "tcp"
|
||||||
localIP = "127.0.0.1"
|
localIP = "127.0.0.1"
|
||||||
localPort = 443
|
localPort = 443
|
||||||
remotePort = 443
|
remotePort = 443
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:latest
|
||||||
container_name: gitea
|
container_name: gitea
|
||||||
environment:
|
environment:
|
||||||
- GITEA__database__DB_TYPE=sqlite3
|
- GITEA__database__DB_TYPE=sqlite3
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./gitea:/data
|
- ./gitea:/data
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
ports:
|
ports:
|
||||||
- "3002:3000"
|
- "3002:3000"
|
||||||
- "222:22"
|
- "222:22"
|
||||||
@@ -1,39 +1,39 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name navidrome.deepseak.icu;
|
server_name navidrome.deepseak.icu;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:4533;
|
proxy_pass http://127.0.0.1:4533;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
# 添加代理超时配置
|
# 添加代理超时配置
|
||||||
proxy_connect_timeout 60s;
|
proxy_connect_timeout 60s;
|
||||||
proxy_read_timeout 600s;
|
proxy_read_timeout 600s;
|
||||||
proxy_send_timeout 600s;
|
proxy_send_timeout 600s;
|
||||||
|
|
||||||
# 针对Navidrome的特殊配置
|
# 针对Navidrome的特殊配置
|
||||||
# 支持大文件上传和流媒体传输
|
# 支持大文件上传和流媒体传输
|
||||||
client_max_body_size 100M;
|
client_max_body_size 100M;
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
|
|
||||||
# 启用gzip压缩
|
# 启用gzip压缩
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
gzip_min_length 1024;
|
gzip_min_length 1024;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_comp_level 6;
|
gzip_comp_level 6;
|
||||||
gzip_types
|
gzip_types
|
||||||
text/plain
|
text/plain
|
||||||
text/css
|
text/css
|
||||||
text/xml
|
text/xml
|
||||||
text/javascript
|
text/javascript
|
||||||
application/json
|
application/json
|
||||||
application/javascript
|
application/javascript
|
||||||
application/xml+rss
|
application/xml+rss
|
||||||
application/atom+xml
|
application/atom+xml
|
||||||
image/svg+xml;
|
image/svg+xml;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
254
nginx/nginx.conf
254
nginx/nginx.conf
@@ -1,127 +1,127 @@
|
|||||||
user nginx;
|
user nginx;
|
||||||
worker_processes auto;
|
worker_processes auto;
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log notice;
|
error_log /var/log/nginx/error.log notice;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 1024;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log main;
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
#tcp_nopush on;
|
#tcp_nopush on;
|
||||||
|
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
|
|
||||||
#gzip on;
|
#gzip on;
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name active.deepseak.icu;
|
server_name active.deepseak.icu;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/active.deepseak.icu/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/registry.deepseak.icu/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/active.deepseak.icu/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/registry.deepseak.icu/privkey.pem;
|
||||||
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||||
client_max_body_size 5m;
|
client_max_body_size 5m;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:3006;
|
proxy_pass http://127.0.0.1:3006;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name bbs.deepseak.icu;
|
server_name bbs.deepseak.icu;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/bbs.deepseak.icu/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/registry.deepseak.icu/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/bbs.deepseak.icu/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/registry.deepseak.icu/privkey.pem;
|
||||||
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||||
client_max_body_size 5m;
|
client_max_body_size 5m;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:3003;
|
proxy_pass http://127.0.0.1:3003;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
server_name image.deepseak.icu;
|
server_name image.deepseak.icu;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/image.deepseak.icu/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/registry.deepseak.icu/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/image.deepseak.icu/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/registry.deepseak.icu/privkey.pem;
|
||||||
|
|
||||||
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
ssl_protocols TLSv1.2 TLSv1.3;
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||||
|
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:3004;
|
proxy_pass http://127.0.0.1:3004;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 添加gitea的HTTP代理
|
# 添加gitea的HTTP代理
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name gitea.deepseak.icu;
|
server_name gitea.deepseak.icu;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:3002;
|
proxy_pass http://10.0.3.14:3002;
|
||||||
# 添加代理超时配置
|
# 添加代理超时配置
|
||||||
proxy_connect_timeout 60s;
|
proxy_connect_timeout 60s;
|
||||||
proxy_read_timeout 600s;
|
proxy_read_timeout 600s;
|
||||||
proxy_send_timeout 600s;
|
proxy_send_timeout 600s;
|
||||||
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
# 添加错误跟踪头
|
# 添加错误跟踪头
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
}
|
}
|
||||||
client_max_body_size 50m;
|
client_max_body_size 50m;
|
||||||
}
|
}
|
||||||
|
|
||||||
# 增加一个空的server,用于申请证书
|
# 增加一个空的server,用于申请证书
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name aaa.deepseak.icu;
|
server_name aaa.deepseak.icu;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +1,36 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 检查并创建nginx用户
|
||||||
|
if ! id -u nginx >/dev/null 2>&1; then
|
||||||
|
echo "创建nginx用户..."
|
||||||
|
sudo useradd -r -s /sbin/nologin nginx
|
||||||
|
fi
|
||||||
|
|
||||||
# 创建 conf.d 目录(如果不存在)
|
# 创建 conf.d 目录(如果不存在)
|
||||||
mkdir -p /etc/nginx/conf.d
|
sudo mkdir -p /etc/nginx/conf.d
|
||||||
|
|
||||||
# 备份并覆盖 nginx.conf 文件
|
# 备份并覆盖 nginx.conf 文件
|
||||||
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
|
sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
|
||||||
cp nginx.conf /etc/nginx/
|
sudo cp nginx.conf /etc/nginx/
|
||||||
|
|
||||||
# 备份并覆盖 conf.d 目录下的所有 .conf 文件
|
# 备份并覆盖 conf.d 目录下的所有 .conf 文件
|
||||||
for conf in conf.d/*.conf; do
|
for conf in conf.d/*.conf; do
|
||||||
filename=$(basename "$conf")
|
filename=$(basename "$conf")
|
||||||
cp "/etc/nginx/conf.d/$filename" "/etc/nginx/conf.d/${filename}.bak" 2>/dev/null || true
|
sudo cp "/etc/nginx/conf.d/$filename" "/etc/nginx/conf.d/${filename}.bak" 2>/dev/null || true
|
||||||
cp "$conf" /etc/nginx/conf.d/
|
sudo cp "$conf" /etc/nginx/conf.d/
|
||||||
done
|
done
|
||||||
|
|
||||||
# 测试并重载配置
|
# 测试并重载配置
|
||||||
if nginx -t; then
|
if sudo nginx -t; then
|
||||||
systemctl reload nginx
|
sudo systemctl reload nginx
|
||||||
echo "配置已生效,HTTPS已启用"
|
echo "配置已生效,HTTPS已启用"
|
||||||
else
|
else
|
||||||
echo "配置测试失败,已恢复备份"
|
echo "配置测试失败,已恢复备份"
|
||||||
# 恢复 nginx.conf 备份
|
# 恢复 nginx.conf 备份
|
||||||
cp /etc/nginx/nginx.conf.bak /etc/nginx/nginx.conf
|
sudo cp /etc/nginx/nginx.conf.bak /etc/nginx/nginx.conf
|
||||||
# 恢复 conf.d 目录下的所有 .conf 文件备份
|
# 恢复 conf.d 目录下的所有 .conf 文件备份
|
||||||
for conf in conf.d/*.conf; do
|
for conf in conf.d/*.conf; do
|
||||||
filename=$(basename "$conf")
|
filename=$(basename "$conf")
|
||||||
mv -f "/etc/nginx/conf.d/${filename}.bak" "/etc/nginx/conf.d/$filename" 2>/dev/null || true
|
sudo mv -f "/etc/nginx/conf.d/${filename}.bak" "/etc/nginx/conf.d/$filename" 2>/dev/null || true
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
registry:
|
registry:
|
||||||
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/registry:2.8.1
|
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/registry:2.8.1
|
||||||
container_name: registry
|
container_name: registry
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
|
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
|
||||||
volumes:
|
volumes:
|
||||||
- ./auth:/auth
|
- ./auth:/auth
|
||||||
- ./data:/var/lib/registry
|
- ./data:/var/lib/registry
|
||||||
ports:
|
ports:
|
||||||
- "3005:5000"
|
- "3005:5000"
|
||||||
@@ -1,337 +1,337 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
# - `/etc/headscale`
|
# - `/etc/headscale`
|
||||||
# - `~/.headscale`
|
# - `~/.headscale`
|
||||||
# - 当前工作目录
|
# - 当前工作目录
|
||||||
|
|
||||||
|
|
||||||
## 1. 更新Headscale配置启用HTTPS
|
## 1. 更新Headscale配置启用HTTPS
|
||||||
|
|
||||||
# 修改server_url为HTTPS
|
# 修改server_url为HTTPS
|
||||||
server_url: https://47.239.121.24:3009
|
server_url: https://47.239.121.24:3009
|
||||||
|
|
||||||
# 启用HTTPS监听
|
# 启用HTTPS监听
|
||||||
listen_addr: 0.0.0.0:8443
|
listen_addr: 0.0.0.0:8443
|
||||||
|
|
||||||
# 添加TLS配置
|
# 添加TLS配置
|
||||||
tls_cert_path: "/var/lib/headscale/server.crt"
|
tls_cert_path: "/var/lib/headscale/server.crt"
|
||||||
tls_key_path: "/var/lib/headscale/server.key"
|
tls_key_path: "/var/lib/headscale/server.key"
|
||||||
|
|
||||||
# 指标监听地址(建议保持内网访问)
|
# 指标监听地址(建议保持内网访问)
|
||||||
metrics_listen_addr: 127.0.0.1:9090
|
metrics_listen_addr: 127.0.0.1:9090
|
||||||
|
|
||||||
# gRPC监听地址(用于远程CLI控制)
|
# gRPC监听地址(用于远程CLI控制)
|
||||||
grpc_listen_addr: 0.0.0.0:50443
|
grpc_listen_addr: 0.0.0.0:50443
|
||||||
|
|
||||||
# 允许不安全的gRPC连接(不建议生产环境使用)
|
# 允许不安全的gRPC连接(不建议生产环境使用)
|
||||||
grpc_allow_insecure: true
|
grpc_allow_insecure: true
|
||||||
|
|
||||||
# Noise协议配置
|
# Noise协议配置
|
||||||
noise:
|
noise:
|
||||||
# 噪声协议私钥路径
|
# 噪声协议私钥路径
|
||||||
private_key_path: /var/lib/headscale/noise_private.key
|
private_key_path: /var/lib/headscale/noise_private.key
|
||||||
|
|
||||||
# IP地址分配前缀
|
# IP地址分配前缀
|
||||||
prefixes:
|
prefixes:
|
||||||
v4: 100.64.0.0/10
|
v4: 100.64.0.0/10
|
||||||
v6: fd7a:115c:a1e0::/48
|
v6: fd7a:115c:a1e0::/48
|
||||||
# IP分配策略:sequential(顺序)或 random(随机)
|
# IP分配策略:sequential(顺序)或 random(随机)
|
||||||
allocation: sequential
|
allocation: sequential
|
||||||
|
|
||||||
# DERP中继服务器配置
|
# DERP中继服务器配置
|
||||||
derp:
|
derp:
|
||||||
server:
|
server:
|
||||||
# 启用内置DERP服务器
|
# 启用内置DERP服务器
|
||||||
enabled: true
|
enabled: true
|
||||||
# 区域ID(避免与公共DERP区域冲突)
|
# 区域ID(避免与公共DERP区域冲突)
|
||||||
region_id: 999
|
region_id: 999
|
||||||
# 区域代码和名称(显示在客户端UI中)
|
# 区域代码和名称(显示在客户端UI中)
|
||||||
region_code: "headscale"
|
region_code: "headscale"
|
||||||
region_name: "Headscale Embedded DERP"
|
region_name: "Headscale Embedded DERP"
|
||||||
# STUN服务监听地址(用于NAT穿透)
|
# STUN服务监听地址(用于NAT穿透)
|
||||||
stun_listen_addr: "0.0.0.0:3478"
|
stun_listen_addr: "0.0.0.0:3478"
|
||||||
# DERP服务器私钥路径
|
# DERP服务器私钥路径
|
||||||
private_key_path: /var/lib/headscale/derp_server_private.key
|
private_key_path: /var/lib/headscale/derp_server_private.key
|
||||||
# 自动添加内置DERP区域到DERP映射
|
# 自动添加内置DERP区域到DERP映射
|
||||||
automatically_add_embedded_derp_region: true
|
automatically_add_embedded_derp_region: true
|
||||||
# 公网IPv4/IPv6地址(提高连接稳定性)
|
# 公网IPv4/IPv6地址(提高连接稳定性)
|
||||||
ipv4: 47.239.121.24
|
ipv4: 47.239.121.24
|
||||||
# ipv6: 2001:db8::1
|
# ipv6: 2001:db8::1
|
||||||
|
|
||||||
# List of externally available DERP maps encoded in JSON
|
# List of externally available DERP maps encoded in JSON
|
||||||
# urls:
|
# urls:
|
||||||
# - https://controlplane.tailscale.com/derpmap/default
|
# - https://controlplane.tailscale.com/derpmap/default
|
||||||
|
|
||||||
# Locally available DERP map files encoded in YAML
|
# Locally available DERP map files encoded in YAML
|
||||||
#
|
#
|
||||||
# This option is mostly interesting for people hosting
|
# This option is mostly interesting for people hosting
|
||||||
# their own DERP servers:
|
# their own DERP servers:
|
||||||
# https://tailscale.com/kb/1118/custom-derp-servers/
|
# https://tailscale.com/kb/1118/custom-derp-servers/
|
||||||
#
|
#
|
||||||
# paths:
|
# paths:
|
||||||
# - /etc/headscale/derp-example.yaml
|
# - /etc/headscale/derp-example.yaml
|
||||||
paths: []
|
paths: []
|
||||||
|
|
||||||
# If enabled, a worker will be set up to periodically
|
# If enabled, a worker will be set up to periodically
|
||||||
# refresh the given sources and update the derpmap
|
# refresh the given sources and update the derpmap
|
||||||
# will be set up.
|
# will be set up.
|
||||||
auto_update_enabled: true
|
auto_update_enabled: true
|
||||||
|
|
||||||
# How often should we check for DERP updates?
|
# How often should we check for DERP updates?
|
||||||
update_frequency: 24h
|
update_frequency: 24h
|
||||||
|
|
||||||
# Disables the automatic check for headscale updates on startup
|
# Disables the automatic check for headscale updates on startup
|
||||||
disable_check_updates: false
|
disable_check_updates: false
|
||||||
|
|
||||||
# Time before an inactive ephemeral node is deleted?
|
# Time before an inactive ephemeral node is deleted?
|
||||||
ephemeral_node_inactivity_timeout: 30m
|
ephemeral_node_inactivity_timeout: 30m
|
||||||
|
|
||||||
database:
|
database:
|
||||||
# Database type. Available options: sqlite, postgres
|
# Database type. Available options: sqlite, postgres
|
||||||
# Please note that using Postgres is highly discouraged as it is only supported for legacy reasons.
|
# Please note that using Postgres is highly discouraged as it is only supported for legacy reasons.
|
||||||
# All new development, testing and optimisations are done with SQLite in mind.
|
# All new development, testing and optimisations are done with SQLite in mind.
|
||||||
type: sqlite
|
type: sqlite
|
||||||
|
|
||||||
# Enable debug mode. This setting requires the log.level to be set to "debug" or "trace".
|
# Enable debug mode. This setting requires the log.level to be set to "debug" or "trace".
|
||||||
debug: true
|
debug: true
|
||||||
|
|
||||||
# GORM configuration settings.
|
# GORM configuration settings.
|
||||||
gorm:
|
gorm:
|
||||||
# Enable prepared statements.
|
# Enable prepared statements.
|
||||||
prepare_stmt: true # 启用预处理语句
|
prepare_stmt: true # 启用预处理语句
|
||||||
parameterized_queries: true # 启用参数化查询
|
parameterized_queries: true # 启用参数化查询
|
||||||
skip_err_record_not_found: true # 跳过"记录未找到"错误
|
skip_err_record_not_found: true # 跳过"记录未找到"错误
|
||||||
slow_threshold: 1000 # 慢查询阈值(毫秒)
|
slow_threshold: 1000 # 慢查询阈值(毫秒)
|
||||||
|
|
||||||
# SQLite config
|
# SQLite config
|
||||||
sqlite:
|
sqlite:
|
||||||
path: /var/lib/headscale/db.sqlite
|
path: /var/lib/headscale/db.sqlite
|
||||||
write_ahead_log: true # 启用WAL模式(生产推荐)
|
write_ahead_log: true # 启用WAL模式(生产推荐)
|
||||||
wal_autocheckpoint: 1000 # WAL自动检查点阈值
|
wal_autocheckpoint: 1000 # WAL自动检查点阈值
|
||||||
|
|
||||||
# # Postgres config
|
# # Postgres config
|
||||||
# Please note that using Postgres is highly discouraged as it is only supported for legacy reasons.
|
# Please note that using Postgres is highly discouraged as it is only supported for legacy reasons.
|
||||||
# See database.type for more information.
|
# See database.type for more information.
|
||||||
# postgres:
|
# postgres:
|
||||||
# # If using a Unix socket to connect to Postgres, set the socket path in the 'host' field and leave 'port' blank.
|
# # If using a Unix socket to connect to Postgres, set the socket path in the 'host' field and leave 'port' blank.
|
||||||
# host: localhost
|
# host: localhost
|
||||||
# port: 5432
|
# port: 5432
|
||||||
# name: headscale
|
# name: headscale
|
||||||
# user: foo
|
# user: foo
|
||||||
# pass: bar
|
# pass: bar
|
||||||
# max_open_conns: 10
|
# max_open_conns: 10
|
||||||
# max_idle_conns: 10
|
# max_idle_conns: 10
|
||||||
# conn_max_idle_time_secs: 3600
|
# conn_max_idle_time_secs: 3600
|
||||||
|
|
||||||
# # If other 'sslmode' is required instead of 'require(true)' and 'disabled(false)', set the 'sslmode' you need
|
# # If other 'sslmode' is required instead of 'require(true)' and 'disabled(false)', set the 'sslmode' you need
|
||||||
# # in the 'ssl' field. Refers to https://www.postgresql.org/docs/current/libpq-ssl.html Table 34.1.
|
# # in the 'ssl' field. Refers to https://www.postgresql.org/docs/current/libpq-ssl.html Table 34.1.
|
||||||
# ssl: false
|
# ssl: false
|
||||||
|
|
||||||
### TLS configuration - 已注释掉,调试后再启用
|
### TLS configuration - 已注释掉,调试后再启用
|
||||||
#
|
#
|
||||||
## Let's encrypt / ACME
|
## Let's encrypt / ACME
|
||||||
#
|
#
|
||||||
# headscale supports automatically requesting and setting up
|
# headscale supports automatically requesting and setting up
|
||||||
# TLS for a domain with Let's Encrypt.
|
# TLS for a domain with Let's Encrypt.
|
||||||
#
|
#
|
||||||
# URL to ACME directory
|
# URL to ACME directory
|
||||||
# acme_url: https://acme-v02.api.letsencrypt.org/directory
|
# acme_url: https://acme-v02.api.letsencrypt.org/directory
|
||||||
|
|
||||||
# Email to register with ACME provider
|
# Email to register with ACME provider
|
||||||
# acme_email: ""
|
# acme_email: ""
|
||||||
|
|
||||||
# Domain name to request a TLS certificate for:
|
# Domain name to request a TLS certificate for:
|
||||||
# tls_letsencrypt_hostname: ""
|
# tls_letsencrypt_hostname: ""
|
||||||
|
|
||||||
# Path to store certificates and metadata needed by
|
# Path to store certificates and metadata needed by
|
||||||
# letsencrypt
|
# letsencrypt
|
||||||
# For production:
|
# For production:
|
||||||
# tls_letsencrypt_cache_dir: /var/lib/headscale/cache
|
# tls_letsencrypt_cache_dir: /var/lib/headscale/cache
|
||||||
|
|
||||||
# Type of ACME challenge to use, currently supported types:
|
# Type of ACME challenge to use, currently supported types:
|
||||||
# HTTP-01 or TLS-ALPN-01
|
# HTTP-01 or TLS-ALPN-01
|
||||||
# See: docs/ref/tls.md for more information
|
# See: docs/ref/tls.md for more information
|
||||||
# tls_letsencrypt_challenge_type: HTTP-01
|
# tls_letsencrypt_challenge_type: HTTP-01
|
||||||
# When HTTP-01 challenge is chosen, letsencrypt must set up a
|
# When HTTP-01 challenge is chosen, letsencrypt must set up a
|
||||||
# verification endpoint, and it will be listening on:
|
# verification endpoint, and it will be listening on:
|
||||||
# :http = port 80
|
# :http = port 80
|
||||||
# tls_letsencrypt_listen: ":http"
|
# tls_letsencrypt_listen: ":http"
|
||||||
|
|
||||||
## Use already defined certificates:
|
## Use already defined certificates:
|
||||||
# tls_cert_path: ""
|
# tls_cert_path: ""
|
||||||
# tls_key_path: ""
|
# tls_key_path: ""
|
||||||
|
|
||||||
log:
|
log:
|
||||||
# Output formatting for logs: text or json
|
# Output formatting for logs: text or json
|
||||||
format: text
|
format: text
|
||||||
level: info
|
level: info
|
||||||
|
|
||||||
## Policy
|
## Policy
|
||||||
# headscale supports Tailscale's ACL policies.
|
# headscale supports Tailscale's ACL policies.
|
||||||
# Please have a look to their KB to better
|
# Please have a look to their KB to better
|
||||||
# understand the concepts: https://tailscale.com/kb/1018/acls/
|
# understand the concepts: https://tailscale.com/kb/1018/acls/
|
||||||
policy:
|
policy:
|
||||||
# The mode can be "file" or "database" that defines
|
# The mode can be "file" or "database" that defines
|
||||||
# where the ACL policies are stored and read from.
|
# where the ACL policies are stored and read from.
|
||||||
mode: file
|
mode: file
|
||||||
# If the mode is set to "file", the path to a
|
# If the mode is set to "file", the path to a
|
||||||
# HuJSON file containing ACL policies.
|
# HuJSON file containing ACL policies.
|
||||||
path: ""
|
path: ""
|
||||||
|
|
||||||
## DNS
|
## DNS
|
||||||
#
|
#
|
||||||
# headscale supports Tailscale's DNS configuration and MagicDNS.
|
# headscale supports Tailscale's DNS configuration and MagicDNS.
|
||||||
# Please have a look to their KB to better understand the concepts:
|
# Please have a look to their KB to better understand the concepts:
|
||||||
#
|
#
|
||||||
# - https://tailscale.com/kb/1054/dns/
|
# - https://tailscale.com/kb/1054/dns/
|
||||||
# - https://tailscale.com/kb/1081/magicdns/
|
# - https://tailscale.com/kb/1081/magicdns/
|
||||||
# - https://tailscale.com/blog/2021-09-private-dns-withmagicdns/
|
# - https://tailscale.com/blog/2021-09-private-dns-withmagicdns/
|
||||||
#
|
#
|
||||||
# Please note that for the DNS configuration to have any effect,
|
# Please note that for the DNS configuration to have any effect,
|
||||||
# clients must have the `--accept-dns=true` option enabled. This is the
|
# clients must have the `--accept-dns=true` option enabled. This is the
|
||||||
# default for the Tailscale client. This option is enabled by default
|
# default for the Tailscale client. This option is enabled by default
|
||||||
# in the Tailscale client.
|
# in the Tailscale client.
|
||||||
#
|
#
|
||||||
# Setting _any_ of the configuration and `--accept-dns=true` on the
|
# Setting _any_ of the configuration and `--accept-dns=true` on the
|
||||||
# clients will integrate with the DNS manager on the client or
|
# clients will integrate with the DNS manager on the client or
|
||||||
# overwrite /etc/resolv.conf.
|
# overwrite /etc/resolv.conf.
|
||||||
# https://tailscale.com/kb/1235/resolv-conf
|
# https://tailscale.com/kb/1235/resolv-conf
|
||||||
#
|
#
|
||||||
# If you want stop Headscale from managing the DNS configuration
|
# If you want stop Headscale from managing the DNS configuration
|
||||||
# all the fields under `dns` should be set to empty values.
|
# all the fields under `dns` should be set to empty values.
|
||||||
dns:
|
dns:
|
||||||
# Whether to use [MagicDNS](https://tailscale.com/kb/1081/magicdns/).
|
# Whether to use [MagicDNS](https://tailscale.com/kb/1081/magicdns/).
|
||||||
magic_dns: false
|
magic_dns: false
|
||||||
|
|
||||||
# Defines the base domain to create the hostnames for MagicDNS.
|
# Defines the base domain to create the hostnames for MagicDNS.
|
||||||
# This domain _must_ be different from the server_url domain.
|
# This domain _must_ be different from the server_url domain.
|
||||||
# `base_domain` must be a FQDN, without the trailing dot.
|
# `base_domain` must be a FQDN, without the trailing dot.
|
||||||
# The FQDN of the hosts will be
|
# The FQDN of the hosts will be
|
||||||
# `hostname.base_domain` (e.g., _myhost.example.com_).
|
# `hostname.base_domain` (e.g., _myhost.example.com_).
|
||||||
base_domain: example.com
|
base_domain: example.com
|
||||||
|
|
||||||
# List of DNS servers to expose to clients.
|
# List of DNS servers to expose to clients.
|
||||||
nameservers:
|
nameservers:
|
||||||
global:
|
global:
|
||||||
- 114.114.114.114
|
- 114.114.114.114
|
||||||
|
|
||||||
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
|
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
|
||||||
# "abc123" is example NextDNS ID, replace with yours.
|
# "abc123" is example NextDNS ID, replace with yours.
|
||||||
# - https://dns.nextdns.io/abc123
|
# - https://dns.nextdns.io/abc123
|
||||||
|
|
||||||
# Split DNS (see https://tailscale.com/kb/1054/dns/),
|
# Split DNS (see https://tailscale.com/kb/1054/dns/),
|
||||||
# a map of domains and which DNS server to use for each.
|
# a map of domains and which DNS server to use for each.
|
||||||
split:
|
split:
|
||||||
{}
|
{}
|
||||||
# foo.bar.com:
|
# foo.bar.com:
|
||||||
# - 1.1.1.1
|
# - 1.1.1.1
|
||||||
# darp.headscale.net:
|
# darp.headscale.net:
|
||||||
# - 1.1.1.1
|
# - 1.1.1.1
|
||||||
# - 8.8.8.8
|
# - 8.8.8.8
|
||||||
|
|
||||||
# Set custom DNS search domains. With MagicDNS enabled,
|
# Set custom DNS search domains. With MagicDNS enabled,
|
||||||
# your tailnet base_domain is always the first search domain.
|
# your tailnet base_domain is always the first search domain.
|
||||||
search_domains: []
|
search_domains: []
|
||||||
|
|
||||||
# Extra DNS records
|
# Extra DNS records
|
||||||
# so far only A and AAAA records are supported (on the tailscale side)
|
# so far only A and AAAA records are supported (on the tailscale side)
|
||||||
# See: docs/ref/dns.md
|
# See: docs/ref/dns.md
|
||||||
extra_records: []
|
extra_records: []
|
||||||
# - name: "grafana.myvpn.example.com"
|
# - name: "grafana.myvpn.example.com"
|
||||||
# type: "A"
|
# type: "A"
|
||||||
# value: "100.64.0.3"
|
# value: "100.64.0.3"
|
||||||
#
|
#
|
||||||
# # you can also put it in one line
|
# # you can also put it in one line
|
||||||
# - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.3" }
|
# - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.3" }
|
||||||
#
|
#
|
||||||
# Alternatively, extra DNS records can be loaded from a JSON file.
|
# Alternatively, extra DNS records can be loaded from a JSON file.
|
||||||
# Headscale processes this file on each change.
|
# Headscale processes this file on each change.
|
||||||
# extra_records_path: /var/lib/headscale/extra-records.json
|
# extra_records_path: /var/lib/headscale/extra-records.json
|
||||||
|
|
||||||
# Unix socket used for the CLI to connect without authentication
|
# Unix socket used for the CLI to connect without authentication
|
||||||
# Note: for production you will want to set this to something like:
|
# Note: for production you will want to set this to something like:
|
||||||
unix_socket: /var/run/headscale/headscale.sock
|
unix_socket: /var/run/headscale/headscale.sock
|
||||||
unix_socket_permission: "0770"
|
unix_socket_permission: "0770"
|
||||||
|
|
||||||
# headscale supports experimental OpenID connect support,
|
# headscale supports experimental OpenID connect support,
|
||||||
# it is still being tested and might have some bugs, please
|
# it is still being tested and might have some bugs, please
|
||||||
# help us test it.
|
# help us test it.
|
||||||
# OpenID Connect
|
# OpenID Connect
|
||||||
# oidc:
|
# oidc:
|
||||||
# only_start_if_oidc_is_available: true
|
# only_start_if_oidc_is_available: true
|
||||||
# issuer: "https://your-oidc.issuer.com/path"
|
# issuer: "https://your-oidc.issuer.com/path"
|
||||||
# client_id: "your-oidc-client-id"
|
# client_id: "your-oidc-client-id"
|
||||||
# client_secret: "your-oidc-client-secret"
|
# client_secret: "your-oidc-client-secret"
|
||||||
# # Alternatively, set `client_secret_path` to read the secret from the file.
|
# # Alternatively, set `client_secret_path` to read the secret from the file.
|
||||||
# # It resolves environment variables, making integration to systemd's
|
# # It resolves environment variables, making integration to systemd's
|
||||||
# # `LoadCredential` straightforward:
|
# # `LoadCredential` straightforward:
|
||||||
# client_secret_path: "${CREDENTIALS_DIRECTORY}/oidc_client_secret"
|
# client_secret_path: "${CREDENTIALS_DIRECTORY}/oidc_client_secret"
|
||||||
# # client_secret and client_secret_path are mutually exclusive.
|
# # client_secret and client_secret_path are mutually exclusive.
|
||||||
#
|
#
|
||||||
# # The amount of time from a node is authenticated with OpenID until it
|
# # The amount of time from a node is authenticated with OpenID until it
|
||||||
# # expires and needs to reauthenticate.
|
# # expires and needs to reauthenticate.
|
||||||
# # Setting the value to "0" will mean no expiry.
|
# # Setting the value to "0" will mean no expiry.
|
||||||
# expiry: 180d
|
# expiry: 180d
|
||||||
#
|
#
|
||||||
# # Use the expiry from the token received from OpenID when the user logged
|
# # Use the expiry from the token received from OpenID when the user logged
|
||||||
# # in, this will typically lead to frequent need to reauthenticate and should
|
# # in, this will typically lead to frequent need to reauthenticate and should
|
||||||
# # only been enabled if you know what you are doing.
|
# # only been enabled if you know what you are doing.
|
||||||
# # Note: enabling this will cause `oidc.expiry` to be ignored.
|
# # Note: enabling this will cause `oidc.expiry` to be ignored.
|
||||||
# use_expiry_from_token: false
|
# use_expiry_from_token: false
|
||||||
#
|
#
|
||||||
# # Customize the scopes used in the OIDC flow, defaults to "openid", "profile" and "email" and add custom query
|
# # Customize the scopes used in the OIDC flow, defaults to "openid", "profile" and "email" and add custom query
|
||||||
# # parameters to the Authorize Endpoint request. Scopes default to "openid", "profile" and "email".
|
# # parameters to the Authorize Endpoint request. Scopes default to "openid", "profile" and "email".
|
||||||
#
|
#
|
||||||
# scope: ["openid", "profile", "email", "custom"]
|
# scope: ["openid", "profile", "email", "custom"]
|
||||||
# extra_params:
|
# extra_params:
|
||||||
# domain_hint: example.com
|
# domain_hint: example.com
|
||||||
#
|
#
|
||||||
# # List allowed principal domains and/or users. If an authenticated user's domain is not in this list, the
|
# # List allowed principal domains and/or users. If an authenticated user's domain is not in this list, the
|
||||||
# # authentication request will be rejected.
|
# # authentication request will be rejected.
|
||||||
#
|
#
|
||||||
# allowed_domains:
|
# allowed_domains:
|
||||||
# - example.com
|
# - example.com
|
||||||
# # Note: Groups from keycloak have a leading '/'
|
# # Note: Groups from keycloak have a leading '/'
|
||||||
# allowed_groups:
|
# allowed_groups:
|
||||||
# - /headscale
|
# - /headscale
|
||||||
# allowed_users:
|
# allowed_users:
|
||||||
# - alice@example.com
|
# - alice@example.com
|
||||||
#
|
#
|
||||||
# # Optional: PKCE (Proof Key for Code Exchange) configuration
|
# # Optional: PKCE (Proof Key for Code Exchange) configuration
|
||||||
# # PKCE adds an additional layer of security to the OAuth 2.0 authorization code flow
|
# # PKCE adds an additional layer of security to the OAuth 2.0 authorization code flow
|
||||||
# # by preventing authorization code interception attacks
|
# # by preventing authorization code interception attacks
|
||||||
# # See https://datatracker.ietf.org/doc/html/rfc7636
|
# # See https://datatracker.ietf.org/doc/html/rfc7636
|
||||||
# pkce:
|
# pkce:
|
||||||
# # Enable or disable PKCE support (default: false)
|
# # Enable or disable PKCE support (default: false)
|
||||||
# enabled: false
|
# enabled: false
|
||||||
# # PKCE method to use:
|
# # PKCE method to use:
|
||||||
# # - plain: Use plain code verifier
|
# # - plain: Use plain code verifier
|
||||||
# # - S256: Use SHA256 hashed code verifier (default, recommended)
|
# # - S256: Use SHA256 hashed code verifier (default, recommended)
|
||||||
# method: S256
|
# method: S256
|
||||||
#
|
#
|
||||||
# # Map legacy users from pre-0.24.0 versions of headscale to the new OIDC users
|
# # Map legacy users from pre-0.24.0 versions of headscale to the new OIDC users
|
||||||
# # by taking the username from the legacy user and matching it with the username
|
# # by taking the username from the legacy user and matching it with the username
|
||||||
# # provided by the OIDC. This is useful when migrating from legacy users to OIDC
|
# # provided by the OIDC. This is useful when migrating from legacy users to OIDC
|
||||||
# # to force them using the unique identifier from the OIDC and to give them a
|
# # to force them using the unique identifier from the OIDC and to give them a
|
||||||
# # proper display name and picture if available.
|
# # proper display name and picture if available.
|
||||||
# # Note that this will only work if the username from the legacy user is the same
|
# # Note that this will only work if the username from the legacy user is the same
|
||||||
# # and there is a possibility for account takeover should a username have changed
|
# # and there is a possibility for account takeover should a username have changed
|
||||||
# # with the provider.
|
# # with the provider.
|
||||||
# # When this feature is disabled, it will cause all new logins to be created as new users.
|
# # When this feature is disabled, it will cause all new logins to be created as new users.
|
||||||
# # Note this option will be removed in the future and should be set to false
|
# # Note this option will be removed in the future and should be set to false
|
||||||
# # on all new installations, or when all users have logged in with OIDC once.
|
# # on all new installations, or when all users have logged in with OIDC once.
|
||||||
# map_legacy_users: false
|
# map_legacy_users: false
|
||||||
|
|
||||||
# Logtail configuration
|
# Logtail configuration
|
||||||
# Logtail is Tailscales logging and auditing infrastructure, it allows the control panel
|
# Logtail is Tailscales logging and auditing infrastructure, it allows the control panel
|
||||||
# to instruct tailscale nodes to log their activity to a remote server.
|
# to instruct tailscale nodes to log their activity to a remote server.
|
||||||
logtail:
|
logtail:
|
||||||
# Enable logtail for this headscales clients.
|
# Enable logtail for this headscales clients.
|
||||||
# As there is currently no support for overriding the log server in headscale, this is
|
# As there is currently no support for overriding the log server in headscale, this is
|
||||||
# disabled by default. Enabling this will make your clients send logs to Tailscale Inc.
|
# disabled by default. Enabling this will make your clients send logs to Tailscale Inc.
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
# Enabling this option makes devices prefer a random port for WireGuard traffic over the
|
# Enabling this option makes devices prefer a random port for WireGuard traffic over the
|
||||||
# default static port 41641. This option is intended as a workaround for some buggy
|
# default static port 41641. This option is intended as a workaround for some buggy
|
||||||
# firewall devices. See https://tailscale.com/kb/1181/firewalls/ for more information.
|
# firewall devices. See https://tailscale.com/kb/1181/firewalls/ for more information.
|
||||||
randomize_client_port: false
|
randomize_client_port: false
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
version: "3.9"
|
version: "3.9"
|
||||||
services:
|
services:
|
||||||
headscale:
|
headscale:
|
||||||
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/headscale/headscale:v0.23.0-beta2
|
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/headscale/headscale:v0.23.0-beta2
|
||||||
container_name: headscale
|
container_name: headscale
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- HEADSCALE_API_KEY=QC33VFzaUw.u1qwXFap0QpFAQnwkdGuUyvpspL15185A5JnWeFpt_c
|
- HEADSCALE_API_KEY=QC33VFzaUw.u1qwXFap0QpFAQnwkdGuUyvpspL15185A5JnWeFpt_c
|
||||||
command: serve --config /etc/headscale/config.yaml
|
command: serve --config /etc/headscale/config.yaml
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/headscale:/var/lib/headscale
|
- ./data/headscale:/var/lib/headscale
|
||||||
- ./config.yaml:/etc/headscale/config.yaml
|
- ./config.yaml:/etc/headscale/config.yaml
|
||||||
ports:
|
ports:
|
||||||
- "3008:8080" # Headscale API (HTTP)
|
- "3008:8080" # Headscale API (HTTP)
|
||||||
- "3009:8443" # Headscale API (HTTPS)
|
- "3009:8443" # Headscale API (HTTPS)
|
||||||
- "9090:9090" # Metrics
|
- "9090:9090" # Metrics
|
||||||
- "3478:3478/udp" # STUN UDP
|
- "3478:3478/udp" # STUN UDP
|
||||||
- "3478:3478/tcp" # STUN TCP
|
- "3478:3478/tcp" # STUN TCP
|
||||||
- "50443:50443" # gRPC
|
- "50443:50443" # gRPC
|
||||||
cap_add:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
sysctls:
|
sysctls:
|
||||||
- net.ipv4.ip_forward=1
|
- net.ipv4.ip_forward=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user