]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon: updated doc
authorMarek Vavruša <marek.vavrusa@nic.cz>
Fri, 27 Mar 2015 13:26:28 +0000 (14:26 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Fri, 27 Mar 2015 13:26:28 +0000 (14:26 +0100)
daemon/engine.c
doc/build.rst
doc/config.rst
doc/daemon.rst
doc/index.rst

index d9d8f9ce21de47a25f46ed401e3d49a6aa4a9074..75c05046917b7f90c9a9cf5833ab64fe6de5e9ab 100644 (file)
 #include "lib/cache.h"
 #include "lib/defines.h"
 
-/*
- * Defines
- */
-
-#define CACHE_DEFAULT_PATH "/tmp/kresolved"
-#define CACHE_DEFAULT_SIZE 10*(1024*1024)
-
 /*
  * Global bindings.
  */
@@ -39,6 +32,11 @@ static int l_help(lua_State *L)
        static const char *help_str = 
                "help()\n    show this help\n"
                "quit()\n    quit\n"
+               "modules.list()\n    list modules\n"
+               "modules.load()\n    load module\n"
+               "modules.unload()\n    unload module\n"
+               "cache.open(path, max_size)\n    open cache\n"
+               "cache.close()\n    close cache\n"
                ;
        puts(help_str);
        /* No results */
index b5b0a515e09108915cdcac804ae4bd80d282f85b..7cc5742c9b435a9fde7f8af71e06408314671e92 100644 (file)
@@ -32,11 +32,12 @@ The following is a list of software required to build Knot DNS Resolver from sou
    "C compiler", "*all*", "*(build only)* [#]_"
    "libknot_ 2.0+", "*all*", "Knot DNS library."
 
-There are also *optional* packages that enable specific functionality in Knot DNS Resolver, apart from the `libuv_` and `GCCGO`_, they are useful mainly for developers to build documentation and tests.
+There are also *optional* packages that enable specific functionality in Knot DNS Resolver, apart from the `libuv`_ and `GCCGO`_, they are useful mainly for developers to build documentation and tests.
 
 .. csv-table::
    :header: "Requirement", "Required by", "Notes"
 
+   "Lua_ 5.1+", "``daemon``", "Embeddable scripting language (LuaJIT_ is preferred)."
    "libuv_ 1.0+", "``daemon``", "Multiplatform I/O and services."
    "cmocka_", "``unit tests``", "Unit testing framework."
    "Python_", "``integration tests``", "For scripting tests, C header files are required (``python-dev``)"
index 153f84ac5afd317c92704b257674b22240be8488..870950b2265b736d6f5fb641a86975a163c1e54f 100644 (file)
@@ -1,2 +1,51 @@
-Configuration reference
------------------------
\ No newline at end of file
+Daemon configuration
+--------------------
+
+The Knot DNS Resolver daemon has no traditional concept of static configuration.
+In it's simplest form it requires just a working directory in which it can set up persistent files like
+cache and the process state.
+
+.. code-block:: sh
+
+       $ kresolved /var/run/kresolved
+
+And you're good to go!
+
+Introduction
+~~~~~~~~~~~~
+
+There are several choices on how you can configure the daemon, a RPC interface a CLI or a configuration file,
+but fortunately all share a common syntax and are transparent to each other, e.g. if you change a knob, you're going to
+see it projected to other interfaces as well.
+
+.. note:: Expect this page to change a lot, as it's still just a proof of concept implementation.
+
+Configuration 101
+~~~~~~~~~~~~~~~~~
+
+If there is a `config` file in the daemon working directory, it's going to get loaded automatically, if there isn't one
+the daemon is going to start with sane defaults and listening on `localhost`. The syntax for options is like follows: ``group.option = value``
+or ``group.action(parameters)``. You can also comment using a ``--`` prefix.
+
+A simple example would be to increase the cache size.
+
+.. code-block:: lua
+
+       -- increase the cache to 100MB
+       cache.open(".", 100*1024*1024)
+
+Dynamic configuration
+~~~~~~~~~~~~~~~~~~~~~
+
+Packages and services
+~~~~~~~~~~~~~~~~~~~~~
+
+The Lua supports a concept called closures, this is extremely useful for scripting actions upon various events.
+
+.. note:: TODO, come back later!
+
+* Timers and events
+* File watchers
+* Serialization
+* Data I/O
+
index baf8c89e17441e0bf6cd0002616f28f5c64d5465..1cd4004a449c6f6ea86d52d0f40a1034a2c4ebab 100644 (file)
@@ -31,6 +31,6 @@ You can load modules this way and use their properties to get information about
        $ kresolved /var/run/knot-resolver
        ...
        [system] started in interactive mode, type 'help()'
-       > module.load('cachectl')
+       > modules.load('cachectl')
        > return cachectl.size()
        { "size": 53 }
\ No newline at end of file
index 19deef18c174f080706d9e4521d231f2166df92d..18f4d2e1f87862edb0badf1d4318305a0034594e 100644 (file)
@@ -9,10 +9,10 @@ Modular architecture of the library keeps the core tiny and efficient, and provi
    :maxdepth: 2
 
    build
-   daemon
    lib
-   modules
+   daemon
    config
+   modules
 
 
 Indices and tables