GithubHelp home page GithubHelp logo

mlogclub / bbs-go Goto Github PK

View Code? Open in Web Editor NEW
2.8K 65.0 580.0 32.09 MB

基于Golang的开源社区系统。简洁对话,高效互动,社区新体验!

Home Page: https://bbs-go.com

License: GNU General Public License v3.0

Go 46.15% Shell 0.18% JavaScript 1.61% HTML 5.47% Vue 35.62% SCSS 2.96% CSS 1.18% Dockerfile 0.13% Makefile 0.04% TypeScript 6.36% Less 0.31%
iris gorm bbs nuxt community forum

bbs-go's Introduction

感谢您的支持与鼓励!如果您喜欢这个开源项目,不妨给它点个⭐️⭐️⭐️,您的星星是我们前进的动力 🙏🙏🙏

项目地址

联系我

用户交流群

BBS-GO用户交流群

加我微信

BBS-GO用户交流群

付费服务

付费是为了项目能够更好的生存下去,请谅解。项目将一如既往的开源下去~

服务 价格 服务内容
商用授权 ¥1628(终生) 提供bbs-go商业使用授权
付费咨询 面议 付费答疑解惑,协助解决问题
功能定制 面议 接受各种功能定制,只有你想不到的没有我们做不到的

介绍

bbs-go是一个使用Go语言搭建的开源社区系统,采用前后端分离技术,Go语言提供api进行数据支撑,用户界面使用Nuxt.js进行渲染,后台界面基于element-ui。如果你正在学习Go语言,或者考虑转Go语言的Phper/Javaer...那么该项目对你有的学习会有很大的帮助,欢迎一起来交流。

bbs-go功能简介

模块

server

bbs-go-server

基于Golang搭建,提供接口数据支撑。

技术栈

site

bbs-go-site

前端页面渲染服务,基于nuxt.js搭建。

技术栈

admin

bbs-go-admin

管理后台系统,基于vue.js + element-ui搭建。

技术栈

功能预览

首页.png 发帖.png 发动态.png 个人中心.png 手机版.png 后台首页.png 后台配置.png

Contributors

bbs-go's People

Contributors

20202200 avatar 88250 avatar athom avatar awkj avatar bbbbbbbbbbbbba avatar danielroe avatar dependabot[bot] avatar dongshanlang avatar espush avatar fanchenggang avatar hodge1997 avatar kataras avatar lftcai avatar lienze avatar mainjzb avatar monkeywithacupcake avatar quantumghost avatar quarkay avatar redxpanda avatar renny-ren avatar sansanyun avatar vcancy avatar yakumo-yukari avatar zzy624 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bbs-go's Issues

Error 1146: Table 'bbsgo_db.t_topic_node' doesn't exist

你好,我使用时一开始用MySQL 5.6创建的数据库charset默认成了latin1,发现错误以后我drop了所有table,改了数据库charset和collation,重新用文档里的数据库SQL做了初始化,删除了静态生成的xml。

正常登陆admin后台,但是当我想创建第一个话题节点时,提示上面错误。请问怎么办?

验证码图片无法显示

--- 访问 api/captcha/request 返回的 captchaUrl 为127.0.0.1 导致图片无法显示成功
{
 "errorCode": 0,
 "message": "",
 "data": {
  "captchaId": "iOPa64RnSSzBKlyXGNCn",
  "captchaUrl": "http://127.0.0.1/api/captcha/show?captchaId=iOPa64RnSSzBKlyXGNCn"
 },
 "success": true
}

Error 1364: Field 'type' doesn't have a default value

test env

bbs-go version v3.1.3
mysql docker image --->mariadb/server:10.4

what i did

topic/create  ---> 发表主题

log info

(/bbs-go/server/repositories/topic_repository.go:69)
[2020-06-26 09:27:03]  Error 1364: Field 'type' doesn't have a default value

The checksum of server's golang dependence mismatch

env

$ go version
go version go1.13.6 linux/amd64

$ cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)

error log

# go mod download
verifying github.com/kataras/iris/[email protected]/go.mod: checksum mismatch
	downloaded: h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U=
	go.sum:     h1:SwHqNIXZt54j+lgTpkbOF22syfzQg7iNTh3mFMnG6nU=

SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

For more information, see 'go help module-auth'.

在拥有禁言权限的时候禁言自己会出现bug

