Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor origin_ui to web_ui to reuse basic logic for server web UI/API #398

Merged
merged 9 commits into from
Nov 27, 2023

Conversation

haoming29
Copy link
Contributor

@haoming29 haoming29 commented Nov 21, 2023

Closes #308

  • This PR also introduced basic username/password auth and its set of APIs to all servers, as well as common APIs such as /config, /health to all servers
  • Changed the auth URLs from /api/v1.0/origin_ui to /api/v1.0/auth/, the origin UI code is updated to the correct URLs
  • Changed the name for one-time activation code and web ui password file to server-web-activation-code and server-web-passwd respectively.
  • Put /health API behind the authentication middleware

Testing Instructions

  • Spin up your director registry and origin
  • Go to https://localhost:8444/view and ensure you can visit origin's web ui as before
  • Close all servers and remove origin-ui-passwd under your /etc/pelican directory
  • Restart any of the server and you should be able to see that the terminal shows the one-time passcode to initialize the UI, although you can only do it through origin UI now.
  • Go to the terminal where origin runs, find the one-time code and go to the origin's initialization page, activate UI using the code, and set your new admin password.
  • Under your /etc/pelican now you should see a server-web-passwd

- Reuse htpasswd auth and common APIs for all servers: /config /health
- Move auth route to /api/v1.0/auth
@haoming29 haoming29 added the internal Internal code improvements, not user-facing label Nov 21, 2023
@haoming29 haoming29 added this to the v7.3.0 milestone Nov 21, 2023
@haoming29 haoming29 requested a review from turetske November 21, 2023 18:36
Copy link
Collaborator

@turetske turetske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some questions about how some of the files will work if we have multiple web-ui's enabled, which will definitely be possible in the future and I don't want us backed into a corner now.

docs/parameters.yaml Show resolved Hide resolved
docs/parameters.yaml Outdated Show resolved Hide resolved
web_ui/authorization.go Outdated Show resolved Hide resolved
web_ui/prometheus.go Show resolved Hide resolved
web_ui/authentication.go Show resolved Hide resolved
@haoming29 haoming29 requested a review from turetske November 27, 2023 21:06
Copy link
Collaborator

@turetske turetske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@turetske turetske merged commit 5c71b63 into PelicanPlatform:main Nov 27, 2023
@haoming29 haoming29 deleted the reuse-web-ui branch November 29, 2023 15:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
internal Internal code improvements, not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor general server_ui code out of origin_ui
2 participants