Explorar el Código

* Updated docs
* Updated main.c with full conf.example
* Fixed a compile type in write_debug()


svn: 175

Bryan Drewery hace 22 años
padre
commit
8862c2db3b
Se han modificado 4 ficheros con 126 adiciones y 91 borrados
  1. 70 0
      doc/INSTALL
  2. 5 69
      doc/README
  3. 22 17
      doc/conf.example
  4. 29 5
      src/main.c

+ 70 - 0
doc/INSTALL

@@ -0,0 +1,70 @@
+
+* The installation process has changed starting at version 1.0.11. 
+* The build currently requires a static TCL 8.0 or newer library. (TCL will be stripped soon)
+
+1. TCL
+2. Pack settings
+3. Compiling
+4. Making bots
+
+Step 1: TCL
+
+If you have already made a static TCL build proceed to Step 2. If you are unsure then keep reading...
+The download website is at:
+	http://www.tcl.tk/software/tcltk/download84.html
+A nice direct link for the tarball is:
+	http://aleron.dl.sourceforge.net/sourceforge/tcl/tcl8.4.4-src.tar.gz
+Once you have it, untar -zxf tcl8.4.4-src.tar.gz
+Then, cd tcl8.4.4/unix
+./configure --disable-shared --prefix=/path/to/your/home --exec-prefix=/path/to/your/home
+Then: make; make install
+
+Step 2: Pack settings
+
+The files listed here are all located in pack/, and will need to be saved for future compiles.
+If you have settings.c, conf.h, or salt.h, place them in pack/
+NOTE: conf.h (pack.conf) from verions previous to 1.0.11 are NOT compatable with 1.0.11 and higher.
+
+conf.h:
+ If you have an older pack.conf, print it out and edit the template pack/conf.h and change accordingly.
+salt.h:
+ This file is generated automatically, if you do not already have one, during compilation
+settings.c:
+ Edit the template pack/settings.c if you don't already have one.
+
+
+Step 3: Compiling
+
+For leaf build: ./build leaf
+For hub build: ./build hub
+To build both: ./build all
+To compile a debug version of the pack, add -d in as a option before the type.
+ ie, ./build -d leaf
+
+During the compile process many warnings may appear on screen, ignore them. Only report ERRORS please.
+After the compile process is finished, the binaries will be placed in wraith.OS.version.tgz.
+ The OS and version are dynamic depending on the pack build, type 'ls' to find exact name.
+
+
+Step 4: Making bots
+
+NOTE: conf files from versions older than 1.0.11 still work, but improvements have been made.
+
+read over doc/conf.example.
+This file can be made by the bot binary with ./binary -g filename
+Edit the conf (conf.example or the generated one, doesnt matter)
+For leaf bots, encrypt the conf as '.known_hosts'
+For hub bots, encrypt the conf as 'conf'
+Thie is done by: ./binary -e infile outfile
+tar -czvf somebot.tgz .known_hosts binary
+(or for hub): tar -czvf somehub.tgz conf binary
+then upload somebot.tgz to whatever shell..
+
+LEAF:
+untar, mkdir ~/.ssh;mv .known_hosts ~/.ssh/.known_hosts
+then just run the leaf binary, it will move itself to: ~/.sshrc
+
+HUB:
+untar, ./binary 
+This is assuming the conf is already encrypted as 'conf', if not, move it to 'conf'.
+The binary can be named ANYTHING, just as long as the encrypted conf is known as 'conf' in the same dir

+ 5 - 69
doc/README

@@ -1,69 +1,10 @@
-wraith by bryan (see CREDITS)
-
-This was rushed, so its not as simple as I'd like it to be..
-Read all of this through, then try what it says, if you fail, try again and make sure you are doing it correctly, if so
-then ask bryan: AIM: Bryan M Drewery
-
-First, get tcl 8.4..
-	http://www.tcl.tk/software/tcltk/download84.html
-	http://aleron.dl.sourceforge.net/sourceforge/tcl/tcl8.4.4-src.tar.gz
-Then, untar it, cd to the dir, cd unix, ./configure --prefix=/home/YOU --exec-prefix=/home/YOU --disable-shared
-
-Now, go back to the pack dir..
-Edit bldall, at the top change the directory to your homedir
-next, gcc -o makesalt makesalt.c
-./makesalt
-mv salt.h src/
-edit src/settings.c
-Edit pack.cfg (dont change anything in this actually.)
-Now, ./build all pack
-Ignore any warnings, any errors report to bryan
-There are your binaries for the OS you compiled on..: leaf, hub
-
-DONT LOSE: settings.c salt.h
-
-
-Making bots:
-edit conf, (it has instructions in it)
-then, ./binary -e conf .known_hosts (either binary is fine, -d would decrypt.)
-tar -czvf somebot.tgz .known_hosts binary
-then upload somebot.tgz to whatever shell..
-LEAF:
-untar, mkdir ~/.ssh;mv .known_hosts ~/.ssh
-Binary: ~/.sshrc
-Conf: ~/.ssh/.known_hosts
-./leaf
-HUB:
-untar, mv .known_hosts conf;./hub
-Binary: /wheverever/you/want // just make sure the file conf is in the same dir
-Conf: /where/you/put/your/hub/conf
-
-You can do ./binary -d /path/to/conf somefile, and edit it on the shell of course to add more bots or change vhosts...
-The hub conf is /path/to/hubdir/conf
-the leaf conf is /home/you/.ssh/.known_hosts
-Dont forget to encrypt them :)
-
-UPDATING:
-Get the new src from bryan.
-Copy your salt.h, settings.c and bldall files and put them in their respect directories in the untarred newsrc..
-./bldall pack
-./leaf -v
-(uname -s)
-cp leaf leaf.Os.ver
-cp hub hub.Os.hub
-Set a hub +U 
-Then on that hub, copy all the binaries for the new version to it's dir..
-whatever os you are in, copy the appropiate new hub binary to 'newhub', then on the hub, type .update newhub
-Sit back and cry as all the bots die probably.. nah j/k
-
-This will all be improved over time, and you won't need to redo your entire net ever...
 
 Channel modes:
 	Read eggdrop docs.
 	Additions:
 	+/-fastop, -fastop does cookieops
