Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/admin-guide/files/records.config.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,7 @@ Logging Configuration

.. ts:cv:: CONFIG proxy.config.log.config.filename STRING logging.yaml
:reloadable:
:deprecated:

This configuration value specifies the path to the
:file:`logging.yaml` configuration file. If this is a relative
Expand Down Expand Up @@ -3061,6 +3062,7 @@ URL Remap Rules
===============

.. ts:cv:: CONFIG proxy.config.url_remap.filename STRING remap.config
:deprecated:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be done for the other vars as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only one with documentation :). I can add them though, but seems kinda lame to add new documentation for something we deprecate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought these were the equivalent to that one:

.. ts:cv:: CONFIG proxy.config.log.config.filename STRING logging.yaml
.. ts:cv:: CONFIG proxy.config.url_remap.filename STRING remap.config
.. ts:cv:: CONFIG proxy.config.ssl.server.multicert.filename STRING ssl_multicert.config
.. ts:cv:: CONFIG proxy.config.ssl.servername.filename STRING sni.yaml

Copy link
Contributor Author

@zwoop zwoop Nov 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I must have missed those ... Let me mark them. Thanks!


Sets the name of the :file:`remap.config` file.

Expand Down Expand Up @@ -3191,6 +3193,7 @@ SSL Termination


.. ts:cv:: CONFIG proxy.config.ssl.server.multicert.filename STRING ssl_multicert.config
:deprecated:

The location of the :file:`ssl_multicert.config` file, relative
to the |TS| configuration directory. In the following
Expand Down Expand Up @@ -3259,6 +3262,7 @@ SSL Termination
file is changed with new tickets, use :option:`traffic_ctl config reload` to begin using them.

.. ts:cv:: CONFIG proxy.config.ssl.servername.filename STRING sni.yaml
:deprecated:

The filename of the :file:`sni.yaml` configuration file.
If relative, it is relative to the configuration directory.
Expand Down Expand Up @@ -3987,6 +3991,7 @@ SOCKS Processor
Specifies the SOCKS version (``4``) or (``5``)

.. ts:cv:: CONFIG proxy.config.socks.socks_config_file STRING socks.config
:deprecated:

The socks.config file allows you to specify ranges of IP addresses
that will not be relayed to the SOCKS server. It can also be used
Expand Down
35 changes: 27 additions & 8 deletions include/tscore/Filenames.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,30 @@

#pragma once

///////////////////////////////////////////////////////////////////
// Configuration file names
extern const char *STORAGE_CONF_FILENAME;
extern const char *RECORDS_CONF_FILENAME;

///////////////////////////////////////////////////////////////////
// Various other file names
extern const char *RECORDS_STATS_FILE;
namespace ts
{
namespace filename
{
constexpr const char *STORAGE = "storage.config";
constexpr const char *RECORDS = "records.config";
constexpr const char *VOLUME = "volume.config";
constexpr const char *PLUGIN = "plugin.config";

// These still need to have their corrensponding records.config settings remove
constexpr const char *LOGGING = "logging.yaml";
constexpr const char *CACHE = "cache.config";
constexpr const char *IP_ALLOW = "ip_allow.yaml";
constexpr const char *HOSTING = "hosting.config";
constexpr const char *SOCKS = "socks.config";
constexpr const char *PARENT = "parent.config";
constexpr const char *REMAP = "remap.config";
constexpr const char *SSL_MULTICERT = "ssl_multicert.config";
constexpr const char *SPLITDNS = "splitdns.config";
constexpr const char *SNI = "sni.yaml";

///////////////////////////////////////////////////////////////////
// Various other file names
constexpr const char *RECORDS_STATS = "records.snap";

} // namespace filename
} // namespace ts
2 changes: 1 addition & 1 deletion iocore/cache/Cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3248,7 +3248,7 @@ ink_cache_init(ts::ModuleVersion v)

Result result = theCacheStore.read_config();
if (result.failed()) {
Fatal("Failed to read cache configuration %s: %s", STORAGE_CONF_FILENAME, result.message());
Fatal("Failed to read cache configuration %s: %s", ts::filename::STORAGE, result.message());
}
}

Expand Down
11 changes: 6 additions & 5 deletions iocore/cache/CacheHosting.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "tscore/HostLookup.h"
#include "tscore/Tokenizer.h"
#include "tscore/Regression.h"
#include "tscore/Filenames.h"

extern int gndisks;

