* Removed the "weekly" script and began installing a facility to allow
authorArt Cancro <ajc@citadel.org>
Wed, 30 Jul 2003 00:26:51 +0000 (00:26 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 30 Jul 2003 00:26:51 +0000 (00:26 +0000)
  database maintenance to happen automatically.  (One Step Install can't
  require the sysadmin to know cron)

citadel/ChangeLog
citadel/Makefile.in
citadel/citadel.h
citadel/citadel.nsi
citadel/citadel.spec
citadel/configure.ac
citadel/serv_upgrade.c
citadel/serv_upgrade.h
citadel/serv_vandelay.c
citadel/setup.c

index 4d61e8183be24dfab8ed30193370bbee7fd5c346..3556973d2e7187e1a9e740765f1f0deb6fc780f9 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 608.12  2003/07/30 00:26:50  ajc
+ * Removed the "weekly" script and began installing a facility to allow
+   database maintenance to happen automatically.  (One Step Install can't
+   require the sysadmin to know cron)
+
  Revision 608.11  2003/07/28 04:17:24  ajc
  * migratenet.c: removed.  Adjusted Makefile.in accordingly.
 
@@ -4914,3 +4919,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 008d3c9432c61b3ed72a346b35e649a397d51c99..01dcfed66ff8476e6c683757033df253ecd39c13 100644 (file)
@@ -191,7 +191,7 @@ install-doc:
                $(INSTALL_DATA) $$i $(root)$(prefix)/$$i; \
        done
 
-install-exec: all weekly
+install-exec: all
        @for i in bio bitbucket files images info userpics; do \
                $(srcdir)/mkinstalldirs $(root)$(prefix)/$$i; \
        done
@@ -201,7 +201,7 @@ install-exec: all weekly
                        $(INSTALL) $$i $(root)$(prefix)/$$i; \
                fi \
        done
-       @for i in utilsmenu weekly ; do \
+       @for i in utilsmenu ; do \
                if test -f $(srcdir)/$$i; then \
                        echo $(INSTALL) $(srcdir)/$$i $(root)$(prefix)/$$i; \
                        $(INSTALL) $(srcdir)/$$i $(root)$(prefix)/$$i; \
@@ -220,7 +220,7 @@ cleaner: clean
 
 distclean: cleaner
        find . -name '*~' -o -name '.#*' | xargs rm -f
-       rm -f Makefile sysdep.h config.cache config/.og config.status *.d weekly
+       rm -f Makefile sysdep.h config.cache config/.og config.status *.d 
 
 .c.d:
        @echo Checking dependencies for $<
@@ -239,7 +239,4 @@ $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4
 $(srcdir)/aclocal.m4: $(srcdir)/acinclude.m4
        cd $(srcdir) && $(ACLOCAL)
 
-weekly: $(srcdir)/weekly.in config.status
-       CONFIG_FILES=weekly CONFIG_HEADERS= $(SHELL) ./config.status
-
 -include $(DEP_FILES)
index 3e970484b7b390651e664e6ca223ff369d585313..d746caa9174967de4cb2ba9cce7d3fe1f67062e6 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
 /*
  * Text description of this software
  */
-#define CITADEL        "Citadel/UX 6.08"
+#define CITADEL        "Citadel/UX 6.09"
 
 /*
  * REV_LEVEL is the current version number (multiplied by 100 to avoid having
@@ -44,9 +44,9 @@ extern "C" {
  * usually more strict because you're not really supposed to dump/load and
  * upgrade at the same time.
  */
-#define REV_LEVEL      608             /* This version */
+#define REV_LEVEL      609             /* This version */
 #define REV_MIN                591             /* Oldest compatible database */
-#define EXPORT_REV_MIN 608             /* Oldest compatible export files */
+#define EXPORT_REV_MIN 609             /* Oldest compatible export files */
 
 #define SERVER_TYPE 0  /* zero for stock Citadel/UX; other developers please
                           obtain SERVER_TYPE codes for your implementations */
@@ -127,6 +127,7 @@ struct config {
        char c_aide_mailboxes;          /* give Aides access to mailboxes   */
        char c_baseroom[ROOMNAMELEN];   /* Name of baseroom (Lobby)         */
        char c_aideroom[ROOMNAMELEN];   /* Name of aideroom (Aide)          */
+       int c_purge_hour;               /* Hour during which db purges run  */
 };
 
 /*
index 125f805eaec9d35d808ef6ade45e5191de399136..4ceac0a90b7c7e444847cae7b67f5914d14a2a2d 100644 (file)
@@ -70,7 +70,6 @@ SetOutPath "$INSTDIR"
 File C:\cygwin\home\error\cvs\citadel\citserver.exe
 File C:\cygwin\bin\cygz.dll
 File C:\cygwin\home\error\cvs\citadel\base64.exe
-File C:\cygwin\home\error\cvs\citadel\weekly
 File C:\cygwin\home\error\cvs\citadel\setup.exe
 File C:\cygwin\home\error\cvs\citadel\sendcommand.exe
 File C:\cygwin\home\error\cvs\citadel\docs\citadel.html
@@ -122,7 +121,6 @@ Delete /rebootok "$INSTDIR\cygssl-0.9.7.dll"
 Delete /rebootok "$INSTDIR\rxvt.exe"
 Delete /rebootok "$INSTDIR\citserver.exe"
 Delete /rebootok "$INSTDIR\base64.exe"
-Delete /rebootok "$INSTDIR\weekly"
 Delete /rebootok "$INSTDIR\setup.exe"
 Delete /rebootok "$INSTDIR\aidepost.exe"
 Delete /rebootok "$INSTDIR\citmail.exe"
index cb1f819447dc313406e4c96512354777d72e6ec2..bf29d94385239c86e8ddaa9d4e17062fe88f97f5 100644 (file)
@@ -82,7 +82,6 @@ upgrading this package.
 /usr/local/citadel/stats
 /usr/local/citadel/userlist
 /usr/local/citadel/utilsmenu
-/usr/local/citadel/weekly
 /usr/local/citadel/modules/libbio.so
 /usr/local/citadel/modules/libbio.la
 /usr/local/citadel/modules/libchat.so
index b18a71902c4a59a33354f47dda6f639df0dcfdc3..c0aa5336c3361cb6313ea93ee4e1d59492fbca4f 100644 (file)
@@ -564,7 +564,7 @@ AC_SUBST(SERVER_LDFLAGS)
 AC_SUBST(SERVER_LIBS)
 AC_SUBST(SETUP_LIBS)
 AC_CONFIG_HEADER(sysdep.h)
-AC_CONFIG_FILES([Makefile weekly])
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 
 if test -z "$DATABASE"; then
index d206176b6a441ccf5c094f7c26d36788c103566d..9e4c9324b1907d66a91e738f560cc95d05f910fa 100644 (file)
 #include "tools.h"
 #include "serv_upgrade.h"
 
-void do_pre555_user_upgrade(void) {
-        struct pre555user usbuf;
-       struct ctdluser newus;
-        struct cdbdata *cdbus;
-       char tempfilename[PATH_MAX];
-       FILE *fp, *tp;
-       static char vcard[1024];
-
-       lprintf(5, "Upgrading user file\n");
-       fp = tmpfile();
-       if (fp == NULL) {
-               lprintf(1, "%s\n", strerror(errno));
-               exit(errno);
-       }
-       strcpy(tempfilename, tmpnam(NULL));
-
-       /* First, back out all old version records to a flat file */
-        cdb_rewind(CDB_USERS);
-        while(cdbus = cdb_next_item(CDB_USERS), cdbus != NULL) {
-                memset(&usbuf, 0, sizeof(struct pre555user));
-                memcpy(&usbuf, cdbus->ptr,
-                               ( (cdbus->len > sizeof(struct pre555user)) ?
-                               sizeof(struct pre555user) : cdbus->len) );
-                cdb_free(cdbus);
-               fwrite(&usbuf, sizeof(struct pre555user), 1, fp);
-       }
-
-       /* ...and overwrite the records with new format records */
-       rewind(fp);
-       while (fread(&usbuf, sizeof(struct pre555user), 1, fp) > 0) {
-           if (strlen(usbuf.fullname) > 0) {
-               lprintf(9, "Upgrading <%s>\n", usbuf.fullname);
-               memset(&newus, 0, sizeof(struct ctdluser));
-
-               newus.uid = usbuf.USuid;
-               strcpy(newus.password, usbuf.password);
-               newus.flags = usbuf.flags;
-               newus.timescalled = (long) usbuf.timescalled;
-               newus.posted = (long) usbuf.posted;
-               newus.axlevel = (cit_uint8_t) usbuf.axlevel;
-               newus.usernum = (long) usbuf.usernum;
-               newus.lastcall = (long) usbuf.lastcall;
-               newus.USuserpurge = (int) usbuf.USuserpurge;
-               strcpy(newus.fullname, usbuf.fullname);
-               newus.USscreenwidth = (cit_uint8_t) usbuf.USscreenwidth;
-               newus.USscreenheight = (cit_uint8_t) usbuf.USscreenheight;
-
-               putuser(&newus);
-
-               /* write the vcard */
-               snprintf(vcard, sizeof vcard,
-                       "Content-type: text/x-vcard\n\n"
-                       "begin:vcard\n"
-                       "n:%s\n"
-                       "tel;home:%s\n"
-                       "email;internet:%s\n"
-                       "adr:;;%s;%s;%s;%s;USA\n"
-                       "end:vcard\n",
-                       usbuf.USname,
-                       usbuf.USphone,
-                       usbuf.USemail,
-                       usbuf.USaddr,
-                       usbuf.UScity,
-                       usbuf.USstate,
-                       usbuf.USzip);
-
-               tp = fopen(tempfilename, "w");
-               fwrite(vcard, strlen(vcard)+1, 1, tp);
-               fclose(tp);
-
-               CtdlWriteObject(USERCONFIGROOM, "text/x-vcard",
-                       tempfilename, &newus, 0, 1, CM_SKIP_HOOKS);
-               unlink(tempfilename);
-           }
-       }
-
-       fclose(fp);     /* this file deletes automatically */
-}
-
-
-
-
-
-
 
 
 /* 
@@ -234,14 +150,20 @@ void convert_bbsuid_to_minusone(void) {
        return;
 }
 
-
 /*
- * This field was originally used for something else, so when we upgrade
- * we have to initialize it to 0 in case there was trash in that space.
+ * Do various things to our configuration file
  */
