Search by

mirror-and-mountain / aeris-foundations

tmw-dev

Extensible Laravel foundations for the Aeris site management portal.

Package info

github.com/mirror-and-mountain/aeris-foundations

pkg:composer/mirror-and-mountain/aeris-foundations

Statistics

Installs: 9

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.2.0 2026-12-02 18:00 UTC

This package is auto-updated.

Last update: 2026-12-04 11:30:01 UTC


README

The reusable Laravel package behind Aeris, namespaced MM\Aeris. Requires PHP 8.3+ and Laravel 13. Install through mirror-and-mountain/aeris for a ready application, or add this package to an existing Laravel application.

Installation

composer require mirror-and-mountain/aeris-foundations:^1.0
php artisan vendor:publish --tag=aeris-config
php artisan vendor:publish --tag=aeris-assets
php artisan migrate
php artisan aeris:portal-user

For local development, use a Composer path repository pointing at this directory and assign its development version 1.0.0.

The service provider is auto-discovered. It registers namespaced views, authenticated routes, Livewire components, console commands and the hourly managed-SSH-key rotation schedule. Run Laravel's queue worker and scheduler. The host must configure a persistent application key and writable storage.

The package owns the users, portal_users, sessions and related Aeris tables. Remove conflicting default create-users/session migrations from a new host before migrating. Keep the host's queue/cache migrations. This is a fresh v1 schema, not an upgrade path for the former portal.

Both account types share one database but have separate web and management guards. Existing hosts must reserve these guards and the package's route paths. Do not install over an unrelated application's user schema without adapting it.

Publishable tags: aeris-config, aeris-copy, aeris-views, aeris-assets. Republish assets when upgrading. Browser dependencies are bundled and shipped in public/; operators do not need Node. Maintainers run npm ci && npm run build before releasing and commit the generated editor bundle and its license notices.

Application configuration

Set AERIS_NAME (default Aeris) and APP_URL in the host .env. Saved branding in portal settings overrides the initial name. See config/aeris.php and the starter's .env.example for feature flags.

Optional Portal support email and Portal support link fields in Portal settings add contacts to user-facing operation errors. Supply either, both, or neither; support links must use HTTP or HTTPS. With neither, users are directed to their portal administrator. Site pages show dismissible error notices; organization users see plain-language messages, while portal operators retain diagnostic details. Queue retry failures are shown immediately, and progress indicators resume when monitoring succeeds. Red delete icons in the environment action bars open deletion confirmation. Development's icon is disabled until its other environments are removed. Deletion has a busy indicator and duplicate-submit protection. Confirmed environment deletion returns to the site page, including when updating the remaining environment settings needs attention.

Register at least one worker in the portal before provisioning sites. Organization sites also require a worker assignment. Existing sites without an assigned worker remain in the portal but cannot be operated until their placement is resolved. Check a registered connection with php artisan aeris:worker-check <worker-id>. Bundled workers use individually managed TLS identities; manually registered workers use the system trust store.

On a new portal without a worker, the management dashboard offers an optional setup guide. It explains worker connections and optional Cloudflare domains; skipping it changes neither configuration. Reopen it from portal settings. Organization sites still require an assigned worker, and localhost addresses are only accessible from the worker host unless separate routing is configured. Portal users are managed on dedicated create, edit and delete pages; a signed-in super admin cannot delete or demote their own account.

Contextual help and interface copy

Question-mark buttons on page, card and section headings open the same right-side help drawer. Each topic has its own Blade view below resources/views/guides/. Explanatory help is kept there instead of in the form; live status, required action data, errors and destructive/security warnings remain visible inline. The drawer supports keyboard focus containment, Escape, backdrop dismissal, focus restoration and reduced motion. Opening help never submits a form.

All page headings, labels, buttons, descriptions and help prose resolve through config/aeris-copy.php, grouped by page/subpage slug. Publish just this file with php artisan vendor:publish --tag=aeris-copy, or publish it alongside the other configuration with --tag=aeris-config. The host may keep only changed keys: nested overrides merge recursively with package defaults.

For example, the host's config/aeris-copy.php can return:

return [
    'integrations' => [
        'cloudflare' => [
            'text-cloudflare-account' => 'Your Cloudflare account',
        ],
    ],
];

In views, use @copy('page.element', ['name' => $value]); PHP callers use \MM\Aeris\Support\Copy::text(...). Named placeholders such as :name keep dynamic values out of the config. Copy is plain text and escaped by Blade; keep markup and links in views. Missing or non-string keys raise explicit configuration errors. Provider responses, diagnostic errors and stored record values are not replaced by editable display copy.

To add a topic, create guides/your-page/topic.blade.php and include aeris::guides.trigger inside its heading, passing guide => 'your-page.topic' and the heading's resolved title. Put guide prose in that page's copy keys. Only include authorized content; the guide is rendered into an inert template on the current page, without another request. Published view overrides live in resources/views/vendor/aeris/guides/.

Extension-field labels and descriptions can be overridden at aeris-copy.forms.<form>.<operation>.<field>.label and .description; existing aeris.forms labels/help remain their defaults. Rebuild cached configuration with php artisan config:cache after changing host copy when configuration is cached. Republish assets when upgrading; no migration is needed for help or copy.

Site and WordPress admin links for public HTTPS addresses appear when the environment is ready and confirmed. Localhost links are hidden by default; set AERIS_ALLOW_LOCAL_SITE_LINKS=true only when portal users access the site from the worker host. localhost refers to each user's browser host, not necessarily the worker. Restart or reload cached configuration after changing it.

New sites use http://localhost:<port> unless their worker is explicitly assigned to the configured and enabled Cloudflare Domains & Tunnels service. Local-only workers do not need cloudflared. On Cloudflare workers, vanity addresses are always the default; organizations can subsequently connect a verified custom domain and use Change site address. Changing a worker's addressing setting does not silently rewrite existing site addresses.

New staging and production environments show their generated vanity address when automatic domains are enabled, or a localhost label otherwise (the worker assigns the port during creation). The address is read-only unless vanity domains and unused, verified organization domains are both available; then a dropdown offers those choices. Custom addresses still require separate DNS and routing setup. Submitted custom addresses are checked against the current choices and their DNS ownership challenge before provisioning.

Super administrators configure Cloudflare's Domains and tunnels and Backup storage independently under Settings / Integrations. Settings also has General settings and Features tabs. Either Cloudflare feature can be used on its own; R2 storage does not require a zone, vanity address or tunnel.

First enter the Account ID and API token, choose Test connection, then Connect after both account access checks pass. These read-only checks verify tunnel and R2 access; they do not prove write permissions or create resources. Verification is bound to the exact credentials and expires after five minutes. Saved credentials become read-only and are never displayed. To replace them, choose Disconnect and confirm. Disconnect removes all local Cloudflare configuration but never deletes provider resources. Managed domains, tunnels and native R2 backup references must be removed first so credentials are not lost. Existing saved account configurations remain connected when upgrading.

Enable R2 on the Cloudflare account before testing the connection. Scope the API token to that account and the intended zone, with Account / Cloudflare Tunnel / Edit, Account / Workers R2 Storage / Edit, Zone / Zone / Read and Zone / DNS / Edit. Custom domains additionally require Zone / SSL and Certificates / Edit and Cloudflare for SaaS enabled on the zone. Supply the token value, not its ID. R2 object access uses separate Object Read & Write S3 credentials, preferably scoped to the backup bucket.

The Cloudflare integration derives vanity hostnames directly from the selected zone, verified using an API token with Zone / Zone / Read permission. For a site named theme in example.com, development uses theme-dev.example.com, staging uses theme-stage.example.com, and production uses theme.example.com. There is no optional site subdomain or editable site base. These single-label hosts can use the zone's active Universal SSL wildcard certificate without Advanced Certificate Manager. Legacy saved bases are ignored for new hostname generation; legacy configurations without a verified zone name must test and save their Zone ID first. Retesting or saving domain settings normalizes the default base to the zone but does not rename existing WordPress sites, DNS records or tunnel routes. Existing addresses require an explicit cutover or deleting/recreating the site. Each service has its own form and save action. Enter its configuration, choose Test and save configuration, then enable it and save that service's settings. Testing a new service leaves it disabled. Changed configuration must pass testing again; saving one service never changes the other. Domains testing verifies the Zone ID against the connected account. Enabling it makes Cloudflare addressing available for worker assignment; no per-site automatic-provisioning preference is needed. It cannot be disabled while workers are assigned or managed addresses depend on it. The Zone ID is read-only while worker connections, managed tunnels/routes, custom hostnames or current/pending site addresses depend on it. The server rejects zone changes in both test and save requests, including legacy site addresses without route inventory. Retesting the existing zone remains available. Organizations can add custom domains only while the connected Domains & Tunnels service is enabled. Otherwise the add-domain form is hidden and direct requests are rejected; existing claims remain available for inspection and removal.

The Cloudflare page lists registered workers, explicit local-only/Cloudflare addressing modes, saved cloudflared checks, operational readiness and managed tunnel state. Test compatibility contacts the worker without changing Cloudflare. Installing cloudflared on the host can make an incompatible worker compatible after retesting; creating a tunnel does not install the binary. Observations are stored against the worker, become unknown after five minutes, and are invalidated when its connection credentials change. Failed checks are unknown, not a confirmed missing installation. Use the worker row's test icon for Test compatibility. After a successful check, open Change addressing mode using the settings icon, select Cloudflare (vanity and custom domains) and Save addressing mode to create or verify its managed tunnel and running connector. Compatibility alone is not operational readiness: the recent check must identify the running connector for the correct account, zone and tunnel. Setup uses the existing duplicate-safe provisioning flow and retains uncertain reservations. Site creation shows the selected worker's actual addressing policy; local workers are not misleadingly checked for cloudflared. Public provisioning checks the live worker again and never silently falls back to localhost. Apply the worker-assignment migration when upgrading: new workers default to local-only, while existing managed-deployment workers retain Cloudflare assignment. The mode dialog explains the impact on existing environments: their addresses are never rewritten, and local-only mode is blocked while public routing is in use.

Install cloudflared on each worker once. Automatic vanity provisioning then creates and starts its worker's managed tunnel when needed; manual tunnel creation is not required. The integration screen shows worker tunnel status without manual tunnel, connector or route controls. If creation cannot be confirmed, inspect Cloudflare and resolve the existing reservation rather than creating another.

Organization Domains handles domain registration and ownership verification; address selection and connection setup belong to each environment's Change site address section. Verified unused domains appear there with Set up domain. The modal opens without contacting Cloudflare. Confirm Set up domain inside it to prepare routing without changing WordPress and save the additional DNS records. Add the records and run Check DNS and certificate in that modal. Once the checks pass, close it and choose Change address on the environment card. Open DNS setup reopens the saved instructions without leaving the site page; they also remain available in Organization Domains for inspection. Checks read the existing Cloudflare resource; they never delete or recreate it. Moving a prepared domain to another environment requires explicit confirmation because replacement restarts certificate validation and changes its DNS challenges. A routing mismatch on the same environment is reported rather than silently replacing the connection. Add all displayed TXT values as separate records, including values sharing the same name. DNS-only CNAME records or matching flattened A/AAAA records are checked against the configured target.

Custom addresses cannot be activated until both the provider hostname and certificate are active and DNS points to the expected target. The portal checks again immediately before changing WordPress, and the user confirms the new hostname by typing it. No manual routing checkbox is required. Default addresses remain available for switching back. Address controls stay visible but disabled while a site task holds their reservation, and are hidden when there is no alternative address. Domains currently or pending use cannot be removed: switch the environment back to its default first, then remove the domain from organization settings. Unused managed resources are cleaned up through the existing guarded lifecycle before registration is removed. Prepared custom domains use the environment's vanity hostname as their Cloudflare custom origin, so the vanity route must remain until those domains are removed. Hosting details remain available on site pages, but routine per-site vanity repair/removal controls are no longer shown. Routing is lifecycle-managed; the Cloudflare integration page exposes worker compatibility checks and addressing mode selection, not manual tunnel or route management. The disconnect dialog offers a regular, non-destructive disconnect and Disconnect and clean up. Cleanup requires typed confirmation and is blocked while site addresses, portal routes, pending site work, migrations or native R2 backups still depend on the connection. It deletes only recorded Aeris-owned custom hostnames, DNS records and tunnels using their ownership-checked lifecycle services. Buckets, objects, organization domain registrations and customer-managed DNS are never deleted. Cleanup pauses new domain provisioning; partial or uncertain failures retain credentials and remaining reservations for inspection. Resolve the reported resource before retrying cleanup. Successful cleanup also clears affected workers' Cloudflare assignments. Deleting a site or environment automatically removes its prepared custom hostnames, owned vanity DNS and tunnel ingress before deleting worker data. Foreign DNS is never adopted or deleted. Organization domain verification, customer-managed DNS and the shared worker tunnel are retained.

Page updates, errors and success messages share one notification area. Error details use the shared dialog and configured support contacts; runtime messages are configurable in aeris-copy.php. A single site activity panel groups related backup, sync, restore and clone work and retains the latest completed status. Completed activity can be dismissed for the current browser tab, including across refreshes. New activity appears again; active or unresolved work cannot be dismissed. Activity history is not deleted. Operators can pause repeated recovery retries without deleting data or releasing reservations, then use the existing inspected resume/release controls. Pausing monitoring does not cancel work already running on a worker. Reload queue consumers after deploying code changes so retries use the current service implementations. Cleanup failures keep resource reservations and leave ordinary deletion available for safe retry; an uncertain worker deletion instead stays fenced for inspection. A process interrupted during cleanup also requires operator inspection. To deprovision a worker, first move or delete the environments using its public addresses, switch its addressing to local-only, and then stop/remove the unused shared tunnel. Only after dependencies are gone can the service be disabled or the connection disconnected; retained R2 backups separately protect their keys. Managed tunnel deletion also clears the disabled connector on its worker after Cloudflare confirms deletion. Upgrade the worker alongside the portal to support this operation. Unconfirmed connector operations and deletions retain their reservations; stop the original request and inspect the worker and Cloudflare before using the corresponding recovery action.

Synchronization uses a portal-managed automation key. Authorized portal administrators can rotate it from the site's hosting details without changing the SSH access state. Syncs automatically enable SSH temporarily if needed; the worker restores its original state afterward.

Site managers can add a new WordPress administrator to a running environment from its site page. The account is created only in that environment, and an existing username or email is never changed. The portal does not store or email the initial password; share it securely. If creation cannot be confirmed, check WordPress before retrying. Upgrade the worker alongside the portal to use this feature.

Hosted access requires a canonical HTTPS origin, APP_DEBUG=false, secure HTTP-only cookies and explicitly trusted reverse proxies where applicable. The starter provides this bootstrap. For another host, replace Laravel's global Illuminate\Http\Middleware\TrustProxies with MM\Aeris\Http\Middleware\TrustPortalProxies; never configure wildcard trust. The same middleware must apply to the Livewire update endpoint.

Extending account and organization forms

Add your own application migration with the extra columns, then publish config/aeris.php and declare fields under forms.portal_user, forms.user or forms.organization:

'forms' => [
    'portal_user' => [],
    'user' => [
        'telephone' => [
            'label' => 'Telephone',
            'type' => 'text',
            'rules' => ['nullable', 'string', 'max:40'],
            'help' => 'Optional contact number.',
        ],
    ],
    'organization' => [
        'billing_reference' => [
            'label' => 'Billing reference',
            'type' => 'text',
            'rules' => ['required', 'string', 'max:80'],
            'realms' => ['portal'],
        ],
    ],
],

Fields render and validate on supported create/edit forms, including account profiles, invitations, administrative user creation, organization-owner forms and Livewire organization creation. Portal-user creation also prompts for these fields in aeris:portal-user. Only configured, validated fields are persisted, in the same transaction as core changes; custom fields need not be mass assignable. Existing authorization and password-confirmation rules still apply.

Options:

  • type: text (default), email, number, date, textarea, select, checkbox.
  • options: value-to-label mapping for selects.
  • default, help: initial value and descriptive text.
  • operations: ['create', 'update'] by default; limit to either operation.
  • realms: ['portal', 'user'] by default. Restrict administrative-only fields to ['portal']; hidden fields are also excluded from validation/persistence.
  • create_rules / update_rules: override rules for an operation.
  • view: optional Blade partial receiving field, name, value and id. Livewire custom controls must bind to extensionFields.<name>.

Use scalar arrays and Laravel rule strings or rule class names so configuration can be cached. Do not put closures into configuration. Core fields such as roles, MFA, verification, ownership IDs and limits cannot be registered as extensions. Unknown submitted fields are ignored. Defaults are display defaults; database defaults/nullability must cover account creation outside these forms (for example OAuth/onboarding), and fields restricted to a different realm.

For custom behavior/casts, extend the package models and configure:

'models' => [
    'portal_user' => App\Models\PortalUser::class,
    'user' => App\Models\User::class,
    'organization' => App\Models\Organization::class,
],

Each class must extend its matching MM\Aeris\Models base class. Table names, relationships, authentication, user factories and implicit organization route binding retain the configured subclasses. Do not change their table/key names or database connection: Aeris uses one database.

Worker status and remote updates

The worker list uses the sites-style table: select a worker name for its detail page, connection checks, edit/removal and existing Cloudflare actions. The list is paginated (50 workers) and performs no worker or GitHub API calls. Installed version is the last authenticated /v1/worker observation, never the source tag used to build a bundle. New registrations show unknown/never checked. Checks older than five minutes show unknown/stale; a failed check shows offline/check failed, not proof that the host itself is down. Check and last-reachable times use relative human-readable text, with exact time/timezone in hover titles and machine-readable <time> attributes. Existing site status badges distinguish healthy, unavailable, unknown and update-uncertain states. Changing the endpoint/token invalidates previous observations.

Use Test connection / refresh status on a worker detail page to check one worker. Its identity and, when supported, update status each have a five-second deadline. Background monitoring performs the same checks automatically, without page-load fanout across all workers. During an accepted/running/unconfirmed update the list shows connection uncertainty; API loss during restart does not mean success. The list reloads once per minute while visible; detail pages provide Reload recorded status without discarding in-progress forms automatically.

Automatic monitoring and existing Compose services

The scheduler runs aeris:workers-monitor every minute. It dispatches only IDs and expiring lease tokens to the default queue, not worker-bundles. The existing portal Compose queue service (queue:work --sleep=3 --tries=1 --timeout=180) already consumes this queue with the distributed QUEUE_CONNECTION=database; scheduler runs schedule:work. The separate bundle-builder continues consuming only worker-bundles. No extra service or Compose change is required. This compatibility was checked against aeris-docker/compose.yaml and .env.example read-only; no services were started or modified.

Apply the Foundations migrations and keep those queue/scheduler services running. Each status job has a 20-second deadline and one attempt, compatible with the Compose 180-second worker limit and DB_QUEUE_RETRY_AFTER=1200. Normal checks are due after 60 seconds; accepted/running/uncertain updates after 30 seconds, subject to the scheduler's one-minute tick, queue throughput and the bounded batch. New workers are automatically eligible without manual checks. Checks confirm updates only when both running version and succeeded status match; a later idle response never clears an ambiguous outcome.

Site backup inventory

The Backups page lists retained environment backups, including those whose source site or environment has been deleted. Super administrators see local and organization backups; organization managers see their assigned organizations; view-only portal users can inspect organization backup metadata but cannot delete backups. Deletion requires password confirmation and removes the private portal copy and any outstanding worker copy.

Creating a backup temporarily stops the environment's WordPress, development and SSH services. Stop external writers separately; a transactional database dump cannot guarantee consistency for non-transactional tables changed externally. Bundles contain sensitive site configuration and database contents. By default, they are kept on Laravel's local disk in storage/app/private/site-backups. Monitor disk space: quotas and retention policies are not yet enforced.

Set AERIS_BACKUP_DISK (the published aeris.backup_disk setting) to a named disk in the host application's config/filesystems.php to store new backup archives elsewhere. Apply the Foundations migrations first. Each backup records its disk at reservation time, including safety and migration snapshots; changing the default does not move existing archives. Keep old disk definitions and credentials available until their backups are deleted or explicitly migrated. Missing or invalid disks fail without falling back to local storage.

Alternatively, enable Cloudflare R2 storage on the Cloudflare integration page and select Cloudflare R2 under Store new backups in. This is a portal-wide default managed by super administrators. Aeris Storage Driver continues to use aeris.backup_disk; selecting it does not move R2 archives.

Enter a bucket name and choose Test and save configuration. Testing reuses an existing private bucket, or creates that exact name only when Cloudflare confirms NoSuchBucket (HTTP 404, error 10006). Permission errors, timeouts and ambiguous responses never trigger creation. Bucket inspection requires R2 storage read permission; creating a missing bucket also needs write permission. Creation does not generate S3 credentials. If creation times out, inspect Cloudflare for that name before retrying instead of choosing another name blindly. For a new bucket, testing with only its name creates it and prompts for keys without marking storage verified. Generate bucket-scoped credentials in Cloudflare, enter both keys and test again to complete verification.

Enter separate, bucket-scoped R2 Object Read & Write access keys for archive uploads. These S3-compatible credentials are not the Cloudflare management API token. The configuration test uploads, reads and removes a small private object before saving the configuration. Only then can R2 be enabled and selected for new backups with Save storage settings. Public development URLs and custom-domain access must remain disabled on backup buckets. Do not expose them through public Workers or other services; bucket privacy checks cannot detect arbitrary external proxies. Use the Access Key ID and Secret Access Key from the R2 token screen, not its separate Token Value. The access key ID must be 32 hexadecimal characters and the secret 64 hexadecimal characters; testing rejects malformed keys before making verification requests. Verification errors identify upload, read-back, deletion or absence checking and include safe HTTP/S3 error codes where available, never signed URLs or secrets. Cleanup checks the exact probe object without listing a directory. If cleanup is unconfirmed, inspect site-backups/r2-check-*.probe in the private bucket before retrying; failed verification never enables storage.

Native R2 configuration keeps encrypted keys and an original account/bucket profile for each reserved backup. Changing the selected bucket or disabling R2 does not retarget existing archives or queued backups. Saved profiles remain available for restores and deletion; keep the old buckets and their credentials accessible. Updating keys for the same bucket rotates access without changing its archive location. R2 errors do not silently select the Aeris storage driver.

