This commit is contained in:
wsl-d4
2025-08-26 16:44:41 +08:00
parent 4c586c6cfc
commit 722e15b458
30 changed files with 3900 additions and 3889 deletions

8
.vscode/sftp.json vendored
View File

@@ -1,10 +1,10 @@
{
"name": "common-server",
"host": "10.0.3.14",
"host": "10.0.3.148",
"protocol": "sftp",
"port": 22,
"username": "root",
"password": "Awei@sxf01",
"remotePath": "/root/common-server",
"username": "awei",
"password": "123456",
"remotePath": "/home/awei/common-server",
"uploadOnSave": true
}

View File

@@ -1,47 +1,47 @@
version: '3.8'
services:
navidrome:
container_name: navidrome
image: deluan/navidrome:latest
ports:
- "4533:4533"
restart: always
environment:
# 扫描音乐库的计划
ND_SCANSCHEDULE: "@every 1h"
# 日志级别
ND_LOGLEVEL: "info"
# 默认语言
ND_DEFAULTLANGUAGE: "zh"
# 会话超时时间
ND_SESSIONTIMEOUT: "24h"
# 启用下载功能
ND_ENABLEDOWNLOADS: "true"
# 启用收藏夹
ND_ENABLEFAVOURITES: "true"
# 启用共享功能
ND_ENABLESHARING: "false"
# 在 UI 中启用5星评级
ND_ENABLESTARRATING: "true"
# 启用转码配置
ND_ENABLETRANSCODINGCONFIG: "true"
# 转码缓存大小
ND_TRANSCODINGCACHESIZE: "2000M"
# 图片缓存大小
ND_IMAGECACHESIZE: "1000M"
# 音乐文件路径
ND_MUSICFOLDER: "/music"
# 数据路径
ND_DATAFOLDER: "/data"
volumes:
# 将宿主机的数据目录挂载到容器的数据目录,用于数据持久化
- "./data:/data"
# 将宿主机的音乐目录挂载到容器的音乐目录,只读模式
- "./music:/music:ro"
networks:
- navidrome-net
networks:
navidrome-net:
version: '3.8'
services:
navidrome:
container_name: navidrome
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/deluan/navidrome:pr-4181
ports:
- "4533:4533"
restart: always
environment:
# 扫描音乐库的计划
ND_SCANSCHEDULE: "@every 1h"
# 日志级别
ND_LOGLEVEL: "info"
# 默认语言
ND_DEFAULTLANGUAGE: "zh"
# 会话超时时间
ND_SESSIONTIMEOUT: "24h"
# 启用下载功能
ND_ENABLEDOWNLOADS: "true"
# 启用收藏夹
ND_ENABLEFAVOURITES: "true"
# 启用共享功能
ND_ENABLESHARING: "false"
# 在 UI 中启用5星评级
ND_ENABLESTARRATING: "true"
# 启用转码配置
ND_ENABLETRANSCODINGCONFIG: "true"
# 转码缓存大小
ND_TRANSCODINGCACHESIZE: "2000M"
# 图片缓存大小
ND_IMAGECACHESIZE: "1000M"
# 音乐文件路径
ND_MUSICFOLDER: "/music"
# 数据路径
ND_DATAFOLDER: "/data"
volumes:
# 将宿主机的数据目录挂载到容器的数据目录,用于数据持久化
- "./data:/data"
# 将宿主机的音乐目录挂载到容器的音乐目录,只读模式
- "./music:/music:ro"
networks:
- navidrome-net
networks:
navidrome-net:
driver: bridge

View File

