Add ability to disable services
This commit is contained in:
parent
a7a8d17186
commit
b3f9c69b93
4 changed files with 9 additions and 2 deletions
|
@ -6,6 +6,10 @@ function service(target, domain, host, alias, vpn) {
|
||||||
alias: alias,
|
alias: alias,
|
||||||
vpn: vpn,
|
vpn: vpn,
|
||||||
record: function() {
|
record: function() {
|
||||||
|
var resolved_host = this.resolve_host();
|
||||||
|
if (!resolved_host) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
return my_host_record(this.target, this.resolve_host(), this.vpn);
|
return my_host_record(this.target, this.resolve_host(), this.vpn);
|
||||||
},
|
},
|
||||||
resolve_host: function() {
|
resolve_host: function() {
|
||||||
|
|
|
@ -72,6 +72,7 @@ class FilterModule(object):
|
||||||
|
|
||||||
new_endpoint = {
|
new_endpoint = {
|
||||||
"name": name,
|
"name": name,
|
||||||
|
"enabled": bool(service.get("host")),
|
||||||
"group": mon.get("group"),
|
"group": mon.get("group"),
|
||||||
"url": url,
|
"url": url,
|
||||||
"conditions": conditions,
|
"conditions": conditions,
|
||||||
|
|
|
@ -87,6 +87,8 @@ def parse_services(services, hosts):
|
||||||
for host in hosts.keys():
|
for host in hosts.keys():
|
||||||
data["host"] = host
|
data["host"] = host
|
||||||
result.append(parse_service(svc, data, hosts))
|
result.append(parse_service(svc, data, hosts))
|
||||||
|
elif not data["host"]:
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
result.append(parse_service(svc, data, hosts))
|
result.append(parse_service(svc, data, hosts))
|
||||||
|
|
||||||
|
|
|
@ -750,7 +750,7 @@ services = {
|
||||||
},
|
},
|
||||||
|
|
||||||
"wiki_js" = {
|
"wiki_js" = {
|
||||||
host = "node001"
|
host = ""
|
||||||
dns = [{
|
dns = [{
|
||||||
domain = "wiki.serguzim.me"
|
domain = "wiki.serguzim.me"
|
||||||
}]
|
}]
|
||||||
|
@ -765,7 +765,7 @@ services = {
|
||||||
},
|
},
|
||||||
|
|
||||||
"woodpecker" = {
|
"woodpecker" = {
|
||||||
host = "node001"
|
host = ""
|
||||||
dns = [
|
dns = [
|
||||||
{
|
{
|
||||||
domain = "ci.serguzim.me"
|
domain = "ci.serguzim.me"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue