]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Add LOCAL_CONFDIR option
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Mar 2016 17:35:49 +0000 (17:35 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 10 Mar 2016 17:35:49 +0000 (17:35 +0000)
CMakeLists.txt
config.h.in
src/libserver/cfg_utils.c

index f8ae533eb9984aa17905bcb43c4bd1990b2c2937..5a81f80ecd6d7f3da125b9a30682fad869cbe5c6 100644 (file)
@@ -83,6 +83,7 @@ ENDIF()
 
 # Now CMAKE_INSTALL_PREFIX is a base prefix for everything
 # CONFDIR - for configuration
+# LOCAL_CONFDIR - for local configuration
 # MANDIR - for manual pages
 # RUNDIR - for runtime files
 # DBDIR - for static files
@@ -93,6 +94,10 @@ IF(NOT CONFDIR)
        SET(CONFDIR "${CMAKE_INSTALL_PREFIX}/etc/rspamd")
 ENDIF(NOT CONFDIR)
 
+IF(NOT LOCAL_CONFDIR)
+       SET(LOCAL_CONFDIR "${CONFDIR}")
+ENDIF(NOT LOCAL_CONFDIR)
+
 IF(NOT MANDIR)
        SET(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
 ENDIF(NOT MANDIR)
index db1a63d9753584c469bb868e59aad4db97991ab7..50a17c0a59b17e7d9996b953941685807b901aa7 100644 (file)
 #define uthash_free(ptr,sz) g_slice_free1(sz, ptr)
 
 #define RSPAMD_CONFDIR "${CONFDIR}"
+#define RSPAMD_LOCAL_CONFDIR "${LOCAL_CONFDIR}"
 #define RSPAMD_RUNDIR "${RUNDIR}"
 #define RSPAMD_LOGDIR "${LOGDIR}"
 #define RSPAMD_DBDIR "${DBDIR}"
index 8bd633929a9d7d3058da6c6ba961d2e9ec6e19b5..01aca11ef9abb4de39bb4dad6118db71c844ad25 100644 (file)
@@ -927,6 +927,7 @@ rspamd_include_map_handler (const guchar *data, gsize len,
 /*
  * Variables:
  * $CONFDIR - configuration directory
+ * $LOCAL_CONFDIR - local configuration directory
  * $RUNDIR - local states directory
  * $DBDIR - databases dir
  * $LOGDIR - logs dir
@@ -936,6 +937,7 @@ rspamd_include_map_handler (const guchar *data, gsize len,
  */
 
 #define RSPAMD_CONFDIR_MACRO "CONFDIR"
+#define RSPAMD_LOCAL_CONFDIR_MACRO "LOCAL_CONFDIR"
 #define RSPAMD_RUNDIR_MACRO "RUNDIR"
 #define RSPAMD_DBDIR_MACRO "DBDIR"
 #define RSPAMD_LOGDIR_MACRO "LOGDIR"
@@ -958,6 +960,9 @@ rspamd_ucl_add_conf_variables (struct ucl_parser *parser, GHashTable *vars)
        ucl_parser_register_variable (parser,
                        RSPAMD_CONFDIR_MACRO,
                        RSPAMD_CONFDIR);
+       ucl_parser_register_variable (parser,
+                       RSPAMD_LOCAL_CONFDIR_MACRO,
+                       RSPAMD_LOCAL_CONFDIR);
        ucl_parser_register_variable (parser, RSPAMD_RUNDIR_MACRO,
                        RSPAMD_RUNDIR);
        ucl_parser_register_variable (parser,  RSPAMD_DBDIR_MACRO,