@@ -1,26 +1,26 @@
name: bbs-go-server
on: [ push ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install dependencies
working-directory: ./server
run: |
go mod download
- name: Build
working-directory: ./server
run: |
make build
name: bbs-go-server
on: [ push ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install dependencies
working-directory: ./server
run: |
go mod download
- name: Build
working-directory: ./server
run: |
make build

View File

@@ -1,32 +1,32 @@
name: bbs-go-site
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
cache-dependency-path: site/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./site
run: |
pnpm install
- name: Build
working-directory: ./site
run: |
name: bbs-go-site
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
cache-dependency-path: site/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./site
run: |
pnpm install
- name: Build
working-directory: ./site
run: |
pnpm build

View File

@@ -1,7 +1,7 @@
.idea
dist
*.log
.DS_Store
node_modules
.nuxt
.idea
dist
*.log
.DS_Store
node_modules
.nuxt
.docker-compose/mysql/data

File diff suppressed because it is too large Load Diff

View File

@@ -1,85 +1,85 @@
## 项目地址
- 演示站:[https://bbs.bbs-go.com](https://bbs.bbs-go.com)
- 文档地址:[https://bbs-go.com](https://bbs-go.com)
- 问题反馈: [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)
- Gitee: [https://gitee.com/mlogclub/bbs-go](https://gitee.com/mlogclub/bbs-go)
## 联系我
### 用户交流群
![BBS-GO用户交流群](docs/images/qq.png)
### 加我微信
![BBS-GO用户交流群](docs/images/wechat.png)
## 介绍
`bbs-go` 是一个基于 Go 语言开发的开源社区论坛系统。它的设计旨在提供轻量、高效的社区讨论平台,支持现代化的 Web 技术栈并且易于扩展和部署。bbs-go 项目采用模块化架构,能够与其他服务和前端框架无缝集成,适合各种规模的在线社区。
项目的主要特点包括:
- **高性能**:基于 Go 语言的并发特性,能够在高负载下保持良好的性能表现。
- **灵活性**:支持自定义配置、插件扩展,易于适应不同需求。
- **简单易用**:提供简洁的管理后台,方便社区管理员管理论坛内容和用户。
- **支持 MySQL 数据库**:提供对常见数据库的支持,确保数据存储的可靠性和稳定性。
- **响应式设计**:前端使用现代化的技术,能够在移动设备和桌面设备上提供良好的用户体验。
项目主要面向开发者和社区管理者,适合搭建技术讨论、兴趣分享等类型的社区论坛。
![bbs-go功能简介](docs/images/features.jpg)
## 模块
### server
[![bbs-go-server](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml)
> 基于`Golang`搭建,提供接口数据支撑。
技术栈
- iris ([https://github.com/kataras/iris](https://github.com/kataras/iris)) Go语言 mvc 框架
- 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
- cron ([https://github.com/robfig/cron](https://github.com/robfig/cron)) 定时任务框架
- goquery ([https://github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)) html dom 元素解析
### site
[![bbs-go-site](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml)
> 前端页面渲染服务,基于`nuxt.js`搭建。
技术栈
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
- nuxt.js ([https://nuxtjs.org](https://nuxtjs.org)) 基于Vue的服务端渲染框架效率高到爆
### admin
[![bbs-go-admin](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml)
> 管理后台系统,基于`vue.js + element-ui`搭建。
技术栈
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
- element-ui ([https://element.eleme.cn](https://element.eleme.cn)) 饿了么开源的基于 vue.js 的前端库
## 功能预览
![首页.png](https://s2.loli.net/2022/04/12/DpvPwB9dlQ6Chef.png)
![发帖.png](https://s2.loli.net/2022/04/12/KC8eXfE6sDLq34V.png)
![发动态.png](https://s2.loli.net/2022/04/12/14pMPuGjEU6kiWV.png)
![个人中心.png](https://s2.loli.net/2022/04/12/1PVNjMh9nUAXsl8.png)
![手机版.png](https://s2.loli.net/2022/04/12/mowWb78CGIaH6T2.png)
![后台首页.png](https://s2.loli.net/2022/04/12/ErX2BLTnh7ldz8D.png)
![后台配置.png](https://s2.loli.net/2022/04/12/PwK6aC74XEZlIOL.png)
## 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>
## 项目地址
- 演示站:[https://bbs.bbs-go.com](https://bbs.bbs-go.com)
- 文档地址:[https://bbs-go.com](https://bbs-go.com)
- 问题反馈: [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)
- Gitee: [https://gitee.com/mlogclub/bbs-go](https://gitee.com/mlogclub/bbs-go)
## 联系我
### 用户交流群
![BBS-GO用户交流群](docs/images/qq.png)
### 加我微信
![BBS-GO用户交流群](docs/images/wechat.png)
## 介绍
`bbs-go` 是一个基于 Go 语言开发的开源社区论坛系统。它的设计旨在提供轻量、高效的社区讨论平台,支持现代化的 Web 技术栈并且易于扩展和部署。bbs-go 项目采用模块化架构,能够与其他服务和前端框架无缝集成,适合各种规模的在线社区。
项目的主要特点包括:
- **高性能**:基于 Go 语言的并发特性,能够在高负载下保持良好的性能表现。
- **灵活性**:支持自定义配置、插件扩展,易于适应不同需求。
- **简单易用**:提供简洁的管理后台,方便社区管理员管理论坛内容和用户。
- **支持 MySQL 数据库**:提供对常见数据库的支持,确保数据存储的可靠性和稳定性。
- **响应式设计**:前端使用现代化的技术,能够在移动设备和桌面设备上提供良好的用户体验。
项目主要面向开发者和社区管理者,适合搭建技术讨论、兴趣分享等类型的社区论坛。
![bbs-go功能简介](docs/images/features.jpg)
## 模块
### server
[![bbs-go-server](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml)
> 基于`Golang`搭建,提供接口数据支撑。
技术栈
- iris ([https://github.com/kataras/iris](https://github.com/kataras/iris)) Go语言 mvc 框架
- 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
- cron ([https://github.com/robfig/cron](https://github.com/robfig/cron)) 定时任务框架
- goquery ([https://github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)) html dom 元素解析
### site
[![bbs-go-site](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml)
> 前端页面渲染服务,基于`nuxt.js`搭建。
技术栈
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
- nuxt.js ([https://nuxtjs.org](https://nuxtjs.org)) 基于Vue的服务端渲染框架效率高到爆
### admin
[![bbs-go-admin](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml)
> 管理后台系统,基于`vue.js + element-ui`搭建。
技术栈
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
- element-ui ([https://element.eleme.cn](https://element.eleme.cn)) 饿了么开源的基于 vue.js 的前端库
## 功能预览
![首页.png](https://s2.loli.net/2022/04/12/DpvPwB9dlQ6Chef.png)
![发帖.png](https://s2.loli.net/2022/04/12/KC8eXfE6sDLq34V.png)
![发动态.png](https://s2.loli.net/2022/04/12/14pMPuGjEU6kiWV.png)
![个人中心.png](https://s2.loli.net/2022/04/12/1PVNjMh9nUAXsl8.png)
![手机版.png](https://s2.loli.net/2022/04/12/mowWb78CGIaH6T2.png)
![后台首页.png](https://s2.loli.net/2022/04/12/ErX2BLTnh7ldz8D.png)
![后台配置.png](https://s2.loli.net/2022/04/12/PwK6aC74XEZlIOL.png)
## 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>

View File

@@ -1,41 +1,41 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
.DS_Store
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
bbs-go
bbs-go.yaml
bbs-go.prod.yaml
bbs-go.dev.yaml
bbs-go.test.yaml
.idea/*
build/*
cscope.files
tags
logs/*.log
web/*
tmp/*
admin/*
internal/web*
cmd/generator/*
go.work
go.work.sum
ip2region.xdb
__debug_bin*
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
.DS_Store
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
bbs-go
bbs-go.yaml
bbs-go.prod.yaml
bbs-go.dev.yaml
bbs-go.test.yaml
.idea/*
build/*
cscope.files
tags
logs/*.log
web/*
tmp/*
admin/*
internal/web*
cmd/generator/*
go.work
go.work.sum
ip2region.xdb
__debug_bin*

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,2 @@
## 介绍
该项目使用Golang进行构建具体参见https://mlog.club
## 介绍
该项目使用Golang进行构建具体参见https://mlog.club

View File

@@ -1,65 +1,65 @@
Port: 8082 # 端口
BaseUrl: https://mlog.club # 网站域名
IpDataPath: # IP数据文件默认读取当前目录下ip2region.xdb文件最新数据文件请从这里下载https://github.com/lionsoul2014/ip2region/tree/master/data
AllowedOrigins:
- "*"
# 日志配置
Logger:
Filename: /data/logs/bbs-go.log # 日志文件的位置
MaxSize: 100 # 文件最大尺寸以MB为单位
MaxAge: 10 # 保留旧文件的最大天数
MaxBackups: 10 # 保留的最大旧文件数量
# 数据库连接
DB:
Url: username:password@tcp(localhost:3306)/bbsgo_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
MaxIdleConns: 50
MaxOpenConns: 200
# 上传配置
Uploader:
# 启用上传方式
Enable: Oss
# 阿里云oss配置
AliyunOss:
Host: # 阿里云OSS资源外网访问地址
Bucket: # 阿里云OSS bucket名称
Endpoint: # 阿里云OSS Endpoint
AccessId: # 阿里云OSS accessID
AccessSecret: # 阿里云OSS accessKey
StyleSplitter: # 阿里云oss图片样式分隔符
StyleAvatar: # 头像图片样式名称
StylePreview: # 预览图片样式名称
StyleSmall: # 小图样式名称
StyleDetail: # 详情图片样式名称
# 本地文件上传
Local:
Host: https://st.mlog.club/ # 上传文件域名
Path: /data/www/st.mlog.club # 上传目录
# 邮件服务器配置,用于邮件通知
Smtp:
Host: # smtp服务地址请设置成你自己的例如smtp.qq.com
Port: # smtp服务端口请设置成你自己额例如25
Username: # 请配置成你自己的
Password: # 请配置成你自己的
SSL: true
# 百度SEO相关配置
# 文档https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14
BaiduSEO:
Site:
Token:
# 神马搜索SEO相关
# 文档https://zhanzhang.sm.cn/open/mip
SmSEO:
Site:
UserName:
Token:
# search
Search:
Port: 8082 # 端口
BaseUrl: https://mlog.club # 网站域名
IpDataPath: # IP数据文件默认读取当前目录下ip2region.xdb文件最新数据文件请从这里下载https://github.com/lionsoul2014/ip2region/tree/master/data
AllowedOrigins:
- "*"
# 日志配置
Logger:
Filename: /data/logs/bbs-go.log # 日志文件的位置
MaxSize: 100 # 文件最大尺寸以MB为单位
MaxAge: 10 # 保留旧文件的最大天数
MaxBackups: 10 # 保留的最大旧文件数量
# 数据库连接
DB:
Url: username:password@tcp(localhost:3306)/bbsgo_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
MaxIdleConns: 50
MaxOpenConns: 200
# 上传配置
Uploader:
# 启用上传方式
Enable: Oss
# 阿里云oss配置
AliyunOss:
Host: # 阿里云OSS资源外网访问地址
Bucket: # 阿里云OSS bucket名称
Endpoint: # 阿里云OSS Endpoint
AccessId: # 阿里云OSS accessID
AccessSecret: # 阿里云OSS accessKey
StyleSplitter: # 阿里云oss图片样式分隔符
StyleAvatar: # 头像图片样式名称
StylePreview: # 预览图片样式名称
StyleSmall: # 小图样式名称
StyleDetail: # 详情图片样式名称
# 本地文件上传
Local:
Host: https://st.mlog.club/ # 上传文件域名
Path: /data/www/st.mlog.club # 上传目录
# 邮件服务器配置,用于邮件通知
Smtp:
Host: # smtp服务地址请设置成你自己的例如smtp.qq.com
Port: # smtp服务端口请设置成你自己额例如25
Username: # 请配置成你自己的
Password: # 请配置成你自己的
SSL: true
# 百度SEO相关配置
# 文档https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14
BaiduSEO:
Site:
Token:
# 神马搜索SEO相关
# 文档https://zhanzhang.sm.cn/open/mip
SmSEO:
Site:
UserName:
Token:
# search
Search:
IndexPath: # 索引路径

View File

@@ -1,26 +1,26 @@
name: bbs-go-server
on: [ push ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install dependencies
working-directory: ./server
run: |
go mod download
- name: Build
working-directory: ./server
run: |
make build
name: bbs-go-server
on: [ push ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: Install dependencies
working-directory: ./server
run: |
go mod download
- name: Build
working-directory: ./server
run: |
make build

View File

@@ -1,32 +1,32 @@
name: bbs-go-site
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
cache-dependency-path: site/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./site
run: |
pnpm install
- name: Build
working-directory: ./site
run: |
name: bbs-go-site
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
cache-dependency-path: site/pnpm-lock.yaml
- name: Install dependencies
working-directory: ./site
run: |
pnpm install
- name: Build
working-directory: ./site
run: |
pnpm build

12
bbs-go/.gitignore vendored
View File

@@ -1,7 +1,7 @@
.idea
dist
*.log
.DS_Store
node_modules
.nuxt
.idea
dist
*.log
.DS_Store
node_modules
.nuxt
.docker-compose/mysql/data

File diff suppressed because it is too large Load Diff

View File

@@ -1,85 +1,85 @@
## 项目地址
- 演示站:[https://bbs.bbs-go.com](https://bbs.bbs-go.com)
- 文档地址:[https://bbs-go.com](https://bbs-go.com)
- 问题反馈: [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)
- Gitee: [https://gitee.com/mlogclub/bbs-go](https://gitee.com/mlogclub/bbs-go)
## 联系我
### 用户交流群
![BBS-GO用户交流群](docs/images/qq.png)
### 加我微信
![BBS-GO用户交流群](docs/images/wechat.png)
## 介绍
`bbs-go` 是一个基于 Go 语言开发的开源社区论坛系统。它的设计旨在提供轻量、高效的社区讨论平台,支持现代化的 Web 技术栈并且易于扩展和部署。bbs-go 项目采用模块化架构,能够与其他服务和前端框架无缝集成,适合各种规模的在线社区。
项目的主要特点包括:
- **高性能**:基于 Go 语言的并发特性,能够在高负载下保持良好的性能表现。
- **灵活性**:支持自定义配置、插件扩展,易于适应不同需求。
- **简单易用**:提供简洁的管理后台,方便社区管理员管理论坛内容和用户。
- **支持 MySQL 数据库**:提供对常见数据库的支持,确保数据存储的可靠性和稳定性。
- **响应式设计**:前端使用现代化的技术,能够在移动设备和桌面设备上提供良好的用户体验。
项目主要面向开发者和社区管理者,适合搭建技术讨论、兴趣分享等类型的社区论坛。
![bbs-go功能简介](docs/images/features.jpg)
## 模块
### server
[![bbs-go-server](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml)
> 基于`Golang`搭建,提供接口数据支撑。
技术栈
- iris ([https://github.com/kataras/iris](https://github.com/kataras/iris)) Go语言 mvc 框架
- 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
- cron ([https://github.com/robfig/cron](https://github.com/robfig/cron)) 定时任务框架
- goquery ([https://github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)) html dom 元素解析
### site
[![bbs-go-site](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml)
> 前端页面渲染服务,基于`nuxt.js`搭建。
技术栈
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
- nuxt.js ([https://nuxtjs.org](https://nuxtjs.org)) 基于Vue的服务端渲染框架效率高到爆
### admin
[![bbs-go-admin](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml)
> 管理后台系统,基于`vue.js + element-ui`搭建。
技术栈
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
- element-ui ([https://element.eleme.cn](https://element.eleme.cn)) 饿了么开源的基于 vue.js 的前端库
## 功能预览
![首页.png](https://s2.loli.net/2022/04/12/DpvPwB9dlQ6Chef.png)
![发帖.png](https://s2.loli.net/2022/04/12/KC8eXfE6sDLq34V.png)
![发动态.png](https://s2.loli.net/2022/04/12/14pMPuGjEU6kiWV.png)
![个人中心.png](https://s2.loli.net/2022/04/12/1PVNjMh9nUAXsl8.png)
![手机版.png](https://s2.loli.net/2022/04/12/mowWb78CGIaH6T2.png)
![后台首页.png](https://s2.loli.net/2022/04/12/ErX2BLTnh7ldz8D.png)
![后台配置.png](https://s2.loli.net/2022/04/12/PwK6aC74XEZlIOL.png)
## 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>
## 项目地址
- 演示站:[https://bbs.bbs-go.com](https://bbs.bbs-go.com)
- 文档地址:[https://bbs-go.com](https://bbs-go.com)
- 问题反馈: [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)
- Gitee: [https://gitee.com/mlogclub/bbs-go](https://gitee.com/mlogclub/bbs-go)
## 联系我
### 用户交流群
![BBS-GO用户交流群](docs/images/qq.png)
### 加我微信
![BBS-GO用户交流群](docs/images/wechat.png)
## 介绍
`bbs-go` 是一个基于 Go 语言开发的开源社区论坛系统。它的设计旨在提供轻量、高效的社区讨论平台,支持现代化的 Web 技术栈并且易于扩展和部署。bbs-go 项目采用模块化架构,能够与其他服务和前端框架无缝集成,适合各种规模的在线社区。
项目的主要特点包括:
- **高性能**:基于 Go 语言的并发特性,能够在高负载下保持良好的性能表现。
- **灵活性**:支持自定义配置、插件扩展,易于适应不同需求。
- **简单易用**:提供简洁的管理后台,方便社区管理员管理论坛内容和用户。
- **支持 MySQL 数据库**:提供对常见数据库的支持,确保数据存储的可靠性和稳定性。
- **响应式设计**:前端使用现代化的技术,能够在移动设备和桌面设备上提供良好的用户体验。
项目主要面向开发者和社区管理者,适合搭建技术讨论、兴趣分享等类型的社区论坛。
![bbs-go功能简介](docs/images/features.jpg)
## 模块
### server
[![bbs-go-server](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-server.yml)
> 基于`Golang`搭建,提供接口数据支撑。
技术栈
- iris ([https://github.com/kataras/iris](https://github.com/kataras/iris)) Go语言 mvc 框架
- 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
- cron ([https://github.com/robfig/cron](https://github.com/robfig/cron)) 定时任务框架
- goquery ([https://github.com/PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)) html dom 元素解析
### site
[![bbs-go-site](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-site.yml)
> 前端页面渲染服务,基于`nuxt.js`搭建。
技术栈
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
- nuxt.js ([https://nuxtjs.org](https://nuxtjs.org)) 基于Vue的服务端渲染框架效率高到爆
### admin
[![bbs-go-admin](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml/badge.svg)](https://github.com/mlogclub/bbs-go/actions/workflows/bbs-go-admin.yml)
> 管理后台系统,基于`vue.js + element-ui`搭建。
技术栈
- vue.js ([https://vuejs.org](https://vuejs.org)) 渐进式 JavaScript 框架
- element-ui ([https://element.eleme.cn](https://element.eleme.cn)) 饿了么开源的基于 vue.js 的前端库
## 功能预览
![首页.png](https://s2.loli.net/2022/04/12/DpvPwB9dlQ6Chef.png)
![发帖.png](https://s2.loli.net/2022/04/12/KC8eXfE6sDLq34V.png)
![发动态.png](https://s2.loli.net/2022/04/12/14pMPuGjEU6kiWV.png)
![个人中心.png](https://s2.loli.net/2022/04/12/1PVNjMh9nUAXsl8.png)
![手机版.png](https://s2.loli.net/2022/04/12/mowWb78CGIaH6T2.png)
![后台首页.png](https://s2.loli.net/2022/04/12/ErX2BLTnh7ldz8D.png)
![后台配置.png](https://s2.loli.net/2022/04/12/PwK6aC74XEZlIOL.png)
## 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>

View File

@@ -1,41 +1,41 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
.DS_Store
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
bbs-go
bbs-go.yaml
bbs-go.prod.yaml
bbs-go.dev.yaml
bbs-go.test.yaml
.idea/*
build/*
cscope.files
tags
logs/*.log
web/*
tmp/*
admin/*
internal/web*
cmd/generator/*
go.work
go.work.sum
ip2region.xdb
__debug_bin*
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
.DS_Store
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
bbs-go
bbs-go.yaml
bbs-go.prod.yaml
bbs-go.dev.yaml
bbs-go.test.yaml
.idea/*
build/*
cscope.files
tags
logs/*.log
web/*
tmp/*
admin/*
internal/web*
cmd/generator/*
go.work
go.work.sum
ip2region.xdb
__debug_bin*

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,2 @@
## 介绍
该项目使用Golang进行构建具体参见https://mlog.club
## 介绍
该项目使用Golang进行构建具体参见https://mlog.club

View File

@@ -1,65 +1,65 @@
Port: 8082 # 端口
BaseUrl: https://mlog.club # 网站域名
IpDataPath: # IP数据文件默认读取当前目录下ip2region.xdb文件最新数据文件请从这里下载https://github.com/lionsoul2014/ip2region/tree/master/data
AllowedOrigins:
- "*"
# 日志配置
Logger:
Filename: /data/logs/bbs-go.log # 日志文件的位置
MaxSize: 100 # 文件最大尺寸以MB为单位
MaxAge: 10 # 保留旧文件的最大天数
MaxBackups: 10 # 保留的最大旧文件数量
# 数据库连接
DB:
Url: username:password@tcp(localhost:3306)/bbsgo_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
MaxIdleConns: 50
MaxOpenConns: 200
# 上传配置
Uploader:
# 启用上传方式
Enable: Oss
# 阿里云oss配置
AliyunOss:
Host: # 阿里云OSS资源外网访问地址
Bucket: # 阿里云OSS bucket名称
Endpoint: # 阿里云OSS Endpoint
AccessId: # 阿里云OSS accessID
AccessSecret: # 阿里云OSS accessKey
StyleSplitter: # 阿里云oss图片样式分隔符
StyleAvatar: # 头像图片样式名称
StylePreview: # 预览图片样式名称
StyleSmall: # 小图样式名称
StyleDetail: # 详情图片样式名称
# 本地文件上传
Local:
Host: https://st.mlog.club/ # 上传文件域名
Path: /data/www/st.mlog.club # 上传目录
# 邮件服务器配置,用于邮件通知
Smtp:
Host: # smtp服务地址请设置成你自己的例如smtp.qq.com
Port: # smtp服务端口请设置成你自己额例如25
Username: # 请配置成你自己的
Password: # 请配置成你自己的
SSL: true
# 百度SEO相关配置
# 文档https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14
BaiduSEO:
Site:
Token:
# 神马搜索SEO相关
# 文档https://zhanzhang.sm.cn/open/mip
SmSEO:
Site:
UserName:
Token:
# search
Search:
Port: 8082 # 端口
BaseUrl: https://mlog.club # 网站域名
IpDataPath: # IP数据文件默认读取当前目录下ip2region.xdb文件最新数据文件请从这里下载https://github.com/lionsoul2014/ip2region/tree/master/data
AllowedOrigins:
- "*"
# 日志配置
Logger:
Filename: /data/logs/bbs-go.log # 日志文件的位置
MaxSize: 100 # 文件最大尺寸以MB为单位
MaxAge: 10 # 保留旧文件的最大天数
MaxBackups: 10 # 保留的最大旧文件数量
# 数据库连接
DB:
Url: username:password@tcp(localhost:3306)/bbsgo_db?charset=utf8mb4&parseTime=True&multiStatements=true&loc=Local
MaxIdleConns: 50
MaxOpenConns: 200
# 上传配置
Uploader:
# 启用上传方式
Enable: Oss
# 阿里云oss配置
AliyunOss:
Host: # 阿里云OSS资源外网访问地址
Bucket: # 阿里云OSS bucket名称
Endpoint: # 阿里云OSS Endpoint
AccessId: # 阿里云OSS accessID
AccessSecret: # 阿里云OSS accessKey
StyleSplitter: # 阿里云oss图片样式分隔符
StyleAvatar: # 头像图片样式名称
StylePreview: # 预览图片样式名称
StyleSmall: # 小图样式名称
StyleDetail: # 详情图片样式名称
# 本地文件上传
Local:
Host: https://st.mlog.club/ # 上传文件域名
Path: /data/www/st.mlog.club # 上传目录
# 邮件服务器配置,用于邮件通知
Smtp:
Host: # smtp服务地址请设置成你自己的例如smtp.qq.com
Port: # smtp服务端口请设置成你自己额例如25
Username: # 请配置成你自己的
Password: # 请配置成你自己的
SSL: true
# 百度SEO相关配置
# 文档https://ziyuan.baidu.com/college/courseinfo?id=267&page=2#h2_article_title14
BaiduSEO:
Site:
Token:
# 神马搜索SEO相关
# 文档https://zhanzhang.sm.cn/open/mip
SmSEO:
Site:
UserName:
Token:
# search
Search:
IndexPath: # 索引路径

View File

@@ -1,23 +1,28 @@
#!/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" # 请替换为你的邮箱地址
# 检查 Certbot 是否安装
if ! command -v certbot &> /dev/null
then
echo "Certbot 未安装,开始安装..."
sudo dnf install epel-release -y
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo dnf config-manager --set-enabled crb
sudo dnf update
sudo dnf install certbot python3-certbot-nginx -y
sudo apt update
sudo apt install -y certbot python3-certbot-nginx
fi
# 申请证书
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

View File

@@ -1,13 +1,13 @@
[Unit]
Description=frpc
After=network.target
[Service]
Type=simple
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/frpc -c /etc/frpc/frpc.toml
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
[Unit]
Description=frpc
After=network.target
[Service]
Type=simple
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/frpc -c /etc/frpc/frpc.toml
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target

View File

@@ -1,47 +1,47 @@
# frpc 基础配置
serverAddr = "47.239.121.24"
serverPort = 7000
auth.method = "token"
auth.token = "8f3c9b7d5e2a4f6h1i0j"
[[proxies]]
name = "http"
type = "tcp"
localIP = "127.0.0.1"
localPort = 80
remotePort = 80
[[proxies]]
name = "https"
type = "tcp"
localIP = "127.0.0.1"
localPort = 443
remotePort = 443
# frpc 基础配置
serverAddr = "47.239.121.24"
serverPort = 7000
auth.method = "token"
auth.token = "8f3c9b7d5e2a4f6h1i0j"
[[proxies]]
name = "http"
type = "tcp"
localIP = "127.0.0.1"
localPort = 80
remotePort = 80
[[proxies]]
name = "https"
type = "tcp"
localIP = "127.0.0.1"
localPort = 443
remotePort = 443

View File

@@ -1,15 +1,15 @@
version: "3"
services:
server:
image: gitea/gitea:latest
container_name: gitea
environment:
- GITEA__database__DB_TYPE=sqlite3
restart: always
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3002:3000"
version: "3"
services:
server:
image: gitea/gitea:latest
container_name: gitea
environment:
- GITEA__database__DB_TYPE=sqlite3
restart: always
volumes:
- ./gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3002:3000"
- "222:22"

View File

@@ -1,39 +1,39 @@
server {
listen 80;
server_name navidrome.deepseak.icu;
location / {
proxy_pass http://127.0.0.1:4533;
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 X-Forwarded-Proto $scheme;
# 添加代理超时配置
proxy_connect_timeout 60s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
# 针对Navidrome的特殊配置
# 支持大文件上传和流媒体传输
client_max_body_size 100M;
proxy_buffering off;
# 启用gzip压缩
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied any;
gzip_comp_level 6;
gzip_types
text/plain
text/css
text/xml
text/javascript
application/json
application/javascript
application/xml+rss
application/atom+xml
image/svg+xml;
}
server {
listen 80;
server_name navidrome.deepseak.icu;
location / {
proxy_pass http://127.0.0.1:4533;
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 X-Forwarded-Proto $scheme;
# 添加代理超时配置
proxy_connect_timeout 60s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
# 针对Navidrome的特殊配置
# 支持大文件上传和流媒体传输
client_max_body_size 100M;
proxy_buffering off;
# 启用gzip压缩
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied any;
gzip_comp_level 6;
gzip_types
text/plain
text/css
text/xml
text/javascript
application/json
application/javascript
application/xml+rss
application/atom+xml
image/svg+xml;
}
}

View File

@@ -1,127 +1,127 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server {
listen 443 ssl;
server_name active.deepseak.icu;
ssl_certificate /etc/letsencrypt/live/active.deepseak.icu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/active.deepseak.icu/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 5m;
location / {
proxy_pass http://127.0.0.1:3006;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 443 ssl;
server_name bbs.deepseak.icu;
ssl_certificate /etc/letsencrypt/live/bbs.deepseak.icu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/bbs.deepseak.icu/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 5m;
location / {
proxy_pass http://127.0.0.1:3003;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 443 ssl;
server_name image.deepseak.icu;
ssl_certificate /etc/letsencrypt/live/image.deepseak.icu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/image.deepseak.icu/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://127.0.0.1:3004;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# 添加gitea的HTTP代理
server {
listen 80;
server_name gitea.deepseak.icu;
location / {
proxy_pass http://127.0.0.1:3002;
# 添加代理超时配置
proxy_connect_timeout 60s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
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 X-Forwarded-Proto $scheme;
}
client_max_body_size 50m;
}
# 增加一个空的server用于申请证书
server {
listen 80;
server_name aaa.deepseak.icu;
}
}
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server {
listen 443 ssl;
server_name active.deepseak.icu;
ssl_certificate /etc/letsencrypt/live/registry.deepseak.icu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/registry.deepseak.icu/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 5m;
location / {
proxy_pass http://127.0.0.1:3006;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 443 ssl;
server_name bbs.deepseak.icu;
ssl_certificate /etc/letsencrypt/live/registry.deepseak.icu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/registry.deepseak.icu/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 5m;
location / {
proxy_pass http://127.0.0.1:3003;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 443 ssl;
server_name image.deepseak.icu;
ssl_certificate /etc/letsencrypt/live/registry.deepseak.icu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/registry.deepseak.icu/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass http://127.0.0.1:3004;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
# 添加gitea的HTTP代理
server {
listen 80;
server_name gitea.deepseak.icu;
location / {
proxy_pass http://10.0.3.14:3002;
# 添加代理超时配置
proxy_connect_timeout 60s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
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 X-Forwarded-Proto $scheme;
}
client_max_body_size 50m;
}
# 增加一个空的server用于申请证书
server {
listen 80;
server_name aaa.deepseak.icu;
}
}

View File

@@ -1,30 +1,36 @@
#!/bin/bash
# 检查并创建nginx用户
if ! id -u nginx >/dev/null 2>&1; then
echo "创建nginx用户..."
sudo useradd -r -s /sbin/nologin nginx
fi
# 创建 conf.d 目录(如果不存在)
mkdir -p /etc/nginx/conf.d
sudo mkdir -p /etc/nginx/conf.d
# 备份并覆盖 nginx.conf 文件
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
cp nginx.conf /etc/nginx/
sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
sudo cp nginx.conf /etc/nginx/
# 备份并覆盖 conf.d 目录下的所有 .conf 文件
for conf in conf.d/*.conf; do
filename=$(basename "$conf")
cp "/etc/nginx/conf.d/$filename" "/etc/nginx/conf.d/${filename}.bak" 2>/dev/null || true
cp "$conf" /etc/nginx/conf.d/
sudo cp "/etc/nginx/conf.d/$filename" "/etc/nginx/conf.d/${filename}.bak" 2>/dev/null || true
sudo cp "$conf" /etc/nginx/conf.d/
done
# 测试并重载配置
if nginx -t; then
systemctl reload nginx
if sudo nginx -t; then
sudo systemctl reload nginx
echo "配置已生效HTTPS已启用"
else
echo "配置测试失败,已恢复备份"
# 恢复 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 文件备份
for conf in conf.d/*.conf; do
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
fi

View File

@@ -1,14 +1,14 @@
version: '3.8'
services:
registry:
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/registry:2.8.1
container_name: registry
restart: always
environment:
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
volumes:
- ./auth:/auth
- ./data:/var/lib/registry
ports:
version: '3.8'
services:
registry:
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/registry:2.8.1
container_name: registry
restart: always
environment:
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
volumes:
- ./auth:/auth
- ./data:/var/lib/registry
ports:
- "3005:5000"

View File

@@ -1,337 +1,337 @@
---
# - `/etc/headscale`
# - `~/.headscale`
# - 当前工作目录
## 1. 更新Headscale配置启用HTTPS
# 修改server_url为HTTPS
server_url: https://47.239.121.24:3009
# 启用HTTPS监听
listen_addr: 0.0.0.0:8443
# 添加TLS配置
tls_cert_path: "/var/lib/headscale/server.crt"
tls_key_path: "/var/lib/headscale/server.key"
# 指标监听地址(建议保持内网访问)
metrics_listen_addr: 127.0.0.1:9090
# gRPC监听地址用于远程CLI控制
grpc_listen_addr: 0.0.0.0:50443
# 允许不安全的gRPC连接不建议生产环境使用
grpc_allow_insecure: true
# Noise协议配置
noise:
# 噪声协议私钥路径
private_key_path: /var/lib/headscale/noise_private.key
# IP地址分配前缀
prefixes:
v4: 100.64.0.0/10
v6: fd7a:115c:a1e0::/48
# IP分配策略sequential顺序或 random随机
allocation: sequential
# DERP中继服务器配置
derp:
server:
# 启用内置DERP服务器
enabled: true
# 区域ID避免与公共DERP区域冲突
region_id: 999
# 区域代码和名称显示在客户端UI中
region_code: "headscale"
region_name: "Headscale Embedded DERP"
# STUN服务监听地址用于NAT穿透
stun_listen_addr: "0.0.0.0:3478"
# DERP服务器私钥路径
private_key_path: /var/lib/headscale/derp_server_private.key
# 自动添加内置DERP区域到DERP映射
automatically_add_embedded_derp_region: true
# 公网IPv4/IPv6地址提高连接稳定性
ipv4: 47.239.121.24
# ipv6: 2001:db8::1
# List of externally available DERP maps encoded in JSON
# urls:
# - https://controlplane.tailscale.com/derpmap/default
# Locally available DERP map files encoded in YAML
#
# This option is mostly interesting for people hosting
# their own DERP servers:
# https://tailscale.com/kb/1118/custom-derp-servers/
#
# paths:
# - /etc/headscale/derp-example.yaml
paths: []
# If enabled, a worker will be set up to periodically
# refresh the given sources and update the derpmap
# will be set up.
auto_update_enabled: true
# How often should we check for DERP updates?
update_frequency: 24h
# Disables the automatic check for headscale updates on startup
disable_check_updates: false
# Time before an inactive ephemeral node is deleted?
ephemeral_node_inactivity_timeout: 30m
database:
# Database type. Available options: sqlite, postgres
# 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.
type: sqlite
# Enable debug mode. This setting requires the log.level to be set to "debug" or "trace".
debug: true
# GORM configuration settings.
gorm:
# Enable prepared statements.
prepare_stmt: true # 启用预处理语句
parameterized_queries: true # 启用参数化查询
skip_err_record_not_found: true # 跳过"记录未找到"错误
slow_threshold: 1000 # 慢查询阈值(毫秒)
# SQLite config
sqlite:
path: /var/lib/headscale/db.sqlite
write_ahead_log: true # 启用WAL模式生产推荐
wal_autocheckpoint: 1000 # WAL自动检查点阈值
# # Postgres config
# Please note that using Postgres is highly discouraged as it is only supported for legacy reasons.
# See database.type for more information.
# postgres:
# # If using a Unix socket to connect to Postgres, set the socket path in the 'host' field and leave 'port' blank.
# host: localhost
# port: 5432
# name: headscale
# user: foo
# pass: bar
# max_open_conns: 10
# max_idle_conns: 10
# conn_max_idle_time_secs: 3600
# # 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.
# ssl: false
### TLS configuration - 已注释掉,调试后再启用
#
## Let's encrypt / ACME
#
# headscale supports automatically requesting and setting up
# TLS for a domain with Let's Encrypt.
#
# URL to ACME directory
# acme_url: https://acme-v02.api.letsencrypt.org/directory
# Email to register with ACME provider
# acme_email: ""
# Domain name to request a TLS certificate for:
# tls_letsencrypt_hostname: ""
# Path to store certificates and metadata needed by
# letsencrypt
# For production:
# tls_letsencrypt_cache_dir: /var/lib/headscale/cache
# Type of ACME challenge to use, currently supported types:
# HTTP-01 or TLS-ALPN-01
# See: docs/ref/tls.md for more information
# tls_letsencrypt_challenge_type: HTTP-01
# When HTTP-01 challenge is chosen, letsencrypt must set up a
# verification endpoint, and it will be listening on:
# :http = port 80
# tls_letsencrypt_listen: ":http"
## Use already defined certificates:
# tls_cert_path: ""
# tls_key_path: ""
log:
# Output formatting for logs: text or json
format: text
level: info
## Policy
# headscale supports Tailscale's ACL policies.
# Please have a look to their KB to better
# understand the concepts: https://tailscale.com/kb/1018/acls/
policy:
# The mode can be "file" or "database" that defines
# where the ACL policies are stored and read from.
mode: file
# If the mode is set to "file", the path to a
# HuJSON file containing ACL policies.
path: ""
## DNS
#
# headscale supports Tailscale's DNS configuration and MagicDNS.
# Please have a look to their KB to better understand the concepts:
#
# - https://tailscale.com/kb/1054/dns/
# - https://tailscale.com/kb/1081/magicdns/
# - https://tailscale.com/blog/2021-09-private-dns-withmagicdns/
#
# Please note that for the DNS configuration to have any effect,
# clients must have the `--accept-dns=true` option enabled. This is the
# default for the Tailscale client. This option is enabled by default
# in the Tailscale client.
#
# Setting _any_ of the configuration and `--accept-dns=true` on the
# clients will integrate with the DNS manager on the client or
# overwrite /etc/resolv.conf.
# https://tailscale.com/kb/1235/resolv-conf
#
# If you want stop Headscale from managing the DNS configuration
# all the fields under `dns` should be set to empty values.
dns:
# Whether to use [MagicDNS](https://tailscale.com/kb/1081/magicdns/).
magic_dns: false
# Defines the base domain to create the hostnames for MagicDNS.
# This domain _must_ be different from the server_url domain.
# `base_domain` must be a FQDN, without the trailing dot.
# The FQDN of the hosts will be
# `hostname.base_domain` (e.g., _myhost.example.com_).
base_domain: example.com
# List of DNS servers to expose to clients.
nameservers:
global:
- 114.114.114.114
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
# "abc123" is example NextDNS ID, replace with yours.
# - https://dns.nextdns.io/abc123
# Split DNS (see https://tailscale.com/kb/1054/dns/),
# a map of domains and which DNS server to use for each.
split:
{}
# foo.bar.com:
# - 1.1.1.1
# darp.headscale.net:
# - 1.1.1.1
# - 8.8.8.8
# Set custom DNS search domains. With MagicDNS enabled,
# your tailnet base_domain is always the first search domain.
search_domains: []
# Extra DNS records
# so far only A and AAAA records are supported (on the tailscale side)
# See: docs/ref/dns.md
extra_records: []
# - name: "grafana.myvpn.example.com"
# type: "A"
# value: "100.64.0.3"
#
# # you can also put it in one line
# - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.3" }
#
# Alternatively, extra DNS records can be loaded from a JSON file.
# Headscale processes this file on each change.
# extra_records_path: /var/lib/headscale/extra-records.json
# Unix socket used for the CLI to connect without authentication
# Note: for production you will want to set this to something like:
unix_socket: /var/run/headscale/headscale.sock
unix_socket_permission: "0770"
# headscale supports experimental OpenID connect support,
# it is still being tested and might have some bugs, please
# help us test it.
# OpenID Connect
# oidc:
# only_start_if_oidc_is_available: true
# issuer: "https://your-oidc.issuer.com/path"
# client_id: "your-oidc-client-id"
# client_secret: "your-oidc-client-secret"
# # Alternatively, set `client_secret_path` to read the secret from the file.
# # It resolves environment variables, making integration to systemd's
# # `LoadCredential` straightforward:
# client_secret_path: "${CREDENTIALS_DIRECTORY}/oidc_client_secret"
# # client_secret and client_secret_path are mutually exclusive.
#
# # The amount of time from a node is authenticated with OpenID until it
# # expires and needs to reauthenticate.
# # Setting the value to "0" will mean no expiry.
# expiry: 180d
#
# # 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
# # only been enabled if you know what you are doing.
# # Note: enabling this will cause `oidc.expiry` to be ignored.
# use_expiry_from_token: false
#
# # 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".
#
# scope: ["openid", "profile", "email", "custom"]
# extra_params:
# domain_hint: example.com
#
# # List allowed principal domains and/or users. If an authenticated user's domain is not in this list, the
# # authentication request will be rejected.
#
# allowed_domains:
# - example.com
# # Note: Groups from keycloak have a leading '/'
# allowed_groups:
# - /headscale
# allowed_users:
# - alice@example.com
#
# # Optional: PKCE (Proof Key for Code Exchange) configuration
# # PKCE adds an additional layer of security to the OAuth 2.0 authorization code flow
# # by preventing authorization code interception attacks
# # See https://datatracker.ietf.org/doc/html/rfc7636
# pkce:
# # Enable or disable PKCE support (default: false)
# enabled: false
# # PKCE method to use:
# # - plain: Use plain code verifier
# # - S256: Use SHA256 hashed code verifier (default, recommended)
# method: S256
#
# # 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
# # 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
# # proper display name and picture if available.
# # 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
# # with the provider.
# # 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
# # on all new installations, or when all users have logged in with OIDC once.
# map_legacy_users: false
# Logtail configuration
# Logtail is Tailscales logging and auditing infrastructure, it allows the control panel
# to instruct tailscale nodes to log their activity to a remote server.
logtail:
# Enable logtail for this headscales clients.
# 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.
enabled: true
# 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
# firewall devices. See https://tailscale.com/kb/1181/firewalls/ for more information.
randomize_client_port: false
---
# - `/etc/headscale`
# - `~/.headscale`
# - 当前工作目录
## 1. 更新Headscale配置启用HTTPS
# 修改server_url为HTTPS
server_url: https://47.239.121.24:3009
# 启用HTTPS监听
listen_addr: 0.0.0.0:8443
# 添加TLS配置
tls_cert_path: "/var/lib/headscale/server.crt"
tls_key_path: "/var/lib/headscale/server.key"
# 指标监听地址(建议保持内网访问)
metrics_listen_addr: 127.0.0.1:9090
# gRPC监听地址用于远程CLI控制
grpc_listen_addr: 0.0.0.0:50443
# 允许不安全的gRPC连接不建议生产环境使用
grpc_allow_insecure: true
# Noise协议配置
noise:
# 噪声协议私钥路径
private_key_path: /var/lib/headscale/noise_private.key
# IP地址分配前缀
prefixes:
v4: 100.64.0.0/10
v6: fd7a:115c:a1e0::/48
# IP分配策略sequential顺序或 random随机
allocation: sequential
# DERP中继服务器配置
derp:
server:
# 启用内置DERP服务器
enabled: true
# 区域ID避免与公共DERP区域冲突
region_id: 999
# 区域代码和名称显示在客户端UI中
region_code: "headscale"
region_name: "Headscale Embedded DERP"
# STUN服务监听地址用于NAT穿透
stun_listen_addr: "0.0.0.0:3478"
# DERP服务器私钥路径
private_key_path: /var/lib/headscale/derp_server_private.key
# 自动添加内置DERP区域到DERP映射
automatically_add_embedded_derp_region: true
# 公网IPv4/IPv6地址提高连接稳定性
ipv4: 47.239.121.24
# ipv6: 2001:db8::1
# List of externally available DERP maps encoded in JSON
# urls:
# - https://controlplane.tailscale.com/derpmap/default
# Locally available DERP map files encoded in YAML
#
# This option is mostly interesting for people hosting
# their own DERP servers:
# https://tailscale.com/kb/1118/custom-derp-servers/
#
# paths:
# - /etc/headscale/derp-example.yaml
paths: []
# If enabled, a worker will be set up to periodically
# refresh the given sources and update the derpmap
# will be set up.
auto_update_enabled: true
# How often should we check for DERP updates?
update_frequency: 24h
# Disables the automatic check for headscale updates on startup
disable_check_updates: false
# Time before an inactive ephemeral node is deleted?
ephemeral_node_inactivity_timeout: 30m
database:
# Database type. Available options: sqlite, postgres
# 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.
type: sqlite
# Enable debug mode. This setting requires the log.level to be set to "debug" or "trace".
debug: true
# GORM configuration settings.
gorm:
# Enable prepared statements.
prepare_stmt: true # 启用预处理语句
parameterized_queries: true # 启用参数化查询
skip_err_record_not_found: true # 跳过"记录未找到"错误
slow_threshold: 1000 # 慢查询阈值(毫秒)
# SQLite config
sqlite:
path: /var/lib/headscale/db.sqlite
write_ahead_log: true # 启用WAL模式生产推荐
wal_autocheckpoint: 1000 # WAL自动检查点阈值
# # Postgres config
# Please note that using Postgres is highly discouraged as it is only supported for legacy reasons.
# See database.type for more information.
# postgres:
# # If using a Unix socket to connect to Postgres, set the socket path in the 'host' field and leave 'port' blank.
# host: localhost
# port: 5432
# name: headscale
# user: foo
# pass: bar
# max_open_conns: 10
# max_idle_conns: 10
# conn_max_idle_time_secs: 3600
# # 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.
# ssl: false
### TLS configuration - 已注释掉,调试后再启用
#
## Let's encrypt / ACME
#
# headscale supports automatically requesting and setting up
# TLS for a domain with Let's Encrypt.
#
# URL to ACME directory
# acme_url: https://acme-v02.api.letsencrypt.org/directory
# Email to register with ACME provider
# acme_email: ""
# Domain name to request a TLS certificate for:
# tls_letsencrypt_hostname: ""
# Path to store certificates and metadata needed by
# letsencrypt
# For production:
# tls_letsencrypt_cache_dir: /var/lib/headscale/cache
# Type of ACME challenge to use, currently supported types:
# HTTP-01 or TLS-ALPN-01
# See: docs/ref/tls.md for more information
# tls_letsencrypt_challenge_type: HTTP-01
# When HTTP-01 challenge is chosen, letsencrypt must set up a
# verification endpoint, and it will be listening on:
# :http = port 80
# tls_letsencrypt_listen: ":http"
## Use already defined certificates:
# tls_cert_path: ""
# tls_key_path: ""
log:
# Output formatting for logs: text or json
format: text
level: info
## Policy
# headscale supports Tailscale's ACL policies.
# Please have a look to their KB to better
# understand the concepts: https://tailscale.com/kb/1018/acls/
policy:
# The mode can be "file" or "database" that defines
# where the ACL policies are stored and read from.
mode: file
# If the mode is set to "file", the path to a
# HuJSON file containing ACL policies.
path: ""
## DNS
#
# headscale supports Tailscale's DNS configuration and MagicDNS.
# Please have a look to their KB to better understand the concepts:
#
# - https://tailscale.com/kb/1054/dns/
# - https://tailscale.com/kb/1081/magicdns/
# - https://tailscale.com/blog/2021-09-private-dns-withmagicdns/
#
# Please note that for the DNS configuration to have any effect,
# clients must have the `--accept-dns=true` option enabled. This is the
# default for the Tailscale client. This option is enabled by default
# in the Tailscale client.
#
# Setting _any_ of the configuration and `--accept-dns=true` on the
# clients will integrate with the DNS manager on the client or
# overwrite /etc/resolv.conf.
# https://tailscale.com/kb/1235/resolv-conf
#
# If you want stop Headscale from managing the DNS configuration
# all the fields under `dns` should be set to empty values.
dns:
# Whether to use [MagicDNS](https://tailscale.com/kb/1081/magicdns/).
magic_dns: false
# Defines the base domain to create the hostnames for MagicDNS.
# This domain _must_ be different from the server_url domain.
# `base_domain` must be a FQDN, without the trailing dot.
# The FQDN of the hosts will be
# `hostname.base_domain` (e.g., _myhost.example.com_).
base_domain: example.com
# List of DNS servers to expose to clients.
nameservers:
global:
- 114.114.114.114
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
# "abc123" is example NextDNS ID, replace with yours.
# - https://dns.nextdns.io/abc123
# Split DNS (see https://tailscale.com/kb/1054/dns/),
# a map of domains and which DNS server to use for each.
split:
{}
# foo.bar.com:
# - 1.1.1.1
# darp.headscale.net:
# - 1.1.1.1
# - 8.8.8.8
# Set custom DNS search domains. With MagicDNS enabled,
# your tailnet base_domain is always the first search domain.
search_domains: []
# Extra DNS records
# so far only A and AAAA records are supported (on the tailscale side)
# See: docs/ref/dns.md
extra_records: []
# - name: "grafana.myvpn.example.com"
# type: "A"
# value: "100.64.0.3"
#
# # you can also put it in one line
# - { name: "prometheus.myvpn.example.com", type: "A", value: "100.64.0.3" }
#
# Alternatively, extra DNS records can be loaded from a JSON file.
# Headscale processes this file on each change.
# extra_records_path: /var/lib/headscale/extra-records.json
# Unix socket used for the CLI to connect without authentication
# Note: for production you will want to set this to something like:
unix_socket: /var/run/headscale/headscale.sock
unix_socket_permission: "0770"
# headscale supports experimental OpenID connect support,
# it is still being tested and might have some bugs, please
# help us test it.
# OpenID Connect
# oidc:
# only_start_if_oidc_is_available: true
# issuer: "https://your-oidc.issuer.com/path"
# client_id: "your-oidc-client-id"
# client_secret: "your-oidc-client-secret"
# # Alternatively, set `client_secret_path` to read the secret from the file.
# # It resolves environment variables, making integration to systemd's
# # `LoadCredential` straightforward:
# client_secret_path: "${CREDENTIALS_DIRECTORY}/oidc_client_secret"
# # client_secret and client_secret_path are mutually exclusive.
#
# # The amount of time from a node is authenticated with OpenID until it
# # expires and needs to reauthenticate.
# # Setting the value to "0" will mean no expiry.
# expiry: 180d
#
# # 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
# # only been enabled if you know what you are doing.
# # Note: enabling this will cause `oidc.expiry` to be ignored.
# use_expiry_from_token: false
#
# # 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".
#
# scope: ["openid", "profile", "email", "custom"]
# extra_params:
# domain_hint: example.com
#
# # List allowed principal domains and/or users. If an authenticated user's domain is not in this list, the
# # authentication request will be rejected.
#
# allowed_domains:
# - example.com
# # Note: Groups from keycloak have a leading '/'
# allowed_groups:
# - /headscale
# allowed_users:
# - alice@example.com
#
# # Optional: PKCE (Proof Key for Code Exchange) configuration
# # PKCE adds an additional layer of security to the OAuth 2.0 authorization code flow
# # by preventing authorization code interception attacks
# # See https://datatracker.ietf.org/doc/html/rfc7636
# pkce:
# # Enable or disable PKCE support (default: false)
# enabled: false
# # PKCE method to use:
# # - plain: Use plain code verifier
# # - S256: Use SHA256 hashed code verifier (default, recommended)
# method: S256
#
# # 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
# # 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
# # proper display name and picture if available.
# # 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
# # with the provider.
# # 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
# # on all new installations, or when all users have logged in with OIDC once.
# map_legacy_users: false
# Logtail configuration
# Logtail is Tailscales logging and auditing infrastructure, it allows the control panel
# to instruct tailscale nodes to log their activity to a remote server.
logtail:
# Enable logtail for this headscales clients.
# 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.
enabled: true
# 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
# firewall devices. See https://tailscale.com/kb/1181/firewalls/ for more information.
randomize_client_port: false

View File

@@ -1,28 +1,28 @@
version: "3.9"
services:
headscale:
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/headscale/headscale:v0.23.0-beta2
container_name: headscale
restart: unless-stopped
environment:
- HEADSCALE_API_KEY=QC33VFzaUw.u1qwXFap0QpFAQnwkdGuUyvpspL15185A5JnWeFpt_c
command: serve --config /etc/headscale/config.yaml
volumes:
- ./data/headscale:/var/lib/headscale
- ./config.yaml:/etc/headscale/config.yaml
ports:
- "3008:8080" # Headscale API (HTTP)
- "3009:8443" # Headscale API (HTTPS)
- "9090:9090" # Metrics
- "3478:3478/udp" # STUN UDP
- "3478:3478/tcp" # STUN TCP
- "50443:50443" # gRPC
cap_add:
- NET_ADMIN
sysctls:
- net.ipv4.ip_forward=1
version: "3.9"
services:
headscale:
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/headscale/headscale:v0.23.0-beta2
container_name: headscale
restart: unless-stopped
environment:
- HEADSCALE_API_KEY=QC33VFzaUw.u1qwXFap0QpFAQnwkdGuUyvpspL15185A5JnWeFpt_c
command: serve --config /etc/headscale/config.yaml
volumes:
- ./data/headscale:/var/lib/headscale
- ./config.yaml:/etc/headscale/config.yaml
ports:
- "3008:8080" # Headscale API (HTTP)
- "3009:8443" # Headscale API (HTTPS)
- "9090:9090" # Metrics
- "3478:3478/udp" # STUN UDP
- "3478:3478/tcp" # STUN TCP
- "50443:50443" # gRPC
cap_add:
- NET_ADMIN
sysctls:
- net.ipv4.ip_forward=1