📚 Encyclopedia

Servers & Hosting · updated 2026-11-23

Linode (Akamai) Object Storage

linodeakamais3object-storagecorssigv4presigned-urls

Linode Object Storage is S3-compatible bucket storage. Justin's account uses it for tldr uploads (private bucket tldr-uploads, Chicago) and for videos.jhampton.io (private bucket in Newark). The S3 API works with hand-rolled SigV4 signing (no AWS SDK); the reusable client is ~/dev/tldr/api/s3_client.php. The big trap is that the two generations of Linode endpoints support different features.

Endpoint generations: CORS is the dividing line

Keys are per bucket

Access keys are limited keys scoped to specific buckets. Creating a new bucket while using an existing key grants that key no access to it; make or update a key for the new bucket. The failure is confusing: with the bucket-scoped tldr key, the CreateBucket call itself returned 200, but every object PUT into the new bucket got 403, which cost an hour on the music app's cloud locker (July 2026). The workaround used there was a prefix (locker/) inside the existing tldr-uploads bucket, with a JSON catalog object (locker/catalog.json) as the index. Key files are kept on the desktop as ~/linode-<name>-object-storage-key.txt; server-side config files (e.g. s3_conf.php, videos_conf.php) hold them, gitignored and mode 640.

Browser-direct uploads (legacy endpoint)

API details worth knowing

Reusing the client in another app (Hunsley Hills Salon)

The hhs site reused tldr's SigV4 client verbatim (api/s3_client.php, with putObject, deleteObject, presignedGetUrl) against its own private Chicago bucket hhs-uploads, with credentials in a server-only api/s3_conf.php (gitignored, .example committed, excluded from the deploy's --delete). The API exposes POST /admin/uploads (multipart, type and size checked, random filename, a media table row for the picker) and a public GET /uploads/{filename} that streams bytes from the bucket with an immutable cache header. Storing the full public URL (https://api.<site>/uploads/<name>) in content keeps pages independent of the bucket. Images survive redeploys and server moves because they never live on the server. Uploads are resized on the way in, see Resizing uploaded photos on the server (PHP GD).

One-off bucket surgery without exposing keys

To overwrite or add objects outside the API (e.g. recompressing existing images): process the files locally, scp them plus a tiny PHP script to the server, and have the script require the server's s3_conf.php and s3_client.php and call putObject($name, $bytes, $mime). The credentials never leave the server.

Overwriting the same key keeps every stored URL valid, but anything already served with Cache-Control: immutable stays cached in returning browsers; only new or expired visitors get the new bytes. If a change must reach cached browsers, upload under a new key and update the reference.

Testing tip

When curling a URL taken from a JSON response, unescape \/ first (sed 's#\\/#/#g'); otherwise curl fails with "Port number was not a decimal" (status 000) and the route looks broken when it is not.

Backups

A nightly rclone mirror copies the buckets to the desktop (~/backups/object-storage, cron 3:45 am); see Backing up Linode Object Storage buckets with rclone.

See also

Linked from

Sources: global CLAUDE.md (Linode Object Storage), justinahampton memory (videos-subdomain-plan, videos-rotation-and-api, headless-chrome-test-gotchas), tldr memory, hunsley memory (hhs-cms, hhs-deployment), justinahampton memory (videos-drop-links)