Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


On Friday, December 4, 2020 at 7:48:52 PM UTC-8 Chris Nelson wrote:

> On Fri, Dec 4, 2020 at 9:01 PM RjOllos  wrote:
>
>> I didn't think this through. The emails are plain text, and "ticket.link" 
>> is just a unicode string, not an HTML element.
>> >>> env.abs_href.ticket(1)
>> u'http://example.org/trac.cgi/ticket/1'
>>
>
> Ah, so there's not "href" to replace!  I think that to affect the body 
> (e.g., a comment or changed description), I need to do it in code.  I'll 
> look into that.
>
>> However, I did find that click tracking can be turned off, and it worked 
>> on my end.
>> https://app.sendgrid.com/settings/tracking
>>
>>
> Yes, but that is for the whole account. We use this for three different 
> applications and Trac is the only one where I know I don't want tracking.
>

I'm surprised SendGrid is modifying the plain text emails. You might have 
to ask them if there's a way to do the equivalent of clicktracking=off for 
plain text emails.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/604db06d-07d5-483d-86ad-5da6d103e6cbn%40googlegroups.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread RjOllos


On Friday, December 4, 2020 at 7:44:54 PM UTC-8 RjOllos wrote:

> On Fri, Dec 4, 2020 at 7:41 PM Eliya Voldman  wrote:
>
>> Sorry, it was my typo about 'autocomplete' in cgi-bin above 
>>
>> I don't have autocompleteusers directory or file under $env.
>>
> You shouldn't. I didn't suggest it should be the case.
>  
>
>> I have only autocomplete
>>
>> $ ls www/chrome/ www/htdocs/
>>
>> www/chrome/:
>>
>> autocomplete/  common/  site/  web.config
>>
>>  
>>
>> www/htdocs/:
>>
>> autocomplete/  common/  site/
>>
>>  
>>
>> We are not using Apache but IIS and the path is D:\Trac\nbdr\www
>>
>> Thanks again, it wasn't easy but I am happy now that with your help I  
>> completed the task
>>
>
> Okay, so you had to copy www/htdocs/autocomplete to 
> www/chrome/autocomplete? I think this is due to your Alias configuration. 
> The manual copy operation shouldn't be needed. 
>
> I don't know how IIS configures Aliases, but there is probably something 
> similar.
>

The reason I'm suggesting to get to the bottom of this, and make it works 
without the manual directory copy, is that I think there's something off or 
not fully understood with your configuration, and you may run into problems 
later if you upgrade Trac. Anyway, just keep in mind in case you have 
trouble later. 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/8988e107-6f0b-4a99-aa72-982c876cde3an%40googlegroups.com.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread Christopher Nelson
On Fri, Dec 4, 2020 at 9:01 PM RjOllos  wrote:

> I didn't think this through. The emails are plain text, and "ticket.link"
> is just a unicode string, not an HTML element.
> >>> env.abs_href.ticket(1)
> u'http://example.org/trac.cgi/ticket/1'
>

Ah, so there's not "href" to replace!  I think that to affect the body
(e.g., a comment or changed description), I need to do it in code.  I'll
look into that.

> However, I did find that click tracking can be turned off, and it worked
> on my end.
> https://app.sendgrid.com/settings/tracking
>
>
Yes, but that is for the whole account. We use this for three different
applications and Trac is the only one where I know I don't want tracking.


-- 
Christopher Nelson, PE
Professional Software Engineer
@ChrisNelsonPE
LinkedIn.com/in/ChrisNelsonPE
NoPerfectProgram.Wordpress.com

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CAFFqYiAEgPwb38mY8xcDK0pRNBAgG4LL6bdNsaTWt9QPC4LaQA%40mail.gmail.com.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


On Friday, December 4, 2020 at 7:45:45 PM UTC-8 Chris Nelson wrote:

> On Fri, Dec 4, 2020 at 7:43 PM RjOllos  wrote:
>
>> On Friday, December 4, 2020 at 12:20:26 PM UTC-8 Chris Nelson wrote:
>>
>>> On Thu, Dec 3, 2020 at 2:03 PM RjOllos  wrote:
>>>
 On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:

> Thanks.  I'll try that.  But I realize I'm going to need to also 
> handle links in the body of the notification (e.g., if a comment or 
> ticket 
> description change includes a link).
>

 I use SendGrid for my Trac development instances. How are the  
 elements formatted when click tracking is enabled? The emails I receive to 
 gmail have a "data-saferedirecturl" attribute that looks like it might be 
 related to the click tracking, but I don't know how click tracking works.

