Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
eb55d81e by Tomasz Miąsko at 2017-01-23T15:36:38+01:00
Use python executable located by configure when running tests.
- - - - -
9b5ec09c by Yann Leboulanger at 2017-01-23T22:00:52+01:00
Merge branch 'test-python-version' into 'master'
Use python executable located by configure when running tests.
See merge request !37
- - - - -
1 changed file:
- Makefile.am
Changes:
=====================================
Makefile.am
=====================================
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,7 +50,7 @@ MAINTAINERCLEANDIRS = \
test:
- python test/runtests.py
+ ${PYTHON} test/runtests.py
.PHONY: test
doc:
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/2be4b0a53ac76961a87ca11919c263bdd…
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
5a2a83a3 by Philipp Hörist at 2017-01-23T18:06:07+01:00
Update available features on windows
On Windows we can now save account passwords in the
Windows Credential Vault
- - - - -
e41a751c by Philipp Hörist at 2017-01-23T19:02:21+01:00
Add config setting for use of keyring
- - - - -
f59fd73f by Philipp Hörist at 2017-01-23T19:18:59+01:00
Improve fallback for windows keyring
- - - - -
2be4b0a5 by Philipp Hörist at 2017-01-23T19:43:43+01:00
Merge branch 'master' into 'master'
Improvements for windows keyring storage
See merge request !38
- - - - -
3 changed files:
- src/common/config.py
- src/common/passwords.py
- src/features_window.py
Changes:
=====================================
src/common/config.py
=====================================
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -314,6 +314,7 @@ class Config:
'remember_opened_chat_controls': [ opt_bool, True, _('If enabled, Gajim will reopen chat windows that were opened last time Gajim was closed.')],
'positive_184_ack': [ opt_bool, False, _('If enabled, Gajim will show an icon to show that sent message has been received by your contact')],
'show_avatar_in_tabs': [ opt_bool, False, _('Show a mini avatar in chat window tabs and in window icon')],
+ 'use_keyring': [opt_bool, True, _('If True, Gajim will use the Systems Keyring to store account passwords.')],
}, {})
__options_per_key = {
=====================================
src/common/passwords.py
=====================================
--- a/src/common/passwords.py
+++ b/src/common/passwords.py
@@ -52,7 +52,7 @@ class PasswordStorage(object):
class SimplePasswordStorage(PasswordStorage):
def get_password(self, account_name):
passwd = gajim.config.get_per('accounts', account_name, 'password')
- if passwd and passwd.startswith('libsecret:'):
+ if passwd and (passwd.startswith('libsecret:') or passwd.startswith('winvault:')):
# this is not a real password, it’s stored through libsecret.
return None
else:
@@ -116,8 +116,14 @@ class SecretWindowsPasswordStorage(PasswordStorage):
self.win_keyring = keyring.get_keyring()
def save_password(self, account_name, password):
- self.win_keyring.set_password('gajim', account_name, password)
- gajim.config.set_per('accounts', account_name, 'password', 'winvault:')
+ try:
+ self.win_keyring.set_password('gajim', account_name, password)
+ gajim.config.set_per(
+ 'accounts', account_name, 'password', 'winvault:')
+ except:
+ log.exception('error:')
+ set_storage(SimplePasswordStorage())
+ storage.save_password(account_name, password)
def get_password(self, account_name):
log.debug('getting password')
@@ -127,10 +133,7 @@ class SecretWindowsPasswordStorage(PasswordStorage):
if not conf.startswith('winvault:'):
password = conf
# migrate the password over to keyring
- try:
- self.save_password(account_name, password)
- except Exception:
- log.exception('error: ')
+ self.save_password(account_name, password)
return password
return self.win_keyring.get_password('gajim', account_name)
@@ -140,19 +143,22 @@ def get_storage():
global storage
if storage is None: # None is only in first time get_storage is called
global Secret
- try:
- gi.require_version('Secret', '1')
- gir = __import__('gi.repository', globals(), locals(),
- ['Secret'], 0)
- Secret = gir.Secret
- except (ValueError, AttributeError):
- pass
- try:
- if os.name != 'nt':
- storage = SecretPasswordStorage()
- else:
- storage = SecretWindowsPasswordStorage()
- except Exception:
+ if gajim.config.get('use_keyring'):
+ try:
+ gi.require_version('Secret', '1')
+ gir = __import__('gi.repository', globals(), locals(),
+ ['Secret'], 0)
+ Secret = gir.Secret
+ except (ValueError, AttributeError):
+ pass
+ try:
+ if os.name != 'nt':
+ storage = SecretPasswordStorage()
+ else:
+ storage = SecretWindowsPasswordStorage()
+ except Exception:
+ storage = SimplePasswordStorage()
+ else:
storage = SimplePasswordStorage()
return storage
=====================================
src/features_window.py
=====================================
--- a/src/features_window.py
+++ b/src/features_window.py
@@ -69,7 +69,7 @@ class FeaturesWindow:
_('Password encryption'): (self.some_keyring_available,
_('Passwords can be stored securely and not just in plaintext.'),
_('Requires libsecret and a provider (such as GNOME Keyring and KSecretService).'),
- _('Feature not available under Windows.')),
+ _('On Windows the Windows Credential Vault is used.')),
_('Spell Checker'): (self.speller_available,
_('Spellchecking of composed messages.'),
_('Requires libgtkspell.'),
@@ -183,7 +183,7 @@ class FeaturesWindow:
def some_keyring_available(self):
if os.name == 'nt':
- return False
+ return True
try:
gi.require_version('Secret', '1')
from gi.repository import Secret
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/ca3b5eee3cee990237134210f97edbe6b…
Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim
Commits:
dccbd1d1 by Philipp Hörist at 2017-01-23T13:58:10+01:00
Store passwords in Windows Credential Vault
- - - - -
f023426f by Philipp Hörist at 2017-01-23T13:58:10+01:00
Add keyring dependency to windows build
- - - - -
d691ccbe by Philipp Hörist at 2017-01-23T14:18:40+01:00
Add config setting for windows keyring
- - - - -
f715de36 by Philipp Hörist at 2017-01-23T17:47:35+01:00
Update available features on windows
On Windows we can now save account passwords in the
Windows Credential Vault
- - - - -
83c9bdb8 by Philipp Hörist at 2017-01-23T18:00:20+01:00
Merge branch 'gajim_0.16' into 'gajim_0.16'
Store passwords in Windows Credential Vault
See merge request !35
- - - - -
4 changed files:
- setup_win32.py
- src/common/config.py
- src/common/passwords.py
- src/features_window.py
Changes:
=====================================
setup_win32.py
=====================================
--- a/setup_win32.py
+++ b/setup_win32.py
@@ -36,7 +36,7 @@ options = {
'includes': ['win32com.server', 'win32com.client'],
'packages': ['pkg_resources', 'cffi', 'gtk',
'cryptography', 'Crypto', 'PIL',
- 'axolotl', 'google', 'common'],
+ 'axolotl', 'google', 'common', 'keyring'],
'includes': ['new'],
'excludes': ['Tkinter', 'unittest', 'psutil'],
}
=====================================
src/common/config.py
=====================================
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -286,6 +286,7 @@ class Config:
'enable_negative_priority': [ opt_bool, False, _('If True, you will be able to set a negative priority to your account in account modification window. BE CAREFUL, when you are logged in with a negative priority, you will NOT receive any message from your server.')],
'use_gnomekeyring': [opt_bool, True, _('If True, Gajim will use Gnome Keyring (if available) to store account passwords.')],
'use_kwalletcli': [opt_bool, True, _('If True, Gajim will use KDE Wallet (if kwalletcli is available) to store account passwords.')],
+ 'use_winvault': [opt_bool, True, _('If True, Gajim will use the Windows Credential Vault to store account passwords.')],
'show_contacts_number': [opt_bool, True, _('If True, Gajim will show number of online and total contacts in account and group rows.')],
'treat_incoming_messages': [ opt_str, '', _('Can be empty, \'chat\' or \'normal\'. If not empty, treat all incoming messages as if they were of this type')],
'scroll_roster_to_last_message': [opt_bool, True, _('If True, Gajim will scroll and select the contact who sent you the last message, if chat window is not already opened.')],
=====================================
src/common/passwords.py
=====================================
--- a/src/common/passwords.py
+++ b/src/common/passwords.py
@@ -26,10 +26,21 @@
__all__ = ['get_password', 'save_password']
+import os
+import logging
import warnings
from common import gajim
from common import kwalletbinding
+log = logging.getLogger('gajim.password')
+
+if os.name == 'nt':
+ try:
+ import keyring
+ except ImportError:
+ log.exception(
+ 'python-keyring missing, falling back to plaintext storage')
+
USER_HAS_GNOMEKEYRING = False
USER_USES_GNOMEKEYRING = False
USER_HAS_KWALLETCLI = False
@@ -46,9 +57,8 @@ class SimplePasswordStorage(PasswordStorage):
def get_password(self, account_name):
passwd = gajim.config.get_per('accounts', account_name, 'password')
if passwd and (passwd.startswith('gnomekeyring:') or passwd.startswith('libsecret:') or \
- passwd == '<kwallet>'):
- # this is not a real password, it's either a gnome
- # keyring token or stored in the KDE wallet
+ passwd == '<kwallet>' or passwd.startswith('winvault:')):
+ # this is not a real password
return None
else:
return passwd
@@ -176,6 +186,34 @@ class KWalletPasswordStorage(PasswordStorage):
gajim.connections[account_name].password = password
+class SecretWindowsPasswordStorage(PasswordStorage):
+ """ Windows Keyring """
+
+ def __init__(self):
+ self.win_keyring = keyring.get_keyring()
+
+ def save_password(self, account_name, password):
+ try:
+ self.win_keyring.set_password('gajim', account_name, password)
+ gajim.config.set_per(
+ 'accounts', account_name, 'password', 'winvault:')
+ except:
+ log.exception('error:')
+ set_storage(SimplePasswordStorage())
+ storage.save_password(account_name, password)
+
+ def get_password(self, account_name):
+ conf = gajim.config.get_per('accounts', account_name, 'password')
+ if conf is None:
+ return None
+ if not conf.startswith('winvault:'):
+ password = conf
+ # migrate the password over to keyring
+ self.save_password(account_name, password)
+ return password
+ return self.win_keyring.get_password('gajim', account_name)
+
+
storage = None
def get_storage():
global storage
@@ -207,6 +245,13 @@ def get_storage():
USER_HAS_KWALLETCLI = True
if USER_HAS_KWALLETCLI:
storage = KWalletPasswordStorage()
+ if storage is None and os.name == 'nt':
+ if gajim.config.get('use_winvault'):
+ try:
+ storage = SecretWindowsPasswordStorage()
+ except:
+ log.exception('error:')
+ storage = None
if storage is None:
storage = SimplePasswordStorage()
return storage
=====================================
src/features_window.py
=====================================
--- a/src/features_window.py
+++ b/src/features_window.py
@@ -72,8 +72,8 @@ class FeaturesWindow:
_('Feature not available under Windows.')),
_('Password encryption'): (self.some_keyring_available,
_('Passwords can be stored securely and not just in plaintext.'),
- _('Requires gnome-keyring and python-gnome2-desktop, or kwalletcli.'),
- _('Feature not available under Windows.')),
+ _('Requires gnome-keyring and python-gnome2-desktop, or kwalletcli'),
+ _('On Windows the Windows Credential Vault is used.')),
_('SRV'): (self.srv_available,
_('Ability to connect to servers which are using SRV records.'),
_('Requires dnsutils.'),
@@ -202,7 +202,7 @@ class FeaturesWindow:
def some_keyring_available(self):
if os.name == 'nt':
- return False
+ return True
if kwalletbinding.kwallet_available():
return True
try:
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/243ab1487e297fdb7df7fa0a91e613e43…
Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim
Commits:
afb2fb1f by Philipp Hörist at 2017-01-23T12:26:50+01:00
Include msg kind when merging nicknames
When two users had the same nickname merging was not
working correctly
- - - - -
243ab148 by Philipp Hörist at 2017-01-23T12:40:08+01:00
Merge branch 'gajim_0.16' into 'gajim_0.16'
Fix chat_merge_consecutive_nickname
See merge request !34
- - - - -
1 changed file:
- src/conversation_textview.py
Changes:
=====================================
src/conversation_textview.py
=====================================
--- a/src/conversation_textview.py
+++ b/src/conversation_textview.py
@@ -218,9 +218,10 @@ class ConversationTextview(gobject.GObject):
# It's True when we scroll in the code, so we can detect scroll from user
self.auto_scrolling = False
- # This holds the last Nickname we received a msg from
+ # Holds the last Nickname and Kind
# for chat_merge_consecutive_nickname feature
self.last_msg_name = None
+ self.last_msg_kind = None
# connect signals
id_ = self.tv.connect('motion_notify_event',
@@ -1329,7 +1330,8 @@ class ConversationTextview(gobject.GObject):
mark1 = mark
else: # not status nor /me
if gajim.config.get('chat_merge_consecutive_nickname'):
- if self.last_msg_name != name or self.just_cleared:
+ if (self.last_msg_kind != kind or self.last_msg_name != name or
+ self.just_cleared):
# Textview is empty or this is a msg from a new user
# Print the Nickname
self.print_name(name, kind, other_tags_for_name,
@@ -1343,6 +1345,7 @@ class ConversationTextview(gobject.GObject):
# Save the last Chatname so we know if we have to
# print the nickname on the next message
self.last_msg_name = name
+ self.last_msg_kind = kind
else:
self.print_name(name, kind, other_tags_for_name,
direction_mark=direction_mark, iter_=end_iter)
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/23443819a2cfa970d8aa46c35ffa214d1…
Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim
Commits:
63439d08 by Tomasz Miąsko at 2017-01-22T23:07:31+01:00
Fix translation list and add missing import.
- - - - -
6ed3651d by Philipp Hörist at 2017-01-22T23:13:43+01:00
Merge branch 'minor-fixes' into 'gajim_0.16'
Fix translation list and add missing import.
See merge request !33
- - - - -
2 changed files:
- po/LINGUAS
- src/common/logging_helpers.py
Changes:
=====================================
po/LINGUAS
=====================================
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -15,7 +15,6 @@ sv
it
eu
sk
-no
zh_CN
br
eo
=====================================
src/common/logging_helpers.py
=====================================
--- a/src/common/logging_helpers.py
+++ b/src/common/logging_helpers.py
@@ -21,6 +21,7 @@
import logging
import i18n
import os
+import sys
def parseLogLevel(arg):
"""
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/8abf73f94e63f96ab859bd4651553e718…