/*
* $Id$
*
- * Citadel/UX setup utility
+ * Citadel setup utility
*
*/
#endif
-#define MAXSETUP 3 /* How many setup questions to ask */
+#define MAXSETUP 4 /* How many setup questions to ask */
#define UI_TEXT 0 /* Default setup type -- text only */
#define UI_SILENT 3 /* Silent running, for use in scripts */
int setup_type;
char setup_directory[SIZ];
char init_entry[SIZ];
+int using_web_installer = 0;
char *setup_titles[] =
{
"Citadel Home Directory",
"System Administrator",
"Citadel User ID",
+ "Server IP address",
"Server port number",
};
"user ID. Please specify that user ID here. You may specify either a\n"
"user name or a numeric UID.\n",
+"Specify the IP address on which your server will run. If you leave this\n"
+"blank, or if you specify 0.0.0.0, Citadel will listen on all addresses.\n"
+"You can usually skip this unless you're running multiple instances of\n"
+"Citadel on the same computer.\n",
+
"Specify the TCP port number on which your server will run. Normally, this\n"
"will be port 504, which is the official port assigned by the IANA for\n"
"Citadel servers. You'll only need to specify a different port number if\n"
"you run multiple instances of Citadel on the same computer and there's\n"
"something else already using port 504.\n",
-"Setup has detected that you currently have data files from a Citadel/UX\n"
+"Setup has detected that you currently have data files from a Citadel\n"
"version 3.2x installation. The program 'conv_32_40' can upgrade your\n"
"files to version 4.0x format.\n"
" Setup will now exit. Please either run 'conv_32_40' or delete your data\n"
if (infp == NULL) {
display_error(strerror(errno));
} else {
- fprintf(infp, "# Start the Citadel/UX server...\n");
+ fprintf(infp, "# Start the Citadel server...\n");
fprintf(infp, "%s:2345:respawn:%s -h%s -x3 -llocal4\n",
entryname, looking_for, setup_directory);
fclose(infp);
int i;
#endif
char buf[SIZ];
- char tempfile[PATH_MAX];
char setupmsg[SIZ];
- strcpy(tempfile, tmpnam(NULL));
strcpy(setupmsg, "");
switch (setup_type) {
break;
case 3:
+ set_str_val(curr, &config.c_ip_addr);
+ break;
+
+ case 4:
set_int_val(curr, &config.c_port_number);
break;
#ifdef HAVE_NEWT
newtInit();
newtCls();
- newtDrawRootText(0, 0, "Citadel/UX Setup");
+ newtDrawRootText(0, 0, "Citadel Setup");
return UI_NEWT;
#endif
return UI_TEXT;
/* set an invalid setup type */
setup_type = (-1);
+ /* Check to see if we're running the web installer */
+ if (getenv("CITADEL_INSTALLER") != NULL) {
+ using_web_installer = 1;
+ }
+
/* parse command line args */
for (a = 0; a < argc; ++a) {
if (!strncmp(argv[a], "-u", 2)) {
setup_type = discover_ui();
}
if (info_only == 1) {
- important_message("Citadel/UX Setup", CITADEL);
+ important_message("Citadel Setup", CITADEL);
cleanup(0);
}
/* Get started in a valid setup directory. */
strcpy(setup_directory, BBSDIR);
- set_str_val(0, setup_directory);
+ if ( (using_web_installer) && (getenv("CITADEL") != NULL) ) {
+ strcpy(setup_directory, getenv("CITADEL"));
+ }
+ else {
+ set_str_val(0, setup_directory);
+ }
+
if (chdir(setup_directory) != 0) {
- important_message("Citadel/UX Setup",
+ important_message("Citadel Setup",
"The directory you specified does not exist.");
cleanup(errno);
}
/* Make sure it's stopped. */
if (test_server() == 0) {
- important_message("Citadel/UX Setup",
+ important_message("Citadel Setup",
"The Citadel service is still running.\n"
"Please stop the service manually and run "
"setup again.");
case UI_TEXT:
printf("\n\n\n"
- " *** Citadel/UX setup program ***\n\n");
+ " *** Citadel setup program ***\n\n");
break;
}
/*
if (setuid(config.c_bbsuid) != 0) {
- important_message("Citadel/UX Setup",
+ important_message("Citadel Setup",
"Failed to change the user ID to your Citadel user.");
cleanup(errno);
}
}
if (old_setup_level < 555) {
- important_message("Citadel/UX Setup",
- "This Citadel/UX installation is too old "
+ important_message("Citadel Setup",
+ "This Citadel installation is too old "
"to be upgraded.");
cleanup(1);
}
write_config_to_disk();
mkdir("info", 0700);
+ chmod("info", 0700);
mkdir("bio", 0700);
+ chmod("bio", 0700);
mkdir("userpics", 0700);
+ chmod("userpics", 0700);
mkdir("messages", 0700);
+ chmod("messages", 0700);
mkdir("help", 0700);
+ chmod("help", 0700);
mkdir("images", 0700);
+ chmod("images", 0700);
mkdir("netconfigs", 0700);
+ chmod("netconfigs", 0700);
/* Delete files and directories used by older Citadel versions */
system("exec /bin/rm -fr ./rooms ./chatpipes ./expressmsgs ./sessions 2>/dev/null");