Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 56 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,74 @@
# Changelog

All notable changes to Makhzan are documented here.
All notable changes to Storely are documented here.

## v0.7.0 - 2026-12-04

### Changed (breaking) - renamed from Makhzan

The package is now **Storely**. Behaviour, API shape and design are unchanged; every public name changed.

| Before (v0.6.0) | After (v0.7.0) |
| --- | --- |
| `elbanbydev/makhzan` | `elbanbydev/storely` |
| namespace `Makhzan\` | `Storely\` |
| `Makhzan` facade, `MakhzanServiceProvider` | `Storely`, `StorelyServiceProvider` |
| `MakhzanFile`, `MakhzanSpace`, `MakhzanFileLocation`, `MakhzanMove`, `MakhzanRoutingRule` | `StorelyFile`, `StorelySpace`, `StorelyFileLocation`, `StorelyMove`, `StorelyRoutingRule` |
| `MakhzanException` | `StorelyException` |
| `config/makhzan.php`, config key `makhzan.*` | `config/storely.php`, config key `storely.*` |
| `MAKHZAN_MAX_UPLOAD_BYTES`, `MAKHZAN_CAPACITY_WARNING_PERCENT`, `MAKHZAN_QUEUE`, `MAKHZAN_LOCAL_ROOT` | `STORELY_*` equivalents |
| publish tags `makhzan-config`, `makhzan-migrations` | `storely-config`, `storely-migrations` |
| tables `makhzan_spaces`, `makhzan_files`, `makhzan_file_locations`, `makhzan_moves`, `makhzan_routing_rules` | `storely_*` |
| commands `makhzan:usage`, `makhzan:health`, `makhzan:verify`, `makhzan:prune`, `makhzan:gc`, `makhzan:replicate` | `storely:*` |
| default local root `storage/app/makhzan` | `storage/app/storely` |

### Upgrading from v0.6.0

Nothing about how the package works changed, so the upgrade is mechanical. Do it in one deploy.

1. **Swap the package.** `composer remove elbanbydev/makhzan && composer require elbanbydev/storely:^0.7`
2. **Rename in your code.** `Makhzan\` -> `Storely\` everywhere (classes, events, exceptions, jobs), and the facade import `use Makhzan\Facades\Makhzan;` -> `use Storely\Facades\Storely;`. A find-and-replace on `Makhzan` -> `Storely` covers it.
3. **Config and env.** Rename `config/makhzan.php` to `config/storely.php` (or republish: `php artisan vendor:publish --tag=storely-config --force`) and change `config('makhzan.*')` calls to `config('storely.*')`. Rename the four `MAKHZAN_*` env vars to `STORELY_*` in `.env`.
4. **Rename the tables (keeps your data) and relabel the migration rows** so `php artisan migrate` treats the new migrations as already applied:

```sql
RENAME TABLE makhzan_spaces TO storely_spaces,
makhzan_files TO storely_files,
makhzan_file_locations TO storely_file_locations,
makhzan_moves TO storely_moves,
makhzan_routing_rules TO storely_routing_rules;

