Files
KantSites/config/services.yaml
T
kantarciandClaude Opus 5 3b1dfc0948 Set the site address in the administration, checked against the installation itself
- System > This installation > Address has a field and a link to the other
  spelling (with or without www), like the WordPress address. It writes
  SITE_ORIGIN to .env through Environment::write and takes effect on the
  next request. With SITE_ORIGIN from the server environment there is no
  field, and a POST is refused.
- Before saving, OriginCheck requests /.well-known/kantsites-origin under the
  new address; it has to return an HMAC of APP_SECRET that only this
  installation knows. Switching to www without DNS or certificate would
  otherwise send every page, the administration included, nowhere. "Save
  anyway" appears only after a refusal. The probe also answers during
  maintenance.
- The message says when the administration changes host and needs a new
  sign-in, since the session cookie belongs to one spelling.

Tests: 584 PHPUnit on PHP 8.2 and 8.4, 35 node, test:editor and
test:browser green (test:browser reports only the known editor colour
contrast on /grundlagen).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 08:36:38 +02:00

151 lines
6.2 KiB
YAML

parameters:
# Die Adresse der Verwaltung. Standard bleibt /admin; wer sie aendert, nimmt Scannern und
# Anmeldeversuchen das Ziel - erraten laesst sie sich nicht mehr. Sie steht in der Umgebung und
# nicht in der Datenbank, weil die Routen beim Start feststehen muessen. Geaendert wird sie
# ueber `php bin/console cms:admin:path <neu>`; der Befehl prueft und raeumt den Cache auf.
kant.admin_path: '%env(string:default:kant.admin_path_default:ADMIN_PATH)%'
kant.admin_path_default: 'admin'
# Wo Schriften und Stylesheets liegen. Im Normalfall im oeffentlichen Ordner; ueber
# FONT_DIRECTORY und ASSET_DIRECTORY umstellbar - die Tests nutzen das, damit sie nicht in
# das Projekt schreiben, und eine Installation mit schreibgeschuetztem public/ ebenfalls.
kant.fonts_dir: '%kernel.project_dir%/public/assets/fonts'
kant.asset_dir: '%kernel.project_dir%/public/assets'
services:
_defaults:
autowire: true
autoconfigure: true
# Jede Aufgabe traegt sich selbst in den Plan ein: eine Klasse, die App\Ops\Tasks\Task
# implementiert, bekommt das Etikett und liegt beim naechsten Abgleich in der Tabelle. Eine
# neue Aufgabe ist damit eine Datei und keine Liste, die man an drei Stellen nachfuehrt.
_instanceof:
App\Ops\Tasks\Task:
tags: ['kant.task']
App\:
resource: '../src/'
exclude: '../src/{Kernel.php,Domain/}'
Doctrine\DBAL\Connection:
factory: ['App\Infrastructure\ConnectionFactory', 'create']
arguments: ['%env(projectdir:DATABASE_URL)%', '@App\Infrastructure\QueryCounter']
App\Controller\PageController:
arguments:
$secret: '%kernel.secret%'
$siteOrigin: '%env(SITE_ORIGIN)%'
# Mit oder ohne www entscheidet SITE_ORIGIN; die andere Schreibweise leitet dorthin um.
App\EventSubscriber\CanonicalHostSubscriber:
arguments:
$siteOrigin: '%env(SITE_ORIGIN)%'
App\Content\MediaLibrary:
arguments:
$directory: '%env(projectdir:MEDIA_DIRECTORY)%'
# Die Schriften liegen im oeffentlichen Ordner: sie sollen vom Webserver direkt ausgeliefert
# werden, ohne PHP dazwischen - das ist der Punkt der Uebung.
# Die Stellen, die wissen muessen, wie die Verwaltung heisst.
App\EventSubscriber\AdminHeadersSubscriber:
arguments:
$adminPath: '%kant.admin_path%'
App\EventSubscriber\PublicNotFoundSubscriber:
arguments:
$adminPath: '%kant.admin_path%'
App\Content\Statistics:
arguments:
$adminPath: '%kant.admin_path%'
App\Content\FontLibrary:
arguments:
$directory: '%env(default:kant.fonts_dir:FONT_DIRECTORY)%'
App\Content\StyleBundle:
arguments:
$assetDirectory: '%env(default:kant.asset_dir:ASSET_DIRECTORY)%'
App\Controller\FormController:
arguments:
$secret: '%kernel.secret%'
$siteOrigin: '%env(SITE_ORIGIN)%'
App\Controller\SeoController:
arguments:
$siteOrigin: '%env(SITE_ORIGIN)%'
$adminPath: '%kant.admin_path%'
App\Command\HealthCommand:
arguments:
$projectDir: '%kernel.project_dir%'
App\Controller\SystemController:
arguments:
$adminPath: '%kant.admin_path%'
$databaseUrl: '%env(DATABASE_URL)%'
$siteOrigin: '%env(SITE_ORIGIN)%'
$mediaDirectory: '%env(projectdir:MEDIA_DIRECTORY)%'
$projectDir: '%kernel.project_dir%'
App\Command\AdminPathCommand:
arguments:
$projectDir: '%kernel.project_dir%'
$adminPath: '%kant.admin_path%'
$environment: '%kernel.environment%'
# Eigene kurze Zeitgrenzen statt des Download-Dienstes mit denen fuer Releasearchive.
App\Ops\OriginCheck:
arguments:
$secret: '%kernel.secret%'
$download: null
App\Command\SiteOriginCommand:
arguments:
$projectDir: '%kernel.project_dir%'
$siteOrigin: '%env(SITE_ORIGIN)%'
App\Ops\ArchiveUpdate:
arguments:
$root: '%kernel.project_dir%'
App\Ops\Updater:
arguments:
$root: '%kernel.project_dir%'
$databaseUrl: '%env(projectdir:DATABASE_URL)%'
App\EventSubscriber\InstallSubscriber:
arguments:
$projectDir: '%kernel.project_dir%'
App\EventSubscriber\MaintenanceSubscriber:
arguments:
$projectDir: '%kernel.project_dir%'
$adminPath: '%kant.admin_path%'
App\Ops\Installation:
arguments:
$root: '%kernel.project_dir%'
$mediaDirectory: '%env(projectdir:MEDIA_DIRECTORY)%'
$secret: '%kernel.secret%'
App\Ops\Backup:
arguments:
$root: '%kernel.project_dir%'
$databaseUrl: '%env(projectdir:DATABASE_URL)%'
$mediaDirectory: '%env(projectdir:MEDIA_DIRECTORY)%'
# Der Aufgabenplan. Die Aufgaben kommen ueber ihr Etikett herein, damit diese Stelle nicht
# jedes Mal mitwaechst.
App\Ops\Scheduler:
arguments:
$tasks: !tagged_iterator kant.task
$projectDir: '%kernel.project_dir%'
App\Ops\Tasks\CleanupTask:
arguments:
$projectDir: '%kernel.project_dir%'
App\EventSubscriber\TaskWorkerSubscriber:
arguments:
$projectDir: '%kernel.project_dir%'
$adminPath: '%kant.admin_path%'
App\Controller\TaskController:
arguments:
$secret: '%kernel.secret%'
App\Controller\CronController:
arguments:
$secret: '%kernel.secret%'
App\Infrastructure\QueryCounter: ~
# `%env(projectdir:...)%`: ersetzt nur %kernel.project_dir%. Symfonys `resolve:` laese ein
# prozentkodiertes MySQL-Passwort (`p%40ss`) als Parameter und brauche den Container.
App\Infrastructure\ProjectDirEnvProcessor:
arguments:
$projectDir: '%kernel.project_dir%'
App\EventSubscriber\QueryHeaderSubscriber:
arguments:
$environment: '%kernel.environment%'
App\Plugin\PluginRegistry:
arguments:
$projectDir: '%kernel.project_dir%'
App\Twig\PluginExtension:
arguments:
$loader: '@twig.loader.native_filesystem'