Skip to content

Commit

Permalink
docs: update examples to use new didkit-cli image
Browse files Browse the repository at this point in the history
  • Loading branch information
jceb committed May 28, 2024
1 parent 2acfc9a commit 6d8994a
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 46 deletions.
30 changes: 15 additions & 15 deletions docs/src/content/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ title: Configuration
sidebar_position: 3
---

The following configuration options can be set:
The following settings are available:

| **Environment Variable Name** | **Description** | **Required** | **Default** | **Example** |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| `DID_SERVER_OWNER` | DID of the server's owner | **yes** | | `did:key:z6MkrAvU5DpYtUjpJpohoKyKvWdbrQ1yyZcgM5TodLowsahP` |
| `DID_SERVER_ADDRESS` | Address that the service listens at | no | `127.0.0.1` | `0.0.0.0` |
| `DID_SERVER_BACKEND_FILE_STORE` | Path to the directory that holds the JSON DID files | no | `$PWD/did_store` | `/usr/web-id/did_store` |
| `DID_SERVER_BACKEND` | Storage backend, currently `mem` and `file` are implemented | no | `mem` | `file` |
| `DID_SERVER_EXTERNAL_HOSTNAME` | External DNS domain name that the server can be reached at | no | `localhost` | `example.com` |
| `DID_SERVER_EXTERNAL_PATH` | External path that the DIDs shall be served at | no | `/` | `/dids` |
| `DID_SERVER_EXTERNAL_PORT` | External port that the server can be reached at | no | `$DID_SERVER_PORT` if `$HOSTNAME == "localhost"`, otherwise `443` as required by the [specifiction](https://w3c-ccg.github.io/did-method-web/) | `3000` |
| `DID_SERVER_PORT` | Port that the service listens at | no | `3000` | `3000` |
| `DID_SERVER_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/` |
| `DID_SERVER_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/` |
| `DID_SERVER_TLS` | Key and certificate for serving a HTTPS/TLS secured service | no | | `{certs="my.crt", key="private.key"}` |
| `DID_SERVER_<more>` | Rocket offers more configuration settings, see [https://rocket.rs/v0.5-rc/guide/configuration/#environment-variables]() - prefix is `DID_SERVER_` | 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 | `$DID_SERVER_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 `DID_SERVER_` | no | | |
20 changes: 12 additions & 8 deletions docs/src/content/docs/deployment/local-test-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ The excellent [mkcert](https://github.com/FiloSottile/mkcert) tool simplifies th
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]()
2. Setup and install local CA: `mkcert -install`
2. Setup and install local CA:

```bash
mkcert -install
```

Ensure that the previous command completed successfully before proceeding to the next step.

Expand All @@ -47,13 +51,13 @@ cat localhost.pem localhost-key.pem > cert.pem
3. Now, let's enable the certificate in the configuration:

```bash title=".env" {7}
DID_WEB_SERVER_OWNER=did:key:xxxx # Put the created or existing DID here.
DID_WEB_SERVER_EXTERNAL_HOSTNAME=localhost # Hostname and port determine the DIDs that are managed by this server, e.g. did:web:id.localhost%3A3000:xyz.
DID_WEB_SERVER_EXTERNAL_PORT=3000 # Set DID_WEB_SERVER_PORT and DID_WEB_SERVER_EXTERNAL_PORT to the same value for this test.
DID_WEB_SERVER_PORT=3000 # Set DID_WEB_SERVER_PORT and DID_WEB_SERVER_EXTERNAL_PORT to the same value for this test.
DID_WEB_SERVER_BACKEND=file # Store DIDs on the local file system.
DID_WEB_SERVER_BACKEND_FILE_STORE=/server/did_store # DIDs will be stored in the `dids` folder below your current directory.
DID_WEB_SERVER_TLS=/server/cert.pem # For compatibilty with DID resolvers, a certificate is required. It will be added later.
DWS_OWNER=did:key:xxxx # Put the created or existing DID here.
DWS_EXTERNAL_HOSTNAME=localhost # Hostname and port determine the DIDs that are managed by this server, e.g. did:web:id.localhost%3A3000:xyz.
DWS_EXTERNAL_PORT=3000 # Set DWS_PORT and DWS_EXTERNAL_PORT to the same value for this test.
DWS_PORT=3000 # Set DWS_PORT and DWS_EXTERNAL_PORT to the same value for this test.
DWS_BACKEND=file # Store DIDs on the local file system.
DWS_BACKEND_FILE_STORE=/server/did_store # DIDs will be stored in the `dids` folder below your current directory.
DWS_TLS=/server/cert.pem # For compatibilty with DID resolvers, a certificate is required. It will be added later.
```

4. With the updated configuration in place, let's restart the server:
Expand Down
Loading

0 comments on commit 6d8994a

Please sign in to comment.