Skip to content

Commit

Permalink
fix(ci): validate and correct internal links
Browse files Browse the repository at this point in the history
  • Loading branch information
jceb committed May 30, 2024
1 parent 2a6bf18 commit a9e1d20
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 34 deletions.
4 changes: 4 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import starlightLinksValidator from 'starlight-links-validator'

import starlightOpenAPI, { openAPISidebarGroups } from 'starlight-openapi';

Expand Down Expand Up @@ -46,6 +47,9 @@ export default defineConfig({
collapsed: false,
},
]),
// Validate internal links
// Ocumentation: https://starlight-links-validator.vercel.app/getting-started/
starlightLinksValidator(),
],
sidebar: [
{ label: 'Introduction', link: '/' },
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@astrojs/starlight": "^0.23.1",
"astro": "^4.8.6",
"sharp": "^0.32.5",
"starlight-links-validator": "^0.9.0",
"starlight-openapi": "^0.6.3"
}
}
28 changes: 14 additions & 14 deletions docs/src/content/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ title: Configuration

The following settings are available:

| **Environment Variable Name** | **Description** | **Required** | **Default** | **Example** |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `DWS_OWNER` | DID of the server's owner | **yes** | | `did:key:z6MkrAvU5DpYtUjpJpohoKyKvWdbrQ1yyZcgM5TodLowsahP` |
| `DWS_ADDRESS` | Address that the service listens at | no | `127.0.0.1` | `0.0.0.0` |
| `DWS_BACKEND_FILE_STORE` | Path to the directory that holds the JSON DID files | no | `$PWD/did_store` | `/usr/web-id/did_store` |
| `DWS_BACKEND` | Storage backend, currently `mem` and `file` are implemented | no | `mem` | `file` |
| `DWS_EXTERNAL_HOSTNAME` | External DNS domain name that the server can be reached at | no | `localhost` | `example.com` |
| `DWS_EXTERNAL_PATH` | External path that the DIDs shall be served at | no | `/` | `/dids` |
| `DWS_EXTERNAL_PORT` | External port that the server can be reached at | no | `$DWS_PORT` if `$HOSTNAME == "localhost"`, otherwise `443` as required by the [specifiction](https://w3c-ccg.github.io/did-method-web/) | `3000` |
| `DWS_PORT` | Port that the service listens at | no | `3000` | `3000` |
| `DWS_RESOLVER_OVERRIDE` | DID HTTP Resolver compatible with [https://w3c-ccg.github.io/did-resolution/]() that's used as the first resolver, before the built-in resolver | no | | `http://uni-resolver-web:8080/1.0/identifiers/` |
| `DWS_RESOLVER` | DID HTTP Resolver compatible with [https://w3c-ccg.github.io/did-resolution/]() that's used after the built-in resovler | no | | `http://uni-resolver-web:8080/1.0/identifiers/` |
| `DWS_TLS` | Key and certificate for serving a HTTPS/TLS secured service | no | | `{certs="my.crt", key="private.key"}` |
| `DWS_<more>` | Rocket offers more configuration settings, see [https://rocket.rs/v0.5-rc/guide/configuration/#environment-variables]() - prefix is `DWS_` | no | | |
| **Environment Variable Name** | **Description** | **Required** | **Default** | **Example** |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `DWS_OWNER` | DID of the server's owner | **yes** | | `did:key:z6MkrAvU5DpYtUjpJpohoKyKvWdbrQ1yyZcgM5TodLowsahP` |
| `DWS_ADDRESS` | Address that the service listens at | no | `127.0.0.1` | `0.0.0.0` |
| `DWS_BACKEND_FILE_STORE` | Path to the directory that holds the JSON DID files | no | `$PWD/did_store` | `/usr/web-id/did_store` |
| `DWS_BACKEND` | Storage backend, currently `mem` and `file` are implemented | no | `mem` | `file` |
| `DWS_EXTERNAL_HOSTNAME` | External DNS domain name that the server can be reached at | no | `localhost` | `example.com` |
| `DWS_EXTERNAL_PATH` | External path that the DIDs shall be served at | no | `/` | `/dids` |
| `DWS_EXTERNAL_PORT` | External port that the server can be reached at | no | `$DWS_PORT` if `$HOSTNAME == "localhost"`, otherwise `443` as required by the [specifiction](https://w3c-ccg.github.io/did-method-web/) | `3000` |
| `DWS_PORT` | Port that the service listens at | no | `3000` | `3000` |
| `DWS_RESOLVER_OVERRIDE` | DID HTTP Resolver compatible with [https://w3c-ccg.github.io/did-resolution/](https://w3c-ccg.github.io/did-resolution/) that's used as the first resolver, before the built-in resolver | no | | `http://uni-resolver-web:8080/1.0/identifiers/` |
| `DWS_RESOLVER` | DID HTTP Resolver compatible with [https://w3c-ccg.github.io/did-resolution/](https://w3c-ccg.github.io/did-resolution/) that's used after the built-in resovler | no | | `http://uni-resolver-web:8080/1.0/identifiers/` |
| `DWS_TLS` | Key and certificate for serving a HTTPS/TLS secured service | no | | `{certs="my.crt", key="private.key"}` |
| `DWS_<more>` | Rocket offers more configuration settings, see [https://rocket.rs/v0.5-rc/guide/configuration/#environment-variables](https://rocket.rs/v0.5-rc/guide/configuration/#environment-variables) - prefix is `DWS_` | no | | |
6 changes: 4 additions & 2 deletions docs/src/content/docs/deployment/local-test-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ issue a valid certificate that can be used by the test server.
The excellent [mkcert](https://github.com/FiloSottile/mkcert) tool simplifies the creation and operating system
integration of a local Certificate Authority. Follow these steps to set up the Certificate Authority:

1. Install mkcert following the instructions on [https://github.com/FiloSottile/mkcert]()
1. Install mkcert following the instructions on
[https://github.com/FiloSottile/mkcert](https://github.com/FiloSottile/mkcert)
2. Setup and install local CA:

```bash
Expand Down Expand Up @@ -69,7 +70,8 @@ docker run -it --rm -p 3000 --env-file .env -u "$(id -u):$(id -g)" -v "$PWD:/ser
### Test functionality

The validity of the test server's certificate can be tested by either visiting
[https://localhost:3000/person1/did.json]() in the browser or running the following command:
[https://localhost:3000/person1/did.json](https://localhost:3000/person1/did.json) in the browser or running the
following command:

```bash
curl -f https://localhost:3000/person1/did.json
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,4 @@ curl -f http://localhost:3000/person1/did.json | jq

Congratulations, you've registered the first DID! 🎉 To make the server fully operational, a TLS certificate is
required. The steps for adding a valid TLS certificate to this server are described in the
[deployment guide for a local test server](/deployment/test-server).
[deployment guide for a local test server](/deployment/local-test-server).
Loading

0 comments on commit a9e1d20

Please sign in to comment.