bunkerweb 1.4.0
This commit is contained in:
11
core/authbasic/confs/server-http/auth-basic.conf
Normal file
11
core/authbasic/confs/server-http/auth-basic.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
{% if USE_AUTH_BASIC == "yes" +%}
|
||||
{% if AUTH_BASIC_LOCATION == "sitewide" %}
|
||||
auth_basic "{{ AUTH_BASIC_TEXT }}";
|
||||
auth_basic_user_file {{ NGINX_PREFIX }}server-http/htpasswd;
|
||||
{% else %}
|
||||
location {{ AUTH_BASIC_LOCATION }} {
|
||||
auth_basic "{{ AUTH_BASIC_TEXT }}";
|
||||
auth_basic_user_file {{ NGINX_PREFIX }}server-http/htpasswd;
|
||||
}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
4
core/authbasic/confs/server-http/htpasswd
Normal file
4
core/authbasic/confs/server-http/htpasswd
Normal file
@@ -0,0 +1,4 @@
|
||||
{% set crypt = import('crypt') %}
|
||||
{% if USE_AUTH_BASIC == "yes" %}
|
||||
{{ AUTH_BASIC_USER }}:{{ crypt.crypt(AUTH_BASIC_PASSWORD, crypt.mksalt(crypt.METHOD_SHA512)) }}
|
||||
{% endif %}
|
||||
54
core/authbasic/plugin.json
Normal file
54
core/authbasic/plugin.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"id": "authbasic",
|
||||
"order": 999,
|
||||
"name": "Auth basic",
|
||||
"description": "Enforce login before accessing a resource or the whole site using HTTP basic auth method.",
|
||||
"version": "0.1",
|
||||
"settings": {
|
||||
"USE_AUTH_BASIC": {
|
||||
"context": "multisite",
|
||||
"default": "no",
|
||||
"help": "Use HTTP basic auth",
|
||||
"id": "use-auth-basic",
|
||||
"label": "Use HTTP basic auth",
|
||||
"regex": "^(yes|no)$",
|
||||
"type": "check"
|
||||
},
|
||||
"AUTH_BASIC_LOCATION": {
|
||||
"context": "multisite",
|
||||
"default": "sitewide",
|
||||
"help": "URL of the protected resource or sitewide value.",
|
||||
"id": "auth-basic-location",
|
||||
"label": "Location",
|
||||
"regex": "^.*$",
|
||||
"type": "text"
|
||||
},
|
||||
"AUTH_BASIC_USER": {
|
||||
"context": "multisite",
|
||||
"default": "changeme",
|
||||
"help": "Username",
|
||||
"id": "auth-basic-user",
|
||||
"label": "Username",
|
||||
"regex": "^.*$",
|
||||
"type": "text"
|
||||
},
|
||||
"AUTH_BASIC_PASSWORD": {
|
||||
"context": "multisite",
|
||||
"default": "changeme",
|
||||
"help": "Password",
|
||||
"id": "auth-basic-password",
|
||||
"label": "Password",
|
||||
"regex": "^.*$",
|
||||
"type": "text"
|
||||
},
|
||||
"AUTH_BASIC_TEXT": {
|
||||
"context": "multisite",
|
||||
"default": "Restricted area",
|
||||
"help": "Text to display",
|
||||
"id": "auth-basic-text",
|
||||
"label": "Text",
|
||||
"regex": "^.*$",
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user