mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-06 05:41:35 +01:00
feat: better basic auth support
This commit is contained in:
@@ -15,6 +15,10 @@ server{
|
|||||||
proxy_pass http://{{ targetip }}:{{ targetport }};
|
proxy_pass http://{{ targetip }}:{{ targetport }};
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
{{ proxy_pass_blob }}
|
{{ proxy_pass_blob }}
|
||||||
|
{% if basicauth %}
|
||||||
|
auth_basic "{{ basicauth }}";
|
||||||
|
auth_basic_user_file /etc/nginx/{{ basicauth }}.htpasswd;
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
vm.py
3
vm.py
@@ -131,7 +131,8 @@ class VM:
|
|||||||
targetport = subdomain.get("port") or 80
|
targetport = subdomain.get("port") or 80
|
||||||
component = template.render(targetip=self.ip, targetport=targetport,
|
component = template.render(targetip=self.ip, targetport=targetport,
|
||||||
servernames=[subdomain["name"]], comment=compositeName,
|
servernames=[subdomain["name"]], comment=compositeName,
|
||||||
proxy_pass_blob=self.proxy_pass_blob, acme=not self.noTerminateACME)
|
proxy_pass_blob=self.proxy_pass_blob, acme=not self.noTerminateACME,
|
||||||
|
basicauth=subdomain.get("basicauth"))
|
||||||
components.append(component)
|
components.append(component)
|
||||||
|
|
||||||
return components
|
return components
|
||||||
|
|||||||
Reference in New Issue
Block a user