Skip to content

Commit b0fde45

Browse files
authored
release(v3.0.0): storage adapter seam + source-aware core (Sources-ready)
- Display file size for items thumbnail view (closes #85) - add StorageAdapterInterface + LocalFsAdapter and StorageFactory/StorageRegistry - introduce SourceContext (active source, per-source upload/meta/trash roots, read-only gating) - make core file/folder ops source-aware (uploads, downloads, shares, trash, portals, OnlyOffice) - add cross-source copy/move for files + folders with guardrails and audit logging - add source selector UI + visible-sources API and propagate sourceId through UI flows - add minimizable transfer progress UI and toast severity styling - add Pro API-level gating + bundle installer refactor + one-click Pro bundle download/install
1 parent 9edc2c0 commit b0fde45

89 files changed

Lines changed: 13753 additions & 1800 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,136 @@
11
# Changelog
22

3+
## Changes 1/11/2025 (V3.0.0)
4+
5+
`release(v3.0.0): storage adapter seam + source-aware core (Sources-ready)`
6+
7+
- Display file size for items thumbnail view (closes #85)
8+
- add StorageAdapterInterface + LocalFsAdapter and StorageFactory/StorageRegistry
9+
- introduce SourceContext (active source, per-source upload/meta/trash roots, read-only gating)
10+
- make core file/folder ops source-aware (uploads, downloads, shares, trash, portals, OnlyOffice)
11+
- add cross-source copy/move for files + folders with guardrails and audit logging
12+
- add source selector UI + visible-sources API and propagate sourceId through UI flows
13+
- add minimizable transfer progress UI and toast severity styling
14+
- add Pro API-level gating + bundle installer refactor + one-click Pro bundle download/install
15+
16+
### v3.0.0 Highlights
17+
18+
- **Storage adapter seam** landed in core, enabling FileRise to operate against different backends through a consistent interface.
19+
- Core is now **source-aware end-to-end** (UI + API + backend), so Pro “Sources” can plug in cleanly while Core remains local-first by default.
20+
- Major **performance improvements** for folder trees and listings (especially in remote/large-tree scenarios).
21+
- **Cross-source copy/move** works for both files and folders with explicit guardrails.
22+
- New UX polish: **transfer progress card** + **toast severity styling**.
23+
24+
### Core architecture
25+
26+
**Storage adapter layer**
27+
28+
- Added a formal adapter interface and default local implementation:
29+
- `StorageAdapterInterface`
30+
- `LocalFsAdapter`
31+
- Added adapter orchestration:
32+
- `StorageFactory` to instantiate adapters for the active source
33+
- `StorageRegistry` to cache/reuse adapter instances
34+
- Added source/session plumbing:
35+
- `SourceContext` to resolve active source + per-source roots (upload/meta/trash) and carry read-only state
36+
- `ReadOnlyAdapter` wrapper to enforce read-only sources at the adapter boundary
37+
38+
**Outcome:** core file/folder operations no longer assume a single local filesystem root.
39+
40+
### Sources support (core plumbing + UI/APIs)
41+
42+
**UI**
43+
44+
- Added a **Sources selector manager** (`public/js/sourceManager.js`) and wired it into the main app bootstrap so the UI can:
45+
- load visible sources
46+
- persist/restore active selection
47+
- notify the rest of the UI on source changes
48+
49+
**APIs (core-side endpoints, Pro-gated at runtime)**
50+
51+
- Added/expanded source endpoints under `/api/pro/sources/`:
52+
- `visible.php` (what the current user can see/select)
53+
- `select.php` (set active source)
54+
- `list.php`, `save.php`, `delete.php` (admin management)
55+
- `test.php` (connection test action)
56+
57+
**Source-aware request threading**
58+
59+
- Threaded `sourceId` through many UI and API flows so reads/writes execute under the correct adapter context (including inactive dual-pane reads).
60+
61+
### File operations
62+
63+
**Cross-source copy/move**
64+
65+
- Implemented **cross-source file copy/move** (adapter → adapter) with safe fallbacks.
66+
- Implemented **cross-source folder copy/move** (recursive) with explicit guardrails:
67+
- `FR_XCOPY_MAX_FILES`
68+
- `FR_XCOPY_MAX_BYTES`
69+
- `FR_XCOPY_MAX_DEPTH`
70+
- Added safety rules:
71+
- block writes when destination is read-only
72+
- enforce scope/ACL/ownership rules consistently
73+
- block operations in encrypted folders when not supported by the active backend
74+
75+
**Transfers UX**
76+
77+
- Added a **global, minimizable transfer progress card** (`transferProgress.js`)
78+
- percent + speed where size is known
79+
- indeterminate progress where size is unknown
80+
- hooks wired into copy/move modals + drag/drop flows
81+
82+
### Uploads / Downloads / Streaming
83+
84+
**Uploads**
85+
86+
- Upload pipeline is now adapter-aware and source-aware.
87+
- Enforces read-only sources and other capability limits server-side.
88+
- Remote backends can be staged and written via adapter `writeStream()` when applicable.
89+
90+
**Downloads**
91+
92+
- Download streaming is adapter-aware (local vs remote) and supports Range behavior where possible:
93+
- `Accept-Ranges`, `Content-Range`, 206/416 handling
94+
- Shared link flows were updated to resolve files within the correct source context.
95+
96+
### Folder tree + listing performance
97+
98+
**Reduced fan-out and expensive probes**
99+
100+
- Added/expanded **shallow listing paths** to avoid accidental deep scans for huge remote trees.
101+
- Introduced optimizations to reduce per-entry stat calls when list results already provide enough metadata.
102+
- Kept the “large tree” goal intact (no regressions intended for very large folder counts).
103+
104+
### Search / Pro feature gating (core-side)
105+
106+
**Search Everywhere integration**
107+
108+
- Updated core wiring so Search Everywhere can operate in a **source-aware** manner (including “All sources” behavior when enabled).
109+
110+
**Pro gating by API level**
111+
112+
- Added/expanded **Pro API level** gating logic (`FR_PRO_API_LEVEL`) so features can be enabled/disabled safely without brittle version-string comparisons.
113+
114+
**Admin + maintenance plumbing**
115+
116+
- Expanded admin plumbing around Pro state, license fields, and feature availability.
117+
- Added/updated Pro bundle management wiring (including download/install paths) to support smoother Pro updates without breaking offline installs.
118+
119+
**UX polish**
120+
121+
- Toasts now support **severity/tone** (success / info / warning / error) and consistent styling.
122+
- Various UI flows updated to use the improved toast semantics.
123+
124+
**Notes / behavioral considerations**
125+
126+
- This release introduces a major internal architecture shift (adapter seam + source context).
127+
- Many endpoints now accept `sourceId` (optional in most cases; defaults to the current/legacy local behavior).
128+
- Remote backends may have feature limitations compared to local FS (e.g., ZIP/encryption-at-rest behaviors depending on backend support).
129+
130+
FileRise v3.0.0 is a major internal milestone: a new storage adapter seam + source-aware core that unlocks Pro “Sources” (multi-backend) while keeping Core local-first and fast. Expect continued iteration on adapter edge cases and remote performance tuning.
131+
132+
---
133+
3134
## Changes 1/2/2025 (v2.13.1)
4135

5136
`release(v2.13.1): harden Docker startup perms + explicit inline MIME mapping (see #79)`

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ RUN apt-get update && \
3939
apache2 \
4040
php php-json php-curl php-zip php-mbstring php-gd php-xml \
4141
ca-certificates curl git openssl \
42+
smbclient \
4243
clamav clamav-freshclam \
4344
&& apt-get clean && rm -rf /var/lib/apt/lists/*
4445

@@ -144,4 +145,4 @@ EXPOSE 80 443
144145
COPY start.sh /usr/local/bin/start.sh
145146
RUN chmod +x /usr/local/bin/start.sh
146147

147-
CMD ["/usr/local/bin/start.sh"]
148+
CMD ["/usr/local/bin/start.sh"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ Drag & drop uploads, OnlyOffice integration, and **optional folder-level encrypt
4646

4747
Full list of features: [Full Feature Wiki](https://github.com/error311/FileRise/wiki/Features)
4848

49-
![FileRise](https://raw.githubusercontent.com/error311/FileRise/master/resources/filerise-v2.9.0.png)
49+
![FileRise](https://raw.githubusercontent.com/error311/FileRise/master/resources/filerise-v3.0.0.png)
5050

51-
https://github.com/user-attachments/assets/87b06f1a-1400-4df1-bf1d-aaae88fcdfbd
51+
https://raw.githubusercontent.com/error311/FileRise/master/resources/FileRisePro-Sources.gif
5252

5353
> 💡 Looking for **FileRise Pro** (brandable header, **user groups**, **client upload portals**, license handling)?
5454
> Check out [filerise.net](https://filerise.net) – FileRise Core stays fully open-source (MIT).

config/config.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,55 @@ function fr_read_admin_config_raw(): array
518518
if (!defined('FR_PRO_BUNDLE_VERSION')) {
519519
define('FR_PRO_BUNDLE_VERSION', null);
520520
}
521+
522+
// ------------------------------------------------------------
523+
// Pro / Core API-level compatibility helpers
524+
// ------------------------------------------------------------
525+
526+
if (!defined('FR_CORE_API_LEVEL')) {
527+
define('FR_CORE_API_LEVEL', 1);
528+
}
529+
530+
if (!function_exists('fr_pro_api_level_from_version')) {
531+
function fr_pro_api_level_from_version(?string $version): int
532+
{
533+
$v = trim((string)$version);
534+
if ($v === '') return 0;
535+
$v = ltrim($v, "vV");
536+
$parts = explode('.', $v);
537+
$major = (isset($parts[0]) && ctype_digit($parts[0])) ? (int)$parts[0] : 0;
538+
$minor = (isset($parts[1]) && ctype_digit($parts[1])) ? (int)$parts[1] : 0;
539+
if ($major <= 0) return 0;
540+
if ($major === 1) {
541+
return max(0, $minor);
542+
}
543+
return ($major * 100) + max(0, $minor);
544+
}
545+
}
546+
547+
if (!defined('FR_PRO_API_LEVEL')) {
548+
define('FR_PRO_API_LEVEL', fr_pro_api_level_from_version(
549+
defined('FR_PRO_BUNDLE_VERSION') ? (string)FR_PRO_BUNDLE_VERSION : ''
550+
));
551+
}
552+
553+
if (!function_exists('fr_pro_api_level_at_least')) {
554+
function fr_pro_api_level_at_least(int $required): bool
555+
{
556+
$current = defined('FR_PRO_API_LEVEL') ? (int)FR_PRO_API_LEVEL : 0;
557+
return $current >= $required;
558+
}
559+
}
560+
561+
if (!defined('FR_PRO_API_REQUIRE_DISK_USAGE')) {
562+
define('FR_PRO_API_REQUIRE_DISK_USAGE', 2);
563+
}
564+
if (!defined('FR_PRO_API_REQUIRE_SEARCH')) {
565+
define('FR_PRO_API_REQUIRE_SEARCH', 3);
566+
}
567+
if (!defined('FR_PRO_API_REQUIRE_AUDIT')) {
568+
define('FR_PRO_API_REQUIRE_AUDIT', 4);
569+
}
570+
if (!defined('FR_PRO_API_REQUIRE_SOURCES')) {
571+
define('FR_PRO_API_REQUIRE_SOURCES', 5);
572+
}

0 commit comments

Comments
 (0)