# Learnitive staging — edu.learnitive.com

`edu.learnitive.com` is the approved public staging hostname for the Learnitive website before promotion to `www.learnitive.com`.

## Staging filesystem and origin

- application root: `/var/www/edu.learnitive.com/public_html`
- site/data root: `/var/www/edu.learnitive.com`
- public origin: `https://edu.learnitive.com`
- deployment profile: `staging`
- trusted server config: `/etc/learnitive`

Extract the release so the repository root is `/var/www/edu.learnitive.com/public_html`, then run from that directory:

```bash
sudo LEARNITIVE_DEPLOYMENT_PROFILE=staging ./installer.sh
```

The standard installer intentionally does not enable, disable, reload or restart the host's shared Apache/Nginx listener. Provision the supplied `deploy/apache/edu.learnitive.com-*.conf` only on an ingress boundary that is operationally safe for Learnitive, or translate the same routes into the independent ingress/tunnel used by the host.

## DNS and TLS

Before public staging acceptance:

1. point `edu.learnitive.com` to the staging ingress;
2. provision a certificate matching `edu.learnitive.com` without using an automatic command that rewrites/reloads the protected Interactive Shell listener;
3. route HTTPS to the private Learnitive endpoints exactly as described by the supplied vhost;
4. keep the staging `X-Robots-Tag: noindex, nofollow, noarchive` policy intact.

If the independent ingress is Apache, the supplied templates require `ssl`, `headers`, `rewrite`, `proxy`, `proxy_http` and WebSocket proxy support. Run `apache2ctl configtest` (or the equivalent for the isolated ingress) before enabling/reloading that ingress. Do not enable modules or reload the protected Interactive Shell web server to satisfy Learnitive.

The application also emits a staging-safe `robots.txt` with `Disallow: /` and server-rendered pages are forced to `noindex` whenever `LEARNITIVE_ENV` is not `production`. This is defense in depth and must not be removed for staging.

Fresh staging installs also default passwordless email to disabled. Enable email, OAuth, licence-provider credentials, analytics or other outbound integrations only with staging-safe/test credentials. Never copy a production secret into staging merely to make a smoke test pass.

If OAuth is part of acceptance testing, register staging callbacks explicitly instead of reusing the www application callback:

```text
https://edu.learnitive.com/api/auth/google/callback
https://edu.learnitive.com/api/auth/github/callback
```

Likewise, allow `edu.learnitive.com` in the staging Turnstile configuration before enabling passwordless email.

The staging env template also keeps the SaaS/database layer disabled until credentials are supplied. If you deliberately enable SaaS against `learnitive_os` during this one-time promotion workflow, treat staging users, licences, course edits and other relational data as production-bound state unless you explicitly clean/reset it before www launch. For a long-lived staging environment, use a separate staging database and independent service/config stack.

## Staging acceptance

After the staging ingress is enabled, run:

```bash
bash scripts/verify-edu-local-vhost.sh
LEARNITIVE_STAGING_VERIFY_ORIGIN=https://edu.learnitive.com \
  node scripts/verify-edu-staging.mjs
```

Then run the normal release gates (`pnpm lint:ci`, `pnpm test:ci`, `pnpm build`, `pnpm local-ci-check`) and the release E2E/manual smoke required by `AGENTS.md`.

At minimum, manually verify login, project creation, Markdown and LaTeX editing, PDF, AI provider setup, Learn/course playback, collaboration, Project Terminal/WebSocket, file persistence across reload, mobile layout, pricing/license activation and the public SEO/noindex behavior.

## Promotion to www

Only after staging acceptance should the production package be installed at `/var/www/learnitive.com/public_html` with the `www` profile. Production uses `https://www.learnitive.com` and removes the staging noindex policy because `LEARNITIVE_ENV=production`.

`edu.learnitive.com` may then be retired or changed to a one-hop `301` redirect to `https://www.learnitive.com` using the supplied `edu.learnitive.com-cutover-redirect-*.conf` templates. If you want `edu.learnitive.com` to remain a permanent parallel staging environment after launch, give it independent config, services, ports, Redis and a staging database instead of reusing the single-environment promotion model in this release.
