home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / HOSTBBS.ARJ / HOSTBBS.DOC < prev    next >
Encoding:
Text File  |  1990-01-29  |  22.2 KB  |  499 lines

  1.  
  2. HOSTBBS:
  3. A General Purpose BBS Program in SALT
  4.  
  5.  
  6. 1.      Introduction:
  7.  
  8.         TELIX is a very popular communication program on IBM PC.  It
  9. is published by Exis Inc. in Canada.  TELIX has a very powerful script
  10. language -- SALT (Script Application Language for Telix).  The
  11. following is a description of a general-purpose BBS (Bulletin Board
  12. System) program written entirely in SALT.
  13.  
  14.         There are several sample programs written in SALT distributed
  15. with TELIX.  One of them is HOST.SLT.  TELIX manual calls it "host
  16. mode of TELIX" when it is run.  It lets a caller dial up and get access to
  17. files and data in a remote IBM PC.  However, the "host mode" offered
  18. by TELIX's HOST is too crude to be called a  BBS.  Therefore, I made
  19. some drastic changes to HOST, converting it into a somewhat complete,
  20. general-purpose BBS program.  I call it HOSTBBS.
  21.  
  22.         HOSTBBS lets a user dial up, get on-line, download/upload files,
  23. enter/read messages, read bulletins, and chat with sysop.  A HOSTBBS
  24. sysop can do all the things that an average user can do; besides,
  25. he/she can enter DOS shell, reboot computer, examine each part of the
  26. hard disk, and force a user into the chat mode from the host PC.
  27.  
  28.         HOSTBBS has many functions found in many other BBS.  For
  29. example, it sets a user's online time to 60 minutes; however, sysop can
  30. change this easily.  HOSTBBS also checks if a user doesn't do anything
  31. for a preset period of time.  It will cut off the line if users just don't do
  32. anything.  However, sysop does not have this "timeout" limit when
  33. he/she calls HOSTBBS remotely.
  34.  
  35.         I will distribute the source program of HOSTBBS (in SALT) as a
  36. public domain software in the future.  In the mean time, I will set up
  37. a BBS based on HOSTBBS.  This BBS is called "Mackey Mouse" since I
  38. am also a Macintosh user.  And all the files and messages in Mackey
  39. Mouse are about Macintosh.  You may call Mackey Mouse if you use
  40. Macintosh and you want to see how HOSTBBS looks like.
  41.  
  42.         The following sections describe the details of setting up a
  43. HOSTBBS.  Only sysop needs to read them.  A user is not required to
  44. read those details since HOSTBBS, once setup, is very easy to use.
  45.  
  46.  
  47.  
  48. 2.      How to Set Up HOSTBBS In Hard Disk
  49.  
  50.         HOSTBBS should be set up on an IBM PC with a hard disk.  You
  51. should make a subdirectory named "HOSTBBS" in the root directory of
  52. hard disk.  (C:\HOSTBBS)  This subdirectory is used to hold all the
  53. necessary files (programs, data files, message files, and configuration
  54. files).  The name of this subdirectory is not defined in the
  55. HOSTBBS.SLT source file.  Sysop may use a different name and put all
  56. the needed files in that subdirectory.  The following is a list of all the
  57. needed files in this subdirectory:
  58.  
  59.         Program files:
  60.         TELIX.EXE       the Telix program, used to run the HOSTBBS script
  61.         HOSTBBS.SLC     HOSTBBS script compiled from HOSTBBS.SLT by CS.EXE
  62.         CHATMODE.SLC    chat mode script compiled from CHATMODE.SLT
  63.  
  64. (The above 3 files are not distributed with this package.  You may get
  65. TELIX.EXE from other popular BBS.  And you should use CS.EXE to
  66. compile HOSTBBS.SLT and CHATMODE.SLT into HOSTBBS.SLC and
  67. CHATMODE.SLC.  All the following files are in the distributed package.)
  68.  
  69.         RESET.COM       small program used to re-boot IBM PC
  70.  
  71.         Data files:
  72.         USERLIST.TXT    user list file used by HOSTBBS
  73.         LOGON.LST       user logon list maintained by HOSTBBS
  74.         HOSTBBS.LOG     detailed logon session maintained by HOSTBBS
  75.  
  76. (Also, the above 3 files are not part of the distributed package.
  77. HOSTBBS will create them automatically.)
  78.  
  79.         FILES.DIR       listing of existing files in the file area
  80.  
  81.         Configuration files:
  82.         ANSI.KEY        key definition used by TELIX to emulate ANSI terminal
  83.         CLRHOST.CNF     configuration file used by TELIX
  84.  
  85.         Message files:
  86.         ASKANSI.TXT     hello screen asking for ANSI mode or TTY mode
  87.         ---------------
  88.         QUESTION.MSG    question hello screen, to be seen by first-time user
  89.         LOGO.MSG        first hello screen, usually BBS logo is put in this file
  90.         WELCOME.MSG     second hello screen, usually a brief description of BBS
  91.         TLXBYE.MSG      bye-bye message, to be seen when log-off
  92.         HELP.MSG        help screen, to be displayed when user needs help
  93.         BLTN.MSG        title bulletin message
  94.         ---------------
  95.         QUESTION.TTY    TTY version of QUESTION.MSG
  96.         LOGO.TTY        TTY version of LOGO.MSG
  97.         WELCOME.TTY     TTY version of WELCOME.MSG
  98.         TLXBYE.TTY      TTY version of TLXBYE.MSG
  99.         HELP.TTY        TTY version of HELP.MSG
  100.         BLTN.TTY        TTY version of title bulletin message
  101.  
  102.         Bulletin files:
  103.         BLTN_x.MSG      x is a number from 1 to 20
  104.  
  105.         Program files are used to run HOSTBBS under TELIX.
  106.  
  107.         Data files are maintained or used by HOSTBBS.
  108.  
  109.         Configuration files are used by TELIX to set up terminal mode.
  110.  
  111.         Message files are used to display screen contents to the user.
  112. Bulletin files are also used to display some information.  Sysop may
  113. modify message files and bulletin files to change the outlook of
  114. HOSTBBS.  And this is how each sysop put  his/her own personal
  115. character into HOSTBBS.
  116.  
  117.         In addition to this C:\HOSTBBS\ subdirectory, three more
  118. subdirectories must also be set up in the root of hard disk.  One for the
  119. file area, one for the message area, and another for the uploaded file.
  120. File area is where users download files.  Message area is where users
  121. write messages.  Upload area is where uploaded files go.  Each one of
  122. the three subdirectories must be present or else the HOSTBBS program
  123. will not function normally.  HOSTBBS defines three standard
  124. subdirectories:
  125.  
  126.         C:\BBSFILES\    standard file area
  127.         C:\BBSUPLDS\    standard upload area
  128.         C:\BBSMSG\      standard message area
  129.  
  130.         The name of standard file area is defined in the global string
  131. variable HOST_DOWNLOADS[], which has the value "C:\BBSFILES\".
  132. The name of standard upload area is defined in the global string
  133. variable HOST_UPLOADS[], which has the value "C:\BBSUPLDS\".  The
  134. name of standard message area is defined in the global string variable
  135. HOST_MESSAGE[], which has the value "C:\BBSMSG\".  The names of
  136. these three subdirectories can be changed by changing the value of
  137. their corresponding string variables in HOSTBBS.SLT, then recompiling
  138. the file to HOSTBBS.SLC.
  139.  
  140.         In summary, each hard disk has four subdirectories for use by
  141. HOSTBBS;  C:\HOSTBBS\ is where all HOSTBBS files reside.
  142. C:\BBSFILES\ is where files for downloading reside.  C:\BBSUPLDS\ is
  143. where uploaded files go.  C:\BBSMSG\ is where BBS messages are
  144. placed.  The names of those four subdirectories can be changed by
  145. sysop who prefer using different names as defined in the original
  146. HOSTBBS.SLT source program.  Of course, you must re-compile the
  147. source program if you decided to use different names.
  148.  
  149.  
  150.  
  151. 3.      User ID and Password
  152.  
  153.         Each user has a unique ID and password in each HOSTBBS
  154. system.  This information is kept in the file USERLIST.TXT.  Whenever
  155. a user calls HOSTBBS, HOSTBBS will ask for an ID.  Then HOSTBBS
  156. searches USERLIST.TXT to see if this ID can be found in this file.
  157. HOSTBBS knows this user is a first-time caller if the ID entered is not
  158. found in USERLIST.TXT.  HOSTBBS will ask for a matching password if
  159. this ID is found in USERLIST.TXT, ensuring the uniqueness of user ID.
  160.  
  161.         USERLIST.TXT is not distributed with the HOSTBBS package
  162. since this file will be created by HOSTBBS automatically.
  163.  
  164.         HOSTBBS keeps only two access levels, which are determined by
  165. the ID and password.  One is for the average users, the other one is for
  166. the sysop.
  167.  
  168.         Sysop (System Operator) of HOSTBBS has complete control over
  169. the entire computer.  In addition to average users' access level, he/she
  170. can enter DOS shell, download from any subdirectory, reboot the
  171. computer, and see any file he/she is interested in.  When sysop is
  172. sitting by the host computer and a user is on-line, he/she can force
  173. the user into the chat mode, terminate the calling session, start
  174. capturing the session, peep the user's personal data, or reset the user's
  175. time to default (60 minutes).
  176.  
  177.         Because sysop has such a privilege to control over the host
  178. computer remotely, HOSTBBS keeps a unique ID and password for
  179. sysop to guard against inappropriate access to the computer system.
  180. This unique ID and password is "hard-coded" into the HOSTBBS
  181. system; i.e. defined in the source program of HOSTBBS.SLT.  Each sysop
  182. MUST choose his/her own ID and passwords, change the system's
  183. corresponding global string variables, and recompile the HOSTBBS
  184. script program before he/she can open the BBS to the public.
  185.  
  186.         Here is how to do it.
  187.  
  188.         HOSTBBS defines one sysop ID in every system.  This sysop ID
  189. has two parts: first name and last name.  First name is defined by the
  190. global string variable SYSOP_FIRST[] while last name is defined by
  191. the global string variable SYSOP_LAST[].  These two variables
  192. together define the sysop ID used in HOSTBBS.
  193.  
  194.         HOSTBBS also defines two more passwords for sysop: one for
  195. sysop to gain access to the system, the other for sysop to enter DOS
  196. shell or to reboot the computer.  The former is defined in the global
  197. string variable SYSOP_PASSWORD[], the latter is defined in the global
  198. string variable SHELLPASS[].
  199.  
  200.         Remember, the version of HOSTBBS.SLT you received should not
  201. have defined anything ("dummy") in the above variables for sysop ID
  202. and passwords.  You MUST define them and recompile the program
  203. before you can set up your own HOSTBBS system.
  204.  
  205.         In summary, four string variables in HOSTBBS.SLT define sysop
  206. ID and passwords:
  207.  
  208.         SYSOP_FIRST[] defines first name of sysop ID
  209.         SYSOP_LAST[] defines last name of sysop ID
  210.         SYSOP_PASSWORD[] defines password of sysop
  211.         SHELLPASS[] defines password to reboot computer or to enter DOS shell
  212.  
  213.  
  214.  
  215. 4.      Files for Uploading/Downloading in HOSTBBS
  216.  
  217.         HOSTBBS keeps one file area for users to download.  The name
  218. of the file directory is defined by the global string variable
  219. HOST_DOWNLOADS[].  Users may see file list by invoking the (L)ist
  220. command in the (F)ile sub-command.  What an average user sees is
  221. actually a text file prepared by sysop.  Sysop should put whatever
  222. he/she wants the user to see in this text file, typically a listing of file
  223. names, size, and description about those files.
  224.  
  225.         What sysop sees when he/she invoke the (L)ist command is
  226. somewhat different from that of average users.  Sysop can see actual
  227. listing of the files in the file area, somewhat similar to typing DIR
  228. under DOS.  Wildcard is also supported for sysop.  Besides, TELIX will
  229. also calculate the estimated transfer time according to the total size of
  230. listed files and current modem speed.
  231.  
  232.         HOSTBBS's first command is the (F)ile command.  This command
  233. is for (L)isting files in the file area, (U)ploading files,  (D)ownloading
  234. files, or (T)yping a text file on screen to see its contents.  TELIX offers
  235. many file transfer protocols for uploading/downloading files.  Users
  236. may choose one protocol after requesting uploading or downloading
  237. functions.
  238.  
  239.         As previously said, sysop can get access to any part of the hard
  240. disk.  The biggest difference between an average user and a sysop
  241. when invoking the (F)ile command is that sysop can:
  242.  
  243.         1. Download files from any part of the hard disk by entering
  244. drive name, path name, and file name.  For example, when HOSTBBS
  245. asks sysop to enter a file name to download, he/she can just enter a
  246. file name for the file in the default file area; or he/she can enter
  247. C:\DOS\UTILITY\SORT.* to download another file in another deeply
  248. nested subdirectory.  Only sysop is allowed to do this.
  249.  
  250.         2. List files in any part of the hard disk.  Wild card characters
  251. are also allowed.  If only RETURN is entered when he/she is prompted
  252. with file name request, the default file list text file (FILES.DIR) is
  253. displayed as usual.  But he/she can also type
  254. C:\LETTER\ORDER*.TXT to list all files with .TXT extension in the
  255. subdirectory LETTER.
  256.  
  257.         Uploaded file goes to the same directory, whether it is uploaded
  258. by an average user or sysop.
  259.  
  260.         The consistence of files in file area and text file FILES.DIR is a
  261. somewhat tricky task for sysop.  Sysop must make effort to maintain
  262. this consistence; otherwise, what the users see in FILES.DIR may not
  263. be the same with what are actually in the file area.  For example, if
  264. the file FOO.TXT is removed from the file area while text file FILES.DIR
  265. still keeps the entry for FOO.TXT, users can't download FOO.TXT even
  266. he/she can still see the entry which is actually only a line of text in
  267. the file FILES.DIR.  So it is a sysop's responsibility to maintain the
  268. consistence of file area and FILES.DIR.
  269.  
  270.  
  271.  
  272.  
  273. 5.      Message area of HOSTBBS
  274.  
  275.         Message area of HOSTBBS contains all the messages entered by
  276. users.  The on-line line-oriented text editor is implemented with the
  277. inspiration of GT Powercomm's text editor in mind.  Any one familiar
  278. with GT-based BBS should feel at home when using this editor to enter
  279. message.
  280.  
  281.         I didn't add some useful functions yet.  For example, you can't
  282. quote other's message when writing a reply message.  It shall be
  283. added in the next release of HOSTBBS.
  284.  
  285.  
  286.  
  287.  
  288. 6.      System Functions of HOSTBBS
  289.  
  290.         HOSTBBS has three system commands, one for average users
  291. and two for the sysop.
  292.  
  293.         Users can (P)age the sysop for a chat.  Sysop may grant the
  294. request by pressing F1 to enter chat mode or any other keys to deny
  295. the request.  HOSTBBS will be back to BBS mode 20 seconds after user
  296. pages sysop.
  297.  
  298.         Users can also see the logon list which is actually a text file
  299. maintained by HOSTBBS.  Logon-logoff data/time, modem speed, ANSI
  300. mode, and user names are listed on the screen.  A "*" mark between
  301. modem speed and ANSI mode indicates an abnormal logoff, such as
  302. accidental hang-up or failed logon.
  303.  
  304.         Users may also change ANSI mode from On to Off or vise versa
  305. during the logon session.
  306.  
  307.         Sysop may enter DOS shell remotely or reboot computer
  308. remotely.
  309.  
  310.         Why do we need to reboot computer remotely, anyway?
  311.  
  312.         Well, this function is actually a "system patch" for earlier
  313. version of HOSTBBS when it is being developed under TELIX 3.10.
  314. That version of TELIX had trouble finding file handle after invoking
  315. DOS shell several times and this made a sysop impossible to invoke
  316. DOS shell several times later.  This function gives sysop a chance to
  317. reboot the system remotely and the whole HOSTBBS system is started
  318. by a batch file.  Although the problem of losing file handle is cured in
  319. TELIX 3.12, this function is retained, anyway.
  320.  
  321.         Another improvement over the DOS shell function is the support
  322. for DOORWAY by TELIX 3.12.  The original HOST program enters DOS
  323. shell very similar to the CTTY COM under DOS.  This method is
  324. somewhat undesirable.  The whole system will be locked up if the
  325. modem linkage is suddenly lost during the DOS shell session.  Local
  326. computer will print "Read/Write error in COM:  A)bord R)etry
  327. I)gnore".  The only way to get out of this condition is to type some
  328. keys from the local computer.  And this is of course not very robust
  329. for an unattended, self-running BBS system.  On the other hand,
  330. DOORWAY will reboot the computer if modem linkage is lost, thus
  331. giving the system a chance to restart HOSTBBS from a batch file.
  332.  
  333.  
  334.  
  335.  
  336. 7.      Bulletin Functions of HOSTBBS
  337.  
  338.         Bulletin is an area where sysop can tell users useful
  339. information, system-specific information, updated files, or anything
  340. sysop likes to let users know.
  341.  
  342.         HOSTBBS reserves 20 vacant "slots" for this function and they
  343. are numbered from 1 to 20.  Each slot is for one bulletin text file.
  344. Here's how to set up the bulletin by yourself.
  345.  
  346.         The main bulletin screen showing all 20 available bulletins is
  347. actually a text file named "BLTN.MSG".  It can be edited with any text
  348. editor, and adding a new bulletin or changing the title of an existing
  349. bulletin is straight forward.  Just use your text editor, open BLTN.MSG,
  350. type over the proper positions for that bulletin, then save it with the
  351. original name.
  352.  
  353.         Other bulletin files are named with their corresponding bulletin
  354. numbers.  For example, bulletin number one is simply named
  355. BLTN_1.MSG, bulletin number two is named BLTN_2.MSG, etc.  Each
  356. one is a text file to be displayed when user invokes the bulletin
  357. function and types a bulletin number.
  358.  
  359.  
  360.  
  361.  
  362.  
  363. 8.      Special Functions for Sysop
  364.  
  365.         Current version of HOSTBBS offers four special functions for
  366. sysop -- the Chat mode function, Display user data function, Text-
  367. capturing function, and Reset-time functions.  This section describes
  368. these functions in detail.
  369.  
  370.         (1)     The Chat Mode -- F1 & F2
  371.  
  372.         HOSTBBS is said to be in HOST mode when a user calls it and
  373. gets on-line.  Many functions are offered in this mode.  However,
  374. sysop can also make HOSTBBS enter the Chat mode by pressing F1 at
  375. any time.  This mode is used for user and sysop to talk (chat) to each
  376. other through computer or terminal keyboard.  Everything typed on
  377. the keyboard will be echoed on the screen and be sent to remote
  378. terminal.  Everything comes in through the communication port will
  379. be displayed on screen.  Sysop and user may talk to each other in this
  380. electronic manner.
  381.  
  382.         The only way to leave chat mode and back to HOST mode is
  383. pressing F2 key.  It is of no use if user pressed F2 key on the remote
  384. terminal/computer.  Only sysop can use F2 key to get back to HOST
  385. mode.
  386.  
  387.         F1/F2 keys are also used to enter chat mode when sysop is
  388. "paged" by the user.  F1 key is used to enter chat mode while F2 key
  389. is used to get out of chat mode.
  390.  
  391.  
  392.         (2)     Displaying User's Data -- F3
  393.  
  394.         User's basic data is kept in the file USERLIST.TXT by HOSTBBS.
  395. Sysop may see a caller's personal data by pressing F3 key while
  396. HOSTBBS is in HOST mode.  A small "window" on screen displays
  397. current caller's name, age, occupation, password, and telephone
  398. number.  This function is useful if sysop wants to know who is the
  399. current user.
  400.  
  401.  
  402.         (3)     Text-capturing -- F4 & F5
  403.  
  404.         Sysop may tell HOSTBBS, which is run under TELIX, to start
  405. capturing screen contents by pressing F4 key at any time.  Pressing F4
  406. key again while text-capturing is in effect will terminate text-
  407. capturing of HOSTBBS.  Sysop may also press F5 key while text-
  408. capturing is in effect to suspend the process; pressing F5 key again
  409. restores text-capturing (pause and unpause).
  410.  
  411.         It is of no use to press F5 key when HOSTBBS is not capturing
  412. anything.
  413.  
  414.         Captured text file is named "HOSTBBS.CAP" and you may use
  415. any text editor to use that file.
  416.  
  417.  
  418.         (4)     Reset User's Remaining On-line Time -- F6
  419.  
  420.         Each user's on-line time is set to 60 minutes.  However, sysop
  421. may reset this time by pressing F6 at any time.  A short message in a
  422. small window tells sysop that user's remaining on-line time has been
  423. reset.
  424.  
  425.  
  426.         In summary, four special functions are provided by current
  427. version of HOSTBBS:
  428.  
  429.         Enter and leave chat mode -- F1 & F2
  430.         Display user's Data -- F3
  431.         Enable and disable text-capturing -- F4 & F5
  432.         Reset on-line time limit -- F6
  433.  
  434.  
  435.  
  436. 9.      The ANSI Problems
  437.  
  438.         HOSTBBS supports ANSI mode if user's terminal or computer
  439. supported it. ANSI code is a kind of escape sequence used to control
  440. screen display, such as color, cursor position, character attribute, and
  441. so on.  If user replied "Y" to the question asking for ANSI mode,
  442. HOSTBBS will display ANSI characters throughout the whole session
  443. until log-off or user disables ANSI mode during the session.
  444.  
  445.         Attention Macintosh users: I will set up a BBS dedicated to all
  446. Macintosh users.  However, most EARLY communication programs on
  447. Macintosh does not support ANSI mode; but latest programs do.
  448. ZTerm 0.85, the most often used shareware in this category is
  449. recommended when you want to call HOSTBBS with Macintosh.  ZTerm
  450. 0.85 supports full set of ANSI code.  It can even display colors if you
  451. are using it on a Macintosh II with a color monitor.  I use my
  452. Macintosh II to test HOSTBBS and it works perfectly fine.  Highly
  453. recommended!!!
  454.  
  455.         Several text files have two versions with identical contents, one
  456. has embedded ANSI codes while the other one doesn't.  The one with
  457. embedded with ANSI codes have ".MSG" as the file extension; the one
  458. without ANSI codes has file extension ".TTY".  HOSTBBS will decide
  459. which text file to display according to current setting of ANSI mode.
  460. Files with ".MSG" will be displayed if current ANSI mode is on and the
  461. ones with ".TTY" will be displayed if current ANSI mode is off.  Text
  462. files with two versions are listed below:
  463.  
  464.         ANSI version         Plain Text version
  465.  
  466.         LOGO.MSG             LOGO.TTY
  467.         BLTN.MSG             BLTN.TTY
  468.         HELP.MSG             HELP.TTY
  469.         QUESTION.MSG         QUESTION.TTY
  470.         TLXBYE.MSG           TLXBYE.TTY
  471.         WELCOME.MSG          WELCOME.TTY
  472.  
  473.  
  474. ---------------------------------------------------------
  475.  
  476.         That's all folks.  I believe this humble BBS will be useful for
  477. some hackers, office users, or evangelists for TELIX.  HOSTBBS
  478. provides most of the important, though not necessarily powerful,
  479. functions of a general-purpose BBS.  Typical usage of HOSTBBS may be
  480. an office user who wants to get access to his computer at home.
  481. Without dealing with all the hassles of setting up a full-scale BBS like
  482. GT or Fido, he/she can set up HOSTBBS within 10 minutes.  And
  483. he/she can still lets his/her colleagues have limited access to this
  484. family BBS.
  485.  
  486.         You are seeing a humble BBS in its very early days.  Any
  487. comment for improvement or enhancement is welcome.  The author
  488. can be contacted at the following address:
  489.  
  490.                 Chester H. Lin
  491.                 5-3 Lane 4 Pu Chen Street
  492.                 Taipei, Taiwan 10611
  493.                 Republic of China
  494.  
  495.  
  496. Chester Lin
  497. January 29, 1990
  498. Taipei, Taiwan
  499.