Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin->Advanced Settings-> Notification settings doesn't save / validate data #19

Closed
fpietrosanti opened this issue Feb 22, 2013 · 6 comments

Comments

@fpietrosanti
Copy link
Contributor

The admin interface for the notification settings does not save and does not valdate the data provided as input.

After saving, the data are not shown in the web interface (empty fields) even after a reload.

Additionally it does not do client validation on the following fields format:
SMTP server address
SMTP server port
Username
Password
Transport Security

@vecna
Copy link
Contributor

vecna commented Feb 23, 2013

Yes is totally true, At the moment this part of code is missing. May require a little analysis anyway, because:

  • Can't be enforced (a node may exists also if notification is not yet configured)
  • Can't be automatically update (because an admin can modify only the node name, etc)
  • Can be managed with a dedicated flag like "update notification" and in this case consider the notification fields or just ignore them

The best solution, is separate the notification settings from the node API. Instead of "Advanced Settings" in the Client would be "Mail configuration", and contains the same fields + the mail template.

@fpietrosanti
Copy link
Contributor Author

@hellais from UI perspective is that proposed approach something quick to be done?
@vecna Is this something relatively quick to be done?

@fpietrosanti
Copy link
Contributor Author

This feature prevent blocking of a major part of the workflow that are the notification, let's consider also the quickest approach to make the email notification testing possibile (so the feature working).

@vecna
Copy link
Contributor

vecna commented Feb 28, 2013

completed with the notification API refactor

@vecna vecna closed this as completed Feb 28, 2013
@fpietrosanti
Copy link
Contributor Author

re-opening because saving of fields doesn't work giving internal server error on dev.globaleaks.org.

That's the stacktrace:

2013-03-01 08:18:07+0000 [-] [Failure instance: Traceback: <type 'exceptions.ValueError'>: invalid literal for int() with base 10: 'x'
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/internet/defer.py:422:errback
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/internet/defer.py:489:_startRunCallbacks
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/internet/defer.py:576:_runCallbacks
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/internet/defer.py:1127:gotResult
--- ---
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/internet/defer.py:1069:_inlineCallbacks
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/python/failure.py:389:throwExceptionIntoGenerator
/data/GL0.2/dev/GLBackend/globaleaks/handlers/admin.py:678:put
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/python/threadpool.py:172:_worker
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/python/context.py:118:callWithContext
/data/GL0.2/dev/GLBackend/glenv/local/lib/python2.7/site-packages/twisted/python/context.py:81:callWithContext
/data/GL0.2/dev/GLBackend/globaleaks/settings.py:134:_wrap
]
2013-03-01 08:18:07+0000 [-] Uncaught exception PUT /admin/notification (93.32.150.70) :: HTTPRequest(protocol='http', host='dev.globaleaks.org:8082', method='PUT', uri='/admin/notification', version='HTTP/1.1', remote_ip='93.32.150.70', body='{"username":"x","activation_template":"","tip_template":"In %s as been created a new Tip for you\n\nYou can access using the unique link http://dev.globaleaks.org:8082/#/status/%s\\nThis is an E-Mail message to notify you that someone has selected you as a valuable recipient of\nWhistleBlowing material in the form of a Globaleaks tip-off. This message has been created\nby the GlobaLeaks Node [http://dev.globaleaks.org].\\nThis tip-off has been sent to you by\nan anonymous whistleblower. She/He would like it for you to\npay special attention to the information and material contained therein. Please consider\nthat whistleblowers often expose themselves to high personal risks in order to protect the public good. Therefore\nthe material that they provide with this tip-off should be considered of high importance.\nPlease do not forward or share this e-mail: each tip-off has a limited number of downloads and access before being\ndestroyed forever, nobody (even the node administrator) can recover\nand expired or dead tip-off.\n\n\n--------------------------------------------------\nGENERAL INFO\n--------------------------------------------------\n1. What is Globaleaks?\nGlobaLeaks is the first Open Source Whistleblowing Framework. It empowers anyone to easily setup and\nmaintain their own Whistleblowing platform. It is also a collection of what are the best practices for\npeople receiveiving and submitting material. GlobaLeaks works in all environments: media, activism, corporations, public agencies.\n2. Is GlobaLeaks sending me this Mail?\n\nNo, this mail has been sent to you by the Node called [http://dev.globaleaks.org]. They are running the GlobaLeaks Platform, but\nare not directly tied to the GlobaLeaks organization. GlobaLeaks (http://www.globaleaks.org) will never be directly\naffiliated with any real world WhistleBlowing sites, GlobaLeaks will only provide software and technical support.\n3. Why am I receiving this?\nYou're receiving this communication because an anonymous whistleblower has chosen you as a trustworthy contact\nfor releasing confidential and/or important information that could be of utmost importance.\nFor any other inquire please refer to %(sitename)s to the GlobaLeaks website at http://globaleaks.org\\n\\nBest regards,\n -- The email notification plugin\n","server":"ciao","comment_template":"","security":"ssl","password":"x","port":"x","file_template":""}', headers={'Content-Length': '2415', 'Accept-Language': 'en-US,en;q=0.5', 'Accept-Encoding': 'gzip, deflate', 'Host': 'dev.globaleaks.org:8082', 'Accept': 'application/json, text/plain, /', 'User-Agent': 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1', 'Dnt': '1', 'Connection': 'keep-alive', 'X-Requested-With': 'XMLHttpRequest', 'Referer': 'http://dev.globaleaks.org:8082/', 'X-Session': 'eEPXnvvVF3ATyoH3TOiTL83Qkq8ogtmQKVhLmDgfIA', 'Content-Type': 'application/json;charset=utf-8'})

@fpietrosanti fpietrosanti reopened this Mar 1, 2013
@vecna
Copy link
Contributor

vecna commented Mar 5, 2013

this thing is working fine since some days... and is unitTested

@vecna vecna closed this as completed Mar 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants