]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Deprecate stale-repository-period better
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 30 Jun 2023 22:14:11 +0000 (16:14 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Fri, 30 Jun 2023 22:14:11 +0000 (16:14 -0600)
This had been deprecated in efe3d0cca66fdf9cef220f4e76fff71b12a11c8b,
but I forgot to update the manual.

Also added deprecation warning message.

examples/config.json
man/fort.8
src/config.c
src/config/types.h

index 29dbcf28549112e0dceb20717d6c825425a76bda..a7bc343672cfdee4f4717499e90e3ba5bcfba5d5 100644 (file)
     }
   },
   "asn1-decode-max-stack": 4096,
-  "stale-repository-period": 43200
 }
index 308f3089f75304c2c3119bf3a69ac04a39a9d769..52f493606f6af98aa5a5ac7a7983ec5a0d1e872d 100644 (file)
@@ -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
index ba3f5c69f2c3004c474250d904328a893ca54837..3ff514ba3bb30241bea2ad9e0d67f9f47d3a3791 100644 (file)
@@ -714,6 +714,7 @@ static const struct option_field options[] = {
                .type = &gt_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))
index 56abb8b8aa71cb69d827073fe1a9006d97bde09f..0c33858008acd05c2c0b4df98f5f466df7ef9d5c 100644 (file)
@@ -2,6 +2,7 @@
 #define SRC_CONFIG_TYPES_H_
 
 #include <jansson.h>
+#include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
 
@@ -75,6 +76,7 @@ struct option_field {
         * Optional.
         */
        int availability;
+       bool deprecated;
        unsigned int min;
        unsigned int max;
 };