Add max rules limit to 32768

Add getLink to template function.
Change max ruleset limit in external configs to 64.
This commit is contained in:
Tindy X committed 2020-05-18 01:30:54 +08:00
1 parent 6219ad03bb
commit a1b7d635ba
3 files changed
+30 -7

No files matched your search

+6
View File
@@ -9,6 +9,8 @@
#include "logger.h"
#include "misc.h"
extern std::string managed_config_prefix;
static inline void parse_json_pointer(nlohmann::json &json, const std::string &path, const std::string &value)
{
std::string pointer = "/" + replace_all_distinct(path, ".", "/");
@@ -110,6 +112,10 @@ int render_template(const std::string &content, const template_args &vars, std::
data[nlohmann::json::json_pointer(pointer)] = output_content;
return std::string();
});
m_callbacks.add_callback("getLink", 1, [](inja::Arguments &args)
{
return managed_config_prefix + args.at(0)->get<std::string>();
});
m_callbacks.add_callback("fetch", 1, template_webGet);
m_callbacks.add_callback("parseHostname", 1, parseHostname);
m_parser_config.include_scope_limit = true;