-	+voice voices all except +q users and people that > |+m devoice
-	+closed is like +locked (kicks all non-users and keeps +i set)
+	+voice voices all except +q users and people that > m|+m devoice
+	+closed is like ghost's +locked (kicks all non-users and keeps +i set)
         +nomop Kicks users who set +ooo*
 	Anything not listed here or in eggdrop docs is not finished.
 
@@ -89,8 +30,6 @@ Only +a can give certain flags, I forget which ones, but you'll figure that out
                    Better idea to just set a few leafs +c and tell your users.
    d       d       auto deop (never +o)
    e       e       exempt from stopnethack //useless
-   f       f       friend
-   h               highlighting //useless
    i               hub access
    j               leaf chat hub access
    k       k       autokick (never on chan)
@@ -100,11 +39,9 @@ Only +a can give certain flags, I forget which ones, but you'll figure that out
    o       o       op
    p               partyline chat access (-p wont be able to talk)
    q       q       quiet (never +v)
-   s               bot is sec hub (NOT FUNCTIONAL YET, DO NOT SET)
    u               bot is the updatehub (MAKE SURE IT HAS OOGLES OF BW)
    v       v       auto-voice
-   w       w       bot gives autovoice
-   x       x       users is exempt for flood kicks
+   x       x       user is exempt from flood kicks
    y       y       bot gives out voices
 
 
@@ -117,6 +54,5 @@ important console modes:
 	+w wallops
 	+c cmds
 	+b bots
-set with !console +abcde...
-
-
+	+d debug (You probably won't want to see all of this)
+set with .console +abcde

+ 22 - 17
doc/conf.example

@@ -1,25 +1,30 @@
-#when you make the bot, remove these #lines :)
+#All lines beginning with '#' will be ignored during the bot startup. They are comments only.
 #These lines MUST be correctly syntaxed or the bot will not work properly.
-#A conf can be only a hub conf or only a leaf conf. (see README for locations)
-#The first line must contain UID (use "id" in shell to get uid)
+#A hub conf is located in the same dir as the hub binary, as 'conf' (encrypted)
+#A leaf conf is located at '~/.ssh/.known_hosts' (encrypted)
+#
+#Note the "- " and "+ " for the following items, the space is REQUIRED.
+#The first line must be the UID of the shell the bot is to be run on. (use "id" in shell to get uid)
 #- 1113
 #The second must be the output from uname -nv (-nr on FBSD)
 #+ somebox #1 SMP Thu May 29 06:55:05 EDT 2003
-#any lines after should be in this format:
-#botnick [!]ip4 [+]hostname IPv6-ip (the + means ipv6) 
-#If there is no hostname for the ipv6 ip, just put a "." in place of hostname.
+#
+#The following line will disable ps cloaking on the shell if you compiled with S_PSCLOAK
+#!-
+#The rest of the conf is for bots and is in the following syntax:
+#botnick [!]ip4 [+]hostname IPv6-ip
+#A . (period) can be used in place of ip4 and/or hostname if the field is not needed. (ie, for using only an ipv6 ip)
 #(the ! means internal NAT ip address, IE: 10.10.0.3, Hostname REQUIRED)
 #Full example:
 #- 101 
 #+ somebox 5.1-RELEASE
-#wraith 66.34.23.123 66-34-23-123.roc.mn.charter.com
-#leetbot 66.34.23.123 +ipv6.uber.leet.la
-#modem 66.34.23.124 some.ipv4.vhost.at.wraith.net
-- 501
-+ veritas #1 SMP Thu May 29 06:55:05 EDT 2003
-!- //This will disable 'ps' cloaking on the shell
-sbptest 66.188.213.191 66-188-213-191.roc.mn.charter.com
-updated 66.188.213.191 66-188-213-191.roc.mn.charter.com
-elinked 66.188.213.191 66-188-213-191.roc.mn.charter.com
-ipv6bot 66.188.213.191 +somehost 1:2:3:4::0
-ipv6b0t 66.188.213.191 . 1:2:3:4::5
+#bot1 1.2.3.4 some.vhost.com
+#bot2 . +ipv6.uber.leet.la
+#bot3 . +another.ipv6.host.com 2001:66:669:3a4::1
+#bot4 1.2.3.4 +someipv6.host.com
+
+
+
+
+
+#if there are any trailing newlines at the end, remove them up to the last bot.

+ 29 - 5
src/main.c

@@ -274,7 +274,7 @@ void write_debug()
     nested_debug = 1;
 
   snprintf(tmpout, sizeof tmpout, STR("* Last 3 contexts: %s/%d [%s], %s/%d [%s], %s/%d [%s]"),
-                                  cx_file[cx_ptr-2], cx_line[cx_ptr-2], cx_note[cx_ptr-2][0] ? cx_note[cx_ptr-2] : ""
+                                  cx_file[cx_ptr-2], cx_line[cx_ptr-2], cx_note[cx_ptr-2][0] ? cx_note[cx_ptr-2] : "",
                                   cx_file[cx_ptr-1], cx_line[cx_ptr-1], cx_note[cx_ptr-1][0] ? cx_note[cx_ptr-1] : "",
                                   cx_file[cx_ptr], cx_line[cx_ptr], cx_note[cx_ptr][0] ? cx_note[cx_ptr] : "");
   putlog(LOG_MISC, "*", "%s", tmpout);
@@ -535,10 +535,32 @@ void gen_conf(char *filename)
     fatal("File already exists..", 0);
   
   fp = fopen(filename, "w+");
-  fprintf(fp, "#Template config file, not too hard to memorize!\n#Do not put the '//comments' into the actual config..\n");
-  fprintf(fp, "- uid //obtained by running 'id'\n");
-  fprintf(fp, "+ uname //obtained by running 'uname -nr' (freebsd) or 'uname -nv' (linux)\n");
-  fprintf(fp, "botname ip4 +host ip6 //use + for ipv6 hostname, ip/host can be replaced with '.' if needed\n");
+
+  fprintf(fp, STR("#All lines beginning with '#' will be ignored during the bot startup. They are comments only.\n"));
+  fprintf(fp, STR("#These lines MUST be correctly syntaxed or the bot will not work properly.\n"));
+  fprintf(fp, STR("#A hub conf is located in the same dir as the hub binary, as 'conf' (encrypted)\n"));
+  fprintf(fp, STR("#A leaf conf is located at '~/.ssh/.known_hosts' (encrypted)\n"));
+  fprintf(fp, STR("#\n"));
+  fprintf(fp, STR("#Note the \"- \" and \"+ \" for the following items, the space is REQUIRED.\n"));
+  fprintf(fp, STR("#The first line must be the UID of the shell the bot is to be run on. (use \"id\" in shell to get uid)\n"));
+  fprintf(fp, STR("#- 1113\n"));
+  fprintf(fp, STR("#The second must be the output from uname -nv (-nr on FBSD)\n"));
+  fprintf(fp, STR("#+ somebox #1 SMP Thu May 29 06:55:05 EDT 2003\n"));
+  fprintf(fp, STR("#\n"));
+  fprintf(fp, STR("#The following line will disable ps cloaking on the shell if you compiled with S_PSCLOAK\n"));
+  fprintf(fp, STR("#!-\n"));
+  fprintf(fp, STR("#The rest of the conf is for bots and is in the following syntax:\n"));
+  fprintf(fp, STR("#botnick [!]ip4 [+]hostname IPv6-ip\n"));
+  fprintf(fp, STR("#A . (period) can be used in place of ip4 and/or hostname if the field is not needed. (ie, for using only an ipv6 ip)\n"));
+  fprintf(fp, STR("#(the ! means internal NAT ip address, IE: 10.10.0.3, Hostname REQUIRED)\n"));
+  fprintf(fp, STR("#Full example:\n"));
+  fprintf(fp, STR("#- 101\n"));
+  fprintf(fp, STR("#+ somebox 5.1-RELEASE\n"));
+  fprintf(fp, STR("#bot1 1.2.3.4 some.vhost.com\n"));
+  fprintf(fp, STR("#bot2 . +ipv6.uber.leet.la\n"));
+  fprintf(fp, STR("#bot3 . +another.ipv6.host.com 2001:66:669:3a4::1\n"));
+  fprintf(fp, STR("#bot4 1.2.3.4 +someipv6.host.com\n"));
+  fprintf(fp, STR("\n\n\n\n#if there are any trailing newlines at the end, remove them up to the last bot.\n"));
   fflush(fp);
   fclose(fp);
   printf("Template config created as '%s'\n", filename);
@@ -937,6 +959,8 @@ Context;
   sdprintf("got_Ed called: -%s i: %s o: %s", which, in, out);
   if (!in || !out)
     fatal("Wrong number of arguments: -e/-d <infile> <outfile/STDOUT>",0);
+  if (!strcmp(in, out))
+    fatal(STR("<infile> should NOT be the same name as <outfile>"), 0);
   check_static("blowfish", blowfish_start);
   module_load(ENCMOD);
   if (!strcmp(which, "e")) {