diff options
Diffstat (limited to 'src/zonemaster')
-rw-r--r-- | src/zonemaster/.gitignore | 1 | ||||
-rw-r--r-- | src/zonemaster/Makefile.am | 17 | ||||
-rw-r--r-- | src/zonemaster/gnunet-service-zonemaster-monitor.c | 479 | ||||
-rw-r--r-- | src/zonemaster/gnunet-service-zonemaster.c | 268 | ||||
-rw-r--r-- | src/zonemaster/zonemaster.conf.in | 17 |
5 files changed, 541 insertions, 241 deletions
diff --git a/src/zonemaster/.gitignore b/src/zonemaster/.gitignore index 1a0e22b66..cde57fa0a 100644 --- a/src/zonemaster/.gitignore +++ b/src/zonemaster/.gitignore | |||
@@ -1 +1,2 @@ | |||
1 | gnunet-service-zonemaster | 1 | gnunet-service-zonemaster |
2 | gnunet-service-zonemaster-monitor | ||
diff --git a/src/zonemaster/Makefile.am b/src/zonemaster/Makefile.am index 21f986498..b655b9ef3 100644 --- a/src/zonemaster/Makefile.am +++ b/src/zonemaster/Makefile.am | |||
@@ -1,5 +1,5 @@ | |||
1 | # This Makefile.am is in the public domain | 1 | # This Makefile.am is in the public domain |
2 | AM_CPPFLAGS = -I$(top_srcdir)/src/include | 2 | AM_CPPFLAGS = -I$(top_srcdir)/src/include |
3 | 3 | ||
4 | plugindir = $(libdir)/gnunet | 4 | plugindir = $(libdir)/gnunet |
5 | 5 | ||
@@ -20,11 +20,11 @@ if USE_COVERAGE | |||
20 | endif | 20 | endif |
21 | 21 | ||
22 | libexec_PROGRAMS = \ | 22 | libexec_PROGRAMS = \ |
23 | gnunet-service-zonemaster | 23 | gnunet-service-zonemaster \ |
24 | gnunet-service-zonemaster-monitor | ||
24 | 25 | ||
25 | gnunet_service_zonemaster_SOURCES = \ | 26 | gnunet_service_zonemaster_SOURCES = \ |
26 | gnunet-service-zonemaster.c | 27 | gnunet-service-zonemaster.c |
27 | |||
28 | gnunet_service_zonemaster_LDADD = \ | 28 | gnunet_service_zonemaster_LDADD = \ |
29 | $(top_builddir)/src/dht/libgnunetdht.la \ | 29 | $(top_builddir)/src/dht/libgnunetdht.la \ |
30 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | 30 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ |
@@ -33,3 +33,14 @@ gnunet_service_zonemaster_LDADD = \ | |||
33 | $(top_builddir)/src/namestore/libgnunetnamestore.la \ | 33 | $(top_builddir)/src/namestore/libgnunetnamestore.la \ |
34 | $(GN_LIBINTL) | 34 | $(GN_LIBINTL) |
35 | 35 | ||
36 | |||
37 | gnunet_service_zonemaster_monitor_SOURCES = \ | ||
38 | gnunet-service-zonemaster-monitor.c | ||
39 | |||
40 | gnunet_service_zonemaster_monitor_LDADD = \ | ||
41 | $(top_builddir)/src/dht/libgnunetdht.la \ | ||
42 | $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ | ||
43 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | ||
44 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
45 | $(top_builddir)/src/namestore/libgnunetnamestore.la \ | ||
46 | $(GN_LIBINTL) | ||
diff --git a/src/zonemaster/gnunet-service-zonemaster-monitor.c b/src/zonemaster/gnunet-service-zonemaster-monitor.c new file mode 100644 index 000000000..275a3a593 --- /dev/null +++ b/src/zonemaster/gnunet-service-zonemaster-monitor.c | |||
@@ -0,0 +1,479 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2012, 2013, 2014, 2017, 2018 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file zonemaster/gnunet-service-zonemaster-monitor.c | ||
23 | * @brief monitor namestore changes and publish them immediately to GNUnet name system | ||
24 | * @author Christian Grothoff | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_util_lib.h" | ||
28 | #include "gnunet_dht_service.h" | ||
29 | #include "gnunet_namestore_service.h" | ||
30 | #include "gnunet_statistics_service.h" | ||
31 | |||
32 | |||
33 | #define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) | ||
34 | |||
35 | |||
36 | /** | ||
37 | * How often should we (re)publish each record before | ||
38 | * it expires? | ||
39 | */ | ||
40 | #define PUBLISH_OPS_PER_EXPIRATION 4 | ||
41 | |||
42 | /** | ||
43 | * How many pending DHT operations do we allow at most? | ||
44 | */ | ||
45 | #define DHT_QUEUE_LIMIT 2000 | ||
46 | |||
47 | /** | ||
48 | * How many events may the namestore give us before it has to wait | ||
49 | * for us to keep up? | ||
50 | */ | ||
51 | #define NAMESTORE_QUEUE_LIMIT 5 | ||
52 | |||
53 | /** | ||
54 | * What replication level do we use for DHT PUT operations? | ||
55 | */ | ||
56 | #define DHT_GNS_REPLICATION_LEVEL 5 | ||
57 | |||
58 | |||
59 | /** | ||
60 | * Handle for DHT PUT activity triggered from the namestore monitor. | ||
61 | */ | ||
62 | struct DhtPutActivity | ||
63 | { | ||
64 | /** | ||
65 | * Kept in a DLL. | ||
66 | */ | ||
67 | struct DhtPutActivity *next; | ||
68 | |||
69 | /** | ||
70 | * Kept in a DLL. | ||
71 | */ | ||
72 | struct DhtPutActivity *prev; | ||
73 | |||
74 | /** | ||
75 | * Handle for the DHT PUT operation. | ||
76 | */ | ||
77 | struct GNUNET_DHT_PutHandle *ph; | ||
78 | |||
79 | /** | ||
80 | * When was this PUT initiated? | ||
81 | */ | ||
82 | struct GNUNET_TIME_Absolute start_date; | ||
83 | }; | ||
84 | |||
85 | |||
86 | /** | ||
87 | * Handle to the statistics service | ||
88 | */ | ||
89 | static struct GNUNET_STATISTICS_Handle *statistics; | ||
90 | |||
91 | /** | ||
92 | * Our handle to the DHT | ||
93 | */ | ||
94 | static struct GNUNET_DHT_Handle *dht_handle; | ||
95 | |||
96 | /** | ||
97 | * Our handle to the namestore service | ||
98 | */ | ||
99 | static struct GNUNET_NAMESTORE_Handle *namestore_handle; | ||
100 | |||
101 | /** | ||
102 | * Handle to monitor namestore changes to instant propagation. | ||
103 | */ | ||
104 | static struct GNUNET_NAMESTORE_ZoneMonitor *zmon; | ||
105 | |||
106 | /** | ||
107 | * Head of monitor activities; kept in a DLL. | ||
108 | */ | ||
109 | static struct DhtPutActivity *ma_head; | ||
110 | |||
111 | /** | ||
112 | * Tail of monitor activities; kept in a DLL. | ||
113 | */ | ||
114 | static struct DhtPutActivity *ma_tail; | ||
115 | |||
116 | /** | ||
117 | * Number of entries in the DHT queue #ma_head. | ||
118 | */ | ||
119 | static unsigned int ma_queue_length; | ||
120 | |||
121 | /** | ||
122 | * Optimize block insertion by caching map of private keys to | ||
123 | * public keys in memory? | ||
124 | */ | ||
125 | static int cache_keys; | ||
126 | |||
127 | |||
128 | /** | ||
129 | * Task run during shutdown. | ||
130 | * | ||
131 | * @param cls unused | ||
132 | * @param tc unused | ||
133 | */ | ||
134 | static void | ||
135 | shutdown_task (void *cls) | ||
136 | { | ||
137 | struct DhtPutActivity *ma; | ||
138 | |||
139 | (void) cls; | ||
140 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
141 | "Shutting down!\n"); | ||
142 | while (NULL != (ma = ma_head)) | ||
143 | { | ||
144 | GNUNET_DHT_put_cancel (ma->ph); | ||
145 | ma_queue_length--; | ||
146 | GNUNET_CONTAINER_DLL_remove (ma_head, | ||
147 | ma_tail, | ||
148 | ma); | ||
149 | GNUNET_free (ma); | ||
150 | } | ||
151 | if (NULL != statistics) | ||
152 | { | ||
153 | GNUNET_STATISTICS_destroy (statistics, | ||
154 | GNUNET_NO); | ||
155 | statistics = NULL; | ||
156 | } | ||
157 | if (NULL != zmon) | ||
158 | { | ||
159 | GNUNET_NAMESTORE_zone_monitor_stop (zmon); | ||
160 | zmon = NULL; | ||
161 | } | ||
162 | if (NULL != namestore_handle) | ||
163 | { | ||
164 | GNUNET_NAMESTORE_disconnect (namestore_handle); | ||
165 | namestore_handle = NULL; | ||
166 | } | ||
167 | if (NULL != dht_handle) | ||
168 | { | ||
169 | GNUNET_DHT_disconnect (dht_handle); | ||
170 | dht_handle = NULL; | ||
171 | } | ||
172 | } | ||
173 | |||
174 | |||
175 | /** | ||
176 | * Continuation called from DHT once the PUT operation triggered | ||
177 | * by a monitor is done. | ||
178 | * | ||
179 | * @param cls a `struct DhtPutActivity` | ||
180 | */ | ||
181 | static void | ||
182 | dht_put_monitor_continuation (void *cls) | ||
183 | { | ||
184 | struct DhtPutActivity *ma = cls; | ||
185 | |||
186 | GNUNET_NAMESTORE_zone_monitor_next (zmon, | ||
187 | 1); | ||
188 | ma_queue_length--; | ||
189 | GNUNET_CONTAINER_DLL_remove (ma_head, | ||
190 | ma_tail, | ||
191 | ma); | ||
192 | GNUNET_free (ma); | ||
193 | } | ||
194 | |||
195 | |||
196 | /** | ||
197 | * Convert namestore records from the internal format to that | ||
198 | * suitable for publication (removes private records, converts | ||
199 | * to absolute expiration time). | ||
200 | * | ||
201 | * @param rd input records | ||
202 | * @param rd_count size of the @a rd and @a rd_public arrays | ||
203 | * @param rd_public where to write the converted records | ||
204 | * @return number of records written to @a rd_public | ||
205 | */ | ||
206 | static unsigned int | ||
207 | convert_records_for_export (const struct GNUNET_GNSRECORD_Data *rd, | ||
208 | unsigned int rd_count, | ||
209 | struct GNUNET_GNSRECORD_Data *rd_public) | ||
210 | { | ||
211 | struct GNUNET_TIME_Absolute now; | ||
212 | unsigned int rd_public_count; | ||
213 | |||
214 | rd_public_count = 0; | ||
215 | now = GNUNET_TIME_absolute_get (); | ||
216 | for (unsigned int i=0;i<rd_count;i++) | ||
217 | { | ||
218 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE)) | ||
219 | continue; | ||
220 | if ( (0 == (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) && | ||
221 | (rd[i].expiration_time < now.abs_value_us) ) | ||
222 | continue; /* record already expired, skip it */ | ||
223 | rd_public[rd_public_count++] = rd[i]; | ||
224 | } | ||
225 | return rd_public_count; | ||
226 | } | ||
227 | |||
228 | |||
229 | /** | ||
230 | * Store GNS records in the DHT. | ||
231 | * | ||
232 | * @param key key of the zone | ||
233 | * @param label label to store under | ||
234 | * @param rd_public public record data | ||
235 | * @param rd_public_count number of records in @a rd_public | ||
236 | * @param ma handle for the PUT operation | ||
237 | * @return DHT PUT handle, NULL on error | ||
238 | */ | ||
239 | static struct GNUNET_DHT_PutHandle * | ||
240 | perform_dht_put (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | ||
241 | const char *label, | ||
242 | const struct GNUNET_GNSRECORD_Data *rd_public, | ||
243 | unsigned int rd_public_count, | ||
244 | struct DhtPutActivity *ma) | ||
245 | { | ||
246 | struct GNUNET_GNSRECORD_Block *block; | ||
247 | struct GNUNET_HashCode query; | ||
248 | struct GNUNET_TIME_Absolute expire; | ||
249 | size_t block_size; | ||
250 | struct GNUNET_DHT_PutHandle *ret; | ||
251 | |||
252 | expire = GNUNET_GNSRECORD_record_get_expiration_time (rd_public_count, | ||
253 | rd_public); | ||
254 | if (cache_keys) | ||
255 | block = GNUNET_GNSRECORD_block_create2 (key, | ||
256 | expire, | ||
257 | label, | ||
258 | rd_public, | ||
259 | rd_public_count); | ||
260 | else | ||
261 | block = GNUNET_GNSRECORD_block_create (key, | ||
262 | expire, | ||
263 | label, | ||
264 | rd_public, | ||
265 | rd_public_count); | ||
266 | if (NULL == block) | ||
267 | { | ||
268 | GNUNET_break (0); | ||
269 | return NULL; /* whoops */ | ||
270 | } | ||
271 | block_size = ntohl (block->purpose.size) | ||
272 | + sizeof (struct GNUNET_CRYPTO_EcdsaSignature) | ||
273 | + sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey); | ||
274 | GNUNET_GNSRECORD_query_from_private_key (key, | ||
275 | label, | ||
276 | &query); | ||
277 | GNUNET_STATISTICS_update (statistics, | ||
278 | "DHT put operations initiated", | ||
279 | 1, | ||
280 | GNUNET_NO); | ||
281 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
282 | "Storing %u record(s) for label `%s' in DHT with expiration `%s' under key %s\n", | ||
283 | rd_public_count, | ||
284 | label, | ||
285 | GNUNET_STRINGS_absolute_time_to_string (expire), | ||
286 | GNUNET_h2s (&query)); | ||
287 | ret = GNUNET_DHT_put (dht_handle, | ||
288 | &query, | ||
289 | DHT_GNS_REPLICATION_LEVEL, | ||
290 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, | ||
291 | GNUNET_BLOCK_TYPE_GNS_NAMERECORD, | ||
292 | block_size, | ||
293 | block, | ||
294 | expire, | ||
295 | &dht_put_monitor_continuation, | ||
296 | ma); | ||
297 | GNUNET_free (block); | ||
298 | return ret; | ||
299 | } | ||
300 | |||
301 | |||
302 | /** | ||
303 | * Process a record that was stored in the namestore | ||
304 | * (invoked by the monitor). | ||
305 | * | ||
306 | * @param cls closure, NULL | ||
307 | * @param zone private key of the zone; NULL on disconnect | ||
308 | * @param label label of the records; NULL on disconnect | ||
309 | * @param rd_count number of entries in @a rd array, 0 if label was deleted | ||
310 | * @param rd array of records with data to store | ||
311 | */ | ||
312 | static void | ||
313 | handle_monitor_event (void *cls, | ||
314 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | ||
315 | const char *label, | ||
316 | unsigned int rd_count, | ||
317 | const struct GNUNET_GNSRECORD_Data *rd) | ||
318 | { | ||
319 | struct GNUNET_GNSRECORD_Data rd_public[rd_count]; | ||
320 | unsigned int rd_public_count; | ||
321 | struct DhtPutActivity *ma; | ||
322 | |||
323 | (void) cls; | ||
324 | GNUNET_STATISTICS_update (statistics, | ||
325 | "Namestore monitor events received", | ||
326 | 1, | ||
327 | GNUNET_NO); | ||
328 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
329 | "Received %u records for label `%s' via namestore monitor\n", | ||
330 | rd_count, | ||
331 | label); | ||
332 | /* filter out records that are not public, and convert to | ||
333 | absolute expiration time. */ | ||
334 | rd_public_count = convert_records_for_export (rd, | ||
335 | rd_count, | ||
336 | rd_public); | ||
337 | if (0 == rd_public_count) | ||
338 | { | ||
339 | GNUNET_NAMESTORE_zone_monitor_next (zmon, | ||
340 | 1); | ||
341 | return; /* nothing to do */ | ||
342 | } | ||
343 | ma = GNUNET_new (struct DhtPutActivity); | ||
344 | ma->start_date = GNUNET_TIME_absolute_get (); | ||
345 | ma->ph = perform_dht_put (zone, | ||
346 | label, | ||
347 | rd, | ||
348 | rd_count, | ||
349 | ma); | ||
350 | if (NULL == ma->ph) | ||
351 | { | ||
352 | /* PUT failed, do not remember operation */ | ||
353 | GNUNET_free (ma); | ||
354 | GNUNET_NAMESTORE_zone_monitor_next (zmon, | ||
355 | 1); | ||
356 | return; | ||
357 | } | ||
358 | GNUNET_CONTAINER_DLL_insert_tail (ma_head, | ||
359 | ma_tail, | ||
360 | ma); | ||
361 | ma_queue_length++; | ||
362 | if (ma_queue_length > DHT_QUEUE_LIMIT) | ||
363 | { | ||
364 | ma = ma_head; | ||
365 | GNUNET_CONTAINER_DLL_remove (ma_head, | ||
366 | ma_tail, | ||
367 | ma); | ||
368 | GNUNET_DHT_put_cancel (ma->ph); | ||
369 | ma_queue_length--; | ||
370 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
371 | "DHT PUT unconfirmed after %s, aborting PUT\n", | ||
372 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (ma->start_date), | ||
373 | GNUNET_YES)); | ||
374 | GNUNET_free (ma); | ||
375 | } | ||
376 | } | ||
377 | |||
378 | |||
379 | /** | ||
380 | * The zone monitor encountered an IPC error trying to to get in | ||
381 | * sync. Restart from the beginning. | ||
382 | * | ||
383 | * @param cls NULL | ||
384 | */ | ||
385 | static void | ||
386 | handle_monitor_error (void *cls) | ||
387 | { | ||
388 | (void) cls; | ||
389 | GNUNET_STATISTICS_update (statistics, | ||
390 | "Namestore monitor errors encountered", | ||
391 | 1, | ||
392 | GNUNET_NO); | ||
393 | } | ||
394 | |||
395 | |||
396 | /** | ||
397 | * Performe zonemaster duties: watch namestore, publish records. | ||
398 | * | ||
399 | * @param cls closure | ||
400 | * @param server the initialized server | ||
401 | * @param c configuration to use | ||
402 | */ | ||
403 | static void | ||
404 | run (void *cls, | ||
405 | const struct GNUNET_CONFIGURATION_Handle *c, | ||
406 | struct GNUNET_SERVICE_Handle *service) | ||
407 | { | ||
408 | unsigned long long max_parallel_bg_queries = 128; | ||
409 | |||
410 | (void) cls; | ||
411 | (void) service; | ||
412 | namestore_handle = GNUNET_NAMESTORE_connect (c); | ||
413 | if (NULL == namestore_handle) | ||
414 | { | ||
415 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
416 | _("Failed to connect to the namestore!\n")); | ||
417 | GNUNET_SCHEDULER_shutdown (); | ||
418 | return; | ||
419 | } | ||
420 | cache_keys = GNUNET_CONFIGURATION_get_value_yesno (c, | ||
421 | "namestore", | ||
422 | "CACHE_KEYS"); | ||
423 | if (GNUNET_OK == | ||
424 | GNUNET_CONFIGURATION_get_value_number (c, | ||
425 | "zonemaster", | ||
426 | "MAX_PARALLEL_BACKGROUND_QUERIES", | ||
427 | &max_parallel_bg_queries)) | ||
428 | { | ||
429 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
430 | "Number of allowed parallel background queries: %llu\n", | ||
431 | max_parallel_bg_queries); | ||
432 | } | ||
433 | if (0 == max_parallel_bg_queries) | ||
434 | max_parallel_bg_queries = 1; | ||
435 | dht_handle = GNUNET_DHT_connect (c, | ||
436 | (unsigned int) max_parallel_bg_queries); | ||
437 | if (NULL == dht_handle) | ||
438 | { | ||
439 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
440 | _("Could not connect to DHT!\n")); | ||
441 | GNUNET_SCHEDULER_add_now (&shutdown_task, | ||
442 | NULL); | ||
443 | return; | ||
444 | } | ||
445 | |||
446 | /* Schedule periodic put for our records. */ | ||
447 | statistics = GNUNET_STATISTICS_create ("zonemaster-mon", | ||
448 | c); | ||
449 | zmon = GNUNET_NAMESTORE_zone_monitor_start (c, | ||
450 | NULL, | ||
451 | GNUNET_NO, | ||
452 | &handle_monitor_error, | ||
453 | NULL, | ||
454 | &handle_monitor_event, | ||
455 | NULL, | ||
456 | NULL /* sync_cb */, | ||
457 | NULL); | ||
458 | GNUNET_NAMESTORE_zone_monitor_next (zmon, | ||
459 | NAMESTORE_QUEUE_LIMIT - 1); | ||
460 | GNUNET_break (NULL != zmon); | ||
461 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, | ||
462 | NULL); | ||
463 | } | ||
464 | |||
465 | |||
466 | /** | ||
467 | * Define "main" method using service macro. | ||
468 | */ | ||
469 | GNUNET_SERVICE_MAIN | ||
470 | ("zonemaster-monitor", | ||
471 | GNUNET_SERVICE_OPTION_NONE, | ||
472 | &run, | ||
473 | NULL, | ||
474 | NULL, | ||
475 | NULL, | ||
476 | GNUNET_MQ_handler_end()); | ||
477 | |||
478 | |||
479 | /* end of gnunet-service-zonemaster-monitor.c */ | ||
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c index 8220e6eab..81d6fa2d9 100644 --- a/src/zonemaster/gnunet-service-zonemaster.c +++ b/src/zonemaster/gnunet-service-zonemaster.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2012, 2013, 2014, 2017 GNUnet e.V. | 3 | Copyright (C) 2012, 2013, 2014, 2017, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -29,8 +29,6 @@ | |||
29 | #include "gnunet_dht_service.h" | 29 | #include "gnunet_dht_service.h" |
30 | #include "gnunet_namestore_service.h" | 30 | #include "gnunet_namestore_service.h" |
31 | #include "gnunet_statistics_service.h" | 31 | #include "gnunet_statistics_service.h" |
32 | #include "gnunet_namestore_plugin.h" | ||
33 | #include "gnunet_signatures.h" | ||
34 | 32 | ||
35 | 33 | ||
36 | #define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) | 34 | #define LOG_STRERROR_FILE(kind,syscall,filename) GNUNET_log_from_strerror_file (kind, "util", syscall, filename) |
@@ -78,23 +76,12 @@ | |||
78 | #define MAXIMUM_ZONE_ITERATION_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) | 76 | #define MAXIMUM_ZONE_ITERATION_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15) |
79 | 77 | ||
80 | /** | 78 | /** |
81 | * The default put interval for the zone iteration. In case | ||
82 | * no option is found | ||
83 | */ | ||
84 | #define DEFAULT_ZONE_PUBLISH_TIME_WINDOW GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) | ||
85 | |||
86 | /** | ||
87 | * The factor the current zone iteration interval is divided by for each | 79 | * The factor the current zone iteration interval is divided by for each |
88 | * additional new record | 80 | * additional new record |
89 | */ | 81 | */ |
90 | #define LATE_ITERATION_SPEEDUP_FACTOR 2 | 82 | #define LATE_ITERATION_SPEEDUP_FACTOR 2 |
91 | 83 | ||
92 | /** | 84 | /** |
93 | * How long until a DHT PUT attempt should time out? | ||
94 | */ | ||
95 | #define DHT_OPERATION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) | ||
96 | |||
97 | /** | ||
98 | * What replication level do we use for DHT PUT operations? | 85 | * What replication level do we use for DHT PUT operations? |
99 | */ | 86 | */ |
100 | #define DHT_GNS_REPLICATION_LEVEL 5 | 87 | #define DHT_GNS_REPLICATION_LEVEL 5 |
@@ -148,21 +135,6 @@ static struct GNUNET_NAMESTORE_Handle *namestore_handle; | |||
148 | static struct GNUNET_NAMESTORE_ZoneIterator *namestore_iter; | 135 | static struct GNUNET_NAMESTORE_ZoneIterator *namestore_iter; |
149 | 136 | ||
150 | /** | 137 | /** |
151 | * Handle to monitor namestore changes to instant propagation. | ||
152 | */ | ||
153 | static struct GNUNET_NAMESTORE_ZoneMonitor *zmon; | ||
154 | |||
155 | /** | ||
156 | * Head of monitor activities; kept in a DLL. | ||
157 | */ | ||
158 | static struct DhtPutActivity *ma_head; | ||
159 | |||
160 | /** | ||
161 | * Tail of monitor activities; kept in a DLL. | ||
162 | */ | ||
163 | static struct DhtPutActivity *ma_tail; | ||
164 | |||
165 | /** | ||
166 | * Head of iteration put activities; kept in a DLL. | 138 | * Head of iteration put activities; kept in a DLL. |
167 | */ | 139 | */ |
168 | static struct DhtPutActivity *it_head; | 140 | static struct DhtPutActivity *it_head; |
@@ -178,11 +150,6 @@ static struct DhtPutActivity *it_tail; | |||
178 | static unsigned int dht_queue_length; | 150 | static unsigned int dht_queue_length; |
179 | 151 | ||
180 | /** | 152 | /** |
181 | * Number of entries in the DHT queue #ma_head. | ||
182 | */ | ||
183 | static unsigned int ma_queue_length; | ||
184 | |||
185 | /** | ||
186 | * Useful for zone update for DHT put | 153 | * Useful for zone update for DHT put |
187 | */ | 154 | */ |
188 | static unsigned long long num_public_records; | 155 | static unsigned long long num_public_records; |
@@ -281,15 +248,6 @@ shutdown_task (void *cls) | |||
281 | (void) cls; | 248 | (void) cls; |
282 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 249 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
283 | "Shutting down!\n"); | 250 | "Shutting down!\n"); |
284 | while (NULL != (ma = ma_head)) | ||
285 | { | ||
286 | GNUNET_DHT_put_cancel (ma->ph); | ||
287 | ma_queue_length--; | ||
288 | GNUNET_CONTAINER_DLL_remove (ma_head, | ||
289 | ma_tail, | ||
290 | ma); | ||
291 | GNUNET_free (ma); | ||
292 | } | ||
293 | while (NULL != (ma = it_head)) | 251 | while (NULL != (ma = it_head)) |
294 | { | 252 | { |
295 | GNUNET_DHT_put_cancel (ma->ph); | 253 | GNUNET_DHT_put_cancel (ma->ph); |
@@ -316,11 +274,6 @@ shutdown_task (void *cls) | |||
316 | GNUNET_NAMESTORE_zone_iteration_stop (namestore_iter); | 274 | GNUNET_NAMESTORE_zone_iteration_stop (namestore_iter); |
317 | namestore_iter = NULL; | 275 | namestore_iter = NULL; |
318 | } | 276 | } |
319 | if (NULL != zmon) | ||
320 | { | ||
321 | GNUNET_NAMESTORE_zone_monitor_stop (zmon); | ||
322 | zmon = NULL; | ||
323 | } | ||
324 | if (NULL != namestore_handle) | 277 | if (NULL != namestore_handle) |
325 | { | 278 | { |
326 | GNUNET_NAMESTORE_disconnect (namestore_handle); | 279 | GNUNET_NAMESTORE_disconnect (namestore_handle); |
@@ -362,27 +315,6 @@ publish_zone_dht_start (void *cls); | |||
362 | 315 | ||
363 | 316 | ||
364 | /** | 317 | /** |
365 | * Continuation called from DHT once the PUT operation triggered | ||
366 | * by a monitor is done. | ||
367 | * | ||
368 | * @param cls a `struct DhtPutActivity` | ||
369 | */ | ||
370 | static void | ||
371 | dht_put_monitor_continuation (void *cls) | ||
372 | { | ||
373 | struct DhtPutActivity *ma = cls; | ||
374 | |||
375 | GNUNET_NAMESTORE_zone_monitor_next (zmon, | ||
376 | 1); | ||
377 | ma_queue_length--; | ||
378 | GNUNET_CONTAINER_DLL_remove (ma_head, | ||
379 | ma_tail, | ||
380 | ma); | ||
381 | GNUNET_free (ma); | ||
382 | } | ||
383 | |||
384 | |||
385 | /** | ||
386 | * Calculate #target_iteration_velocity_per_record. | 318 | * Calculate #target_iteration_velocity_per_record. |
387 | */ | 319 | */ |
388 | static void | 320 | static void |
@@ -521,10 +453,6 @@ update_velocity (unsigned int cnt) | |||
521 | dht_queue_length, | 453 | dht_queue_length, |
522 | GNUNET_NO); | 454 | GNUNET_NO); |
523 | GNUNET_STATISTICS_set (statistics, | 455 | GNUNET_STATISTICS_set (statistics, |
524 | "# size of the DHT queue (mon)", | ||
525 | ma_queue_length, | ||
526 | GNUNET_NO); | ||
527 | GNUNET_STATISTICS_set (statistics, | ||
528 | "% speed increase needed for target velocity", | 456 | "% speed increase needed for target velocity", |
529 | pct, | 457 | pct, |
530 | GNUNET_NO); | 458 | GNUNET_NO); |
@@ -558,6 +486,12 @@ check_zone_namestore_next () | |||
558 | GNUNET_NO); | 486 | GNUNET_NO); |
559 | delay = GNUNET_TIME_relative_multiply (delay, | 487 | delay = GNUNET_TIME_relative_multiply (delay, |
560 | NS_BLOCK_SIZE); | 488 | NS_BLOCK_SIZE); |
489 | /* make sure we do not overshoot because of the #NS_BLOCK_SIZE factor */ | ||
490 | delay = GNUNET_TIME_relative_min (MAXIMUM_ZONE_ITERATION_INTERVAL, | ||
491 | delay); | ||
492 | /* no delays on first iteration */ | ||
493 | if (GNUNET_YES == first_zone_iteration) | ||
494 | delay = GNUNET_TIME_UNIT_ZERO; | ||
561 | GNUNET_assert (NULL == zone_publish_task); | 495 | GNUNET_assert (NULL == zone_publish_task); |
562 | zone_publish_task = GNUNET_SCHEDULER_add_delayed (delay, | 496 | zone_publish_task = GNUNET_SCHEDULER_add_delayed (delay, |
563 | &publish_zone_namestore_next, | 497 | &publish_zone_namestore_next, |
@@ -606,24 +540,22 @@ convert_records_for_export (const struct GNUNET_GNSRECORD_Data *rd, | |||
606 | rd_public_count = 0; | 540 | rd_public_count = 0; |
607 | now = GNUNET_TIME_absolute_get (); | 541 | now = GNUNET_TIME_absolute_get (); |
608 | for (unsigned int i=0;i<rd_count;i++) | 542 | for (unsigned int i=0;i<rd_count;i++) |
609 | if (0 == (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE)) | 543 | { |
544 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE)) | ||
545 | continue; | ||
546 | if ( (0 == (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) && | ||
547 | (rd[i].expiration_time < now.abs_value_us) ) | ||
548 | continue; /* record already expired, skip it */ | ||
549 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) | ||
610 | { | 550 | { |
611 | rd_public[rd_public_count] = rd[i]; | 551 | /* GNUNET_GNSRECORD_block_create will convert to absolute time; |
612 | if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) | 552 | we just need to adjust our iteration frequency */ |
613 | { | 553 | min_relative_record_time.rel_value_us = |
614 | /* GNUNET_GNSRECORD_block_create will convert to absolute time; | 554 | GNUNET_MIN (rd[i].expiration_time, |
615 | we just need to adjust our iteration frequency */ | 555 | min_relative_record_time.rel_value_us); |
616 | min_relative_record_time.rel_value_us = | ||
617 | GNUNET_MIN (rd_public[rd_public_count].expiration_time, | ||
618 | min_relative_record_time.rel_value_us); | ||
619 | } | ||
620 | else if (rd_public[rd_public_count].expiration_time < now.abs_value_us) | ||
621 | { | ||
622 | /* record already expired, skip it */ | ||
623 | continue; | ||
624 | } | ||
625 | rd_public_count++; | ||
626 | } | 556 | } |
557 | rd_public[rd_public_count++] = rd[i]; | ||
558 | } | ||
627 | return rd_public_count; | 559 | return rd_public_count; |
628 | } | 560 | } |
629 | 561 | ||
@@ -635,8 +567,7 @@ convert_records_for_export (const struct GNUNET_GNSRECORD_Data *rd, | |||
635 | * @param label label to store under | 567 | * @param label label to store under |
636 | * @param rd_public public record data | 568 | * @param rd_public public record data |
637 | * @param rd_public_count number of records in @a rd_public | 569 | * @param rd_public_count number of records in @a rd_public |
638 | * @param cont function to call with PUT result | 570 | * @param ma handle for the put operation |
639 | * @param cont_cls closure for @a cont | ||
640 | * @return DHT PUT handle, NULL on error | 571 | * @return DHT PUT handle, NULL on error |
641 | */ | 572 | */ |
642 | static struct GNUNET_DHT_PutHandle * | 573 | static struct GNUNET_DHT_PutHandle * |
@@ -644,8 +575,7 @@ perform_dht_put (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
644 | const char *label, | 575 | const char *label, |
645 | const struct GNUNET_GNSRECORD_Data *rd_public, | 576 | const struct GNUNET_GNSRECORD_Data *rd_public, |
646 | unsigned int rd_public_count, | 577 | unsigned int rd_public_count, |
647 | GNUNET_SCHEDULER_TaskCallback cont, | 578 | struct DhtPutActivity *ma) |
648 | void *cont_cls) | ||
649 | { | 579 | { |
650 | struct GNUNET_GNSRECORD_Block *block; | 580 | struct GNUNET_GNSRECORD_Block *block; |
651 | struct GNUNET_HashCode query; | 581 | struct GNUNET_HashCode query; |
@@ -697,8 +627,8 @@ perform_dht_put (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
697 | block_size, | 627 | block_size, |
698 | block, | 628 | block, |
699 | expire, | 629 | expire, |
700 | cont, | 630 | &dht_put_continuation, |
701 | cont_cls); | 631 | ma); |
702 | GNUNET_free (block); | 632 | GNUNET_free (block); |
703 | return ret; | 633 | return ret; |
704 | } | 634 | } |
@@ -746,8 +676,7 @@ zone_iteration_finished (void *cls) | |||
746 | calculate_put_interval (); | 676 | calculate_put_interval (); |
747 | /* reset for next iteration */ | 677 | /* reset for next iteration */ |
748 | min_relative_record_time | 678 | min_relative_record_time |
749 | = GNUNET_TIME_relative_multiply (GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY, | 679 | = GNUNET_TIME_UNIT_FOREVER_REL; |
750 | PUBLISH_OPS_PER_EXPIRATION); | ||
751 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 680 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
752 | "Zone iteration finished. Adjusted zone iteration interval to %s\n", | 681 | "Zone iteration finished. Adjusted zone iteration interval to %s\n", |
753 | GNUNET_STRINGS_relative_time_to_string (target_iteration_velocity_per_record, | 682 | GNUNET_STRINGS_relative_time_to_string (target_iteration_velocity_per_record, |
@@ -816,7 +745,6 @@ put_gns_record (void *cls, | |||
816 | label, | 745 | label, |
817 | rd_public, | 746 | rd_public, |
818 | rd_public_count, | 747 | rd_public_count, |
819 | &dht_put_continuation, | ||
820 | ma); | 748 | ma); |
821 | put_cnt++; | 749 | put_cnt++; |
822 | if (0 == put_cnt % DELTA_INTERVAL) | 750 | if (0 == put_cnt % DELTA_INTERVAL) |
@@ -884,131 +812,6 @@ publish_zone_dht_start (void *cls) | |||
884 | 812 | ||
885 | 813 | ||
886 | /** | 814 | /** |
887 | * Process a record that was stored in the namestore | ||
888 | * (invoked by the monitor). | ||
889 | * | ||
890 | * @param cls closure, NULL | ||
891 | * @param zone private key of the zone; NULL on disconnect | ||
892 | * @param label label of the records; NULL on disconnect | ||
893 | * @param rd_count number of entries in @a rd array, 0 if label was deleted | ||
894 | * @param rd array of records with data to store | ||
895 | */ | ||
896 | static void | ||
897 | handle_monitor_event (void *cls, | ||
898 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | ||
899 | const char *label, | ||
900 | unsigned int rd_count, | ||
901 | const struct GNUNET_GNSRECORD_Data *rd) | ||
902 | { | ||
903 | struct GNUNET_GNSRECORD_Data rd_public[rd_count]; | ||
904 | unsigned int rd_public_count; | ||
905 | struct DhtPutActivity *ma; | ||
906 | |||
907 | (void) cls; | ||
908 | GNUNET_STATISTICS_update (statistics, | ||
909 | "Namestore monitor events received", | ||
910 | 1, | ||
911 | GNUNET_NO); | ||
912 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
913 | "Received %u records for label `%s' via namestore monitor\n", | ||
914 | rd_count, | ||
915 | label); | ||
916 | /* filter out records that are not public, and convert to | ||
917 | absolute expiration time. */ | ||
918 | rd_public_count = convert_records_for_export (rd, | ||
919 | rd_count, | ||
920 | rd_public); | ||
921 | if (0 == rd_public_count) | ||
922 | { | ||
923 | GNUNET_NAMESTORE_zone_monitor_next (zmon, | ||
924 | 1); | ||
925 | return; /* nothing to do */ | ||
926 | } | ||
927 | num_public_records++; | ||
928 | ma = GNUNET_new (struct DhtPutActivity); | ||
929 | ma->start_date = GNUNET_TIME_absolute_get (); | ||
930 | ma->ph = perform_dht_put (zone, | ||
931 | label, | ||
932 | rd, | ||
933 | rd_count, | ||
934 | &dht_put_monitor_continuation, | ||
935 | ma); | ||
936 | if (NULL == ma->ph) | ||
937 | { | ||
938 | /* PUT failed, do not remember operation */ | ||
939 | GNUNET_free (ma); | ||
940 | GNUNET_NAMESTORE_zone_monitor_next (zmon, | ||
941 | 1); | ||
942 | return; | ||
943 | } | ||
944 | GNUNET_CONTAINER_DLL_insert_tail (ma_head, | ||
945 | ma_tail, | ||
946 | ma); | ||
947 | ma_queue_length++; | ||
948 | if (ma_queue_length > DHT_QUEUE_LIMIT) | ||
949 | { | ||
950 | ma = ma_head; | ||
951 | GNUNET_CONTAINER_DLL_remove (ma_head, | ||
952 | ma_tail, | ||
953 | ma); | ||
954 | GNUNET_DHT_put_cancel (ma->ph); | ||
955 | ma_queue_length--; | ||
956 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
957 | "DHT PUT unconfirmed after %s, aborting PUT\n", | ||
958 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (ma->start_date), | ||
959 | GNUNET_YES)); | ||
960 | GNUNET_free (ma); | ||
961 | } | ||
962 | } | ||
963 | |||
964 | |||
965 | /** | ||
966 | * The zone monitor is now in SYNC with the current state of the | ||
967 | * name store. Start to perform periodic iterations. | ||
968 | * | ||
969 | * @param cls NULL | ||
970 | */ | ||
971 | static void | ||
972 | monitor_sync_event (void *cls) | ||
973 | { | ||
974 | (void) cls; | ||
975 | if ( (NULL == zone_publish_task) && | ||
976 | (NULL == namestore_iter) ) | ||
977 | zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_start, | ||
978 | NULL); | ||
979 | } | ||
980 | |||
981 | |||
982 | /** | ||
983 | * The zone monitor encountered an IPC error trying to to get in | ||
984 | * sync. Restart from the beginning. | ||
985 | * | ||
986 | * @param cls NULL | ||
987 | */ | ||
988 | static void | ||
989 | handle_monitor_error (void *cls) | ||
990 | { | ||
991 | (void) cls; | ||
992 | GNUNET_STATISTICS_update (statistics, | ||
993 | "Namestore monitor errors encountered", | ||
994 | 1, | ||
995 | GNUNET_NO); | ||
996 | if (NULL != zone_publish_task) | ||
997 | { | ||
998 | GNUNET_SCHEDULER_cancel (zone_publish_task); | ||
999 | zone_publish_task = NULL; | ||
1000 | } | ||
1001 | if (NULL != namestore_iter) | ||
1002 | { | ||
1003 | GNUNET_NAMESTORE_zone_iteration_stop (namestore_iter); | ||
1004 | namestore_iter = NULL; | ||
1005 | } | ||
1006 | zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_start, | ||
1007 | NULL); | ||
1008 | } | ||
1009 | |||
1010 | |||
1011 | /** | ||
1012 | * Performe zonemaster duties: watch namestore, publish records. | 815 | * Performe zonemaster duties: watch namestore, publish records. |
1013 | * | 816 | * |
1014 | * @param cls closure | 817 | * @param cls closure |
@@ -1026,8 +829,7 @@ run (void *cls, | |||
1026 | (void) service; | 829 | (void) service; |
1027 | last_put_100 = GNUNET_TIME_absolute_get (); /* first time! */ | 830 | last_put_100 = GNUNET_TIME_absolute_get (); /* first time! */ |
1028 | min_relative_record_time | 831 | min_relative_record_time |
1029 | = GNUNET_TIME_relative_multiply (GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY, | 832 | = GNUNET_TIME_UNIT_FOREVER_REL; |
1030 | PUBLISH_OPS_PER_EXPIRATION); | ||
1031 | target_iteration_velocity_per_record = INITIAL_ZONE_ITERATION_INTERVAL; | 833 | target_iteration_velocity_per_record = INITIAL_ZONE_ITERATION_INTERVAL; |
1032 | namestore_handle = GNUNET_NAMESTORE_connect (c); | 834 | namestore_handle = GNUNET_NAMESTORE_connect (c); |
1033 | if (NULL == namestore_handle) | 835 | if (NULL == namestore_handle) |
@@ -1040,7 +842,7 @@ run (void *cls, | |||
1040 | cache_keys = GNUNET_CONFIGURATION_get_value_yesno (c, | 842 | cache_keys = GNUNET_CONFIGURATION_get_value_yesno (c, |
1041 | "namestore", | 843 | "namestore", |
1042 | "CACHE_KEYS"); | 844 | "CACHE_KEYS"); |
1043 | zone_publish_time_window_default = DEFAULT_ZONE_PUBLISH_TIME_WINDOW; | 845 | zone_publish_time_window_default = GNUNET_DHT_DEFAULT_REPUBLISH_FREQUENCY; |
1044 | if (GNUNET_OK == | 846 | if (GNUNET_OK == |
1045 | GNUNET_CONFIGURATION_get_value_time (c, | 847 | GNUNET_CONFIGURATION_get_value_time (c, |
1046 | "zonemaster", | 848 | "zonemaster", |
@@ -1084,18 +886,8 @@ run (void *cls, | |||
1084 | "Target zone iteration velocity (μs)", | 886 | "Target zone iteration velocity (μs)", |
1085 | target_iteration_velocity_per_record.rel_value_us, | 887 | target_iteration_velocity_per_record.rel_value_us, |
1086 | GNUNET_NO); | 888 | GNUNET_NO); |
1087 | zmon = GNUNET_NAMESTORE_zone_monitor_start (c, | 889 | zone_publish_task = GNUNET_SCHEDULER_add_now (&publish_zone_dht_start, |
1088 | NULL, | 890 | NULL); |
1089 | GNUNET_NO, | ||
1090 | &handle_monitor_error, | ||
1091 | NULL, | ||
1092 | &handle_monitor_event, | ||
1093 | NULL, | ||
1094 | &monitor_sync_event, | ||
1095 | NULL); | ||
1096 | GNUNET_NAMESTORE_zone_monitor_next (zmon, | ||
1097 | NAMESTORE_QUEUE_LIMIT - 1); | ||
1098 | GNUNET_break (NULL != zmon); | ||
1099 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, | 891 | GNUNET_SCHEDULER_add_shutdown (&shutdown_task, |
1100 | NULL); | 892 | NULL); |
1101 | } | 893 | } |
diff --git a/src/zonemaster/zonemaster.conf.in b/src/zonemaster/zonemaster.conf.in index 871eb9c8f..6179b87be 100644 --- a/src/zonemaster/zonemaster.conf.in +++ b/src/zonemaster/zonemaster.conf.in | |||
@@ -23,3 +23,20 @@ ZONE_PUBLISH_TIME_WINDOW = 4 h | |||
23 | # USE_CACHE = YES | 23 | # USE_CACHE = YES |
24 | 24 | ||
25 | # PREFIX = valgrind --leak-check=full --track-origins=yes | 25 | # PREFIX = valgrind --leak-check=full --track-origins=yes |
26 | |||
27 | |||
28 | |||
29 | [zonemaster-monitor] | ||
30 | AUTOSTART = @AUTOSTART@ | ||
31 | FORCESTART = YES | ||
32 | HOSTNAME = localhost | ||
33 | BINARY = gnunet-service-zonemaster-monitor | ||
34 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-zonemaster-monitor.sock | ||
35 | @JAVAPORT@PORT = 2124 | ||
36 | |||
37 | # Do we require users that want to access GNS to run this process | ||
38 | # (usually not a good idea) | ||
39 | UNIX_MATCH_UID = NO | ||
40 | |||
41 | # Do we require users that want to access GNS to be in the 'gnunet' group? | ||
42 | UNIX_MATCH_GID = NO | ||