diff --git a/Dockerfile b/Dockerfile index 1bf5b27..9ef111e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -83,6 +83,7 @@ RUN apt-get update \ # resty.limit.req is bundled with OpenResty, so no rock is needed for it. RUN luarocks install lua-resty-auto-ssl \ && luarocks install luasocket \ + && luarocks install lua-resty-balancer \ && luarocks install lua-resty-ipmatcher # ── Node app ───────────────────────────────────────────────────────────────── diff --git a/nodejs/models/host.js b/nodejs/models/host.js index 5abc762..fd88a5f 100755 --- a/nodejs/models/host.js +++ b/nodejs/models/host.js @@ -28,6 +28,7 @@ class Host extends Table{ 'host': {isRequired: true, type: 'string', min: 1, max: 500}, 'ip': {isRequired: true, type: 'string', min: 3, max: 500}, 'targetPort': {isRequired: true, type: 'number', min:0, max:65535}, + 'targets': {default: function(){return []}, isRequired: false, type: 'object'}, 'forcessl': {isRequired: false, default: true, type: 'boolean'}, 'targetssl': {isRequired: false, default: false, type: 'boolean'}, diff --git a/nodejs/utils/host_features.js b/nodejs/utils/host_features.js index 4e5cc83..32ddc9d 100644 --- a/nodejs/utils/host_features.js +++ b/nodejs/utils/host_features.js @@ -252,6 +252,7 @@ function normalizeHostFeatures(body){ if('sso_enabled' in body) body.sso_enabled = toBool(body.sso_enabled); if('sso_allow_users' in body) body.sso_allow_users = parseAllowList(body.sso_allow_users); if('sso_allow_groups' in body) body.sso_allow_groups = parseAllowList(body.sso_allow_groups); + if('targets' in body) body.targets = parseAllowList(body.targets); if('ratelimit_rate' in body) body.ratelimit_rate = clampNumber(body.ratelimit_rate, 1, 1000000, 10); if('ratelimit_burst' in body) body.ratelimit_burst = clampNumber(body.ratelimit_burst, 0, 1000000, 20); diff --git a/nodejs/views/hosts.ejs b/nodejs/views/hosts.ejs index 9a61c93..fa18728 100755 --- a/nodejs/views/hosts.ejs +++ b/nodejs/views/hosts.ejs @@ -232,6 +232,7 @@ }); $f.find("textarea[name='req_headers']").val(hostFeatureHeadersToText(h.req_headers)); + $f.find("textarea[name='targets']").val(hostFeatureListToText(h.targets)); $f.find("textarea[name='resp_headers']").val(hostFeatureHeadersToText(h.resp_headers)); $f.find("textarea[name='ip_allow']").val(hostFeatureListToText(h.ip_allow)); $f.find("textarea[name='ip_deny']").val(hostFeatureListToText(h.ip_deny)); @@ -632,6 +633,14 @@ Whether the proxy talks to the target over HTTP or HTTPS. Independent of Incoming SSL above — clients can use HTTPS to reach the proxy while it still talks plain HTTP to the target, or vice versa. + +