[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3388 - in GNUnet: contrib src/setup/gtk src/setup/lib src/
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3388 - in GNUnet: contrib src/setup/gtk src/setup/lib src/util/config_impl |
Date: |
Sun, 10 Sep 2006 20:09:36 -0700 (PDT) |
Author: grothoff
Date: 2006-09-10 20:09:30 -0700 (Sun, 10 Sep 2006)
New Revision: 3388
Added:
GNUnet/contrib/config-client.scm
Modified:
GNUnet/contrib/Makefile.am
GNUnet/contrib/config-daemon.in
GNUnet/contrib/config-daemon.scm
GNUnet/src/setup/gtk/gconf.c
GNUnet/src/setup/lib/gns.c
GNUnet/src/setup/lib/tree.c
GNUnet/src/setup/lib/tree.h
GNUnet/src/util/config_impl/impl.c
Log:
adding programmatic option update for setup
Modified: GNUnet/contrib/Makefile.am
===================================================================
--- GNUnet/contrib/Makefile.am 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/contrib/Makefile.am 2006-09-11 03:09:30 UTC (rev 3388)
@@ -2,8 +2,7 @@
pkgdata_DATA = \
config-daemon.scm \
- config-client.in \
- config-daemon.in
+ config-client.scm
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
Added: GNUnet/contrib/config-client.scm
===================================================================
--- GNUnet/contrib/config-client.scm 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/contrib/config-client.scm 2006-09-11 03:09:30 UTC (rev 3388)
@@ -0,0 +1,165 @@
+;; This is not a stand-alone guile application.
+;; It can only be executed from within gnunet-setup.
+;;
+;; GNUnet setup defines a function "build-tree-node"
+;; (with arguments section, option, description, help,
+;; children, visible, value and range) which is
+;; used by the script to create the configuration tree.
+;;
+;; GNUnet setup defines a function "change-visible"
+;; (with arguments context, section, option, yesno) which
+;; can be used by the script to dynamically change the
+;; visibility of options.
+;;
+;; GNUnet setup defines a function "get-option"
+;; (with arguments context, section, option) which
+;; can be used to query the current value of an option.
+;;
+;; GNUnet setup defines a function "set-option"
+;; (with arguments context, section, option, value) which
+;; can be used to set the value of an option.
+;;
+;;
+;; GNUnet setup requires two functions from this script.
+;; First, a function "gnunet-config-setup" which constructs the
+;; configuration tree.
+;;
+;; Second, a function "gnunet-config-change" which is notified whenever
+;; configuration options are changed; the script can then
+;; change the visibility of other options.
+;;
+;;
+;; TODO:
+;; - complete conversion of *.in to *.scm
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; for GNU gettext
+(define (_ msg) (gettext msg "GNUnet"))
+
+;; common string
+(define (nohelp)
+ (_ "No help available.") )
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; menu definitions
+
+;; meta-menu
+
+(define (meta-exp builder)
+ (builder
+ "Meta-client"
+ "EXPERIMENTAL"
+ (_ "Prompt for development and/or incomplete code")
+ (_
+"If EXPERIMENTAL is set to NO, options for experimental code are not shown.
If in doubt, use NO.
+
+Some options apply to experimental code that maybe in a state of development
where the functionality, stability, or the level of testing is not yet high
enough for general use. These features are said to be of \"alpha\" quality.
If a feature is currently in alpha, uninformed use is discouraged (since the
developers then do not fancy \"Why doesn't this work?\" type messages).
+
+However, active testing and qualified feedback of these features is always
welcome. Users should just be aware that alpha features may not meet the
normal level of reliability or it may fail to work in some special cases. Bug
reports are usually welcomed by the developers, but please read the documents
<file://README> and <http://gnunet.org/faq.php3> and use
<https://gnunet.org/mantis/> for how to report problems." )
+ '()
+ #t
+ #f
+ #f
+ 'advanced) )
+
+(define (meta-adv builder)
+ (builder
+ "Meta-client"
+ "ADVANCED"
+ (_ "Show options for advanced users")
+ (_
+"These are options that maybe difficult to understand for the beginner. These
options typically refer to features that allow tweaking of the installation.
If in a hurry, say NO." )
+ '()
+ #t
+ #t
+ #f
+ 'always) )
+
+(define (meta-rare builder)
+ (builder
+ "Meta-client"
+ "RARE"
+ (_ "Show rarely used options")
+ (_
+"These are options that hardly anyone actually needs. If you plan on doing
development on GNUnet, you may want to look into these. If in doubt or in a
hurry, say NO." )
+ '()
+ #t
+ #t
+ #f
+ 'advanced) )
+
+(define (meta builder)
+ (builder
+ "Meta-client"
+ ""
+ (_ "Meta-configuration")
+ (_ "Which level of configuration should be available")
+ (list
+ (meta-adv builder)
+ (meta-rare builder)
+ (meta-exp builder)
+ )
+ #t
+ #f
+ #f
+ 'always) )
+
+
+
+
+;; main-menu
+
+(define (main builder)
+ (builder
+ "Root"
+ ""
+ (_ "Root node")
+ (nohelp)
+ (list
+ (meta builder)
+ )
+ #t
+ #f
+ #f
+ 'always) )
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; first main method: build tree using build-tree-node
+;; The lambda expression is used to throw away the last argument,
+;; which we use internally and which is not used by build-tree-node!
+(define (gnunet-config-setup)
+ (main
+ (lambda (a b c d e f g h i) (build-tree-node a b c d e f g h) ) ) )
+
+
+;; second main method: update visibility (and values)
+;; "change" uses again the tree builder but this time
+;; scans the "i" tags to determine how the visibility needs to change
+
+(define (gnunet-config-change ctx)
+ (let
+ (
+ (advanced (get-option ctx "Meta-client" "ADVANCED"))
+ (rare (get-option ctx "Meta-client" "RARE"))
+ (experimental (get-option ctx "Meta-client" "EXPERIMENTAL"))
+ )
+ (begin
+ (main
+ (lambda (a b c d e f g h i)
+ (begin
+ (cond
+ ((eq? i 'advanced) (change-visible ctx a b advanced))
+ ((eq? i 'rare) (change-visible ctx a b rare))
+ ((eq? i 'experimental) (change-visible ctx a b experimental))
+ (else 'nothing)
+ )
+ ) ) ) )
+) )
+
Modified: GNUnet/contrib/config-daemon.in
===================================================================
--- GNUnet/contrib/config-daemon.in 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/contrib/config-daemon.in 2006-09-11 03:09:30 UTC (rev 3388)
@@ -1,110 +1,5 @@
mainmenu "GNUnet Server Configuration"
-menu "Meta-configuration" "Meta"
- config EXPERIMENTAL
- bool "Prompt for development and/or incomplete code"
- help
- If EXPERIMENTAL is set to NO, options for experimental
code are
- not shown. If in doubt, use NO.
-
- Some options apply to experimental code that maybe in a state
- of development where the functionality, stability, or the level
of
- testing is not yet high enough for general use. These features
- are said to be of "alpha" quality. If a feature is currently
in
- alpha, uninformed use is discouraged (since the
developers then
- do not fancy "Why doesn't this work?" type messages).
-
- However, active testing and qualified feedback of these
features
- is always welcome. Users should just be aware that
alpha features
- may not meet the normal level of reliability or it may fail to
work
- in some special cases. Bug reports are usually welcomed by the
- developers, but please read the documents
<file://README> and
- <http://gnunet.org/faq.php3> and use
<https://gnunet.org/mantis/>
- for how to report problems.
-
- config ADVANCED
- bool "Show options for advanced users"
- help
- These are options that maybe difficult to understand for the
- beginner. These options typically refer to features that
- allow tweaking of the installation. If in a hurry, say
NO.
-
- config RARE
- bool "Show rarely used options"
- help
- These are options that hardly anyone actually needs.
- If you plan on doing development on GNUnet, you may want to
- look into these. If in doubt or in a hurry, say NO.
-endmenu
-
-menu "General settings" "GNUNETD"
- config GNUNETD_HOME
- string "Full pathname of GNUnet HOME directory"
- default ""
- help
- This gives the root-directory of the GNUnet installation. Make
- sure there is some space left in that directory. :-) Users
inserting
- or indexing files will be able to store data in this directory
- up to the (global) quota specified below. Having a few
gigabytes
- of free space is recommended.
- Default: GNUNETD_HOME = /var/lib/GNUnet
-
- config HELLOEXPIRES
- int "How many minutes should peer advertisements last?"
- default 1440
- depends on Meta::ADVANCED
- help
- How many minutes is the current IP valid? (GNUnet will sign
HELLO
- messages with this expiration timeline. If you are on dialup, 60
- (for 1 hour) is suggested. If you are having a static IP
address,
- you may want to set this to a large value (say 14400). The
default
- is 1440 (1 day). If your IP changes periodically, you will want
to
- choose the expiration to be smaller than the frequency with
which
- your IP changes.
- The largest legal value is 14400 (10 days).
- Default: HELLOEXPIRES = 1440
-
- config LOGLEVEL
- string "Log level"
- default "WARNING"
- depends on Meta::ADVANCED
- help
- Loglevel, how much should be logged? You can use NOTHING, FATAL,
- ERROR, FAILURE, WARNING, MESSAGE, INFO, DEBUG, CRON or
EVERYTHING
- (which log more and more messages in this order). Default is
- WARNING.
-
- config LOGFILE
- string "Where should logs go by default"
- default "$GNUNETD_HOME/logs"
- depends on Meta::ADVANCED
- help
- In which file should gnunetd write the logs? If you specify
- nothing, logs are written to stderr (and note that if gnunetd
runs
- in the background, stderr is closed and all logs are discarded).
- Default: LOGFILE = $GNUNETD_HOME/logs
-
- config KEEPLOG
- int "How long should logs be kept"
- default 3
- depends on Meta::ADVANCED
- help
- How long should logs be kept? If you specify a value greater
- than zero, a log is created each day with the date appended
- to its filename. These logs are deleted after $KEEPLOG days.
- To keep logs forever, set this value to 0.
-
- config PIDFILE
- string "Where should gnunetd write the PID"
- default "$GNUNETD_HOME/gnunet.pid"
- depends on Meta::ADVANCED
- help
- In which file should gnunetd write the process-id of the
server? If
- you run gnunetd as root, you may want to choose
- /var/run/gnunetd.pid. It's not the default since gnunetd may not
- have write rights at that location.
- Default: PIDFILE = $GNUNETD_HOME/gnunetd.pid
-
config HOSTS
string "Where should gnunetd keep the list of peers"
default "$GNUNETD_HOME/data/hosts/"
@@ -152,88 +47,7 @@
If you have to use a proxy for outbound HTTP connections,
specify the proxy configuration here. Default is no proxy.
- config APPLICATIONS
- string "Which applications should gnunetd support?"
- default "advertising fs getoption stats traffic"
- depends on Meta::ADVANCED
- help
- Which applications should gnunetd support? Specify the name of
the
- dynamic shared object (DSO) that implements the service in the
- gnunetd core here. Separate multiple modules with spaces.
-
- Whenever this option is changed, you MUST run gnunet-update.
-
- Currently, the available applications are:
- advertising: tell peers about peers
- This module will advertise your peer to other peers.
- Without it, your peer will not participate in
- informing peers about other peers. You should
- always load this module.
- getoption: configuration
- This module allows clients to query gnunetd about
- the values of various configuration options. Many
- tools need this. You should always load this module.
- stats: statistics
- This module allows tools like gnunet-stats
- and gnunet-gtk to query gnunetd about various
- statistics. This information is usually quite
- useful to diagnose errors, hence it is recommended
- that you load this module.
- traffic: traffic analysis
- This module keeps track of how many messages of
- which type and size were recently received and
- transmitted. This information can then be used
- by your peer to establish how much cover traffic
- is currently available. The amount of cover
- traffic becomes important if you want to make
- anonymous requests with an anonymity level that
- is greater than one. This module does not add
- support for any new peer-to-peer messages itself.
- It is recommended that you always load this module,
- unless you are really short on memory and are
- certain that you do not require good anonymity.
- fs: file sharing
- The file sharing module is needed for downloading
- files, for caching content within the network and
- for being the source of content. At this point,
- pretty much everybody should load this module.
- chat: broadcast chat (demo-application, ALPHA quality)
- If this module is loaded, you can run gnunet-chat
- (text-mode only) to chat with other GNUnet users.
- However, there are no channels and no list of users
- on-line, the code simply broadcasts your messages.
- tbench: benchmark tool for transport performance
- If two peers load this module and establish a direct
- connection, the gnunet-tbench tool can be used to
- measure the quality of the connection between the
- two peers. Useful mostly for testing new transports.
- tracekit: topology visualization toolkit
- Peers that load this module can be queried for their
- active connections (in fact, this is transitive for
- all peers that load this module). Using the
- gnunet-tracekit tool it is possible to create a
- picture of the network topology. Note that the
- picture maybe incomplete since peers that do not
- load the tracekit module will not respond to such
- requests and thus cut off the trace. Also, some
- peers may fail to respond within the specified
- timeout. Note that while tracing the topology
- maybe fun, loading tracekit may make it easier
- for an adversary to compromise your anonymity.
-
- Again, the chat, tbench and tracekit protocols are potential
security
- risks and have been engineered for testing GNUnet or
demonstrating how
- GNUnet works. They should be used with caution.
-
- In order to download or share files with GNUnet, you must load
the
- fs module which in turn requires or recommends getoption, stats
- and traffic.
-
- Everybody should run advertising.
-
- Default: APPLICATIONS = "advertising fs getoption stats traffic"
-
config TRANSPORTS
string "Which transport mechanisms are available?"
default "udp tcp http nat"
@@ -298,46 +112,7 @@
endmenu
-if Meta::ADVANCED
- menu "Modules" "MODULES"
- config sqstore
- string "Which database should be used?"
- default "sqstore_sqlite"
- help
- Which database should be used? The options
- are "sqstore_sqlite" and "sqstore_mysql".
- Default is "sqstore_sqlite". You must run
- gnunet-update after changing this value!
-
- In order to use sqstore_mysql, you must configure
- the mysql database, which is relatively simple.
- Read the file doc/README.mysql for how to setup
- mysql.
- The default is "sqstore_sqlite".
-
- config topology
- string "Which topology should be used?"
- default "topology_default"
- help
- Which topology should be used? The only
- options at the moment are "topology_default"
- and "topology_f2f". In default mode, GNUnet
- will try to connect to a diverse set of peers,
- and welcome connections from anyone. In
- f2f (friend-to-friend) mode, GNUnet will only
- allow connections from peers that are explicitly
- listed in a FRIENDS file. Note that you can
- list peers in the FRIENDS file that run in
- default mode.
- Use f2f only if you have (trustworthy) friends
- that use GNUnet and are afraid of establishing
- (direct) connections to unknown peers.
-
- The default is "topology_default".
- endmenu
-endif
-
menu "Network" "NETWORK"
config PORT
int "Client/Server Port"
@@ -411,21 +186,7 @@
endmenu
-menu "Friend-to-Friend" "F2F"
- config FRIENDS
- string "List of friends for friend-to-friend topology"
- default "$GNUNETD_HOME/friends"
- depends on Meta::ADVANCED
- help
- Specifies the name of a file which contains a list of GNUnet
peer IDs
- that are friends. If used together with
- [MODULES] topology = topology_f2f
-
- this will ensure that GNUnet only connects to these peers (via
- any available transport).
-endmenu
-
menu "Resource limitations" "LOAD"
config BASICLIMITING
@@ -531,14 +292,6 @@
menu "UDP Transport" "UDP"
- config PORT
- int "Port"
- range 0 65535
- default 2086
- help
- To which port does GNUnet bind? Default is 2086 and
there is usually
- no reason to change that.
-
config BLACKLIST
string "Disallow connections from"
default
"127.0.0.1/8;172.16.0.0/12;192.168.0.0/16;10.0.0.0/255.0.0.0;"
@@ -578,16 +331,6 @@
menu "TCP Transport" "TCP"
- config PORT
- int "Port"
- range 0 65535
- default 2086
- help
- To which port does GNUnet bind? Default is 2086 and
there is usually
- no reason to change that. Make sure that this port
does not
- conflict with the port for GNUnet clients (section
NETWORK), which
- defaults to 2087.
-
config BLACKLIST
string "Disallow connections from"
default
"127.0.0.1/8;172.16.0.0/12;192.168.0.0/16;10.0.0.0/255.0.0.0;"
@@ -614,54 +357,21 @@
endif
- menu "NAT" "NAT"
-
- config LIMITED
- bool "Is this machine unreachable behind a NAT?"
- default n
- help
- Is this machine behind a NAT that does not allow
- connections from the outside to the GNUnet port?
- (if you can configure the NAT box to allow
- direct connections from other peers, set this
- to NO). Set this only to YES if other peers
- cannot contact you directly via TCP or UDP.
- If you set this to NO, you should also set the
- TCP and UDP port to '0' to indicate that you
- cannot accept inbound connections.
-
- endmenu
-
if Meta::EXPERIMENTAL && Meta::RARE && Meta::ADVANCED
menu "UDP over IPv6" "UDP6"
- config PORT
- int "Port"
- range 0 65535
- default 2088
-
- config MTU
- int "MTU"
- default 1452
- depends on Meta::RARE
-
config BLACKLIST
string "Disallow connections from"
- endmenu
-
- menu "TCP over IPv6" "TCP6"
- config PORT
- int "Port"
- range 0 65535
- default 2088
-
config MTU
int "MTU"
default 1440
depends on Meta::RARE
+ endmenu
+
+ menu "TCP over IPv6" "TCP6"
config BLACKLIST
string "Disallow connections from"
@@ -779,61 +489,6 @@
menu "Anonymous file sharing" "FS"
- config QUOTA
- int "MB of diskspace GNUnet can use for anonymous file sharing"
- default 1024
- help
- How much disk space (MB) is GNUnet allowed to use for
anonymous file
- sharing? This does not take indexed files into
account, only the
- space directly used by GNUnet is accounted for. GNUnet
will gather
- content from the network if the current
space-consumption is below
- the number given here (and if content migration is
allowed below).
-
- IMPORTANT:
- Note that if you change the quota, you need to run
gnunet-update,
- otherwise your databases will be inconsistent and
gnunetd will
- refuse to work. Default is 1024 (1 GB)
-
- config ACTIVEMIGRATION
- bool "Allow migrating content"
- default y
- depends on Meta::ADVANCED
- help
- Should we participate in content migration? If you say
yes here,
- GNUnet will migrate content to your server, and you
will not be able
- to control what data is stored on your machine. This
option has
- advantages and disadvantages.
-
- If you activate it, you can claim for *all* the
non-indexed (-n to
- gnunet-insert) content that you did not know what it
was even if an
- adversary takes control of your machine.
-
- If you do not activate it, it is obvious that you have
knowledge of
- all the content that is hosted on your machine and thus
can be
- considered liable for it.
-
- So if you think that the legal system in your country
has gone
- postal, you may want to set it to "NO" and make sure
that the
- content you put on your machine does not get you into
too much
- trouble if an adversary takes control of your machine.
If you think
- that you're safe if you host content that you don't
know anything
- about (like an ISP) or that you don't have to fear
prosecution
- no-matter-what, turn it to YES, which will also improve
GNUnet's
- performance and thereby your results.
-
- Note that as long as the adversary is not really
powerful (e.g. can
- not take control of your machine), GNUnet's build-in
anonymity
- mechanisms should protect you from being singled out
easily.
-
- Currently, activating active migration can cause some
problems when
- the database is getting full (gdbm reorganization can
take very,
- very long and make GNUnet look like it hangs for that
time). Thus if
- you turn it on, you may want to disable it after you
hit the
- quota. A better content management system should solve
this problem
- in the near future... [at the time of GNUnet 0.6.1c,
the MySQL
- database module already works well even if the db is
full.]
- Default is YES.
-
config DIR
string "Directory for storing FS data"
default "$GNUNETD_HOME/data/fs/"
@@ -873,43 +528,6 @@
endmenu
- if Meta::EXPERIMENTAL && Meta::RARE && Meta::ADVANCED
-
- menu "GNUnet Testbed" "TESTBED"
-
- config REGISTERURL
- string "Where should we register the testbed service?"
- default "http://gnunet.org/testbed/"
- help
- Where should we register the testbed service?
- Default is "http://gnunet.org/testbed/"
-
- config ALLOW_MODULE_LOADING
- bool "Allow to load and unload modules"
- default n
- help
- Is the testbed operator allowed to load and
- unload modules? (somewhat of a security risk!)
- Default is NO.
-
- config UPLOAD-DIR
- string "Upload directory"
- default "$GNUNETD_HOME/testbed"
- help
- Where should file-uploads go?
- Default is $GNUNETD_HOME/testbed
-
- config LOGIN
- string "Login-name for SSH-tunnel"
- default 2087
- help
- Login-name for SSH-tunnel (for secure testbed
- connections). Without login name the testbed-server
- will try to make a direct TCP connection to the
- application port (default: 2087).
-
- endmenu
-
menu "DHT" "DHT"
config BUCKETCOUNT
int "Number of buckets to use"
@@ -929,17 +547,6 @@
endif
- if Meta::RARE
- menu "GAP" "GAP"
- config TABLESIZE
- int "Size of the routing table."
- default 65536
- help
- Size of the routing table.
- Default: 65536
- endmenu
- endif
-
endmenu
Modified: GNUnet/contrib/config-daemon.scm
===================================================================
--- GNUnet/contrib/config-daemon.scm 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/contrib/config-daemon.scm 2006-09-11 03:09:30 UTC (rev 3388)
@@ -6,16 +6,20 @@
;; children, visible, value and range) which is
;; used by the script to create the configuration tree.
;;
-;; GNUnet setup also defines a function "change-visible"
-;; (with arguments context, option, section, yesno) which
+;; GNUnet setup defines a function "change-visible"
+;; (with arguments context, section, option, yesno) which
;; can be used by the script to dynamically change the
;; visibility of options.
;;
-;; Finally, GNUnet setup defines a function "get-option"
-;; (with arguments context, option, section) which
+;; GNUnet setup defines a function "get-option"
+;; (with arguments context, section, option) which
;; can be used to query the current value of an option.
;;
+;; GNUnet setup defines a function "set-option"
+;; (with arguments context, section, option, value) which
+;; can be used to set the value of an option.
;;
+;;
;; GNUnet setup requires two functions from this script.
;; First, a function "gnunet-config-setup" which constructs the
;; configuration tree.
@@ -26,11 +30,7 @@
;;
;;
;; TODO:
-;; - support for changes to one option forcing
-;; changes to other, seemingly unrelated options
-;; (should only require another callback into C)
-;; - actually convert *.in to *.scm
-;; - test!
+;; - complete conversion of *.in to *.scm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -64,10 +64,8 @@
#t
#f
#f
- 'always) )
+ 'advanced) )
-
-
(define (meta-adv builder)
(builder
"Meta"
@@ -81,6 +79,19 @@
#f
'always) )
+(define (meta-rare builder)
+ (builder
+ "Meta"
+ "RARE"
+ (_ "Show rarely used options")
+ (_
+"These are options that hardly anyone actually needs. If you plan on doing
development on GNUnet, you may want to look into these. If in doubt or in a
hurry, say NO." )
+ '()
+ #t
+ #t
+ #f
+ 'advanced) )
+
(define (meta builder)
(builder
"Meta"
@@ -88,8 +99,9 @@
(_ "Meta-configuration")
(_ "Which level of configuration should be available")
(list
+ (meta-adv builder)
+ (meta-rare builder)
(meta-exp builder)
- (meta-adv builder)
)
#t
#f
@@ -98,12 +110,25 @@
;; General menu
+(define (general-path builder)
+ (builder
+ "GNUNETD"
+ "GNUNETD_HOME"
+ (_ "Full pathname of GNUnet HOME directory")
+ (_
+"This gives the root-directory of the GNUnet installation. Make sure there is
some space left in that directory. :-) Users inserting or indexing files will
be able to store data in this directory up to the (global) quota specified
below. Having a few gigabytes of free space is recommended." )
+ '()
+ #t
+ "/var/lib/GNUnet"
+ '()
+ 'always) )
+
(define (general-helloexpires builder)
(builder
"GNUNETD"
"HELLOEXPIRES"
(_ "How many minutes should peer advertisements last?")
- (_
+ (_
"How many minutes is the current IP valid? (GNUnet will sign HELLO messages
with this expiration timeline. If you are on dialup, 60 (for 1 hour) is
suggested. If you are having a static IP address, you may want to set this to a
large value (say 14400). The default is 1440 (1 day). If your IP changes
periodically, you will want to choose the expiration to be smaller than the
frequency with which your IP changes." )
'()
#t
@@ -123,6 +148,95 @@
(list "NOTHING" "DEBUG" "STATUS" "INFO" "WARNING" "ERROR" "FATAL")
'always) )
+(define (general-logfile builder)
+ (builder
+ "GNUNETD"
+ "LOGFILE"
+ (_ "Where should logs go?")
+ (_
+"In which file should gnunetd write the logs? If you specify nothing, logs
are written to stderr (and note that if gnunetd runs in the background, stderr
is closed and all logs are discarded)." )
+ '()
+ #t
+ "$GNUNETD_HOME/logs"
+ '()
+ 'advanced) )
+
+(define (general-keeplog builder)
+ (builder
+ "GNUNETD"
+ "KEEPLOG"
+ (_ "How long should logs be kept?")
+ (_
+"How long should logs be kept? If you specify a value greater than zero, a log
is created each day with the date appended to its filename. These logs are
deleted after $KEEPLOG days. To keep logs forever, set this value to 0." )
+ '()
+ #t
+ 3
+ (cons 0 36500)
+ 'advanced) )
+
+(define (general-pidfile builder)
+ (builder
+ "GNUNETD"
+ "PIDFILE"
+ (_ "Where should gnunetd write the PID?")
+ (_
+"In which file should gnunetd write the process-id of the server? If you run
gnunetd as root, you may want to choose /var/run/gnunetd.pid. It's not the
default since gnunetd may not have write rights at that location." )
+ '()
+ #f
+ "$GNUNET_HOME/gnunetd.pid"
+ '()
+ 'rare) )
+
+
+(define (general-transports builder)
+ (builder
+ "GNUNETD"
+ "TRANSPORTS"
+ (_ "Which transport mechanisms should GNUnet use?")
+ (_
+"Use space-separated list of the modules, e.g. \"udp smtp tcp\". The
available transports are udp, tcp, http, smtp, tcp6, udp6 and nat.
+
+Loading the 'nat' and 'tcp' modules is required for peers behind NAT boxes
that cannot directly be reached from the outside. Peers that are NOT behind a
NAT box and that want to *allow* peers that ARE behind a NAT box to connect
must ALSO load the 'nat' module. Note that the actual transfer will always be
via tcp initiated by the peer behind the NAT box. The nat transport requires
the use of tcp, http, smtp and/or tcp6 in addition to nat itself.")
+ '()
+ #t
+ "udp tcp http nat"
+ '()
+ 'advanced) )
+
+
+(define (general-applications builder)
+ (builder
+ "GNUNETD"
+ "APPLICATIONS"
+ (_ "Which applications should gnunetd support?")
+ (_
+"Whenever this option is changed, you MUST run gnunet-update. Currently, the
available applications are:
+
+advertising: advertises your peer to other peers. Without it, your peer will
not participate in informing peers about other peers. You should always load
this module.
+
+getoption: allows clients to query gnunetd about the values of various
configuration options. Many tools need this. You should always load this
module.
+
+stats: allows tools like gnunet-stats and gnunet-gtk to query gnunetd about
various statistics. This information is usually quite useful to diagnose
errors, hence it is recommended that you load this module.
+
+traffic: keeps track of how many messages were recently received and
transmitted. This information can then be used to establish how much cover
traffic is currently available. The amount of cover traffic becomes important
if you want to make anonymous requests with an anonymity level that is greater
than one. It is recommended that you load this module.
+
+fs: needed for anonymous file sharing. You should always load this module.
+
+chat: broadcast chat (demo-application, ALPHA quality). Required for
gnunet-chat. Note that the current implementation of chat is not considered to
be secure.
+
+tbench: benchmark transport performance. Required for gnunet-tbench. Note
that tbench allows other users to abuse your resources.
+
+tracekit: topology visualization toolkit. Required for gnunet-tracekit. Note
that loading tracekit will make it slightly easier for an adversary to
compromise your anonymity." )
+ '()
+ #t
+ "advertising getoption fs stats traffic"
+ '()
+ 'advanced) )
+
+
+
+
+
(define (general builder)
(builder
"GNUNETD"
@@ -130,8 +244,14 @@
(_ "General settings")
(_ "Settings that change the behavior of GNUnet in general")
(list
+ (general-path builder)
(general-helloexpires builder)
(general-loglevel builder)
+ (general-logfile builder)
+ (general-keeplog builder)
+ (general-pidfile builder)
+ (general-transports builder)
+ (general-applications builder)
)
#t
#f
@@ -139,6 +259,318 @@
'always) )
+;; modules menu
+
+(define (modules-sqstore builder)
+ (builder
+ "MODULES"
+ "sqstore"
+ (_ "Which database should be used?")
+ (_
+"Which database should be used? The options are \"sqstore_sqlite\" and
\"sqstore_mysql\". You must run gnunet-update after changing this value!
+
+In order to use sqstore_mysql, you must configure the mysql database, which is
relatively simple. Read the file doc/README.mysql for how to setup mysql." )
+ '()
+ #t
+ "sqstore_sqlite"
+ (list "sqstore_sqlite" "sqstore_mysql")
+ 'advanced) )
+
+(define (modules-topology builder)
+ (builder
+ "MODULES"
+ "topology"
+ (_ "Which topology should be used?")
+ (_
+"Which topology should be used? The only options at the moment are
\"topology_default\" and \"topology_f2f\". In default mode, GNUnet will try to
connect to a diverse set of peers, and welcome connections from anyone. In f2f
(friend-to-friend) mode, GNUnet will only allow connections from peers that are
explicitly listed in a FRIENDS file. Note that you can list peers in the
FRIENDS file that run in default mode.
+
+Use f2f only if you have (trustworthy) friends that use GNUnet and are afraid
of establishing (direct) connections to unknown peers." )
+ '()
+ #t
+ "topology_default"
+ (list "topology_default" "topology_f2f")
+ 'advanced) )
+
+
+
+(define (modules builder)
+ (builder
+ "MODULES"
+ ""
+ (_ "Modules")
+ (_ "Settings that select specific implementations for GNUnet modules")
+ (list
+ (modules-sqstore builder)
+ (modules-topology builder)
+ )
+ #t
+ #f
+ #f
+ 'advanced) )
+
+
+;; f2f menu
+
+(define (f2f builder)
+ (builder
+ "F2F"
+ ""
+ (_ "List of friends for friend-to-friend topology")
+ (_ "Specifies the name of a file which contains a list of GNUnet peer IDs
that are friends. If used with the friend-to-friend topology, this will ensure
that GNUnet only connects to these peers (via any available transport).")
+ '()
+ #f
+ "$GNUNET_HOME/friends"
+ '()
+ 'f2f) )
+
+
+
+;; applications menu
+
+(define (fs-quota builder)
+ (builder
+ "FS"
+ "QUOTA"
+ (_ "MB of diskspace GNUnet can use for anonymous file sharing")
+ (_
+"How much disk space (MB) is GNUnet allowed to use for anonymous file sharing?
This does not take indexed files into account, only the space directly used by
GNUnet is accounted for. GNUnet will gather content from the network if the
current space-consumption is below the number given here (and if content
migration is allowed below).
+
+Note that if you change the quota, you need to run gnunet-update afterwards.")
+ '()
+ #t
+ 1024
+ (cons 1 1000000)
+ 'always))
+
+
+(define (fs-gap-tablesize builder)
+ (builder
+ "GAP"
+ "TABLESIZE"
+ (_ "Size of the routing table.")
+ (nohelp)
+ '()
+ #t
+ 65536
+ (cons 1024 1048576)
+ 'rare))
+
+
+(define (fs-activemigration builder)
+ (builder
+ "FS"
+ "ACTIVEMIGRATION"
+ (_ "Allow migrating content to this peer.")
+ (_
+"If you say yes here, GNUnet will migrate content to your server, and you will
not be able to control what data is stored on your machine.
+
+If you activate it, you can claim for *all* the non-indexed (-n to
gnunet-insert) content that you did not know what it was even if an adversary
takes control of your machine. If you do not activate it, it is obvious that
you have knowledge of all the content that is hosted on your machine and thus
can be considered liable for it.")
+ '()
+ #t
+ #f
+ #f
+ 'advanced))
+
+
+(define (fs builder)
+ (builder
+ "FS"
+ ""
+ (_ "Options for anonymous file sharing")
+ (nohelp)
+ (list
+ (fs-quota builder)
+ (fs-activemigration builder)
+ (fs-gap-tablesize builder)
+ )
+ #t
+ #t
+ #f
+ 'fs-loaded))
+
+(define (applications builder)
+ (builder
+ ""
+ ""
+ (_ "Applications")
+ (nohelp)
+ (list
+ (fs builder)
+ )
+ #t
+ #f
+ #f
+ 'always) )
+
+;; transport menus
+
+(define (nat builder)
+ (builder
+ "NAT"
+ "LIMITED"
+ (_ "Is this machine unreachable behind a NAT?")
+ (_ "Set to YES if this machine is behind a NAT that limits connections from
the outside to the GNUnet port. Note that if you have configured your NAT box
to allow direct connections from other machines to the GNUnet ports, you should
set the option to NO. Set this only to YES if other peers cannot contact you
directly.")
+ '()
+ #t
+ #f
+ #f
+ 'nat-loaded) )
+
+(define (tcp-port builder)
+ (builder
+ "TCP"
+ "PORT"
+ (_ "Which port should be used by the TCP IPv4 transport?")
+ (nohelp)
+ '()
+ #t
+ 2086
+ (cons 0 65535)
+ 'nat-unlimited))
+
+(define (tcp builder)
+ (builder
+ "TCP"
+ ""
+ (_ "TCP transport")
+ (nohelp)
+ (list
+ (tcp-port builder)
+ )
+ #t
+ #f
+ #f
+ 'tcp-loaded) )
+
+
+(define (http-port builder)
+ (builder
+ "HTTP"
+ "PORT"
+ (_ "Which port should be used by the HTTP transport?")
+ (nohelp)
+ '()
+ #t
+ 1080
+ (cons 0 65535)
+ 'nat-unlimited))
+
+(define (http builder)
+ (builder
+ "HTTP"
+ ""
+ (_ "HTTP transport")
+ (nohelp)
+ (list
+ (http-port builder)
+ )
+ #t
+ #f
+ #f
+ 'http-loaded) )
+
+
+(define (udp-port builder)
+ (builder
+ "UDP"
+ "PORT"
+ (_ "Which port should be used by the UDP IPv4 transport?")
+ (nohelp)
+ '()
+ #t
+ 2086
+ (cons 0 65535)
+ 'advanced))
+
+(define (udp builder)
+ (builder
+ "UDP"
+ ""
+ (_ "UDP transport")
+ (nohelp)
+ (list
+ (udp-port builder)
+ )
+ #t
+ #f
+ #f
+ 'udp-loaded) )
+
+
+(define (tcp6-port builder)
+ (builder
+ "TCP6"
+ "PORT"
+ (_ "Which port should be used by the TCP IPv6 transport?")
+ (nohelp)
+ '()
+ #t
+ 2088
+ (cons 0 65535)
+ 'nat-unlimited))
+
+(define (tcp6 builder)
+ (builder
+ "TCP6"
+ ""
+ (_ "TCP6 transport")
+ (nohelp)
+ (list
+ (tcp6-port builder)
+ )
+ #t
+ #f
+ #f
+ 'tcp6-loaded) )
+
+
+(define (udp6-port builder)
+ (builder
+ "UDP6"
+ "PORT"
+ (_ "Which port should be used by the UDP IPv6 transport?")
+ (nohelp)
+ '()
+ #t
+ 2088
+ (cons 0 65535)
+ 'advanced))
+
+(define (udp6 builder)
+ (builder
+ "UDP6"
+ ""
+ (_ "UDP6 transport")
+ (nohelp)
+ (list
+ (udp6-port builder)
+ )
+ #t
+ #f
+ #f
+ 'udp6-loaded) )
+
+
+(define (transports builder)
+ (builder
+ ""
+ ""
+ (_ "Transports")
+ (nohelp)
+ (list
+ (nat builder)
+ (tcp builder)
+ (tcp6 builder)
+ (udp builder)
+ (udp6 builder)
+ (http builder)
+ )
+ #t
+ #f
+ #f
+ 'always) )
+
+
;; main-menu
(define (main builder)
@@ -150,6 +582,10 @@
(list
(meta builder)
(general builder)
+ (modules builder)
+ (f2f builder)
+ (transports builder)
+ (applications builder)
)
#t
#f
@@ -168,19 +604,54 @@
(lambda (a b c d e f g h i) (build-tree-node a b c d e f g h) ) ) )
-;; "change" is not yet implemented. However, the idea is to again use
-;; the tree builder but this time scan use the "i" tags to determine
-;; how the visibility needs to change
+;; second main method: update visibility (and values)
+;; "change" uses again the tree builder but this time
+;; scans the "i" tags to determine how the visibility needs to change
(define (gnunet-config-change ctx)
- (let ((advanced (get-option ctx "Meta" "ADVANCED")))
- (main
+ (let
+ (
+ (advanced (get-option ctx "Meta" "ADVANCED"))
+ (rare (get-option ctx "Meta" "RARE"))
+ (experimental (get-option ctx "Meta" "EXPERIMENTAL"))
+ (f2f (string= (get-option ctx "MODULES" "topology") "topology_f2f") )
+ (fs-loaded (list? (member "fs" (string-split (get-option ctx "GNUNETD"
"APPLICATIONS") #\ ) ) ) )
+ (nat-loaded (list? (member "nat" (string-split (get-option ctx "GNUNETD"
"TRANSPORTS") #\ ) ) ) )
+ (nat-limited (get-option ctx "NAT" "LIMITED"))
+ (nat-unlimited (not (get-option ctx "NAT" "LIMITED")))
+ (tcp-loaded (list? (member "tcp" (string-split (get-option ctx "GNUNETD"
"TRANSPORTS") #\ ) ) ) )
+ (udp-loaded (list? (member "udp" (string-split (get-option ctx "GNUNETD"
"TRANSPORTS") #\ ) ) ) )
+ (tcp6-loaded (list? (member "tcp6" (string-split (get-option ctx
"GNUNETD" "TRANSPORTS") #\ ) ) ) )
+ (udp6-loaded (list? (member "udp6" (string-split (get-option ctx
"GNUNETD" "TRANSPORTS") #\ ) ) ) )
+ (http-loaded (list? (member "http" (string-split (get-option ctx
"GNUNETD" "TRANSPORTS") #\ ) ) ) )
+ )
+ (begin
+ (if (and nat-loaded nat-limited tcp-loaded)
+ (set-option ctx "TCP" "PORT" "0")
+ 'nothing)
+ (if (and nat-loaded nat-limited tcp6-loaded)
+ (set-option ctx "TCP6" "PORT" "0")
+ 'nothing)
+ (if (and nat-loaded nat-limited http-loaded)
+ (set-option ctx "HTTP" "PORT" "0")
+ 'nothing)
+ (main
(lambda (a b c d e f g h i)
(begin
- (if (eq? i 'advanced)
- (change-visible ctx a b advanced)
- 'nothing ) ) ) ) ) )
+ (cond
+ ((eq? i 'advanced) (change-visible ctx a b advanced))
+ ((eq? i 'rare) (change-visible ctx a b rare))
+ ((eq? i 'experimental) (change-visible ctx a b experimental))
+ ((eq? i 'f2f) (change-visible ctx a b f2f))
+ ((eq? i 'fs-loaded) (change-visible ctx a b fs-loaded))
+ ((eq? i 'nat-unlimited)(change-visible ctx a b nat-unlimited))
+ ((eq? i 'nat-loaded) (change-visible ctx a b nat-loaded))
+ ((eq? i 'udp-loaded) (change-visible ctx a b udp-loaded))
+ ((eq? i 'tcp-loaded) (change-visible ctx a b tcp-loaded))
+ ((eq? i 'udp6-loaded) (change-visible ctx a b udp6-loaded))
+ ((eq? i 'tcp6-loaded) (change-visible ctx a b tcp6-loaded))
+ (else 'nothing)
+ )
+ ) ) ) )
+) )
-;; Example: (change-visible ctx "FOO" "BAR" #t)
-
-;; (setup)
\ No newline at end of file
Modified: GNUnet/src/setup/gtk/gconf.c
===================================================================
--- GNUnet/src/setup/gtk/gconf.c 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/src/setup/gtk/gconf.c 2006-09-11 03:09:30 UTC (rev 3388)
@@ -388,6 +388,8 @@
"background",
SETUP_EDIT_BGCOLOR,
"background-set",
SETUP_TRUE,
"editable", SETUP_TRUE,
+ "wrap-width", SETUP_DWIDTH,
+ "wrap-mode", SETUP_WRAP,
NULL);
column = gtk_tree_view_get_column(GTK_TREE_VIEW(treeView),
col - 1);
@@ -400,6 +402,8 @@
_("Default"),
renderer,
"text", SETUP_DEFAULT_VALUE,
+ "wrap-width", SETUP_DWIDTH,
+ "wrap-mode", SETUP_WRAP,
NULL);
column = gtk_tree_view_get_column(GTK_TREE_VIEW(treeView),
col - 1);
@@ -565,9 +569,6 @@
#ifdef WINDOWS
FreeConsole();
#endif
-
- /* add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps"); */
- /* add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); */
return gconf_main_post_init(self,
ectx,
cfg,
Modified: GNUnet/src/setup/lib/gns.c
===================================================================
--- GNUnet/src/setup/lib/gns.c 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/src/setup/lib/gns.c 2006-09-11 03:09:30 UTC (rev 3388)
@@ -53,6 +53,8 @@
GNS_TCL * listeners;
+ unsigned int in_notify;
+
};
static void notify_listeners(void * ctx,
@@ -60,11 +62,15 @@
struct GNS_Context * g = ctx;
GNS_TCL * lpos;
+ if (g->in_notify > 0)
+ return; /* do not do recursive notifications! */
+ g->in_notify++;
lpos = g->listeners;
while (lpos != NULL) {
lpos->l(tree, lpos->c);
lpos = lpos->next;
}
+ g->in_notify--;
}
/**
@@ -192,7 +198,8 @@
notify_listeners(g, pos);
/* allow tree to update visibility */
- tree_notify_change(¬ify_listeners,
+ tree_notify_change(cfg,
+ ¬ify_listeners,
g,
g->ectx,
g->root,
@@ -258,6 +265,7 @@
ctx->ectx = ectx;
ctx->cfg = cfg;
ctx->root = root;
+ ctx->in_notify = 0;
if (-1 == GC_attach_change_listener(cfg,
&configChangeListener,
ctx)) {
Modified: GNUnet/src/setup/lib/tree.c
===================================================================
--- GNUnet/src/setup/lib/tree.c 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/src/setup/lib/tree.c 2006-09-11 03:09:30 UTC (rev 3388)
@@ -35,6 +35,7 @@
VisibilityChangeListener vcl;
void * ctx;
struct GNS_Tree * root;
+ struct GC_Configuration * cfg;
} TC;
/* ********************** scheme smob boxing ***************** */
@@ -187,6 +188,41 @@
if (opt != NULL)
free(opt);
return SCM_EOL;
+}
+
+/**
+ * Set an option.
+ */
+SCM set_option(SCM smob,
+ SCM section,
+ SCM option,
+ SCM value) {
+ TC * tc;
+ char * opt;
+ char * sec;
+ char * val;
+
+ SCM_ASSERT(SCM_SMOB_PREDICATE(tc_tag, smob), smob, SCM_ARG1, "set_option");
+ SCM_ASSERT(scm_string_p(option), option, SCM_ARG2, "set_option");
+ SCM_ASSERT(scm_string_p(section), section, SCM_ARG3, "set_option");
+ SCM_ASSERT(scm_string_p(value), value, SCM_ARG4, "set_option");
+
+ tc = (TC *) SCM_SMOB_DATA(smob);
+ opt = scm_to_locale_string(option);
+ sec = scm_to_locale_string(section);
+ val = scm_to_locale_string(value);
+ GC_set_configuration_value_string(tc->cfg,
+ NULL,
+ sec,
+ opt,
+ val);
+ if (sec != NULL)
+ free(sec);
+ if (val != NULL)
+ free(val);
+ if (opt != NULL)
+ free(opt);
+ return SCM_EOL;
}
/**
@@ -345,13 +381,15 @@
*
* Update visibility (and notify about changes).
*/
-void tree_notify_change(VisibilityChangeListener vcl,
+void tree_notify_change(struct GC_Configuration * cfg,
+ VisibilityChangeListener vcl,
void * ctx,
struct GE_Context * ectx,
struct GNS_Tree * root,
struct GNS_Tree * change) {
TC tc;
+ tc.cfg = cfg;
tc.vcl = vcl;
tc.ctx = ctx;
tc.root = root;
@@ -377,6 +415,9 @@
scm_c_define_gsubr("get-option",
3, 0, 0,
&get_option);
+ scm_c_define_gsubr("set-option",
+ 4, 0, 0,
+ &set_option);
return NULL;
}
Modified: GNUnet/src/setup/lib/tree.h
===================================================================
--- GNUnet/src/setup/lib/tree.h 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/src/setup/lib/tree.h 2006-09-11 03:09:30 UTC (rev 3388)
@@ -44,7 +44,8 @@
* A value in the tree has been changed.
* Update visibility (and notify about changes).
*/
-void tree_notify_change(VisibilityChangeListener vcl,
+void tree_notify_change(struct GC_Configuration * cfg,
+ VisibilityChangeListener vcl,
void * ctx,
struct GE_Context * ectx,
struct GNS_Tree * root,
Modified: GNUnet/src/util/config_impl/impl.c
===================================================================
--- GNUnet/src/util/config_impl/impl.c 2006-09-11 00:15:12 UTC (rev 3387)
+++ GNUnet/src/util/config_impl/impl.c 2006-09-11 03:09:30 UTC (rev 3388)
@@ -568,9 +568,14 @@
e = findEntry(data, section, option);
}
if (e->dirty_val != NULL) {
- /* recursive update, not allowed! */
- GE_BREAK(ectx, 0);
- ret = -1;
+ if (0 == strcmp(e->dirty_val,
+ value)) {
+ ret = 0;
+ } else {
+ /* recursive update to different value -- not allowed! */
+ GE_BREAK(ectx, 0);
+ ret = -1;
+ }
} else {
e->dirty_val = STRDUP(value);
i = data->lsize - 1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3388 - in GNUnet: contrib src/setup/gtk src/setup/lib src/util/config_impl,
grothoff <=