Open source free Golang blog source code

888u

Last update at :2024-06-01,Edit by888u

EiBlog is a simple, light and secure blogging system. It is easy to use (complex to build) and is not recommended for friends without computer knowledge to build.

GitHub: https://github.com/eiblog/eiblog

demo: https://deepzz.com/

For detailed introduction, please view GitHub and the author's blog. It is worth mentioning that the blog is very fast and is worth installing and trying.

Quick experience

Taking mongodb as an example, more supported backend storage services are as follows:

Type (driver) Address (source) example
mongodb mongodb://localhost:27017
mysql user:password@tcp(localhost:3306)/eiblog?charset=utf8mb4&parseTime=True&loc=Local
postgres host=localhost port=5432 user=user password=password dbname=eiblog sslmode=disable
sqlite /path/eiblog.db
sqlserver sqlserver://user:password@localhost:9930?database=eiblog
clickhouse tcp://localhost:9000?database=eiblog&username=user&password=password&read_timeout=10&write_timeout=20

1. Start dependent services, mongodb, elasticsearch:

$ docker run --name mongodb \
    -p 27017:27017 \
    -v ${PWD}/mgodb:/data/db \
    mongo:3.2

$ docker run --name elasticsearch \
    -p 9200:9200 \
    -v ${PWD}/esdata:/usr/share/elasticsearch/data \
    deepzz0/elasticsearch:2.4.1

2. Download the compressed package, go here to download the eiblog (non-backup) corresponding system compressed package, and then decompress it.

3. Modify the configuration and change the database and ES addresses to the corresponding addresses:

# Modify conf/app.yml database connection configuration
database:
  driver: mongodb
  source: mongodb://localhost:27017

# Modify conf/app.yml ES connection configuration. If you do not enable the search function, you can leave it blank.
eshost: http://localhost:9200

4. Start the service:

./backend

Then visit localhost:9000, the backend address is localhost:9000/admin/login, and the default account password is deepzz/deepzz.

Features

In line with the nature of blogging to share knowledge, EiBlog will not have strong customization functions (including themes, CDN support, etc.), and will only maintain commonly used simple pages and functions:

Home page, topics, archives, friend links, about, search

Function description

Blog archiving uses the timeline to help us summarize blog posts. If the content is less than one year old, it will be archived by month, and if it is older, it will be archived by year.
Blog topics, sometimes the blog posts are in the same series. Topics can help us summarize the blog posts well and are very friendly to readers.
With the tag system, each blog post can be tagged with different tags, making it possible to customize the archive if the archive and topic are not satisfied. This auxiliary search is simply perfect.
The search system relies on ElasticSearch to realize on-site search, which has both speed and efficiency. Coupled with Google Opensearch, the search is only smooth.
The management backend, embedded with the full-featured Typecho backend system, and the full-featured Markdown editor make you feel simple and refreshing.
Google statistics, due to the speed problem of Google API, the back-end API asynchronous statistics is implemented, making the blog page load quickly.
Disqus comment, the comment system in mainland China is not friendly, so I chose disqus, and due to well-known reasons, it cannot be used in mainland China, so I implemented an alternative disqus comment method.
Multiple storage backends, supporting mongodb, mysql, postgres, sqlite and other storage backends.
Qiniu CDN supports uploading attachments directly in the Markdown editor, allowing you to only consider editing content and free your mind.
Automatic backup supports the backup function of multiple storage backends, and the backup data is saved to Qiniu CDN.

Of course, in order to make the entire system load faster, more optimization measures have been taken:

The number of article comments (not important) is obtained by running a scheduled task on the backend, so sometimes the number of comments is incorrect, which reduces API calls.
All content of the entire site is cached in memory, and all mardown documents are converted to html for caching, which reduces the conversion process.
Static files such as .js and .css are stored locally in the browser, and base64 of small images is built into css. Second access will not cause delays caused by the network, speeding up access. Update via version control.
For best practice nginx configuration, you can view eiblog.conf, enable compression to reduce the transmission volume, server transmit certificate chain, enable Session Resumption, Session Ticket, OCSP Stapling, etc. to accelerate the certificate handshake and increase the speed again.

Open source free Golang blog source code--EiBlog 1

Recommended site search: registration-free CDN, expired domain name query, Wanwang space price, ICP registration center, buy server high defense, free foreign space, foreign trade space, agent IP address, in domain name, overseas virtual host space, < /p>

Open source free Golang blog source code

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码