Commit graph

1,037 commits

Author SHA1 Message Date
souliane
2a74cd0c06 tools (xmlui): to click a button in a "param" form will automatically submit the parameters of the same category 2014-05-16 00:53:09 +02:00
souliane
c3d859a48b wix: update the connection mechanism to ask for non empty profile passwords 2014-05-07 18:16:15 +02:00
souliane
fa430d5105 quick_app, primitivus: update the connection mechanism to ask for non empty profile passwords 2014-05-07 16:11:32 +02:00
souliane
6a7f88858e jp: option '-c' is not longer a flag but a string to define the profile password:
- no '-c': same behavior as before, do not connect the profile
- '-c' with not following value: autoconnect and use the default value '' as profile password
- '-c' with a following value: autoconnect and use that value as profile password

Note that previous scripts may not work. For example, even if the profile password for "test1" is empty:
  jp disco -p test1 -c contact@host.net
must be changed to:
  jp disco -p test1 -c -- contact@host.net
Otherwise, argparse will think that "contact@host.net" is the password and that the target JID is missing.
2014-05-07 16:10:20 +02:00
souliane
67a605c1c8 stdui: add ui_profile_manager to interact with frontends when profile authentication is needed 2014-05-07 16:03:38 +02:00
souliane
f3b0b52014 plugins misc_account, misc_smtp: update the plugins that deal with passwords 2014-05-12 17:51:38 +02:00
souliane
0d28c03d27 core, memory, bridge: added profile password + password encryption:
/!\ This changeset updates the database version to 2 and modify the database content!

Description:
    - new parameter General / Password to store the profile password
    - profile password is initialized with XMPP password value, it is stored hashed
    - bridge methods asyncCreateProfile/asyncConnect takes a new argument "password" (default = "")
    - bridge method asyncConnect returns a boolean (True = connection already established, False = connection initiated)
    - profile password is checked before initializing the XMPP connection

    - new private individual parameter to store the personal encryption key of each profile
    - personal key is randomly generated and encrypted with the profile password
    - personal key is decrypted after profile authentification and stored in a Sessions instance
    - personal key is used to encrypt/decrypt other passwords when they need to be retrieved/modified

    - modifying the profile password re-encrypt the personal key
    - Memory.setParam now returns a Deferred (the bridge method "setParam" is unchanged)
    - Memory.asyncGetParamA eventually decrypts the password, Memory.getParamA would fail on a password parameter

TODO:
    - if profile authentication is OK but XMPP authentication is KO, prompt the user for another XMPP password
    - fix the method "registerNewAccount" (and move it to a plugin)
    - remove bridge method "connect", sole "asyncConnect" should be used
2014-05-07 16:02:23 +02:00
souliane
c9f4397000 memory: add class ProfileSessions based on Sessions 2014-05-10 17:37:32 +02:00
souliane
7a29fae242 memory, test: added module crypto to hash passwords and encrypt/decrypt passwords or blocks 2014-05-07 15:46:43 +02:00
Goffi
cc010fba59 core: fixed typo 2014-05-15 20:25:52 +02:00
Goffi
e3f0fe289e core: getReady and asyncConnect now wait full initialisation, not only memory 2014-05-15 20:01:56 +02:00
Goffi
a3f460d391 plugin text commands: added /me command to avoid the need to escape the / 2014-05-15 19:51:53 +02:00
Goffi
a2f1522efd bridge (constructor): fixed D-Bus frontend generator for async method without sig_in + fixed --debug option + regenerated bridge to fix bad frontend D-Bus bridge. 2014-05-15 16:35:28 +02:00
Goffi
f0b2c7dea3 core: added a getReady method which can be called by frontends to ensure that backend is fully initialised before doing anything + this ckeck is automatically done in asyncConnect 2014-05-15 16:02:16 +02:00
souliane
561cc93a04 test: fix the tests after the changes of logging system 2014-05-14 13:26:23 +02:00
Goffi
ed2abd3971 core (log): moved configuration to core.log_config; this avoid import issues with pyjamas. 2014-05-14 12:51:24 +02:00
souliane
daa4b0b30b plugin misc_static_blog: renamed from tmp_blog_banner, now also with page's title, meta keywords and description 2014-05-13 17:17:57 +02:00
souliane
1eeddf5900 better PEP-8 compliance 2014-05-07 15:44:31 +02:00
Goffi
ee26391a11 core (i18n): use logging system instead of print 2014-05-08 19:11:47 +02:00
Goffi
9905e14d0c core (log): added "custom" backend 2014-05-08 19:11:20 +02:00
Goffi
2aeada884e core (logs): workaround for pyjamas bug 2014-05-08 17:16:15 +02:00
souliane
2e6420fb49 memory, jp: added jp commands to load/save parameters template 2014-05-04 18:43:54 +02:00
Goffi
675921a7d7 core: if in debug mode and ipdb is present, use ipdb instead of pdb 2014-05-05 20:16:14 +02:00
Goffi
2802250596 core (log/standard backend): added "%(profile)s" format management 2014-05-05 20:16:13 +02:00
Goffi
ad9c41cbc2 core(log): standard backend: colors are now checked on a per handler basis 2014-05-05 20:16:08 +02:00
Goffi
2fddb02872 wix: use of new logging system 2014-05-05 20:12:21 +02:00
Goffi
39989cc985 primitivus: use of new logging system:
- default output is \\memory
    - logs can be seen with :messages command
    - now useless writeLog method has been removed
