relay: Skip warnings for single onion services

Single onion services are not secret, so there is no added risk from
using accounting or running a relay in the same instance.

Related to #40691
This commit is contained in:
Jeremy Saklad 2022-10-21 08:07:43 -05:00
parent 4481c1e609
commit 7e80ad4787
No known key found for this signature in database
GPG Key ID: 94B02EA3D0B6481B
2 changed files with 8 additions and 2 deletions

3
changes/ticket40691 Normal file
View File

@ -0,0 +1,3 @@
o Minor features (relay):
- Do not warn about configuration options that may expose a non-anonymous
onion service. Closes ticket 40691.

View File

@ -33,6 +33,7 @@
#include "core/or/port_cfg_st.h"
#include "feature/hibernate/hibernate.h"
#include "feature/hs/hs_service.h"
#include "feature/nodelist/nickname.h"
#include "feature/stats/geoip_stats.h"
#include "feature/stats/predict_ports.h"
@ -942,7 +943,8 @@ options_validate_relay_accounting(const or_options_t *old_options,
if (accounting_parse_options(options, 1)<0)
REJECT("Failed to parse accounting options. See logs for details.");
if (options->AccountingMax) {
if (options->AccountingMax &&
!hs_service_non_anonymous_mode_enabled(options)) {
if (options->RendConfigLines && server_mode(options)) {
log_warn(LD_CONFIG, "Using accounting with a hidden service and an "
"ORPort is risky: your hidden service(s) and your public "
@ -1118,7 +1120,8 @@ options_validate_relay_mode(const or_options_t *old_options,
if (BUG(!msg))
return -1;
if (server_mode(options) && options->RendConfigLines)
if (server_mode(options) && options->RendConfigLines &&
!hs_service_non_anonymous_mode_enabled(options))
log_warn(LD_CONFIG,
"Tor is currently configured as a relay and a hidden service. "
"That's not very secure: you should probably run your hidden service "