Commit Graph

19 Commits (9138dfe65011c402a40452ea4fab7eca457918fd)

Author SHA1 Message Date
Joca 9138dfe650
Remove CSRF, add password change, admin user management
Stripped all CSRF token generation, injection, and validation since it
breaks behind Apache reverse proxy. Removed handlers/csrf.go, stripped
CSRFToken from PageData, removed validateCSRFToken from all POST handlers,
and cleaned up hidden inputs and JS CSRF references.

Added self-service password change at /password/ with current-password
verification and bcrypt update. New Password link in navbar.

Extended admin panel with user management: lists all users with join dates
and allows admins to delete other users (self-deletion blocked). Added
GetAllUsers() and DeleteUser() to models.
2026-05-13 18:01:03 -03:00
Joca a5a2e7063a
Add admin-controlled signup toggle and hide signup links. 2026-04-19 14:03:24 -03:00
Joca 13b0821eef
make chat.html self contained 2026-02-23 20:28:48 -03:00
Joca d6fe1544e0
Forgot that pages don't use the inline html anymore. Fixed parsing of the base template 2026-02-23 20:24:48 -03:00
Joca 41b37758f9
refactooooor (check commit im not explaining this) 2026-02-20 14:40:06 -03:00
Joca 7fa8634bcb
simplify template parsing 2026-02-20 14:37:49 -03:00
Joca 582897903e
Preferences: Remove markdown preview preference after feature removal
- Remove markdown_preview_default field from UserPreferences model
- Remove markdown_preview_default column from user_preferences table schema
- Simplify preferences form to only show draft auto-save checkbox
- Update handler to only process auto_save_drafts preference
- Clean up unused form fields and validation logic

Only the draft auto-save preference remains.
2026-01-15 23:34:21 -03:00
Joca 309e516480
Preferences: Add user preferences system with database table and settings page
- Add user_preferences table to store per-user settings (auto_save_drafts, markdown_preview_default)
- Create UserPreferences model with GetUserPreferences, CreateDefaultPreferences, and UpdateUserPreferences functions
- Add PreferencesHandler for GET/POST requests to display and save user preferences
- Create preferences.html template with checkbox for draft auto-save and radio buttons for markdown preview default
- Add "Preferences" link to navbar for logged-in users
- Register /preferences/ route with login requirement

This establishes the foundation for advanced features like draft auto-save and markdown preview toggle, allowing users to customize their experience.
2026-01-15 23:21:03 -03:00
Joca ef06bf160a
All: Enhance session management and security features
Using proper auth + security on login.
2025-12-21 21:26:02 -03:00
Joca 3a82e2a0d1
All: Migrate boards from global to board specific
Massive commit. Rewrites some of the chat logic to work individually
rather than a global chat.
2025-08-22 00:07:13 -03:00
Joca 7b0528ef36
feat: Add file-based avatar system
- A new `files` table to store metadata about uploaded files, including original name and hash.
- The `users` table is updated to reference a `pfp_file_id` from the new `files` table, removing the insecure `pfp_url` field.
- A new `/file` endpoint and handler (`handlers/file.go`) are created to serve files securely based on their ID, preventing direct file system access.
- Profile editing (`handlers/profile_edit.go` and `templates/pages/profile_edit.html`) is updated to handle file uploads instead of URL inputs.
- The chat feature (`models/chat.go` and `templates/pages/chat.html`) is updated to work with the new file ID system, ensuring avatars are displayed correctly.
Should also fix #68.
2025-06-21 16:21:21 -03:00
Joca bdf81e7c68 Ask admin credentials on initialize instead of defining them on config.json 2025-06-15 02:48:43 +02:00
Joca c10535492b The initialize function now fails if any board already exists. 2025-06-15 02:48:43 +02:00
Joca 3b56c7e831 Initial implementation of the chat feature. 2025-06-15 02:47:16 +02:00
Joca e6f097d35c Add cli flag for initializing tables instead of creating them at startup 2025-06-15 02:44:03 +02:00
Joca b1c3f80afb Implemented features for creating and deleting boards and threads, removed thread types, enhanced CSS for boards and comments 2025-06-15 02:44:03 +02:00
Joca 4eb97f27d8 Create admin user, admin can edit news blotter 2025-06-15 02:41:36 +02:00
Joca de1f442082 Refactor signup and login handlers, add auto table creation 2025-06-15 02:40:40 +02:00
Joca eee9540bdc Initial Commit 2025-06-15 02:37:02 +02:00