Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion b3/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def __init__(self, conf, options):
game_log = self.config.get('server', 'game_log')
if game_log[0:6] == 'ftp://' or game_log[0:7] == 'sftp://' or game_log[0:7] == 'http://':
self.remoteLog = True
self.bot('Working in remote-log mode: %s', game_log)
self.bot('Working in remote-log mode')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this change? Why hiding the gamelog path from the B3 log?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it shows the SFTP/FTP password within the log path.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough 👍


if self.config.has_option('server', 'local_game_log'):
f = self.config.getpath('server', 'local_game_log')
Expand Down
8 changes: 4 additions & 4 deletions b3/plugins/sftpytail/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ def handle_download(block):
self._remoteFileOffset = remotesize - self._maxGap
#self.debug('RETR from remote offset %s. (expecting to read at least %s bytes)' % (
# self._remoteFileOffset, remoteSize - self._remoteFileOffset))
if not rfile:
self.debug('opening remote game log file %s for reading' % self.sftpconfig['path'])
rfile = sftp.open(self.sftpconfig['path'], 'r')
#if not rfile:
self.debug('opening remote game log file %s for reading' % self.sftpconfig['path'])
rfile = sftp.open(self.sftpconfig['path'], 'r')
rfile.seek(self._remoteFileOffset)
self.debug('reading remote game log file from offset %s' % self._remoteFileOffset)
handle_download(rfile.read())
Expand Down Expand Up @@ -354,4 +354,4 @@ def get_private_key(self, password=None):
else:
raise ValueError("can't identify private key type")
with open(self.private_key_file, "r") as f:
return key_type.from_private_key(f, password=password)
return key_type.from_private_key(f, password=password)