[SAC] [OSGeo] #1671: [trac] Port notify.py local modification to newer version

#1671: [trac] Port notify.py local modification to newer version
---------------------------+-------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Keywords: trac
---------------------------+-------------------
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 ?

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by strk):

The wiki page references #39 for background

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:1&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by mloskot):

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/&lt;PROJET&gt;/prefs I use are empty.

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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:2&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by strk):

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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:3&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by mloskot):

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.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:4&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (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).

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:5&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by strk):

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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:6&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (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.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:7&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by mloskot):

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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:8&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:9&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (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 ?

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:10&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (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).

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:11&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (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.

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:12&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (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 ! :slight_smile:

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:13&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by mloskot):

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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:14&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by strk):

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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:15&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by neteler):

Replying to [comment:6 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:
  * https://trac.osgeo.org/grass/ticket/2708#comment:15
and the email notification reached the list (<<--- this is how we have set
it up in grass-dev):
  * https://lists.osgeo.org/pipermail/grass-dev/2016-May/080310.html

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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:16&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
---------------------------+--------------------
Reporter: strk | Owner: sac@…
     Type: task | Status: new
Priority: normal | Milestone:
Component: Systems Admin | Resolution:
Keywords: trac |
---------------------------+--------------------

Comment (by strk):

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

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:17&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.

#1671: [trac] Port notify.py local modification to newer version
--------------------+-------------------
Reporter: strk | Owner: strk
     Type: task | Status: new
Priority: normal | Milestone:
Component: Trac | Resolution:
Keywords: trac |
--------------------+-------------------
Changes (by strk):

* owner: sac@… => strk
* component: Systems Admin => Trac

--
Ticket URL: <https://trac.osgeo.org/osgeo/ticket/1671#comment:18&gt;
OSGeo <http://www.osgeo.org/&gt;
OSGeo committee and general foundation issue tracker.