def init_ftp_server(self):
if self.get_config("ftpd", "enabled", False, boolean=True):
- accountfile = self.get_config("ftpd", "accounts.file", None)
+ accountfile = from_utf8_or_none(self.get_config("ftpd", "accounts.file", None))
accounturl = self.get_config("ftpd", "accounts.url", None)
ftp_portstr = self.get_config("ftpd", "port", "8021")
def init_sftp_server(self):
if self.get_config("sftpd", "enabled", False, boolean=True):
- accountfile = self.get_config("sftpd", "accounts.file", None)
+ accountfile = from_utf8_or_none(self.get_config("sftpd", "accounts.file", None))
accounturl = self.get_config("sftpd", "accounts.url", None)
sftp_portstr = self.get_config("sftpd", "port", "8022")
- pubkey_file = self.get_config("sftpd", "host_pubkey_file")
- privkey_file = self.get_config("sftpd", "host_privkey_file")
+ pubkey_file = from_utf8_or_none(self.get_config("sftpd", "host_pubkey_file"))
+ privkey_file = from_utf8_or_none(self.get_config("sftpd", "host_privkey_file"))
from allmydata.frontends import sftpd
s = sftpd.SFTPServer(self, accountfile, accounturl,
class FTPServer(service.MultiService):
def __init__(self, client, accountfile, accounturl, ftp_portstr):
+ precondition(isinstance(accountfile, unicode), accountfile)
service.MultiService.__init__(self)
r = Dispatcher(client)
class SFTPServer(service.MultiService):
def __init__(self, client, accountfile, accounturl,
sftp_portstr, pubkey_file, privkey_file):
+ precondition(isinstance(accountfile, unicode), accountfile)
+ precondition(isinstance(pubkey_file, unicode), pubkey_file)
+ precondition(isinstance(privkey_file, unicode), privkey_file)
service.MultiService.__init__(self)
r = Dispatcher(client)
# we could leave this anonymous, with just the /uri/CAP form
raise NeedRootcapLookupScheme("must provide an account file or URL")
- pubkey = keys.Key.fromFile(pubkey_file)
- privkey = keys.Key.fromFile(privkey_file)
+ pubkey = keys.Key.fromFile(pubkey_file.encode(get_filesystem_encoding()))
+ privkey = keys.Key.fromFile(privkey_file.encode(get_filesystem_encoding()))
class SSHFactory(factory.SSHFactory):
publicKeys = {pubkey.sshType(): pubkey}
privateKeys = {privkey.sshType(): privkey}