logo
0
1
WeChat Login
chore: bootstrap typecho-go (M1 + M2 + M3)

typecho-go

Go re-implementation of Typecho, a lightweight blog platform.

Status

Pre-alpha. See PLAN.md for the milestone roadmap.

Requirements

  • Go 1.25+
  • PostgreSQL 12+

MySQL, MariaDB and SQLite are intentionally not supported. If your existing Typecho site runs on MySQL, migrate to PostgreSQL first (e.g. with pgloader) before pointing typecho-go at the database.

Quick start

cp config.example.yaml config.yaml
# edit config.yaml — at minimum set db.dsn and site.secret

make run
curl http://127.0.0.1:8080/healthz

Build

make build              # local binary -> bin/typecho
make release            # cross-compile linux/amd64, linux/arm64, windows/amd64, darwin/arm64

Test

Unit tests are pure-Go and run offline:

make test

Integration tests require a reachable PostgreSQL. Point the TYPECHO_TEST_DSN env var at one; tests are gated by the integration build tag:

export TYPECHO_TEST_DSN='postgres://tc:tc@localhost:5432/tc?sslmode=disable'
make test-integration

CI (CNB) starts a postgres:16-alpine service and exports the DSN automatically; see .cnb.yml.

HTTPS

HTTPS is opt-in. Set server.https.enabled: true and provide cert_file / key_file in config.yaml. HTTP-to-HTTPS redirection is a separate switch (server.https.redirect_http).

Differences from Typecho (PHP)

AspectTypecho (PHP)typecho-go
RuntimePHP 7.4+Single static Go binary
DatabaseMySQL / PostgreSQL / SQLitePostgreSQL only
Theme engineNative PHP includesGo html/template — PHP themes not compatible
Plugin systemPHP hook dispatchGo compile-time registration + runtime enable/disable — PHP plugins not compatible
URL structureConfigurable permalinksSame
DB schematypecho_* (7 tables)Same
Passwordsphpass ($P$...)phpass verification + bcrypt for new; transparent upgrade on first login
XML-RPCBuilt-inOpt-in via config.yaml

License

MIT. See LICENSE. Inspired by Typecho (GPL-2.0) — schema and URL layout reused for compatibility, no PHP source code included.