Skip to content

Commit

Permalink
ANON-241 - Add anons file with default dns mapping (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
web3yurii authored Jan 13, 2025
1 parent 0a3544c commit d903d01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -4595,6 +4595,13 @@ options_init_from_torrc(int argc, char **argv)
}
}

char *anons_fname = get_datadir_fname("anons");
file_status_t anons_status = file_status(anons_fname);
if (anons_status != FN_FILE) {
log_info(LD_CONFIG, "Creating anons file with default mapping");
write_str_to_file(anons_fname, DEFAULT_ANON_DNS_MAPPING, 0);
}

char *terms_fname = get_datadir_fname("terms-agreement");
if (config_line_find(cmdline_only_options, "--agree-to-terms")) {
write_str_to_file_if_not_equal(terms_fname, "agreed");
Expand Down
2 changes: 2 additions & 0 deletions src/app/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ int get_protocol_warning_severity_level(void);
/** Pattern for backing up configuration files */
#define CONFIG_BACKUP_PATTERN "%s.orig.1"

#define DEFAULT_ANON_DNS_MAPPING "anyone.anon 6zctvi63m7xxbd34hxn2uvnaw5ao7sec4l3k4bflzeqtve5jlehz6tyd.anon"

/** An error from options_trial_assign() or options_init_from_string(). */
typedef enum setopt_err_t {
SETOPT_OK = 0,
Expand Down

0 comments on commit d903d01

Please sign in to comment.