major rework of backend loading and usage:
- split config from user data to config.json, add config.hson.template - moved default user data localdb to root folder - moved pve, localdb, ldap backend handlers to backends sub folder - add dynamic loading of all backends - add dynamic mapping for auth backends to support multiple auth sources - update affected endpoints
This commit is contained in:
223
config/config.json.template
Normal file
223
config/config.json.template
Normal file
@@ -0,0 +1,223 @@
|
||||
{
|
||||
"backends": {
|
||||
"pve": {
|
||||
"import": "pve.js",
|
||||
"config": {
|
||||
"url": "https://pve.mydomain.example/api2/json",
|
||||
"token": {
|
||||
"user": "proxmoxaas-api",
|
||||
"realm": "pam",
|
||||
"id": "token",
|
||||
"uuid": "token-secret-value"
|
||||
},
|
||||
"root": {
|
||||
"username": "root@pam",
|
||||
"password": "rootpassword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"localdb": {
|
||||
"import": "localdb.js",
|
||||
"config": {
|
||||
"dbfile": "localdb.json"
|
||||
}
|
||||
},
|
||||
"paasldap": {
|
||||
"import": "paasldap.js",
|
||||
"config": {
|
||||
"url": "http://paasldap.mydomain.example"
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers": {
|
||||
"pve": "pve",
|
||||
"db": "localdb",
|
||||
"auth": {
|
||||
"pve": "pve",
|
||||
"ldap": "paasldap"
|
||||
}
|
||||
},
|
||||
"application": {
|
||||
"hostname": "paas.mydomain.example",
|
||||
"domain": "mydomain.example",
|
||||
"listenPort": 8081
|
||||
},
|
||||
"useriso": {
|
||||
"node": "examplenode1",
|
||||
"storage": "cephfs"
|
||||
},
|
||||
"resources": {
|
||||
"cpu": {
|
||||
"type": "list",
|
||||
"whitelist": true,
|
||||
"display": false
|
||||
},
|
||||
"cores": {
|
||||
"name": "vCPU",
|
||||
"type": "numeric",
|
||||
"multiplier": 1,
|
||||
"base": 1024,
|
||||
"compact": false,
|
||||
"unit": "Cores",
|
||||
"display": true
|
||||
},
|
||||
"memory": {
|
||||
"name": "RAM",
|
||||
"type": "numeric",
|
||||
"multiplier": 1048576,
|
||||
"base": 1024,
|
||||
"compact": true,
|
||||
"unit": "B",
|
||||
"display": true
|
||||
},
|
||||
"swap": {
|
||||
"name": "SWAP",
|
||||
"type": "numeric",
|
||||
"multiplier": 1048576,
|
||||
"base": 1024,
|
||||
"compact": true,
|
||||
"unit": "B",
|
||||
"display": true
|
||||
},
|
||||
"local": {
|
||||
"name": "local",
|
||||
"type": "storage",
|
||||
"multiplier": 1,
|
||||
"base": 1024,
|
||||
"compact": true,
|
||||
"unit": "B",
|
||||
"disks": [
|
||||
"rootfs",
|
||||
"mp",
|
||||
"sata",
|
||||
"unused"
|
||||
],
|
||||
"display": true
|
||||
},
|
||||
"cephpl": {
|
||||
"name": "cephpl",
|
||||
"type": "storage",
|
||||
"multiplier": 1,
|
||||
"base": 1024,
|
||||
"compact": true,
|
||||
"unit": "B",
|
||||
"disks": [
|
||||
"rootfs",
|
||||
"mp",
|
||||
"sata",
|
||||
"unused"
|
||||
],
|
||||
"display": true
|
||||
},
|
||||
"network": {
|
||||
"name": "Network",
|
||||
"type": "numeric",
|
||||
"multiplier": 1000000,
|
||||
"base": 1000,
|
||||
"compact": true,
|
||||
"unit": "B/s",
|
||||
"display": true
|
||||
},
|
||||
"pci": {
|
||||
"type": "list",
|
||||
"whitelist": true,
|
||||
"display": true
|
||||
}
|
||||
},
|
||||
"clientsync": {
|
||||
"resourcetypes": [
|
||||
"lxc",
|
||||
"qemu",
|
||||
"node"
|
||||
],
|
||||
"schemes": {
|
||||
"always": {
|
||||
"enabled": true
|
||||
},
|
||||
"hash": {
|
||||
"enabled": true
|
||||
},
|
||||
"interrupt": {
|
||||
"min-rate": 1,
|
||||
"max-rate": 60,
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultuser": {
|
||||
"resources": {
|
||||
"cpu": {
|
||||
"global": [],
|
||||
"nodes": {}
|
||||
},
|
||||
"cores": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"memory": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"swap": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"local": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"cephpl": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"network": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"pci": {
|
||||
"global": [],
|
||||
"nodes": {}
|
||||
}
|
||||
},
|
||||
"nodes": [],
|
||||
"cluster": {
|
||||
"vmid": {
|
||||
"min": -1,
|
||||
"max": -1
|
||||
},
|
||||
"pool": ""
|
||||
},
|
||||
"templates": {
|
||||
"instances": {
|
||||
"lxc": {},
|
||||
"qemu": {}
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"lxc": {
|
||||
"type": "veth",
|
||||
"bridge": "vmbr0",
|
||||
"vlan": 10,
|
||||
"ip": "dhcp",
|
||||
"ip6": "dhcp"
|
||||
},
|
||||
"qemu": {
|
||||
"type": "virtio",
|
||||
"bridge": "vmbr0",
|
||||
"vlan": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,332 +0,0 @@
|
||||
{
|
||||
"static": {
|
||||
"types": {
|
||||
"auth": {
|
||||
"pve": "pve",
|
||||
"ldap": "ldap"
|
||||
}
|
||||
}
|
||||
},
|
||||
"global": {
|
||||
"application": {
|
||||
"pveAPI": "https://pve.mydomain.example/api2/json",
|
||||
"pveAPIToken": {
|
||||
"user": "proxmoxaas-api",
|
||||
"realm": "pve",
|
||||
"id": "token",
|
||||
"uuid": "token-secret-value"
|
||||
},
|
||||
"pveroot": {
|
||||
"username": "root@pam",
|
||||
"password": "rootpassword"
|
||||
},
|
||||
"hostname": "paas.mydomain.example",
|
||||
"domain": "mydomain.example"
|
||||
},
|
||||
"resources": {
|
||||
"cpu": {
|
||||
"type": "list",
|
||||
"whitelist": true,
|
||||
"display": false
|
||||
},
|
||||
"cores": {
|
||||
"name": "vCPU",
|
||||
"type": "numeric",
|
||||
"multiplier": 1,
|
||||
"base": 1024,
|
||||
"compact": false,
|
||||
"unit": "Cores",
|
||||
"display": true
|
||||
},
|
||||
"memory": {
|
||||
"name": "RAM",
|
||||
"type": "numeric",
|
||||
"multiplier": 1048576,
|
||||
"base": 1024,
|
||||
"compact": true,
|
||||
"unit": "B",
|
||||
"display": true
|
||||
},
|
||||
"swap": {
|
||||
"name": "SWAP",
|
||||
"type": "numeric",
|
||||
"multiplier": 1048576,
|
||||
"base": 1024,
|
||||
"compact": true,
|
||||
"unit": "B",
|
||||
"display": true
|
||||
},
|
||||
"local": {
|
||||
"name": "local",
|
||||
"type": "storage",
|
||||
"multiplier": 1,
|
||||
"base": 1024,
|
||||
"compact": true,
|
||||
"unit": "B",
|
||||
"disks": [
|
||||
"rootfs",
|
||||
"mp",
|
||||
"sata",
|
||||
"unused"
|
||||
],
|
||||
"display": true
|
||||
},
|
||||
"cephpl": {
|
||||
"name": "cephpl",
|
||||
"type": "storage",
|
||||
"multiplier": 1,
|
||||
"base": 1024,
|
||||
"compact": true,
|
||||
"unit": "B",
|
||||
"disks": [
|
||||
"rootfs",
|
||||
"mp",
|
||||
"sata",
|
||||
"unused"
|
||||
],
|
||||
"display": true
|
||||
},
|
||||
"network": {
|
||||
"name": "Network",
|
||||
"type": "numeric",
|
||||
"multiplier": 1000000,
|
||||
"base": 1000,
|
||||
"compact": true,
|
||||
"unit": "B/s",
|
||||
"display": true
|
||||
},
|
||||
"pci": {
|
||||
"type": "list",
|
||||
"whitelist": true,
|
||||
"display": true
|
||||
}
|
||||
},
|
||||
"clientsync": {
|
||||
"resourcetypes": [
|
||||
"lxc",
|
||||
"qemu",
|
||||
"node"
|
||||
],
|
||||
"schemes": {
|
||||
"always": {
|
||||
"enabled": true
|
||||
},
|
||||
"hash": {
|
||||
"enabled": true
|
||||
},
|
||||
"interrupt": {
|
||||
"min-rate": 1,
|
||||
"max-rate": 60,
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"useriso": {
|
||||
"node": "examplenode1",
|
||||
"storage": "cephfs"
|
||||
},
|
||||
"defaultuser": {
|
||||
"resources": {
|
||||
"cpu": {
|
||||
"global": [],
|
||||
"nodes": {}
|
||||
},
|
||||
"cores": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"memory": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"swap": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"local": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"cephpl": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"network": {
|
||||
"global": {
|
||||
"max": 0
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"pci": {
|
||||
"global": [],
|
||||
"nodes": {}
|
||||
}
|
||||
},
|
||||
"nodes": [],
|
||||
"cluster": {
|
||||
"vmid": {
|
||||
"min": -1,
|
||||
"max": -1
|
||||
},
|
||||
"pool": ""
|
||||
},
|
||||
"templates": {
|
||||
"instances": {
|
||||
"lxc": {},
|
||||
"qemu": {}
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"lxc": {
|
||||
"type": "veth",
|
||||
"bridge": "vmbr0",
|
||||
"vlan": 10,
|
||||
"ip": "dhcp",
|
||||
"ip6": "dhcp"
|
||||
},
|
||||
"qemu": {
|
||||
"type": "virtio",
|
||||
"bridge": "vmbr0",
|
||||
"vlan": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"users": {
|
||||
"exampleuser@examplepool": {
|
||||
"resources": {
|
||||
"cpu": {
|
||||
"global": [
|
||||
{
|
||||
"match": "kvm64",
|
||||
"name": "kvm64",
|
||||
"max": 1
|
||||
},
|
||||
{
|
||||
"match": "host",
|
||||
"name": "host",
|
||||
"max": 1
|
||||
}
|
||||
],
|
||||
"nodes": {}
|
||||
},
|
||||
"cores": {
|
||||
"global": {
|
||||
"max": 128
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"memory": {
|
||||
"global": {
|
||||
"max": 131072
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"swap": {
|
||||
"global": {
|
||||
"max": 131072
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"local": {
|
||||
"global": {
|
||||
"max": 1099511627776
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"cephpl": {
|
||||
"global": {
|
||||
"max": 1099511627776
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"network": {
|
||||
"global": {
|
||||
"max": 100000
|
||||
},
|
||||
"nodes": {}
|
||||
},
|
||||
"pci": {
|
||||
"global": [],
|
||||
"nodes": {
|
||||
"examplenode1": [
|
||||
{
|
||||
"match": "[exampledevice1]",
|
||||
"name": "exampledevice1",
|
||||
"max": 1
|
||||
}
|
||||
],
|
||||
"examplenode2": [
|
||||
{
|
||||
"match": "[exampledevice2]",
|
||||
"name": "exampledevice2",
|
||||
"max": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"nodes": [
|
||||
"examplenode1",
|
||||
"examplenode2"
|
||||
],
|
||||
"cluster": {
|
||||
"vmid": {
|
||||
"min": 100,
|
||||
"max": 199
|
||||
},
|
||||
"pool": "examplepool"
|
||||
},
|
||||
"templates": {
|
||||
"instances": {
|
||||
"lxc": {
|
||||
"net0": {
|
||||
"value": "name=eth0,bridge=vmbr0,ip=dhcp,ip6=dhcp,tag=10,type=veth,rate=1000",
|
||||
"resource": {
|
||||
"name": "network",
|
||||
"amount": 1000
|
||||
}
|
||||
}
|
||||
},
|
||||
"qemu": {
|
||||
"cpu": {
|
||||
"value": "host",
|
||||
"resource": null
|
||||
},
|
||||
"net0": {
|
||||
"value": "virtio,bridge=vmbr0,tag=10,rate=1000",
|
||||
"resource": {
|
||||
"name": "network",
|
||||
"amount": 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"lxc": {
|
||||
"type": "veth",
|
||||
"bridge": "vmbr0",
|
||||
"vlan": 10,
|
||||
"ip": "dhcp",
|
||||
"ip6": "dhcp"
|
||||
},
|
||||
"qemu": {
|
||||
"type": "virtio",
|
||||
"bridge": "vmbr0",
|
||||
"vlan": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user