GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Multi S3 storage support by veenone · Pull Request #1839 · projectsend/projectsend

Conversation

@veenone

@veenone veenone commented Nov 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

ProjectSend can use one external bucket today, for everyone or for nobody. This PR turns that single bucket into a list of storage locations and lets an administrator decide, per client, which of them that client's uploads go to.

Preview

Settings → Storage, with the server's disk and three buckets. One is the default, one has stopped taking uploads and still serves its files.

Storage settings listing four locations with the default and upload status of each

Adding a location opens a side sheet with the name and note clients will see, the provider, the credentials and the same connection test as before.

The Add location side sheet

On the client's account page, locations are assigned in priority order. The first is preselected on their upload screen.

Storage locations card on a client account with two locations in priority order

What the client sees when uploading with more than one location.

Client upload screen with a Store in choice between two locations

The staff Files list gains a Location filter when there is more than one location.

Files list with the Location filter open

What this adds

Storage locations instead of one bucket

Settings → Storage now lists every place uploaded files can live: the server's own disk, plus any number of S3-compatible or Google Cloud Storage buckets. Exactly one location is the default for new uploads. Each location has a name and an optional note, written for clients; they never see a bucket name or an endpoint.

Locations are added and edited in a side sheet with the same connection test as before. Secrets are encrypted at rest and never sent back to the browser. Three rules keep files reachable:

  • A location that still holds files cannot be removed. It can stop accepting new uploads, and everything already in it keeps downloading.
  • The default location cannot stop accepting uploads and cannot be removed until another default is chosen.
  • The server's own disk is always present and cannot be removed.

Locations per client

On a client's account page, someone with the edit-settings permission can give the client one or more locations, in priority order. The client's uploads go to the first one. When a client has more than one, the upload screen offers the choice; the choice locks while a batch is uploading so every file in the batch lands in the same place. Staff, and clients with no locations of their own, keep uploading to the default.

The server checks the chosen location against the client's own list when the upload session is created, so a client cannot write into a bucket nobody gave them. The check happens before any bytes are sent, where a validation error can still reach the screen.

Smaller changes

  • The staff Files list can be filtered by location. The filter appears only when there is more than one.
  • The email telling staff that a client uploaded a file can name the location it went to. A new setting controls this and it is off by default.
  • The orphan scanner looks in every registered bucket, including ones that no longer accept uploads, since files can be left there from when they did.
  • The container durability warning now looks at the default location rather than at whether external storage is on.

Upgrading

Existing files stay where they are. The migration creates the storage_locations table, inserts the server's disk, and copies the current bucket as a location on its old disk name, files_external, so every file already stamped with that disk keeps resolving. If "Use external storage for new uploads" was on, the bucket becomes the default; otherwise the server's disk does.

Boot happens before artisan migrate, so until the migration has run the old settings row is read exactly as before. The migration clears the boot cache at the end, so the carried-over bucket is registered on the next request. The old external_storage_settings table is left in place for an install that rolls back; nothing writes to it any more.

Files never move when assignments change. Only new uploads follow the new settings.

How it is built

  • StorageLocation is the new model, with storage_locations and the client_storage_location pivot carrying a priority. upload_sessions gains a nullable storage_location_id.
  • ExternalStorageConfigApplier registers one Laravel disk per configured bucket instead of overriding the single files_external stub. The cache key moves to v5 and holds a list.
  • UploadLocations decides the disk for a new upload: the client's own list filtered to usable locations, or the default. ResolvingUploadDisk carries the requested location id as a hint, and UploadLocations honours it only if it belongs to the uploader.
  • The controller and its tests keep their existing names, ExternalStorageSettingsController and ExternalStorageSettingsTest, so the diff shows them as edits rather than a delete and an add.
  • New strings are translated in all 16 locales.

Other ways to handle the same cases

  • One bucket with a folder per client, rather than separate locations. A location here is a bucket plus an optional folder inside it, and each location gets its own generated disk name, so an installation that wants one bucket can add it more than once with a different folder each time. Separate rows were chosen so that credentials, regions and endpoints can differ, which a prefix alone cannot give.
  • Moving a client's existing files when their locations change. Rejected: it would copy files between providers, and a copy that fails halfway leaves a file in two places or in none. Files stay put and new uploads follow the settings.
  • Assigning locations to groups and to staff. Left for the follow-up below so this PR stays reviewable.

