About Gbootcms
Gbootcms is a Go language port of PbootCMS 3.2.12. It preserves the original database structure (ay_ prefix), template syntax, URL routing rules, and admin UI (Layui), replacing the PHP backend with Go technology to achieve single-binary deployment, millisecond startup, and low memory footprint.
Core Advantages
- Single Binary Deployment — No PHP environment needed, compile and run directly, cross-platform support for Windows/Linux/macOS
- Zero CGO Dependency — Uses glebarez pure Go SQLite driver, no GCC required
- 100% Database Compatible — Table structure 1:1 with PbootCMS PHP version, bidirectional migration supported
- Dual Template Engine — Backend pongo2 (Django style) + Frontend custom TagParser ({gboot:xxx} tags + hot reload)
- Multi-language Support — Traditional Chinese, Simplified Chinese, English frontend templates with backend area management
Implemented Features
Admin Backend
- Admin login/logout (bcrypt + double MD5 backward compatibility + captcha + login lockout)
- Content management: articles/products CRUD, batch sorting, extended fields, ext_ custom fields
- Category management: tree structure, custom URLs, template selection
- Single page management, site info, company info
- Slides, friendly links, custom tags, inline link tags
- Content models, extended fields, custom forms (with Turnstile verification)
- Media library (image management), message management
- System configuration (70+ options), menu management, role permissions (RBAC)
- User management, database backup, system logs, area management
- Member management: member list/level/field/comment (with batch operations, Excel export)
Frontend Display
- Homepage (carousel, navigation, product showcase)
- List pages (pagination, ext_ filtering, subcategory navigation)
- Content detail pages (extended fields, breadcrumbs, prev/next, view count)
- Search page, tag page, message page, single page
- Template hot reload (fsnotify), .html static URL
- Member system: login/register/logout/profile/edit/password recovery
- Comment system: submit/list/my comments/delete
- Cloudflare Turnstile verification integration
Security
- XSS filtering (FilterUserInput, aligned with PbootCMS filter())
- SQL injection protection (identifier whitelist validation + GORM parameterized queries)
- CSRF token protection (32-byte crypto/rand)
- Session TTL mechanism (24h max lifetime + 2h idle timeout + periodic cleanup)
- Session Fixation protection (regenerate Session ID on login)
- RBAC fine-grained permission checks (menu filtering + URL-level interception)
- Password bcrypt encryption (with double MD5 backward compatibility + auto-upgrade on login)
- Secure random numbers (crypto/rand for captchas, filenames, ucode)
Tech Stack
| Layer | Choice | Description |
|---|
| Language | Go 1.25 | Single binary deployment, no CGO |
| Web Framework | Gin v1.12 | Routing, middleware, request handling |
| ORM | GORM v1.31 | AutoMigrate, ay_ prefix |
| Database | SQLite (glebarez pure Go) | No CGO/GCC required |
| Backend Template | Pongo2 v6.1 | Django style + PbootCMS syntax converter |
| Frontend Template | Custom TagParser | {gboot:xxx} tags + fsnotify hot reload |
| Admin UI | Layui 2.5.4 + jQuery 1.12.4 | Consistent with PbootCMS original |
| Config | Viper v1.21 | Environment variable prefix PBOOTCMS_GO_ |
| Logging | log/slog (stdlib) | Structured logging |
Quick Start
# Build (output to bin/)
go build -o bin/gbootcms.exe .
# Run
.in\gbootcms.exe
# Frontend: http://localhost:8080/
# Admin: http://localhost:8080/admin
# Default account: admin / 123456
License
This project is open-sourced under the Apache License 2.0. The original PbootCMS project is also licensed under Apache License 2.0. We thank them for their excellent design and broad user base.
Gbootcms — Preserving the soul of PbootCMS, embracing the speed of Go.