Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AlistGo/alist
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.51.0
Choose a base ref
...
head repository: AlistGo/alist
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.52.0
Choose a head ref
  • 11 commits
  • 22 files changed
  • 4 contributors

Commits on Aug 25, 2025

  1. chore(deps): Upgrade 115driver to v1.1.1 (#9283)

    - Upgraded `github.com/SheltonZhu/115driver` from v1.0.34 to v1.1.1
    - Updated the corresponding version verification information in `go.sum`
    okatu-loli authored Aug 25, 2025
    Configuration menu
    Copy the full SHA
    d7723c3 View commit details
    Browse the repository at this point in the history
  2. feat(search): Optimized search result filtering and paging logic (#9287)

    - Introduced the `filteredNodes` list to optimize the node filtering process
    - Filtered results based on the page limit during paging
    - Modified search logic to ensure nodes are within the user's base path
    - Added access permission checks for node metadata
    - Adjusted paging logic to avoid redundant node retrieval
    okatu-loli authored Aug 25, 2025
    Configuration menu
    Copy the full SHA
    3319f6e View commit details
    Browse the repository at this point in the history
  3. feat: implement session management (#9286)

    * feat(auth): Added device session management
    
    - Added the `handleSession` function to manage user device sessions and verify client identity
    - Updated `auth.go` to call `handleSession` for device handling when a user logs in
    - Added the `Session` model to database migrations
    - Added `device.go` and `session.go` files to handle device session logic
    - Updated `settings.go` to add device-related configuration items, such as the maximum number of devices, device eviction policy, and session TTL
    
    * feat(session): Adds session management features
    
    - Added `SessionInactive` error type in `device.go`
    - Added session-related APIs in `router.go` to support listing and evicting sessions
    - Added `ListSessionsByUser`, `ListSessions`, and `MarkInactive` methods in `session.go`
    - Returns an appropriate error when the session state is `SessionInactive`
    
    * feat(auth): Marks the device session as invalid.
    
    - Import the `session` package into the `auth` module to handle device session status.
    - Add a check in the login logic. If `device_key` is obtained, call `session.MarkInactive` to mark the device session as invalid.
    - Store the invalid status in the context variable `session_inactive` for subsequent middleware checks.
    - Add a check in the session refresh logic to abort the process if the current session has been marked invalid.
    
    * feat(auth, session): Added device information processing and session management changes
    
    - Updated device handling logic in `auth.go` to pass user agent and IP information
    - Adjusted database queries in `session.go` to optimize session query fields and add `user_agent` and `ip` fields
    - Modified the `Handle` method to add `ua` and `ip` parameters to store the user agent and IP address
    - Added the `SessionResp` structure to return a session response containing `user_agent` and `ip`
    - Updated the `/admin/user/create` and `/webdav` endpoints to pass the user agent and IP address to the device handler
    okatu-loli authored Aug 25, 2025
    Configuration menu
    Copy the full SHA
    c64f899 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2025

  1. chore(deps): Update 115driver dependency to v1.1.2 (#9294)

    - Upgrade `github.com/SheltonZhu/115driver` to v1.1.2 in `go.mod`
    - Modify `replace` to point to `github.com/okatu-loli/115driver v1.1.2`
    - Remove old version checksum from `go.sum` and add new version checksum
    okatu-loli authored Aug 27, 2025
    Configuration menu
    Copy the full SHA
    de09ba0 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2025

  1. fix(session): Fixed the session status update logic. (#9296)

    - Removed the error returned when the session status is `SessionInactive`.
    - Updated the `LastActive` field of the session to always record the current time.
    okatu-loli authored Aug 28, 2025
    Configuration menu
    Copy the full SHA
    3bf0af1 View commit details
    Browse the repository at this point in the history
  2. feat(user): Enhanced role assignment logic (#9297)

    - Imported the `utils` package
    - Modified the role assignment logic to prevent assigning administrator or guest roles to users
    okatu-loli authored Aug 28, 2025
    Configuration menu
    Copy the full SHA
    84adba3 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2025

  1. feat(session): Added user session limit and device eviction logic

    - Renamed `CountSessionsByUser` to `CountActiveSessionsByUser` and added session status filtering
    - Added user and device session limit, with policy handling when exceeding the limit
    - Introduced device eviction policy: If the maximum number of devices is exceeded, the oldest session will be evicted using the "evict_oldest" policy
    - Modified `LastActive` update logic to ensure accurate session activity time
    okatu-loli committed Aug 29, 2025
    Configuration menu
    Copy the full SHA
    8623da5 View commit details
    Browse the repository at this point in the history
  2. feat(auth): Optimized device session handling logic

    - Introduced middleware to handle device sessions
    - Changed `handleSession` to `HandleSession` in multiple places in `auth.go` to maintain consistent naming
    - Updated response structure to return `device_key` and `token`
    okatu-loli committed Aug 29, 2025
    Configuration menu
    Copy the full SHA
    9a7c82a View commit details
    Browse the repository at this point in the history
  3. Merge pull request #9299 from okatu-loli/session-manage-2

    fix: session login error
    JoaHuang authored Aug 29, 2025
    Configuration menu
    Copy the full SHA
    a11e4cf View commit details
    Browse the repository at this point in the history
  4. fix(readme): remove outdated sponsor links from README files (#9300)

    Co-authored-by: Sky_slience <Skyslience@spdzy.com>
    skysliences and Sky_slience authored Aug 29, 2025
    Configuration menu
    Copy the full SHA
    63391a2 View commit details
    Browse the repository at this point in the history
  5. fix: session invalid issue (#9301)

    * feat(auth): Enhanced device login session management
    
    - Upon login, obtain and verify `Client-Id` to ensure unique device sessions.
    - If there are too many device sessions, clean up old ones according to the configured policy or return an error.
    - If a device session is invalid, deregister the old token and return a 401 error.
    - Added `EnsureActiveOnLogin` function to handle the creation and refresh of device sessions during login.
    
    * feat(session): Modified session deletion logic to mark sessions as inactive.
    
    - Changed session deletion logic to mark sessions as inactive using the `MarkInactive` method.
    - Adjusted error handling to ensure an error is returned if marking fails.
    
    * feat(session): Added device limits and eviction policies
    
    - Added a device limit, controlling the maximum number of devices using the `MaxDevices` configuration option.
    - If the number of devices exceeds the limit, the configured eviction policy is used.
    - If the policy is `evict_oldest`, the oldest device is evicted.
    - Otherwise, an error message indicating too many devices is returned.
    
    * refactor(session): Filter for the user's oldest active session
    
    - Renamed `GetOldestSession` to `GetOldestActiveSession` to more accurately reflect its functionality
    - Updated the SQL query to add the `status = SessionActive` condition to retrieve only active sessions
    - Replaced all callpoints and unified the new function name to ensure logical consistency
    okatu-loli authored Aug 29, 2025
    Configuration menu
    Copy the full SHA
    4b288a0 View commit details
    Browse the repository at this point in the history
Loading