summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xPICA_node.c2
-rw-r--r--PICA_nodeconfig.c8
-rw-r--r--PICA_nodeconfig.h8
-rw-r--r--pica-node.850
-rw-r--r--pica-node.conf.543
5 files changed, 106 insertions, 5 deletions
diff --git a/PICA_node.c b/PICA_node.c
index 1a6433c..27b7e40 100755
--- a/PICA_node.c
+++ b/PICA_node.c
@@ -2412,7 +2412,7 @@ int main(int argc,char** argv)
process_cmdline(argc, argv);
-nodecfg.config_file = (nodecfg.config_file ? nodecfg.config_file : "/etc/pica-node.ini");
+nodecfg.config_file = (nodecfg.config_file ? nodecfg.config_file : "/etc/pica-node.conf");
PICA_nodeconfig_load(nodecfg.config_file);
diff --git a/PICA_nodeconfig.c b/PICA_nodeconfig.c
index f495962..d89d91b 100644
--- a/PICA_nodeconfig.c
+++ b/PICA_nodeconfig.c
@@ -17,10 +17,10 @@ d = iniparser_load(config_file);
if (!d)
return 0;
-nodecfg.announced_addr = strdup(iniparser_getstring(d, "pica-node:announced_addr", NULL));
-nodecfg.listen_port = strdup(iniparser_getstring(d, "pica-node:listen_port", NULL));
-nodecfg.nodes_db_file = strdup(iniparser_getstring(d, "pica-node:nodes_db_file", NULL));
-nodecfg.CA_cert_file = strdup(iniparser_getstring(d, "pica-node:CA_cert_file", NULL));
+nodecfg.announced_addr = strdup(iniparser_getstring(d, "pica-node:announced_addr", PICA_NODECONFIG_DEF_ANNOUNCED_ADDR));
+nodecfg.listen_port = strdup(iniparser_getstring(d, "pica-node:listen_port", PICA_NODECONFIG_DEF_LISTEN_PORT));
+nodecfg.nodes_db_file = strdup(iniparser_getstring(d, "pica-node:nodes_db_file", PICA_NODECONFIG_DEF_NODES_DB_FILE));
+nodecfg.CA_cert_file = strdup(iniparser_getstring(d, "pica-node:CA_cert_file", PICA_NODECONFIG_DEF_CA_CERT_FILE));
iniparser_freedict(d);
diff --git a/PICA_nodeconfig.h b/PICA_nodeconfig.h
index db44346..bbb2f1d 100644
--- a/PICA_nodeconfig.h
+++ b/PICA_nodeconfig.h
@@ -2,6 +2,14 @@
#ifndef PICA_NODECONFIG_H
#define PICA_NODECONFIG_H
+//FIXME these default values should be set by "configure" script
+//FIXME put these macros inside man pages and substitute them using sed during "make install"
+#define PICA_NODECONFIG_DEF_ANNOUNCED_ADDR "0.0.0.0"
+#define PICA_NODECONFIG_DEF_LISTEN_PORT 2299
+#define PICA_NODECONFIG_DEF_NODES_DB_FILE "/var/lib/pica-node/nodelist.db"
+#define PICA_NODECONFIG_DEF_CONFIG_FILE "/etc/pica-node.conf"
+#define PICA_NODECONFIG_DEF_CA_CERT_FILE "/usr/share/pica-node/CA.pem"
+
struct nodeconfig
{
char *announced_addr;
diff --git a/pica-node.8 b/pica-node.8
new file mode 100644
index 0000000..cdf6521
--- /dev/null
+++ b/pica-node.8
@@ -0,0 +1,50 @@
+
+.TH pica-node 8
+.SH NAME
+pica-node \- start the node for Pica Pica Messenger distributed network
+.SH SYNOPSIS
+.B pica-node
+[\-f configuration file] [\-v | \-vv | \-vvv]
+.SH DESCRIPTION
+Pica Pica node serves Pica Pica distributed network. It authenticates users,
+provides info about other existing nodes and online users, routes encrypted
+connections between users.
+.PP
+.B pica-node
+listens for TCP connections from clients and other nodes. On startup it loads
+nodelist database and tries to connect to each node listed there. At least one
+node should be alive for successful join to Pica Pica distributed network.
+.B
+
+.SH OPTIONS
+.TP
+\-h
+display help
+.TP
+\-f
+.I config_file_name
+
+Specifies the name of the configuration file. The default is /etc/pica-node.conf
+.TP
+\-v
+Verbose mode. This is helpful in debugging problems. Multiple -v options
+increase the verbosity. The maximum is 3.
+.SH FILES
+.TP
+.I /etc/pica-node.conf
+Configuration file. See
+.BR pica-node.conf (5)
+for details
+.TP
+.I /var/lib/pica-node/nodelist.db
+Nodelist database. This is SQLite 3 database file.
+.TP
+.I /usr/share/pica-node/CA.pem
+Certificate Authority X509 certificate in .pem format
+.SH AUTHOR
+Anton Sviridenko (anton (at) picapica.im, anton (at) picapica.ge)
+.SH SEE ALSO
+.BR pica-node.conf(5)
+
+.BR http://picapica.im
+
diff --git a/pica-node.conf.5 b/pica-node.conf.5
new file mode 100644
index 0000000..391f4c9
--- /dev/null
+++ b/pica-node.conf.5
@@ -0,0 +1,43 @@
+
+.TH pica-node.conf 5
+.SH NAME
+pica-node.conf \- pica-node configuration file
+.SH SYNOPSIS
+.B /etc/pica-node.conf
+.SH DESCRIPTION
+.BR pica-node (8)
+reads configuration data from
+.I /etc/pica-node.conf
+(or the
+file specified with -f on the command line). The file has .INI file format.
+All options must be contained in
+.B [pica-node]
+section. The possible options and their meanings are as follows:
+.TP
+.I announced_addr
+Network address that can be used to reach this instance of pica-node.
+Can be specified in form of DNS name or IPv4 adress. If the computer
+running pica-node is behind NAT, external public address of NAT machine
+must be specified and port forwarding must be configured.
+.TP
+.I listen_port
+Specifies the port number that
+.BR pica-node (8)
+listens on. The default is 2299
+.TP
+.I nodes_db_file
+Specifies the nodes database file. This is the SQLite 3 database. It stores
+info about available nodes (their address, port, last seen online, etc).
+The default is
+.I /var/lib/pica-node/nodelist.db
+.TP
+.I CA_cert_file
+Specifies the path to CA certificate in .pem format. The default is
+.I /usr/share/pica-node/CA.pem
+.SH AUTHOR
+Anton Sviridenko (anton (at) picapica.im, anton (at) picapica.ge)
+.SH SEE ALSO
+.BR pica-node (8)
+
+.BR http://picapica.im
+