Page MenuHomePhabricator

[docs] update docs with instructions for running identity service
ClosedPublic

Authored by varun on Mar 30 2023, 2:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 28, 9:35 AM
Unknown Object (File)
Fri, Jun 28, 9:34 AM
Unknown Object (File)
Fri, Jun 28, 9:34 AM
Unknown Object (File)
Fri, Jun 28, 9:34 AM
Unknown Object (File)
Fri, Jun 28, 9:34 AM
Unknown Object (File)
Fri, Jun 28, 9:32 AM
Unknown Object (File)
Fri, Jun 28, 4:33 AM
Unknown Object (File)
Thu, Jun 27, 7:24 PM
Subscribers

Details

Summary
  • added new docs for services setup and services workflows
  • added instructions for setting up docker and running the identity service
  • fixed a broken link and added xcode installation instructions
Test Plan

made sure links all work

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

seems like these instructions aren't complete since @ashoat is facing issues... will take a look tomorrow

docs/nix_dev_env.md
75 ↗(On Diff #24445)

this link was broken

docs/nix_mobile_setup.md
5 ↗(On Diff #24445)

copied this section from the OG dev env doc

docs/nix_services_setup.md
3 ↗(On Diff #24445)

Copied this from the OG dev_services doc

varun requested review of this revision.Mar 30 2023, 2:27 PM
ashoat requested changes to this revision.EditedMar 30 2023, 2:46 PM

EDIT ignore this comment - I was confused. It seems that no additional config is necessary to test in dev mode.

Can we also talk about what is necessary to do to get your local keyserver to talk to the local identity service? We should definitely cover non-Docker local keyserver, and wouldn't hurt to cover Docker keyserver too.

  • For Docker keyserver you can set COMM_JSONCONFIG_secrets_identity_service_config in keyserver/.env
  • The story isn't as good for the non-Docker local keyserver
    • We'll need to set COMM_JSONCONFIG_secrets_identity_service_config manually for the dev script in keyserver/package.json (the same way we set NODE_ENV there today)
      • I surmised we at least need COMM_JSONCONFIG_secrets_identity_service_config='{"identitySocketAddr":"http://localhost:50054"}'
      • I'm guessing we also need to set identityAuthToken, but I can't tell if it's supposed to be based on services/identity/secrets/secret_key.txt or what. It doesn't seem like passing that through base64 gives something that looks like the config we have in production
    • We should call out that even though the name of COMM_JSONCONFIG_secrets_identity_service_config seems to imply it can be set by creating a keyserver/secrets/identity_service_config.json file, this is not the case currently
      • It would be even better to just rename the variable to avoid misleading people. Related task: ENG-3229
docs/nix_dev_env.md
75 ↗(On Diff #24445)

Should it potentially just link to the Xcode section on the current page instead?

docs/nix_mobile_setup.md
5 ↗(On Diff #24445)

This is already at the top of the mainline Nix instructions, not sure we need to repeat it but I don't feel too strongly

docs/nix_services_setup.md
3 ↗(On Diff #24445)

Nice, thanks for finding that. Is there anything else we should copy over from that file? For instance it looks like the VSCode section might still be relevant

docs/nix_services_workflows.md
5 ↗(On Diff #24445)

Super nitty but would be cool to use actual apostrophe character throughout this doc instead of single-quote character

This revision now requires changes to proceed.Mar 30 2023, 2:46 PM

Without identityAuthToken I'm getting this error from rust-node-addon:

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Error("key must be a string", line: 1, column: 2)', src/identity_client/mod.rs:58:47

Without identityAuthToken I'm getting this error from rust-node-addon:

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Error("key must be a string", line: 1, column: 2)', src/identity_client/mod.rs:58:47

hmmm can you echo $COMM_JSONCONFIG_secrets_identity_service_config? it looks like the env var is currently set to invalid JSON

In D7261#215947, @varun wrote:

Without identityAuthToken I'm getting this error from rust-node-addon:

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Error("key must be a string", line: 1, column: 2)', src/identity_client/mod.rs:58:47

hmmm can you echo $COMM_JSONCONFIG_secrets_identity_service_config? it looks like the env var is currently set to invalid JSON

It's not set in my terminal so that won't work, but here's my patch where I set the environmental variable in my package.json as noted in my first comment. It looks like valid JSON, are you sure it's not just because identityAuthToken is missing?

oh i missed that. yeah it's probably cos identityAuthToken is missing. you should just unset the env var altogether. there are default values available to talk to local identity if the env var is not set

Ah okay. Does that default always apply regardless of dev / prod mode? I guess that's convenient to be able to access from dev / prod mode of local keyserver. I wonder how to configure with Docker keyserver (I assume it won't be able to hit localhost, and will need some sort of config in the Docker Compose) but that's a topic for another day

Please address my inline comments before landing!

This revision is now accepted and ready to land.Mar 30 2023, 5:54 PM
varun added inline comments.
docs/nix_dev_env.md
75 ↗(On Diff #24445)

yeah that makes more sense

docs/nix_mobile_setup.md
5 ↗(On Diff #24445)

I'll remove this

docs/nix_services_setup.md
3 ↗(On Diff #24445)

i haven't tested the VSCode<>Docker stuff in my Nix environment yet so don't want to copy it over. i created a backlog task, though

address comments and some other feedback from linear

remove some unnecessary text

This revision was landed with ongoing or failed builds.Mar 31 2023, 12:21 PM
This revision was automatically updated to reflect the committed changes.