Commit Graph

14737 Commits

Author SHA1 Message Date
Andras Bacsai 91f538e171 fix(server): handle limit edge case and IPv6 allowlist dedupe
Update server limit enforcement to re-enable force-disabled servers when the
team is at or under its limit (`<= 0` condition).

Improve allowlist validation and matching by:
- supporting IPv6 CIDR mask ranges up to `/128`
- adding IPv6-aware CIDR matching in `checkIPAgainstAllowlist`
- normalizing/deduplicating redundant allowlist entries before saving

Add feature tests for `ServerLimitCheckJob` covering under-limit, at-limit,
over-limit, and no-op scenarios.
2026-03-03 17:03:46 +01:00
Andras Bacsai fb186841f4 fix(auth): resolve 419 session errors with domain-based access and Cloudflare Tunnels (#8749) 2026-03-03 12:37:47 +01:00
Andras Bacsai 7aa495baa3 feat(subscription): add refunds and cancellation management (#8637) 2026-03-03 12:37:36 +01:00
Andras Bacsai 0320d6a5b6 chore: prepare for PR 2026-03-03 12:37:06 +01:00
Andras Bacsai d3b8d70f08 fix(subscription): harden quantity updates and proxy trust behavior
Centralize min/max server limits in Stripe quantity updates and wire them into
Livewire subscription actions with price preview/update handling.

Also improve host/proxy middleware behavior by trusting loopback hosts when FQDN
is set and auto-enabling secure session cookies for HTTPS requests behind
proxies when session.secure is unset.

Includes feature tests for loopback trust and secure cookie auto-detection.
2026-03-03 12:28:16 +01:00
Andras Bacsai 76ae720c36 feat(subscription): add Stripe server limit quantity adjustment flow
Introduce a new `UpdateSubscriptionQuantity` Stripe action to:
- preview prorated due-now and next-cycle recurring costs
- update subscription item quantity with proration invoicing
- revert quantity and void invoice when payment is not completed

Wire the flow into the Livewire subscription actions UI with a new adjust-limit modal,
price preview loading, and confirmation-based updates. Also refactor the subscription
management section layout and fix modal confirmation behavior for temporary 2FA bypass.

Add `Subscription::billingInterval()` helper and comprehensive Pest coverage for
quantity updates, preview calculations, failure/revert paths, and billing interval logic.
2026-03-03 12:24:13 +01:00
Andras Bacsai d569433a77 Merge remote-tracking branch 'origin/next' into subscription-refunds-cancellation 2026-03-03 12:24:10 +01:00
Andras Bacsai 1f1f2936e5 fix(service): ente photos join link doesn't work (#8727) 2026-03-03 11:56:15 +01:00
Andras Bacsai 66efcaf352 fix(service): cloudreve doesn't persist data across restarts (#8740) 2026-03-03 11:55:37 +01:00
Andras Bacsai 09b169a222 Merge remote-tracking branch 'origin/next' into subscription-refunds-cancellation 2026-03-03 11:52:58 +01:00
Andras Bacsai fad1b95578 fix(ssh): prevent RCE via SSH command injection (#8748) 2026-03-03 11:52:50 +01:00
Andras Bacsai 839635e9e8 chore: prepare for PR 2026-03-03 11:51:38 +01:00
Andras Bacsai db6229f815 Merge remote-tracking branch 'origin/next' into subscription-refunds-cancellation 2026-03-03 10:40:30 +01:00
Andras Bacsai 8a5ccd6323 fix(proxy): handle IPv6 CIDR notation in Docker network gateways (#8703) 2026-03-03 10:22:40 +01:00
Andras Bacsai 2ad7df2dea Merge remote-tracking branch 'origin/next' into 8649-parseaddr-bug 2026-03-03 10:21:59 +01:00
Andras Bacsai 338fa1b45b Fix: application rollback uses correct commit sha (#8576) 2026-03-03 09:51:32 +01:00
Andras Bacsai 7ae76ebc79 test(factories): add missing model factories for app test suite
Enable `HasFactory` on `Environment`, `Project`, `ScheduledTask`, and
`StandaloneDocker`, and add dedicated factories for related models to
stabilize feature/unit tests.

Also bump `visus/cuid2` to `^6.0` and refresh `composer.lock` with the
resulting dependency updates.
2026-03-03 09:50:05 +01:00
Andras Bacsai e1a7c64f37 Merge remote-tracking branch 'origin/next' into fix/rollback-uses-correct-commit 2026-03-03 09:22:43 +01:00
Andras Bacsai 02858c0892 test(rollback): verify shell metacharacter escaping in git commit parameter 2026-03-03 09:05:01 +01:00
Andras Bacsai d2744e0cff fix(database): handle PDO constant name change for PGSQL_ATTR_DISABLE_PREPARES
Support both the older PDO::PGSQL_ATTR_DISABLE_PREPARES and newer
Pdo\Pgsql::ATTR_DISABLE_PREPARES constant names to ensure compatibility
across different PHP versions.
2026-03-03 09:04:45 +01:00
Andras Bacsai e4fae68f0e docs(application): add comments explaining commit selection logic for rollback support
Add clarifying comments to the setGitImportSettings method explaining how the
commit selection works, including the fallback to git_commit_sha and that invalid
refs will cause failures on the remote server. This documents the behavior
introduced for proper rollback commit handling.

Also remove an extra blank line for minor code cleanup.
2026-03-03 08:54:58 +01:00
Andras Bacsai a71c16b17d Merge remote-tracking branch 'origin/next' into fix/rollback-uses-correct-commit 2026-03-03 08:51:22 +01:00
ShadowArcanist 9597bfb802 fix(service): cloudreve doesn't persist data across restarts 2026-03-03 11:20:40 +05:30
🏔️ Peak c328bd104f Merge branch 'next' into fix/ente-photos-join-album 2026-03-02 22:16:08 +01:00
🏔️ Peak 0560e021fb Merge branch 'v4.x' into next 2026-03-02 22:14:59 +01:00
Andras Bacsai 6f2be461f8 Merge branch 'next' into fix/ente-photos-join-album 2026-03-02 16:57:38 +01:00
Andras Bacsai 2dc0597562 test(rollback): use full-length git commit SHA values in test fixtures
Update test data to use complete 40-character git commit SHA hashes instead of abbreviated 12-character values.
2026-03-02 13:31:48 +01:00
Andras Bacsai 862ab607b7 Merge remote-tracking branch 'origin/next' into fix/rollback-uses-correct-commit 2026-03-02 12:53:14 +01:00
Andras Bacsai e436eeef91 feat(service): disable minio community edition (#8686) 2026-03-02 12:52:14 +01:00
Andras Bacsai 61366871ee Fix Grist service template (#8384) 2026-03-02 12:52:03 +01:00
Andras Bacsai e7fb4155cf feat(service): add Pydio cells (#8323) 2026-03-02 12:51:50 +01:00
Andras Bacsai b5d6e13b83 feat: add comment field to environment variables (#7269) 2026-03-02 12:37:14 +01:00
Andras Bacsai 1234463fca feat(models): add is_required to EnvironmentVariable fillable array
Add is_required field to the EnvironmentVariable model's fillable
array to allow mass assignment. Include comprehensive tests to verify
all fillable fields are properly configured for mass assignment.
2026-03-02 12:34:30 +01:00
Andras Bacsai 059164224c fix(bootstrap): add bounds check to extractBalancedBraceContent
Return null when startPos exceeds string length to prevent out-of-bounds
access. Add comprehensive test coverage for environment variable parsing
edge cases.
2026-03-02 12:24:40 +01:00
Felix Mönckemeyer ed9b9da249 fix: join link should be set correctly in the env variables 2026-03-02 12:00:19 +01:00
Andras Bacsai 236745ede1 chore: prepare for PR 2026-03-01 18:49:40 +01:00
Andras Bacsai 43412a1a2a Merge remote-tracking branch 'origin/next' into subscription-refunds-cancellation 2026-03-01 14:39:34 +01:00
Andras Bacsai 816c455c69 Merge remote-tracking branch 'origin/next' into fix/rollback-uses-correct-commit 2026-03-01 14:39:26 +01:00
Andras Bacsai 9b7e2e15b0 Merge remote-tracking branch 'origin/next' into env-var-descriptions 2026-03-01 14:39:23 +01:00
Andras Bacsai 9a4b4280be refactor(jobs): split task skip checks into critical and runtime phases
Move expensive runtime checks (service/application status) after cron
validation to avoid running them for tasks that aren't due. Critical
checks (orphans, infrastructure) remain in first phase.

Also fix database heading parameters to be built from the model.
2026-02-28 18:37:51 +01:00
Andras Bacsai 31555f9e8a fix(jobs): prevent non-due jobs firing on restart and enrich skip logs with resource links
- Refactor shouldRunNow() to only fire on first run (empty cache) if actually due by cron schedule, preventing spurious executions after cache loss or service restart
- Add enrichSkipLogsWithLinks() method to fetch and populate resource names and links for tasks, backups, and docker cleanup jobs in skip logs
- Update skip logs UI to display resource column with links to related resources, improving navigation and context
- Add fallback display when linked resources are deleted
- Expand tests to cover both restart scenarios: non-due jobs (should not fire) and due jobs (should fire)
2026-02-28 18:03:29 +01:00
Andras Bacsai 63be5928ab feat(scheduler): add pagination to skipped jobs and filter manager start events
- Implement pagination for skipped jobs display with 20 items per page
- Add pagination controls (previous/next buttons) to the scheduled jobs view
- Exclude ScheduledJobManager "started" events from run logs, keeping only "completed" events
- Add ShouldBeEncrypted interface to ScheduledTaskJob for secure queue handling
- Update log filtering to fetch 500 recent skips and slice for pagination
- Use Log facade instead of fully qualified class name
2026-02-28 16:23:58 +01:00
Andras Bacsai a0c177f6f2 feat(jobs): add queue delay resilience to scheduled job execution
Implement dedup key-based cron tracking to make scheduled jobs resilient to queue
delays. Even if a job is delayed by minutes, it will catch the missed cron window
by tracking previousRunDate in cache instead of relying on isDue() alone.

- Add dedupKey parameter to shouldRunNow() in ScheduledJobManager
  - When provided, uses getPreviousRunDate() + cache tracking for resilience
  - Falls back to isDue() for docker cleanups without dedup key
  - Prevents double-dispatch within same cron window

- Optimize ServerConnectionCheckJob dispatch
  - Skip SSH checks if Sentinel is healthy (enabled and live)
  - Reduces redundant checks when Sentinel heartbeat proves connectivity

- Remove hourly Sentinel update checks
  - Consolidate to daily CheckAndStartSentinelJob dispatch
  - Crash recovery handled by sentinelOutOfSync → ServerCheckJob flow

- Add logging for skipped database backups with context (backup_id, database_id, status)

- Refactor skip reason methods to accept server parameter, avoiding redundant queries

- Add comprehensive test suite for scheduling with various delay scenarios and timezones
2026-02-28 15:06:25 +01:00
ShadowArcanist 8c13ddf2c7 feat(service): disable minio community edition 2026-02-28 18:38:06 +05:30
Andras Bacsai f68793ed69 feat(jobs): optimize async job dispatches and enhance Stripe subscription sync
Reduce unnecessary job queue pressure and improve subscription sync reliability:

- Cache ServerStorageCheckJob dispatch to only trigger on disk percentage changes
- Rate-limit ConnectProxyToNetworksJob to maximum once per 10 minutes
- Add progress callback support to SyncStripeSubscriptionsJob for UI feedback
- Implement bulk fetching of valid Stripe subscription IDs for efficiency
- Detect and report resubscribed users (same email, different customer ID)
- Fix CleanupUnreachableServers query operator (>= 3 instead of = 3)
- Improve empty subId validation in PushServerUpdateJob
- Optimize relationship access by using properties instead of query methods
- Add comprehensive test coverage for all optimizations
2026-02-28 13:18:44 +01:00
Andras Bacsai d9e39ba211 Merge remote-tracking branch 'origin/next' into env-var-descriptions 2026-02-28 00:09:54 +01:00
Andras Bacsai a565fc3b36 fix(rollback): escape commit SHA to prevent shell injection
Properly escape commit SHA using escapeshellarg() before passing it
to shell commands. Add comprehensive tests for git commit rollback
scenarios including shallow clone, fallback behavior, and HEAD handling.
2026-02-27 23:26:31 +01:00
Andras Bacsai 530037c213 Merge remote-tracking branch 'origin/next' into fix/rollback-uses-correct-commit 2026-02-27 23:24:08 +01:00
Andras Bacsai 6b2a669cb9 docs(sponsors): add huge sponsors section and reorganize list
- Create new "Huge Sponsors" section with SerpAPI
- Move SerpAPI from Small Sponsors to Huge Sponsors
- Replace Dade2 with Darweb
- Add Greptile and MVPS as new sponsors
2026-02-27 22:03:54 +01:00
Andras Bacsai ce6859648a fix(ssh): automatically fix SSH directory permissions during upgrade (#8635) 2026-02-27 14:45:29 +01:00