Review main Merged

74366[FEATURE] Make backend URL configurable

Benjamin Franzke CR +2 V +2 Expert +771 −391 updated 01/24/24, 21:21

Commit message

The TYPO3 Backend URL is made configurable in order to enable optional
protection against application admin interface infrastructure
enumeration (WSTG-CONF-05). Both, frontend and backend requests are
now handled by the PHP script `/index.php` to enable virtual admin
interface URLs.

The default TYPO3 Backend entrypoint path `/typo3` can be changed by
specifying a custom URL path or domain name in
`$GLOBALS['TYPO3_CONF_VARS']['BE']['entryPoint']`.

This change requires web server adaption. A silent migration and
according documentation for custom web server configurations is added.
A deprecation layer (for non-adapted systems) is in place that rewrites
the server environment variables passed to `/typo3/index.php` as if
`/index.php` was used directly. This layer will be removed in TYPO3 v14.

This change does not take assets into account, only routing is adapted.
That means composer mode will use assets provided via _assets as before
and TYPO3 classic mode will serve backend assets from /typo3/* even if
another backend URL is used and configured.

In composer mode there is an additional opt-out for the installation of
the legacy entrypoint for that can be defined in composer.json:

  "extra": {
    "typo3/cms": {
      "install-deprecated-typo3-index-php": false
    }
  }

The application flow is slightly adapted by moving common middlewares
into a separate core middleware chain. This chain is dispatched by a
distinct core HTTP application (which is invoked by index.php).
These middlewares are suitable for proxy determination or generic
access control – basically everything not needed for subrequests.
The core HTTP request handler then decides whether the request is to be
routed to the frontend or backend application. Frontend and backend
appplications are still designed to work independently with a plain
PSR-7 Server Request in order for sub requests from backend to frontend
(or vice versa) to work.

The following diagram outlines the new application workflow including
flow of possible sub requests (not yet used from backend to frontend,
but it shows how they are intended to be invoked):

                         +-------------------+
                         |                   |
                         |  Core HTTP        |
                         |  Application      |
                         |                   |
                         +---------+---------+
                                   |
                                   |
                                   v
                         +---------+---------+
                         |                   |
                         |  Core HTTP        |
                         |  Middlewares      |
                         |                   |
                         +---------+---------+
                                   |
                                   |
                                   v
                         +---------+---------+
                         |                   |
                         |  Core HTTP        |
           +-------------+  Request Handler  +--------------+
           |             |                   |              |
           |             +-------------------+              |
           |                                                |
           v                                                v
  +--------+----------+                           +---------+---------+
  |                   | (Sub Request)             |                   |
  |  Frontend HTTP    +<-------------+            |  Backend HTTP     |
  |  Application      +<-----------+ |            |  Application      |
  |                   |            | |            |                   |
  +---------+---------+            | |            +---------+---------+
            |                      | |                      |
            |                      | |                      |
            v                      | |                      v
  +---------+---------+            | |            +---------+---------+
  |                   |            | |            |                   |
  |  Frontend HTTP    |            | |            |  Backend HTTP     |
  |  Middlewares      |            | |            |  Middlewares      |
  |                   |            | |            |                   |
  +---------+---------+            | |            +---------+---------+
            |                      | |                      |
            |                      | |                      |
            v                      | |                      v
  +---------+---------+            | |            +---------+---------+
  |                   |            | |            |                   |
  |  Frontend HTTP    |            | |            |  Backend HTTP     |
  |  Request Handler  |            | |            |  Request Handler  |
  |                   |            | |            |                   |
  +---------+---------+            | |            +---------+---------+
            |                      | |                      |
            |                      | |                      |
            v                      | |                      v
  +---------+---------+            | |            +---------+---------+
  |                   |            | |            |                   |
  |  TypoScript       |            | |            |  Backend Route    |
  |  Frontend         +------------+ |            |  Dispatcher       |
  |  Controller       |              |            |                   |
  |                   |              |            +---------+---------+
  +-------------------+              |                      |
                                     |                      |
                                     |                      v
                                     |            +---------+---------+
                                     |            |                   |
                                     |            |  Backend          |
                                     +------------+  Controller       |
                                                  |                   |
                                                  +-------------------+

Commands executed:
  # For changed in https://github.com/TYPO3/testing-framework/pull/533
  composer req --dev "typo3/testing-framework":"dev-main"

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 61

Show 41 more files