Skip to content
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

Merged
merged 22 commits into from
Mar 13, 2024

Conversation

devinivy
Copy link
Collaborator

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 their app.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 option NEXT_PUBLIC_PLC_DIRECTORY_URL which defaults to prod PLC. We may set this in our staging environment.

Copy link

render bot commented Mar 11, 2024

Copy link

render bot commented Mar 11, 2024

const [session, setSession] = useState(
client.authState === AuthState.LoggedOut ? null : client.session,
)
useEffect(() => {
Copy link
Contributor

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

Copy link
Contributor

@foysalit foysalit left a 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!

@devinivy devinivy changed the base branch from main to feat/labeler-distro March 13, 2024 20:53
@devinivy devinivy merged commit 94e425f into feat/labeler-distro Mar 13, 2024
4 checks passed
devinivy added a commit that referenced this pull request Mar 14, 2024
* 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]>
@matthieusieben matthieusieben deleted the divy/distro branch November 15, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants