Link Mapper module
Edition |
Incubator (services) |
||
Issues |
|||
Git |
|||
Latest |
3.4.2
|
The Link Mapper module records incoming 404
requests in realtime. Editors can respond to each 404
with either 200
(hide the error), 302
, 301
(redirects), or 410
(gone) to tell servers to stop looking for it.
This module is at the INCUBATOR level.
|
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
<groupId>info.magnolia.linkmapper</groupId>
<artifactId>magnolia-linkmapper</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>info.magnolia.linkmapper</groupId>
<artifactId>magnolia-linkmapper</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>info.magnolia.linkmapper</groupId>
<artifactId>magnolia-linkmapper</artifactId>
<version>3.1</version>
</dependency>
Usage
Once installed and configured the link mapper module stores data on a 3rd party server. Data is being collected by the public instance(s) each time a 404
is detected. This data can then be consumed by the author instance (on-demand) in the 404Links app. Editors can examine the data and decide what redirect action (response) should be taken. These redirects can be published to the public instances much the same way virtual URI mappings are done. The difference here is that the virtual URI mappings are handled prior to rendering while the 404
redirects are handled after rendering.
Configuration
Property | Description |
---|---|
|
required To use the link mapper module you will need to obtain a client identifier from Magnolia. This identifier is used to track the data obtained by the filter. This property is set in the module config. |
|
required To be able to authenticate at the collection server you need the JWT token which can be found in the console after the startup of the collection server. |
|
required The base URL for the 3rd party service collecting the data. Also obtained from Magnolia along with the client identifier.
<decorating-module-name>/decorations/linkmapper/restClients/linkMapperService.yaml
|
404Links app
All Links
From the author instance, editors can use the 404Links app to view the data collected on the public instances by the broken links filter. Data is collected from the server using the Reload action. Broken links are displayed along with the corresponding site name and access count. Results can be filtered and sorted in a variety of different ways.
Each entry can be published to the public instances. Use the well known Publish action to trigger the publication. With the Archive Action, it is possible to move the link to the Archive Tab. If the link is accessed further the node will be automatically get unarchived after the next Reload.
The publication of a node is only available after setting the Target and Redirect Type. |
There is also an action available from the browser view to quickly blacklist an item. |
Archive
The archive list is there to ensure clarity in the main list even with longer use. The same search and filter functions are available. To edit a link, however, it is necessary to unarchive it. If an archived link is accessed again, it is automatically unarchived with the next Reload.
Dialog
The edit dialog offers the possibility to define a redirect type and a redirect target. It is also possible to evaluate a list of referers and query parameters.
Property | Description |
---|---|
|
Name of the Link shown in the table. |
|
Options:
|
|
Options:
|
|
Original name from first reload. |
|
URL which was causing the |
When editing an item you can see referrers and query parameters of the request that led to the 404. This is sometimes helpful to fight broken links coming from within the system. |
Collection server
The quarkus collection server only works with version >=3.2.2 .
|
The collection server was developed using the Quarkus framework and is available for download from the link below. The server includes a docker file to create a deployable container.
As a database for collecting the information, a PostgreSQL server is needed. The connection to this database can be passed by parameter or configured in the server in the application.properties file.
Repository
You can clone down the linkmapper postgresql repo:
git clone ssh://git@git.magnolia-cms.com/services/linkmapper-quarkus-postgresql.git
Configuration
The following parameters can be configured:
Parameter | Description |
---|---|
|
required, default is The log level of the root category, which is used as the default log level for all categories. |
|
required, default is The HTTP port. |
|
required The PostgreSQL datasource username. |
|
required The PostgreSQL datasource password. |
|
required The PostgreSQL datasource URL. |
|
required, default is The datasource pool maximum size. |
|
required, default is If set to true the server will drop all tables in the datasource and recreate them on server startup. |
|
required, default is If set to true the server creates a new public/private key pair for the jwt authentication on server startup. When this happens every token generates before is getting invalid. On the first server startup, a fresh key pair will be generated even if this property is set false. |
Security
At every server start, a valid jwt token is generated and written to the server console. Tokens are valid until a new public/private key pair is generated. See Collection server.
For the connection to the collection, server to work a valid token must be entered in the Magnolia backend. See the configuration section above. |