Creation/Dev/GScript FTP Server: Difference between revisions

From Graal Bible
(Created page with 'The server binds to a random port (it's not possible to specify a port to bind to with TSocket unless it's enabled by Stefan) and listens for incoming FTP connections. You can co…')
 
m (Preventing page scrolling left/right.)
Line 27: Line 27:
'''Setup instructions'''
'''Setup instructions'''


  1. Download the attached file and unzip it
'''1.''' Download the attached file and unzip it
  2. Create classes for each of the files named ftp_*.txt in the zip folder, and copy the scripts into them.
 
  3. Create a new DBNPC named FTP and place the script inside FTP.txt into it.
'''2.''' Create classes for each of the files named ftp_*.txt in the zip folder, and copy the scripts into them.
  4. Give your NPC-server folder rights to any folders you want to be able to access. You can give read or read/write rights. Note that it is a security risk to give the NPC-server rights, so do this with care. You can give rights to specific folders or blanket (e.g. rw */*, rw */*/*)
 
  5. Setup users in the DBNPC FTP. Follow the format in there and be sure to remove cbk1994. The users must be the account name of a player, and they will share that player's folder rights. Community names are not supported for obvious reasons.
'''3.''' Create a new DBNPC named FTP and place the script inside FTP.txt into it.
  6. Use the command "/npc ftp" in RC to see where the FTP server is currently listening. If your client separates the host and port fields, the host is before the colon and the port is after.
 
'''4.''' Give your NPC-server folder rights to any folders you want to be able to access. You can give read or read/write rights. Note that it is a security risk to give the NPC-server rights, so do this with care. You can give rights to specific folders or blanket (e.g. rw */*, rw */*/*)
 
'''5.''' Setup users in the DBNPC FTP. Follow the format in there and be sure to remove cbk1994. The users must be the account name of a player, and they will share that player's folder rights. Community names are not supported for obvious reasons.
 
'''6.''' Use the command "/npc ftp" in RC to see where the FTP server is currently listening. If your client separates the host and port fields, the host is before the colon and the port is after.


'''For a live example please visit''': http://forums.graalonline.com/forums/showthread.php?t=134261400
'''For a live example please visit''': http://forums.graalonline.com/forums/showthread.php?t=134261400

Revision as of 03:54, 25 December 2010

The server binds to a random port (it's not possible to specify a port to bind to with TSocket unless it's enabled by Stefan) and listens for incoming FTP connections. You can connect using any FTP client. I've tested the FTP client built into Windows Explorer, Filezilla, Transmit, and Cyberduck, but some other FTP clients may work as well.

The port will change every time the server restarts or the FTP DBNPC is updated. You can use "/npc ftp" in RC to get the new port and host.

Features

   * Download files or entire folders (easy backups)
   * Compatible with virtually any FTP client, tested in several (see above; be sure to report unsupported FTP clients so I can fix the error)
   * Complex rights control based on the player's folder rights, prevents accidentally giving a user too many rights (see below)
   * Writing is supported (see below for issues with uploading), and can be disabled for any user or for every user easily
   * Move, rename, or create directories

Active transfer mode is not supported; you must use passive mode.

Disclaimer

Chris wrote this out of sheer boredom, and since he has no use for it now since he doesn't run a server, but he hopes this may be useful. Keep in mind that he tested this as much as possible and can't find any security holes, but they may exist. Please report any bugs and I will release a fix as fast as I can.

Uploading Information

Due to my Nemesis, the flood alert, it's not possible to upload too much data. If you do, no scripts on the server will be able to write (or read?) to/from files. It is to your advantage not to cross this limit. There is no limit for reading. You shouldn't run into this problem unless you are uploading more than 10 MB of files in a short time. GScript also can not write to some file extensions. Currently, there is no list of allowed extensions, but most, such as txt and doc, will work. Some folders also cannot be written to by script, such as logs and all script folders (weapons, scripts, npcs).

Rights system

Folder rights are inherited from the folder rights of the account of the user being used. If the NPC-server doesn't have rights to a folder, that user won't be able to upload or download files there. You can also completely disable writing in the script. If you are worried about security, don't give the NPC-server rights to any folders with confidential files, or just don't use this script.

Setup instructions

1. Download the attached file and unzip it

2. Create classes for each of the files named ftp_*.txt in the zip folder, and copy the scripts into them.

3. Create a new DBNPC named FTP and place the script inside FTP.txt into it.

4. Give your NPC-server folder rights to any folders you want to be able to access. You can give read or read/write rights. Note that it is a security risk to give the NPC-server rights, so do this with care. You can give rights to specific folders or blanket (e.g. rw */*, rw */*/*)

5. Setup users in the DBNPC FTP. Follow the format in there and be sure to remove cbk1994. The users must be the account name of a player, and they will share that player's folder rights. Community names are not supported for obvious reasons.

6. Use the command "/npc ftp" in RC to see where the FTP server is currently listening. If your client separates the host and port fields, the host is before the colon and the port is after.

For a live example please visit: http://forums.graalonline.com/forums/showthread.php?t=134261400

Please report any bugs. Feedback is appreciated.

Credits:

Chris Vimes(cbk1994) - Creator

death_striker (death_striker) -Providing development space for this to be possible.