mirror of
https://github.com/Neocky/pluGET.git
synced 2024-04-29 16:12:30 +00:00
Merge pull request #38 from TheDudeFromCI/patch-1
Added custom port support for FTP access.
This commit is contained in:
commit
449232e2ca
@ -72,8 +72,10 @@ def createConfig():
|
|||||||
config['SFTP - Remote Server']['Server'] = '0.0.0.0'
|
config['SFTP - Remote Server']['Server'] = '0.0.0.0'
|
||||||
config['SFTP - Remote Server']['Username'] = 'user'
|
config['SFTP - Remote Server']['Username'] = 'user'
|
||||||
config['SFTP - Remote Server']['Password'] = 'password'
|
config['SFTP - Remote Server']['Password'] = 'password'
|
||||||
config['SFTP - Remote Server'][';'] = 'If a different Port for SFTP needs to be used (Works only for SFTP)'
|
config['SFTP - Remote Server'][';'] = 'If a different Port for SFTP needs to be used (Default: 22)'
|
||||||
config['SFTP - Remote Server']['SFTPPort'] = '22'
|
config['SFTP - Remote Server']['SFTPPort'] = '22'
|
||||||
|
config['SFTP - Remote Server'][';_'] = 'If a different Port for FTP needs to be used (Default: 21)'
|
||||||
|
config['SFTP - Remote Server']['FTPPort'] = '21'
|
||||||
config['SFTP - Remote Server'][';_'] = 'Change the path below if the plugin folder path is different on the SFTP/FTP server (Change only if you know what you are doing)'
|
config['SFTP - Remote Server'][';_'] = 'Change the path below if the plugin folder path is different on the SFTP/FTP server (Change only if you know what you are doing)'
|
||||||
config['SFTP - Remote Server']['PluginFolderOnServer'] = '/plugins'
|
config['SFTP - Remote Server']['PluginFolderOnServer'] = '/plugins'
|
||||||
config['SFTP - Remote Server'][';__'] = 'If you want to use FTP instead of SFTP change to (False) else use (True)'
|
config['SFTP - Remote Server'][';__'] = 'If you want to use FTP instead of SFTP change to (False) else use (True)'
|
||||||
|
@ -10,9 +10,10 @@ from handlers.handle_config import configurationValues
|
|||||||
|
|
||||||
def createFTPConnection():
|
def createFTPConnection():
|
||||||
configValues = configurationValues()
|
configValues = configurationValues()
|
||||||
ftp = ftplib.FTP(configValues.sftp_server, user=configValues.sftp_user, \
|
|
||||||
passwd=configValues.sftp_password)
|
|
||||||
try:
|
try:
|
||||||
|
ftp = ftplib.FTP()
|
||||||
|
ftp.connect(configValues.sftp_server, configValues.ftp_port)
|
||||||
|
ftp.login(configValues.sftp_user, configValues.sftp_password)
|
||||||
return ftp
|
return ftp
|
||||||
except UnboundLocalError:
|
except UnboundLocalError:
|
||||||
print(oColors.brightRed + "[FTP]: Check your config.ini!" + oColors.standardWhite)
|
print(oColors.brightRed + "[FTP]: Check your config.ini!" + oColors.standardWhite)
|
||||||
|
Loading…
Reference in New Issue
Block a user