mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-18 23:38:18 +00:00
#531: implement an SFTP frontend. Mostly works, still lots of debug messages. Still needs tests and auth-by-pubkey in accounts.file
This commit is contained in:
@ -79,6 +79,7 @@ class Client(node.Node, pollmixin.PollMixin):
|
||||
self.init_key_gen(key_gen_furl)
|
||||
# ControlServer and Helper are attached after Tub startup
|
||||
self.init_ftp_server()
|
||||
self.init_sftp_server()
|
||||
|
||||
hotline_file = os.path.join(self.basedir,
|
||||
self.SUICIDE_PREVENTION_HOTLINE_FILE)
|
||||
@ -270,6 +271,19 @@ class Client(node.Node, pollmixin.PollMixin):
|
||||
s = ftpd.FTPServer(self, accountfile, accounturl, ftp_portstr)
|
||||
s.setServiceParent(self)
|
||||
|
||||
def init_sftp_server(self):
|
||||
if self.get_config("sftpd", "enabled", False, boolean=True):
|
||||
accountfile = self.get_config("sftpd", "sftp.accounts.file", None)
|
||||
accounturl = self.get_config("sftpd", "sftp.accounts.url", None)
|
||||
sftp_portstr = self.get_config("sftpd", "sftp.port", "8022")
|
||||
pubkey_file = self.get_config("sftpd", "sftp.host_pubkey_file")
|
||||
privkey_file = self.get_config("sftpd", "sftp.host_privkey_file")
|
||||
|
||||
from allmydata import sftpd
|
||||
s = sftpd.SFTPServer(self, accountfile, accounturl,
|
||||
sftp_portstr, pubkey_file, privkey_file)
|
||||
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