summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2014-10-26 21:51:35 +0200
committerrl1987 <rl1987@sdf.lonestar.org>2014-10-26 21:53:48 +0200
commit36e771628eb77f9eb4101517b761c8dc652ff037 (patch)
tree04f2c40f716c9ebba10d9865d831c42c643a0948 /src/or/router.c
parent1ce57267b4dbb765dc0ce652080b60ecc013703e (diff)
downloadtor-36e771628eb77f9eb4101517b761c8dc652ff037.tar.gz
tor-36e771628eb77f9eb4101517b761c8dc652ff037.zip
Congratulate relay operator when OR is first started
When Tor first generates identity keypair, emit a log message that thanks for their participation and points to new Tor relay lifecycle document.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index bbbf9c4b84..b202554357 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -381,6 +381,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
@@ -425,6 +445,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);