拥有禁言权限应该不允许禁言自己

在禁言自己后前端点击解除禁言不会生效,当前状体文字会先显示禁言解除 但是刷新页面后依然是禁言状态,但是在后台禁言状态

是现实 正常状态 实际是用户依然是禁言状态 无法发帖和删帖

docker 本地启动报错

v3.1.4
本地 MACOS
docker 方式启动

bbs-go-site_1 | > [email protected] start /app
bbs-go-site_1 | > nuxt start
bbs-go-site_1 |
bbs-go-site_1 | ℹ Listening on: http://172.20.0.3:3000/
bbs-go-server_1 | time="2020-07-01T12:37:42+08:00" level=error msg="Get : unsupported protocol scheme """
bbs-go-server_1 | time="2020-07-01T12:37:57+08:00" level=error msg="Get : unsupported protocol scheme """
bbs-go-server_1 | time="2020-07-01T12:38:12+08:00" level=error msg="Get : unsupported protocol scheme """
bbs-go-server_1 | time="2020-07-01T12:38:27+08:00" level=error msg="Get : unsupported protocol scheme """

The checksum of server's golang dependence mismatch

env

$ go version
go version go1.13.6 linux/amd64

$ cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)

error log

# go mod download
verifying github.com/kataras/iris/[email protected]/go.mod: checksum mismatch
	downloaded: h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U=
	go.sum:     h1:SwHqNIXZt54j+lgTpkbOF22syfzQg7iNTh3mFMnG6nU=

SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

For more information, see 'go help module-auth'.

建议增加类似issue的功能

现在纯论坛模式在国内基本个人小玩家都挂不了了。
建议可以增加兼容issue社区反馈等的,类似github issue反馈等业务型的反馈功能。

把this替换成m?

今天发现这个项目,非常棒!感谢作者。
小小建议:this改成m,因为this在goland小波浪线,看着不舒服。😸

建议增加对vim的支持

建议增加脚本自动生成cscope及tags文件,方便开发人员使用vim查看代码,以及开发相关功能。

前端[后台管理]页面中,用户信息roles无法传递到后台顺利通过iris转化为正确格式数组的bug

本地搭建后尝试了后台管理的功能,发现并不能直接通过编辑用户信息添加角色,调试后发现,前台传输的roles是数组如下图:
image
而这个信息传到后台时,控制器源码如下图使用simple.FormValueStringArray中的FormValue,并不能获取出正确的数据
image
image
我尝试用其他方法来fix 这个bug,但我发现前端数组传到后台在iris中找不到直接回归数组的方法,roles这个key在后台已经变成了带下标的键了,直接formvalue('roles')是获取不到任何值的,iris在国内的相关文档少之又少,国外google不到类似的情况,所以这种问题到底怎么解决?

Docker部署,图片打不开

image

Docker部署的,使用localhost可以访问,使用ip在其他机器访问的话,就打不开图片,查看发现图片是地址localhost?

bash ./build.sh 文件中有不可见字符 \r

运行命令 bash ./build.sh


