Go to file
千石 eb4c35db75
feat(device/session): per-user max devices & TTL, WebDAV reactivation, admin clean/list APIs (#9315)
* feat(auth): Improved device session management logic

- Replaced the `userID` parameter with the `user` object to support operations with more user attributes.
- Introduced `SessionTTL` and `MaxDevices` properties in the `Handle` and `EnsureActiveOnLogin` functions to support user-defined settings.
- Adjusted the session creation and verification logic in `session.go` to support user-defined device count and session duration.
- Added help documentation in `setting.go` to explain the configuration purposes of `MaxDevices` and `DeviceSessionTTL`.
- Added optional `MaxDevices` and `SessionTTL` properties to the user entity in `user.go` and persisted these settings across user updates.
- Modified the device handling logic in `webdav.go` to adapt to the new user object parameters.

* feat(session): Added session cleanup functionality

- Added the `/clean` route to the route for session cleanup
- Added the `DeleteInactiveSessions` method to support deleting inactive sessions by user ID
- Added the `DeleteSessionByID` method to delete a specific session by session ID
- Defined the `CleanSessionsReq` request structure to support passing a user ID or session ID
- Implemented the `CleanSessions` interface logic to perform corresponding session cleanup operations based on the request parameters

* feat(session): Added session list functionality with usernames

- Added the `SessionWithUser` structure, which includes `Session` and `Username` fields.
- Added the `ListSessionsWithUser` function, which queries and returns a list of sessions with usernames.
- Used a `JOIN` operation to join the session and user tables to retrieve the username associated with each session.
- Changed `ListSessions` to `ListSessionsWithUser` to ensure that the username is retrieved.

* feat(webdav): Enhanced WebDAV authentication logic

- Added logic for generating device keys based on the Client-Id, prioritizing those obtained from the request header.
- If the Client-Id is missing, attempts to obtain it from the cookie. If that still doesn't exist, generates a random suffix for the client IP address as an identifier.
- Stores the generated Client-Id in a cookie to ensure consistency across subsequent requests.
- Use the device.EnsureActiveOnLogin method instead of the original Handle method to reactivate inactive sessions.
2025-09-11 11:27:07 +08:00
.github fix: resolve webdav decode issue (#9268) 2025-08-16 20:55:17 +08:00
cmd refactor(convert_role): Improve role conversion logic for legacy formats (#9219) 2025-07-26 15:20:08 +08:00
drivers feat: Support 123pan safebox (#9311) 2025-09-05 19:58:27 +08:00
internal feat(device/session): per-user max devices & TTL, WebDAV reactivation, admin clean/list APIs (#9315) 2025-09-11 11:27:07 +08:00
pkg feat: implement session management (#9286) 2025-08-25 19:46:38 +08:00
public fix: embed all files of dist 2024-02-03 19:44:50 +08:00
server feat(device/session): per-user max devices & TTL, WebDAV reactivation, admin clean/list APIs (#9315) 2025-09-11 11:27:07 +08:00
wrapper feat: add `windows/arm64` target (close #3308) 2023-02-09 19:52:40 +08:00
.air.toml feat: add doge driver (#6201) 2024-03-25 22:53:44 +08:00
.gitignore feat: add doge driver (#6201) 2024-03-25 22:53:44 +08:00
CODE_OF_CONDUCT.md docs: Create CODE_OF_CONDUCT.md [skip ci] 2022-09-10 22:23:05 +08:00
CONTRIBUTING.md docs: update go version 2023-07-27 18:32:33 +08:00
Dockerfile fix(docker_release): avoid duplicate occupation in docker image (#8393 close #8388) 2025-04-19 14:26:19 +08:00
Dockerfile.ci Update Dockerfile.ci (#9230) 2025-07-29 18:35:47 +08:00
LICENSE chore: add windows bin to gitignore 2022-04-18 18:31:10 +08:00
README.md fix(readme): remove outdated sponsor links from README files (#9300) 2025-08-29 14:56:54 +08:00
README_cn.md fix(readme): remove outdated sponsor links from README files (#9300) 2025-08-29 14:56:54 +08:00
README_ja.md fix(readme): remove outdated sponsor links from README files (#9300) 2025-08-29 14:56:54 +08:00
build.sh fix: dead link 2025-06-27 23:58:52 +08:00
docker-compose.yml feat!: listen to both http & https (#4536) 2023-06-11 18:17:37 +08:00
entrypoint.sh fix: shebang of entrypoint.sh (#8408) 2025-04-27 19:56:34 +08:00
go.mod chore(deps): Update 115driver dependency to v1.1.2 (#9294) 2025-08-27 17:46:34 +08:00
go.sum chore(deps): Update 115driver dependency to v1.1.2 (#9294) 2025-08-27 17:46:34 +08:00
main.go feat: use cobra and add some command 2022-08-07 13:09:59 +08:00
renovate.json fix(deps): update dependencies by renovate[bot] (#2344) 2022-11-17 08:49:15 +08:00

README.md

logo

🗂️A file list program that supports multiple storages, powered by Gin and Solidjs.


English | 中文 | 日本語 | Contributing | CODE_OF_CONDUCT

Features

Document

https://alistgo.com/

API Documentation (via Apifox):

https://alist-public.apifox.cn/

Demo

https://al.nn.ci

Discussion

Please go to our discussion forum for general questions, issues are for bug reports and feature requests only.

Sponsor

AList is an open-source software, if you happen to like this project and want me to keep going, please consider sponsoring me or providing a single donation! Thanks for all the love and support: https://alistgo.com/guide/sponsor.html

Special sponsors

  • VidHub - An elegant cloud video player within the Apple ecosystem. Support for iPhone, iPad, Mac, and Apple TV.

Contributors

Thanks goes to these wonderful people:

Contributors

License

The AList is open-source software licensed under the AGPL-3.0 license.

Disclaimer

  • This program is a free and open source project. It is designed to share files on the network disk, which is convenient for downloading and learning Golang. Please abide by relevant laws and regulations when using it, and do not abuse it;
  • This program is implemented by calling the official sdk/interface, without destroying the official interface behavior;
  • This program only does 302 redirect/traffic forwarding, and does not intercept, store, or tamper with any user data;
  • Before using this program, you should understand and bear the corresponding risks, including but not limited to account ban, download speed limit, etc., which is none of this program's business;
  • If there is any infringement, please contact me by email, and it will be dealt with in time.

@GitHub · @TelegramGroup · @Discord