Skip to content

About

PHP CLI installer for fresh MyBB setup and safe core upgrades.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

mybb-installer-cli

The shared library is a normal Composer dependency, mybbresources/mybb-tooling >=0.1.0 <1.0.0, resolved from its public Git repository. Run composer install in a standalone checkout. Composer owns the ignored vendor/ directory; no library source snapshot is tracked here. In the coordinated core checkout, php tools/install-component-dependencies.php uses a temporary path repository pointing directly to canonical src/. The coordinated workspace builds mybb-install.phar together with the CLI using php -d phar.readonly=0 tools/build-phars.php VERSION [OUTPUT_DIR] from the workspace root. Each PHAR embeds the shared library, has PHP's internal SHA-256 archive signature, and is accompanied by a SHA-256 sidecar for transfer-integrity checks. The sidecar is not an authenticity signature; only distribute a release after attaching artifacts to the project's trusted, provenance-verified release channel. V1 host support is PHP 8.2–8.4 on Ubuntu 24.04 x86_64, macOS 15 Intel, and macOS 15 Apple Silicon; Windows support is not claimed.

Open source command-line installer prototype for fresh MyBB sites and transactional core-file upgrades. The primary flow fetches the newest stable MyBB release (with an explicit version override), verifies it, and installs the companion mybb-cli and mybb-plugin-repository from a signed pinned bundle. --core-only is an explicit opt-out for operators who intentionally want only MyBB core.

Operational expectations

  • Detect PHP/runtime and filesystem requirements before changing the target directory.
  • Offer interactive setup and non-interactive options suitable for automation.
  • Download official releases over HTTPS, verify published checksums/signatures when available, and report provenance.
  • Make retries safe; avoid overwriting an existing installation without an explicit backup/upgrade flow.
  • Keep credentials out of shell history and logs; explain database and initial-admin setup clearly.
  • Bootstrap the companion CLI and repository plugin from pinned, verified releases.
  • Provide dry-run, clear progress/errors, and a recovery/cleanup plan for interrupted installs.

The executable is bin/mybb-install. check [PATH] --json is read-only: it reports PHP CLI version/SAPI, curl, zip/ZipArchive, sodium, and mysqli, target writability and state, free space, MyBB markers, plus web-server assumptions that need operator review because the CLI cannot inspect the web server or its PHP SAPI. It does not create a missing target or perform a write probe. Installation requires PHP 8.2+ and those extensions. Before downloading the official package archive, install/upgrade prints a secret-free pre-download summary to stderr with the resolved version, target, prerequisites, checksum state, database preflight, and companion components. After checksum verification and archive inspection, it prints the exact file and directory plan to stderr before any site writes; --dry-run also returns the exact file list as JSON on stdout. It rejects unsafe ZIP entries and journals file changes. If an install is interrupted during file installation, rerun install --path=TARGET --resume with the same bootstrap options; the installer verifies the official archive and journal, continues matching or missing core files, and validates the complete bootstrap file set before deleting any digest-matching partial writes. Cleanup removes only the recorded package transaction directories and matching bootstrap writes before retrying the signed bundle. Locally modified and unjournaled files are preserved and reported. recover --path=TARGET --rollback remains available for operators who prefer to discard an interrupted file installation. For upgrades, first run upgrade --path=SITE --backup-dir=EXISTING_DIR --dry-run; review the exact changed-file list, then repeat with --yes. It creates a timestamped backup of every replaced file outside the MyBB site directory, applies only files present in the official release, and preserves inc/config.php, inc/settings.php, uploads, cache, plugin files, and Admin CP backups. If an install is interrupted, review the journal before choosing resume or rollback; an interruption during database setup is deliberately not auto-replayed because MyBB's schema and seed-data operations are not transactional. Upgrade interruptions can be reviewed with upgrade --path=SITE --resume --journal=BACKUP_DIR/transaction.json --dry-run, then continued with --yes; resume refuses different official bytes, missing/altered backups, and unexpected live-file changes. recover --upgrade-journal=BACKUP_DIR/transaction.json --rollback remains available to restore a pre-commit file upgrade. Choose a backup parent outside the web server's document root; the tool can enforce that it is outside the MyBB site directory but cannot infer the hosting document root. A pinned historical official release is resolved from the versions page and canonical package URL. When a signed companion bundle is present, fresh installs verify its Ed25519 signature and SHA-256 before applying it.

Fresh setup can prompt interactively on a POSIX TTY or read a protected JSON file for automation; database/admin passwords are never accepted as command arguments. The interactive flow hides both passwords, confirms the administrator password, previews non-secret settings, and asks for final confirmation. For automation, copy setup-config.example.json outside both the site directory and the web root, replace the placeholders, and restrict it with chmod 600 /path/to/setup.json. Run bin/mybb-install install --path=/path/to/empty/site --setup-config=/path/to/setup.json --bootstrap-dir=/path/to/signed-bundles; the default install flow applies the official installer steps in isolated PHP CLI subprocesses, then confirms MyBB created its lock, config, and settings files. The setup journal is adjacent to the site directory and contains step names and non-secret identity fields only. A DB prefix with existing tables is refused before downloads or site writes. Use a newly created, empty database/prefix. If setup stopped once table creation began, inspect the database and journal and manually reset the partial database before starting a new installation; the CLI refuses an unsafe replay.

Build companion packages before installation with php ../tools/build-bootstrap.php VERSION KEY_ID PRIVATE_KEY_FILE TRUSTED_KEYS_JSON OUTPUT_DIRECTORY. Point the installer to that directory with --bootstrap-dir=PATH, or place core.json, core.zip, bootstrap.json, bootstrap.zip, repository.json, repository.zip, and trusted-keys.json under this project's dist/ directory. Release PHAR builds can set MYBB_PHAR_BOOTSTRAP_DIR and MYBB_PHAR_TRUSTED_KEYS_FILE; the builder verifies all three signed package manifests and exact archive maps, then embeds the assets and pinned trust map in mybb-install.phar. The core package owns the shared library and central trusted key ring; the CLI package owns only its executable; the repository plugin has its own package identity and ownership record so catalog updates do not collide with toolchain files. The signing key must also be pinned in config/trusted-keys.json (or supplied with --trusted-keys=PATH); the adjacent bundle trust map is checked against that pin and cannot establish trust by itself. Keep the private signing key outside the web root and never include it in the bundle. A normal install fails before contacting the official release source if any signed companion package is absent; select --core-only explicitly to skip companion installation.

Current limits: Database/admin setup delegates schema and seed work to MyBB's own installer in CLI subprocesses; a fresh official MyBB 1.8.41 install with signed companion bootstrap has passed against MariaDB 11.4 locally. Upgrade applies files only and leaves the database migration to MyBB's official /install/upgrade.php flow after the operator reviews release notes. It does not create a database backup automatically, so make one before upgrading. Fresh-install recovery journals all three signed companion packages' exact destinations, every observed package-state ledger digest, and each package-manager transaction directory before writes. Resume and rollback clean only those exact digest-matching files and journaled transaction directories; changed files and transaction trees containing symlinks or special files are preserved and reported. Existing journals created before transaction-directory journaling can be resumed conservatively, but their untracked transaction artifacts are not deleted. The full-package SHA-512 parser has been exercised against the official 1.8.41 page, and live official release verification/installation now passes on that floor version. The isolated latest-version resolver fixture also passed locally and resolved to 1.8.41. The live fixture verifies resume/rollback of an interrupted core-file transaction against a real site file with synthetic staged bytes; the separate official-upgrade fixture passes a real 1.8.40-to-1.8.41 transition locally, including authenticated web-wizard assessment and data preservation. Hosted coordinated run 41287352085 passed the fixture and full matrix.

Upgrade sources may start at MyBB 1.8.40; fresh installs and upgrade targets require 1.8.41 or later 1.8.x. This exception does not widen catalog plugin/toolchain compatibility. The isolated official upgrade fixture documents the exact transition and its file-only database outcome.

The distribution reference map pins production key catalog-2026. The signed core package alone owns the installed central trust ring; Admin CP reads that ring. A public pin does not authenticate a PHAR download or complete publication. See release readiness for the fingerprint, rotation process, private candidate verification, and remaining release gates.

About

PHP CLI installer for fresh MyBB setup and safe core upgrades.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages