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

Documentation and Auth? #82

Open
andy8leung opened this issue Jan 16, 2025 · 3 comments
Open

Documentation and Auth? #82

andy8leung opened this issue Jan 16, 2025 · 3 comments

Comments

@andy8leung
Copy link

Can someone point out where the docs are?

How does authentication work? Can someone provide examples?

@idevat
Copy link
Collaborator

idevat commented Jan 16, 2025

Hi Andy,

Can you be more specific what exactly you need?

Regarding documentation:
Instruction for building pcs-web-ui is in README.md (please note that you need to have pcs installed, which provides the backend for pcs-web-ui). There is no documentation for webui itself, it should be intuitive if you are familiar with HA Cluster. If you are not familiar with HA Cluster I would recommend https://clusterlabs.org/help/ (and above all Clusters from Scratch and then Pacemaker Explained).

Regarding authentication:
Do you mean user authentication (in webui) or authentication between cluster nodes (e.g. during setup)?

@andy8leung
Copy link
Author

Do you mean user authentication (in webui) or authentication between cluster nodes (e.g. during setup)?

user authentication on the web ui. I want to see if we can use the REST API to monitor pcs. I have pcs installed and the web ui is running but I'm not able to authenticate. I can access the landing page which tells you how to build pcs-web-ui and every other page is saying {"notauthorized": true}. I tried passing in the username/password set in pcs as the payload but no luck.

If you can provide an example to authenticate, that'll be great!

@idevat
Copy link
Collaborator

idevat commented Jan 20, 2025

Hi Andy,

Thanks for mentioning your intention to use the REST API.

I'm not sure about your installation because if you pcs-web-ui is running you shouldn't get the page with information about building pcs-web-ui. However, if you just need conversation between your scripts and backend, you can use something like this:

curl --insecure --data "username={username}&password={password}" --cookie-jar cookie.txt  https://node1:2224/ui/login
curl --insecure --cookie cookie.txt --header "X-Requested-With: XMLHttpRequest" https://node1:2224/managec/cluster-name/cluster_status

Where:

  • node1 is node of your cluster
  • cluster-name is name of your cluster
  • {username} is a user on node1 (if you use something different from hacluster please keep in mind the user must be in group haclient
  • {password} is password of the user
  • --insecure is required if you have self signed certificate

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

No branches or pull requests

2 participants