From: Alberto Leiva Popper Date: Fri, 30 Jun 2023 22:14:11 +0000 (-0600) Subject: Deprecate stale-repository-period better X-Git-Tag: 1.6.0~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58e95976afcc2b2a84d7e6f6ed7f5ef5d95b68a4;p=thirdparty%2FFORT-validator.git Deprecate stale-repository-period better This had been deprecated in efe3d0cca66fdf9cef220f4e76fff71b12a11c8b, but I forgot to update the manual. Also added deprecation warning message. --- diff --git a/examples/config.json b/examples/config.json index 29dbcf28..a7bc3436 100644 --- a/examples/config.json +++ b/examples/config.json @@ -116,5 +116,4 @@ } }, "asn1-decode-max-stack": 4096, - "stale-repository-period": 43200 } diff --git a/man/fort.8 b/man/fort.8 index 308f3089..52f49360 100644 --- a/man/fort.8 +++ b/man/fort.8 @@ -1142,31 +1142,7 @@ By default, it has a value of \fI4096\fR (4 kB). .B \-\-stale-repository-period=\fIUNSIGNED_INTEGER\fR .RS 4 -Time period that must lapse to warn about a stale repository (the messages will -be sent to the operation log). The time lapse starts once the repository -download has been retried (see \fI--rsync.retry.count\fR and -\fI--http.retry.count\fR) and failed after such retries. -.P -A repository is considered stale if its files can't be fetched due to a -communication error and this error persists across validation cycles. This kind -of issues can be due to a local misconfiguration (eg. a firewall that blocks -incoming data) or a problem at the server (eg. the server is down). -.P -Despite who's "fault" is, FORT validator will try to work with the local files -from \fI--local-repository\fR. -.P -The communication errors sent to the operation log, are those related to -"first level" RPKI servers; commonly this are the servers maintained by the -RIRs. -.P -Currently \fBall\fR the communication errors are logged at the validation log. -This argument (\fB--stale-repository-period\fR) is merely to send this error -messages also to the operation log. -.P -A value \fBequal to 0\fR means that the communication errors will be logged at -once. -.P -By default, it has a value of \fI43200\fR (12 hours). +Deprecated; does nothing. .RE .P @@ -1347,8 +1323,7 @@ to a specific value: "max": 5 } }, - "asn1-decode-max-stack": 4096, - "stale-repository-period": 43200 + "asn1-decode-max-stack": 4096 } .fi .RE diff --git a/src/config.c b/src/config.c index ba3f5c69..3ff514ba 100644 --- a/src/config.c +++ b/src/config.c @@ -714,6 +714,7 @@ static const struct option_field options[] = { .type = >_uint, .offset = offsetof(struct rpki_config, stale_repository_period), .doc = "Deprecated; does nothing.", + .deprecated = true, .min = 0, .max = UINT_MAX, }, @@ -966,6 +967,7 @@ set_default_values(void) rpki_config.output.format = OFM_CSV; rpki_config.asn1_decode_max_stack = 4096; /* 4kB */ + rpki_config.stale_repository_period = 43200; /* 12 hours */ rpki_config.init_tals = false; rpki_config.thread_pool.server.max = 20; @@ -1057,6 +1059,10 @@ handle_opt(int opt) FOREACH_OPTION(options, option, AVAILABILITY_GETOPT) { if (option->id == opt) { + if (option->deprecated) + pr_op_warn("Warning: '%s' is deprecated.", + option->name); + return is_rpki_config_field(option) ? option->type->parse.argv(option, optarg, get_rpki_config_field(option)) diff --git a/src/config/types.h b/src/config/types.h index 56abb8b8..0c338580 100644 --- a/src/config/types.h +++ b/src/config/types.h @@ -2,6 +2,7 @@ #define SRC_CONFIG_TYPES_H_ #include +#include #include #include @@ -75,6 +76,7 @@ struct option_field { * Optional. */ int availability; + bool deprecated; unsigned int min; unsigned int max; };