| Age | Commit message (Collapse) | Author |
|
|
|
Repurpose the previously unused 2-byte field in the tracker protocol to advertise the server's TLS port. This allows clients to discover which servers support TLS connections.
Note: currently only the official, original, 1990's Tracker software sends this server provided 2-byte field to tracker clients. I'm adding this to Mobius in the hope that the modern day trackers might update their behavior to match the original software, which would put these unused 2 bytes to a useful purpose.
|
|
The tracker protocol splits large server lists into batches, with each
batch preceded by a ServerInfoHeader. Previously, GetListing only read
the initial header and failed when encountering subsequent headers
mid-stream, causing the scanner to misinterpret header bytes as server
record data.
Changes:
- Refactored GetListing to use bufio.Reader instead of bufio.Scanner
to handle heterogeneous data (headers and server records)
- Added readServerRecord helper function for sequential reading
- Renamed ServerInfoHeader.SrvCountDup to BatchSize for clarity
- Added comprehensive documentation explaining the batching protocol
- Removed unused serverScanner function and tests
- Added table tests covering multiple batch scenarios
The BatchSize field indicates the number of servers in the current
batch, while SrvCount indicates the total across all batches.
|
|
- Add TLSConfig and TLSPort fields to Server struct
- Add WithTLS option function for configuration
- Add ServeWithTLS and ServeFileTransfersWithTLS methods
- Update ListenAndServe to start TLS listeners when configured
- Add -tls-cert, -tls-key, -tls-port command-line flags
- Fix data race in rateLimiters map access with mutex
- Add TLS documentation with certificate generation instructions
|
|
|
|
|
|
Adds new constants for file format identifiers (FormatFILP), fork types
(ForkTypeINFO), and platform identifiers (PlatformAMAC, PlatformMWIN) to
improve code maintainability and readability. Changes FlatFileForkHeader.ForkType
field from [4]byte to ForkType type alias for better compile-time type checking,
matching the pattern used in ForkInfoList.Fork.
|
|
- Add custom validator for banner file extensions (.jpg, .jpeg, .gif)
- Update HandleTranAgreed to dynamically detect banner type from file extension
- Export FileTypeFromFilename function for use across packages
- Add comprehensive test coverage for banner validation and type detection
- Improve error messages to clearly communicate allowed file extensions
|
|
- Replace [4]byte with ForkType in ForkInfoList struct
- Update constants ForkTypeDATA and ForkTypeMACR to use ForkType
- Add String() method to ForkType for better debugging
- Improve consistency with existing type patterns (FieldType, TranType)
- Clean up unused code and improve documentation
|
|
- Fix critical bug in tracker address parsing: strings.Split(t, ":") instead of strings.Split(":", t)
- Add dependency injection for TrackerRegistrar to improve testability
- Extract registerWithAllTrackers() helper function to eliminate code duplication
- Add comprehensive test suite covering:
* Unit tests for parseTrackerPassword with edge cases and special characters
* Integration tests for registerWithTrackers with mocking
* Context cancellation and graceful shutdown testing
* Error handling for network failures and malformed addresses
* Edge cases like zero ports, long names, and empty configurations
- Improve password parsing to handle colons in passwords correctly
- Add MockTrackerRegistrar for isolated testing without network dependencies
The string splitting bug would have prevented tracker registration from working
with password-protected trackers. All tests pass and verify the fix works correctly.
|
|
- Add table-driven tests for GetNewsArtListData, DataSize, NewsArtListData.Read, NewsArtList.Read, and newsPathScanner
- Improve test coverage from 0% to 87.5%-100% for these functions
- Add test for Field.DecodeNewsPath function
- Fix NewsArtList.Read to return nil instead of io.EOF for proper io.Reader behavior
- Add constants for NewsFlavorCount and improve code documentation
|
|
- Add tests for UnmarshalYAML covering array and map formats
- Add tests for MarshalYAML with various permission combinations
- Cover edge cases including empty bitmaps and full permissions
- Ensure backward compatibility with legacy array format
|
|
- Add complete test suite for Stats with 100% coverage
- Fix Decrement method to prevent negative values
- Test all methods: Increment, Decrement, Set, Get, Values
- Cover edge cases including zero decrements and mixed operations
|
|
Updated all file close operations to use anonymous functions that ignore
return values to satisfy golangci-lint errcheck warnings.
|
|
- 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
|
|
- 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".
|
|
- 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.
|
|
This seems to be important on Windows! See #161
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Bonjour doesn't seem happy inside Docker, so I'm making it optional and off by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Added ability to reload config, agreement, news, and user accounts without restarting the server by sending SIGHUP to the running process
* Added ability to use modern unix or windows line breaks in Agreement.txt and MessageBoard.txt instead of classic MacOS `\r` breaks.
* Extensive refactor towards swappable backends for the active server state
* Extensive refactored towards making the hotline package generic and re-usable for alternate server implemenations
* Fix bug where users whose accounts have been deleted would not be disconnected
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|