| Age | Commit message (Collapse) | Author |
|
- 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
|
|
- 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
|
|
- Fix incorrect error message for banner loading
- Convert all error logging to structured format
- Remove server shutdown during config reload failures
|
|
- 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
|
|
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.
|
|
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".
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
- 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
|
|
- 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
|
|
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.
|
|
Move delete operation before modifying account.Login to prevent deleting wrong key from accounts map.
|
|
- 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
|
|
|
|
This seems to be important on Windows! See #161
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix documentation error
|
|
|
|
Fix documentation of --api-addr flag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bonjour doesn't seem happy inside Docker, so I'm making it optional and off by default.
|
|
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
|
|
|
|
|
|
|
|
|
|
Correct docker image path
|
|
Remove references to the client, which has been split off to separate project repo
|
|
|
|
|
|
|
|
|