Repository navigation
docs(readme): lead with a first request, move WebAssembly to its own page #1521
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
Changes from all commits
ffe024f
d5635be
b3c9624
6d4c635
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,9 +85,11 @@ mongosh --eval "rs.initiate()" | |
| | Replica set | `rs0` | | ||
| | Connection string | `mongodb://localhost:27017/?replicaSet=rs0` | | ||
|
|
||
| For Docker on a non-default port: | ||
| For the Docker container above, reached from the host, add `directConnection=true`, | ||
| because the replica set names its member by the container's hostname, which the | ||
| host cannot resolve: | ||
| ``` | ||
| mongodb://localhost:27018/?replicaSet=rs0&directConnection=true | ||
| mongodb://localhost:27017/?replicaSet=rs0&directConnection=true | ||
| ``` | ||
|
|
||
| ## Building with MongoDB Support | ||
|
|
@@ -105,8 +107,20 @@ one binary per backend. | |
|
|
||
| ## Initializing ExtendDB with MongoDB | ||
|
|
||
| On MongoDB, `init` reads the connection string from `extenddb.toml`, so write | ||
| that file first, then run `init` with `--overwrite`, which regenerates the file | ||
| and keeps the connection string. The `umask 077` creates the file readable by | ||
| your user only, as `init` writes it: | ||
|
|
||
| ```bash | ||
| ./target/release/extenddb init --backend mongodb --config extenddb.toml | ||
| (umask 077 && cat > extenddb.toml) <<'EOF' | ||
| [storage] | ||
| backend = "mongodb" | ||
|
|
||
| [storage.mongodb] | ||
| connection_string = "mongodb://localhost:27017/?replicaSet=rs0&directConnection=true" | ||
| EOF | ||
| ./target/release/extenddb init --backend mongodb --config extenddb.toml --overwrite | ||
| ``` | ||
|
|
||
| This creates: | ||
|
|
@@ -122,7 +136,7 @@ The generated config will contain: | |
| backend = "mongodb" | ||
|
|
||
| [storage.mongodb] | ||
| connection_string = "mongodb://localhost:27017/?replicaSet=rs0" | ||
| connection_string = "mongodb://localhost:27017/?replicaSet=rs0&directConnection=true" | ||
| ``` | ||
|
|
||
| ## Starting the Server | ||
|
|
@@ -131,6 +145,22 @@ connection_string = "mongodb://localhost:27017/?replicaSet=rs0" | |
| ./target/release/extenddb serve --config extenddb.toml | ||
| ``` | ||
|
|
||
| ## Creating an Account for Your First Request | ||
|
|
||
| On MongoDB, `manage list-accounts` lists no account after `init`, because the | ||
| default account `init` writes has no 12-digit account ID. Create an account and | ||
| use its ID for the IAM user and access key. With the admin password in | ||
| `EXTENDDB_PASSWORD`: | ||
|
|
||
| ```bash | ||
| ACCOUNT_ID=$(./target/release/extenddb manage --user admin \ | ||
| create-account --account-name dev | grep -o '[0-9]\{12\}' | head -n 1) | ||
| ``` | ||
|
|
||
| Then continue with `create-user`, `put-user-policy` and `create-access-key` | ||
| as in step 3 of [Make your first request](../README.md#make-your-first-request), | ||
| and configure the AWS CLI as in its step 4. | ||
|
|
||
| ## Config Mapping | ||
|
|
||
| ```toml | ||
|
|
@@ -155,13 +185,17 @@ export EXTENDDB__STORAGE__MONGODB__CONNECTION_STRING="mongodb://localhost:27017/ | |
|
|
||
| ## Verifying the Connection | ||
|
|
||
| Run these after steps 3 and 4 of | ||
| [Make your first request](../README.md#make-your-first-request), which give | ||
| the AWS CLI an ExtendDB key and the certificate: | ||
|
|
||
| ```bash | ||
| # Health check | ||
| curl --cacert ~/.extenddb/tls/cert.pem https://127.0.0.1:8000/health | ||
| curl --cacert ~/.extenddb/tls/cert.pem https://127.0.0.1:18443/health | ||
|
|
||
| # List tables (should return empty) | ||
| aws dynamodb list-tables \ | ||
| --endpoint-url https://127.0.0.1:8000 \ | ||
| --endpoint-url https://127.0.0.1:18443 \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should change. With the port fixed, this reaches the server, but the guide never sets up what the AWS CLI needs here: nothing on the page points it at the self-signed certificate or gives it an ExtendDB key (no
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 142c751 links step 3 of Make your first request, adds its step 4 for the AWS CLI, and says the connection check runs after those two steps. |
||
| --region us-east-1 | ||
| ``` | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should change. This entry renders the page with Python-Markdown (
Markdown==3.10.2in requirements.txt; the calls at lines 282-285 and 305-308 use thetables,fenced_codeandtocextensions) for the PDF and for the console's document page, which embeds that HTML (crates/server/src/console/pages/docs_page.rs:101). Python-Markdown nests a list only when it is indented four spaces, and the five cases under "A synchronous control plane" (docs/webassembly.md:60, 80, 91, 98 and 110) are indented two. In the generated page they become five more top-level items of "What it does not do" ("A new table.", "A write.", "No other state."), which then read as more things the build lacks. GitHub nests them, so the problem shows only in the generated docs. Putting the-of those five items at four spaces (two more than now), with their continuation lines moved the same two, renders correctly in both; adding four spaces instead breaks GitHub's rendering.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6588e33 moves the
-of the five cases to four spaces and their continuation lines two further. Python-Markdown 3.10.2 withtables,fenced_codeandtocnow renders them as a list nested under "A synchronous control plane".