UPDATE migrations SET migration = REPLACE(migration, 'makhzan', 'storely')
WHERE migration LIKE '%makhzan%';
```

5. **Published migrations.** If you published the package migrations, delete the four `*_create_makhzan_*_table.php` files (the SQL above already relabelled their `migrations` rows, so the new `*_create_storely_*` files will not run).
6. **Local space files.** If you use `local` driver spaces, `mv storage/app/makhzan storage/app/storely`, or set `STORELY_LOCAL_ROOT=app/makhzan` to keep the old path.
7. **Drain the queue first.** Serialized `Makhzan\Jobs\MirrorFileJob` / `MoveLocationJob` payloads cannot be unserialized once the classes are gone. Let mirror and drain jobs finish before you deploy.
8. **Scheduler.** Point scheduled commands at `storely:*` instead of `makhzan:*`.
9. **Clear caches.** `php artisan config:clear && php artisan cache:clear`.

## v0.6.0 - 2026-12-03

### Added
- Restore: `Makhzan::restore($file)` undoes a soft delete; it throws when every copy is already gone. Restoring a live file is a no-op.
- `makhzan:replicate <from> <to>`: copies every file on one space to another, SHA-256 verified, source untouched; existing copies are skipped and failures are listed per file (non-zero exit when any fail).
- Restore: `Storely::restore($file)` undoes a soft delete; it throws when every copy is already gone. Restoring a live file is a no-op.
- `storely:replicate <from> <to>`: copies every file on one space to another, SHA-256 verified, source untouched; existing copies are skipped and failures are listed per file (non-zero exit when any fail).

### Docs
- Refreshed the package description (composer.json + GitHub) and the README (EN + AR) feature overview so the public face reflects everything through v0.6.0: routing rules, temporary URLs, integrity verification, lifecycle commands and replication.

## v0.5.0 - 2026-12-03

### Added
- Temporary URLs: `Makhzan::temporaryUrl($file, $minutes)` returns a short-lived signed URL from the first live copy whose driver supports it (new `SupportsTemporaryUrls` contract, implemented by the Flysystem/S3-family driver). Drivers that cannot sign are skipped; a failed signing attempt falls through to the next copy; minutes are clamped to 1..10080.
- Garbage collection: `makhzan:gc` removes location rows on deleted spaces and reports files left with zero copies; `--check-remote` also drops locations whose copy is confirmed gone from its space (unreachable spaces are kept), `--purge` deletes the empty file records, `--dry-run` reports only. Backed by `GcService` and `Makhzan::gc()`.
- Temporary URLs: `Storely::temporaryUrl($file, $minutes)` returns a short-lived signed URL from the first live copy whose driver supports it (new `SupportsTemporaryUrls` contract, implemented by the Flysystem/S3-family driver). Drivers that cannot sign are skipped; a failed signing attempt falls through to the next copy; minutes are clamped to 1..10080.
- Garbage collection: `storely:gc` removes location rows on deleted spaces and reports files left with zero copies; `--check-remote` also drops locations whose copy is confirmed gone from its space (unreachable spaces are kept), `--purge` deletes the empty file records, `--dry-run` reports only. Backed by `GcService` and `Storely::gc()`.

## v0.4.0 - 2026-12-03

### Added
- Routing rules: steer files to a space by category and optional size range. Active rules are evaluated by ascending priority and add their spaces to the write candidates before the plain fill order; a rule with an optional per-rule mirror; broken rules (missing/full/failing space) fall through. `RuleService` with validated create/update/delete, `Makhzan::rules()`, and `Makhzan::store(..., $category)`.
- File deletion: `Makhzan::delete()` soft-deletes a file (copies stay), `Makhzan::forceDelete()` removes every copy from its space before deleting the record.
- `makhzan:prune` command: force-deletes files soft-deleted longer than `--days` (default 30), with `--dry-run`.
- Routing rules: steer files to a space by category and optional size range. Active rules are evaluated by ascending priority and add their spaces to the write candidates before the plain fill order; a rule with an optional per-rule mirror; broken rules (missing/full/failing space) fall through. `RuleService` with validated create/update/delete, `Storely::rules()`, and `Storely::store(..., $category)`.
- File deletion: `Storely::delete()` soft-deletes a file (copies stay), `Storely::forceDelete()` removes every copy from its space before deleting the record.
- `storely:prune` command: force-deletes files soft-deleted longer than `--days` (default 30), with `--dry-run`.

## v0.3.1 - 2026-12-03

Expand All @@ -32,7 +78,7 @@ All notable changes to Makhzan are documented here.
## v0.3.0 - 2026-12-03

### Added
- `makhzan:verify` command: walks every recorded copy (optionally one space), checks it still exists on its space, refreshes `verified_at`, lists missing/unreachable copies and exits non-zero when any are found.
- `storely:verify` command: walks every recorded copy (optionally one space), checks it still exists on its space, refreshes `verified_at`, lists missing/unreachable copies and exits non-zero when any are found.

## v0.2.0 - 2026-12-03

Expand All @@ -47,4 +93,4 @@ All notable changes to Makhzan are documented here.
## v0.1.0 - 2026-12-03

### Added
- First public cut: storage spaces (local, R2, B2, generic S3, Google Drive, Telegram) with encrypted credentials, priority fill order, live health checks with test gating, automatic write/read failover, per-space usage with capacity warnings, mirroring, background drains, content-addressed dedup, `makhzan:health` and `makhzan:usage` commands, EN + AR docs.
- First public cut: storage spaces (local, R2, B2, generic S3, Google Drive, Telegram) with encrypted credentials, priority fill order, live health checks with test gating, automatic write/read failover, per-space usage with capacity warnings, mirroring, background drains, content-addressed dedup, `storely:health` and `storely:usage` commands, EN + AR docs.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ All three gates must pass before a PR. Add tests for every behavior change.

- `declare(strict_types=1)` in every PHP file.
- Credentials and secrets are never logged, serialized, or returned by the API.
- Driver errors are wrapped in `MakhzanException` with a message that never includes credentials or tokens.
- Driver errors are wrapped in `StorelyException` with a message that never includes credentials or tokens.
- Database changes come with a new migration; published migrations are never edited.

## Reporting security issues
Expand Down
Loading
Loading