Operator-defined S3 disks remain supported too. For example, define a dedicated Cloudflare R2 disk in the host application:

// config/filesystems.php, inside 'disks'
'aeris-r2' => [
    'driver' => 's3',
    'key' => env('R2_ACCESS_KEY_ID'),
    'secret' => env('R2_SECRET_ACCESS_KEY'),
    'region' => 'auto',
    'bucket' => env('R2_BUCKET'),
    'endpoint' => env('R2_ENDPOINT'), // https://<account-id>.r2.cloudflarestorage.com
    'visibility' => 'private',
    'stream_reads' => true,
    'aeris_s3_without_acl' => true,
    'throw' => true,
],

Set the corresponding R2 credentials, bucket and endpoint in the host's environment, then set AERIS_BACKUP_DISK=aeris-r2 and refresh Laravel's cached configuration. Aeris includes the Laravel S3 filesystem adapter. Do not configure a public bucket, public access policy, public URL or web-served filesystem root: private write visibility alone cannot override public bucket policies or web server access. Secure credentials and grant only the needed object access. R2 does not implement S3 object ACLs. The explicit aeris_s3_without_acl option removes the S3 adapter's private ACL from Aeris archive uploads, including multipart uploads; it relies on the bucket itself being private. Use it only for a dedicated private S3-compatible bucket that rejects ACLs. All S3 backup disks require stream_reads => true to avoid buffering a full remote object in the SDK's default temporary storage.

Compatible drivers must support private stream writes, stream reads, existence checks and deletion, and return the just-written bytes on read. Aeris verifies both size and SHA-256 after upload and before each restore; incompatible drivers, permissions, missing adapters and inconsistent reads produce errors rather than an alternate local backup. Archives are staged as private local files under storage/app/private/site-backup-staging for verification and seekable worker uploads. Upload staging remains named while a filesystem driver writes it, because multipart drivers may reopen it; it is removed afterward, but a killed process can leave a private staging file for an operator to clean up. Each portal and queue host needs writable private staging and enough local free space for the largest archive even with remote storage.

Backups use the default database or Redis queue. Its retry_after must exceed the 1050-second backup job timeout (1200 seconds is recommended), and a queue worker must run continuously. Backup jobs override the worker's default timeout. Portal and queue processes must access the recorded backup disks and share an atomic cache-lock backend; a local backup disk must also be shared across hosts. Use a shared cache backend when running multiple hosts. Failures or unconfirmed outcomes leave the environment fenced for inspection; an outstanding temporary worker copy must be cleaned up before deleting its inventory record. Scheduled backups and quotas are not implemented yet.

Site records refresh backup progress every ten seconds while visible and remove the progress notice when finished, without discarding unsaved edits. In a devcontainer, backup files live in its storage volume, not the host checkout. Create backups using the environment action icon; creation and deletion use confirmation modals rather than inline dropdown forms. Backup table organization, site and environment names link to their records; deleted sources remain readable without broken links. Environment links open the matching section of the site record. Every backup table also shows its saved location: Cloudflare R2 or Aeris storage (disk name). This uses the backup's recorded destination, not today's default; native R2 profile handles and credentials are never displayed.

Every site record includes a Backups card covering all of its environments, including removed environments. Organization owners/admins and authorized portal managers can delete settled backups using the confirmation modal; members and view-only users cannot. Global inventory search covers site/environment names and organizations, with environment and status filters applied before pagination. Site cards have the same search and filters across all backups belonging to that site. Progress refresh preserves filter selections and pauses during confirmation.

Restoration, cloning and whole-site moves

Apply the recovery migration, deploy an updated worker, and restart any long-running portal queue workers before using these actions. Destinations must advertise restores_supported; migration sources must also advertise backup_keep_stopped_supported. The portal checks these capabilities before taking safety snapshots or pausing sources. Recovery jobs use the same private storage, shared atomic cache locks and database/Redis queue requirements as backups (retry_after=1200, job timeout 1050 seconds).

The restore icon in a site's Backups card restores a completed backup into an existing environment of that source site only. Organization owners/admins and authorized portal managers can restore; members and view-only users cannot. All destination files and its database are replaced. A mandatory safety backup is saved first, and the destination address, credentials and worker placement are preserved. The source WordPress table prefix is retained and stored URLs are rewritten with serialization-aware WordPress tools. Source application keys are retained for encrypted application data; worker infrastructure and automation credentials are not copied from the source archive.

The clone icon on an environment copies all files and its database into another environment of the same site and worker. Existing destinations are overwritten after a safety backup. An unused development, staging or production slot can be created; only one of each is allowed. Customer creation of a new slot follows the existing site-provisioning feature flag. Cloning copies everything; use Environment sync for a selective copy instead.

Editing development themes

Use Edit theme on a running development environment to open its actual theme files. Saved edits take effect in that environment immediately; staging and production are not edited. Organisation owners/administrators and authorized portal operators can open the editing page. Other environment types cannot.

Open browser editor prepares the editor and opens the theme in a new tab. The first launch can take a few minutes. Access uses a short-lived, single-use handoff to the worker's separate browser gateway, never a worker API token or portal client certificate. The private worker API retains mutual TLS.

For Edit in VS Code, install VS Code and Remote - SSH, connect the computer with its public SSH key, and follow the one-time connection-file instructions. Download both the settings and trusted-server-key file; server identity checking stays enabled. Private keys remain on the developer's computer. After setup, Open theme in VS Code opens the correct theme folder automatically. Reconnect the computer with its public key each time editing is reopened; closing editing revokes workspace-only keys, so previous editors do not regain access when another administrator starts a new session.

Save work and choose Close theme editing before backups, syncs, restores or other site operations. These operations are blocked while editing is open, preparing or requires cleanup after a failure. Closing disconnects editing sessions but retains saved files and editor settings. Use selective sync to promote the theme to staging or production. On workers supporting idle shutdown, editing also closes automatically after 30 minutes without browser or SSH activity, with a warning during the last five minutes. The portal's theme editing page shows this warning too; polling that page does not extend an editing session. Save work when warned, or continue using an editor to reset the idle deadline. Git tools are available inside the workspace; GitHub authentication and deployment integration are not included.

Workers must support theme editing and have their browser gateway/reachable desktop connection configured. Browser access is separate from the WordPress address. Remote browser gateways require HTTPS; loopback HTTP is for local use.

Selective environment synchronization

The site's Environment sync card replaces the former managed JSON policy editor. In its modal choose two running environments and select the theme, plugins, media uploads, the whole database, or specific source tables. Database choices are mutually exclusive. Table names are loaded from the selected source and revalidated when queuing. Copy related tables together. Database copies can replace users and administrator accounts. Source and destination WordPress table prefixes must match for database sync.

Selected content replaces its destination counterpart; unselected content is left alone. The destination address and infrastructure credentials are retained. Environment files, repository metadata and Composer credentials are not copied from the source; destination equivalents are retained. The theme's cached environment configuration is discarded. A full destination safety backup is saved and checksum-verified in private portal storage before the worker may copy anything. The confirmation explicitly acknowledges replacement; production writes also require typing production.

Native sync requires an updated worker advertising selective_sync_supported. It does not require SSH, an applied JSON policy, or Meros theme sync commands. Deploy worker and portal changes together, publish the portal assets, run php artisan migrate, and restart long-lived queue consumers. Sync jobs share the backup queue requirements: database/Redis, retry_after=1200, timeout 1050s. Progress and errors appear on the site record and update through polling. The sync card sits above backups and shows recent runs in a history table. Environment action icons stay on one row; actions that do not fit move into a labelled ellipsis menu, which updates when the card's available width changes. On mobile, all environment actions use that menu and the environment-creation button sits below its heading. Clear log permanently removes completed and operator-released entries after confirmation; active operations, unresolved failures, backups and site data remain. Source and destination are fenced against other operations until completion. Failures retain the destination safety snapshot and site reservation. An authorized portal operator can release a settled operation after inspection; release never repeats a data copy. Legacy operation journals remain inspectable.

Organisation site creation offers development, staging or production as the first environment, defaulting to development. The first-created environment anchors the worker collection independently of its type. Missing types can be added later, including development. Remove other environments before deleting the original environment and its logical site.

Move site is portal-only and moves every environment together to a different worker. Organization sites can move only to a worker already assigned to their organization. The control is hidden when no other eligible worker exists. All environments must initially be running and idle, and routing reservations must be settled; remove managed SSH routes first. Each migration snapshot keeps its source environment stopped, including SSH, so no site writes resume after the snapshot. All destinations are restored before switching any routing or atomically changing the portal's environment placements.

Portal-owned vanity DNS and custom-hostname ingress are moved between managed Cloudflare tunnels in the same account and zone. Ownership markers and original DNS IDs are verified; unrelated routes are preserved. Interrupted cutovers can resume using the same ownership snapshots without adopting foreign DNS or repeating completed imports. Moving to a Cloudflare worker from local addressing generates vanity addresses; moving to a local-only worker removes managed public routing and assigns destination localhost addresses. The dialog previews every address and requires explicit approval for conversions. Approval is bound to the current preview; changed worker policies or addresses require review again. All restores and paused sources are verified before routing changes, and all placements commit together. Moves between Cloudflare workers preserve owned vanity/custom addresses. Customer-managed DNS is never removed during conversion. Previously queued legacy moves retain their manual-routing confirmation flow. A restored environment's current custom address and its owned vanity ingress hostname are kept separately. Destination SSH starts disabled; old portal automation credentials are invalidated. Native selective sync does not require reapplying a policy.

Original worker data remains stopped, not deleted, after a move; its snapshots stay in private portal storage. Retained local source copies are not re-imported into the portal inventory. Backups involved in unfinished recoveries cannot be deleted. The whole site is fenced while a recovery runs. Failures retain those fences, archives and safety snapshots for operator inspection rather than silently restarting partially restored sites. Uncertain monitoring can be resumed by a portal operator using the original operation IDs; a worker-reported failure requires inspecting and resolving the partial destination first. After stopping related jobs and confirming stable worker data, a portal operator can release a failed operation without replaying imports or deleting worker data. Failed migrations require intact original managed DNS and ingress before release; once new routing or local cleanup has started, resume the inspected move instead of releasing its reservation. Active worker restores cannot be released. This does not roll back overwritten content: use the retained safety backup after repairing the destination, or clean up a disposable failed destination explicitly.

Progress appears on the site record and disappears after successful completion. Confirmation dialogs warn about overwrites and downtime. As with backups, stop external host/database writers separately; the portal cannot fence them. Backups whose source site has been deleted remain retained, but are not accepted as input to an unrelated site's restore or clone action.

Default limits are ten dispatches per tick and twenty outstanding checks. Both total default queue depth (including reserved/unrelated jobs) and active per-worker leases apply backpressure. A blocked queue cannot accumulate a new batch of expired checks every minute. Scheduling uses a shared atomic cache lock and each worker has an atomic five-minute database lease; duplicate deliveries cannot overlap a running check. Stale queued jobs skip network I/O; expired reservations can be reclaimed once queue capacity is available. Due-time/ID ordering rotates checks instead of repeatedly selecting the same first workers.

Network I/O runs outside database row locks. Results are committed only when the lease, connection credentials and observation/update fence still match the snapshot. A credential rotation, endpoint change, manual refresh or newly accepted update during a request causes the old result to be discarded; it cannot overwrite newer observations or clear update uncertainty. There are no credentials or worker models in queue payloads and monitoring never queries GitHub.