>>>
>>> My email notifications come in with URLs that start like 
>>>
>>> Ticket URL: >>
>>> then wrap to four more lines which look like gibberish.  Clicking goes 
>>> to SendGrid, records my click, then redirects to Trac.  It'd be nice if 
>>> SendGrid let you turn off click tracking by API key so one defaulted to on 
>>> and another defaulted to off but I don't seem to be able to find that, if 
>>> it exists.
>>>
>>> I've edited every instance of `ticket_notify_email.txt` on my server 
>>> (even just to change "URL" to "url") but the change doesn't show up on 
>>> notifications, even after restarting `tracd`.  My Trac admin skills are 
>>> really stale. :-(
>>>
>>
>> That's weird, I've never seen it, and I'm just using the free account.
>>
>
> We are on Silver Tier (I think), the lowest paid level.
>
>> To customize `ticket_notify_email.txt`, put a copy in $env/templates. It 
>> should be picked up by a server restart.
>>
> I'll try that.  Thanks.
>
> Is there a way to restart `tracd` other than killing and running it 
> again?  I looked for a signal to send it or something but didn't find any 
> documentation. 
>

I'm not aware of way, other than killing the process. 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/68bd43be-91d5-4186-b9c2-c667c2d44595n%40googlegroups.com.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread Christopher Nelson
On Fri, Dec 4, 2020 at 7:43 PM RjOllos  wrote:

> On Friday, December 4, 2020 at 12:20:26 PM UTC-8 Chris Nelson wrote:
>
>> On Thu, Dec 3, 2020 at 2:03 PM RjOllos  wrote:
>>
>>> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>>>
 Thanks.  I'll try that.  But I realize I'm going to need to also handle
 links in the body of the notification (e.g., if a comment or ticket
 description change includes a link).

>>>
>>> I use SendGrid for my Trac development instances. How are the 
>>> elements formatted when click tracking is enabled? The emails I receive to
>>> gmail have a "data-saferedirecturl" attribute that looks like it might be
>>> related to the click tracking, but I don't know how click tracking works.
>>>
>>
>> My email notifications come in with URLs that start like
>>
>> Ticket URL: >
>> then wrap to four more lines which look like gibberish.  Clicking goes to
>> SendGrid, records my click, then redirects to Trac.  It'd be nice if
>> SendGrid let you turn off click tracking by API key so one defaulted to on
>> and another defaulted to off but I don't seem to be able to find that, if
>> it exists.
>>
>> I've edited every instance of `ticket_notify_email.txt` on my server
>> (even just to change "URL" to "url") but the change doesn't show up on
>> notifications, even after restarting `tracd`.  My Trac admin skills are
>> really stale. :-(
>>
>
> That's weird, I've never seen it, and I'm just using the free account.
>

We are on Silver Tier (I think), the lowest paid level.

> To customize `ticket_notify_email.txt`, put a copy in $env/templates. It
> should be picked up by a server restart.
>
I'll try that.  Thanks.

Is there a way to restart `tracd` other than killing and running it again?
I looked for a signal to send it or something but didn't find any
documentation.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CAFFqYiDhUUyGGjz%3D8LMdEdUiPsqVAM5QY--Yc0MNA8T7G-Rvww%40mail.gmail.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread Ryan Ollos
On Fri, Dec 4, 2020 at 7:41 PM Eliya Voldman  wrote:

> Sorry, it was my typo about 'autocomplete' in cgi-bin above
>
> I don't have autocompleteusers directory or file under $env.
>
You shouldn't. I didn't suggest it should be the case.


> I have only autocomplete
>
> $ ls www/chrome/ www/htdocs/
>
> www/chrome/:
>
> autocomplete/  common/  site/  web.config
>
>
>
> www/htdocs/:
>
> autocomplete/  common/  site/
>
>
>
> We are not using Apache but IIS and the path is D:\Trac\nbdr\www
>
> Thanks again, it wasn't easy but I am happy now that with your help I
> completed the task
>

Okay, so you had to copy www/htdocs/autocomplete to
www/chrome/autocomplete? I think this is due to your Alias configuration.
The manual copy operation shouldn't be needed.

I don't know how IIS configures Aliases, but there is probably something
similar.

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CA%2BBGpn9-4w-H1YLzeybBSEEu%2B1wS_9zZsGidebtQtGPKenVzww%40mail.gmail.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread Eliya Voldman


Sorry, it was my typo about 'autocomplete' in cgi-bin above 

I don't have autocompleteusers directory or file under $env. I have only 
autocomplete

$ ls www/chrome/ www/htdocs/

www/chrome/:

autocomplete/  common/  site/  web.config

 

www/htdocs/:

autocomplete/  common/  site/

 

We are not using Apache but IIS and the path is D:\Trac\nbdr\www

Thanks again, it wasn't easy but I am happy now that with your help I  
completed the task
On Friday, December 4, 2020 at 10:27:26 PM UTC-5 RjOllos wrote:

> On Friday, December 4, 2020 at 6:45:56 PM UTC-8 RjOllos wrote:
>
>> On Fri, Dec 4, 2020 at 6:20 PM Eliya Voldman  wrote:
>>
>>> Hi Ryan,
>>> Finally I was able to implement 'autocompleteusers' option.
>>> The trick was to copy 'autocomplete' directory from cgi-bin to chrome 
>>> directory
>>> Now both 'autocomplete' and 'drop-down' works fine
>>>
>>> Highly appreciate your help
>>>
>>
>> autocomplete in cgi-bin? Are you sure? Hopefully the directory is named 
>> "autocompleteusers" and is not found in cgi-bin after deployment.
>>
>> Here is an example:
>>
>> $ trac-admin ../tracenvs/proj-1.4 deploy www
>> Copying resources from:
>>   trac.web.chrome.Chrome
>> 
>> /Users/rjollos/.pyenv/versions/trac-2.7/lib/python2.7/site-packages/Trac-1.4.2-py2.7.egg/trac/htdocs
>> /Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.4/htdocs
>>   autocompleteusers.autocompleteusers.AutocompleteUsers
>> 
>> /Users/rjollos/.pyenv/versions/trac-2.7/lib/python2.7/site-packages/TracAutocompleteUsersPlugin-1.0.dev0-py2.7.egg/autocompleteusers/htdocs
>> Creating scripts.
>>
>> $ find www/htdocs/autocompleteusers/
>> www/htdocs/autocompleteusers/
>> www/htdocs/autocompleteusers//css
>> www/htdocs/autocompleteusers//css/autocomplete.css
>> www/htdocs/autocompleteusers//css/indicator.gif
>> www/htdocs/autocompleteusers//js
>> www/htdocs/autocompleteusers//js/autocomplete_ticket.js
>> www/htdocs/autocompleteusers//js/autocomplete.js
>> www/htdocs/autocompleteusers//js/format_item.js
>> www/htdocs/autocompleteusers//js/autocomplete_query.js
>> www/htdocs/autocompleteusers//js/autocomplete_perms.js 
>>
>> It works for me.
>>
>> What are your Alias directives in the Apache config?
>>
>> Ryan
>>
>
> Another possibility, your Alias is too specific. Currently, we recommend:
>
> Alias /trac/chrome D:\Trac\NBDR\www\htdocs 
>
> See:
> https://trac.edgewall.org/wiki/TracInstall#MappingStaticResources
>
> In the past our documentation defined more specific aliases:
>
> Alias /trac/chrome/common D:\Trac\NBDR\www\htdocs\common
> Alias /trac/chrome/site D:\Trac\NBDR\www\htdocs\site
>
> See:
> https://trac.edgewall.org/wiki/0.12/TracInstall#MappingStaticResources
>
> However, there's no real advantage to the latter and it can cause problems 
> like the one you are experiencing. Adding TracAutocompleteUsers plugin adds 
> the path:
> D:\Trac\NBDR\www\htdocs\autocompleteusers
> which wouldn't be picked up by the latter set of aliases. An additional 
> alias would be needed.
>
> We had a long discussion about that on trac-dev a few years back.
>
> Ryan
>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/4b8f2eee-2f54-41f5-866f-cbd0766c12d6n%40googlegroups.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread RjOllos


On Friday, December 4, 2020 at 6:45:56 PM UTC-8 RjOllos wrote:

> On Fri, Dec 4, 2020 at 6:20 PM Eliya Voldman  wrote:
>
>> Hi Ryan,
>> Finally I was able to implement 'autocompleteusers' option.
>> The trick was to copy 'autocomplete' directory from cgi-bin to chrome 
>> directory
>> Now both 'autocomplete' and 'drop-down' works fine
>>
>> Highly appreciate your help
>>
>
> autocomplete in cgi-bin? Are you sure? Hopefully the directory is named 
> "autocompleteusers" and is not found in cgi-bin after deployment.
>
> Here is an example:
>
> $ trac-admin ../tracenvs/proj-1.4 deploy www
> Copying resources from:
>   trac.web.chrome.Chrome
> 
> /Users/rjollos/.pyenv/versions/trac-2.7/lib/python2.7/site-packages/Trac-1.4.2-py2.7.egg/trac/htdocs
> /Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.4/htdocs
>   autocompleteusers.autocompleteusers.AutocompleteUsers
> 
> /Users/rjollos/.pyenv/versions/trac-2.7/lib/python2.7/site-packages/TracAutocompleteUsersPlugin-1.0.dev0-py2.7.egg/autocompleteusers/htdocs
> Creating scripts.
>
> $ find www/htdocs/autocompleteusers/
> www/htdocs/autocompleteusers/
> www/htdocs/autocompleteusers//css
> www/htdocs/autocompleteusers//css/autocomplete.css
> www/htdocs/autocompleteusers//css/indicator.gif
> www/htdocs/autocompleteusers//js
> www/htdocs/autocompleteusers//js/autocomplete_ticket.js
> www/htdocs/autocompleteusers//js/autocomplete.js
> www/htdocs/autocompleteusers//js/format_item.js
> www/htdocs/autocompleteusers//js/autocomplete_query.js
> www/htdocs/autocompleteusers//js/autocomplete_perms.js 
>
> It works for me.
>
> What are your Alias directives in the Apache config?
>
> Ryan
>

Another possibility, your Alias is too specific. Currently, we recommend:

Alias /trac/chrome D:\Trac\NBDR\www\htdocs 

See:
https://trac.edgewall.org/wiki/TracInstall#MappingStaticResources

In the past our documentation defined more specific aliases:

Alias /trac/chrome/common D:\Trac\NBDR\www\htdocs\common
Alias /trac/chrome/site D:\Trac\NBDR\www\htdocs\site

See:
https://trac.edgewall.org/wiki/0.12/TracInstall#MappingStaticResources

However, there's no real advantage to the latter and it can cause problems 
like the one you are experiencing. Adding TracAutocompleteUsers plugin adds 
the path:
D:\Trac\NBDR\www\htdocs\autocompleteusers
which wouldn't be picked up by the latter set of aliases. An additional 
alias would be needed.

We had a long discussion about that on trac-dev a few years back.

Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/86a9c2ab-8747-4ea7-ac03-955feadaa6b2n%40googlegroups.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread Ryan Ollos
On Fri, Dec 4, 2020 at 6:20 PM Eliya Voldman  wrote:

> Hi Ryan,
> Finally I was able to implement 'autocompleteusers' option.
> The trick was to copy 'autocomplete' directory from cgi-bin to chrome
> directory
> Now both 'autocomplete' and 'drop-down' works fine
>
> Highly appreciate your help
>

autocomplete in cgi-bin? Are you sure? Hopefully the directory is named
"autocompleteusers" and is not found in cgi-bin after deployment.

Here is an example:

$ trac-admin ../tracenvs/proj-1.4 deploy www
Copying resources from:
  trac.web.chrome.Chrome

/Users/rjollos/.pyenv/versions/trac-2.7/lib/python2.7/site-packages/Trac-1.4.2-py2.7.egg/trac/htdocs
/Users/rjollos/Documents/Workspace/trac-dev/tracenvs/proj-1.4/htdocs
  autocompleteusers.autocompleteusers.AutocompleteUsers

/Users/rjollos/.pyenv/versions/trac-2.7/lib/python2.7/site-packages/TracAutocompleteUsersPlugin-1.0.dev0-py2.7.egg/autocompleteusers/htdocs
Creating scripts.

$ find www/htdocs/autocompleteusers/
www/htdocs/autocompleteusers/
www/htdocs/autocompleteusers//css
www/htdocs/autocompleteusers//css/autocomplete.css
www/htdocs/autocompleteusers//css/indicator.gif
www/htdocs/autocompleteusers//js
www/htdocs/autocompleteusers//js/autocomplete_ticket.js
www/htdocs/autocompleteusers//js/autocomplete.js
www/htdocs/autocompleteusers//js/format_item.js
www/htdocs/autocompleteusers//js/autocomplete_query.js
www/htdocs/autocompleteusers//js/autocomplete_perms.js

It works for me.

What are your Alias directives in the Apache config?

Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CA%2BBGpn-XeSrPQOAmO2N3T9gubrr2B3bsh4agyyd9DUaea2oyOA%40mail.gmail.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread Eliya Voldman
Hi Ryan,
Finally I was able to implement 'autocompleteusers' option.
The trick was to copy 'autocomplete' directory from cgi-bin to chrome 
directory
Now both 'autocomplete' and 'drop-down' works fine

Highly appreciate your help

On Friday, December 4, 2020 at 7:32:02 PM UTC-5 RjOllos wrote:

> On Friday, December 4, 2020 at 4:19:55 PM UTC-8 evol...@gmail.com wrote:
>
>> Hi Ryan,
>>
>> I deleted cgi-bin and htdocs
>>
> I ran the script:
>>
>> D:\Trac\NBDR>trac-admin D:\Trac\NBDR deploy D:\Trac\NBDR\www
>>
>> Copying resources from:
>>
>>   trac.web.chrome.Chrome
>>
>> d:\trac\python27\lib\site-packages\trac\htdocs
>>
>> d:\trac\NBDR\htdocs
>>
>>   autocompleteusers.autocompleteusers.AutocompleteUsers
>>
>> d:\trac\python27\lib\site-packages\autocompleteusers\htdocs
>>
>> Creating scripts.
>>
>>  
>>
>> D:\Trac\NBDR>
>>
>> --
>>
>> It created new scripts:
>>
>> $ ls /d/Trac/NBDR/www/htdocs/autocomplete/*
>>
>> /d/Trac/NBDR/www/htdocs/autocomplete/css:
>>
>> autocomplete.css  indicator.gif
>>
>>  
>>
>> /d/Trac/NBDR/www/htdocs/autocomplete/js:
>>
>> autocomplete.js  autocomplete_perms.js  autocomplete_query.js  
>> autocomplete_ticket.js  format_item.js
>>
>> --
>>
>> I restarted webserver.
>>
>> It failed to start TRAC with 500.
>>
>> Then I realized that 'new' cgi-bin miss 2 files:
>>
>> old: $ls /d/Trac/NBDR/www/cgi-bin/
>>
>> trac.cgi*  trac.fcgi*  trac.wsgi*  trac_wsgi.py*  trac_wsgi.pyc
>>
>> new: $ls /d/Trac/NBDR/www/cgi-bin/
>>
>> trac.cgi*  trac.fcgi*  trac.wsgi* 
>>
>> Hence I copied those 2 files and was able to start TRAC.
>>
>
> The pyc file is created automatically by the Python interpretter.
>
> For trac_wsgi.py, I'd recommend locating it somewhere other than cgi-bin. 
> Or, write a deploy script that delete www, runs deploy, and then copies 
> $env/trac_wsgi.py to $www/cgi-bi
>
> You'll need to redeploy every time you upgrade Trac and when installing or 
> upgrading most plugins (any plugins that have static assets: JS, CC, 
> Images).
>  
>
>> trac.ini has these blocks:
>>
>> [components]
>>
>> autocompleteusers.* = enabled
>>
>>  
>>
>> [autocomplete]
>>
>> fields = tester, reviewer
>>
>> multi_fields = users
>>
>> --
>>
>> I tried to create a new ticket. I used Cc field to check but it still 
>> does not autocomplete users
>>
>> What else could be wrong?
>>
>> Thanks
>>
>
> You've disabled [ticket] restrict_owner, correct?:  
> https://trac.edgewall.org/wiki/TracIni#ticket-restrict_owner-option
>
> The reporter (if available), CC and owner field (in the ticket workflow 
> controls) should be autocompleted. The [autocomplete] section isn't needed 
> unless you have additional fields that you'd like to autocomplete.
>
> Make sure to do a hard-refresh of your browser and then retest. How to do 
> so is described in the box here:
> https://trac.edgewall.org/wiki/TracUpgrade#a6.Refreshstaticresources
>
> Check the console again for errors if the issue persists.
>
> Ryan
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/22a6b39b-1b62-4645-8273-4c894e414f35n%40googlegroups.com.


[Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


On Wednesday, November 25, 2020 at 10:12:48 AM UTC-8 RjOllos wrote:

> On Wednesday, November 25, 2020 at 9:44:03 AM UTC-8 Chris Nelson wrote:
>
>> I'm using SendGrid as my mail relay for Trac 1.0.1 notifications.  It 
>> adds click tracking to URls so the footer of the notification looks a 
>> mess.  I can suppress this by adding "clicktracking=off" before "href" in 
>> the  tab but I can't figure out how to do that.  I've 
>> edited  ticket_notify_email.txt to end:
>>
>> ${_('Ticket URL: <%(link.replace("href", "clicktracking=off href"))s>', 
>> link=ticket.link}
>>
>> And a couple of other alternatives but the changes I thought were 
>> promising seem to be syntax errors which break the template and I don't get 
>> notified at all.  Genshi is not my strong suit so I'm kind of blindly 
>> trying things that seem like they might work but I could use some 
>> guidance.  Thanks.
>>
>
> Try this:
>
> ${_('Ticket URL: <%(link)s>', link=ticket.link.replace("href", 
> "clicktracking=off href")} 
>
> If that doesn't work, then:
>
> {% with link=ticket.link.replace("href", "clicktracking=off href") %}\
> ${_('Ticket URL: <%(link)s>', link=link} 
> {% end %}\
>
>
> Ryan
>

I didn't think this through. The emails are plain text, and "ticket.link" 
is just a unicode string, not an HTML element.
>>> env.abs_href.ticket(1)
u'http://example.org/trac.cgi/ticket/1'

However, I did find that click tracking can be turned off, and it worked on 
my end.
https://app.sendgrid.com/settings/tracking

[image: Screen Shot 2020-12-04 at 17.59.39.jpg] 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/f2fb6cbb-f52b-4cda-a56b-1d5d262cb458n%40googlegroups.com.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


On Friday, December 4, 2020 at 4:43:18 PM UTC-8 RjOllos wrote:

> On Friday, December 4, 2020 at 12:20:26 PM UTC-8 Chris Nelson wrote:
>
>> On Thu, Dec 3, 2020 at 2:03 PM RjOllos  wrote:
>>
>>> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>>>
 Thanks.  I'll try that.  But I realize I'm going to need to also handle 
 links in the body of the notification (e.g., if a comment or ticket 
 description change includes a link).

>>>
>>> I use SendGrid for my Trac development instances. How are the  
>>> elements formatted when click tracking is enabled? The emails I receive to 
>>> gmail have a "data-saferedirecturl" attribute that looks like it might be 
>>> related to the click tracking, but I don't know how click tracking works.
>>>
>>
>> My email notifications come in with URLs that start like 
>>
>> Ticket URL: >
>> then wrap to four more lines which look like gibberish.  Clicking goes to 
>> SendGrid, records my click, then redirects to Trac.  It'd be nice if 
>> SendGrid let you turn off click tracking by API key so one defaulted to on 
>> and another defaulted to off but I don't seem to be able to find that, if 
>> it exists.
>>
>> I've edited every instance of `ticket_notify_email.txt` on my server 
>> (even just to change "URL" to "url") but the change doesn't show up on 
>> notifications, even after restarting `tracd`.  My Trac admin skills are 
>> really stale. :-(
>>
>
> That's weird, I've never seen it, and I'm just using the free account.
>

Actually, just reproduced. Will investigate.
 

> To customize `ticket_notify_email.txt`, put a copy in $env/templates. It 
> should be picked up by a server restart.
>
> Ryan 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/0e9933dd-9f25-481b-97b3-c81b5db982acn%40googlegroups.com.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread RjOllos


On Friday, December 4, 2020 at 12:20:26 PM UTC-8 Chris Nelson wrote:

> On Thu, Dec 3, 2020 at 2:03 PM RjOllos  wrote:
>
>> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>>
>>> Thanks.  I'll try that.  But I realize I'm going to need to also handle 
>>> links in the body of the notification (e.g., if a comment or ticket 
>>> description change includes a link).
>>>
>>
>> I use SendGrid for my Trac development instances. How are the  
>> elements formatted when click tracking is enabled? The emails I receive to 
>> gmail have a "data-saferedirecturl" attribute that looks like it might be 
>> related to the click tracking, but I don't know how click tracking works.
>>
>
> My email notifications come in with URLs that start like 
>
> Ticket URL: 
> then wrap to four more lines which look like gibberish.  Clicking goes to 
> SendGrid, records my click, then redirects to Trac.  It'd be nice if 
> SendGrid let you turn off click tracking by API key so one defaulted to on 
> and another defaulted to off but I don't seem to be able to find that, if 
> it exists.
>
> I've edited every instance of `ticket_notify_email.txt` on my server (even 
> just to change "URL" to "url") but the change doesn't show up on 
> notifications, even after restarting `tracd`.  My Trac admin skills are 
> really stale. :-(
>

That's weird, I've never seen it, and I'm just using the free account.

To customize `ticket_notify_email.txt`, put a copy in $env/templates. It 
should be picked up by a server restart.

Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/f020655d-629d-4095-9e29-e51cf3df2f25n%40googlegroups.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread RjOllos


On Friday, December 4, 2020 at 4:19:55 PM UTC-8 evol...@gmail.com wrote:

> Hi Ryan,
>
> I deleted cgi-bin and htdocs
>
> I ran the script:
>
> D:\Trac\NBDR>trac-admin D:\Trac\NBDR deploy D:\Trac\NBDR\www
>
> Copying resources from:
>
>   trac.web.chrome.Chrome
>
> d:\trac\python27\lib\site-packages\trac\htdocs
>
> d:\trac\NBDR\htdocs
>
>   autocompleteusers.autocompleteusers.AutocompleteUsers
>
> d:\trac\python27\lib\site-packages\autocompleteusers\htdocs
>
> Creating scripts.
>
>  
>
> D:\Trac\NBDR>
>
> --
>
> It created new scripts:
>
> $ ls /d/Trac/NBDR/www/htdocs/autocomplete/*
>
> /d/Trac/NBDR/www/htdocs/autocomplete/css:
>
> autocomplete.css  indicator.gif
>
>  
>
> /d/Trac/NBDR/www/htdocs/autocomplete/js:
>
> autocomplete.js  autocomplete_perms.js  autocomplete_query.js  
> autocomplete_ticket.js  format_item.js
>
> --
>
> I restarted webserver.
>
> It failed to start TRAC with 500.
>
> Then I realized that 'new' cgi-bin miss 2 files:
>
> old: $ls /d/Trac/NBDR/www/cgi-bin/
>
> trac.cgi*  trac.fcgi*  trac.wsgi*  trac_wsgi.py*  trac_wsgi.pyc
>
> new: $ls /d/Trac/NBDR/www/cgi-bin/
>
> trac.cgi*  trac.fcgi*  trac.wsgi* 
>
> Hence I copied those 2 files and was able to start TRAC.
>

The pyc file is created automatically by the Python interpretter.

For trac_wsgi.py, I'd recommend locating it somewhere other than cgi-bin. 
Or, write a deploy script that delete www, runs deploy, and then copies 
$env/trac_wsgi.py to $www/cgi-bi

You'll need to redeploy every time you upgrade Trac and when installing or 
upgrading most plugins (any plugins that have static assets: JS, CC, 
Images).
 

> trac.ini has these blocks:
>
> [components]
>
> autocompleteusers.* = enabled
>
>  
>
> [autocomplete]
>
> fields = tester, reviewer
>
> multi_fields = users
>
> --
>
> I tried to create a new ticket. I used Cc field to check but it still does 
> not autocomplete users
>
> What else could be wrong?
>
> Thanks
>

You've disabled [ticket] restrict_owner, 
correct?:  https://trac.edgewall.org/wiki/TracIni#ticket-restrict_owner-option

The reporter (if available), CC and owner field (in the ticket workflow 
controls) should be autocompleted. The [autocomplete] section isn't needed 
unless you have additional fields that you'd like to autocomplete.

Make sure to do a hard-refresh of your browser and then retest. How to do 
so is described in the box here:
https://trac.edgewall.org/wiki/TracUpgrade#a6.Refreshstaticresources

Check the console again for errors if the issue persists.

Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/182a8159-b848-4d77-be26-d5de9594a136n%40googlegroups.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread Eliya Voldman


Hi Ryan,

I deleted cgi-bin and htdocs

I ran the script:

D:\Trac\NBDR>trac-admin D:\Trac\NBDR deploy D:\Trac\NBDR\www

Copying resources from:

  trac.web.chrome.Chrome

d:\trac\python27\lib\site-packages\trac\htdocs

d:\trac\NBDR\htdocs

  autocompleteusers.autocompleteusers.AutocompleteUsers

d:\trac\python27\lib\site-packages\autocompleteusers\htdocs

Creating scripts.

 

D:\Trac\NBDR>

--

It created new scripts:

$ ls /d/Trac/NBDR/www/htdocs/autocomplete/*

/d/Trac/NBDR/www/htdocs/autocomplete/css:

autocomplete.css  indicator.gif

 

/d/Trac/NBDR/www/htdocs/autocomplete/js:

autocomplete.js  autocomplete_perms.js  autocomplete_query.js  
autocomplete_ticket.js  format_item.js

--

I restarted webserver.

It failed to start TRAC with 500.

Then I realized that 'new' cgi-bin miss 2 files:

old: $ls /d/Trac/NBDR/www/cgi-bin/

trac.cgi*  trac.fcgi*  trac.wsgi*  trac_wsgi.py*  trac_wsgi.pyc

new: $ls /d/Trac/NBDR/www/cgi-bin/

trac.cgi*  trac.fcgi*  trac.wsgi* 

Hence I copied those 2 files and was able to start TRAC.

 

trac.ini has these blocks:

[components]

autocompleteusers.* = enabled

 

[autocomplete]

fields = tester, reviewer

multi_fields = users

--

I tried to create a new ticket. I used Cc field to check but it still does 
not autocomplete users

What else could be wrong?

Thanks


On Friday, December 4, 2020 at 4:34:53 PM UTC-5 RjOllos wrote:

> On Fri, Dec 4, 2020 at 10:14 AM Eliya Voldman  wrote:
>
>> Hi Ryan,
>>
>> I already have www directory under Trac\NBDR :
>>
>> $ ls /d/Trac/NBDR/www/
>>
>> cgi-bin/  chrome/  htdocs/  web.config
>>
>>  
>>
>> Currently webserver alias points to -> D:\Trac\nbdr\www
>>
>> You suggested to deploy to D:\Trac\NBDR\www and point the webserver 
>> Aliases to D:\Trac\NBDR\www
>>
>> I'm affraid it'll cause a conflict because it's already exist.
>>
>> Could I deploy to existing D:\Trac\nbdr\www like this and don't change 
>> Aliases. It sounds to me like deploying to location which already exist. 
>> Won't it break anything?
>>
>> Could I run the following:
>>
>> trac-admin D:\Trac\NBDR deploy D:\Trac\NBDR\www
>>
>
> You should be okay to redeloy to  "Trac/NBDR/www/". I'd do the following:
> * Make a backup copy of the dir.
> * Delete cgi-bin and htdocs
> * Run deploy
>
> cgi-bin and htdocs will be recreated. What's in the chrome directory? It's 
> probably not needed. I'm not sure about web.config. You may want to 
> relocate that file.
>
> Ryan
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/36bb98bd-db15-4d7d-b57a-b8bf6737575cn%40googlegroups.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread Ryan Ollos
On Fri, Dec 4, 2020 at 10:14 AM Eliya Voldman  wrote:

> Hi Ryan,
>
> I already have www directory under Trac\NBDR :
>
> $ ls /d/Trac/NBDR/www/
>
> cgi-bin/  chrome/  htdocs/  web.config
>
>
>
> Currently webserver alias points to -> D:\Trac\nbdr\www
>
> You suggested to deploy to D:\Trac\NBDR\www and point the webserver
> Aliases to D:\Trac\NBDR\www
>
> I'm affraid it'll cause a conflict because it's already exist.
>
> Could I deploy to existing D:\Trac\nbdr\www like this and don't change
> Aliases. It sounds to me like deploying to location which already exist.
> Won't it break anything?
>
> Could I run the following:
>
> trac-admin D:\Trac\NBDR deploy D:\Trac\NBDR\www
>

You should be okay to redeloy to  "Trac/NBDR/www/". I'd do the following:
* Make a backup copy of the dir.
* Delete cgi-bin and htdocs
* Run deploy

cgi-bin and htdocs will be recreated. What's in the chrome directory? It's
probably not needed. I'm not sure about web.config. You may want to
relocate that file.

Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/CA%2BBGpn_scX0VJdDKUV9SymuhF-__bYQwDsHMM88NpqN4BxGfuQ%40mail.gmail.com.


Re: [Trac] Re: How can I modify the ticket link in notifications

2020-12-04 Thread Christopher Nelson
On Thu, Dec 3, 2020 at 2:03 PM RjOllos  wrote:

> On Thursday, December 3, 2020 at 6:52:31 AM UTC-8 Chris Nelson wrote:
>
>> Thanks.  I'll try that.  But I realize I'm going to need to also handle
>> links in the body of the notification (e.g., if a comment or ticket
>> description change includes a link).
>>
>
> I use SendGrid for my Trac development instances. How are the  elements
> formatted when click tracking is enabled? The emails I receive to gmail
> have a "data-saferedirecturl" attribute that looks like it might be related
> to the click tracking, but I don't know how click tracking works.
>

My email notifications come in with URLs that start like

Ticket URL: 

Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread Eliya Voldman
Hi Ryan,

I already have www directory under Trac\NBDR :

$ ls /d/Trac/NBDR/www/

cgi-bin/  chrome/  htdocs/  web.config

 

Currently webserver alias points to -> D:\Trac\nbdr\www

You suggested to deploy to D:\Trac\NBDR\www and point the webserver Aliases 
to D:\Trac\NBDR\www

I'm affraid it'll cause a conflict because it's already exist.

Could I deploy to existing D:\Trac\nbdr\www like this and don't change 
Aliases. It sounds to me like deploying to location which already exist. 
Won't it break anything?

Could I run the following:

trac-admin D:\Trac\NBDR deploy D:\Trac\NBDR\www

 

Thanks


On Friday, December 4, 2020 at 11:31:36 AM UTC-5 RjOllos wrote:

> On Friday, December 4, 2020 at 8:20:41 AM UTC-8 evol...@gmail.com wrote:
>
>> hi Ryan,
>> Looks that the next step is to 're-deploy' static assets.
>> In my case Project is located under D:\Trac\NBDR hence I did the 
>> following:
>>
>> D:\Trac\NBDR>trac-admin . deploy  D:\Trac\NBDR
>>
>> Error: Resources cannot be deployed to a target directory that is equal 
>> to or below the source directory 'd:\trac\NBDR\htdocs'.
>>
> This is a common mistake, which is why that error message was added. If 
> you deploy to D:\Trac\NBDR, the cgi-bin and htdocs directories will be 
> created:
> D:\Trac\NBDR\cgi-bin
> D:\Trac\NBDR\htdocs
>
> But there's already a D:\Trac\NBDR\htdocs directory containing the custom 
> site code, and files are extracted from that location in the deploy 
> operation, which leads to a recursion error.
>
> Usually, you want to separate out the private and public assets. 
>
> D:\Trac\NBDR is the Trac environment. The static assets should be deployed 
> outside this location, to a location served public. This might be 
> D:\Trac\public or D:\Trac\www.
>
> $ trac-admin D:\Trac\NBDR deploy D:\Trac\www
>
> and point the webserver Aliases to D:\Trac\www per:
> https://trac.edgewall.org/wiki/TracInstall#cgi-bin
>
>> Please choose a different target directory and try again.
>>
>> D:\Trac\NBDR>
>>
>> Obviously I can't re-deploy at the same location. I want to leave my 
>> Project at the same location as it now.
>>
>> My question: how could I handle it? Could I deploy e.g. to D:\Temp and 
>> then move back to D:\Trac\NBDR? Could you advice?
>>
> I advise against putting your public resources in D:\Trac\NBDR\htdocs. If 
> you want to deploy below D:\Trac\NBDR, use D:\Trac\NBDR\www:
>
> $ trac-admin D:\Trac\NBDR deploy D:\Trac\NBDR\www
>
> and point the webserver Aliases to D:\Trac\NBDR\www
>  
>
>> Thanks
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/43af7973-bf8c-475f-9ad8-218eea5c980fn%40googlegroups.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread RjOllos


On Friday, December 4, 2020 at 8:20:41 AM UTC-8 evol...@gmail.com wrote:

> hi Ryan,
> Looks that the next step is to 're-deploy' static assets.
> In my case Project is located under D:\Trac\NBDR hence I did the following:
>
> D:\Trac\NBDR>trac-admin . deploy  D:\Trac\NBDR
>
> Error: Resources cannot be deployed to a target directory that is equal to 
> or below the source directory 'd:\trac\NBDR\htdocs'.
>
This is a common mistake, which is why that error message was added. If you 
deploy to D:\Trac\NBDR, the cgi-bin and htdocs directories will be created:
D:\Trac\NBDR\cgi-bin
D:\Trac\NBDR\htdocs

But there's already a D:\Trac\NBDR\htdocs directory containing the custom 
site code, and files are extracted from that location in the deploy 
operation, which leads to a recursion error.

Usually, you want to separate out the private and public assets. 

D:\Trac\NBDR is the Trac environment. The static assets should be deployed 
outside this location, to a location served public. This might be 
D:\Trac\public or D:\Trac\www.

$ trac-admin D:\Trac\NBDR deploy D:\Trac\www

and point the webserver Aliases to D:\Trac\www per:
https://trac.edgewall.org/wiki/TracInstall#cgi-bin

> Please choose a different target directory and try again.
>
> D:\Trac\NBDR>
>
> Obviously I can't re-deploy at the same location. I want to leave my 
> Project at the same location as it now.
>
> My question: how could I handle it? Could I deploy e.g. to D:\Temp and 
> then move back to D:\Trac\NBDR? Could you advice?
>
I advise against putting your public resources in D:\Trac\NBDR\htdocs. If 
you want to deploy below D:\Trac\NBDR, use D:\Trac\NBDR\www:

$ trac-admin D:\Trac\NBDR deploy D:\Trac\NBDR\www

and point the webserver Aliases to D:\Trac\NBDR\www
 

> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/59ed4184-8a98-433a-a5fd-5865f35380a2n%40googlegroups.com.


Re: [Trac] Re: How to handle usernames in TRAC

2020-12-04 Thread Eliya Voldman
hi Ryan,
Looks that the next step is to 're-deploy' static assets.
In my case Project is located under D:\Trac\NBDR hence I did the following:

D:\Trac\NBDR>trac-admin . deploy  D:\Trac\NBDR

Error: Resources cannot be deployed to a target directory that is equal to 
or below the source directory 'd:\trac\NBDR\htdocs'.

Please choose a different target directory and try again.

D:\Trac\NBDR>

Obviously I can't re-deploy at the same location. I want to leave my 
Project at the same location as it now.

My question: how could I handle it? Could I deploy e.g. to D:\Temp and then 
move back to D:\Trac\NBDR? Could you advice?

Thanks

On Thursday, December 3, 2020 at 8:33:51 PM UTC-5 RjOllos wrote:

> On Thursday, December 3, 2020 at 5:07:05 PM UTC-8 evol...@gmail.com wrote:
>
>> Hi Ryan, jeff
>> Actually I am not 'true' web developer and mostly could only follow 
>> someone's instructions. Thanks for above suggestions.
>> - Ryan, I do have in trac.ini those lines. I also see in Admin Tab - 
>> Plugins that plugin TracAutocompleteUsersPlugin 0.4.6 is 'Enabled'
>> Following Ryan recommendation I tried to open/create a ticket and check 
>> Console. When I click on Tab 'Create Ticket' I've got errors in Console. 
>> (see attachments). Are they related to my issue? 
>>
>
> The resources aren't available from the webserver. Did you restart the 
> webserver? If yes, then you may need to redeploy static assets, depending 
> on your server config. See the link I sent earlier. 
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/trac-users/438dfeec-c9e2-4151-8d73-28e080e1f71bn%40googlegroups.com.