Commit Graph

1221 Commits (f4bc5c925cdfc0f9dc96062558eb866e635df6b4)

Author SHA1 Message Date
Joca f4bc5c925c
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.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
2026-05-09 20:02:41 -03:00
Joca a5a2e7063a
Add admin-controlled signup toggle and hide signup links. 2026-04-19 14:03:24 -03:00
Joca 8ff0b7f2c2
Harden profile image uploads. 2026-03-06 14:58:53 -03:00
Joca 7a5b0f8ca5
Add CSRF checks to chat. 2026-03-06 14:53:40 -03:00
Joca f3749b3812
Add CSRF checks to likes. 2026-03-06 14:53:23 -03:00
Joca ca5ad07f26
Add CSRF checks to news. 2026-03-06 14:53:20 -03:00
Joca 47ebf77f24
Add CSRF checks to profile editing. 2026-03-06 14:53:17 -03:00
Joca 730b05dd58
Add CSRF checks to preferences. 2026-03-06 14:53:14 -03:00
Joca 82a7e48827
Add CSRF checks to boards and threads. 2026-03-06 14:51:54 -03:00
Joca 48363ccef9
Add CSRF checks to signup. 2026-03-06 14:51:14 -03:00
Joca ff4e05fd0b
Add CSRF checks to login. 2026-03-06 14:50:50 -03:00
Joca 91c7591c19
modify the classic board page heavily 2026-02-26 21:33:34 -03:00
Joca 95c2fc7c0d
Fix css box 2026-02-23 21:21:23 -03:00
Joca 6e6eba2ca1
Fix accept cookie button and reestyle the reply button 2026-02-23 20:38:03 -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 1c88b1f138
update sample json 2026-02-20 14:47:24 -03:00
Joca fb346aba49
update readme 2026-02-20 14:44:30 -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 2c7634da43
split stuff so i can read better 2026-02-20 13:37:46 -03:00
Joca 56416b78ec
refactor the preferences page 2026-02-20 13:26:58 -03:00
Joca 5553a8af01
move inline css and js into proper files 2026-02-20 13:16:31 -03:00
Joca 78a2875958
Fix errors on js and add grouped messages 2026-01-20 23:33:46 -03:00
Joca 9749457e2f
Remove scroll-to-top button
Removed the floating scroll-to-top button that appeared in the bottom-right
corner of pages after scrolling down.

Changes:
- Removed .scroll-to-top CSS styles from static/style.css
- Removed initScrollToTop() function from static/app.js
- Removed function call from initialization
- Cleaned up dark mode styles for scroll-to-top

The scroll-to-top functionality is still available via keyboard (Home key)
and browser default behavior.
2026-01-18 21:35:04 -03:00
Joca 39b1ea10f4
Remove binary and add it to .gitignore 2026-01-15 23:36:54 -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 9c959f6412
Revert "Chat: Add markdown preview toggle with client-side rendering and user preference"
This reverts commit ffe9f30c0a.
2026-01-15 23:33:03 -03:00
Joca ffe9f30c0a
Chat: Add markdown preview toggle with client-side rendering and user preference
- Add renderMarkdownPreview() function to app.js matching server-side Go implementation
- Support headers (#, ##, ###), bold (**text**), italic (*text*), code (`code`), code blocks (```lang), lists (* item), and @mentions
- Add Edit/Preview tab UI above chat textarea with active tab highlighting
- Preview updates in real-time with 300ms debounce while typing
- Respect user's markdown_preview_default preference from settings (edit or preview)
- Pass user preferences to chat template via ChatHandler
- Add markdown tab and preview container styles matching beige/blue/pink theme
- Preview shows formatted HTML identical to actual chat messages
- Support dark mode with appropriate color adjustments for tabs and preview
- Tabs use cyan accent for active state, orange for inactive hover

User can switch between editing markdown and seeing live preview of formatted output.
2026-01-15 23:26:37 -03:00
Joca e76049a353
Chat: Add draft auto-save to localStorage with restore and discard options
- Add draft management functions to app.js (saveDraft, loadDraft, clearDraft, getDraftTimestamp)
- Implement draft auto-save in chat that saves every 2 seconds after typing stops
- Show draft restoration banner on page load if draft exists and is less than 7 days old
- Display draft age with "X minutes/hours/days ago" format
- Add Restore and Discard buttons to draft indicator
- Clear draft automatically after successfully sending a message
- Add draft indicator styles matching beige/blue/pink theme with cyan restore button
- Support dark mode with appropriate color adjustments
- Draft indicator slides in from top with smooth animation

Draft key format: draft_chat_{boardId} for per-board draft storage.
2026-01-15 23:23:12 -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 83113a563a
Chat: Fix message duplication by removing optimistic UI for sent messages
- Remove optimistic message rendering that was causing duplicates
- Messages now only appear after server broadcast confirmation
- Simplify appendMessage() to check for existing message IDs and prevent duplicates
- Remove message delivery status indicators (sending/sent/failed)
- Add user alert when attempting to send while disconnected

This fixes the issue where messages appeared twice - once as an optimistic
temporary message and again when the server broadcast was received.
2026-01-15 23:05:00 -03:00
Joca 935446280f
Chat: Add real-time connection status, typing indicators, smart scrolling, and message delivery status
Features added:
- Connection status indicator (green=connected, yellow=connecting, red=disconnected)
- Exponential backoff reconnection (1s → 2s → 4s → ... → 30s max)
- Typing indicators showing who is typing (up to 3 users, with overflow count)
- Message status (⋯ sending, ✓ sent, ✗ failed with retry option)
- Jump-to-bottom button with unread message count badge
- Smart scroll preservation (stays in place unless already at bottom)
- Optimistic UI for sent messages (appears immediately, updates with real status)
- Backend support for broadcasting typing events to other users
2026-01-15 23:00:31 -03:00
Joca d36d0d46fd
UI: Add breadcrumb navigation to chat page
- Breadcrumb bar above chat header (Home › Boards › Chat Name)
- Styled to match chat container with themed colors
- Includes dark mode support
2026-01-15 22:50:58 -03:00
Joca f7b8055062
UI: Add navigation improvements with breadcrumbs, back buttons, scroll-to-top, and keyboard shortcuts
- Breadcrumb navigation on board and thread pages (Home › Boards › Board › Thread)
- Back buttons to return to parent page (with arrow icon and hover effects)
- Scroll-to-top button appears after scrolling 300px (smooth animation)
- Keyboard shortcuts: Ctrl+Enter submits forms from textarea, Esc clears focus and closes notifications
- Optimistic UI for like/dislike buttons (immediate visual feedback with checkmark)
- Updated thread handler to pass board data for breadcrumb context
2026-01-15 22:49:54 -03:00
Joca 00185e6774
UI: Fix word wrapping for long text content
- Add word-wrap and overflow-wrap to all content areas
- Prevents horizontal overflow on long words/URLs
- Fixes layout breaking with continuous text (e.g., 'owohhh...')
- Applied to post content, chat messages, lists, and paragraphs
2026-01-15 22:44:49 -03:00
Joca 69a62f0ad5
Handlers: Add password confirmation validation to signup
- Server-side validation for password confirmation field
- Display error message if passwords don't match
- Complements client-side validation added in previous commit
2026-01-15 22:39:58 -03:00
Joca ca4268dfec
UI: Add Phase 1 QOL improvements
- Add loading spinners and disabled states for form submissions
- Implement client-side form validation with inline error messages
- Add Enter-to-submit functionality for single-line forms
- Implement relative timestamps (e.g., '2 hours ago')
- Add character counters for textareas
- Auto-resize textareas as users type
- Add toast notifications for success/error messages
- Improve form accessibility with autocomplete and max lengths
- Add password confirmation field to signup form
- Better error styling throughout the application
2026-01-15 22:39:30 -03:00
Joca b11b4fd0a6
Quick .gitignore update so this shit does not bother me anymore 2026-01-15 22:34:58 -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 876ac33d1b
using bcrypt 2025-12-07 21:30:23 -03:00
Joca 7b934e00a6
Chat: Add Markdown support
Using RegEx because It's easier.
We will change to another solution if this proves to be a problem.
2025-09-05 22:09:17 -03:00
Joca 30f7cc7b82
Misc: Add DOCUMENTATION.md
Provides a complete overview of the project in a technical level. Should
be useful.
2025-09-04 19:01:21 -03:00
Joca adac250d86
Threads: Fix css of threads 2025-08-29 22:41:05 -03:00
Joca e18d7ba193
Chat: Highlight a message if the current user is mentioned 2025-08-29 14:48:38 -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 5370611265
Board: Fix mismatch between schema and query 2025-08-21 23:42:03 -03:00
Joca b1db26af16
Chat: Highlight user mentions even after page reload 2025-08-09 21:05:01 -03:00
Joca d3db9723ec
chat: polish mention system
We now have a proper autocomplete. Next on the list is moving the chat page into it's proper place and add pop-ups for profiles.
2025-08-03 19:21:06 -03:00
Joca d2d64d69fc
handlers/app.go: Removed Strict IP and User-Agent Session Validation
So, turns out validating stuff with these parameters is not a good idea at all. FML honestly.
2025-06-29 21:24:28 -03:00