./build.sh: line 2: $'\r': command not found
./build.sh: line 6: $'\r': command not found
./build.sh: line 11: $'\r': command not found
./build.sh: line 17: $'\r': command not found
./build.sh: line 18: $'\r': command not found
./build.sh: line 19: syntax error near unexpected token `$'{\r''
'/build.sh: line 19: `funcBuildServer() {

使用命令vim -b build.sh 打开build.sh文件

image

生产环境中,originalUrl未定义

配置描述如下:

  1. Nginx将访问域名反向代理到localhost:3000的site服务;
  2. nuxt.config.js的配置描述如下:
    export default {
    server: {
    port: 3000,
    host: '0.0.0.0',
    timing: {
    total: true,
    },
    },
    mode: 'universal',
    /*
    ** Headers of the page
    /
    head: {
    htmlAttrs: {
    lang: 'zh-cmn-Hans',
    },
    title: '',
    meta: [
    { charset: 'utf-8' },
    {
    name: 'viewport',
    content:
    'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui',
    },
    { name: 'window-target', content: '_top' },
    ],
    link: [
    { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
    {
    rel: 'alternate',
    type: 'application/atom+xml',
    title: '最新文章',
    href: '/atom.xml',
    },
    {
    rel: 'alternate',
    type: 'application/atom+xml',
    title: '最新话题',
    href: '/topic_atom.xml',
    },
    {
    rel: 'alternate',
    type: 'application/atom+xml',
    title: '最新开源项目',
    href: '/project_atom.xml',
    },
    {
    rel: 'stylesheet',
    href: '//cdn.staticfile.org/bulma/0.8.0/css/bulma.min.css',
    },
    {
    rel: 'stylesheet',
    href: '//at.alicdn.com/t/font_1142441_bu6x3hdokz.css',
    },
    ],
    },
    /

    ** Customize the progress-bar color
    /
    loading: { color: '#FFB90F' },
    /

    ** Global CSS
    /
    css: [{ src: '~/assets/styles/main.scss', lang: 'scss' }],
    /

    ** Plugins to load before mounting the App
    /
    plugins: [
    '/plugins/filters',
    '
    /plugins/axios',
    '/plugins/bbs-go',
    { src: '
    /plugins/infinite-scroll', ssr: false },
    { src: '~/plugins/vue-lazyload', ssr: false },
    ],
    /

    ** Nuxt.js dev-modules
    /
    buildModules: [
    // Doc: https://github.com/nuxt-community/eslint-module
    '@nuxtjs/eslint-module',
    ],
    /

    ** Nuxt.js modules
    /
    modules: [
    // Doc:https://github.com/nuxt-community/modules/tree/master/packages/bulma
    // '@nuxtjs/bulma',
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/axios',
    '@nuxtjs/eslint-module',
    '@nuxtjs/toast',
    ['cookie-universal-nuxt', { alias: 'cookies' }],
    [
    '@nuxtjs/google-adsense',
    {
    id: 'ca-pub-5683711753850351',
    pageLevelAds: true,
    },
    ],
    ],
    /

    ** Axios module configuration
    ** See https://axios.nuxtjs.org/options
    */
    axios: {
    proxy: true,
    credentials: true,
    },

proxy: {
'/api/':
process.env.NODE_ENV === 'production'
? 'http://api.shitcoin.chat'
: process.env.NODE_ENV === 'docker'
? 'http://bbs-go-server:8082'
: 'http://172.21.174.102:8082',
},

// Doc: https://github.com/shakee93/vue-toasted
// Doc: https://github.com/nuxt-community/modules/tree/master/packages/toast
toast: {
position: 'top-right',
duration: 2000, // Display time of the toast in millisecond
keepOnHover: true, // When mouse is over a toast's element, the corresponding duration timer is paused until the cursor leaves the element
},

/*
** Build configuration
/
build: {
// publicPath: 'https://file.mlog.club/static/nuxtclient/',
optimizeCSS: true,
extractCSS: true,
splitChunks: {
layouts: true,
pages: true,
commons: true,
},
postcss: {
preset: {
features: {
customProperties: false,
},
},
},
/

** You can extend webpack config here
*/
extend(config, ctx) {},
},
}

  1. bbs-go.yaml的配置如下:
    Env: prod # 环境,线上环境:prod、测试环境:dev
    BaseUrl: "" # 网站域名
    Port: '8082' # 端口
    LogFile: ./data/logs/bbs-go.log # 日志文件
    ShowSql: false # 是否打印sql
    StaticPath: ./data/www # 根路径下的静态文件目录,可配置绝对路径

数据库连接

MySqlUrl: shitcoin:password@tcp(ip:port)/bbsgo_db?charset=utf8mb4&parseTime=True&loc=Local

github登录配置

Github:
ClientID:
ClientSecret:

qq登录配置

QQConnect:
AppId:
AppKey:
Uploader:
Enable: local
# 阿里云oss配置
Local:
Host: "http://shitcoin.chat"
Path: "./data"
AliyunOss:
Host: 请配置成你自己的
Bucket: 请配置成你自己的
Endpoint: 请配置成你自己的
AccessId: 请配置成你自己的
AccessSecret: 请配置成你自己的

邮件服务器配置,用于邮件通知

Smtp:
Addr: smtp.qq.com
Port: '25'
Username: 请配置成你自己的
Password: 请配置成你自己的

百度ai配置,用于自动分析文章摘要、标签

BaiduAi:
ApiKey:
SecretKey:

操作行为描述: 更新头像图片

site错误输出:
ERROR Cannot read property 'originalUrl' of undefined 11:55:52

