truthhun / dochub Goto Github PK
View Code? Open in Web Editor NEW参考百度文库,使用Beego(Golang)开发的开源文库系统
Home Page: https://www.wenkuzhijia.cn
License: Apache License 2.0
参考百度文库,使用Beego(Golang)开发的开源文库系统
Home Page: https://www.wenkuzhijia.cn
License: Apache License 2.0
如付费下载文档 会员 购买积分等功能
你好,我的文档为啥打不开预览效果呢
日志提示:处理失败:exec: "soffice": executable file not found in $PATH
我用的centos7,pdf2svg没有找到安装包,跟这个有关系吗
看到这个提示:当前格式(txt)文档暂时不支持在线预览,请下载原文档对内容进行浏览。
复杂的实现了,最简单的却忘了。
我太懒了,不想注册,主要是加上真的方便。
希望能将安装步骤写详细点,谢谢
你好,如何联系您?V或QQ?
现在通过pdf.js在线浏览pdf的性能应该比较好了,为什么还要增加pdf转svg过程去浏览svg?
主要通过pdf.js浏览甚至可以保留pdf的链接特性,更是方便啊。
你好,我在导入项目后,提示sitemap找不到请问是什么原因
使用Docker的形式运行,安装的时候控制台报如下错误:
Handler crashed with error register db Ping default
, open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory
已找到解决方法:
需提供zoneinfo.zip并在Dockerfile添加 COPY ./zoneinfo.zip /usr/local/go/lib/time/zoneinfo.zip
具体的报错信息如下:
2018-07-19 17:28:32:[ORM]2018/07/19 09:28:32 register db Ping `default`, open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory
2018-07-19 17:28:32:panic: register db Ping `default`, open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory
2018-07-19 17:28:32:goroutine 1 [running]:
2018-07-19 17:28:32:github.com/TruthHun/DocHub/models.RegisterDB()
2018-07-19 17:28:32: /Users/TruthHun/goworkspace/src/github.com/TruthHun/DocHub/models/Models.go:203 +0xb00
2018-07-19 17:28:32:github.com/TruthHun/DocHub/models.Init()
2018-07-19 17:28:32: /Users/TruthHun/goworkspace/src/github.com/TruthHun/DocHub/models/Models.go:119 +0x26
2018-07-19 17:28:32:main.init.0()
2018-07-19 17:28:32: /Users/TruthHun/goworkspace/src/github.com/TruthHun/DocHub/main.go:24 +0x180
2018-07-19 17:28:32:main.init()
2018-07-19 17:28:32: <autogenerated>:1 +0x6c
显示是zoneinfo处理的问题
参考下面的链接,我修改我的docker-compose
可以解决
version: '2'
services:
dochub:
build: .
volumes:
- /home/flyingstudio/wenku/conf:/www/dochub/conf
- /usr/share/zoneinfo:/usr/share/zoneinfo
ports:
- 8090:8090
restart: always
PS:在其他地方也看到了一些解决办法,您可以参考下:
pod error: panic: open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory
问题:
Error 1055: Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'wenku.i.Id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
介绍
我的mysql: Ver 14.14 Distrib 5.7.18
修复建议:
where %v group by d.Title, d.Id order by di.%v desc limit %v
if sql, err := LeftJoinSqlBuild(tables, on, map[string][]string{"i": []string{"Count"}}, 1, 100000000, nil, []string{"i.DsId", "d.Title"}, cond); err == nil {
3.models/Models.go 431行,添加, "i.Score", "i.TimeCreate", "i.Id"
if sql, err := LeftJoinSqlBuild(tables, on, fields, p, listRows, orderBy, []string{"i.DsId", "i.Score", "i.TimeCreate", "i.Id"}, cond); err == nil {
在调用BaseController中的ResponseJson()函数,为什么不会抛map空指针的panic?
一般,在继承了BaseController之后,然后在调用他的ResponseJson的时候,不是会抛:Handler crashed with error assignment to entry in nil map
希望能帮忙解答下
package controllers
import (
"github.com/astaxie/beego"
)
type T1Controller struct {
// BaseController
beego.Controller
T2Controller
}
type T2Controller struct {
beego.Controller
}
func (this *T2Controller) Test() {
data := map[string]interface{}{"status": "ok"}
this.Data["json"] = data
this.ServeJSON()
this.StopRun()
}
func (this *T1Controller) New() {
re := this.GetString("status")
if re == "test" {
this.Test()
}
this.Ctx.WriteString("Hello World!")
this.ServeJSON()
}
查看控制台输出,可能是413 Request Entity Too Large
所以如果使用Nginx反代,最好提前设置好文件上传大小限制
即在xx.conf文件添加
# 允许上传大小50M
client_max_body_size 52428800;
老大您好,我已经将站点成功部署在www.liveinfree.com上,先一切功能正常,下载文件报404错误。
部署方式:docker Ubuntu 16 版本:2.0
如何通过java连接pdf2svg,将pdf转成svg,作者可以写个demo吗
数据库在哪里
似乎作者教程正在做,希望部署教程添加Docker版本~
文档编辑函数中
//文档编辑
func (this *UserController) DocEdit() {
原分类-1操作应该放置在info的相关量重新赋值之前!相关代码如下:
// 原分类-1
models.Regulate(models.GetTableCategory(), "Cnt", -1, fmt.Sprintf("Id in(%v,%v,%v)", info.ChanelId, info.Cid, info.Pid))
doc.Title = params["Title"].(string)
doc.Keywords = ### params["Tags"].(string)
doc.Description = params["Intro"].(string)
info.Pid = params["Pid"].(int)
info.Cid = params["Cid"].(int)
info.ChanelId = params["Chanel"].(int)
info.Price = params["Price"].(int)
info.TimeUpdate = int(time.Now().Unix())
orm.NewOrm().Update(&doc, "Title", "Keywords", "Description")
orm.NewOrm().Update(&info, "Pid", "Cid", "ChanelId", "Price")
//新分类+1
models.Regulate(models.GetTableCategory(), "Cnt", 1, fmt.Sprintf("Id in(%v,%v,%v)", params["Chanel"], params["Cid"], params["Pid"]))
this.ResponseJson(true, "文档编辑成功")
在ubuntu18.04上部署的是2.0的linux压缩版,用户注册页面上填写完用户邮箱,点击获取邮箱验证码,顶部出现有个红色提示,但没有文字内容,也不能正常注册,后台又不能添加用户,根本就用不了啊~
您好安全问题在哪给您反馈
models/Models.go 317行
- orderBy = []string{"s.Page desc"}
+ orderBy = []string{"ds.Page desc"}
网站首页的文章列表查询中存在sql_mode=only_full_group_by的问题,建议将DocumentModel.go的第186行修改为fields := "d.Title,any_value(d.Id) Id,any_value(ds.Ext) Ext,any_value(ds.ExtCate) ExtCate",第190行修改为where %v group by d.Title order by any_value(di.%v) desc limit %v,即可无视sql_mode=only_full_group_by的问题
项目做得不错,为了让大家快速体验,我提供你一个演示环境吧。
联系我微信:zqg5258423
没有关闭链接,建议加上一句
defer resp.Body.Close()
否则在执行大量下载后会保持大量的established状态连接以及close wait连接,最后机子可能会失联
目前DocHub能否做到设置用户的文档管理权限。比如A用户只能预览所有文档,不能下载。
DocHub对应的后台管理演示地址更新了吗?若更新,求最新地址。
目前dockerfile有两个问题
直接下载release版本的二进制文件后运行
但是实际部署经常是本地重新编译的,因此建议修改dockerfile,增加build部分
另外一个问题是dockerfile的基础镜像truthhun/dochub像个黑盒子
能否也提供下相应的dockerfile,以便确定下这里做了什么便于修改和debug
貌似Docker环境的邮件发不出去?有没有Ubuntu的安装教程?
当用户上传一个文档后,会增加积分。但当用户删除自己上传的文档时,积分没有变动。所以,如果有人上传一个文档,又删除,上传又删除,如此反复,他的积分理论上就无上限了。
2018/09/28 07:16:52.293 [E] [Install.go:123] 初始化友链数据失败:Error 1146: Table 'dochub.hc_friend' doesn't exist
2018/09/28 07:16:52.301 [E] [ConfigModel.go:69] 查询全局配置失败,config表中全局配置信息为空
配合文档内容,可能有单独的其他文件的资源(比如程序源码、图片、视频等),也附带这些资源的上传和下载就更完备了。
再次感谢作者的开源项目。
想在内网环境使用DocHub如何解决存储问题?
models/UserModel.go 125行
用户信息导入的时候,注册时间未添加
添加TimeCreate字段的插入
var userinfo = UserInfo{Id: user.Id, Status: true, Coin: coin, TimeCreate: int(time.Now().Unix())}
同时这样更改之后,Docker默认时区不是**,进行Docker默认时区的更改
建议:在Dockerfile添加时区定义
# 时区设置
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
希望可以编辑上传采集MD文件,现在很多人写作都是用的markdown格式,版面和阅读体验都挺好的。
阅读界面现在要一直向下滚动,能否增加设置,可以设置成不用滚动,而是像书籍一样翻页的效果。
感谢开源这么用心的作品。
版本:doc2.1
在install阶段出现
dial tcp:address too many colons in address。
数据库外网地址:
腾讯云云数据库外网地址
安装好dochub2.0之后,进入https://ip:8090/admin之后输入账户:admin密码:admim验证码:芝麻开门之后显示用户名或者密码错误
搜索文库时,只按照文件名搜索嘛?
可否将标签和描述一起加进去搜索。
谢谢
您既然已经抽取了各类文件的全文文本,并且保存在了mysql的表hc_doc_text中,为什么不使用
elasticsearch 实现全文搜索的功能呢,他有着非常广泛的应用场景,参考google book,也是类似的
文库系统,但是全文搜索功能让人炫目。
最后,感谢您努力实现的作品,我们非常喜欢,虽然不是太复杂的系统,但适合我们的应用需求。
谢谢!
提示:bucket是否私有 false,400 bad request
但是查看minio的bucket,已经设置了read only了。
https://minio.dormanthink.cc:9001/dochub-public/%7B93629C71-4624-4587-91F7-2013836115A3%7D.png.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=L3QTRXXUFLX3NRQFXEZ9%2F20190504%2F%2Fs3%2Faws4_request&X-Amz-Date=20190504T134411Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=dd55fce63e7d59535fe1c37f67ec302d96ee52f787bd55667ccd7c4263162bb3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.