Additional Follow up

I will submit a second PR, stacked on this one, lets locations be assigned to client groups and to staff, with a "Used by" breakdown on the storage screen. I will open it once this one is in, or now as a draft if reviewing them together is easier.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@veenone
veenone force-pushed the pr/storage-locations branch from c208867 to 7ca938e Compare November 21, 2026 01:59
@veenone veenone changed the title Keep uploads in several storage locations, chosen per client Multi S3 storage support Nov 21, 2026
@veenone

veenone commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

veenone added 9 commits November 26, 2026 07:43
@veenone
Keep uploads in several storage locations, chosen per client
af7f923
The single external bucket under Settings → Storage becomes a list of
storage locations: the server's own disk plus any number of S3 or Google
Cloud buckets, one of them the default. A client can be given one or more
of them in priority order; their uploads go to the first, or to another
of their own they pick on the upload screen. Staff, and clients with none
assigned, keep using the default.

The existing bucket is carried over on its old disk name, so files already
in it keep resolving, and until the migration has run the old settings row
is read exactly as before. A location that still holds files cannot be
removed, only stopped from taking new uploads. The choice on the upload
screen locks while a batch is uploading, the staff Files list can be
filtered by location, and the client-upload email can name the location
(off by default).

The external storage tests move to StorageLocationsTest with every old
guarantee kept, and the new strings are translated in all 16 locales.
@veenone
Trim the storage locations code back to what it needs
726a12d
Keep the applier in upstream's shape (apply per location, applyS3/applyGcs,
resolve) so its comments survive, drop helpers only one caller used
(writableDisks, defaultIsExternal, externalProvider, the unused
acceptingUploads scope) and the legacy cache key nobody reads. The
controller keeps upstream's explanatory comments on validation and the
connection test. The migration no longer guards columns earlier
migrations always create. Drop three strings: the impossible empty table
message, the default-location fallback, and 'Save location' where
'Save' says the same.
@veenone
Fold duplicate storage location tests together
dfb49b1
Restore the wording of the tests carried over from upstream's external
storage suite, merge the default-disk pair, the migration on/off pair and
the removal pair, and fold the pre-migration read into the two legacy
tests that already cover it.
@veenone
Fold three more storage location tests into the ones beside them
3a0fbaf
The follows-the-default client and the staff-ignore-the-pick case join
the resolution tests they sit next to, and refusing a closed default
joins the test that moves the default.
@veenone
Keep the storage settings controller and its tests under their old names
ee3c83a
Settings → Storage is still served by ExternalStorageSettingsController and
tested by ExternalStorageSettingsTest, as ExternalStorageConfigApplier
already kept its name. The diff then shows what changed in each instead
of a deleted file and a new one.
@veenone
Keep more of upstream's wording in the storage applier and upload event
f2c7f71
Pass GCS only the location id it needs, restore the credential docblock
and the upload event's comment where they still hold, and leave the
interface field order and one test assertion as upstream had them.
@veenone
Drop a history note from the StorageLocation docblock
4d7da20
@veenone
Forget the cached storage list at the end of the storage locations mi…
add69d6
…gration

The migrate process boots against the old schema and caches the legacy
bucket (or nothing, when it was switched off) under the new storage
locations key. Nothing cleared it afterwards, so a migrated bucket that
had been switched off stayed unregistered until someone saved the
storage settings. Also name the local disk by its constant in
StorageDurability and fix a cache comment that no longer held.
@veenone
Test the pre-migration read with a full-schema row again
d991807
Restore the test that boots a 2.2+ external storage row before the
storage locations migration, add one for the cache the migration leaves
behind, and reword two test names that described the old on/off switch.
@veenone
veenone force-pushed the pr/storage-locations branch from 7ca938e to d991807 Compare November 26, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@veenone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.