diff options
author | ng0 <ng0@n0.is> | 2019-03-09 18:42:04 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-03-09 18:42:04 +0000 |
commit | e1328a2a749b32ba053f9bc0a5083e6bdbbada2f (patch) | |
tree | 38b5002a4d57ad7dcd467e7793150571915e1a52 | |
parent | 9f4cd6db0d1c7e6ced4326b1fd38e8b8386dafb3 (diff) | |
parent | 7dfa6a4c8c74efd96bb654e3999f4e5e8962b47b (diff) | |
download | gnunet-e1328a2a749b32ba053f9bc0a5083e6bdbbada2f.tar.gz gnunet-e1328a2a749b32ba053f9bc0a5083e6bdbbada2f.zip |
Merge branch 'master' of gnunet.org:gnunet
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | src/gns/gns.conf.in | 4 | ||||
-rw-r--r-- | src/gns/gnunet-dns2gns.c | 60 | ||||
-rw-r--r-- | src/gns/gnunet-gns-proxy.c | 57 | ||||
-rw-r--r-- | src/rest/gnunet-rest-server.c | 59 | ||||
-rw-r--r-- | src/rest/rest.conf | 2 |
6 files changed, 195 insertions, 9 deletions
@@ -1,20 +1,24 @@ | |||
1 | Sat Mar 9 01:58:22 CET 2019 | 1 | Sat Mar 9 15:58:45 2019 +0100 |
2 | gnunet-publish now by default does not expose the creation time, | 2 | REST: Config option for address bind. Defaults to localhost. |
3 | option -d no longer exists, to enable the old behavior use -E. -CG | 3 | GNS: dns2gns/gns-proxy config option for address bind. Defaults to localhost. |
4 | |||
5 | Sat Mar 9 01:58:22 CET 2019 | ||
6 | gnunet-publish now by default does not expose the creation time, | ||
7 | option -d no longer exists, to enable the old behavior use -E. -CG | ||
4 | 8 | ||
5 | Sat Mar 2 14:23:10 2019 +0100 | 9 | Sat Mar 2 14:23:10 2019 +0100 |
6 | utils: gnunet-qr.py now installed under pkgshare instead of bin | 10 | utils: gnunet-qr.py now installed under pkgshare instead of bin |
7 | 11 | ||
8 | Thu Feb 28 19:07:59 CET 2019 | 12 | Thu Feb 28 19:07:59 CET 2019 |
9 | CADET: Fix in order, unrealiable message ordering | 13 | CADET: Fix in order, unrealiable message ordering |
10 | 14 | ||
11 | Thu 28 Feb 2019 10:54:58 AM CET | 15 | Thu 28 Feb 2019 10:54:58 AM CET |
12 | Releasing GNUnet 0.11.0. -CG | 16 | Releasing GNUnet 0.11.0. -CG |
13 | 17 | ||
14 | Wed Jun 6 08:28:27 CEST 2018 | 18 | Wed Jun 6 08:28:27 CEST 2018 |
15 | Releasing GNUnet 0.11.0pre66. Let's try to keep a better | 19 | Releasing GNUnet 0.11.0pre66. Let's try to keep a better |
16 | ChangeLog again henceforth. -CG | 20 | ChangeLog again henceforth. -CG |
17 | 21 | ||
18 | Sat Jan 7 16:41:34 CET 2017 | 22 | Sat Jan 7 16:41:34 CET 2017 |
19 | Converting NAT library to new NAT service (and | 23 | Converting NAT library to new NAT service (and |
20 | splitting of nat-auto service for auto-configuration). -CG | 24 | splitting of nat-auto service for auto-configuration). -CG |
diff --git a/src/gns/gns.conf.in b/src/gns/gns.conf.in index 2e6a02b07..3252e4888 100644 --- a/src/gns/gns.conf.in +++ b/src/gns/gns.conf.in | |||
@@ -32,6 +32,8 @@ INTERCEPT_DNS = NO | |||
32 | BINARY = gnunet-gns-proxy | 32 | BINARY = gnunet-gns-proxy |
33 | START_ON_DEMAND = NO | 33 | START_ON_DEMAND = NO |
34 | RUN_PER_USER = YES | 34 | RUN_PER_USER = YES |
35 | BIND_TO=127.0.0.1 | ||
36 | BIND_TO6=::1 | ||
35 | 37 | ||
36 | # Where is the certificate for the GNS proxy stored? | 38 | # Where is the certificate for the GNS proxy stored? |
37 | PROXY_CACERT = $GNUNET_DATA_HOME/gns/gns_ca_cert.pem | 39 | PROXY_CACERT = $GNUNET_DATA_HOME/gns/gns_ca_cert.pem |
@@ -42,6 +44,8 @@ PROXY_UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-gns-proxy.sock | |||
42 | BINARY = gnunet-dns2gns | 44 | BINARY = gnunet-dns2gns |
43 | START_ON_DEMAND = NO | 45 | START_ON_DEMAND = NO |
44 | RUN_PER_USER = YES | 46 | RUN_PER_USER = YES |
47 | BIND_TO=127.0.0.1 | ||
48 | BIND_TO6=::1 | ||
45 | 49 | ||
46 | # -d: DNS resolver to use, -s: suffix to use, -f: fcfs suffix to use | 50 | # -d: DNS resolver to use, -s: suffix to use, -f: fcfs suffix to use |
47 | OPTIONS = -d 8.8.8.8 | 51 | OPTIONS = -d 8.8.8.8 |
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index 68d090579..d2eabf02c 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c | |||
@@ -92,6 +92,17 @@ struct Request | |||
92 | uint16_t original_request_id; | 92 | uint16_t original_request_id; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | /** | ||
96 | * The address to bind to | ||
97 | */ | ||
98 | static in_addr_t address; | ||
99 | |||
100 | /** | ||
101 | * The IPv6 address to bind to | ||
102 | */ | ||
103 | static struct in6_addr address6; | ||
104 | |||
105 | |||
95 | 106 | ||
96 | /** | 107 | /** |
97 | * Handle to GNS resolver. | 108 | * Handle to GNS resolver. |
@@ -578,6 +589,7 @@ run (void *cls, | |||
578 | const char *cfgfile, | 589 | const char *cfgfile, |
579 | const struct GNUNET_CONFIGURATION_Handle *c) | 590 | const struct GNUNET_CONFIGURATION_Handle *c) |
580 | { | 591 | { |
592 | char *addr_str; | ||
581 | (void) cls; | 593 | (void) cls; |
582 | (void) args; | 594 | (void) args; |
583 | (void) cfgfile; | 595 | (void) cfgfile; |
@@ -602,6 +614,52 @@ run (void *cls, | |||
602 | gns = NULL; | 614 | gns = NULL; |
603 | return; | 615 | return; |
604 | } | 616 | } |
617 | |||
618 | /* Get address to bind to */ | ||
619 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (c, "dns2gns", | ||
620 | "BIND_TO", | ||
621 | &addr_str)) | ||
622 | { | ||
623 | //No address specified | ||
624 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
625 | "Don't know what to bind to...\n"); | ||
626 | GNUNET_free (addr_str); | ||
627 | GNUNET_SCHEDULER_shutdown (); | ||
628 | return; | ||
629 | } | ||
630 | if (1 != inet_pton (AF_INET, addr_str, &address)) | ||
631 | { | ||
632 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
633 | "Unable to parse address %s\n", | ||
634 | addr_str); | ||
635 | GNUNET_free (addr_str); | ||
636 | GNUNET_SCHEDULER_shutdown (); | ||
637 | return; | ||
638 | } | ||
639 | GNUNET_free (addr_str); | ||
640 | /* Get address to bind to */ | ||
641 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (c, "dns2gns", | ||
642 | "BIND_TO6", | ||
643 | &addr_str)) | ||
644 | { | ||
645 | //No address specified | ||
646 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
647 | "Don't know what to bind6 to...\n"); | ||
648 | GNUNET_free (addr_str); | ||
649 | GNUNET_SCHEDULER_shutdown (); | ||
650 | return; | ||
651 | } | ||
652 | if (1 != inet_pton (AF_INET6, addr_str, &address6)) | ||
653 | { | ||
654 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
655 | "Unable to parse IPv6 address %s\n", | ||
656 | addr_str); | ||
657 | GNUNET_free (addr_str); | ||
658 | GNUNET_SCHEDULER_shutdown (); | ||
659 | return; | ||
660 | } | ||
661 | GNUNET_free (addr_str); | ||
662 | |||
605 | listen_socket4 = GNUNET_NETWORK_socket_create (PF_INET, | 663 | listen_socket4 = GNUNET_NETWORK_socket_create (PF_INET, |
606 | SOCK_DGRAM, | 664 | SOCK_DGRAM, |
607 | IPPROTO_UDP); | 665 | IPPROTO_UDP); |
@@ -611,6 +669,7 @@ run (void *cls, | |||
611 | 669 | ||
612 | memset (&v4, 0, sizeof (v4)); | 670 | memset (&v4, 0, sizeof (v4)); |
613 | v4.sin_family = AF_INET; | 671 | v4.sin_family = AF_INET; |
672 | v4.sin_addr.s_addr = address; | ||
614 | #if HAVE_SOCKADDR_IN_SIN_LEN | 673 | #if HAVE_SOCKADDR_IN_SIN_LEN |
615 | v4.sin_len = sizeof (v4); | 674 | v4.sin_len = sizeof (v4); |
616 | #endif | 675 | #endif |
@@ -634,6 +693,7 @@ run (void *cls, | |||
634 | 693 | ||
635 | memset (&v6, 0, sizeof (v6)); | 694 | memset (&v6, 0, sizeof (v6)); |
636 | v6.sin6_family = AF_INET6; | 695 | v6.sin6_family = AF_INET6; |
696 | v6.sin6_addr = address6; | ||
637 | #if HAVE_SOCKADDR_IN_SIN_LEN | 697 | #if HAVE_SOCKADDR_IN_SIN_LEN |
638 | v6.sin6_len = sizeof (v6); | 698 | v6.sin6_len = sizeof (v6); |
639 | #endif | 699 | #endif |
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index 65a7b6018..a6b053e56 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c | |||
@@ -661,6 +661,15 @@ struct Socks5Request | |||
661 | 661 | ||
662 | /* *********************** Globals **************************** */ | 662 | /* *********************** Globals **************************** */ |
663 | 663 | ||
664 | /** | ||
665 | * The address to bind to | ||
666 | */ | ||
667 | static in_addr_t address; | ||
668 | |||
669 | /** | ||
670 | * The IPv6 address to bind to | ||
671 | */ | ||
672 | static struct in6_addr address6; | ||
664 | 673 | ||
665 | /** | 674 | /** |
666 | * The port the proxy is running on (default 7777) | 675 | * The port the proxy is running on (default 7777) |
@@ -3516,6 +3525,7 @@ bind_v4 () | |||
3516 | memset (&sa4, 0, sizeof (sa4)); | 3525 | memset (&sa4, 0, sizeof (sa4)); |
3517 | sa4.sin_family = AF_INET; | 3526 | sa4.sin_family = AF_INET; |
3518 | sa4.sin_port = htons (port); | 3527 | sa4.sin_port = htons (port); |
3528 | sa4.sin_addr.s_addr = address; | ||
3519 | #if HAVE_SOCKADDR_IN_SIN_LEN | 3529 | #if HAVE_SOCKADDR_IN_SIN_LEN |
3520 | sa4.sin_len = sizeof (sa4); | 3530 | sa4.sin_len = sizeof (sa4); |
3521 | #endif | 3531 | #endif |
@@ -3553,6 +3563,7 @@ bind_v6 () | |||
3553 | memset (&sa6, 0, sizeof (sa6)); | 3563 | memset (&sa6, 0, sizeof (sa6)); |
3554 | sa6.sin6_family = AF_INET6; | 3564 | sa6.sin6_family = AF_INET6; |
3555 | sa6.sin6_port = htons (port); | 3565 | sa6.sin6_port = htons (port); |
3566 | sa6.sin6_addr = address6; | ||
3556 | #if HAVE_SOCKADDR_IN_SIN_LEN | 3567 | #if HAVE_SOCKADDR_IN_SIN_LEN |
3557 | sa6.sin6_len = sizeof (sa6); | 3568 | sa6.sin6_len = sizeof (sa6); |
3558 | #endif | 3569 | #endif |
@@ -3591,10 +3602,56 @@ run (void *cls, | |||
3591 | { | 3602 | { |
3592 | char* cafile_cfg = NULL; | 3603 | char* cafile_cfg = NULL; |
3593 | char* cafile; | 3604 | char* cafile; |
3605 | char* addr_str; | ||
3594 | struct MhdHttpList *hd; | 3606 | struct MhdHttpList *hd; |
3595 | 3607 | ||
3596 | cfg = c; | 3608 | cfg = c; |
3597 | 3609 | ||
3610 | /* Get address to bind to */ | ||
3611 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "gns-proxy", | ||
3612 | "BIND_TO", | ||
3613 | &addr_str)) | ||
3614 | { | ||
3615 | //No address specified | ||
3616 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
3617 | "Don't know what to bind to...\n"); | ||
3618 | GNUNET_free (addr_str); | ||
3619 | GNUNET_SCHEDULER_shutdown (); | ||
3620 | return; | ||
3621 | } | ||
3622 | if (1 != inet_pton (AF_INET, addr_str, &address)) | ||
3623 | { | ||
3624 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
3625 | "Unable to parse address %s\n", | ||
3626 | addr_str); | ||
3627 | GNUNET_free (addr_str); | ||
3628 | GNUNET_SCHEDULER_shutdown (); | ||
3629 | return; | ||
3630 | } | ||
3631 | GNUNET_free (addr_str); | ||
3632 | /* Get address to bind to */ | ||
3633 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "gns-proxy", | ||
3634 | "BIND_TO6", | ||
3635 | &addr_str)) | ||
3636 | { | ||
3637 | //No address specified | ||
3638 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
3639 | "Don't know what to bind6 to...\n"); | ||
3640 | GNUNET_free (addr_str); | ||
3641 | GNUNET_SCHEDULER_shutdown (); | ||
3642 | return; | ||
3643 | } | ||
3644 | if (1 != inet_pton (AF_INET6, addr_str, &address6)) | ||
3645 | { | ||
3646 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
3647 | "Unable to parse IPv6 address %s\n", | ||
3648 | addr_str); | ||
3649 | GNUNET_free (addr_str); | ||
3650 | GNUNET_SCHEDULER_shutdown (); | ||
3651 | return; | ||
3652 | } | ||
3653 | GNUNET_free (addr_str); | ||
3654 | |||
3598 | if (NULL == (curl_multi = curl_multi_init ())) | 3655 | if (NULL == (curl_multi = curl_multi_init ())) |
3599 | { | 3656 | { |
3600 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 3657 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index 77f3d898d..f9e954912 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c | |||
@@ -64,6 +64,16 @@ | |||
64 | static struct GNUNET_SCHEDULER_Task *httpd_task; | 64 | static struct GNUNET_SCHEDULER_Task *httpd_task; |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * The address to bind to | ||
68 | */ | ||
69 | static in_addr_t address; | ||
70 | |||
71 | /** | ||
72 | * The IPv6 address to bind to | ||
73 | */ | ||
74 | static struct in6_addr address6; | ||
75 | |||
76 | /** | ||
67 | * The port the service is running on (default 7776) | 77 | * The port the service is running on (default 7776) |
68 | */ | 78 | */ |
69 | static unsigned long long port = GNUNET_REST_SERVICE_PORT; | 79 | static unsigned long long port = GNUNET_REST_SERVICE_PORT; |
@@ -695,6 +705,7 @@ bind_v4 () | |||
695 | memset (&sa4, 0, sizeof (sa4)); | 705 | memset (&sa4, 0, sizeof (sa4)); |
696 | sa4.sin_family = AF_INET; | 706 | sa4.sin_family = AF_INET; |
697 | sa4.sin_port = htons (port); | 707 | sa4.sin_port = htons (port); |
708 | sa4.sin_addr.s_addr = address; | ||
698 | #if HAVE_SOCKADDR_IN_SIN_LEN | 709 | #if HAVE_SOCKADDR_IN_SIN_LEN |
699 | sa4.sin_len = sizeof (sa4); | 710 | sa4.sin_len = sizeof (sa4); |
700 | #endif | 711 | #endif |
@@ -731,6 +742,7 @@ bind_v6 () | |||
731 | memset (&sa6, 0, sizeof (sa6)); | 742 | memset (&sa6, 0, sizeof (sa6)); |
732 | sa6.sin6_family = AF_INET6; | 743 | sa6.sin6_family = AF_INET6; |
733 | sa6.sin6_port = htons (port); | 744 | sa6.sin6_port = htons (port); |
745 | sa6.sin6_addr = address6; | ||
734 | #if HAVE_SOCKADDR_IN_SIN_LEN | 746 | #if HAVE_SOCKADDR_IN_SIN_LEN |
735 | sa6.sin6_len = sizeof (sa6); | 747 | sa6.sin6_len = sizeof (sa6); |
736 | #endif | 748 | #endif |
@@ -806,9 +818,56 @@ run (void *cls, | |||
806 | const char *cfgfile, | 818 | const char *cfgfile, |
807 | const struct GNUNET_CONFIGURATION_Handle *c) | 819 | const struct GNUNET_CONFIGURATION_Handle *c) |
808 | { | 820 | { |
821 | char* addr_str; | ||
809 | cfg = c; | 822 | cfg = c; |
810 | plugin_map = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); | 823 | plugin_map = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO); |
811 | 824 | ||
825 | /* Get address to bind to */ | ||
826 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest", | ||
827 | "BIND_TO", | ||
828 | &addr_str)) | ||
829 | { | ||
830 | //No address specified | ||
831 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
832 | "Don't know what to bind to...\n"); | ||
833 | GNUNET_free (addr_str); | ||
834 | GNUNET_SCHEDULER_shutdown (); | ||
835 | return; | ||
836 | } | ||
837 | if (1 != inet_pton (AF_INET, addr_str, &address)) | ||
838 | { | ||
839 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
840 | "Unable to parse address %s\n", | ||
841 | addr_str); | ||
842 | GNUNET_free (addr_str); | ||
843 | GNUNET_SCHEDULER_shutdown (); | ||
844 | return; | ||
845 | } | ||
846 | GNUNET_free (addr_str); | ||
847 | /* Get address to bind to */ | ||
848 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest", | ||
849 | "BIND_TO6", | ||
850 | &addr_str)) | ||
851 | { | ||
852 | //No address specified | ||
853 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
854 | "Don't know what to bind6 to...\n"); | ||
855 | GNUNET_free (addr_str); | ||
856 | GNUNET_SCHEDULER_shutdown (); | ||
857 | return; | ||
858 | } | ||
859 | if (1 != inet_pton (AF_INET6, addr_str, &address6)) | ||
860 | { | ||
861 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
862 | "Unable to parse IPv6 address %s\n", | ||
863 | addr_str); | ||
864 | GNUNET_free (addr_str); | ||
865 | GNUNET_SCHEDULER_shutdown (); | ||
866 | return; | ||
867 | } | ||
868 | GNUNET_free (addr_str); | ||
869 | |||
870 | |||
812 | /* Get CORS data from cfg */ | 871 | /* Get CORS data from cfg */ |
813 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest", | 872 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "rest", |
814 | "REST_ALLOW_ORIGIN", | 873 | "REST_ALLOW_ORIGIN", |
diff --git a/src/rest/rest.conf b/src/rest/rest.conf index 138751696..bef8cf473 100644 --- a/src/rest/rest.conf +++ b/src/rest/rest.conf | |||
@@ -1,6 +1,8 @@ | |||
1 | [rest] | 1 | [rest] |
2 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-rest.sock | 2 | UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-rest.sock |
3 | BINARY=gnunet-rest-server | 3 | BINARY=gnunet-rest-server |
4 | BIND_TO=127.0.0.1 | ||
5 | BIND_TO6=::1 | ||
4 | REST_PORT=7776 | 6 | REST_PORT=7776 |
5 | REST_ALLOW_HEADERS=Authorization,Accept,Content-Type | 7 | REST_ALLOW_HEADERS=Authorization,Accept,Content-Type |
6 | REST_ALLOW_ORIGIN=* | 8 | REST_ALLOW_ORIGIN=* |