ipsvrd

ipsvrd

This is the background server used to access data on a Fip Server.

Normal running is in the SYSTEM file :
    svrd    local   ipsvrd -s+ -E 20
or with some logging
    svrd    local   ipsvrd -s+ -E 20 -l

It prefers to use a parameter file - and will warn on startup if it is not
there - which defaults to tables/wire/FIPNET.FIP

Use the parameter file to whitelist ONLY Fip servers for gaining access to your
system or to setup SSL.
Use the '-z' input switch to specify any other filename. A '.FIP' extension may
be added.

Syntax :
    ; comment line

    default-blacklist: allow/disallow
        Default is to allow all connections, use this to set the default to disallow
unless they are specified in one of more 'allow' parameters

    allow: (IPaddress to allow)
    disallow: (IPaddress to block)
        use these to blacklist/whitelist certain addresses,
        a '*' (star) can be used to indicate ALL    eg 10.3.3.*

    admin: (admin name)

    use-ssl:yes/no
        The commends are for a ftp running over SSL/TLS on the remote server
        default is NO
        no  - normal, standard plain TCP
        yes - connect (normally) and immediately start SSL on top

    ssl-method: (1,2,3,23,999)
        Version number to use for TLS/SSL       default: 999 for current default (2 or 3)
    ssl-password: (password)
    ssl-passwd: (password)            default: none
        Optional password if the handshake requires a shared secret
    ssl-key: (name of a certiticate key file)       default: none
    ssl-cert: (name of a certificate file)  default: none
    ssl-root-cert: (name of a root PEM certificate file)    defaunt: none
        Optional certificates are in tables/ssl unless name starts with '/'
    ssl-verify: yes/no  verify server certificates  default: yes
    ssl-ciphers: (list) acceptable ciphers
        (use 'openssl ciphers' to list)
        default:  "HIGH:!aNULL:!kRSA:!SRP:!PSK:!CAMELLIA:!RC4:!MD5:!DSS"
    ssl-display: yes/no display SSL connection details  default: no

EG :
;
default-blacklist:disallow

; * is a wild card
allow:217.138.58.*

allow:7.90.77.115

--------------------------------------------------

Input switches are (all optional) :
    -d : top path                   default: /
    -D : display actions for Notes          default: no
    -E : maximum number of threads          default: 1
        up to a max of 200 (not Win2k)
        Note this is also a hardware limit in that small systems may not be able to
run more than 50 or so
    -g : disable SSL                default: depends on 'use-ssl:yes' in parameter file
    -G : display any SSL debugging infomation. default: none
    -I : id of this instance            default: ignored
        Where there are several copies of 'ipsvrd' running (more for Win2k)
    -l : log requests               default: no logging
    -L : log requests and connections       default: no logging
    -P : Port no to receive messages on     default: 9140
    -s : IP address or hostname to listen on    default: boot address.
        '-s +' will listen on ALL cards and address for this box.
    -u : dump incoming data             default: no
    -w : adjust the timeout in secs         default: 4
        on slow networks, try increasing it to 10 or more
    -z : Name of Parameter file         default: none

    -v : print version number and quit      default: no

--------------------------------------------------
Notes upload version of ipsvrd is called ipnotwir

For testing, start the program in a terminal/command window and add the '-D'
input switch. This allows logging to the screen what is happening!

Parameter file for Notes is tables/notes/2NOTES (on WINNT 2NOTES.FIP)

    notes-server: (hostname of the notes server)
        eg notes-server:HOBBES
    notes-path: (path to a local database)
    notes-database: (path and name of database)
        eg notes-database:editorial/CET_Edit.nsf

    Where data is held locally and the database holds just a link to the files :
        notes-data-drive: (letter)
        notes-data-fiphdr: (fiphdr field)
        notes-data-filename:/cet/\ND/\NP/\NS
        notes-data-fileext:.txt
        notes-data-ismac:
            This just converts line ends to CR only
            It does NOT convert any oither characters.
        log-line: (extra logging)

    For each field that needs to be filled in :

    field: (Notes Field name)   file:
    field: (Notes Field name)   file:richtext
        Add the text of the file to this field
        if richtext is added, it is a richtext type field
        eg field:ArticleText    file:

    field: (Notes Field name)   data:(FipSeq)
    field: (Notes Field name)   data:(FipSeq)   type: (optional type)
        Add metadata from FipHdr or system variables into Notes fields
        The optional type can be the special notes types of
            type:list   this is a controlled list
            type:time   this is a date/time field
            type:number this is a number
        The default is a string of text

    If there are spaces in the Field name or the data specification, wrap double
quotes around them

    examples

    ; AdminDb
    fixed:ND    CN=LNCOV1/O=MG_REG
    field:AdminDb   data:\CN
    ; Headline
    combie:QH   XK|DI
    field:Headline  data:\QH

    ; no of characters in a NUMBER field
    field:Character_count   type:number data:\$c
    ; add time of insert to the Comments field
    field:Comments    data:"Sent From FIP - \$d-\$m-\$y at \$h:\$n:\$b"
    ; make sure CopyCheck is blank
    field:CopyCheck  data:""
    field:CopyCount  type:number    data:1
    field:Correspondent data:\SU
    ; TIME
    field:CreatedOn  type:time

On Windows, there may be a permissions problem accessing the database with the
LOCALSYSTEM account. So the 'Fip Comms Manager' service must be started by a
logon that can see/modify Notes!

--------------------------------------------------

