Add new config items to the test TOML file

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-01-09 20:34:54 +01:00
parent 8bbd49acf4
commit 8033c6c6bf
6 changed files with 45 additions and 15 deletions

View File

@@ -200,7 +200,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
if(val.ok)
conf_item->v.b = val.u.b;
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type bool", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type bool", conf_item->k);
break;
}
case CONF_INT:
@@ -209,7 +209,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
if(val.ok)
conf_item->v.i = val.u.i;
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type integer", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type integer", conf_item->k);
break;
}
case CONF_UINT:
@@ -218,7 +218,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
if(val.ok && val.u.i >= 0)
conf_item->v.ui = val.u.i;
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type unsigned integer", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type unsigned integer", conf_item->k);
break;
}
case CONF_LONG:
@@ -227,7 +227,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
if(val.ok)
conf_item->v.l = val.u.i;
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type long", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type long", conf_item->k);
break;
}
case CONF_ULONG:
@@ -236,7 +236,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
if(val.ok && val.u.i >= 0)
conf_item->v.ul = val.u.i;
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type unsigned long", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type unsigned long", conf_item->k);
break;
}
case CONF_DOUBLE:
@@ -245,7 +245,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
if(val.ok)
conf_item->v.d = val.u.d;
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type double", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type double", conf_item->k);
break;
}
case CONF_STRING:
@@ -260,7 +260,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
conf_item->t = CONF_STRING_ALLOCATED;
}
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type string", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type string", conf_item->k);
break;
}
case CONF_ENUM_PTR_TYPE:
@@ -275,7 +275,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
log_warn("Config setting %s is invalid, allowed options are: %s", conf_item->k, conf_item->h);
}
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type string", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type string", conf_item->k);
break;
}
case CONF_ENUM_BUSY_TYPE:
@@ -290,7 +290,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
log_warn("Config setting %s is invalid, allowed options are: %s", conf_item->k, conf_item->h);
}
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type string", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type string", conf_item->k);
break;
}
case CONF_ENUM_BLOCKING_MODE:
@@ -305,7 +305,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
log_warn("Config setting %s is invalid, allowed options are: %s", conf_item->k, conf_item->h);
}
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type string", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type string", conf_item->k);
break;
}
case CONF_ENUM_REFRESH_HOSTNAMES:
@@ -320,7 +320,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
log_warn("Config setting %s is invalid, allowed options are: %s", conf_item->k, conf_item->h);
}
else
log_debug(DEBUG_CONFIG, "%s does not exist or is not of type string", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is not of type string", conf_item->k);
break;
}
case CONF_ENUM_PRIVACY_LEVEL:
@@ -329,7 +329,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
if(val.ok && val.u.i >= PRIVACY_SHOW_ALL && val.u.i <= PRIVACY_MAXIMUM)
conf_item->v.i = val.u.i;
else
log_debug(DEBUG_CONFIG, "%s does not exist or is invalid", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST or is invalid", conf_item->k);
break;
}
case CONF_STRUCT_IN_ADDR:
@@ -373,7 +373,7 @@ void readTOMLvalue(struct conf_item *conf_item, const char* key, toml_table_t *t
}
}
else
log_debug(DEBUG_CONFIG, "%s does not exist", conf_item->k);
log_debug(DEBUG_CONFIG, "%s DOES NOT EXIST", conf_item->k);
break;
}
}

View File

@@ -80,7 +80,7 @@ bool writeFTLtoml(void)
// Compare with default value and add a comment on difference
bool changed = false;
if(conf_item->t == CONF_STRING)
if(conf_item->t == CONF_STRING || conf_item->t == CONF_STRING_ALLOCATED)
changed = strcmp(conf_item->v.s, conf_item->d.s) != 0;
else if(conf_item->t == CONF_JSON_STRING_ARRAY)
changed = !cJSON_Compare(conf_item->v.json, conf_item->d.json, true);

View File

@@ -3301,7 +3301,8 @@ void FTL_dnsmasq_log(const char *payload, const int length)
int check_struct_sizes(void)
{
int result = 0;
result += check_one_struct("struct config", sizeof(struct config), 6120, 4420);
// sizeof(struct conf_item) is 72 on x86_64 and 52 on x86_32
result += check_one_struct("struct config", sizeof(struct config), 6336, 4576);
result += check_one_struct("queriesData", sizeof(queriesData), 72, 64);
result += check_one_struct("upstreamsData", sizeof(upstreamsData), 640, 628);
result += check_one_struct("clientsData", sizeof(clientsData), 672, 652);

View File

@@ -171,6 +171,14 @@
# Possible values are: <valid subpath>, both slashes are needed!
webhome = "/admin/"
[http.interface]
# Should the web interface use the boxed layout?
boxed = true
# Theme used by the Pi-hole web interface
# Possible values are: <valid themename>
theme = "default"
[files]
# The location of FTL's log file
# Possible values are: <any writable file>
@@ -217,6 +225,9 @@
# Privacy level
privacylevel = 0
# Which upper temperature limit should be used by Pi-hole [°C]? Temperatures above this limit will be shown as "hot"
temp_limit = 60.000000
[misc.check]
# Should FTL check the 15 min average of CPU load and complain if the load is larger than the number of available CPU cores?
load = false ### CHANGED, default = true

View File

@@ -53,6 +53,9 @@ chown pihole:pihole /etc/pihole/pihole-FTL.toml
# Prepare dnsmasq.conf
cp test/dnsmasq.conf /etc/dnsmasq.conf
# Prepare versions file (read by /api/version)
cp test/versions /etc/pihole/versions
# Prepare local powerDNS resolver
bash test/pdns/setup.sh

15
test/versions Normal file
View File

@@ -0,0 +1,15 @@
CORE_BRANCH=development
WEB_BRANCH=devel
FTL_BRANCH=development
CORE_VERSION=v5.14.2-60-g955e36a9
WEB_VERSION=v5.17-7-gf69f7e88
FTL_VERSION=v5.20-489-g64441ed6-dirty
GITHUB_CORE_VERSION=v5.14.2
GITHUB_WEB_VERSION=v5.18
GITHUB_FTL_VERSION=v5.20
CORE_HASH=955e36a9
GITHUB_CORE_HASH=dfcdb1a7
WEB_HASH=f69f7e88
GITHUB_WEB_HASH=f69f7e88
FTL_HASH=64441ed6-dirty
GITHUB_FTL_HASH=140a3658