Skip to content

Commit 5ca4d71

Browse files
authored
Merge pull request #177 from jabbate19/apikey
Use Token over User/PW
2 parents 0b21c65 + a11b7ee commit 5ca4d71

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

HACKING/.env.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ PROXSTAR_REDIRECT_URI=https://proxstar.csh.rit.edu/logout
2323
# Proxmox
2424
PROXSTAR_PROXMOX_HOSTS= # Host list that Proxstar can use (proxstar01, etc...)
2525
PROXSTAR_PROXMOX_USER=api@pve
26-
PROXSTAR_PROXMOX_PASS= # Password for proxstar user
26+
PROXSTAR_PROXMOX_TOKEN_NAME= # Token name for user
27+
PROXSTAR_PROXMOX_TOKEN_VALUE= # Token value for user
2728
PROXSTAR_PROXMOX_ISO_STORAGE=nfs-iso
2829
PROXSTAR_PROXMOX_VM_STORAGE=ceph
2930

config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
# Proxmox
3535
PROXMOX_HOSTS = [host.strip() for host in environ.get('PROXSTAR_PROXMOX_HOSTS', '').split(',')]
3636
PROXMOX_USER = environ.get('PROXSTAR_PROXMOX_USER', '')
37-
PROXMOX_PASS = environ.get('PROXSTAR_PROXMOX_PASS', '')
37+
PROXMOX_TOKEN_NAME = environ.get('PROXSTAR_PROXMOX_TOKEN_NAME', '')
38+
PROXMOX_TOKEN_VALUE = environ.get('PROXSTAR_PROXMOX_TOKEN_VALUE', '')
3839
PROXMOX_ISO_STORAGE = environ.get('PROXSTAR_PROXMOX_ISO_STORAGE', 'nfs-iso')
3940
PROXMOX_VM_STORAGE = environ.get('PROXSTAR_PROXMOX_VM_STORAGE', 'ceph')
4041
# STARRS

proxstar/proxmox.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def connect_proxmox():
1212
proxmox = ProxmoxAPI(
1313
host,
1414
user=app.config['PROXMOX_USER'],
15-
password=app.config['PROXMOX_PASS'],
15+
token_name=app.config['PROXMOX_TOKEN_NAME'],
16+
token_value=app.config['PROXMOX_TOKEN_VALUE'],
1617
verify_ssl=False,
1718
)
1819
proxmox.version.get()

proxstar/vnc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def delete_vnc_target(node=None, port=None, token=None):
7575

7676
def open_vnc_session(vmid, node, proxmox):
7777
"""Pings the Proxmox API to request a VNC Proxy connection. Authenticates
78-
against the API using a Uname/Pass, gets a few tokens back, then uses those
78+
against the API using a Uname/Token, gets a few tokens back, then uses those
7979
tokens to open the VNC Proxy. Use these to connect to the VM's host with
8080
websockify proxy.
8181
Returns: Ticket to use as the noVNC password, and a port.

0 commit comments

Comments
 (0)