---- Input ----
Example of Input :
<?xml version="1.0" standalone="yes"?>
<FIPAGENT>
<ACTION>DIRLIST</ACTION>
<QUEUE>/fip/spool/2edsys</QUEUE>
<LOGON>albert</LOGON>
<PASSWD>HeyJude</PASSWD>
<SIZE/>
<DATE/>
</FIPAGENT>
Note - tags are case insensitive

---- Output ----
Example of Output :
<?xml version="1.0" standalone="yes"?>
<FIPAGENT>
<REPLY>
    <ACTION>DIRLIST</ACTION>
    <RESULT>231</RESULT>
    <DEVICE-RESULT>0</DEVICE-RESULT>
    <DATALENGTH>6507</DATALENGTH>
</REPLY>
</FIPAGENT>Data follows.......
Note there is no trailing NL

---- Notes ----
Return Codes

Ok - in the range 200-299

211 - Read complete
212 - Filter returns nothing
221 - Store complete
222 - Link complete (for LINK which succeeded)
222 - Move successful
222 - Copy successful
231 - Directory List complete
241 - Delete complete
251 - Script complete
261 - Ignore complete

errors - in the range 400-499

general errors
401 - Nothing !
402 - No Action Specified
403 - No Logon Specified
404 - Password Incorrect
405 - Unknown Action Specified
406 - Timeout - incomplete Token

Read
411 - No File Specified
412 - No Such File
413 - File not Readable

Store/Append/Link
421 - No File Specified
422 - Exists but is NOT a File
423 - File exists - no overwrite selected
424 - Error Writing Zero Length File
425 - No Data Sent for new file
426 - Error Append/Prepend to File
427 - Error cannot find input data File
428 - Error Unable to write file
429 - Error Unable to Append/Prepend file

Dir List
431 - No Queue Specified
432 - Queue does NOT exist

Delete
441 - No File Specified
442 - No Such File
443 - File Permissions do not allow Delete

Script
451 - No Script Specified
452 - No Script File
453 - Not able to run Script file
454 - Script ran but errored

Ignore
no errors

NOTES-UPLOAD
461 - No File Specified
462 - No Data Sent for new file
463 - Not able to log onto the DataBase
464 - Error uploading fields, pls check parameter file.

--------------------------------------------------

Tags and SubTags
----------------
If the Action is DIRLIST :
    queue       - absolute queue or folder name
    size/       - returns the size of each file
    date/       - returns last modifcation date of each file
    totals/     - returns only the number of items in the folder

If the Action is STORE :
    file        - filename with complete path
    link        - optional link - filename with complete path
    unique/     - file MUST be uniquename
    notunique/  - increment filename if exists
    overwrite/  - overwrite texisting if exists
    originals/  - save existing (if any) in /fip/originals
    makequeue/  - make the queue
    zerolength/ - allow/make a zero length file.
    permissions - unix style permissions
    script-after    - Full path and all parameters - Mandatory
                Note that FipHdr field DD holds the filename
    tmpfile     - for use with scipt-after, just use a tmp file for the data
    ignore-errors   - for script

if the Action is APPEND :
    file        - filename with complete path
    link        - optional link - filename with complete path
    originals/  - save existing (if any) in /fip/originals
    makequeue/  - make the queue

If the Action is LINK or MOVE or COPY:
    file        - filename with complete path
    source      - do NOT store the file, use this file to link to, unless the link
file does NOT exist.
    unique/     - file MUST be uniquename
    notunique/  - increment filename if exists
    overwrite/  - overwrite existing if exists
    originals/  - save existing (if any) in /fip/originals
    makequeue/  - make the queue
    zerolength/ - allow/make a zero length file.
    permissions - unix style permissions

If the Action is READ :
    file        - filename - Mandatory
    filter      - a grep of the line
    sort        - sort upside down
    maxitems    - give me only the first 100 lines  - eg log files
There are no extra tags for NOTES UPLOAD as the FipHdr is matched to Notes
fields

If the Action is SCRIPT - run Script :
    script      - Full path and all parameters - Mandatory
    ignore-errors

If the Action is DELETE :
    file        - filename - Mandatory

Version Control
;1w32   27nov99 added Notes Upload
    ;e 05jun00 added LINK
    ;f 08aug00 more error checking
    ;g 22aug00 redid DIRLIST a bit
    ;h 26mar02 added -s for -s+
    ;i 14jul03 added action APPEND as a type of STORE files
    ;j-k 19sep04 speedy
    ;l-m 26oct05 added script-after to store
    ;n-p 25oct06 cleanup and added dump -u plus more Notes stuff
    ;q-s 20nov06 added RichText for file data
    ;t 20dec06 added META for STORE (missing dec 2005 mod)
    ;u 31may07 redid STORE/PERMISSIONS
    ;v2 20sep07 added -w (;v1 added IP address to log)
    ;w3-5 30oct08 make notes* FipSeq ;3 unlink on store -> w and added timing -T
;5 bugette in APPEND and added PREPEND
    ;w6-7 30apr14 file-trace added ;7-8 added STATTIME
    ;w9-12 23aug17 added -I and -E for multiple instances - should improve thruput
on slow networks/systems
    ;w13-16 5oct17 MOVE and COPY added ;17 added useMsg and sysMsg ;18 15aug19
added blacklists ;19-26 SSL
    ;w27-29 17mar20 allow /data-av and data-no-av as valid fip top folders
    ;30-32 10oct22 pid_t and sockaddr_t

(copyright) 2024 and previous years FingerPost Ltd.