Implement AsciiDoc and TipTap conversion logic, including new Admonition node and CodeBlock extension; add DiffViewer and HistoryPanel components for document version comparison; introduce password hashing utility with SHA-256.

This commit is contained in:
2026-04-12 22:28:15 +02:00
parent 05b773c14c
commit 376b946e73
22 changed files with 2767 additions and 323 deletions

View File

@@ -57,6 +57,13 @@ func (d *DB) init() error {
return err
}
// HasUsers returns true if at least one user account exists.
func (d *DB) HasUsers() bool {
var n int
d.sql.QueryRow(`SELECT COUNT(*) FROM users`).Scan(&n)
return n > 0
}
// CreateUser inserts a new user. Returns ErrUserExists if the username is taken.
func (d *DB) CreateUser(username, passHash, role string) error {
_, err := d.sql.Exec(