Commit 4f84221d authored by rswindell's avatar rswindell
Browse files

SBBSecho v3.02:

Most of the changes are in EchoCfg:
- SBBSecho and EchoCfg will now maintain auto-backups of the sbbsecho.ini file
- AutoAddSubs now defaults to true/enabled: this setting is harmless without
  further configuring linked nodes (Uplink for Groups / GroupHub)
- Global Settings are now a separate sub-menu in EchoCfg
- EchoCfg remembers current selection on (more) sub-menus
- Sub-menus have been rearranged and resized
- Numerous Online Help text updates in EchoCfg
- Adding missing/new settings to EchoCfg:
  Log Timestamp Format
  Strict Packet Passwords
  Use FTN Domain/Zone Map
  BSY Mutex File Timeout
  BSO Lock Attempt Delay
  BSO Lock Attempt Limit
  Config File Backups
  Linked Nodes->Uplink for Message Groups
  Echo Statistics File
  Outgoing Semaphore File
  Automatically Add New Subs to Area File
  Maximum Backups to Maintain of Area File
  Relay Filtered Messages
  (everything you can set in sbbsecho.ini should now be editable via EchoCfg)
parent cd4c1501
This diff is collapsed.
......@@ -226,6 +226,8 @@ void get_default_echocfg(sbbsecho_cfg_t* cfg)
cfg->relay_filtered_msgs = false;
cfg->umask = 077;
cfg->areafile_backups = 100;
cfg->cfgfile_backups = 100;
cfg->auto_add_subs = true;
}
char* pktTypeStringList[] = {"2+", "2e", "2.2", "2", NULL}; // Must match enum pkt_type
......@@ -248,15 +250,15 @@ bool sbbsecho_read_ini(sbbsecho_cfg_t* cfg)
/* Global/root section: */
/************************/
iniFreeStringList(cfg->sysop_alias_list);
SAFECOPY(cfg->inbound , iniGetString(ini, ROOT_SECTION, "Inbound", "../fido/nonsecure", value));
SAFECOPY(cfg->secure_inbound, iniGetString(ini, ROOT_SECTION, "SecureInbound", "../fido/inbound", value));
SAFECOPY(cfg->outbound , iniGetString(ini, ROOT_SECTION, "Outbound", "../fido/outbound", value));
SAFECOPY(cfg->areafile , iniGetString(ini, ROOT_SECTION, "AreaFile", "../data/areas.bbs", value));
SAFECOPY(cfg->badareafile , iniGetString(ini, ROOT_SECTION, "BadAreaFile", "../data/badareas.lst", value));
SAFECOPY(cfg->echostats , iniGetString(ini, ROOT_SECTION, "EchoStats", "../data/echostats.ini", value));
SAFECOPY(cfg->logfile , iniGetString(ini, ROOT_SECTION, "LogFile", "../data/sbbsecho.log", value));
SAFECOPY(cfg->logtime , iniGetString(ini, ROOT_SECTION, "LogTimeFormat", "%Y-%m-%d %H:%M:%S", value));
SAFECOPY(cfg->temp_dir , iniGetString(ini, ROOT_SECTION, "TempDirectory", "../temp/sbbsecho", value));
SAFECOPY(cfg->inbound , iniGetString(ini, ROOT_SECTION, "Inbound" ,DEFAULT_INBOUND , value));
SAFECOPY(cfg->secure_inbound, iniGetString(ini, ROOT_SECTION, "SecureInbound" ,DEFAULT_SECURE_INBOUND , value));
SAFECOPY(cfg->outbound , iniGetString(ini, ROOT_SECTION, "Outbound" ,DEFAULT_OUTBOUND , value));
SAFECOPY(cfg->areafile , iniGetString(ini, ROOT_SECTION, "AreaFile" ,DEFAULT_AREA_FILE , value));
SAFECOPY(cfg->badareafile , iniGetString(ini, ROOT_SECTION, "BadAreaFile" ,DEFAULT_BAD_AREA_FILE , value));
SAFECOPY(cfg->echostats , iniGetString(ini, ROOT_SECTION, "EchoStats" ,DEFAULT_ECHOSTATS_FILE , value));
SAFECOPY(cfg->logfile , iniGetString(ini, ROOT_SECTION, "LogFile" ,DEFAULT_LOG_FILE , value));
SAFECOPY(cfg->logtime , iniGetString(ini, ROOT_SECTION, "LogTimeFormat" ,DEFAULT_LOG_TIME_FMT , value));
SAFECOPY(cfg->temp_dir , iniGetString(ini, ROOT_SECTION, "TempDirectory" ,DEFAULT_TEMP_DIR , value));
SAFECOPY(cfg->outgoing_sem , iniGetString(ini, ROOT_SECTION, "OutgoingSemaphore", "", value));
cfg->log_level = iniGetLogLevel(ini, ROOT_SECTION, "LogLevel", cfg->log_level);
cfg->strip_lf = iniGetBool(ini, ROOT_SECTION, "StripLineFeeds", cfg->strip_lf);
......@@ -269,6 +271,7 @@ bool sbbsecho_read_ini(sbbsecho_cfg_t* cfg)
cfg->relay_filtered_msgs = iniGetBool(ini, ROOT_SECTION, "RelayFilteredMsgs", cfg->relay_filtered_msgs);
cfg->umask = iniGetInteger(ini, ROOT_SECTION, "umask", cfg->umask);
cfg->areafile_backups = iniGetInteger(ini, ROOT_SECTION, "AreaFileBackups", cfg->areafile_backups);
cfg->cfgfile_backups = iniGetInteger(ini, ROOT_SECTION, "CfgFileBackups", cfg->cfgfile_backups);
/* EchoMail options: */
cfg->maxbdlsize = (ulong)iniGetBytes(ini, ROOT_SECTION, "BundleSize", 1, cfg->maxbdlsize);
......@@ -462,6 +465,9 @@ bool sbbsecho_write_ini(sbbsecho_cfg_t* cfg)
FILE* fp;
str_list_t ini;
if(cfg->cfgfile_backups)
backup(cfg->cfgfile, cfg->cfgfile_backups, /* ren: */false);
if((fp=iniOpenFile(cfg->cfgfile, /* create: */true))==NULL)
return false;
ini = iniReadFile(fp);
......@@ -477,6 +483,7 @@ bool sbbsecho_write_ini(sbbsecho_cfg_t* cfg)
iniSetString(&ini, ROOT_SECTION, "Outbound" ,cfg->outbound ,NULL);
iniSetString(&ini, ROOT_SECTION, "AreaFile" ,cfg->areafile ,NULL);
iniSetInteger(&ini, ROOT_SECTION, "AreaFileBackups" ,cfg->areafile_backups ,NULL);
iniSetInteger(&ini, ROOT_SECTION, "CfgFileBackups" ,cfg->cfgfile_backups ,NULL);
iniSetString(&ini, ROOT_SECTION, "BadAreaFile" ,cfg->badareafile ,NULL);
iniSetString(&ini, ROOT_SECTION, "EchoStats" ,cfg->echostats ,NULL);
if(cfg->logfile[0])
......
......@@ -1766,6 +1766,10 @@ bool alter_config(fidoaddr_t addr, const char* key, const char* value)
{
FILE* fp;
static ulong alterations;
if(alterations++ == 0)
backup(cfg.cfgfile, cfg.cfgfile_backups, /* ren: */false);
if((fp=iniOpenFile(cfg.cfgfile, false)) == NULL) {
lprintf(LOG_ERR, "ERROR %d (%s) opening %s for altering configuration of node %s"
,errno, strerror(errno), cfg.cfgfile, smb_faddrtoa(&addr, NULL));
......
......@@ -42,10 +42,20 @@
#include "fidodefs.h"
#define SBBSECHO_VERSION_MAJOR 3
#define SBBSECHO_VERSION_MINOR 1
#define SBBSECHO_VERSION_MINOR 2
#define SBBSECHO_PRODUCT_CODE 0x12FF /* from http://ftsc.org/docs/ftscprod.013 */
#define DEFAULT_INBOUND "../fido/nonsecure"
#define DEFAULT_SECURE_INBOUND "../fido/inbound"
#define DEFAULT_OUTBOUND "../fido/outbound"
#define DEFAULT_AREA_FILE "../data/areas.bbs"
#define DEFAULT_BAD_AREA_FILE "../data/badareas.lst"
#define DEFAULT_ECHOSTATS_FILE "../data/echostats.ini"
#define DEFAULT_LOG_FILE "../data/sbbsecho.log"
#define DEFAULT_LOG_TIME_FMT "%Y-%m-%d %H:%M:%S"
#define DEFAULT_TEMP_DIR "../temp/sbbsecho"
enum mail_status {
MAIL_STATUS_NORMAL
,MAIL_STATUS_HOLD
......@@ -140,8 +150,9 @@ typedef struct {
char logfile[MAX_PATH+1]; /* LOG path/filename */
char logtime[64]; /* format of log timestamp */
char cfgfile[MAX_PATH+1]; /* Configuration path/filename */
uint cfgfile_backups; /* Number of backups to keep of cfg file */
char temp_dir[MAX_PATH+1]; /* Temporary file directory */
char outgoing_sem[MAX_PATH+1]; /* Semaphore file to creat when there's outgoing data */
char outgoing_sem[MAX_PATH+1]; /* Semaphore file to create/touch when there's outgoing data */
str_list_t sysop_alias_list; /* List of sysop aliases */
ulong maxpktsize /* Maximum size for packets */
,maxbdlsize; /* Maximum size for bundles */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment