Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent absolute links from adoc to www.jenkins.io and jenkins.io #5899

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ archive: generate
# Check Typo
#######################################################
check:
scripts/check-hard-coded-URL-references
curl -qsL https://github.com/crate-ci/typos/releases/download/v1.13.4/typos-v1.13.4-x86_64-unknown-linux-musl.tar.gz | tar xvzf - ./typos
curl -qsL https://github.com/halkeye/typos-json-to-checkstyle/releases/download/v0.1.1/typos-checkstyle-v0.1.1-x86_64 > typos-checkstyle && chmod 0755 typos-checkstyle
./typos --format json | ./typos-checkstyle - > checkstyle.xml || true
Expand Down
2 changes: 1 addition & 1 deletion content/events/hacktoberfest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ who have committed to assist contributors and to provide quick turnaround in pul
|=========================================================
|Project/component | Keywords | Ideas and links

| link:https://jenkins.io[Jenkins Website]
| link:/[Jenkins Website]
| Documentation, +
Asciidoc, +
CSS, +
Expand Down
2 changes: 1 addition & 1 deletion content/participate/report-issue.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ https://issues.jenkins.io/secure/Dashboard.jspa[the JIRA home page].
* For *Project* select:
** _Jenkins_ for general issues with Jenkins,
** _Security Issues_ if you want to report a security issue privately
* For _Infrastructure_, if you're reporting a bug with https://www.jenkins.io/projects/infrastructure/[a Jenkins service run by the Jenkins project], open an issue in the https://github.com/jenkins-infra/helpdesk/issues/new/choose[dedicated helpdesk on Github].
* For _Infrastructure_, if you're reporting a bug with link:/projects/infrastructure/[a Jenkins service run by the Jenkins project], open an issue in the https://github.com/jenkins-infra/helpdesk/issues/new/choose[dedicated helpdesk on Github].
* Enter a short but meaningful description of your problem as *Summary*.
* For *Priority*, see
https://issues.jenkins.io/secure/ShowConstantsHelp.jspa?decorator=popup#PriorityLevels[here]
Expand Down
4 changes: 2 additions & 2 deletions content/participate/test.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ See the jira:WEBSITE-662[] EPIC for tasks related to this page, contributions ar

- Pull Requests - link:https://ci.jenkins.io/job/Core/job/jenkins/view/change-requests/[https://ci.jenkins.io/job/Core/job/jenkins/view/change-requests/]

- Weekly Release - link:/download/[https://jenkins.io/download/]
- Weekly Release - link:/download/[weekly downloads]

- Quarterly Long Term Support Release Candidate - link:http://mirrors.jenkins.io/war-stable-rc/[http://mirrors.jenkins.io/war-stable-rc/]

- Quarterly Long Term Support Release - link:/download/[https://jenkins.io/download/]
- Quarterly Long Term Support Release - link:/download/[LTS downloads]

==== Jenkins Plugins
- Pull request builds from link:https://ci.jenkins.io/job/Plugins/[ci.jenkins.io]
2 changes: 1 addition & 1 deletion content/project/conduct.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Technical criticism is always appreciated. Keep it positive and constructive. Do

Everything hosted under link:/[jenkins.io], link:https://jenkins-ci.org/[jenkins-ci.org] and their sub-domains such as:

* link:https://jenkins.io[jenkins.io]
* link:/[jenkins.io]
* link:https://issues.jenkins.io/[issues.jenkins.io]
* link:https://stories.jenkins.io/[stories.jenkins.io]

Expand Down
2 changes: 1 addition & 1 deletion content/project/team-leads.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Coordinates the security-related activities in the Jenkins project. This is an *
* Publish link:https://wiki.jenkins.io/display/JENKINS/Security+Advisorie[Security Advisories] (including CVE IDs and CVSS) and notify the link:https://groups.google.com/forum/#!forum/jenkinsci-advisories[mailing list]
* Drive security policy definition/changes in the community
* Represent the Jenkins project on security topics with third parties
* Represent the https://www.jenkins.io/security/cna/[Jenkins CNA].
* Represent the link:/security/cna/[Jenkins CNA].

[[infrastructure]]
### Infrastructure Officer
Expand Down
2 changes: 1 addition & 1 deletion content/redirect/oracle-account-signup.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
layout: redirect
redirect_url: https://jenkins.io/oracleAccountSignup # TODO get rid of double redirect
redirect_url: /oracleAccountSignup # TODO get rid of double redirect
---
2 changes: 1 addition & 1 deletion content/redirect/pipeline-cps-method-mismatches.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
layout: redirect
redirect_url: https://www.jenkins.io/doc/book/pipeline/cps-method-mismatches/
redirect_url: /doc/book/pipeline/cps-method-mismatches/
---
2 changes: 1 addition & 1 deletion content/security/plugins.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ This typically is the case when plugins have particularly severe security vulner
* Literate (`literate`): link:/security/advisory/2020-03-09/#SECURITY-1750[SECURITY-1750]
* Nerrvana (`nerrvana`): link:/security/advisory/2020-10-08/#SECURITY-2097[SECURITY-2097]
* Persona (`persona`): link:/security/advisory/2020-10-08/#SECURITY-2046[SECURITY-2046]
* Pipeline: Classpath Step (`pipeline-classpath`): https://www.jenkins.io/security/advisory/2017-03-20/#pipeline-classpath-step-plugin-allowed-script-security-sandbox-bypass[SECURITY-336]
* Pipeline: Classpath Step (`pipeline-classpath`): link:/security/advisory/2017-03-20/#pipeline-classpath-step-plugin-allowed-script-security-sandbox-bypass[SECURITY-336]
* Pipeline: Phoenix AutoTest (`phoenix-autotest`): link:/security/advisory/2022-03-29/[multiple vulnerabilities announced on 2022-03-29]
* Puppet Enterprise Pipeline (`puppet-enterprise-pipeline`): link:/security/advisory/2019-10-16/#SECURITY-918[SECURITY-918]
* Reactor (`reactor`): link:/security/advisory/2017-04-10/#reactor-plugin[SECURITY-487]
Expand Down
2 changes: 1 addition & 1 deletion content/security/reporting.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Please report issues present in the following components:
* Jenkins, including installers and Docker images published by the Jenkins project
* Jenkins plugins published by the Jenkins project (listed on https://plugins.jenkins.io/[plugins.jenkins.io] and/or hosted in https://github.com/jenkinsci[the jenkinsci GitHub organization])
* Additional components published by the Jenkins project for general use, such as Docker images
* Jenkins infrastructure projects, such as https://www.jenkins.io/[jenkins.io] or more generally the repositories hosted in the https://github.com/jenkins-infra[jenkins-infra GitHub organization]
* Jenkins infrastructure projects, such as link:/[jenkins.io] or more generally the repositories hosted in the https://github.com/jenkins-infra[jenkins-infra GitHub organization]


The following components are out of scope:
Expand Down
2 changes: 1 addition & 1 deletion content/solutions/php.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ file (`phpcs.xml`):
----

You can then fine-tune the failure conditions using the
https://www.jenkins.io/doc/pipeline/steps/warnings-ng/[Warnings-NG pipeline configuration]
link:/doc/pipeline/steps/warnings-ng/[Warnings-NG pipeline configuration]

==== Results Caching

Expand Down
2 changes: 1 addition & 1 deletion content/templates/updates.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ See https://github.com/jenkins-infra/update-center2/tree/master/site[OSS Update
The experimental plugin site is located at https://updates.jenkins.io/experimental/[https://updates.jenkins.io/experimental/].
Configure `+https://updates.jenkins.io/experimental/update-center.json+` in Jenkins to receive experimental releases (those with `alpha` or `beta` in their version numbers).

See https://www.jenkins.io/doc/developer/publishing/releasing-experimental-updates/[Publishing Experimental Plugin Releases] for more information.
See link:/doc/developer/publishing/releasing-experimental-updates/[Publishing Experimental Plugin Releases] for more information.

This update site always serves the latest releases, which may be incompatible with your version of Jenkins.

Expand Down
39 changes: 39 additions & 0 deletions scripts/check-hard-coded-URL-references
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# Report adoc files that use https://www.jenkins.io or https://jenkins.io

# Site development depends on links being relative to the current site
# so that we can show the site on a developer desktop or in the preview
# sites without links that jump to the original site.

# See https://github.com/jenkins-infra/jenkins.io/issues/5718
# See also https://github.com/jenkins-infra/jenkins.io/pull/5715

# Returns 0 if no issues are detected
# Returns 1 if one or more adoc files include https://www.jenkins.io
# Returns 2 if one or more adoc files include https://jenkins.io
# Returns 3 if both https://www.jenkins.io and https://jenkins.io are found

return_code=0

files=$(git grep -l https://www.jenkins.io -- content/[a-zA-Z]**/*.adoc)
if [ "$files" != "" ]; then
echo "ERROR: incorrectly used https://www.jenkins.io in ${files}"
echo
echo "See https://github.com/jenkins-infra/jenkins.io/issues/5718"
echo "See also https://github.com/jenkins-infra/jenkins.io/pull/5715"
echo
return_code=1
fi

files=$(git grep -l https://jenkins.io -- content/[a-zA-Z]**/*.adoc)
if [ "$files" != "" ]; then
echo "ERROR: incorrectly used https://jenkins.io in ${files}"
echo
echo "See https://github.com/jenkins-infra/jenkins.io/issues/5718"
echo "See also https://github.com/jenkins-infra/jenkins.io/pull/5715"
echo
return_code=$(( return_code + 2 ))
fi

exit $return_code