2014-05-05 20:12:19 +02:00
Goffi
468206e529 quick_frontend: use of new logging system 2014-05-05 18:58:34 +02:00
Goffi
233d4b4268 core (log): added magic %(profile)s key to log_fmt:
if %(profile)s is used in log_fmt, SàT try to find profile value using introspection. This is for debugging purpose only, *DO NOT* use in production. This key don't work (yet ?) with standard backend, and will not work in every frontend.
2014-05-05 18:58:34 +02:00
Goffi
ba103161d5 core (log): refactoring + twisted backend:
- configuration is now done with classes, so inheritance is possible
    - twisted backend now use twisted log methods
    - log not produced by SàT directly in twisted backend are captured by an observer (twistedObserver) and sent back to SàT logging chain, with the "twisted" logger.
    - \\default output use normal twistd output, except in debug mode where it add an stdout output in addition to the log file.
    - when log_colors = True, colors are enabled only where it's possible (tty out), when log_colors=force colors are always enabled.
    - fixed some bad log.xxx calls
2014-05-05 18:58:34 +02:00
Goffi
737e784c3d core (log): added advanced feature to basic backend (colors/formatting/level and logger filtering) 2014-05-05 18:58:34 +02:00
Goffi
64384dc8bf core (logs): added formatting, name filter and outputs management:
- formatting is inspired from, and use when possible, standard logging. "message", "levelname", and "name" are the only format managed, depending on backend more can be managed (standard backend formats are specified in official python logging doc)
    - name filter use regular expressions. It's possible to log only plugins with SAT_LOG_LOGGER="^sat.plugins". To log only XEPs 96 & 65, we can use SAT_LOG_LOGGER='(xep_0095|xep_0065)'
    - output management use a particular syntax:
        - output handler are name with "//", so far there are "//default" (most of time stderr), "//memory" and "//file"
        - options can be specified in parenthesis, e.g. "//memory(50)" mean a 50 lines memory buffer (50 is the current default, so that's equivalent to "//memory")
        - several handlers can be specified: "//file(/tmp/sat.log)//default" will use the default logging + a the /tmp/sat.log file
        - if there is only one handler, it use the file handler: "/tmp/sat.log" is the same as "//file(/tmp/sat.log)"
    - not finished, need more work for twisted and basic backends
2014-05-05 18:58:34 +02:00
souliane
86d90d66aa core (constants): use realpath instead of abspath + do not import it when building libervia 2014-05-01 11:14:25 +02:00
souliane
4b8ba7a6f4 memory: fixes the method fixLocalDir for pid_dir and log_dir to use local_dir as default 2014-04-30 19:54:21 +02:00
souliane
42b1b6c4ed plugins TEXT-COMMANDS, XEP-0045, XEP-0048, XEP-0249:
- give a feedback instead of sending the message when the command is invalid or used in a wrong context
    - add command /join for XEP-0249
2014-04-30 16:34:09 +02:00
souliane
c7f12fc904 core: fixes constants.py 2014-04-27 18:51:03 +02:00
souliane
f3a0686176 primitivus: fixes contact group update 2014-04-27 18:22:12 +02:00
souliane
f0fa9b699d plugin XEP_0033: fixes the server part and the tests 2014-04-11 11:02:42 +02:00
Goffi
d89044dbbc tests: fixed log init in helpers (log init must be done before any call to a log method) 2014-04-23 12:01:59 +02:00
Goffi
edf5db192f test: configuration/use of new logging system 2014-04-21 20:04:52 +02:00
Goffi
a3186ac2e3 tests: fixed import in test_helpers_plugins 2014-04-21 19:45:10 +02:00
Goffi
8cd6bed824 plugin XEP-0096: fixed a bug introduced by the log refactoring 2014-04-20 11:51:48 +02:00
Goffi
317342b616 core (log): configuration and environment variables are now checked for log level and colors:
- variable change logs behaviour, so far only level and colors are implemented
    - configuration use log_[name], for example you can put log_level=debug in sat.conf (section [DEFAULT]) to see all levels
    - environment variables use SAT_LOG_[NAME]: e.g. SAT_LOG_LEVEL=debug
    - colors can be true, false or force to force colors even if stdout is not a tty
2014-04-19 20:11:23 +02:00
Goffi
501bc92528 core: use of the new core.log module:
/!\ this is a massive refactoring and was largely automated, it probably did bring some bugs /!\
2014-04-19 19:19:19 +02:00
Goffi
dc5c042fe7 core (log): twisted backend use logging methods instead of log.msg 2014-04-19 16:48:26 +02:00
Goffi
f05724db74 core: logging refactoring, first step:
- added a core.log module
    - 3 backends can be used: basic, standard (python's logging module) or twisted
    - colors can be used
    - the module has been made to be used by frontends, it should work in exotic environments like pyjamas
    - logging basic configuration is now made in sat.tac
    - core.log configuration is inspired from python standard logging, and use it when possible
    - getLogger should be used the same way as for standard logging
2014-04-19 00:02:38 +02:00
Goffi
28ad5741fd core (constants): added some basic ANSI escape codes 2014-04-18 23:36:52 +02:00
Goffi
3fcd7e22d9 plugins XEP-0048, XEP-0049: feature is not checked anymore before using private XML storage, as feature announcement is not mandatory in XEP-0049 2014-04-10 16:12:50 +02:00
Goffi
acce568f57 core (stdui): added forgotten __init__.py 2014-04-08 09:50:45 +02:00
souliane
e91a30729f core, frontends: unify the roster management UIs in sat/stdui/ui_contact_list.py 2014-04-03 16:10:44 +02:00