mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-18 23:38:18 +00:00
ftp server: initial implementation. Still needs unit tests, custom Twisted patches. For #512
This commit is contained in:
@ -78,6 +78,7 @@ class Client(node.Node, testutil.PollMixin):
|
||||
if key_gen_furl:
|
||||
self.init_key_gen(key_gen_furl)
|
||||
# ControlServer and Helper are attached after Tub startup
|
||||
self.init_ftp_server()
|
||||
|
||||
hotline_file = os.path.join(self.basedir,
|
||||
self.SUICIDE_PREVENTION_HOTLINE_FILE)
|
||||
@ -253,6 +254,17 @@ class Client(node.Node, testutil.PollMixin):
|
||||
ws = WebishServer(webport, nodeurl_path)
|
||||
self.add_service(ws)
|
||||
|
||||
def init_ftp_server(self):
|
||||
if not self.get_config("ftpd", "enabled", False, boolean=True):
|
||||
return
|
||||
portstr = self.get_config("ftpd", "ftp.port", "8021")
|
||||
accountfile = self.get_config("ftpd", "ftp.accounts.file", None)
|
||||
accounturl = self.get_config("ftpd", "ftp.accounts.url", None)
|
||||
|
||||
from allmydata import ftpd
|
||||
s = ftpd.FTPServer(self, portstr, accountfile, accounturl)
|
||||
s.setServiceParent(self)
|
||||
|
||||
def _check_hotline(self, hotline_file):
|
||||
if os.path.exists(hotline_file):
|
||||
mtime = os.stat(hotline_file)[stat.ST_MTIME]
|
||||
|
Reference in New Issue
Block a user