- Changed the path concatenation method between `reqPath` and `src` and `dst` to use `ResolvePath`
- Updated the implementation of path handling in multiple functions
- Improved the consistency and reliability of path resolution
* feat(s3): Add support for S3 object storage classes
Introduces a new 'storage_class' configuration option for S3 providers. Users can now specify the desired storage class (e.g., Standard, GLACIER, DEEP_ARCHIVE) for objects uploaded to S3-compatible services like AWS S3 and Tencent COS.
The input storage class string is normalized to match AWS SDK constants, supporting various common aliases. If an unknown storage class is provided, it will be used as a raw value with a warning. This enhancement provides greater control over storage costs and data access patterns.
* feat(storage): Support for displaying file storage classes
Adds storage class information to file metadata and API responses.
This change introduces the ability to store file storage classes in file metadata and display them in API responses. This allows users to view a file's storage tier (e.g., S3 Standard, Glacier), enhancing data management capabilities.
Implementation details include:
- Introducing the StorageClassProvider interface and the ObjWrapStorageClass structure to uniformly handle and communicate object storage class information.
- Updated file metadata structures (e.g., ArchiveObj, FileInfo, RespFile) to include a StorageClass field.
- Modified relevant API response functions (e.g., GetFileInfo, GetFileList) to populate and return storage classes.
- Integrated functionality for retrieving object storage classes from underlying storage systems (e.g., S3) and wrapping them in lists.
* feat(driver/s3): Added the "Other" interface and implemented it by the S3 driver.
A new `driver.Other` interface has been added and defined in the `other.go` file.
The S3 driver has been updated to implement this new interface, extending its functionality.
* feat(s3): Add S3 object archive and thaw task management
This commit introduces comprehensive support for S3 object archive and thaw operations, managed asynchronously through a new task system.
- **S3 Transition Task System**:
- Adds a new `S3Transition` task configuration, including workers, max retries, and persistence options.
- Initializes `S3TransitionTaskManager` to handle asynchronous S3 archive/thaw requests.
- Registers dedicated API routes for monitoring S3 transition tasks.
- **Integrate S3 Archive/Thaw with Other API**:
- Modifies the `Other` API handler to intercept `archive` and `thaw` methods for S3 storage drivers.
- Dispatches these operations as `S3TransitionTask` instances to the task manager for background processing.
- Returns a task ID to the client for tracking the status of the dispatched operation.
- **Refactor `other` package for improved API consistency**:
- Exports previously internal structs such as `archiveRequest`, `thawRequest`, `objectDescriptor`, `archiveResponse`, `thawResponse`, and `restoreStatus` by making their names public.
- Makes helper functions like `decodeOtherArgs`, `normalizeStorageClass`, and `normalizeRestoreTier` public.
- Introduces new constants for various S3 `Other` API methods.
Introduces the ability to sign generated URLs for enhanced security and access control.
This feature is activated by configuring a `PrivateKey`, `UID`, and `ValidDuration` in the driver settings. If a private key is provided, the driver will sign the output URLs, making them time-limited based on the `ValidDuration`. The `ValidDuration` defaults to 30 minutes if not specified.
The core signing logic is encapsulated in the new `sign.go` file. The `driver.go` file integrates this signing process before returning the final URL.
- Implement complete ProtonDrive storage driver with end-to-end encryption support
- Add authentication via username/password with credential caching and reusable login
- Support all core operations: List, Link, Put, Copy, Move, Remove, Rename, MakeDir
- Include encrypted file operations with PGP key management and node passphrase handling
- Add temporary HTTP server for secure file downloads with range request support
- Support media streaming using temp server range requests
- Implement progress tracking for uploads and downloads
- Support directory operations with circular move detection
- Add proper error handling and panic recovery for external library integration
Closes#9312
- Implement OAuth2 authentication with US/EU region support
- Add file operations (list, upload, download, delete, rename, move, copy)
- Add folder operations (create, rename, move, delete)
- Enhance error handling with pCloud-specific retry logic
- Use correct API methods: GET for reads, POST for writes
- Implement direct upload approach for better performance
- Add exponential backoff for failed requests with 4xxx/5xxx classification
* feat(driver): add Gofile storage driver
Add support for Gofile.io cloud storage service with full CRUD operations.
Features:
- File and folder listing
- Upload and download functionality
- Create, move, rename, copy, and delete operations
- Direct link generation for file access
- API token authentication
The driver implements all required driver interfaces and follows
the existing driver patterns in the codebase.
* feat(gofile): add configurable link expiration handling
- Adjusts driver addition metadata to accept LinkExpiry and DirectLinkExpiry options for caching and API expiry control (drivers/gofile/meta.go:10).
- Applies the new options when building file links, setting optional local cache expiration (drivers/gofile/driver.go:101) and sending an expireTime to the direct-link API (drivers/gofile/util.go:202).
- Logs Gofile API error payloads and validates the structured error response before returning it (drivers/gofile/util.go:141).
- Adds the required imports and returns the configured model.Link instance (drivers/gofile/driver.go:6).
- Use `filePath` variable to simplify path handling
- Replace `isSymlinkDir` with `isLinkedDir` in `isFolder` check
- Use simplified path variables in `times.Stat` function calls
refactor(util): Optimized directory link check functions
- Renamed `isSymlinkDir` to `isLinkedDir` to expand Windows platform support
- Corrected path resolution logic to ensure link paths are absolute
- Added error handling to prevent path resolution failures
* feat(storage): Added role and user path checking functionality
- Added `GetAllRoles` function to retrieve all roles
- Added `GetAllUsers` function to retrieve all users
- Added `firstPathSegment` function to extract the first segment of a path
- Checks whether a storage object is used by a role or user, and returns relevant information for unusing it
* fix(storage): Fixed a potential null value issue with not checking firstMount.
- Added a check to see if `firstMount` is null to prevent logic errors.
- Adjusted the loading logic of `GetAllRoles` and `GetAllUsers` to only execute when `firstMount` is non-null.
- Fixed the `usedBy` check logic to ensure that an error message is returned under the correct conditions.
- Optimized code structure to reduce unnecessary execution paths.
- Implement automatic session token renewal every 6-9 minutes
- Add validation for required SessionToken and Cookie fields in Init
- Handle session expiration by calling renewToken on validation failure
- Prevent storage failures due to MediaFire session timeouts
Fixes session closure issues that occur after server restarts or extended periods.
Co-authored-by: Da3zKi7 <da3zki7@duck.com>
- Changed permission path collection from map to slice to improve code readability
- Removed redundant path checks to improve path addition efficiency
- Restructured the loop logic for path processing to simplify the path permission assignment process
Add support for Gofile.io cloud storage service with full CRUD operations.
Features:
- File and folder listing
- Upload and download functionality
- Create, move, rename, copy, and delete operations
- Direct link generation for file access
- API token authentication
The driver implements all required driver interfaces and follows
the existing driver patterns in the codebase.
* feat(meta): Added a SafePassword field
- Added the SafePassword field to meta.go
- Revised the field format to align with the code style
- The SafePassword field is used to supplement the extended functionality
* feat(driver): Added support for safe unlocking logic
- Added safe file unlocking logic in `driver.go`, returning an error if unlocking fails.
- Introduced the `safeBoxUnlocked` variable of type `sync.Map` to record the IDs of unlocked files.
- Enhanced error handling logic to automatically attempt to unlock safe files and re-retrieve the file list.
- Added the `IsLock` field to file types in `types.go` to identify whether they are safe files.
- Added a constant definition for the `SafeBoxUnlock` interface address in `util.go`.
- Added the `unlockSafeBox` method to unlock a safe with a specified file ID via the API.
- Optimized the file retrieval logic to automatically call the unlock method when the safe is locked.
* Refactor (driver): Optimize lock field type
- Changed the `IsLock` field type from `int` to `bool` for better semantics.
- Updated the check logic to use direct Boolean comparisons to improve code readability and accuracy.
* 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
- 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`
- 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
- Removed the error returned when the session status is `SessionInactive`.
- Updated the `LastActive` field of the session to always record the current time.
- 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
* 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
- 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
* fix(setting): ensure DefaultRole stores role ID while exposing role name in APIs
- Simplified initial settings to use `model.GUEST` as the default role ID instead of querying roles at startup.
- Updated `GetSetting`, `ListSettings` handlers to:
- Convert stored role ID into the corresponding role name when returning data.
- Preserve dynamic role options for selection.
- Removed unused `strings` import and role preloading logic from `InitialSettings`.
- This change avoids DB dependency during initialization while keeping consistent role display for frontend clients.
* fix(setting): ensure DefaultRole stores role ID while exposing role
name in APIs (fix/settings-get-role)
- Simplify initial settings to use `model.GUEST` as the default role ID
instead of querying roles at startup.
- Update `GetSetting`, `ListSettings` handlers to:
- Convert stored role ID into the corresponding role name when
returning data.
- Preserve dynamic role options for selection.
- Remove unused `strings` import and role preloading logic from
`InitialSettings`.
- Avoid DB dependency during initialization while keeping consistent
role display for frontend clients.
- Adjusted logic to skip incrementing index when exiting comments.
- Added checks to continue loop if inside a single-line or block comment.
- Prevents erroneous parsing and retains intended comment exclusion.
* feat(setting): add role-based default and registration settings (closed #feat/register-and-statistics)
- Added `AllowRegister` and `DefaultRole` settings to site configuration.
- Integrated dynamic role options for `DefaultRole` using `op.GetRoles`.
- Updated `setting.go` handlers to manage `DefaultRole` options dynamically.
- Modified `const.go` to include new site settings constants.
- Updated dependencies in `go.mod` and `go.sum` to support new functionality.
* feat(register-and-statistics): add user registration endpoint
- Added `POST /auth/register` endpoint to support user registration.
- Implemented registration logic in `auth.go` with dynamic role assignment.
- Integrated settings `AllowRegister` and `DefaultRole` for registration flow.
- Updated imports to include new modules: `conf`, `setting`.
- Adjusted user creation logic to use `DefaultRole` setting dynamically.
* feat(register-and-statistics): add user registration endpoint (#register-and-statistics)
- Added `POST /auth/register` endpoint to support user registration.
- Implemented registration logic in `auth.go` with dynamic role assignment.
- Integrated `AllowRegister` and `DefaultRole` settings for registration flow.
- Updated imports to include new modules: `conf`, `setting`.
- Adjusted user creation logic to use `DefaultRole` dynamically.
* feat(register-and-statistics): enhance role management logic (#register-and-statistics)
- Refactored CreateRole and UpdateRole functions to handle default role.
- Added dynamic role assignment logic in 'role.go' using conf settings.
- Improved request handling in 'handles/role.go' with structured data.
- Implemented default role logic in 'db/role.go' to update non-default roles.
- Modified 'model/role.go' to include a 'Default' field for role management.
* feat(register-and-statistics): enhance role management logic
- Refactor CreateRole and UpdateRole to handle default roles.
- Add dynamic role assignment using conf settings in 'role.go'.
- Improve request handling with structured data in 'handles/role.go'.
- Implement default role logic in 'db/role.go' for non-default roles.
- Modify 'model/role.go' to include 'Default' field for role management.
* feat(register-and-statistics): improve role handling logic
- Switch from role names to role IDs for better consistency.
- Update logic to prioritize "guest" for default role ID.
- Adjust `DefaultRole` setting to use role IDs.
- Refactor `getRoleOptions` to return role IDs as a comma-separated string.
* feat(register-and-statistics): improve role handling logic
* fix: resolve webdav handshake error in permission checks
- Updated role permission logic to handle bidirectional subpaths,
fixing handshake termination by remote host due to path mismatch.
- Refactored function naming for consistency and clarity.
- Enhanced filtering of objects based on user permissions.
- Modified `makePropstatResponse` to preserve encoded href paths.
- Added test for `makePropstatResponse` to ensure href encoding.
* Delete server/webdav/makepropstatresponse_test.go
* ci(workflow): set GOPROXY for Go builds on GitHub Actions
- Use `GOPROXY=https://proxy.golang.org,direct` to speed up module downloads
- Mitigates network flakiness (e.g., checksum DB timeouts/rate limits)
- `,direct` provides fallback for private/unproxyable modules
- No build logic changes; only affects dependency resolution across all matrix targets
---------
Co-authored-by: AlistGo <opsgit88@gmail.com>
* feat: improve WebDAV permission handling and user role fetching
- Added logic to handle root permissions in WebDAV requests.
- Improved the user role fetching mechanism.
- Enhanced path checks and permission scopes in role_perm.go.
- Set FetchRole function to avoid import cycles between modules.
* fix(webdav): resolve connection reset issue by encoding paths
- Adjust path encoding in webdav.go to prevent connection reset.
- Utilize utils.EncodePath for correct path formatting.
- Ensure proper handling of directory paths with trailing slash.
* fix(webdav): resolve connection reset issue by encoding paths
- Adjust path encoding in webdav.go to prevent connection reset.
- Utilize utils.FixAndCleanPath for correct path formatting.
- Ensure proper handling of directory paths with trailing slash.
* fix: resolve webdav handshake error in permission checks
- Updated role permission logic to handle bidirectional subpaths.
- This adjustment fixes the issue where remote host terminates the
handshake due to improper path matching.
* fix: resolve webdav handshake error in permission checks (fix/fix-webdav-error)
- Updated role permission logic to handle bidirectional subpaths,
fixing handshake termination by remote host due to path mismatch.
- Refactored function naming for consistency and clarity.
- Enhanced filtering of objects based on user permissions.
* fix: resolve webdav handshake error in permission checks
- Updated role permission logic to handle bidirectional subpaths,
fixing handshake termination by remote host due to path mismatch.
- Refactored function naming for consistency and clarity.
- Enhanced filtering of objects based on user permissions.
* feat(label): enhance label file binding and router setup (feat/add-tag-backup)
- Add `GetLabelsByFileNamesPublic` to retrieve labels using file names.
- Refactor router setup for label and file binding routes.
- Improve `toObjsResp` for efficient label retrieval by file names.
- Comment out unnecessary user ID parameter in `toObjsResp`.
* feat(label): enhance label file binding and router setup
- Add `GetLabelsByFileNamesPublic` for label retrieval by file names.
- Refactor router setup for label and file binding routes.
- Improve `toObjsResp` for efficient label retrieval by file names.
- Comment out unnecessary user ID parameter in `toObjsResp`.
* refactor(db): comment out debug print in GetLabelIds (#feat/add-tag-backup)
- Comment out debug print statement in GetLabelIds to clean up logs.
- Enhance code readability by removing unnecessary debug output.
* feat(label-file-binding): add batch creation and improve label ID handling
- Introduced `CreateLabelFileBinDingBatch` API for batch label binding.
- Added `collectLabelIDs` helper function to handle label ID parsing.
- Enhanced label ID handling to support varied delimiters and input formats.
- Refactored `CreateLabelFileBinDing` logic for improved code readability.
- Updated router to include `POST /label_file_binding/create_batch`.
- Add `GetUsersByRole` function for fetching users by role.
- Introduce `GetAllBasePathsFromRoles` to aggregate paths from roles.
- Refine path handling in `pkg/utils/path.go` for normalization.
- Comment out base path prefix updates to simplify role operations.
- Add `IntSlice` type to handle both single int and array in JSON.
- Modify `MeResp` struct to use `IntSlice` for `Role` field.
- Import `encoding/json` for JSON operations.
- Implement new driver for 123 Open service, enabling file operations
such as listing, uploading, moving, and removing files.
- Introduce token management for authentication and authorization.
- Add API integration for various file operations and actions.
- Include utility functions for handling API requests and responses.
- Register the new driver in the existing drivers' list.
- Adjust log formatter to disable colors when NO_COLOR or ALIST_NO_COLOR
environment variables are set.
- Reorganize formatter settings for better readability.
- Add `GetUsersByRole` function to fetch users based on their roles.
- Extend `UpdateUserBasePathPrefix` to accept optional user lists.
- Ensure path cleaning in `UpdateUserBasePathPrefix` for consistency.
- Integrate guest role fetching in `auth.go` middleware.
- Utilize `GetUsersByRole` in `role.go` for base path modifications.
- Remove redundant line in `role.go` role modification logic.
- Add API documentation section to `README.md` with link to Apifox
- Add API documentation section to `README_ja.md` with Japanese translation and link to Apifox
- Add API documentation section to `README_cn.md` with Chinese translation and link to Apifox
- Add `CountEnabledAdminsExcluding` function to count enabled admins excluding a specific user.
- Implement `CountUsersByRoleAndEnabledExclude` in `internal/db/user.go` to support exclusion logic.
- Refactor role handling with switch-case for better readability in `server/handles/role.go`.
- Ensure at least one enabled admin remains when disabling an admin in `server/handles/user.go`.
- Maintain guest role name consistency when updating roles in `internal/op/role.go`.
- Update `CreateUser` to adjust `BasePath` based on user roles and clean paths.
- Modify `UpdateUser` to incorporate role-based path changes.
- Add validation in `CreateStorage` and `UpdateStorage` to prevent root mount path.
- Prevent changes to admin user's role and username in user handler.
- Update `UpdateRole` to modify user base paths when role paths change, and clear user cache accordingly.
- Import `errors` package to handle error messages.
- Add new imports: `database/sql`, `encoding/json`, and `conf` package in `convert_role.go`.
- Simplify permission entry initialization by removing redundant struct formatting.
- Update error logging messages for better clarity.
- Replace `op.GetUsers` with direct database access for fetching user roles.
- Implement role update logic using `rawDb` and handle legacy int role conversion.
- Count the number of users whose roles are updated and log completion.
- Introduce `IsLegacyRoleDetected` function to check for legacy role formats.
- Modify `cmd/common.go` to invoke role conversion if legacy format is detected.
* 标签管理
* pr检查优化
* feat(role): Implement role management functionality
- Add role management routes in `server/router.go` for listing, getting, creating, updating, and deleting roles
- Introduce `initRoles()` in `internal/bootstrap/data/data.go` for initializing roles during bootstrap
- Create `internal/op/role.go` to handle role operations including caching and singleflight
- Implement role handler functions in `server/handles/role.go` for API responses
- Define database operations for roles in `internal/db/role.go`
- Extend `internal/db/db.go` for role model auto-migration
- Design `internal/model/role.go` to represent role structure with ID, name, description, base path, and permissions
- Initialize default roles (`admin` and `guest`) in `internal/bootstrap/data/role.go` during startup
* refactor(user roles): Support multiple roles for users
- Change the `Role` field type from `int` to `[]int` in `drivers/alist_v3/types.go` and `drivers/quqi/types.go`.
- Update the `Role` field in `internal/model/user.go` to use a new `Roles` type with JSON and database support.
- Modify `IsGuest` and `IsAdmin` methods to check for roles using `Contains` method.
- Update `GetUserByRole` method in `internal/db/user.go` to handle multiple roles.
- Add `roles.go` to define a new `Roles` type with JSON marshalling and scanning capabilities.
- Adjust code in `server/handles/user.go` to compare roles with `utils.SliceEqual`.
- Change role initialization for users in `internal/bootstrap/data/dev.go` and `internal/bootstrap/data/user.go`.
- Update `Role` handling in `server/handles/task.go`, `server/handles/ssologin.go`, and `server/handles/ldap_login.go`.
* feat(user/role): Add path limit check for user and role permissions
- Add new permission bit for checking path limits in `user.go`
- Implement `CheckPathLimit` method in `User` struct to validate path access
- Modify `JoinPath` method in `User` to enforce path limit checks
- Update `role.go` to include path limit logic in `Role` struct
- Document new permission bit in `Role` and `User` comments for clarity
* feat(permission): Add role-based permission handling
- Introduce `role_perm.go` for managing user permissions based on roles.
- Implement `HasPermission` and `MergeRolePermissions` functions.
- Update `webdav.go` to utilize role-based permissions instead of direct user checks.
- Modify `fsup.go` to integrate `CanAccessWithRoles` function.
- Refactor `fsread.go` to use `common.HasPermission` for permission validation.
- Adjust `fsmanage.go` for role-based access control checks.
- Enhance `ftp.go` and `sftp.go` to manage FTP access via roles.
- Update `fsbatch.go` to employ `MergeRolePermissions` for batch operations.
- Replace direct user permission checks with role-based permission handling across various modules.
* refactor(user): Replace integer role values with role IDs
- Change `GetAdmin()` and `GetGuest()` functions to retrieve role by name and use role ID.
- Add patch for version `v3.45.2` to convert legacy integer roles to role IDs.
- Update `dev.go` and `user.go` to use role IDs instead of integer values for roles.
- Remove redundant code in `role.go` related to guest role creation.
- Modify `ssologin.go` and `ldap_login.go` to set user roles to nil instead of using integer roles.
- Introduce `convert_roles.go` to handle conversion of legacy roles and ensure role existence in the database.
* feat(role_perm): implement support for multiple base paths for roles
- Modify role permission checks to support multiple base paths
- Update role creation and update functions to handle multiple base paths
- Add migration script to convert old base_path to base_paths
- Define new Paths type for handling multiple paths in the model
- Adjust role model to replace BasePath with BasePaths
- Update existing patches to handle roles with multiple base paths
- Update bootstrap data to reflect the new base_paths field
* feat(role): Restrict modifications to default roles (admin and guest)
- Add validation to prevent changes to "admin" and "guest" roles in `UpdateRole` and `DeleteRole` functions.
- Introduce `ErrChangeDefaultRole` error in `internal/errs/role.go` to standardize error messaging.
- Update role-related API handlers in `server/handles/role.go` to enforce the new restriction.
- Enhance comments in `internal/bootstrap/data/role.go` to clarify the significance of default roles.
- Ensure consistent error responses for unauthorized role modifications across the application.
* 🔄 **refactor(role): Enhance role permission handling**
- Replaced `BasePaths` with `PermissionPaths` in `Role` struct for better permission granularity.
- Introduced JSON serialization for `PermissionPaths` using `RawPermission` field in `Role` struct.
- Implemented `BeforeSave` and `AfterFind` GORM hooks for handling `PermissionPaths` serialization.
- Refactored permission calculation logic in `role_perm.go` to work with `PermissionPaths`.
- Updated role creation logic to initialize `PermissionPaths` for `admin` and `guest` roles.
- Removed deprecated `CheckPathLimit` method from `Role` struct.
* fix(model/user/role): update permission settings for admin and role
- Change `RawPermission` field in `role.go` to hide JSON representation
- Update `Permission` field in `user.go` to `0xFFFF` for full access
- Modify `PermissionScopes` in `role.go` to `0xFFFF` for enhanced permissions
* 🔒 feat(role-permissions): Enhance role-based access control
- Introduce `canReadPathByRole` function in `role_perm.go` to verify path access based on user roles
- Modify `CanAccessWithRoles` to include role-based path read check
- Add `RoleNames` and `Permissions` to `UserResp` struct in `auth.go` for enhanced user role and permission details
- Implement role details aggregation in `auth.go` to populate `RoleNames` and `Permissions`
- Update `User` struct in `user.go` to include `RolesDetail` for more detailed role information
- Enhance middleware in `auth.go` to load and verify detailed role information for users
- Move `guest` user initialization logic in `user.go` to improve code organization and avoid repetition
* 🔒 fix(permissions): Add permission checks for archive operations
- Add `MergeRolePermissions` and `HasPermission` checks to validate user access for reading archives
- Ensure users have `PermReadArchives` before proceeding with `GetNearestMeta` in specific archive paths
- Implement permission checks for decompress operations, requiring `PermDecompress` for source paths
- Return `PermissionDenied` errors with 403 status if user lacks necessary permissions
* 🔒 fix(server): Add permission check for offline download
- Add permission merging logic for user roles
- Check user has permission for offline download addition
- Return error response with "permission denied" if check fails
* ✨ feat(role-permission): Implement path-based role permission checks
- Add `CheckPathLimitWithRoles` function to validate access based on `PermPathLimit` permission.
- Integrate `CheckPathLimitWithRoles` in `offline_download` to enforce path-based access control.
- Apply `CheckPathLimitWithRoles` across file system management operations (e.g., creation, movement, deletion).
- Ensure `CheckPathLimitWithRoles` is invoked for batch operations and archive-related actions.
- Update error handling to return `PermissionDenied` if the path validation fails.
- Import `errs` package in `offline_download` for consistent error responses.
* ✨ feat(role-permission): Implement path-based role permission checks
- Add `CheckPathLimitWithRoles` function to validate access based on `PermPathLimit` permission.
- Integrate `CheckPathLimitWithRoles` in `offline_download` to enforce path-based access control.
- Apply `CheckPathLimitWithRoles` across file system management operations (e.g., creation, movement, deletion).
- Ensure `CheckPathLimitWithRoles` is invoked for batch operations and archive-related actions.
- Update error handling to return `PermissionDenied` if the path validation fails.
- Import `errs` package in `offline_download` for consistent error responses.
* ♻️ refactor(access-control): Update access control logic to use role-based checks
- Remove deprecated logic from `CanAccess` function in `check.go`, replacing it with `CanAccessWithRoles` for improved role-based access control.
- Modify calls in `search.go` to use `CanAccessWithRoles` for more precise handling of permissions.
- Update `fsread.go` to utilize `CanAccessWithRoles`, ensuring accurate access validation based on user roles.
- Simplify import statements in `check.go` by removing unused packages to clean up the codebase.
* ✨ feat(fs): Improve visibility logic for hidden files
- Import `server/common` package to handle permissions more robustly
- Update `whetherHide` function to use `MergeRolePermissions` for user-specific path permissions
- Replace direct user checks with `HasPermission` for `PermSeeHides`
- Enhance logic to ensure `nil` user cases are handled explicitly
* 标签管理
* feat(db/auth/user): Enhance role handling and clean permission paths
- Comment out role modification checks in `server/handles/user.go` to allow flexible role changes.
- Improve permission path handling in `server/handles/auth.go` by normalizing and deduplicating paths.
- Introduce `addedPaths` map in `CurrentUser` to prevent duplicate permissions.
* feat(storage/db): Implement role permissions path prefix update
- Add `UpdateRolePermissionsPathPrefix` function in `role.go` to update role permissions paths.
- Modify `storage.go` to call the new function when the mount path is renamed.
- Introduce path cleaning and prefix matching logic for accurate path updates.
- Ensure roles are updated only if their permission scopes are modified.
- Handle potential errors with informative messages during database operations.
* feat(role-migration): Implement role conversion and introduce NEWGENERAL role
- Add `NEWGENERAL` to the roles enumeration in `user.go`
- Create new file `convert_role.go` for migrating legacy roles to new model
- Implement `ConvertLegacyRoles` function to handle role conversion with permission scopes
- Add `convert_role.go` patch to `all.go` under version `v3.46.0`
* feat(role/auth): Add role retrieval by user ID and update path prefixes
- Add `GetRolesByUserID` function for efficient role retrieval by user ID
- Implement `UpdateUserBasePathPrefix` to update user base paths
- Modify `UpdateRolePermissionsPathPrefix` to return modified role IDs
- Update `auth.go` middleware to use the new role retrieval function
- Refresh role and user caches upon path prefix updates to maintain consistency
---------
Co-authored-by: Leslie-Xy <540049476@qq.com>
Mega supports duplicate names but alist does not support.
In `List()` method, driver will return multiple files with same name.
That makes alist to use oldest version file for listing/downloading.
So it is necessary to filter old same name files in a folder.
After fixes, all CRUD work normally.
Refs #8344
* feat(local): support percent for video thumbnail
The percentage determines the point in the video (as a percentage of the total duration) at which the thumbnail will be generated.
* feat(local): support both time and percent for video thumbnail
* refactor(local): avoid duplicate parsing of VideoThumbPos
* feat(lanzou): add RemoveJSComment function to clean JavaScript comments from HTML
* feat(lanzou): remove comments from share page data in getFilesByShareUrl function
* fix(lanzou): optimize RemoveJSComment function to improve comment removal logic
* fix(aliyundrive_open): resolve file duplication issues and improve path handling
1. Fix file duplication by implementing a new removeDuplicateFiles method that cleans up duplicate files after operations
2. Change Move operation to use "ignore" for check_name_mode instead of "refuse" to allow moves when destination has same filename
3. Set Copy operation to handle duplicates by removing them after successful copy
4. Improve path handling for all file operations (Move, Rename, Put, MakeDir) by properly maintaining the full path of objects
5. Implement GetRoot interface for proper root object initialization with correct path
6. Add proper path management in List operation to ensure objects have correct paths
7. Fix path handling in error cases and improve logging of failures
* refactor(aliyundrive_open): change error logging to warnings for duplicate file removal
Updated the Move, Rename, and Copy methods to log warnings instead of errors when duplicate file removal fails, as the primary operations have already completed successfully. This improves the clarity of logs without affecting the functionality.
* Update drivers/aliyundrive_open/util.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: potential XSS vulnerabilities
* feat: support filter and render for readme.md
* chore: set ReadMeAutoRender to true
* fix attachFileName undefined
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* refactor(cmd): use std `runtime` package to get go version info
- Remove the `GoVersion` variable.
- Remove overriding `GoVersion` by ldflags in `build.sh`.
- Get go version, OS and arch from the constants in the std `runtime` package instead of compile time.
* chore(ci): remove `GoVersion` flag from workflows
Remove GoVersion flag from beta_release.yml and build.yml workflows.
> Reduce compile-time dependencies.
* fix(driver): additionally implement canceling and updating progress for putting for some drivers
* refactor: add driver archive api into template
* fix(123): use built-in MD5 to avoid caching full
* .
* fix build failed
* fix(archive): unrecognition zip
* feat(archive): add tree for zip meta
* fix bug
* refactor(archive): meta cache time use Link Expiration first
* feat(archive): return sort policy in meta (#2)
* refactor
* perf(archive): reduce new network requests
---------
Co-authored-by: KirCute_ECT <951206789@qq.com>
* Feat(offline-download): allow using thunder offline download tool in any storage
* Feat(offline-download): allow using 115 offline download tool in any storage
* Feat(offline-download): allow using pikpak offline download tool in any storage
* style(offline-download): unify offline download tool names
* feat(offline-download): show available offline download tools only
* Fix(offline-download): update unmodified tool names.
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* feat(github): add github api driver
* fix: filter submodule operation
* feat: rename, copy and move, but with bugs
* fix: move and copy returns 422
* fix: change TargetPath in rename msg from parent path to new self path
* fix: add non-commit mutex
* pref(github): use net/http to put blob
* chore: add a help message to `ref` addition
* feat(local): support percent for video thumbnail
The percentage determines the point in the video (as a percentage of the total duration) at which the thumbnail will be generated.
* feat(local): support both time and percent for video thumbnail
* build: add argument INSTALL_ARIA2 to dockerfile
* feat: run aria2 in main entrypoint
* feat(ci): environment matrix for docker release
* improve(ci): allow overwrite artifacts in docker release
* fix(ci): permission of alist binary in docker; entrypoint logic
* improve(aria2): move aria2 data to /opt/aria2; fix permission issues
References:
https://github.com/AlistGo/with_aria2/pull/13
Co-authored-by: GoodbyeNJN <cc@fuckwall.cc>
* fix(ci): aio image is not taking effect
* fix(build): tar command in aria2 installation process
(cherry picked from commit 647285408354807bae64df6a20fefb696ff787de)
---------
Co-authored-by: GoodbyeNJN <cc@fuckwall.cc>
* feat(patch): upgrade patch module
* chore(patch): add docs
* fix(patch): skip and rewrite invalid last launched version
* fix(patch): turn two functions into patches
* fix(ftp-server): client timeout to wait a large file upload to netdisk
* fix(ftp-server): driver alist v3 upload failed and temp files do not be deleted
* fix(139): update family cloud API
* fix(139): update API of familyGetLink
* feat(139): support group (close#7603)
* docs: add `139 group` to Readme
* feat(139): support multipart upload (close: #7444)
* feat(139): add custom upload part size option
* fix: missing right big quote
---------
Co-authored-by: Andy Hsu <i@nn.ci>
- Add support for remote and OneDrive storage types
- Implement new upload methods for different storage types
- Update driver to handle various storage policies
- Add error handling and session cleanup for failed uploads
* feat: support general users view and cancel own tasks
Add a creator attribute to the upload, copy and offline download
tasks, so that a GENERAL task creator can view and cancel them.
BREAKING CHANGE:
1. A new internal package `task` including the struct `TaskWithCreator`
which embeds `tache.Base` is created, and the past dependence on
`tache.Task` will all be transferred to dependence on this package.
2. The API `/admin/task` can now also be accessed via `/task`, and the
old endpoint is retained to ensure compatibility with legacy
automation scripts.
Closes#7398
* fix(deps): update github.com/xhofe/tache to v0.1.3
* add my_build.sh
* Fix OOM of thumbnail generation of LoaclDrive by using a task queue to control thread count
* remove my_build.sh
* chore(local): allow ThumbConcurrency set to zero
* revert(local): changes to thumbnail generating functions
* feat(local): implement static token bucket
* feat(local): use static token bucket to limit thumbnails generating concurrent
---------
Co-authored-by: KKJas <75424880+Muione@users.noreply.github.com>
- eliminating fixed 200 ms delay in getFiles to prevent thread starvation
- allowing cancellation via context to mitigate potential DoS attacks by immediately cancelling excessive requests
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: David Hao <akang943578@gmail.com>
Co-authored-by: Ke Wang <me@ke.wang>
* Fix: when S3 PutObject with objectName contains /, aliyundriveopen failed due to KeyNotFound, make dir to fix this.
(cherry picked from commit eb24f45771)
* Upgrade gofakes3 to v0.0.5, support AWS Signature V2
(cherry picked from commit 3218d7cf2c)
---------
Co-authored-by: David Hao <akang943578@gmail.com>
* add pikpak offline download function
* 完善PikPak离线下载功能
* 删除多余的代码
* add task cache to avoid too many requests about API
* 优化Status函数
* 完善所有功能,目前测试无BUG
* 减少缓存时间,优化添加离线任务的参数
* fix(drivers/iLanZou): resolve resource access issue on iLanZou driver mount
The driver failed to mount due to incorrect URL parameter ordering which the backend did not accept
This commit reorders the parameters to meet the backend's expectations
and ensures successful mounting of the iLanZou driver.
Closes#6271, Closes#6415
* fix(drivers/iLanZou): Fixed the error ID number returned when creating a folder
Closes#6610, Closes#6333
---------
Co-authored-by: maye174 <96584640+maye174@users.noreply.github.com>
* feat(mega): add support for two-factor authentication in Mega driver #6226
* feat(mega): remove debug print statement in Mega driver Init function
* feat(mega): add help message for new field
* fix(115): Support 115 302 redirect while getting link under (nested) alist_v3 remote
* chore: simplify logic
* chore: simplify logic
* use internal UA
* add option to set if the user want their ua be passed to upstream
In TestGetStorageVirtualFilesByPath() and TestGetBalancedStorage(), setupStorages() was being called twice, leading to a "UNIQUE constraint failed" error.
* fix(search): the problem of not returning in time when index does not support auto update.
* fix(search): the problem of duplicate indexing of folders.
* fix(quqi): error returned when uploading a file that existed
* fix empty download link for no vip user
* fix cannot parse request result
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* feat: add `quqi` driver
* change signature of request function
* specific header for every storage
* todo: real upload
* fix upload method
* fix incorrect parameters for some request function calls
* refine some form parameters to avoid potential problems
* fix file extension duplication in rename function
* improve the error message in login function
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* feat: add `quqi` driver
* change signature of request function
* specific header for every storage
* todo: real upload
* fix upload method
* fix incorrect parameters for some request function calls
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* fix(chaoxing):fix JSON parsing error in `content` field
* fix(chaoxing): optimizing `UnmarshalJSON` implementation
* fix(chaoxing): use `objectID` when is empty
* build: improve multistage docker build
* build: add dockerfile for ci
* build: add BuildDockerMultiplatform function in build.sh for ci
* ci: change build method
* build: add missing mod download command to the Dockerfile
* build: revert changes made ffmpeg installed
* build: use musl build for docker release
* ci: apply to dev version
* fix: don't login on pr
* fix: don't build_docker_with_aria2 on pr
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* Add support for client-side discoverable in begin login
Use `(*webauthn.WebAuthn).BeginDiscoverableLogin()` to handle client-side discoverable login.
* Upgrade github.com/go-webauthn/webauthn to v0.10.0
Upgrade [go-webauthn/webauthn](github.com/go-webauthn/webauthn) library to latest.
The convenient finish login function (as FinishDiscoverableLogin) for discoverable functions has been added in the v0.9.0. [^1]
---
[^1]: https://github.com/go-webauthn/webauthn/releases/tag/v0.9.0
* Add support for client-side discoverable in validating login
Use `(*webauthn.WebAuthn).FinishDiscoverableLogin()` to handle client-side discoverable login.
> **NOTE**:
- The first param `rawID` in this callback function is unnecessary to check, it's handled by the third-party webauthn library later.
- `userHandle` param is equal to the ID returned by (User).WebAuthnID() function.
* fix:123 driver connect error
* feat: calculate sign with pure go
---------
Co-authored-by: tangminghao <tangminghao@hxzn.com>
Co-authored-by: Andy Hsu <i@nn.ci>
* fix(aliyundrive_open):Mitigation measures for AliOpen's 15-minute limit.
I conducted small-scale tests, which seem to have no significant negative impact. If the 15-minute issue still occurs, further measures will be needed. Methods like local proxy can be attempted.
* chore(aliyundrive_open): change cache of the link to 1 minute
---------
Co-authored-by: Andy Hsu <i@nn.ci>
This update introduces the ability to mount 115 share links.
Currently, only listing and downloading are supported. Note that login and share link are required for this feature to work.
Close#5384
general: add createTime/updateTime support in webdav and some drivers
general: add hash support in some drivers
general: cross-storage rapid-upload support
general: enhance upload to avoid local temp file if possible
general: replace readseekcloser with File interface to speed upstream operations
feat(aliyun_open): same as above
feat(crypt): add hack for 139cloud
Close#4934Close#4819
baidu_netdisk needs to improve the upload code to support rapid-upload
* feat: support webauthn login
* manually merge
* fix: clear user cache after updating authn
* decrease db size of Authn
* change authn type to text
* simplify code structure
---------
Co-authored-by: Andy Hsu <i@nn.ci>
general: enhance multi-thread downloader with cancelable context, immediately stop all stream processes when canceled;
feat(crypt): improve stream closing;
general: fix the bug of downloading files becomes previewing stream on modern browsers;
Co-authored-by: Sean He <866155+seanhe26@users.noreply.github.com>
Co-authored-by: Andy Hsu <i@nn.ci>
this PR has several enhancements, fixes, and features:
- [x] Crypt: a transparent encryption driver. Anyone can easily, and safely store encrypted data on the remote storage provider. Consider your data is safely stored in the safe, and the storage provider can only see the safe, but not your data.
- [x] Optional: compatible with [Rclone Crypt](https://rclone.org/crypt/). More ways to manipulate the encrypted data.
- [x] directory and filename encryption
- [x] server-side encryption mode (server encrypts & decrypts all data, all data flows thru the server)
- [x] obfuscate sensitive information internally
- [x] introduced a server memory-cached multi-thread downloader.
- [x] Driver: **Quark** enabled this feature, faster load in any single thread scenario. e.g. media player directly playing from the link, now it's faster.
- [x] general improvement on HTTP/WebDAV stream processing & header handling & response handling
- [x] Driver: **Mega** driver support ranged http header
- [x] Driver: **Quark** fix bug of not closing HTTP request to Quark server while user end has closed connection to alist
## Crypt, a transparent Encrypt/Decrypt Driver. (Rclone Crypt compatible)
e.g.
Crypt mount path -> /vault
Crypt remote path -> /ali/encrypted
Aliyun mount paht -> /ali
when the user uploads a.jpg to /vault, the data will be encrypted and saved to /ali/encrypted/xxxxx. And when the user wants to access a.jpg, it's automatically decrypted, and the user can do anything with it.
Since it's Rclone Crypt compatible, users can download /ali/encrypted/xxxxx and decrypt it with rclone crypt tool. Or the user can mount this folder using rclone, then mount the decrypted folder in Linux...
NB. Some breaking changes is made to make it follow global standard, e.g. processing the HTTP header properly.
close#4679close#4827
Co-authored-by: Sean He <866155+seanhe26@users.noreply.github.com>
Co-authored-by: Andy Hsu <i@nn.ci>
* Determine whether the URL requires Sign
* Add File and Mem based KV
NOT TESTED: TokenKV Function
* Change Token KV func to common func.
Add File based KV func
* Remove KV, Remove Token
I found that the original Sign function is enough to complete the link signature, and only need to add simple configuration items to meet the requirements.
* Add IsStorageSigned func to judge if Signing is enabled in the storage settings.
It should be working now.
* Add a SIGN button to the management panel.
* Add enable_sign to the basic storage struct.
Can enable sign for every driver now.
Bug: When sign enabled, in download page, Copy link doesn't contain a sign.
(Not done yet)
* Fix a bug from commit 8f6c25f.
Response of fsread function does not contain sign.
* Optimize code and follow advices.
- Add back public/dist/README.md
- Enable sign when DownProxyUrl is enabled
- Merge needSign() to isEncrypt() in fsread.go
* simplify code
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* feat(drivers): new driver `urls` (close#3268)
* chore: rename
* support customize basic info or get from url
* dfs tree to calculate folder size
* go mod tidy
* add help message
* feat: add the support for Trainbit
read only
* feat: add the support for Trainbit
modify the structure of code
allow to create folder, move, rename and remove
* feat: add the support for Trainbit
allow to upload file
* feat: add the support for Trainbit
get token from page
* feat: add the support for Trainbit
display progress of updating
* feat: add the support for Trainbit
fix bug of time zone
* feat: add the support for Trainbit
fix the bug of filename
This is to enable the use case where the stock Docker image is used with
different flags. E.g. `docker run xhofe/alist:latest ./alist server --data=mydata`
This was the behavior until PR#2818 changed it. This would make the image more usable.
* feat & refactor(qbittorrent/client): support `deleteFiles` arg for `Client.Delete()` method
* feat(qbittorrent/client): also delete tags in `Client.Delete()`
from this commit, if you want reverse proxy to sub-directory like `alist` with `nginx`, you need config:
```nginx
location /alist/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_redirect off;
proxy_pass http://127.0.0.1:5244/alist/;
# the max size of file to upload
client_max_body_size 20000m;
}
```
* fix(qbittorrent): wait for qbittorrent to parse torrent and create task
#3413
* fix(qbittorrent): check task state correctly
* fix(qbittorrent): fix path sent to `op.Put()`
* feat(qbittorrent): authorization and logging in support
* feat(qbittorrent/client): support `AddFromLink`
* refactor(qbittorrent/client): check authorization when getting a new client
* feat(qbittorrent/client): support `GetInfo`
* test(qbittorrent/client): update test cases
* feat(qbittorrent): init qbittorrent client on bootstrap
* feat(qbittorrent): support setting webui url via gin
* feat(qbittorrent/client): support deleting
* feat(qbittorrent/client): parse `TorrentStatus` enum when unmarshalling json in `GetInfo()`
* feat(qbittorrent/client): support getting files by id
* feat(qbittorrent): support adding qbittorrent tasks via gin
* refactor(qbittorrent/client): return a `Client` interface in `New()` instead of `*client`
* refactor: task handle
* chore: fix typo
* chore: change path
---------
Co-authored-by: Andy Hsu <i@nn.ci>
* Update driver.go
* fix(Lanzou):files cannot be uploaded to the specified directory
Solve the problem that files cannot be uploaded to the specified directory
fix: The file size is exceeded and cannot be uploaded
fix: File name has special characters, signature fails
improve: optimize memory usage
Signed-off-by: aimuz <mr.imuz@gmail.com>
Signed-off-by: aimuz <mr.imuz@gmail.com>
* remove:"Endpoint" and "CustomHost" are the same thing, remove "CustomHost"
* fix: file download url error
* fix: too many file get list error
Co-authored-by: wangwuxuan <wangwuxuan@163.com>
* refactor:separate the setting method from the db package to the op package and add the cache
* refactor:separate the meta method from the db package to the op package
* fix:setting not load database data
* refactor:separate the user method from the db package to the op package
* refactor:remove user JoinPath error
* fix:op package user cache
* refactor:fs package list method
* fix:tile virtual paths (close#2743)
* Revert "refactor:remove user JoinPath error"
This reverts commit 4e20daaf9e.
* clean path directly may lead to unknown behavior
* fix: The path of the meta passed in must be prefix of reqPath
* chore: rename all virtualPath to mountPath
* fix: `getStoragesByPath` and `GetStorageVirtualFilesByPath`
is_sub_path:
/a/b isn't subpath of /a/bc
* fix: don't save setting if hook error
Co-authored-by: Noah Hsu <i@nn.ci>
* refactor:Prepare to remove the get interface
* feat:add obj Unwarp interface
* refactor:obj name mapping and program internal path processing
* chore: fix typo
* feat: unwrap get
* fix: no use op.Get to get parent id
* fix: set the path uniformly
Co-authored-by: Noah Hsu <i@nn.ci>
* feat: remove index on `SearchNode.Name`
As we do not use s% on name column, index there does not work
* fix: init index after init data
Or on the first run, it will log 'init index error: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...'
* fix: match parent more precisely
It will match `/a/bc` if we search in `/a/b` originally.
But it is not backward compatible by adding a suffix `/`
to all the data in parent field
* feat: ignore AList storage on indexing
* fix: remove unused err in `walkFn`
* chore(ci): fix auto_lang trigger and run it
* feat: batch index
* feat: quit index & init index
* feat: set DocType for bleve data
* fix: build index cleanup check origin err
* fix: delete set-cookie from sharepoint webdav response header
* fix: avoid two redirects when using webdav
* fix: return the correct Content-Type instead of just `application/octet-stream`
* feat: webdav backend localOnly -> proxyOnly
Currently if using aria2 to download a torrent file, it does not
consider seeding + active as completed, so the torrent download task
only completes as aria2 stops seeding.
This commit uses seeder property of TaskInfo, and mark tasks with active
status and true seeder as complete.
Thanks for taking the time to fill out this bug report, please **confirm that your issue is not a duplicate issue and not because of your operation or version issues**
感谢您花时间填写此错误报告,请**务必确认您的issue不是重复的且不是因为您的操作或版本问题**
- type:checkboxes
attributes:
label:Please make sure of the following things
description:You may select more than one, even select all.
description:|
You must check all the following, otherwise your issue may be closed directly. Or you can go to the [discussions](https://github.com/alist-org/alist/discussions)
- label:I have read the [documentation](https://alist.nn.ci).
- label:I'm sure there are no duplicate issues or discussions.
- label:I'm sure it's due to `alist` and not something else(such as `Dependencies` or `Operational`).
- label:I'm sure I'm using the latest version
- label:|
I have read the [documentation](https://alistgo.com).
我已经阅读了[文档](https://alistgo.com)。
- label:|
I'm sure there are no duplicate issues or discussions.
我确定没有重复的issue或讨论。
- label:|
I'm sure it's due to `AList` and not something else(such as [Network](https://alistgo.com/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
I'm sure this issue is not fixed in the latest version.
我确定这个问题在最新版本中没有被修复。
- type:input
id:version
attributes:
label:Alist Version / Alist 版本
description:What version of our software are you running?
placeholder:v2.0.0
label:AList Version / AList 版本
description:|
What version of our software are you running? Do not use `latest` or `master` as an answer.
您使用的是哪个版本的软件?请不要使用`latest`或`master`作为答案。
placeholder:v3.xx.xx
validations:
required:true
- type:input
id:driver
attributes:
label:Driver used / 使用的存储驱动
description:What storage driver are you using?
description:|
What storage driver are you using?
您使用的是哪个存储驱动?
placeholder:"for example: Onedrive"
validations:
required:true
@@ -43,8 +59,17 @@ body:
attributes:
label:Reproduction / 复现链接
description:|
Please provide a link to a repo that can reproduce the problem you ran into.
请提供能复现此问题的链接
Please provide a link to a repo that can reproduce the problem you ran into. Please be aware that your issue may be closed directly if you don't provide it.
请提供能复现此问题的链接,请知悉如果不提供它你的issue可能会被直接关闭。
validations:
required:true
- type:textarea
id:config
attributes:
label:Config / 配置
description:|
Please provide the configuration file of your `AList` application and take a screenshot of the relevant storage configuration. (hide privacy field)
Hello @${{ github.event.issue.user.login }}, this issue was closed due to inactive more than 60 days. You can reopen or recreate it if you think it should continue.
Hello @${{ github.event.issue.user.login }}, this issue was closed due to inactive more than 52 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again.
Hello @${{ github.event.issue.user.login }}, please input issue by template and add detail. Issues labeled by `question` will be closed if no activities in 7 days.
Hello @${{ github.event.issue.user.login }}, please input issue by template and add detail. Issues labeled by `question` will be closed if no activities in 3 days.
- [x] Web upload(Can allow visitors to upload), delete, mkdir, rename, move and copy
- [x] Offline download
- [x] Copy files between two storage
- [x] Multi-thread downloading acceleration for single-thread download/stream
## Document
<https://alist.nn.ci/>
<https://alistgo.com/>
## API Documentation (via Apifox):
<https://alist-public.apifox.cn/>
## Demo
<https://pan.nn.ci>
<https://al.nn.ci>
## Discussion
Please go to our [discussion forum](https://github.com/Xhofe/alist/discussions) for general questions, **issues are for bug reports and feature request only.**
Please go to our [discussion forum](https://github.com/alist-org/alist/discussions) for general questions, **issues are for bug reports and feature requests only.**
- [JetBrains: Essential tools for software developers and teams](https://www.jetbrains.com/)
## 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 forall the love and support:
https://alistgo.com/guide/sponsor.html
### Special sponsors
- [VidHub](https://apps.apple.com/app/apple-store/id1659622164?pt=118612019&ct=alist&mt=8) - An elegant cloud video player within the Apple ecosystem. Support for iPhone, iPad, Mac, and Apple TV.
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 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;
@@ -100,4 +143,4 @@ The `AList` is open-source software licensed under the AGPL-3.0 license.
- [VidHub](https://apps.apple.com/app/apple-store/id1659622164?pt=118612019&ct=alist&mt=8) - An elegant cloud video player within the Apple ecosystem. Support for iPhone, iPad, Mac, and Apple TV.
RootCmd.PersistentFlags().BoolVar(&flags.Dev,"dev",false,"start with dev mode")
RootCmd.PersistentFlags().BoolVar(&flags.ForceBinDir,"force-bin-dir",false,"Force to use the directory where the binary file is located as data directory")
RootCmd.PersistentFlags().BoolVar(&flags.LogStd,"log-std",false,"Force to log to std")
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.