Commit graph

1,053 commits

Author SHA1 Message Date
Goffi
87b3e413ee core (XMPP): sendMessage refactoring:
- better separation of message sending actions
    - use of more generic exceptions to hook the behaviour (SkipHistory and CancelError)
    - use of raise instead of return
    - use of failure.trap
2014-06-07 16:35:29 +02:00
souliane
5f2b90e163 memory (params), test: fixes updateParams bug 2014-06-03 17:10:12 +02:00
souliane
900047c921 memory (params), test: fixes bug relative to parameter filtering 2014-06-03 15:10:51 +02:00
souliane
2a04d556a3 plugin XEP-0100: fixes the call to log.debug (line 185) 2014-06-04 12:57:49 +02:00
souliane
a22d4b27dc primitivus: fixes freedesktop notifications when the owner name is changing 2014-05-28 12:14:28 +02:00
souliane
50503332d2 memory: synchronize the upgrade to database v2 to be sure libervia's profile password is read to be written in the config file before its encryption 2014-05-23 13:00:35 +02:00
souliane
90115df6f1 tools: add missing file src/tools/config.py 2014-05-23 10:03:33 +02:00
souliane
c68b147398 memory: auto-update configuration file with libervia's passphrase when migrating the database 2014-05-23 09:59:15 +02:00
souliane
ae45889d50 plugins misc_account, misc_register_account: manually delete the sessions when not needed anymore 2014-05-21 23:17:51 +02:00
souliane
8be7416569 core, stdui (profile manager), quick_app: ask for another XMPP password when profile authentication succeed but XMPP connection fails 2014-05-21 23:15:01 +02:00
souliane
ea05b4e0d6 memory (params): fixes bugs in setParam:
- symbol 'd' was accessed without having been initialized when setting the empty value to a password which is not the profile password
    - the method was actually returning without waiting for the parameter to be set
2014-05-21 21:14:40 +02:00
souliane
cf7c18e56b plugin misc_accout: update relative to the introduction of profile password:
- check for the profile password instead of the xmpp password before a modification can be done
- "Change your password" action changes both passwords (a confirmation is asked)
2014-05-21 12:07:13 +02:00
souliane
d70cbb3b7f plugin misc_account: do not send the password with the confirmation email for account creation 2014-05-20 15:47:08 +02:00
souliane
8eddcc4ec9 memory (params): fix parameters of type "list" to use the default option when no individual value is set 2014-05-20 09:34:02 +02:00
souliane
c6e66eda24 fixes setup with PyCrypto minimal version 2014-05-16 11:26:46 +02:00
souliane
dd597a2ead core, memory, bridge, plugin misc_register_account: move registerNewAccount to a new plugin:
- the bridge method has been removed, now a plugin takes care of it with XMLUI callback system
    - TODO: xmpp.RegisteringAuthenticator still needs to be fixed
2014-05-16 00:58:20 +02:00
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