Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#1671 closed task (fixed)

[trac] Port notify.py local modification to newer version

Reported by: strk Owned by: strk
Priority: normal Milestone:
Component: Trac Keywords: trac
Cc: frankw, neteler

Description

Reading https://wiki.osgeo.org/wiki/Trac_Instances#Local_Customizations I found out there were local modifications to the "notification.py" module of Trac to lookup emails of OSGeo users. I dubt this local modification was ported when trac was updated.

Frank: what was the local modification useful for ? How to test if it works ?

Change History (26)

comment:1 Changed 3 years ago by strk

The wiki page references #39 for background

comment:2 Changed 3 years ago by Mateusz Łoskot

This might be related:

Trac, all OSGeo instances, suddenly stopped delivering email notifications to my inbox. I have noticed, that Full Name and E-mail fields in all https://trac.osgeo.org/<PROJET>/prefs I use are empty.

Once I fill those in, Trac e-mail notifications work again.

comment:3 Changed 3 years ago by strk

Do you remember approximately when did things stop working ? So to relate it on either trac version upgrade or something different.

comment:4 Changed 3 years ago by Mateusz Łoskot

I have not received notification about new GEOS ticket 7 days ago (https://trac.osgeo.org/geos/ticket/778) - I used to receive all new tickets emailed. But, surely, I did not receive notification with comments to ticket I reported today and that made me check what is going on.

comment:5 Changed 3 years ago by neteler

FWIW, trac/GRASS delivers emails.

Perhaps a potential issue in GEOS or related to mloskot's email could be spotted in the mail.log file on trac? (also /etc/aliases comes to mind which might interfere).

comment:6 Changed 3 years ago by strk

Markus: do you have your name and address in https://trac.osgeo.org/grass/prefs ? (General tab)

comment:7 Changed 3 years ago by strk

Mateusz: according to the /prefs/ text, those settings are stored in a session and the session is referenced from a cookie. If I recall correctly those cookies expire with the session, could you check with a cookie inspector ?

I'm looking in the database and do see your preferences in the session_attribute table under the sid value of 'mloskot', but for example I don't see Markus ones in the grass database instance.

comment:8 Changed 3 years ago by Mateusz Łoskot

Sandro, AFAIK, the cookie is used only if a user is not signed in to the Trac with username/password.

I don't see those values stored in any of cookies associated with trac.osgeo.org.

Last edited 3 years ago by Mateusz Łoskot (previous) (diff)

comment:9 Changed 3 years ago by strk

Could be. In any case there are only 3 sessions in GEOS that have an 'email' attribute, 1 in GRASS and 7 in PostGIS.

Of this total of 11, yours and the one for "googlerocks" (a spammer) are the only ones named after an actual user.

The other 10 also look like having fake emails.

So I'm still curious to know how Markus receives his notifications, if at all

comment:10 Changed 3 years ago by rouault

I no longer receive email notifications from Trac ticket changes and I see that https://trac.osgeo.org/gdal/prefs is now empty. Such issue (empty email) occured several months ago when Trac version was upgraded and I add to enter it back at that time. I suspect that all users are affected by the emptied email ?

comment:11 Changed 3 years ago by strk

I wonder if it's been myself wiping out the session attributes while fighting spammers. Cannot exclude that (but I guess I could look at the backups to verify). The other possibility is that session attributes are removed when they do not have a match in the session itself (which is more likely that I could have removed, thinking it would hold no important info). I'll try the latter.

In any case, it doesn't seem nice to require entering preferences in each and every instance. We're the same community here, using a single sign-on, so we should really aim at making this automatic. Besides, judging from the actual values in those attribute tables, chances are spammers are using notifications as a way to spam arbitrary email addresses, by writing them into the session preference.

For configuration, see https://trac.edgewall.org/wiki/TracNotification (but please dont' configure your instances independently, we want to use the global config as much as possible).

comment:12 Changed 3 years ago by dbaston

The PostGIS trac instance has been "forgetting" my name and email address for some time (years, I think). I enter it in, it sticks for some time (how long, I'm not sure), and eventually is wiped out. So it may not be related to a recent update.

comment:13 Changed 3 years ago by strk

Confirmed: wiping a session first makes the session attributes orphaned (so that /prefs/ results blanked out) and finally (on log-out) wipes the attributes. The oldest backup that I made myself was from 20160503 and did not have Mateusz' email in session_attribute, nor Even's (for GDAL instance).

Every clue points to this lack of port of a patch Frank Warmerdam applied to the notify.py script, to make it use the email registered with LDAP for figuring out users email.

So, it only takes someone to find that patch and port it (and ideally make it general and send upstream).

Daniel: I know you're always ready for new challenges ! :)

comment:14 Changed 3 years ago by Mateusz Łoskot

I've never had to enter anything in Preferences per each OSGeo Trac instance to get notifications working.

comment:15 Changed 3 years ago by strk

Mateusz: that confirms it was Frank's notify.py change doing the magic

comment:16 in reply to:  6 Changed 3 years ago by neteler

Replying to strk:

Markus: do you have your name and address in https://trac.osgeo.org/grass/prefs ? (General tab)

No, it is empty.

As a test, I just edited a ticket:

and the email notification reached the list (<<--- this is how we have set it up in grass-dev):

Looks all good here. Maybe this setting differs from other OSGeo projects but for us it is fine.

comment:17 Changed 3 years ago by strk

Reaching the list is not a problem. Reaching individual users is (like someone added in Cc, I guess)

comment:18 Changed 3 years ago by strk

Component: Systems AdminTrac
Owner: changed from sac@… to strk

comment:19 Changed 3 years ago by strk

See also #128 for more information about the notification.py hack

comment:20 Changed 3 years ago by strk

I'm looking at this

comment:21 Changed 3 years ago by strk

testing

comment:22 Changed 3 years ago by strk2

Does it work yet ??

Last edited 3 years ago by strk (previous) (diff)

comment:23 Changed 3 years ago by strk

Cc: neteler added

I've ported the changes, but cannot confirm they are working as expected

comment:24 Changed 3 years ago by strk2

As trac supports considering unqualified names as addresses in a given domain, it could be less of an hack to setup dynamic aliases for OSGeo users

comment:25 Changed 3 years ago by nhv

test

comment:26 Changed 3 years ago by strk

Resolution: fixed
Status: newclosed

Thanks, everything works now :)

Note: See TracTickets for help on using tickets.