feat(shumei): enhance device ID generation and add options for UID
luckfun233
90df7df
- Introduced DeviceOptions struct to allow specifying a UID for device ID generation.
- Updated GetDeviceID and GetDeviceIDWithOptions functions to support the new options.
- Improved fingerprint data construction to align with browser SDK.
- Added comprehensive tests for device ID generation and fingerprint data handling.
fix(sse): refine handling of tool fragments in SSE parsing
- Updated ParseSSEChunkForContentDetailed to correctly identify tool fragments and prevent their content from leaking into the main response.
- Enhanced fragment type resolution to ensure proper handling of nested paths and status checks.
- Added tests to verify the correct behavior of tool fragments and their impact on stream parsing.
test(sse): add tests for search mode and fragment handling
- Implemented tests for various scenarios in the search mode, ensuring that tool fragments do not affect the main content.
- Verified that the response status behaves correctly in both fragment and response contexts…
feat: update platform handling and add web support
luckfun233
3678d9b
- Updated Android client version to 2.1.5 in constants_shared.json.
- Introduced new constants_web.json for web platform configuration.
- Enhanced transport layer to support platform-specific TLS settings.
- Added platform configuration handling in settings update and read requests.
- Implemented platform selection UI in the web interface.
- Updated localization files for platform settings.
- Added Shumei device ID generation logic for web platform.
- Introduced confusion mapping and encryption for device ID generation.
feat: Add jitter and random offset to token refresh intervals for better distribution
luckfun233
04c88a2
feat: Implement account role management and banning functionality
luckfun233
766bd1c
- Added role management for accounts, allowing accounts to be set as "normal" or "standby".
- Introduced banning functionality, marking accounts as banned and preventing their use.
- Updated account pool logic to exclude banned and standby accounts from active usage.
- Implemented API endpoints for setting account roles and banning/unbanning accounts.
- Enhanced UI components to support role selection and display account statuses (banned, standby).
- Added localization strings for new features in English and Chinese.
- Updated runtime settings to include a backup release count for standby account promotions.
Fix config.json permission denied on HF Spaces persistent storage
luckfun233
534def0
On HuggingFace Spaces, the persistent /data volume may retain files owned by root or a different UID after container rebuilds, causing permission denied when ds2api tries to save config changes.
Two-layer fix:
- entrypoint.sh: always chown+chmod config files on startup, not just when creating them for the first time
- Go writeConfigBytes: atomic write (temp file + rename) with fallback that removes the old file and retries if permission denied