-void initialize_c_rfc822_strict_from(void) {
+void update_config(void) {
        get_config();
-       config.c_rfc822_strict_from = 0;
+
+       if (CitControl.version < 606) {
+               config.c_rfc822_strict_from = 0;
+       }
+
+       if (CitControl.version < 609) {
+               config.c_purge_hour = 3;
+       }
+
        put_config();
 }
 
@@ -263,9 +185,15 @@ void check_server_upgrades(void) {
                return;
        }
 
-       if (CitControl.version < 555) do_pre555_user_upgrade();
+       update_config();
+
+       if (CitControl.version < 555) {
+               lprintf(1, "Your data files are from a version of Citadel\n"
+                       "that is too old to be upgraded.  Sorry.\n");
+               exit(EXIT_FAILURE);
+       }
+
        if (CitControl.version < 591) bump_mailbox_generation_numbers();
-       if (CitControl.version < 606) initialize_c_rfc822_strict_from();
        if (CitControl.version < 608) convert_bbsuid_to_minusone();
 
        CitControl.version = REV_LEVEL;
@@ -273,15 +201,6 @@ void check_server_upgrades(void) {
 }
 
 
-
-
-
-
-
-
-
-
-
 char *serv_upgrade_init(void)
 {
        check_server_upgrades();
index c8b2d6a1af52a805882486a30d4b7ff10e8f48f7..8d8bc3202e2c189deed4f62d41366f2859e785ab 100644 (file)
@@ -3,27 +3,3 @@
  *
  */
 
-/*
- * Format of a user record prior to version 5.55
- */
-struct pre555user {                    /* User record                      */
-       int USuid;                      /* userid (==BBSUID for bbs only)   */
-       char password[20];              /* password (for BBS-only users)    */
-       unsigned flags;                 /* See US_ flags below              */
-       int timescalled;                /* Total number of logins           */
-       int posted;                     /* Number of messages posted (ever) */
-       char fullname[26];              /* Name for Citadel messages & mail */
-       char axlevel;                   /* Access level                     */
-       cit_uint8_t USscreenwidth;      /* Screen width (for textmode users)*/
-       cit_uint8_t USscreenheight;     /* Screen height(for textmode users)*/
-       long usernum;                   /* User number (never recycled)     */
-       time_t lastcall;                /* Last time the user called        */
-       char USname[30];                /*                                  */
-       char USaddr[25];                /*                                  */
-       char UScity[15];                /*                                  */
-       char USstate[3];                /*                                  */
-       char USzip[10];                 /*                                  */
-       char USphone[11];               /*                                  */
-       char USemail[32];               /*                                  */
-       int USuserpurge;                /* Purge time (in days) for user    */
-};
index 1608804b5c4df90267c729c64712eeff293338f3..2ef114d4794da676a6afd0aa2150046f0826f3b5 100644 (file)
@@ -282,6 +282,7 @@ void artv_do_export(void) {
        cprintf("%d\n", config.c_max_workers);
        cprintf("%d\n", config.c_pop3_port);
        cprintf("%d\n", config.c_smtp_port);
+       cprintf("%d\n", config.c_purge_hour);
 
        /* Export the control file */
        get_control();
@@ -339,6 +340,7 @@ void artv_import_config(void) {
        client_gets(buf);       config.c_max_workers = atoi(buf);
        client_gets(buf);       config.c_pop3_port = atoi(buf);
        client_gets(buf);       config.c_smtp_port = atoi(buf);
+       client_gets(buf);       config.c_purge_hour = atoi(buf);
        put_config();
        lprintf(7, "Imported config file\n");
 }
index 2113246c3b0e2d9a2dd5687e344382ce0d2cc69c..11dfd1054fd54474c148087dda497e135d213529 100644 (file)
@@ -920,10 +920,11 @@ int main(int argc, char *argv[])
 
        old_setup_level = config.c_setup_level;
 
-       if (old_setup_level == 0)
+       if (old_setup_level == 0) {
                goto NEW_INST;
+       }
 
-       if (old_setup_level < 323) {
+       if (old_setup_level < 555) {
                important_message("Citadel/UX Setup",
                                  "This Citadel/UX installation is too old "
                                  "to be upgraded.");
@@ -931,17 +932,6 @@ int main(int argc, char *argv[])
        }
        write_config_to_disk();
 
-       if ((config.c_setup_level / 10) == 32) {
-               important_msgnum(31);
-               cleanup(0);
-       }
-       if (config.c_setup_level < 400) {
-               config.c_setup_level = 400;
-       }
-       /* end of 3.23 -> 4.00 update section */
-
-       /* end of 4.00 -> 4.02 update section */
-
        old_setup_level = config.c_setup_level;
 
        /* end of version update section */
@@ -961,11 +951,10 @@ NEW_INST:
        mkdir("images", 0700);
        mkdir("netconfigs", 0700);
 
-       /* Delete a bunch of old files from Citadel v4; don't need anymore */
+       /* Delete files and directories used by older Citadel versions */
        system("rm -fr ./chatpipes ./expressmsgs ./sessions 2>/dev/null");
-
-       /* Delete the old citadel.log file; this facility has been removed */
        unlink("citadel.log");
+       unlink("weekly");
 
        check_services_entry(); /* Check /etc/services */
 #ifndef __CYGWIN__