The scheduler also runs aeris:environments-monitor every minute. It uses the same enabled flag, interval, queue and bounded batch/backpressure settings. Confirmed environments without a pending operation are checked independently; failed checks retain the last recorded state for recovery but show unknown instead of a confirmed runtime badge. Observations older than five minutes also show unknown and do not offer browser links. A site page checks for changes every 10 seconds while visible and reloads when safe, or asks the user to reload if there are unsaved changes or an open form. These checks read the worker's live container observation for settled environments. The worker inspects its owned Compose services and reports stopped, removed or degraded containers instead of trusting a saved ready state. Failed or pending worker operations retain their diagnostic state. This does not verify public DNS, routing or external HTTP reachability and does not send alerts.

Use the shared persistent application cache (distributed default: database) for scheduler locks, with normal queue/cache migrations applied. If checks remain stale, inspect scheduler/queue logs and backlog, then scale queue consumers or tune limits to capacity rather than treating stale status as healthy. Optional settings:

AERIS_WORKER_STATUS_ENABLED=true
# Defaults to QUEUE_CONNECTION (database in distributed Compose):
AERIS_WORKER_STATUS_QUEUE_CONNECTION=database
# Leave unset to use that connection's default queue, consumed by existing queue:
# AERIS_WORKER_STATUS_QUEUE=default
AERIS_WORKER_STATUS_INTERVAL=60
AERIS_WORKER_STATUS_BATCH_SIZE=10
AERIS_WORKER_STATUS_MAX_PENDING=20

Intervals are clamped to 30–300 seconds, batches to 1–100 and pending capacity to 1–200. Custom queue names require a consumer for that queue. Inline/sync queues are rejected, and the durable database/Redis connection's retry_after must be greater than 20 seconds. To diagnose a dispatch without waiting for the scheduler:

php artisan aeris:workers-monitor

Remote updates require a superadministrator management session, configured MFA, password confirmation, CSRF, a fresh reachable identity and update-status check, and typing the worker name as explicit confirmation. Requests are throttled and serialized per worker. The portal sends only the selected version to the worker; it never invokes remote shell commands or changes running services itself. All worker API requests retain the saved worker's token and per-worker mTLS.

Tag discovery uses only https://api.github.com/repos/mirror-and-mountain/aeris-worker/tags, with up to three pages/300 tags and a three-second deadline per page. It runs only on detail pages for workers that report version/update support or when requesting an update. Results are shared in the application cache for ten minutes; failures are cached for one minute, and rate/access limits for ten minutes (bounded Retry-After/rate-reset headers can adjust this to 1–60 minutes). Discovery errors and truncated snapshots are visible; “no newer tag in this snapshot” does not assert that every GitHub release was examined. Configure persistent application cache for effective caching across web requests.

Only valid vMAJOR.MINOR.PATCH SemVer tags are considered, including valid prerelease/build metadata. Comparison follows SemVer precedence (numeric prerelease identifiers, stable precedence and ignored build metadata), not lexical tag order. Stable installations are never offered a prerelease; already prerelease workers may advance to newer prereleases or stable releases. Unpublished targets, downgrades and metadata-only changes are rejected.

Worker update contract:

GET  /v1/worker          → service, api_version, version, updates_supported
POST /v1/worker/updates  {version} → 202 {state:"accepted",version}
GET  /v1/worker/updates  → {state,version,error}

api_version is "1" and updates_supported is a boolean. Older workers without version/update support remain checkable but cannot be remotely updated. Valid update states are idle, accepted, running, succeeded and failed. Acceptance is not success: success requires an authenticated running version equal to the requested target and matching succeeded update status. A mismatched target/version, invalid status, request timeout or API loss stays uncertain and blocks blind retries. Idle after a pending update also remains unconfirmed; inspect worker logs and reconcile worker-side status rather than assume success. An explicit HTTP rejection (400/401/403/404/409/422/429, without an accepted/running/succeeded claim) is recorded separately as rejected, not uncertain. It may be retried after a fresh reachable idle/finished-state check, subject to throttling. Contradictory responses, timeouts, server errors and malformed acceptance stay fenced even if a later status is idle. Worker-reported error text is never shown or persisted verbatim; local worker logs hold diagnostics. The portal does not implement a TLS bypass, rollback or updater fallback. Worker-side build/restart support and prerequisites remain necessary. When updates are unavailable, GET /v1/worker may provide the safe updates_unavailable_reason (for example Git/Go missing from the worker service PATH). Monitoring validates this as single-line text up to 300 characters and the detail page displays it escaped; malformed/oversized reasons use a safe fallback. The explanation is cleared once update support becomes available.

Private worker bundles

