Skip to content

forge-kernel/maintenance-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Forge Web Setup

A standalone maintenance panel for Forge projects deployed on shared hosting where you don't have CLI access.

Why this exists

Forge provides CLI commands for cache management, migrations, and seeders. That works fine when you have terminal access. On shared hosting — where you upload files via FTP or a file manager — those commands aren't available. This script fills that gap.

It's a single PHP file that boots the Forge kernel, gives you a web interface for common maintenance tasks, and can be deleted when you're done.

How to use

  1. Copy setup.php into your project's public/ directory.
  2. Visit https://yoursite.com/setup.php in your browser.
  3. Set a password on first visit. You'll get an access token — save it somewhere.
  4. Use the panel to perform maintenance.
  5. Click "Delete setup.php" when you're finished.

After you delete it, nothing remains. The only other file it creates is .setup_lock in the project root, which is also removed during self-destruct.

What it does

Cache Management

  • Warm All Caches — rebuilds the module registry, compiles lifecycle hooks, runs all cache warmers (controller map, router hooks, role permissions), rebuilds the helper map and module command cache.
  • Flush All Caches — clears all framework cache files, view templates, role/permission caches, and module caches. Everything rebuilds lazily on the next request.
  • Clear View Cache — removes compiled view templates only.
  • Reset OPcache — resets the OPcache when the extension is available.
  • Individual cache files — clear specific cache files (module registry, compiled hooks, controller map, etc.) one at a time.

Database Migrations

  • Preview — list pending migrations without running them. Filter by scope (app, module, all) and optionally by module name or group.
  • Run — execute pending migrations.
  • Rollback — roll back by number of steps or by batch number.

Seeders

  • Preview — list available seeders and whether they've been run.
  • Run — execute pending seeders for app or a specific module.
  • Rollback — roll back seeders by number of steps.

System Tools

  • Generate Application Key — creates a new key and writes it to .env.
  • Toggle Maintenance Mode — creates or removes the maintenance file.
  • Clear Logs — removes all files in storage/logs/.
  • Fix Permissions — sets 0755 on storage directories.
  • Reset OPcache — same as the cache tab option.

Security

The panel is protected by a password set on first visit. The password is bcrypt-hashed and stored in .setup_lock in the project root. All actions are rate-limited to 30 per minute and logged to storage/logs/setup.log.

When you're done, use the self-destruct button. It removes both setup.php and .setup_lock.

What it needs

  • PHP 8.1+
  • The Forge kernel and modules must be present (this script boots the full kernel)
  • A working database connection if you're running migrations or seeders

Notes

  • The .htaccess in public/ should already skip this file since it checks for existing files before rewriting. If your server routes it through index.php anyway, add a rewrite condition for setup.php.
  • The file is not meant to stay deployed. Use it, do your maintenance, delete it.
  • This is not a replacement for proper CLI access. It's a fallback for when you don't have it.

About

Forge web maintenance tool for shared hosting

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages