English | 简体中文
A self-hosted, multi-user blogging platform you own end to end.
InkStone (砚石, "inkstone") packs an entire blog system into one deployable stack — Go + Gin + PostgreSQL on the backend, Next.js + React on the frontend, plus a complete admin dashboard. Write in Markdown or rich text and switch between the two at will, restyle the site, manage users and comments, and upgrade versions online — all without ever touching the code.
Personal column or multi-author publication, InkStone is built to be the blog you can still maintain five years from now: no plugin sprawl, no monthly fees, no surprises.
✍️ Two editors · 🛡️ Three CAPTCHA providers · 🔄 Version notifications (manual upgrades) · 🌏 Bilingual docs
Beta1.29 · MIT License · github.com/shenwei322/inkstone
Language note: the visitor site, the admin dashboard, and the
docs/+.ai-skill/documentation currently ship with Simplified Chinese copy only — the project is Chinese-first by design. Application-level i18n (including an English UI) is not implemented yet; this README is bilingual, the product itself is not.
- Two editors, one article: a Markdown editor and a Tiptap rich-text editor — switch between them mid-draft without losing formatting
- Articles & pages: draft/published workflow, categories and tags, standalone pages (about, custom landing pages)
- Media management: images and files stored with tracked references, managed from a single admin screen
- Comments & engagement: comments with nested replies, likes and favorites, all manageable from the dashboard
- Automatic table of contents, syntax highlighting, back-to-top, and one-click sharing
- Dark/light theme toggle, custom wallpaper, custom site icon, and configurable sidebar widgets (including sanitized custom HTML)
- GSAP-powered page transitions and entrance animations; fully responsive on mobile
- Multi-user system: registration, login, and a personal center;
admin/userroles with RBAC enforced in middleware; optional email verification codes for registration and login - Dual-token JWT: 15-minute access token, 7-day refresh token; changing a password, banning a user, or changing a role increments
TokenVersion, invalidating all previously issued tokens immediately - Human verification with three interchangeable providers (switchable in the dashboard):
lap(default): first-party proxy to Cap's Cloudflare Workers deployment — the browser never contactsworkers.devdirectly, with DNS-pinned-IP and TUN-proxy fallbackspow: a self-contained proof-of-work v2 scheme that spends the visitor's local CPU (memory-hard table, multi-round hashing, real-interaction signals) — works even when the server has no outbound internet access and cannot use a proxygeetest: Geetest v4 behavioral verification
- Rate limiting on login/registration, CORS allowlist, and a trusted-reverse-proxy setting that prevents spoofed
X-Forwarded-Forheaders from bypassing rate limits - Defense in depth: article HTML sanitized through a bluemonday allowlist, sidebar custom HTML sanitized on write, and SSRF-guarded link health checks
- Update checks only — the dashboard never updates itself: it compares against upstream and shows the manual upgrade commands when a newer version exists. Nothing is downloaded, swapped, or restarted from the web UI (
UPDATE_MANUAL_ONLY=true, the default) - Two check sources:
commits(compare commits) andreleases(GitHub Releases — version tags, release notes, and image-package assets) - Upgrades stay manual:
git pull+ rebuild, ordocker loadthe image package +docker compose up -d— no source tree or rebuild needed on the image route, fully offline-capable - The legacy one-click pipeline (download → SHA256 verify → atomic swap → rebuild via a host-side update agent) still lives in the codebase behind
UPDATE_MANUAL_ONLY=false, but its UI entry points are gone - Audit logs, traffic analytics, maintenance mode, sitemap / robots.txt / RSS (
sitemap.xml,feed.xml)
A built-in /admin dashboard covers: overview, articles (recycle bin included), pages, categories and tags, comments, friend links, files, users, appearance, security, IP access control, site logs, sitemap, and system maintenance (version checks and data backups). The sidebar groups navigation into Content / Site / Security / System, and related screens live behind tabs on a single page.
| Layer | Stack |
|---|---|
| Backend | Go 1.27 · Gin 1.12 · GORM 1.31 · PostgreSQL 16 (schema via AutoMigrate) |
| Auth | golang-jwt v5 dual tokens + TokenVersion generation-based revocation |
| Frontend | Next.js 16.3 (App Router) · React 19.2 · TypeScript 5 · Tailwind CSS v4 |
| Editors | Tiptap 3 (rich text) · marked + bluemonday (Markdown rendering and sanitizing) · highlight.js |
| Data & motion | TanStack Query 5 · GSAP 3.15 · Recharts 3 · lucide-react |
| Deployment | Docker Compose (dev / offline / prod) · Nginx · host-side update agent |
git clone https://github.com/shenwei322/inkstone.git
cd inkstone
# 1. Start the database (PostgreSQL 16)
docker compose -f docker-compose.dev.yml up -d
# 2. Backend (defaults to :8080, API prefix /api/v1)
cd backend && go run ./cmd/server
# 3. Frontend visitor site (defaults to :3000)
cd frontend && npm install && npm run devA few notes:
- For Go module downloads in mainland China, set
GOPROXY=https://goproxy.cn,direct - On Windows you must build with
-tags timetzdata, otherwiseTimeZone=Asia/Shanghaiin the DSN fails withunknown time zoneand the backend will not start NEXT_PUBLIC_API_URLon the frontend is injected at build time — rebuild after changing it- If the backend exits with
failed to connect database, the PostgreSQL container is usually not running
Verification checklist after code changes:
# Backend
cd backend && gofmt -w . && go vet ./... && go build -tags timetzdata -o server.exe ./cmd/server
# Frontend
cd frontend && npm run build && npx eslint app components lib --ext .ts,.tsxCopy .env.example to .env and fill in your domain, database password, and JWT_SECRET, then pick one of the following:
Option 1: Build from source (server with the source tree)
docker compose --env-file .env -f docker-compose.prod.yml up -d --buildOption 2: Offline image package (recommended, no build required)
scp dist/inkstone-images-<version>.tar root@<server-ip>:/opt/
ssh root@<server-ip> "docker load -i /opt/inkstone-images-<version>.tar \
&& cd /opt/inkstone-deploy && docker compose -f docker-compose.offline.yml up -d"Image packages are produced by deploy/package-images.sh (Linux/macOS) or deploy/package-images.ps1 (Windows), which also emit a .sha256 checksum file.
Option 3: Version notifications from the dashboard
Set UPDATE_ENABLED=true and the "System Update" page reports when a newer upstream version exists, together with the manual upgrade commands. It never updates anything by itself — apply upgrades with Option 1 or 2.
# Turn on version checks (without it, the page cannot even compare versions)
UPDATE_ENABLED=true
# Restoring one-click updates is a feature rollback: also set UPDATE_MANUAL_ONLY=false
# and put the removed dashboard entry points backFor production you must also keep deploy/nginx/inkstone.conf in sync — the three exact-match locations for sitemap.xml, robots.txt, and feed.xml are required, or those SEO endpoints return 404.
backend/ Go backend
cmd/server/main.go Entry point: dependency wiring + route registration
internal/handler/ HTTP layer (binding, responses, error mapping)
internal/service/ Business logic (update_*.go implements online updates)
internal/repository/ GORM data access
internal/middleware/ Auth / CORS / rate limiting / security headers / traffic stats
internal/model/ Data models
pkg/config·mailer/ Configuration and SMTP
frontend/ Next.js visitor site + built-in dashboard
app/ Route pages; app/admin/ is the dashboard
components/ Reusable components (editors, captcha, motion wrappers, …)
lib/api.ts The single API client entry point
deploy/ Deployment assets
nginx/inkstone.conf Production Nginx config
update-agent.sh/.ps1 Host-side update agent
package-images.sh/.ps1 Image-package build scripts
scripts/rebuild.sh/.ps1 Rebuild script for native deployments
docs/ PoW captcha interception and optimization reports
scripts/dev-start.ps1 One-command local startup
.ai-skill/ Project knowledge base (developer docs for AI assistants, in Chinese)
Developer and AI-assistant documentation lives in .ai-skill/ (written in Simplified Chinese): key facts and development rules (SKILL.md), the complete API reference, data models, settings, frontend components, and deployment troubleshooting. Please update the relevant document alongside code changes.
- Repository: https://github.com/shenwei322/inkstone
- Commit messages must be written in Simplified Chinese (project convention)
MIT © 2026 shenwei (shenwei322)