Super administrators can use Worker connections → Build worker bundle, after management authentication, configured MFA and password confirmation. Supply a unique worker name, a portal-reachable HTTPS API origin (for example https://worker.example.com:8443), a published version tag (v1.2.3 or v1.2.3-rc.1), and linux/darwin with amd64/arm64. The source is fixed to https://github.com/mirror-and-mountain/aeris-worker.git; there is no arbitrary repository, branch, local-source or prebuilt-binary fallback. The selected tag must already exist and include cmd/aeris, deploy/bundle/install.sh and non-empty deploy/wordpress templates.

The portal cross-compiles ./cmd/aeris with CGO_ENABLED=0 and injects the version using -X github.com/mirror-and-mountain/aeris-worker/internal/cli.version=vTAG. The private .tar.gz has these root entries:

aeris                         executable for the selected platform
install.sh                    executable from the same source tag
deploy/wordpress/             templates from that source tag
bundle.json                   {"listen":"0.0.0.0:PORT","version":"vTAG"}
credentials/worker.crt        server certificate with hostname/IP SAN
credentials/worker.key        private server key
credentials/ca.crt            this worker's CA certificate
credentials/token             random 256-bit worker bearer token

The URL determines the listen port (443 when omitted); ports below 1024 may require elevated privileges. The prescribed 0.0.0.0 listener is IPv4: an IPv6 URL needs host routing/forwarding to that listener. TLS must still present the matching hostname/IP certificate; do not terminate or bypass worker mTLS.

Each bundle gets an independent RSA-3072 CA and server/portal-client identities. The CA certificate, portal client certificate and client key are encrypted on the worker record using the application key; the token is separately encrypted. The CA signing key is discarded. Neither the CA signing key nor portal client private key is included in the download. All saved-worker API operations use that worker's mTLS identity. Separately registered workers use ordinary system TLS trust with no custom client certificate; global AERIS_WORKER_CA_CERT, AERIS_WORKER_CLIENT_CERT and AERIS_WORKER_CLIENT_KEY settings are not used.

CA validity is 3650 days; server and portal client certificates expire after 825 days, displayed on the worker details page. After expiry the portal cannot authenticate to the worker. Renewal or replacement of a bundled identity on an existing connection, and migration of its environments to a new connection, are not currently supported. Back up sites and plan maintenance before expiry; do not remove the existing connection or install a new bundle over the worker until a renewal or migration process is available. Do not disable TLS verification.

Downloads are sensitive and sent with no-store/no-cache; their authenticated POST endpoint is atomically claimable only once and must not pass through a caching proxy. Keep the archive private and securely remove it after installation. A record is created only after a successful build, but registration is not a connection check. Install on the worker, then return to Worker connections and select Test connection. The worker never needs to call the portal; the portal must reach the worker API through the host firewall/network. An interrupted download retains the unverified connection rather than claiming success or silently rotating its credentials: remove the unused connection and rebuild. Do not reuse that connection if the partial archive may have been exposed.

Portal runtime build dependencies

The PHP application user needs writable private storage, PHP's OpenSSL extension, proc_open/Symfony Process support, git, tar with gzip support, and Go on PATH. Go 1.24 is sufficient to bootstrap: GOTOOLCHAIN=auto downloads a newer toolchain if required by the selected worker tag's go.mod. Outbound HTTPS must reach GitHub, proxy.golang.org, sum.golang.org, Go toolchain download endpoints and any direct module origins. Do not disable module checksums or TLS verification. Builds use isolated Go/Git configuration and private per-build module/build caches rather than the portal user's shared credentials. Provision sufficient disk/RAM for Go compilation and run builds on the dedicated CLI queue described below.

Asynchronous builds and deployment prerequisites

Source compilation does not run in a web/FPM request. The POST queues only a build UUID; an owner-restricted status page polls every five seconds. The CLI queue job registers a worker only after the complete build and encrypted archive publication succeed. Results expire 15 minutes after publication. Downloads require the same requesting super administrator, current MFA and password confirmation; claiming consumes the result before reading it, so interrupted/corrupted downloads cannot be replayed.

Set AERIS_WORKER_BUNDLE_QUEUE_CONNECTION to a configured durable connection (default database; Redis is also suitable). Sync, deferred, background and null drivers are refused. The deployment must provision the queue's tables/backend, then supervise a separate CLI worker, for example:

php artisan queue:work database --queue=worker-bundles --timeout=900 --tries=1
php artisan schedule:run

Configure the queue connection's retry_after (or backend visibility timeout) to more than 900 seconds, for example 1200, and install CLI PHP pcntl so Laravel can enforce job timeouts. The source build has one shared 600-second subprocess budget, not four separate 600-second allowances. Jobs are not retried automatically. Keep the scheduler running every minute; it invokes aeris:worker-bundles-clean to expire queued/stuck builds, ready/consumed archives and orphaned results/workspaces left by killed processes. Queued requests expire after one hour, running builds after 20 minutes, and orphaned files after two hours. Expiry never deletes or modifies the pre-registered worker: its unused connection must be removed explicitly before rebuilding.

Archives at rest are application-key encrypted and private (0700 directory, 0600 files) under storage/app/private/worker-bundle-downloads. Only encrypted results survive the job; the raw archive, keys and source caches are deleted. Compressed bundles are limited to 24 MiB to bound download memory; configure at least 256 MiB PHP memory for web downloads and sufficient CLI build memory. Safe failure messages identify the build stage, exit code and classified tag/network/trust/checksum/storage/compiler issue. Raw subprocess output, command arguments, private paths, certificates and tokens are never reported. Operators can reproduce compiler failures in an isolated CLI checkout of the selected tag.

This package contains no distributed FPM/proxy configuration, and the available local PHP is CLI with max_execution_time=0; this does not establish FPM limits. Typical PHP web execution limits (30 seconds), Nginx upstream read limits (60 seconds), and Cloudflare proxy read limits (120 seconds) cannot safely cover a 600-second synchronous compilation. set_time_limit() cannot change FPM's request_terminate_timeout or upstream limits. The queue design removes that dependency, but production readiness still requires the durable queue worker, visibility timeout and scheduler above; no running services are configured or started by this package change.

Workspaces are random 0700 directories under storage/app/private/worker-bundles; credentials and archives are 0600. Files are removed after job failure/success and normal PHP shutdown; the scheduled cleanup removes stale directories after the maximum job lifetime. Do not expose or symlink this private directory into public storage.

Development

composer install
npm ci
npm run build
vendor/bin/phpunit
vendor/bin/pint --test

Tests boot a clean Laravel application through Orchestra Testbench and use one ephemeral SQLite database. Production starter smoke tests should also exercise MariaDB and both Compose flag variants before release.