Git Product home page Git Product logo

fesiong / goblog Goto Github PK

View Code? Open in Web Editor NEW
450.0 11.0 107.0 50.43 MB

安企内容管理系统(AnqiCMS)(原GoBlog),是一款使用 GoLang 开发的企业站内容管理系统,它部署简单,软件安全,界面优雅,小巧,执行速度飞快,使用 AnqiCMS 搭建的网站可以防止众多安全问题发生。AnqiCMS 的设计对SEO友好,并且内置了大量企业站常用功能,对网站优化有很好的帮助提升,对企业管理网站一定程度上提高了办事效率,提高企业的竞争力。

Home Page: https://www.anqicms.com/

License: Other

Go 88.72% JavaScript 0.09% HTML 3.12% Shell 0.11% Makefile 0.08% Batchfile 0.04% XSLT 0.52% PHP 5.76% CSS 1.57%
goblog iris go blog website seo seo-friendly anqicms

goblog's People

Contributors

aschenmaker avatar fesiong avatar firma 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

goblog's Issues

博客无法评论

我是在这个网站https://www.kandaoni.com/news/7733.html 来到这里的,我不知道网站站长是不是就是这个博客的开发者?目前https://www.kandaoni.com/news/7733.html 无法评论,一评论就报错

image

另外我对这篇文章中的download方法有疑问(新手),download方法都是在goroutine中运行的go d.Download(resource, p),那么该方法中return的err真的有用吗?我感觉没用吧,需要通过channel传出来才行吧?

package main
import (
    "fmt"
    "github.com/vbauerster/mpb/v5"
    "github.com/vbauerster/mpb/v5/decor"
    "io"
    "net/http"
    "os"
    "runtime"
    "strconv"
    "sync"
)
type Resource struct {
    Filename string
    Url      string
}
type Downloader struct {
    wg         *sync.WaitGroup
    pool       chan *Resource
    Concurrent int
    HttpClient http.Client
    TargetDir  string
    Resources  []Resource
}
func NewDownloader(targetDir string) *Downloader {
    concurrent := runtime.NumCPU()
    return &Downloader{
        wg:         &sync.WaitGroup{},
        TargetDir:  targetDir,
        Concurrent: concurrent,
    }
}
func (d *Downloader) AppendResource(filename, url string) {
    d.Resources = append(d.Resources, Resource{
        Filename: filename,
        Url:      url,
    })
}
func (d *Downloader) Download(resource Resource, progress *mpb.Progress) error {
    defer d.wg.Done()
    d.pool <- &resource
    finalPath := d.TargetDir + "/" + resource.Filename
    // 创建临时文件
    target, err := os.Create(finalPath + ".tmp")
    if err != nil {
        return err
    }
    // 开始下载
    req, err := http.NewRequest(http.MethodGet, resource.Url, nil)
    if err != nil {
        return err
    }
    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        target.Close()
        return err
    }
    defer resp.Body.Close()
    fileSize, _ := strconv.Atoi(resp.Header.Get("Content-Length"))
    // 创建一个进度条
    bar := progress.AddBar(
        int64(fileSize),
        // 进度条前的修饰
        mpb.PrependDecorators(
            decor.CountersKibiByte("% .2f / % .2f"), // 已下载数量
            decor.Percentage(decor.WCSyncSpace),     // 进度百分比
        ),
        // 进度条后的修饰
        mpb.AppendDecorators(
            decor.EwmaETA(decor.ET_STYLE_GO, 90),
            decor.Name(" ] "),
            decor.EwmaSpeed(decor.UnitKiB, "% .2f", 60),
        ),
    )
    reader := bar.ProxyReader(resp.Body)
    defer reader.Close()
    // 将下载的文件流拷贝到临时文件
    if _, err := io.Copy(target, reader); err != nil {
        target.Close()
        return err
    }
    // 关闭临时并修改临时文件为最终文件
    target.Close()
    if err := os.Rename(finalPath+".tmp", finalPath); err != nil {
        return err
    }
    <-d.pool
    return nil
}
func (d *Downloader) Start() error {
    d.pool = make(chan *Resource, d.Concurrent)
    fmt.Println("开始下载,当前并发:", d.Concurrent)
    p := mpb.New(mpb.WithWaitGroup(d.wg))
    for _, resource := range d.Resources {
        d.wg.Add(1)
        go d.Download(resource, p)
    }
    p.Wait()
    d.wg.Wait()
    return nil
}

高老师,加油!

要是有会员系统更好了,可以认证会员资质、充值、购买商品、优惠卷、关注粉丝,积分、获赞、评论、收藏等会员功能,辛苦了。

MAC M1 编译不过

% go build -o anqicms main/main.go

command-line-arguments

/opt/homebrew/Cellar/go/1.21.3/libexec/pkg/tool/darwin_arm64/link: running cc failed: exit status 1
ld: unknown file type in '/private/var/folders/79/_92pblyn2hqg13wk1_n02xpw0000gn/T/go-link-1685129928/000000.o'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我用預設的帳號與密碼無法登入