at getSignInUrl (middleware/authenticated.js:35:0)
at toSignIn (middleware/authenticated.js:26:0)
at server.js:386:5
at promisify (.nuxt/utils.js:259:0)
at middlewareSeries (.nuxt/utils.js:239:0)
at module.exports.webpack_exports.default (.nuxt/server.js:205:0)
at processTicksAndRejections (internal/process/task_queues.js:97:5)

CheckInService的CheckIn方法

CheckIn 方法这样加锁,不是同时只有一个人可以签到了么,用户一多 同时签到的时候不是要排队签到影响并发了么

func (s *checkInService) CheckIn(userId int64) error {
	s.m.Lock()
	defer s.m.Unlock()
	....
}

error 未传递

func(key cache.Key) (value cache.Value, e error) {
value = repositories.UserRepository.Get(simple.DB(), key2Int64(key))
return
},
repositories.UserRepository.Get 没有传递error, 会导致loader中的e永远是nil,然后cache中的逻辑 (err always nil)永远都不会执行c.stats.RecordLoadError(loadTime) [goburrow/cache/local.go line: 295]
if err != nil {
c.stats.RecordLoadError(loadTime)
return nil, err
}
c.stats.RecordLoadSuccess(loadTime)
en := newEntry(k, v, sum(k))
c.setEntryWriteTime(en, now)
c.setEntryAccessTime(en, now)
c.sendEvent(eventWrite, en)
return v, nil

发送邮件异常dial tcp :25: connectex: No connection could be made because the target machine actively refused it.

我这里做了个本地测试,尝试了用多种方法链接smtp邮箱,刚开始是自己随便配了个站点邮箱,可以用网易邮箱大师发送邮件,但是用bbs-go配置上这个信息在main里面直接发送邮件测试发现不行,后来用qq个人邮箱开启了smtp服务尝试,甚至链接smtp.qq.com都说dial tcp :25: connectex: No connection could be made because the target machine actively refused it.
ssl开关都不行,我甚至开始怀疑这个邮箱模块是否能用,这里是我个人邮箱的配置,可以拿去调试
image
这里是我在main中调用发送的配置
image
但实情是,我在项目启动后会调用这个发送邮箱的模块,但是始终报错dial tcp :25: connectex: No connection could be made because the target machine actively refused it.
这个端口是可以通过其他平台的客户端软件通过stmp发送邮件的,包括直接用telnet也可以连接,那么问题来了,是什么导致连这个端口在bss-go的邮箱模块访问不了的呢?

This can impact web performance

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
layouts/admin/907ce8a6.4984274.js (483 KiB)

执行 go run main.go 报错

2019/07/29 10:19:55 /Users/knight/Repository/go/pkg/mod/github.com/ikeikeikeike/go-sitemap-generator/[email protected]/stm/sitemap.go:14: Max processors 8
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x16c9bc6]

goroutine 62 [running]:
github.com/ikeikeikeike/go-sitemap-generator/v2/stm.(*Sitemap).XMLContent(...)
/Users/knight/Repository/go/pkg/mod/github.com/ikeikeikeike/go-sitemap-generator/[email protected]/stm/sitemap.go:103
github.com/mlogclub/mlog/services.(*articleService).GenerateSitemap(0x22eb0f8)
/Users/knight/Repository/go/src/mlog/services/article_service.go:294 +0x5c6
github.com/mlogclub/mlog/app.generateSitemapAndRss.func1()
/Users/knight/Repository/go/src/mlog/app/starting.go:20 +0x2d
created by github.com/mlogclub/mlog/app.generateSitemapAndRss
/Users/knight/Repository/go/src/mlog/app/starting.go:19 +0x35
exit status 2

验证码

您好,请教一下,我按照教程搭建了bbs,但是验证码图片显示不出来,求助~

跑起服务后,注册时有问题

image

每次注册时,就会弹出报错,报错信息见上图。

而且代码里面搜索 no such host 找不到对应的。

代码里面和.jpg相关的就只有这段 utils.go :

// generateKey 生成图片Key
func generateImageKey(data []byte) string {
	md5 := simple.MD5Bytes(data)
	return filepath.Join("images", simple.TimeFormat(time.Now(), "2006/01/02/"), md5+".jpg")
}

可能是qq邮箱的报错,也有可能是其他,我明天设置一下网易邮箱试试

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.