-
Notifications
You must be signed in to change notification settings - Fork 43
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
Ozone frontend/backend build and account setup #35
Conversation
Your Render PR Server URL is https://ozone-staging-pr-35.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cnnio1mct0pc739tmk90. |
Your Render PR Server URL is https://ozone-sandbox-pr-35.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cnnio26ct0pc739tmki0. |
const [session, setSession] = useState( | ||
client.authState === AuthState.LoggedOut ? null : client.session, | ||
) | ||
useEffect(() => { |
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.
do we want this to re-run on every render or just when client.session
changes? just being cautious so that we don't run unnecessary things on every render since there are no deps on this useEffect
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.
Looks good. Just a few suggestions below!
* Ozone frontend/backend build and account setup (#35) * setup dockerfile and service entrypoint for frontend/backend deployed together * gitignore/yarnlock tidy * auth state for ozone configuration * update api package * plc/identity setup workflow * tidy/fixes * record creation flow on login * reorg client config / configuration flow * skip record creation step if not service account * tidy * rename metadata endpoint * fix * reorg plc constants, bring plc functionality into lib/identity * make generic ErrorInfo component * misc fixes * fix cypress * websocket fix * add docker workflow * update ozone version * fix entrypoint order of operations * fix next build / rel paths --------- Co-authored-by: Foysal Ahamed <[email protected]> * Docs on hosting ozone UI and backend (#48) * setup dockerfile and service entrypoint for frontend/backend deployed together * gitignore/yarnlock tidy * auth state for ozone configuration * update api package * plc/identity setup workflow * tidy/fixes * record creation flow on login * reorg client config / configuration flow * skip record creation step if not service account * tidy * rename metadata endpoint * fix * reorg plc constants, bring plc functionality into lib/identity * make generic ErrorInfo component * misc fixes * fix cypress * websocket fix * docs on hosting ozone ui and backend * minor tweaks * minor tweaks * add docker workflow * update ozone version * misc doc fixes * fix entrypoint order of operations * fix next build / rel paths * fix old ozone-ui references * fix markdown table * use a working build sha in compose * fix headers --------- Co-authored-by: Jake Gold <[email protected]> Co-authored-by: Foysal Ahamed <[email protected]> * Show custom labels from labeler service in ozone (#51) * setup dockerfile and service entrypoint for frontend/backend deployed together * gitignore/yarnlock tidy * auth state for ozone configuration * update api package * plc/identity setup workflow * tidy/fixes * record creation flow on login * reorg client config / configuration flow * skip record creation step if not service account * tidy * rename metadata endpoint * fix * reorg plc constants, bring plc functionality into lib/identity * make generic ErrorInfo component * misc fixes * fix cypress * websocket fix * add docker workflow * update ozone version * ✨ Use custom labeler labels in label input --------- Co-authored-by: Devin Ivy <[email protected]> * Service record configuration (#52) * setup dockerfile and service entrypoint for frontend/backend deployed together * gitignore/yarnlock tidy * auth state for ozone configuration * update api package * plc/identity setup workflow * tidy/fixes * record creation flow on login * reorg client config / configuration flow * skip record creation step if not service account * tidy * rename metadata endpoint * fix * reorg plc constants, bring plc functionality into lib/identity * make generic ErrorInfo component * misc fixes * fix cypress * websocket fix * boilerplate for service account configuration page * in-progess, configuration page * in-progess, configuration page * minor reorg in configure page * add react-json-view dep for record config * record configuration flow * fix dep * tidy * browser-only react viewer * build 0.1.0 rc * final tidy * ozone version bump * build * tidy --------- Co-authored-by: Foysal Ahamed <[email protected]> Co-authored-by: Jake Gold <[email protected]>
A few things going on here. First, the
service/
entrypoint has been added in order to support an Ozone frontend and backend running together. The Dockerfile has been updated to run this service entrpoint. The Ozone backend serves a metadata endpoint with its DID, URL, and public key, which the UI uses in order to configure the service account's (i.e. account with the same DID) identity and publish theirapp.bsky.labeler.service
record.If the service account does not have a labeler service endpoint and key, then the UI requires that you login as the service account and configure it. Without a service endpoint, there's no way for the PDS to properly proxy to the service.
Publishing the service record is optional. Each time the service account logs in, it prompts them to publish the record and they may opt to skip.
A couple things to look out for here. We want to ensure this works just fine for our Ozone deployment, where the frontend and backend are not on the same domain. I set it up to work like this, but haven't been able to test it yet. I have also updated the
session
object, which gets stored in local storage, so there may be a compatibility issue there to check out. Lastly, there could be some issues that we could provide better error messages for, such as handling the case that he backend is offline; the service can't be found due to use of a different PLC environment; etc. I did add a new config optionNEXT_PUBLIC_PLC_DIRECTORY_URL
which defaults to prod PLC. We may set this in our staging environment.