目前有建立預設的帳號與密碼,但是無法登入
帳號:admin
密碼:123456

資料庫內的的密碼 :
$2a$04$oHBNr3IxvjMaJ9kX45QhZuIfMZuEnodZOIdyj35WCCh/L8QFX7zzW

你好,请教怎么在列表调用内容?

目前提供的item的for字段里没有content字段,只是{{item.Description}},我想直接调用{{item.Content}},应该怎么写?

后台模型管理里关了产品模型,但是添加栏目那里还会显示

盒子添加文章测试,程序崩溃

载入sego词典 /opt/1panel/apps/openresty/openresty/www/sites/web/dictionary.txt
2024/04/26 12:57:37 sego词典载入完毕
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x180 pc=0x1092728]

goroutine 132 [running]:
github.com/golang/freetype/truetype.(*Font).Index(0x0?, 0x1?)
github.com/golang/[email protected]/truetype/truetype.go:394 +0x8
kandaoni.com/anqicms/provider.(*TitleImage).getLettersLen(0xc000f3cb40, {0xc000e59d10, 0x1, 0x0?}, 0x20)
kandaoni.com/anqicms/provider/titleImage.go:274 +0x47
kandaoni.com/anqicms/provider.(*TitleImage).drawTitle(0xc000f3cb40, {0x1ea2490, 0xc0014bcd40?}, {0xc00161a3c0, 0x2e})
kandaoni.com/anqicms/provider/titleImage.go:234 +0x445
kandaoni.com/anqicms/provider.(*TitleImage).DrawTitles(0xc000f3cb40, {0xc00161a3c0, 0x2e}, {0xc000d4e6c0, 0x218})
kandaoni.com/anqicms/provider/titleImage.go:67 +0x7e
kandaoni.com/anqicms/provider.(*Website).SaveArchive.func5()
kandaoni.com/anqicms/provider/archive.go:726 +0x78
created by kandaoni.com/anqicms/provider.(*Website).SaveArchive in goroutine 121
kandaoni.com/anqicms/provider/archive.go:725 +0x276b

根据分类添加文章,点击首页导航分类显示404

这个问题在最后一次提交之前也是存在的,
找了一下bug,主要是因为那个rewrite的动态路由造成的
因为后台在添加导航时,挂在分类下,那个link为空白,前端自动添加了link,格式为:类似(http://localhost:8001/c/1)这样的路由
然后这个路由被rewrite获取到,被当成了伪静态的路由进行处理,但是伪静态的地址是加了.html的后缀,
但是出现了服务重启也能打开,再次重启又404的奇怪现象.
我看那个blog版本下添加导航挂载分类下直接分配了link的,格式是category/id,在路由中也有category/{id}的路由,
还有一处bug,controller/category.go 文件中func CategoryArticlePage(ctx iris.Context) {}方法中categoryId 一直为0
,if categoryVal == nil { categoryId = 0 } else { category, _ = categoryVal.(*model.Category) //应该在此处添加一下下面的代码 categoryId = category.Id }

写错了

运行时报错,包正常引入

github.com/chai2010/webp

..\vendor\github.com\chai2010\webp\webp.go:22:9: undefined: webpGetInfo
..\vendor\github.com\chai2010\webp\webp.go:26:20: undefined: webpDecodeGray
..\vendor\github.com\chai2010\webp\webp.go:39:20: undefined: webpDecodeRGB
..\vendor\github.com\chai2010\webp\webp.go:52:20: undefined: webpDecodeRGBA
..\vendor\github.com\chai2010\webp\webp.go:68:14: undefined: webpDecodeGrayToSize
..\vendor\github.com\chai2010\webp\webp.go:82:14: undefined: webpDecodeRGBToSize
..\vendor\github.com\chai2010\webp\webp.go:96:14: undefined: webpDecodeRGBAToSize
..\vendor\github.com\chai2010\webp\webp.go:109:7: undefined: toGrayImage
..\vendor\github.com\chai2010\webp\webp.go:110:14: undefined: webpEncodeGray
..\vendor\github.com\chai2010\webp\webp.go:119:14: undefined: webpEncodeRGB
..\vendor\github.com\chai2010\webp\webp.go:119:14: too many errors (exit status 1)

大佬 可以加入博客加密功能吗

1

image

在发布博客的时候可以设置密码 其他人需要查看则需要输入正确的密码才能阅读

有时候自己的有些博客比较隐私所有就不方便所有人阅读 只有输入正确密码的人才能阅读

如何访问前台代码?

我编译了后台代码,运行enterprise分支,如何访问前台?我访问的地址会跳到后台登陆界面;已完成初始化

linux 下编译报错,

不错的项目,下载下来在centos环境下编译 go build -o anqicms main/main.go 报错,不知道什么原因

/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/tmp/go-link-1136416180/000000.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

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.