diff --git a/.github/workflows/link-validator.yml b/.github/workflows/link-validator.yml new file mode 100644 index 0000000000..8c60966835 --- /dev/null +++ b/.github/workflows/link-validator.yml @@ -0,0 +1,42 @@ +name: Link Validator + +on: + pull_request: + workflow_dispatch: + schedule: + - cron: '0 6 * * 1' + +permissions: + contents: read + +jobs: + validate-links: + runs-on: ubuntu-22.04 + if: github.event.repository.fork == false + steps: + - name: Checkout + # https://github.com/actions/checkout/releases + # v4.1.1 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 + with: # https://github.com/olafurpg/setup-scala#faster-checkout-of-big-repos + fetch-depth: 100 + fetch-tags: true + + - name: Cache Coursier cache + # https://github.com/coursier/cache-action/releases + # v6.4.5 + uses: coursier/cache-action@1ff273bff02a8787bc9f1877d347948af647956d + + - name: Set up JDK 11 + # https://github.com/coursier/setup-action/releases + # v1.3.5 + uses: coursier/setup-action@7bde40eee928896f074dbb76d22dd772eed5c65f + with: + jvm: temurin:1.11 + apps: cs + + - name: sbt site + run: sbt docs/paradox + + - name: Run Link Validator + run: cs launch net.runne::site-link-validator:0.2.5 -- scripts/link-validator.conf diff --git a/build.sbt b/build.sbt index cf79f2db96..8386f74473 100644 --- a/build.sbt +++ b/build.sbt @@ -35,7 +35,7 @@ inThisBuild(Def.settings( val tagOrBranch = if (isSnapshot.value) "main" else "v" + version.value - Seq(("BUSL-1.1", url(s"https://raw.githubusercontent.com/akka/akka-http/${tagOrBranch}/LICENSE"))) + Seq(("BUSL-1.1", url(s"https://github.com/akka/akka-http/blob/${tagOrBranch}/LICENSE.txt"))) }, description := "Akka Http: Modern, fast, asynchronous, streaming-first HTTP server and client.", testOptions ++= Seq( @@ -512,7 +512,7 @@ lazy val docs = project("docs") apidocRootPackage := "akka", Formatting.docFormatSettings, ThisBuild / publishRsyncHost := "akkarepo@gustav.akka.io", - publishRsyncArtifacts := List((Compile / paradox).value -> gustavDir("docs").value), + publishRsyncArtifacts := List((Compile / paradox).value -> gustavDir("libraries").value), ) .settings(ParadoxSupport.paradoxWithCustomDirectives) diff --git a/docs/src/main/paradox/migration-guide/migration-guide-10.2.x.md b/docs/src/main/paradox/migration-guide/migration-guide-10.2.x.md index 26472448e3..4df95589c2 100644 --- a/docs/src/main/paradox/migration-guide/migration-guide-10.2.x.md +++ b/docs/src/main/paradox/migration-guide/migration-guide-10.2.x.md @@ -89,7 +89,7 @@ agent has been dropped in 10.2.0. HTTP/2 support therefore now requires to be ru The Scalatest dependency for akka-http-testkit was upgraded to version 3.1.0. This version is incompatible with previous versions. This is relevant for user code if it uses methods from @scaladoc[ScalatestUtils](akka.http.scaladsl.testkit.ScalatestUtils) -(which are in scope if your test extends from @scaladoc[ScalaTestRouteTest](akka.http.scaladsl.testkit.ScalaTestRouteTest)). +(which are in scope if your test extends from @scaladoc[ScalatestRouteTest](akka.http.scaladsl.testkit.ScalatestRouteTest)). In this case, the project itself needs to be updated to use Scalatest >= 3.1.0. ### Providing route settings, exception and rejection handling @@ -222,7 +222,7 @@ server connections you should create a @apidoc[HttpsConnectionContext] with the relevant configuration. Previously, the SSL configuration was constructed based on the parameters -you pass to @apidoc[HttpsConnectionContext$] and the logic and configuration +you pass to @apidoc[HttpsConnectionContext] and the logic and configuration used by the [ssl-config](https://lightbend.github.io/ssl-config/) library. This was because back then the default JDK SSL configuration was a bad match for HTTP connections. Nowadays, however, the JDK defaults are much better and the diff --git a/docs/src/main/paradox/quickstart-scala/index.md b/docs/src/main/paradox/quickstart-scala/index.md index 890862b482..d634455211 100644 --- a/docs/src/main/paradox/quickstart-scala/index.md +++ b/docs/src/main/paradox/quickstart-scala/index.md @@ -31,7 +31,7 @@ The Akka HTTP example for Scala is a zipped project that includes a sbt build fi * On Linux and MacOS systems, open a terminal and use the command `unzip` akka-quickstart-scala.zip. * On Windows, use a tool such as File Explorer to extract the project. -Alternatively, you can bootstrap a new project with Akka HTTP already configured using the [Giter8](http://www.foundweekends.org/giter8/) template directly via sbt: +Alternatively, you can bootstrap a new project with Akka HTTP already configured using the [Giter8](https://www.foundweekends.org/giter8/) template directly via sbt: ```sh sbt new akka/akka-http-quickstart-scala.g8 diff --git a/docs/src/main/paradox/routing-dsl/testkit.md b/docs/src/main/paradox/routing-dsl/testkit.md index 481fdfa6bf..78b24f597b 100644 --- a/docs/src/main/paradox/routing-dsl/testkit.md +++ b/docs/src/main/paradox/routing-dsl/testkit.md @@ -31,7 +31,7 @@ To use Akka HTTP TestKit, add the module to your project: @@@ div { .group-scala } Here is an example of what a simple test with the routing testkit might look like using the built-in support for -[scalatest](http://www.scalatest.org) and [specs2](http://etorreborre.github.io/specs2/): +[scalatest](https://www.scalatest.org) and [specs2](https://etorreborre.github.io/specs2/): ScalaTest : @@snip [FullTestKitExampleSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/FullTestKitExampleSpec.scala) { #source-quote } @@ -58,7 +58,7 @@ route structure defined in your service. The final element of the `~>` chain is a `check` call, which takes a block of assertions as parameter. In this block you define your requirements onto the result produced by your route after having processed the given request. Typically you use one of the defined "inspectors" to retrieve a particular element of the routes response and express assertions -against it using the test DSL provided by your test framework. For example, with [scalatest](http://www.scalatest.org), in order to verify that +against it using the test DSL provided by your test framework. For example, with [scalatest](https://www.scalatest.org), in order to verify that your route responds to the request with a status 200 response, you'd use the `status` inspector and express an assertion like this: diff --git a/scripts/link-validator.conf b/scripts/link-validator.conf new file mode 100644 index 0000000000..8e4d5ca743 --- /dev/null +++ b/scripts/link-validator.conf @@ -0,0 +1,37 @@ +// 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://doc.akka.io/libraries/akka-http/snapshot/" + replace = "/" + } + { + prefix = "https://doc.akka.io/api/akka-http/snapshot/" + replace = "/api/akka-http/snapshot/" + } + ] + + ignore-missing-local-files-regex = "" + + ignore-prefixes = [ + "https://repo.akka.io/maven" + "https://repo.akka.io/snapshots" + # GitHub will block with "429 Too Many Requests" + "https://github.com/" + # MVN repository forbids access after a few requests + "https://mvnrepository.com/artifact/" + "http://localhost:" + "http://example.com" + ] + + ignore-files = [] + + non-https-whitelist = [ + "http://restclient.net/" + ] +}