From 734b0271faae99f808c461dc309e9b49078ae5cd Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Mon, 6 Jul 2026 23:40:10 +0000 Subject: [PATCH] update readme, update template config --- README.md | 100 +++++------------------------------- config/template.config.json | 28 ++++++---- 2 files changed, 32 insertions(+), 96 deletions(-) diff --git a/README.md b/README.md index 1417bd9..b452970 100644 --- a/README.md +++ b/README.md @@ -23,105 +23,31 @@ In the Proxmox web GUI, perform the following steps: - Sys.Audit 4. Add a new API Token Permission with path: `/`, select the API token created previously, and role: `proxmoxaas-api` 5. Add a new User Permission with path: `/`, select the `proxmoxaas-api` user, and role: `proxmoxaas-api` -6. To prevent users from bypassing the API provided methods, create a new role with only the following permssions: +6. To prevent users from bypassing the API provided methods, create a new role `PAAS-Client` with only the following permssions: - Datastore.Audit + - Pool.Audit - VM.Audit - VM.Console - - VM.Monitor - VM.PowerMgmt ### Installation - API 1. Clone this repo onto the `ProxmoxAAS-API` host 2. Run `npm install` to initiaze the package requirements 3. Copy `template.config.json` as `config.json` and modify the following values: - 1. In `backends/pve/config`: - - url: the URI to the Proxmox API, ie `https://pve.domain.net/api2/json` - - fabric: the URL to the ProxmoxAAS-Fabric, ie `https://fabric.local` - - token: the user(name), authentication realm (pam), token id, and token secrey key (uuid) - - root (**Optional**): In order to allow users to customize instance pcie devices, the API must use the root credentials for privilege elevation. Provide the root username, ie. `root@pam`, and root user password - 2. In `backends/paasldap/config` (**Optional**): - - url: url to a PAAS-LDAP server API ie. `http://ldap.local` - 3. In `handlers/auth`: - - Add any authentication handlers to be used by the API. Add the realm name (ie. `pve`) as the key and the handler name as provided in `backends`. For example, a PAAS-LDAP handler could be added as `"paas-ldap": "paasldap"` and users in the realm `user@paas-ldap` will use this handler to perform auth actions. Refer to [backends](#Backends) - 4. In `application`: + 1. In `application`: - hostname - the ProxmoxAAS-Dashboard URL, ie `paas.domain.net` - domain - the base domain for the dashboard and proxmox, ie `domain.net` - listenPort - the port you want the API to listen on, ie `8081` - 5. In `useriso`: + 1. In `backends/pve/config`: + - url: the URI to the Proxmox API, ie `https://pve.domain.net/api2/json` + - fabric: the URL to the ProxmoxAAS-Fabric, ie `https://fabric.local` + - token: the `proxmoxaas-api` user(name), authentication realm (pam), token id, and token secrey key (uuid) + - root (**Optional**): In order to allow users to customize instance pcie devices, the API must use the root credentials for privilege elevation. Provide the root username, ie. `root@pam`, and root user password + 2. In `backends/access_manager/config`: + - url: url to a access-mamanger-api server API ie. `http://access.local` + 4. In `useriso`: - node: host of storage with user accessible iso files - storage: name of storage with user accessible iso files - 6. In `backups`: + 5. In `backups`: - storage: name of storage for instance backups -4. Start the service using `node .`, or call the provided shell script, or use the provided systemctl service script - -# Backends - -Backend handlers are used to interface with any number and type of backend data source used to store ProxmoxAAS data. Most data involves users, groups, and membership relationships. The default backends are sufficient to run a small cluster, but additional backend handlers can be created. - -## Interface - -Each backend must implement the following methods: - - - - - - - - - - -
openSessionopens a session to the backend by creating a session token
closeSessioncloses a session to the backend
- -Additionally, backends dealing with user data may also need to implement: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
addUsercreate a user
getUserretrieve user data including membership
setUsermodify a user
delUserdelete a user
addGroupcreate a group
getGroupretrieve group data including members
setGroupmodify group data except membership
delGroupdelete group
addUserToGroupadd user to group as member
delUserFromGroupremove user from group
- -Not all user backends will necessarily implement all the methods fully. For example, backends which do not store group data may not need to implement the group related methods. - -Specific documentation can be found in `src/backends/backends.js`. - -## Multiple Interfaces - -Multiple backends can be specified using the config. During a backend operation involving users, each backend method will be called in the order specified in the config. If the operation is to retrieve user data, the responses will be merged favoring the last backend called. \ No newline at end of file +4. Start the service using `node .`, or call the provided shell script, or use the provided systemctl service script \ No newline at end of file diff --git a/config/template.config.json b/config/template.config.json index af1ff14..b3aa0c6 100644 --- a/config/template.config.json +++ b/config/template.config.json @@ -31,7 +31,7 @@ }, "handlers": { "instance": "pve", - "users": ["access_manager"] + "users": "access_manager" }, "useriso": { "node": "examplenode1", @@ -44,7 +44,8 @@ "cpu": { "type": "list", "whitelist": true, - "display": false + "display": false, + "category": "" }, "cores": { "name": "vCPU", @@ -53,7 +54,8 @@ "base": 1024, "compact": false, "unit": "Cores", - "display": true + "display": true, + "category": "" }, "memory": { "name": "RAM", @@ -62,7 +64,8 @@ "base": 1024, "compact": true, "unit": "B", - "display": true + "display": true, + "category": "" }, "swap": { "name": "SWAP", @@ -71,7 +74,8 @@ "base": 1024, "compact": true, "unit": "B", - "display": true + "display": true, + "category": "" }, "local": { "name": "local", @@ -84,9 +88,11 @@ "rootfs", "mp", "sata", + "scsi", "unused" ], - "display": true + "display": true, + "category": "Storage" }, "cephpl": { "name": "cephpl", @@ -99,9 +105,11 @@ "rootfs", "mp", "sata", + "scsi", "unused" ], - "display": true + "display": true, + "category": "Storage" }, "network": { "name": "Network", @@ -110,12 +118,14 @@ "base": 1000, "compact": true, "unit": "B/s", - "display": true + "display": true, + "category": "" }, "pci": { "type": "list", "whitelist": true, - "display": true + "display": true, + "category": "Devices" } }, "clientsync": {