Expand Down Expand Up @@ -244,7 +245,7 @@ int fstat_wrapper(int fd, struct stat *s);
int
CacheHostTable::BuildTableFromString(const char *config_file_path, char *file_buf)
{
Note("hosting.config loading ...");
Note("%s loading ...", ts::filename::HOSTING);

// Table build locals
Tokenizer bufTok("\n");
Expand Down Expand Up @@ -325,7 +326,7 @@ CacheHostTable::BuildTableFromString(const char *config_file_path, char *file_bu
if (gen_host_rec.Init(type)) {
Warning("Problems encountered while initializing the Generic Volume");
}
Note("hosting.config finished loading");
Note("%s finished loading", ts::filename::HOSTING);
return 0;
}

Expand Down Expand Up @@ -374,7 +375,7 @@ CacheHostTable::BuildTableFromString(const char *config_file_path, char *file_bu
current = current->next;
ats_free(last);

Note("hosting.config finished loading");
Note("%s finished loading", ts::filename::HOSTING);
}

if (!generic_rec_initd) {
Expand Down Expand Up @@ -596,11 +597,11 @@ ConfigVolumes::read_config_file()
config_path = RecConfigReadConfigPath("proxy.config.cache.volume_filename");
ink_release_assert(config_path);

Note("volume.config loading ...");
Note("%s loading ...", ts::filename::VOLUME);

file_buf = readIntoBuffer(config_path, "[CacheVolition]", nullptr);
if (file_buf == nullptr) {
Error("volume.config failed to load");
Error("%s failed to load", ts::filename::VOLUME);
Warning("Cannot read the config file: %s", (const char *)config_path);
return;
}
Expand Down
12 changes: 6 additions & 6 deletions iocore/cache/Store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,13 @@ Store::read_config()
Span *sd = nullptr, *cur = nullptr;
Span *ns;
ats_scoped_fd fd;
ats_scoped_str storage_path(RecConfigReadConfigPath(nullptr, STORAGE_CONF_FILENAME));
ats_scoped_str storage_path(RecConfigReadConfigPath(nullptr, ts::filename::STORAGE));

Note("%s loading ...", STORAGE_CONF_FILENAME);
Note("%s loading ...", ts::filename::STORAGE);
Debug("cache_init", "Store::read_config, fd = -1, \"%s\"", (const char *)storage_path);
fd = ::open(storage_path, O_RDONLY);
if (fd < 0) {
Error("%s failed to load", STORAGE_CONF_FILENAME);
Error("%s failed to load", ts::filename::STORAGE);
return Result::failure("open %s: %s", (const char *)storage_path, strerror(errno));
}

Expand Down Expand Up @@ -372,7 +372,7 @@ Store::read_config()
const char *end;
if ((size = ink_atoi64(e, &end)) <= 0 || *end != '\0') {
delete sd;
Error("%s failed to load", STORAGE_CONF_FILENAME);
Error("%s failed to load", ts::filename::STORAGE);
return Result::failure("failed to parse size '%s'", e);
}
} else if (0 == strncasecmp(HASH_BASE_STRING_KEY, e, sizeof(HASH_BASE_STRING_KEY) - 1)) {
Expand All @@ -390,7 +390,7 @@ Store::read_config()
}
if (!*e || !ParseRules::is_digit(*e) || 0 >= (volume_num = ink_atoi(e))) {
delete sd;
Error("%s failed to load", STORAGE_CONF_FILENAME);
Error("%s failed to load", ts::filename::STORAGE);
return Result::failure("failed to parse volume number '%s'", e);
}
}
Expand Down Expand Up @@ -442,7 +442,7 @@ Store::read_config()
sd = nullptr; // these are all used.
sort();

Note("%s finished loading", STORAGE_CONF_FILENAME);
Note("%s finished loading", ts::filename::STORAGE);

return Result::ok();
}
Expand Down
11 changes: 6 additions & 5 deletions iocore/dns/SplitDNS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include "tscore/ink_platform.h"
#include "tscore/Tokenizer.h"
#include "tscore/Filenames.h"

#ifdef SPLIT_DNS
#include <sys/types.h>
Expand Down Expand Up @@ -130,15 +131,15 @@ SplitDNSConfig::reconfigure()
return;
}

Note("splitdns.config loading ...");
Note("%s loading ...", ts::filename::SPLITDNS);

SplitDNS *params = new SplitDNS;

params->m_SplitDNSlEnable = gsplit_dns_enabled;
params->m_DNSSrvrTable = new DNS_table("proxy.config.dns.splitdns.filename", modulePrefix, &sdns_dest_tags);

if (nullptr == params->m_DNSSrvrTable || (0 == params->m_DNSSrvrTable->getEntryCount())) {
Error("splitdns.config failed to load");
Error("%s failed to load", ts::filename::SPLITDNS);
Warning("No NAMEDs provided! Disabling SplitDNS");
gsplit_dns_enabled = 0;
delete params;
Expand All @@ -159,7 +160,7 @@ SplitDNSConfig::reconfigure()
SplitDNSConfig::print();
}

Note("splitdns.config finished loading");
Note("%s finished loading", ts::filename::SPLITDNS);
}

/* --------------------------------------------------------------
Expand Down Expand Up @@ -476,7 +477,7 @@ SplitDNSRecord::Init(matcher_line *line_info)
}

if (!ats_is_ip(&m_servers.x_server_ip[0].sa)) {
return Result::failure("%s No server specified in splitdns.config at line %d", modulePrefix, line_num);
return Result::failure("%s No server specified in %s at line %d", modulePrefix, ts::filename::SPLITDNS, line_num);
}

DNSHandler *dnsH = new DNSHandler;
Expand Down Expand Up @@ -505,7 +506,7 @@ SplitDNSRecord::Init(matcher_line *line_info)
if (line_info->num_el > 0) {
const char *tmp = ProcessModifiers(line_info);
if (tmp != nullptr) {
return Result::failure("%s %s at line %d in splitdns.config", modulePrefix, tmp, line_num);
return Result::failure("%s %s at line %d in %s", modulePrefix, tmp, line_num, ts::filename::SPLITDNS);
}
}

Expand Down
5 changes: 3 additions & 2 deletions iocore/net/QUICMultiCertConfigLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "QUICConfig.h"
#include "QUICConnection.h"
#include "QUICTypes.h"
#include "tscore/Filenames.h"
// #include "QUICGlobals.h"

#define QUICConfDebug(fmt, ...) Debug("quic_conf", fmt, ##__VA_ARGS__)
Expand Down Expand Up @@ -128,7 +129,7 @@ QUICMultiCertConfigLoader::init_server_ssl_ctx(std::vector<X509 *> &cert_list, c
#if TS_USE_TLS_SET_CIPHERSUITES
if (params->server_tls13_cipher_suites != nullptr) {
if (!SSL_CTX_set_ciphersuites(ctx, params->server_tls13_cipher_suites)) {
Error("invalid tls server cipher suites in records.config");
Error("invalid tls server cipher suites in %s", ts::filename::RECORDS);
goto fail;
}
}
Expand All @@ -141,7 +142,7 @@ QUICMultiCertConfigLoader::init_server_ssl_ctx(std::vector<X509 *> &cert_list, c
#else
if (!SSL_CTX_set1_curves_list(ctx, params->server_groups_list)) {
#endif
Error("invalid groups list for server in records.config");
Error("invalid groups list for server in %s", ts::filename::RECORDS);
goto fail;
}
}
Expand Down
7 changes: 4 additions & 3 deletions iocore/net/SSLClientUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "tscore/ink_config.h"
#include "records/I_RecHttp.h"
#include "tscore/ink_platform.h"
#include "tscore/Filenames.h"
#include "tscore/X509HostnameValidator.h"

#include "P_Net.h"
Expand Down Expand Up @@ -158,15 +159,15 @@ SSLInitClientContext(const SSLConfigParams *params)
SSL_CTX_set_options(client_ctx, params->ssl_client_ctx_options);
if (params->client_cipherSuite != nullptr) {
if (!SSL_CTX_set_cipher_list(client_ctx, params->client_cipherSuite)) {
SSLError("invalid client cipher suite in records.config");
SSLError("invalid client cipher suite in %s", ts::filename::RECORDS);
goto fail;
}
}

#if TS_USE_TLS_SET_CIPHERSUITES
if (params->client_tls13_cipher_suites != nullptr) {
if (!SSL_CTX_set_ciphersuites(client_ctx, params->client_tls13_cipher_suites)) {
SSLError("invalid tls client cipher suites in records.config");
SSLError("invalid tls client cipher suites in %s", ts::filename::RECORDS);
goto fail;
}
}
Expand All @@ -179,7 +180,7 @@ SSLInitClientContext(const SSLConfigParams *params)
#else
if (!SSL_CTX_set1_curves_list(client_ctx, params->client_groups_list)) {
#endif
SSLError("invalid groups list for client in records.config");
SSLError("invalid groups list for client in %s", ts::filename::RECORDS);
goto fail;
}
}
Expand Down
13 changes: 7 additions & 6 deletions iocore/net/SSLUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "tscore/I_Layout.h"
#include "tscore/ink_cap.h"
#include "tscore/ink_mutex.h"
#include "tscore/Filenames.h"
#include "records/I_RecHttp.h"

#include "P_Net.h"
Expand Down Expand Up @@ -962,7 +963,7 @@ SSLPrivateKeyHandler(SSL_CTX *ctx, const SSLConfigParams *params, const std::str
SSLConfigParams::load_ssl_file_cb(completeServerKeyPath);
}
} else {
SSLError("empty SSL private key path in records.config");
SSLError("empty SSL private key path in %s", ts::filename::RECORDS);
return false;
}

Expand Down Expand Up @@ -1328,7 +1329,7 @@ SSLMultiCertConfigLoader::init_server_ssl_ctx(std::vector<X509 *> &cert_list, co
} else {
// disable client cert support
server_verify_client = SSL_VERIFY_NONE;
Error("illegal client certification level %d in records.config", server_verify_client);
Error("illegal client certification level %d in %s", server_verify_client, ts::filename::RECORDS);
}
SSL_CTX_set_verify(ctx, server_verify_client, ssl_verify_client_callback);
SSL_CTX_set_verify_depth(ctx, params->verify_depth); // might want to make configurable at some point.
Expand All @@ -1340,15 +1341,15 @@ SSLMultiCertConfigLoader::init_server_ssl_ctx(std::vector<X509 *> &cert_list, co

if (params->cipherSuite != nullptr) {
if (!SSL_CTX_set_cipher_list(ctx, params->cipherSuite)) {
SSLError("invalid cipher suite in records.config");
SSLError("invalid cipher suite in %s", ts::filename::RECORDS);
goto fail;
}
}

#if TS_USE_TLS_SET_CIPHERSUITES
if (params->server_tls13_cipher_suites != nullptr) {
if (!SSL_CTX_set_ciphersuites(ctx, params->server_tls13_cipher_suites)) {
SSLError("invalid tls server cipher suites in records.config");
SSLError("invalid tls server cipher suites in %s", ts::filename::RECORDS);
goto fail;
}
}
Expand All @@ -1361,7 +1362,7 @@ SSLMultiCertConfigLoader::init_server_ssl_ctx(std::vector<X509 *> &cert_list, co
#else
if (!SSL_CTX_set1_curves_list(ctx, params->server_groups_list)) {
#endif
SSLError("invalid groups list for server in records.config");
SSLError("invalid groups list for server in %s", ts::filename::RECORDS);
goto fail;
}
}
Expand Down Expand Up @@ -1590,7 +1591,7 @@ SSLMultiCertConfigLoader::load(SSLCertLookup *lookup)

const matcher_tags sslCertTags = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, false};

Note("ssl_multicert.config loading ...");
Note("%s loading ...", ts::filename::SSL_MULTICERT);

if (params->configFilePath) {
file_buf = readIntoBuffer(params->configFilePath, __func__, nullptr);
Expand Down
6 changes: 3 additions & 3 deletions lib/records/RecCore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ RecCoreInit(RecModeT mode_type, Diags *_diags)

ink_mutex_init(&g_rec_config_lock);

g_rec_config_fpath = ats_stringdup(RecConfigReadConfigPath(nullptr, RECORDS_CONF_FILENAME));
g_rec_config_fpath = ats_stringdup(RecConfigReadConfigPath(nullptr, ts::filename::RECORDS));
if (RecFileExists(g_rec_config_fpath) == REC_ERR_FAIL) {
RecLog(DL_Warning, "Could not find '%s', system will run with defaults\n", RECORDS_CONF_FILENAME);
RecLog(DL_Warning, "Could not find '%s', system will run with defaults\n", ts::filename::RECORDS);
file_exists = false;
}

Expand Down Expand Up @@ -1257,7 +1257,7 @@ std::string
RecConfigReadPersistentStatsPath()
{
std::string rundir(RecConfigReadRuntimeDir());
return Layout::relative_to(rundir, RECORDS_STATS_FILE);
return Layout::relative_to(rundir, ts::filename::RECORDS_STATS);
}

void
Expand Down
4 changes: 2 additions & 2 deletions mgmt/LocalManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,9 @@ LocalManager::processEventQueue()
// check if we have a local file update
if (mh->msg_id == MGMT_EVENT_CONFIG_FILE_UPDATE) {
// records.config
if (!(strcmp(payload.begin(), RECORDS_CONF_FILENAME))) {
if (!(strcmp(payload.begin(), ts::filename::RECORDS))) {
if (RecReadConfigFile() != REC_ERR_OKAY) {
mgmt_elog(errno, "[fileUpdated] Config update failed for records.config\n");
mgmt_elog(errno, "[fileUpdated] Config update failed for %s\n", ts::filename::RECORDS);
} else {
RecConfigWarnIfUnregistered();
}
Expand Down
Loading