diff options
-rw-r--r-- | changes/ticket10427 | 4 | ||||
-rw-r--r-- | src/or/router.c | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/changes/ticket10427 b/changes/ticket10427 new file mode 100644 index 0000000000..66af284243 --- /dev/null +++ b/changes/ticket10427 @@ -0,0 +1,4 @@ + o Minor features: + - When identity keypair is generated for first time, log a + congratulatory message that points to new relay lifecycle + document. Implements feature 10427. diff --git a/src/or/router.c b/src/or/router.c index 2a21b81a23..5219ca44d5 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -369,6 +369,26 @@ rotate_onion_key(void) tor_free(fname_prev); } +/** Log greeting message that points to new relay lifecycle document the + * first time this function has been called. + */ +static void +log_new_relay_greeting(void) +{ + static int already_logged = 0; + + if (already_logged) + return; + + tor_log(LOG_NOTICE, LD_GENERAL, "You are running a new relay. " + "Thanks for helping the Tor network! If you wish to know " + "what will happen in the upcoming weeks regarding its usage, " + "have a look at https://blog.torproject.org/blog/lifecycle-of" + "-a-new-relay"); + + already_logged = 1; +} + /** Try to read an RSA key from <b>fname</b>. If <b>fname</b> doesn't exist * and <b>generate</b> is true, create a new RSA key and save it in * <b>fname</b>. Return the read/created key, or NULL on error. Log all @@ -413,6 +433,7 @@ init_key_from_file(const char *fname, int generate, int severity) goto error; } log_info(LD_GENERAL, "Generated key seems valid"); + log_new_relay_greeting(); if (crypto_pk_write_private_key_to_filename(prkey, fname)) { tor_log(severity, LD_FS, "Couldn't write generated key to \"%s\".", fname); |