aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-07-01Add documentation and comprehensive test coverage for AccountManagerJeff Halter
- Add GoDoc comments to AccountManager interface and all YAMLAccountManager methods - Add complete table-driven test coverage for Create, Update, Get, and List methods - Tests follow project conventions with proper error handling and temporary directories - All tests pass with comprehensive verification of both memory state and file operations
2025-06-30Replace inappropriate panic calls with proper error handlingJeff Halter
- Convert panic in news article processing to return error instead - Replace panic in API stats endpoint with HTTP error response - Update ThreadedNewsMgr interface to return errors from ListArticles - Ensure server stability by handling errors gracefully
2025-06-30Improve error handling consistency in main.goJeff Halter
- Fix incorrect error message for banner loading - Convert all error logging to structured format - Remove server shutdown during config reload failures
2025-06-30Add type safety to field system with FieldType aliasJeff Halter
- Define FieldType as typed alias for [2]byte to improve type safety - Update all 47 field constants to use FieldType instead of raw [2]byte - Update Field struct to use FieldType for Type field - Update function signatures: NewField, GetField, Transaction.GetField - Fix field_test.go to use new FieldType in test cases - Maintains backward compatibility with zero runtime overhead - Enhances API clarity and prevents accidental field type misuse
2025-06-30Refactor access bitmap unmarshal logic to use map-driven approachJeff Halter
Replace 120+ lines of repetitive if statements with a compact map lookup. This improves maintainability by reducing code duplication and making it easier to add new access permissions.
2025-06-29Fix IPv6 address parsing in IP extractionJeff Halter
Replace string splitting with net.SplitHostPort to properly handle both IPv4 and IPv6 addresses. Fixes issue where IPv6 addresses like [::1]:8080 were incorrectly parsed as "[" instead of "::1".
2025-06-29Merge branch 'feature/extract-error-constants'Jeff Halter
2025-06-29Fix tests modifying test fixture files by using temporary directoriesJeff Halter
Previously, running tests would modify test/config/Users/guest.yaml and create test/config/Users/test-user.yaml due to the automatic migration logic in YAMLAccountManager. This caused git diff to show changes after running tests. Solution: - Modified TestNewYAMLAccountManager to use t.TempDir() for test isolation - Added copyTestFiles helper to copy test fixtures to temporary directory - Tests now run against copies, leaving original fixtures untouched This ensures tests are properly isolated and don't have side effects on the repository's test fixture files.
2025-06-29Extract hardcoded error strings into comprehensive public constantsJeff Halter
Replace 60+ hardcoded error strings throughout transaction handlers with public constants and templates for consistent error handling across the Hotline protocol implementation. Features: - 33 authorization error constants (ErrMsgNotAllowed*) - Account operation error constants (ErrMsgAccount*) - File operation error templates with filename parameters (ErrMsgCannot*) - Upload/download restriction templates (ErrMsgUpload*) - Ban message constants (ErrMsgTemporaryBan, ErrMsgPermanentBan) - General error constants (ErrMsgUserNotFound, ErrMsgCreateAlias) - Chat/messaging templates (ErrMsgDoesNotAcceptTemplate) Benefits: - Single source of truth for all error messages - Public API for other packages to import standard error constants - Sprintf-style templates for dynamic content (filenames, usernames) - Clear distinction between protocol errors (ErrMsg*) and golang errors - Improved maintainability and consistency across transaction handlers All error messages are now centralized, making future modifications easier and ensuring consistent user experience across all operations.
2025-06-28Update Homebrew workflow to also update URL fieldJeff Halter
2025-06-28Add automated Homebrew formula updates on releaseJeff Halter
2025-06-28Add comprehensive documentation to transaction handler functionsJeff Halter
- Document all transaction handler functions with detailed field specifications - Include request and reply field descriptions with required/optional indicators - Add field numbers and descriptions for easy protocol reference - Remove duplicate comments while preserving important context - Standardize documentation format across all handler functions
2025-06-26Refactor FormattedPath to use scanner interface and add comprehensive testsJeff Halter
- Replace manual byte slicing with bufio.Scanner for safer parsing - Add pathSegmentScanner implementing bufio.SplitFunc pattern - Add comprehensive table tests covering edge cases and special characters - Improve code safety with proper bounds checking - Follow established codebase patterns for binary data parsing
2025-06-26Replace filepath.Join with path.Join for Windows compatibilityJeff Halter
Replace all instances of filepath.Join with path.Join across the codebase to improve Windows compatibility following the guidance from https://github.com/golang/go/issues/44305. Key changes: - Replaced filepath.Join with path.Join in 14 files - Updated import statements appropriately - Resolved variable shadowing issues where function parameters named 'path' were conflicting with the path package - Maintained filepath imports where needed for OS-specific functions like filepath.Walk, filepath.IsAbs, filepath.Dir, and filepath.Base All tests pass, confirming the changes maintain functionality while improving cross-platform compatibility.
2025-06-25Fix critical bug in YAMLAccountManager Update methodJeff Halter
Move delete operation before modifying account.Login to prevent deleting wrong key from accounts map.
2025-06-25Refactor copyDir and findConfigPath functions in main.goJeff Halter
- Refactor copyDir: Add proper error handling, resource cleanup with defer, true recursion, better permissions (0755), and separation of concerns - Refactor configSearchPaths -> findConfigPath: Add directory validation, better naming, and clearer documentation - Add comprehensive test suite for all functions with 100% test coverage - Remove panic in copyDir, replace with proper error propagation - Fix resource leaks by using defer for file cleanup
2025-06-25Ignore .claudeJeff Halter
2025-06-19Ensure temporary upload files are closed before renameJeff Halter
This seems to be important on Windows! See #161
2025-05-22Update transaction_handlers.goTheo Knez
2025-05-22Update api.goTheo Knez
2025-05-22Update server.goTheo Knez
2025-05-22Update go.sumTheo Knez
2025-05-22Update go.modTheo Knez
2025-05-22Update main.goTheo Knez
2025-02-06Bump Golang version in DockerfileJeff Halter
2025-02-06Account for 16 vs 32 bit integers in folder uploadRuben Beltran del Rio
2024-11-24Bump Go and dependency versions to latestJeff Halter
2024-10-06Update README.mdJeff Halter
Fix documentation error
2024-10-06Fix tracker resultsJeff Halter
2024-08-07Update README.mdJeff Halter
Fix documentation of --api-addr flag
2024-08-04Delete cmd/mobius-hotline-server/mobius/config/Files/hello.txtJeff Halter
2024-08-04Create About This Area.txtJeff Halter
2024-07-31Migrate user account yaml files to new Access flag format if neededJeff Halter
2024-07-30Fix commentsJeff Halter
2024-07-28Fix tracker registration loggingJeff Halter
2024-07-28Improve human readability of account config filesJeff Halter
2024-07-27Fix missing version in Docker and Makefile buildJeff Halter
2024-07-27Add logging of tracker registrationJeff Halter
2024-07-26Make Bonjour optional and disabled by defaultJeff Halter
Bonjour doesn't seem happy inside Docker, so I'm making it optional and off by default.
2024-07-26Limit guest permissionsJeff Halter
Limit default guest permissions to: File System Maintenance * Can Download files * Can Download folders * Can Upload Files * Can Upload Folders Messaging * Can Send Messages News * Can Read Articles * Can Post Articles Chat * Can Initiate Private Chat * Can Read Chat * Can Send Chat Misc * Can Use Any Name
2024-07-26Register server address on local network with BonjourJeff Halter
2024-07-25Wrap file transfer errors with more contextJeff Halter
2024-07-23Add client connection rate limitJeff Halter
2024-07-23Fix panic on empty news pathJeff Halter
2024-07-22Update README.mdJeff Halter
Correct docker image path
2024-07-21Update README.mdJeff Halter
Remove references to the client, which has been split off to separate project repo
2024-07-21Clean up loggingJeff Halter
2024-07-19Add option for account-specific file rootJeff Halter
2024-07-19Appease linterJeff Halter
2024-07-19Fix failing test, replace use of reflect package with assertJeff Halter