Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

zikwall/blogchain-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

400 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build build build

Blog Chain

Simple, Powerful and Productive blogging server written in Go

Related Projects

Development

  • Native
go run ./cmd/api/main.go \
  --bind-address 0.0.0.0:3001 \ // if listener == 1
  --listener 1
  --bind-socket /tmp/blogchain.sock \ // if listener == 2
  --database-host @ \
  --database-user blogchain \
  --database-password 123456 \
  --database-name blogchain \
  --database-dialect mysql \
  --clickhouse-address localhost \
  --clickhouse-user default \
  --clickhouse-password ***** \
  --clickhouse-database database_name \
  --clickhouse-alt-hosts <optional hosts> \
  --container-secret secret
  • Docker
docker run -d --net=host \
   -e BIND_ADDRESS='0.0.0.0:3001' \
   -e BIND_SOCKET='/tmp/blogchain.sock' \
   -e LISTENER=1 \
   -e DATABASE_HOST='<database host: @>' \
   -e DATABASE_USER='<database username>' \
   -e DATABASE_PASSWORD='<database password>' \
   -e DATABASE_NAME='<database name>' \
   -e DATABASE_DIALECT='<database dialect: mysql>' \
   -e CLICKHOUSE_ADDRESS='' \
   -e CLICKHOUSE_USER='default' \
   -e CLICKHOUSE_PASSWORD='' \
   -e CLICKHOUSE_DATABASE='database_name' \
   -e CLICKHOUSE_ALT_HOSTS='optional hosts' \
   -e CDN_HOST='https://fileserver:1338' \
   -e CDN_USER='user' \
   -e CDN_PASSWORD='pass' \
   -e CONTAINER_SECRET='<application secret>' \
   --name golang-blogchain-server qwx1337/blogchain-server:latest

This option is good for ClickHouse cluster with multiple replicas.

  -e CLICKHOUSE_ALT_HOSTS='host2:1234,host3,host4:5678

In example above on every new connection driver will use following sequence of hosts if previous host is unavailable:

  • host1:9000;
  • host2:1234;
  • host3:9000;
  • host4:5678.

All queries within established connection will be sent to the same host.

Use Docker secrets

Template: /srv/bc_secret/<secret_name_with_underscore>

Examples:

  • CLICKHOUSE_ALT_HOSTS or --clickhouse-alt-hosts to /srv/bc_secret/clickhouse_alt_hosts
  • DATABASE_PASSWORD to /srv/bc_secret/database_password
  • etc

For a complete list of secrets, see the file main.go.

Tests

  • $ make tests
  • $ golangci-lint run --config ./.golangci.yml

About

A network of blog written in Go for blogchain clients. Available on: http://mediafanbox.online:3001/

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors