Skip to content

Commit

Permalink
Merge branch 'develop' into permalink-versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
garvinhicking authored Nov 18, 2024
2 parents 24e6b7f + 5033747 commit 046312d
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 79 deletions.
11 changes: 1 addition & 10 deletions .ddev/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,23 @@

/**/*.example
/.dbimageBuild
/.dbimageExtra
/.ddev-docker-*.yaml
/.*downloads
/.global_commands
/.homeadditions
/.importdb*
/.sshimageBuild
/.venv
/.webimageBuild
/.webimageExtra
/apache/apache-site.conf
/commands/.gitattributes
/commands/db/mysql
/commands/host/launch
/commands/web/xdebug
/commands/web/live
/config.local.y*ml
/db_snapshots
/import-db
/import.yaml
/mutagen/mutagen.yml
/mutagen/.start-synced
/nginx_full/nginx-site.conf
/postgres/postgresql.conf
/providers/acquia.yaml
/providers/lagoon.yaml
/providers/pantheon.yaml
/providers/platform.yaml
/providers/upsun.yaml
/sequelpro.spf
Expand Down
8 changes: 8 additions & 0 deletions .ddev/commands/web/live
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

## #ddev-generated
## Description: Run ddev-live inside the web container
## Usage: live [flags] [args]
## Example: "ddev live auth" or "ddev live list sites" or "ddev live --version"

ddev-live $@
55 changes: 36 additions & 19 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ type: php
docroot: public
php_version: "8.2"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
Expand All @@ -20,17 +18,21 @@ use_dns_when_possible: true
composer_version: "2"
web_environment: []
nodejs_version: "16"
corepack_enable: false

# Key features of DDEV's config.yaml:

# name: <projectname> # Name of the project, automatically provides
# http://projectname.ddev.site and https://projectname.ddev.site

# type: <projecttype> # drupal6/7/8, backdrop, typo3, wordpress, php
# type: <projecttype> # backdrop, craftcms, django4, drupal, drupal6, drupal7, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress
# See https://ddev.readthedocs.io/en/stable/users/quickstart/ for more
# information on the different project types
# "drupal" covers recent Drupal 8+

# docroot: <relative_path> # Relative path to the directory containing index.php.

# php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"
# php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"

# You can explicitly specify the webimage but this
# is not recommended, as the images are often closely tied to DDEV's' behavior,
Expand All @@ -40,9 +42,10 @@ nodejs_version: "16"

# database:
# type: <dbtype> # mysql, mariadb, postgres
# version: <version> # database version, like "10.4" or "8.0"
# MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0
# PostgreSQL versions can be 9-15.
# version: <version> # database version, like "10.11" or "8.0"
# MariaDB versions can be 5.5-10.8, 10.11, and 11.4.
# MySQL versions can be 5.5-8.0.
# PostgreSQL versions can be 9-17.

# router_http_port: <port> # Port to be used for http (defaults to global configuration, usually 80)
# router_https_port: <port> # Port for https (defaults to global configuration, usually 443)
Expand All @@ -60,6 +63,8 @@ nodejs_version: "16"
# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn

# timezone: Europe/Berlin
# If timezone is unset, DDEV will attempt to derive it from the host system timezone
# using the $TZ environment variable or the /etc/localtime symlink.
# This is the timezone used in the containers and by PHP;
# it can be set to any valid timezone,
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Expand All @@ -79,12 +84,17 @@ nodejs_version: "16"
# - preview
# - snapshot
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
# To reinstall Composer after the image was built, run "ddev debug refresh".
# To reinstall Composer after the image was built, run "ddev debug rebuild".

# nodejs_version: "18"
# change from the default system Node.js version to another supported version, like 14, 16, 18, 20.
# Note that you can use 'ddev nvm' or nvm inside the web container to provide nearly any
# Node.js version, including v6, etc.
# nodejs_version: "20"
# change from the default system Node.js version to any other version.
# See https://ddev.readthedocs.io/en/stable/users/configuration/config/#nodejs_version for more information
# and https://www.npmjs.com/package/n#specifying-nodejs-versions for the full documentation,
# Note that using of 'ddev nvm' is discouraged because "nodejs_version" is much easier to use,
# can specify any version, and is more robust than using 'nvm'.

# corepack_enable: false
# Change to 'true' to 'corepack enable' and gain access to latest versions of yarn/pnpm

# additional_hostnames:
# - somename
Expand Down Expand Up @@ -112,6 +122,13 @@ nodejs_version: "16"
# If true, turns off the normal warning that says
# "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set"

# ddev_version_constraint: ""
# Example:
# ddev_version_constraint: ">= 1.22.4"
# This will enforce that the running ddev version is within this constraint.
# See https://github.com/Masterminds/semver#checking-version-constraints for
# supported constraint formats

# working_dir:
# web: /var/www/html
# db: /home
Expand All @@ -136,8 +153,8 @@ nodejs_version: "16"
# - "mutagen": enables Mutagen for this project.
# - "nfs": enables NFS for this project.
#
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen
# See https://ddev.readthedocs.io/en/stable/users/install/performance/#nfs
# See https://ddev.readthedocs.io/en/stable/users/install/performance/#mutagen

# fail_on_hook_fail: False
# Decide whether 'ddev start' should be interrupted by a failing hook
Expand Down Expand Up @@ -190,13 +207,13 @@ nodejs_version: "16"

# disable_settings_management: false
# If true, DDEV will not create CMS-specific settings files like
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
# Drupal's settings.php/settings.ddev.php or TYPO3's additional.php
# In this case the user must provide all such settings.

# You can inject environment variables into the web container with:
# web_environment:
# - SOMEENV=somevalue
# - SOMEOTHERENV=someothervalue
# - SOMEENV=somevalue
# - SOMEOTHERENV=someothervalue

# no_project_mount: false
# (Experimental) If true, DDEV will not mount the project into the web container;
Expand Down Expand Up @@ -248,10 +265,10 @@ nodejs_version: "16"
# override_config: false
# By default, config.*.yaml files are *merged* into the configuration
# But this means that some things can't be overridden
# For example, if you have 'nfs_mount_enabled: true'' you can't override it with a merge
# For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge
# and you can't erase existing hooks or all environment variables.
# However, with "override_config: true" in a particular config.*.yaml file,
# 'nfs_mount_enabled: false' can override the existing values, and
# 'use_dns_when_possible: false' can override the existing values, and
# hooks:
# post-start: []
# or
Expand Down
89 changes: 49 additions & 40 deletions config/nginx/redirects.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,36 @@ location = /Home/Extensions.html {
# Add short links

location = /installation {
return 303 /m/typo3/tutorial-getting-started/main/en-us/Installation/Index.html;
return 303 /m/typo3/reference-coreapi/main/en-us/Administration/Installation/Install.html;
}

location = /upgrade {
return 303 /m/typo3/guide-installation/main/en-us/;
return 303 /m/typo3/reference-coreapi/main/en-us/Administration/Upgrade/Index.html;
}

location = /system-requirements {
return 303 /m/typo3/guide-installation/main/en-us/In-depth/SystemRequirements/Index.html;
return 303 /m/typo3/reference-coreapi/main/en-us/Administration/Installation/SystemRequirements/Index.html;
}

location = /core-contribution {
return 303 /m/typo3/guide-contributionworkflow/main/en-us/;
}

# Rewrite Upgrade guide links to new position in TYPO3 explained
location ~ ^/m/typo3/guide-installation/(main|13.4|12.4)/en-us/(.*)$ {
return 303 /m/typo3/reference-coreapi/$1/en-us/Administration/Upgrade/$2;
}

# Rewrite TypoScript in 45 min guide links to new position in TypoScript reference
location ~ ^/m/typo3/tutorial-typoscript-in-45-minutes/(main|13.4|12.4)/en-us/(.*)$ {
return 303 /m/typo3/reference-typoscript/$1/en-us/Guide/$2;
}

# Move TypoScript Syntax into TypoScript reference
location ~ ^/m/typo3/reference-coreapi/(main|13.4|12.4)/en-us/Configuration/TypoScript/Syntax/(.*)/Index.html$ {
return 303 /m/typo3/reference-typoscript/$1/en-us/Syntax/$2/Index.html;
}

# Rewrite Fluid VH reference links to new position
location ~ ^/typo3cms/ViewHelperReference/latest(.*)$ {
return 303 /other/typo3/view-helper-reference/main/en-us$1;
Expand All @@ -90,6 +105,11 @@ location ~ ^/typo3cms/ViewHelperReference(.*)$ {
return 303 /other/typo3/view-helper-reference/main/en-us$1;
}

# Redirect from 1.0 to main in how to document
location ~ ^/m/typo3/docs-how-to-document/1.0/en-us/(.*) {
return 303 /m/typo3/docs-how-to-document/main/en-us/$1;
}

# Redirect from old rest reference to new
location ~ ^/m/typo3/docs-how-to-document/main/en-us/WritingReST/Reference/(.*) {
return 303 /m/typo3/docs-how-to-document/main/en-us/Reference/ReStructuredText/$1;
Expand Down Expand Up @@ -160,7 +180,7 @@ location ~ ^/m/typo3/reference-coreapi/(main|11.5)/en-us/ApiOverview/UpdateWizar
}

location ~ ^/m/typo3/reference-coreapi/(main|11.5|10.4)/en-us/TypoScriptSyntax(.*) {
return 303 /m/typo3/reference-coreapi/$1/en-us/Configuration/TypoScriptSyntax$2;
return 303 /m/typo3/reference-typoscript/$1/en-us/Syntax$2;
}
location ~ ^/m/typo3/reference-coreapi/(main|11.5|10.4)/en-us/ApiOverview/Hooks(.*) {
return 303 /m/typo3/reference-coreapi/$1/en-us/ApiOverview/Events$2;
Expand Down Expand Up @@ -484,10 +504,10 @@ location ~ ^/typo3cms/TyposcriptIn45MinutesTutorial/7.6(.*) {
return 303 /m/typo3/tutorial-typoscript-in-45-minutes/7.6/en-us$1;
}
location ~ ^/typo3cms/TyposcriptIn45MinutesTutorial/(master|main|stable|latest)(.*) {
return 303 /m/typo3/tutorial-typoscript-in-45-minutes/main/en-us$2;
return 303 /m/typo3/reference-typoscript/main/en-us/Guide/$2;
}
location ~ ^/typo3cms/TyposcriptIn45MinutesTutorial(.*) {
return 303 /m/typo3/tutorial-typoscript-in-45-minutes/main/en-us$1;
return 303 /m/typo3/reference-typoscript/main/en-us/Guide/$1;
}

# typo3/tutorial-templating-with-fluid
Expand Down Expand Up @@ -564,10 +584,10 @@ location ~ ^/m/typo3/reference-coding-guidelines/(6.2|7.6|8.7|9.5|master|main|st
# was merged into TYPO3 Explained and will be taken offline and archived
# >> redirect all to new location in reference-coreapi (301)
location ~ ^/typo3cms/TyposcriptSyntaxReference/(6.2|7.6|8.7|master|main|stable|latest)/.* {
return 301 /m/typo3/reference-coreapi/($1)/en-us/ApiOverview/TypoScriptSyntax/Index.html;
return 301 /m/typo3/reference-typoscript/($1)/en-us/Syntax/Index.html;
}
location ~ ^/m/typo3/reference-typoscript-syntax/(6.2|7.6|8.7|master|main|stable|latest)/.* {
return 303 /m/typo3/reference-coreapi/$1/en-us/ApiOverview/TypoScriptSyntax/Index.html;
return 303 /m/typo3/reference-typoscript/$1/en-us/Syntax/Index.html;
}

# typo3/reference-services
Expand Down Expand Up @@ -750,6 +770,11 @@ location ~ ^/typo3cms/extensions/core(.*) {
return 303 /c/typo3/cms-core/main/en-us$1;
}

# Redirect for any version of the Changelog to main. We only support the main branch here
location ~ ^/c/typo3/cms-core/(?!main)([^/]+)/en-us(.*) {
return 303 /c/typo3/cms-core/main/en-us$2;
}

# friendsoftypo3/adodb
location ~ ^typo3cms/extensions/adodb/8.4.0(.*) {
return 303 /p/friendsoftypo3/adodb/8.4/en-us$1;
Expand Down Expand Up @@ -880,42 +905,21 @@ location ~ ^/typo3cms/extensions/externalimport_tut/(master|latest|stable)/(.*)
return 303 /p/cobweb/externalimport_tut/main/en-us/$2;
}

# getting started rewrite 2021
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/GeneralPrinciples/(.*) {
return 303 /m/typo3/tutorial-getting-started/main/en-us/Concepts/Index.html;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/ListModule/(.*) {
return 303 /m/typo3/tutorial-editors/main/en-us/ListModule/Index.html;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/FileModule/(.*) {
return 303 /m/typo3/tutorial-editors/main/en-us/FileModule/Index.html;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/UserManagement/Index.html {
return 303 /m/typo3/tutorial-getting-started/main/en-us/Setup/BackendUsers.html;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/UserManagement/BackendPrivileges/Index.html {
return 303 /m/typo3/reference-coreapi/main/en-us/ApiOverview/AccessControl/Index.html;
# getting started rewrite 2024
location ~ ^/m/typo3/tutorial-getting-started/(main|13.4|12.4)/en-us/Installation/TutorialDdev.html {
return 303 https://docs.typo3.org/m/typo3/tutorial-getting-started/$1/en-us/Installation/Install.html;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/UserManagement/BackendUsers/Index.html {
return 303 /m/typo3/reference-coreapi/main/en-us/ApiOverview/AccessControl/UsersAndGroups/Index.html;
location ~ ^/m/typo3/tutorial-getting-started/(main|13.4|12.4)/en-us/UserManagement/(.*) {
return 303 https://docs.typo3.org/m/typo3/reference-coreapi/$1/en-us/Administration/UserManagement/$2;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/UserManagement/Groups/Index.html {
return 303 /m/typo3/reference-coreapi/main/en-us/ApiOverview/AccessControl/UsersAndGroups/Index.html;
location ~ ^/m/typo3/tutorial-getting-started/(main|13.4|12.4)/en-us/PermissionsManagement/(.*) {
return 303 https://docs.typo3.org/m/typo3/reference-coreapi/$1/en-us/Administration/PermissionsManagement/$2;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/UserManagement/PagePermissions/Index.html {
return 303 /m/typo3/reference-coreapi/main/en-us/ApiOverview/AccessControl/AccessControlOptions/Index.html#page-permissions;
location ~ ^/m/typo3/tutorial-getting-started/(main|13.4|12.4)/en-us/Installation/(TuneTYPO3|ReleaseIntegrity|Deployer/Index|Surf/Index|Magallanes/Index).html {
return 303 https://docs.typo3.org/m/typo3/reference-coreapi/$1/en-us/Administration/Installation/$2.html;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/UserManagement/UserSetup/Index.html {
return 303 /m/typo3/tutorial-getting-started/main/en-us/Setup/BackendUsers.html;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/OtherBackendModules/BackendLocalization/Index.html {
return 303 /m/typo3/tutorial-getting-started/draft/en-us/Setup/BackendLanguages.html;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/Templating/Index.html {
return 303 /m/typo3/tutorial-getting-started/draft/en-us/NextSteps/Index.html#fluid-templating;
}
location ~ ^/m/typo3/tutorial-getting-started/main/en-us/NextSteps/Developers/Index.html {
return 303 https://docs.typo3.org/Home/ExtensionManuals.html;
location ~ ^/m/typo3/tutorial-getting-started/(main|13.4|12.4)/en-us/en-us/Troubleshooting/(TYPO3|SystemModules|PHP|Database).html {
return 303 https://docs.typo3.org/m/typo3/reference-coreapi/$1/en-us/Administration/Troubleshooting/$2.html;
}

# TYPO3 release integrity guide as requestes by ohader
Expand Down Expand Up @@ -953,3 +957,8 @@ location ~ ^/p/aoepeople/crawler/(.*) {
location ~ ^/typo3cms/extensions/eventnews/(.*) {
return 303 /p/georgringer/eventnews/main/en-us/$2;
}

# contentblocks/content-blocks to friendsoftypo3/content-blocks
location ~ ^/p/contentblocks/content-blocks/(.*) {
return 303 /p/friendsoftypo3/content-blocks/main/en-us/$2;
}
26 changes: 17 additions & 9 deletions legacy_hook/src/DocumentationLinker.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
*/
final readonly class DocumentationLinker
{
private const MAIN_IDENTIFIER = 'main';

private FilesystemAdapter $cache;
private int $cacheTime;

Expand Down Expand Up @@ -138,19 +140,25 @@ public function redirectToLink(): Response
public function resolvePermalink(string $url): ResponseDescriber
{
if (preg_match(
'/^' .
'([a-z0-9\-_]+):' . // $repository
'([a-z0-9\-_]+)' . // $index
'(@[a-z0-9\.-]+)?' . // $version
'$/imsU',
$url,
$matches)
'/^' .
'([a-z0-9\-_]+):' . // $repository
'([a-z0-9\-_]+)' . // $index
'(@[a-z0-9\.-]+)?' . // $version
'$/imsU',
$url,
$matches)
) {
[, $repository, $index] = $matches;
$version = str_replace('@', '', $matches[3] ?? '') ?: 'main';
$version = str_replace('@', '', $matches[3] ?? '') ?: self::MAIN_IDENTIFIER;
$entrypoint = $this->resolveEntryPoint($repository, $version);
$objectsContents = $this->getObjectsFile($entrypoint);

if ($objectsContents === '' && $version !== self::MAIN_IDENTIFIER) {
// soft-fail to resolve a maybe not-yet released version to main.
$entrypoint = $this->resolveEntryPoint($repository, self::MAIN_IDENTIFIER);
$objectsContents = $this->getObjectsFile($entrypoint);
}

if ($objectsContents === '') {
return new ResponseDescriber(404, [], 'Invalid shortcode, no objects.inv.json found.');
}
Expand Down Expand Up @@ -205,7 +213,7 @@ private function parseInventoryForIndex(string $index, array $json): string
// std:confval + pagelink.html#some-entry
// to:
// pagelink.html#confval-some-entry
$link = str_replace('#', '#-' . $docNodeTypeParts[1], $indexMetaData[2]);
$link = str_replace('#', '#' . $docNodeTypeParts[1] . '-', $indexMetaData[2]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Extractor/ComposerJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class ComposerJson
{
private const ALLOWED_TYPO3_VERSIONS = ['6.2', '7.6', '8.7', '9.5', '10.4', '11.5', '12.4'];
private const ALLOWED_TYPO3_VERSIONS = ['6.2', '7.6', '8.7', '9.5', '10.4', '11.5', '12.4', '13.4'];

public function __construct(private readonly array $composerJson)
{
Expand Down

0 comments on commit 046312d

Please sign in to comment.