update readme, update template config

This commit is contained in:
2026-07-06 23:40:10 +00:00
parent f3b279e636
commit 734b0271fa
2 changed files with 32 additions and 96 deletions
+13 -87
View File
@@ -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:
<table>
<tr>
<td>openSession</td>
<td>opens a session to the backend by creating a session token</td>
</tr>
<tr>
<td>closeSession</td>
<td>closes a session to the backend</td>
</tr>
</table>
Additionally, backends dealing with user data may also need to implement:
<table>
<tr>
<td>addUser</td>
<td>create a user</td>
</tr>
<tr>
<td>getUser</td>
<td>retrieve user data including membership</td>
</tr>
<tr>
<td>setUser</td>
<td>modify a user</td>
</tr>
<tr>
<td>delUser</td>
<td>delete a user</td>
</tr>
<tr>
<td>addGroup</td>
<td>create a group</td>
</tr>
<tr>
<td>getGroup</td>
<td>retrieve group data including members</td>
</tr>
<tr>
<td>setGroup</td>
<td>modify group data except membership</td>
</tr>
<tr>
<td>delGroup</td>
<td>delete group</td>
</tr>
<tr>
<td>addUserToGroup</td>
<td>add user to group as member</td>
</tr>
<tr>
<td>delUserFromGroup</td>
<td>remove user from group</td>
</tr>
</table>
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.
4. Start the service using `node .`, or call the provided shell script, or use the provided systemctl service script
+19 -9
View File
@@ -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": {