Page MenuHomePhabricator

[web/native/keyserver] Start using new url facts
ClosedPublic

Authored by michal on Oct 11 2023, 8:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 4:49 PM
Unknown Object (File)
Fri, Dec 20, 6:42 PM
Unknown Object (File)
Sun, Dec 15, 11:35 PM
Unknown Object (File)
Sun, Dec 15, 11:35 PM
Unknown Object (File)
Sun, Dec 15, 11:35 PM
Unknown Object (File)
Sun, Dec 15, 11:35 PM
Unknown Object (File)
Sun, Dec 15, 11:35 PM
Unknown Object (File)
Sun, Dec 15, 11:35 PM
Subscribers

Details

Summary

Part of ENG-5153
Depends on D9398

Now we can start using the new /webapp/ and /keyserver urls in other places.
This also brings back the option of testing the web app with "staging" keyserver because it sets the urlPrefix to the one specified in the url facts (passed as a variable in html) (more context in D9145).

Test Plan
  • check that web and native migrations work
  • check that uploading a new image works
  • test that navigating to https://localhost:3000/comm/chat/thread/256%7C83932/ redirects to /webapp/
  • I run the keyserver docs according to the instructions in the nix_keyserver_deployment.md to check if both new web app and keyserver endpoints work:
    • The webapp successfully loaded under http://localhost:3000/webapp/
    • In the network inspector I could see a successful request to the keyserver (http://localhost:3000/keyserver/get_initial_redux_state)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

keyserver/icons/site.webmanifest
6–11 ↗(On Diff #31940)

They are now fetched relative to the site.webmanifest. So on dev they will be fetched from localhost:3000/webapp/android-chrome.png and on production from web.comm.app/android-chrome.png so there should be no difference on production.

keyserver/src/creators/report-creator.js
148–152 ↗(On Diff #31940)

I don't think it's worth migrating the commbot messages to /keyserver// squadcal.com.

keyserver/src/fetchers/upload-fetchers.js
107 ↗(On Diff #31940)

We could migrate existing urls (on clients) to use /keyserver// squadcal.com but:

  • old clients still need to work with older urls
  • we will be migrating all urls to blob schema anyway in the future

because of that I think it's better to just add a redirect for now (it's in the next diff).

keyserver/src/keyserver.js
242–249 ↗(On Diff #31940)

Added to handle old links, bookmarks etc. on dev. On production there should be no difference because webAppUrl and commAppUrl should both have web.comm.app so we don't need to add a redirect.

web/redux/persist.js
164–176 ↗(On Diff #31940)

This should be a no-op on production but we should still run it to enable existing "testing" web clients to connect to staging.

michal published this revision for review.Oct 11 2023, 9:14 AM
kamil added inline comments.
web/redux/persist.js
164–176 ↗(On Diff #31940)

I think this migrating URL from web.comm.app to squadcal, is that correct?

This revision is now accepted and ready to land.Oct 16 2023, 3:49 AM
web/redux/persist.js
164–176 ↗(On Diff #31940)

Ah right I got confused from native. On web production this will change the url from web.comm.app to squadcal (or to some different url in case of "staging") and on web dev it will change it from localhost:3000/comm to localhost:3000/webapp.

ashoat requested changes to this revision.Oct 22 2023, 3:49 PM

Some docs issues

docs/linux_dev_environment.md
94–95 ↗(On Diff #32274)

I don't think these changes are sufficient. You'll also need this line for JSON keyserver endpoints:

ProxyPass /keyserver/ http://localhost:3000/keyserver/
docs/nix_keyserver_deployment.md
15–16 ↗(On Diff #32274)

This is broken for a couple reasons:

  1. The names of the environmental variables need to be updated to reflect your changes earlier
  2. You need a keyserver config now. It wasn't previously necessary but now it is

It might help to actually test it

This revision now requires changes to proceed.Oct 22 2023, 3:49 PM

Updated the docs issues, amended the test plan for docker keyserver deploy.

This revision is now accepted and ready to land.Oct 27 2023, 8:00 AM