# Install Design Pro on cPanel

Target website: **https://designpro.makersprout.com.au**.

This package runs with PHP and MySQL/MariaDB. It does not require Node.js, Composer or a command runner on the hosting account. Use a current, fully patched PHP 8.3 or 8.4 release in cPanel. The code supports PHP 8.2+, but an old local test runtime is not a production recommendation.

The installer creates one site owner and workshop. Public signup, subscription billing, live CNC execution and a video relay are not installed. Do not describe a saved job or connector-reported receipt as permission to cut.

## 1. Preserve the existing site

Back up the subdomain's current files and any database before changing its document root. Extract this package into a **new** folder; do not merge over an existing installation or existing private configuration.

Recommended account layout:

```text
/home/CPANEL_ACCOUNT/designpro/
    app/
    database/
    private/
    public/          ← document root of designpro.makersprout.com.au
    INSTALL.md
```

In cPanel **Domains**, create or edit `designpro.makersprout.com.au` so its document root is `/home/CPANEL_ACCOUNT/designpro/public`. The folders `app`, `database` and `private` must remain outside the web document root. Do not point the domain at the package root or move `private` into `public_html`.

If your host does not allow an outside-public_html document root, ask the host to provide a separate safe layout. Do not solve this by making database configuration public. The installer deliberately refuses a document root other than this package's public directory.

Ensure DNS resolves to the cPanel server and AutoSSL supplies a valid certificate for the subdomain. Open only its HTTPS address. Enable cPanel's Force HTTPS Redirect for the subdomain when available. No DNS, hosting or certificate change was performed while preparing these files.

## 2. Select PHP and create the database

In cPanel's PHP version/extension controls, enable:

- PDO and `pdo_mysql`
- JSON, session, OpenSSL and hash support

In **MySQL Database Wizard**:

1. Create a dedicated empty database.
2. Create a dedicated database user with a strong password.
3. Associate it with that database. The installer needs CREATE, SELECT, INSERT, UPDATE, DELETE and REFERENCES on this database; it does not need CREATE DATABASE, GRANT, FILE or global administrator rights.
4. Record the full database and user names, including the cPanel account prefix. The normal host is `localhost` and port is `3306`; use the host's supplied values.

Do not paste database passwords into chat or the shared handoff. The owner supplies them directly to the HTTPS installer. Credentials are saved in `private/config.php`, never in browser JavaScript or the public files.

Use a new table prefix, default `dpro_`. The installer refuses any existing table beginning with that prefix, rather than changing or deleting existing data.

## 3. Authorise first installation privately

No public default installation code is included. Before opening the wizard, create:

```text
/home/CPANEL_ACCOUNT/designpro/private/install-token.txt
```

The file must contain a randomly generated secret of 32–256 letters, digits, underscores or hyphens, with permissions **0600**. Keep the private directory restricted to the hosting account, normally 0700. Do not put this token on the NAS, in a public URL or in chat.

If cPanel Terminal is available, from the extracted package root run this using the hosting account's selected PHP CLI:

```sh
php -r '$p="private/install-token.txt"; if(file_exists($p)){fwrite(STDERR,"Token already exists; refusing overwrite.\n");exit(1);} $f=fopen($p,"x");if(!$f)exit(1);chmod($p,0600);fwrite($f,bin2hex(random_bytes(32)).PHP_EOL);fclose($f);'
```

Use cPanel File Manager to view that private file and copy the code into the installation form. Do not download or share it unnecessarily. Alternatively, generate a 64-character random password with your password manager and use File Manager to create the private file and set permissions to 0600.

Do not use a memorable phrase, the examples in this guide, a database password or an account password as the installation token.

## 4. Run the installer

Open:

**https://designpro.makersprout.com.au/install.php**

1. Resolve every failed preflight check.
2. Enter the private installation token.
3. Confirm the website address.
4. Enter the database host, port, full database name, full user name, password and new prefix.
5. Choose a workshop name and site-owner email.
6. Choose and repeat an owner password between 12 and 72 bytes. Use a password manager.
7. Select **Create workspace and lock installer**.

Password fields are never reflected back into the HTML. On success, the installer creates `private/config.php`, writes a permanent `private/installed.lock`, removes the setup token and shows the sign-in link. The installer thereafter returns HTTP 410 and cannot create another owner or overwrite configuration.

If token removal fails, remove only `private/install-token.txt` manually in File Manager. Keep `installed.lock` and `config.php`. You can also remove the public `install.php` file after successful setup as an additional housekeeping step; the application does not need it.

Sign in using the owner account. Confirm the expected workshop appears. Test with a generic non-moving job before any connector integration. No Hubble credentials, TLS gateway, camera relay, physical calibration or controller connection is established by the site installer.

## 5. Verify the public boundary

- The website and API use the expected HTTPS origin.
- Requests for `/private/config.php`, `/database/schema.php`, `/app/installer.php` and directory listings must not expose files. With the correct document root those paths do not map to the private package folders.
- Reloading `/install.php` returns the locked message, not a second setup form.
- Logging out prevents access to saved projects/jobs.
- A separate account must not access another workshop's projects or devices.
- No public source archive, backup, `.env`, token file or production config belongs inside `public`.

For live connector acceptance, use the separately documented API contract and explicit local pairing. Uploading a job must only validate/cache and return a receipt, never activate a machine. Live streaming requires a suitable separately authorised relay; shared cPanel PHP hosting is not assumed to provide it.

## Interrupted or failed installation

MySQL `CREATE TABLE` statements can commit independently. A failed installation is **not** guaranteed to roll back the schema. The installer never drops tables automatically.

- Read the non-secret phase/table inventory in `private/install-failure.json` and, if present, `private/install-state.json` using File Manager. Do not publish these files.
- If the failure happened before owner creation/config publication, correct the cause and choose a **fresh prefix** for a clean retry. Preserve partial tables until the operator has reviewed them; never drop unrelated tables.
- If `owner_created` is true, configuration exists, or an installed lock exists, stop and review the recorded state. Do not delete those markers to force another bootstrap. Recover the configuration/installation through the operator, preserving the existing database and credentials.
- A leftover `private/installing.lock` after a PHP process crash prevents concurrent/replayed setup. Verify no installer is running before manually removing this transient lock. Do not remove `installed.lock`.
- Check ordinary PHP hosting permissions, DB privileges and storage availability. The public error deliberately omits raw database/filesystem details and passwords.

The private config is written atomically without replacing an existing file. Hosts must support normal same-directory file publication/hardlinks. If the host refuses this operation, report the exact normal hosting restriction; do not make private storage publicly writable.

## Updates and rollback

This is a first-install package. Do not rerun the installer to update a live site or overwrite `private/config.php`. Back up files and database before any future release; schema upgrades need an explicit migration path and review. The package does not silently migrate, destroy or reset an existing installation.

Keep DB backups and private config off the public document root. Restoring only old web files may be incompatible with a newer schema; follow the exact release's rollback guidance.
