diff --git a/.github/workflows/link-validator.yml b/.github/workflows/link-validator.yml new file mode 100644 index 00000000..0a49b0b2 --- /dev/null +++ b/.github/workflows/link-validator.yml @@ -0,0 +1,41 @@ +name: Link Validator + +permissions: {} + +on: + pull_request: + workflow_dispatch: + schedule: + - cron: '0 6 * * 1' + +jobs: + validate-links: + runs-on: ubuntu-20.04 + if: github.repository == 'apache/incubator-pekko-management' + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Checkout GitHub merge + if: github.event.pull_request + run: |- + git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch + git checkout scratch + + - name: Setup Java 8 + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 + + - name: Cache Coursier cache + uses: coursier/cache-action@v6.4.0 + + - name: Setup Coursier + uses: coursier/setup-action@v1.3.3 + + - name: Create the Pekko site + run: sbt "unidoc; docs/paradox" + + - name: Run Link Validator + run: cs launch net.runne::site-link-validator:0.2.2 -- scripts/link-validator.conf diff --git a/build.sbt b/build.sbt index 4f9b2f29..1dcc424e 100644 --- a/build.sbt +++ b/build.sbt @@ -290,8 +290,7 @@ lazy val docs = project "scaladoc.pekko.base_url" -> s"https://pekko.apache.org/api/pekko/current/", "extref.pekko-http.base_url" -> s"https://pekko.apache.org/docs/pekko-http/current/%s", "scaladoc.pekko.http.base_url" -> s"https://pekko.apache.org/api/pekko-http/current/", - "extref.pekko-grpc.base_url" -> s"https://pekko.apache.org/docs/pekko-grpc/current/%s", - "scaladoc.akka.management.base_url" -> s"/${(Preprocess / siteSubdirName).value}/"), + "extref.pekko-grpc.base_url" -> s"https://pekko.apache.org/docs/pekko-grpc/current/%s"), Compile / paradoxMarkdownToHtml / sourceGenerators += Def.taskDyn { val targetFile = (Compile / paradox / sourceManaged).value / "license-report.md" diff --git a/docs/src/main/paradox/bootstrap/istio.md b/docs/src/main/paradox/bootstrap/istio.md index 44d14b36..daad74d6 100644 --- a/docs/src/main/paradox/bootstrap/istio.md +++ b/docs/src/main/paradox/bootstrap/istio.md @@ -6,7 +6,7 @@ To bootstrap a Pekko cluster in Istio, Istio must be configured to allow Pekko c It is important to be aware that since Istio's proxy is bypassed, the Pekko cluster communication will not be secured by Istio using TLS. If you wish to secure your cluster communication, you will need to configure [Pekko remoting with mTLS](https://pekko.apache.org/docs/pekko/current/remoting-artery.html#remote-security) yourself. -Booting a Pekko cluster in Istio requires a minimum Istio version of 1.2.0, as it requires the outbound port exclusions feature that was added in there. It also requires using the @ref[Kubernetes API](kubernetes-api.md) contact point discovery method to be used. The instructions below are for the additional configuration necessary to ensure an Akka cluster can be bootstrapped in Istio. +Booting a Pekko cluster in Istio requires a minimum Istio version of 1.2.0, as it requires the outbound port exclusions feature that was added in there. It also requires using the @ref[Kubernetes API](kubernetes-api.md) contact point discovery method to be used. The instructions below are for the additional configuration necessary to ensure a Pekko cluster can be bootstrapped in Istio. ## Allowing outbound communication diff --git a/docs/src/main/paradox/discovery/kubernetes.md b/docs/src/main/paradox/discovery/kubernetes.md index fc61a7aa..e293c440 100644 --- a/docs/src/main/paradox/discovery/kubernetes.md +++ b/docs/src/main/paradox/discovery/kubernetes.md @@ -110,7 +110,7 @@ spec: ### Role-Based Access Control -If your Kubernetes cluster has [Role-Based Access Control (RBAC)](https://kubernetes.io/docs/admin/authorization/rbac/) +If your Kubernetes cluster has [Role-Based Access Control (RBAC)](https://kubernetes.io/docs/reference/access-authn-authz/rbac/) enabled, you'll also have to grant the Service Account that your pods run under access to list pods. The following configuration can be used as a starting point. It creates a `Role`, `pod-reader`, which grants access to query pod information. It then binds the default Service Account to the `Role` by creating a `RoleBinding`. diff --git a/docs/src/main/paradox/kubernetes-deployment/building-using-maven.md b/docs/src/main/paradox/kubernetes-deployment/building-using-maven.md index a8b012f8..0a6a4ad4 100644 --- a/docs/src/main/paradox/kubernetes-deployment/building-using-maven.md +++ b/docs/src/main/paradox/kubernetes-deployment/building-using-maven.md @@ -99,7 +99,7 @@ To build and publish the image run the following. The Docker username and regist Note that the registry to push to must include the username, for example `-Ddocker.registry=docker.io/youruser`. -Security information (i.e. user and password) can be specified in multiple ways as described in section [docker-maven-plugin authentication](http://dmp.fabric8.io/#authentication). +Security information (i.e. user and password) can be specified in multiple ways as described in section [docker-maven-plugin authentication](https://dmp.fabric8.io/#authentication). ``` mvn -Ddocker.username= -Ddocker.registry=/ package docker:push diff --git a/docs/src/main/paradox/kubernetes-deployment/deploying.md b/docs/src/main/paradox/kubernetes-deployment/deploying.md index e825c845..8eac4790 100644 --- a/docs/src/main/paradox/kubernetes-deployment/deploying.md +++ b/docs/src/main/paradox/kubernetes-deployment/deploying.md @@ -150,7 +150,7 @@ for 'hello world': kubectl expose deployment appka --type=LoadBalancer --name=appka-service -You can inspect the Pekko Cluster membership status with the [Cluster HTTP Management](https://doc.pekko.io/docs/pekko-management/current/cluster-http-management.html). +You can inspect the Pekko Cluster membership status with the @ref:[Cluster HTTP Management](../cluster-http-management.md). curl http://127.0.0.1:7626/cluster/members/ diff --git a/docs/src/main/paradox/kubernetes-deployment/preparing-for-production.md b/docs/src/main/paradox/kubernetes-deployment/preparing-for-production.md index 47a5673b..0f6f7f46 100644 --- a/docs/src/main/paradox/kubernetes-deployment/preparing-for-production.md +++ b/docs/src/main/paradox/kubernetes-deployment/preparing-for-production.md @@ -66,7 +66,7 @@ spec: Here are a few things to note: * We're using a Kubernetes deployment. Deployments are logical groupings of pods that represent a single service using the same template. - They support [configurable rolling updates](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#deploymentstrategy-v1-apps), + They support [configurable rolling updates](https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-intro/), meaning the cluster will be gradually upgraded, rather than upgrading every node at once and incurring an outage. * We label the pod in the `template` with `app: appka`. This must match the ActorSystem name so that @ref[Pekko Bootstrap](../bootstrap/index.md) finds the other nodes in the cluster. * The image we're using is `pekko-sample-cluster-kubernetes:latest`. This corresponds to the name and version of the service in our build. diff --git a/docs/src/main/paradox/loglevels/logback.md b/docs/src/main/paradox/loglevels/logback.md index f6ae94e0..aa9dafe9 100644 --- a/docs/src/main/paradox/loglevels/logback.md +++ b/docs/src/main/paradox/loglevels/logback.md @@ -6,7 +6,7 @@ Dynamic Log Levels for Logback hooks into Pekko Management and provides a route @@project-info{ projectId="management-loglevels-logback" } -Requires @ref:[Pekko Management](../pekko-management.md) and that the application uses [Logback](http://logback.qos.ch) as logging backend. +Requires @ref:[Pekko Management](../pekko-management.md) and that the application uses [Logback](https://logback.qos.ch) as logging backend. @@dependency[sbt,Gradle,Maven] { symbol1=PekkoManagementVersion diff --git a/management-pki/src/main/scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala b/management-pki/src/main/scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala index 79eadc3b..8c99d3da 100644 --- a/management-pki/src/main/scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala +++ b/management-pki/src/main/scala/org/apache/pekko/pki/kubernetes/PemManagersProvider.scala @@ -35,7 +35,7 @@ import scala.util.Random * INTERNAL API * Convenience methods to ease building an SSLContext from k8s-provided PEM files. */ -// Duplicate from https://github.com/akka/akka/blob/31f654768f86db68f4c22daa2cbd0bae28fc1fad/akka-remote/src/main/scala/akka/remote/artery/tcp/ssl/PemManagersProvider.scala#L35 +// Duplicate from https://github.com/apache/incubator-pekko/blob/964dcf53eb9a81a65944a1b1d51575091fe0a031/remote/src/main/scala/org/apache/pekko/remote/artery/tcp/ssl/PemManagersProvider.scala // Eventually that will be a bit more open and we can reuse the class from Pekko in pekko-management. // See also https://github.com/akka/akka-http/issues/3772 @InternalApi diff --git a/scripts/link-validator.conf b/scripts/link-validator.conf new file mode 100644 index 00000000..5c1ed883 --- /dev/null +++ b/scripts/link-validator.conf @@ -0,0 +1,86 @@ +// config for https://github.com/ennru/site-link-validator/ +site-link-validator { + root-dir = "docs/target/paradox/site/main/" + # relative to `root-dir` + start-file = "index.html" + + # Resolves URLs with the given prefix as local files instead + link-mappings = [ + { + prefix = "https://pekko.apache.org/docs/pekko/current/" + replace = "" + } + # ScalaDoc from unidoc + { + prefix = "https://pekko.apache.org/api/pekko-management/current/" + replace = "/../../../../../target/scala-2.13/unidoc/" + } + { + prefix = "https://pekko.apache.org/api/pekko-management/current/" + replace = "/../../../../../target/scala-2.13/unidoc/" + } + { + prefix = "https://pekko.apache.org/api/pekko-management/snapshot/" + replace = "/../../../../../target/scala-2.13/unidoc/" + } + ] + + ignore-missing-local-files-regex = "" + // e.g. "^api/alpakka/snapshot/pekko/stream/alpakka/googlecloud/storage/impl/Formats.*" + + ignore-prefixes = [ + # example in docs + "http://127.0.0.1" + # Fails after a number of requests with "403 Forbidden" + "https://javadoc.io/static/" + # GitHub will block with "429 Too Many Requests" + "https://github.com/" + # Github links generated by sbt-license-report + "http://github.com/" + # Other links generated by sbt-license-report + "http://asm.objectweb.org/" + "http://groovy.codehaus.org/" + "http://www.mockito.org" + "https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html" + # Occasionally returns a 500 Internal Server Error + "http://code.google.com/" + ] + + non-https-whitelist = [ + # license report + "http://ant.apache.org/" + "http://asm.objectweb.org/" + "http://asm.ow2.io/" + "http://commons.apache.org/" + "http://ezmorph.sourceforge.net" + "http://findbugs.sourceforge.net/" + "http://groovy.codehaus.org/modules/http-builder/" + "http://hamcrest.org/JavaHamcrest/" + "http://hc.apache.org/" + "http://jopt-simple.github.io/jopt-simple" + "http://json-lib.sourceforge.net" + "http://junit.org" + "http://maven.apache.org" + "http://nekohtml.sourceforge.net/" + "http://opensource.org/" + "http://parboiled.org" + "http://servlet-spec.java.net" + "http://wiremock.org" + "http://www.apache.org/license/" + "http://www.apache.org/licenses/" + "http://www.eclipse.org/legal/epl-v10.html" + "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" + "http://www.jetbrains.org" + "http://www.joda.org/joda-time/" + "http://www.mockito.org" + "http://www.opensource.org/licenses/bsd-license.php" + "http://www.opensource.org/licenses/mit-license.php" + "http://www.reactive-streams.org/" + "http://www.scala-lang.org/" + "http://www.scalatest.org" + "http://www.slf4j.org" + "http://xerces.apache.org/xerces2-j" + "http://xml.apache.org/" + ] + +}