+// The "host key" is a 100-byte random string that is used to do some persistent hashing.
+// It must remain consistent throughout the lifetime of this Citadel installation
+void generate_host_key(void) {
+ syslog(LOG_INFO, "config: generating a host key");
+ int len = 0;
+ char host_key[128];
+
+ while (len < 100) {
+ do {
+ host_key[len] = random() % 0x7F;
+ } while (!isalnum(host_key[len]));
+ host_key[++len] = 0;
+ }
+ CtdlSetConfigStr("host_key", host_key);
+}
+
+
+// Put some sane default values into our configuration. Some will be overridden when we run setup.