[Trac] Re: urllib2 authentication to Trac resources

2012-10-03 Thread Jason Miller
I posted in ernst :) 

Bitten Authentication (
http://bitten.edgewall.org/browser/trunk/bitten/slave.py):

def _get_opener(self):
  opener = urllib2.build_opener(urllib2.HTTPErrorProcessor())
  opener.add_handler(HTTPBasicAuthHandler(self.password_mgr))
  opener.add_handler(urllib2.HTTPDigestAuthHandler(self.password_mgr))
  opener.add_handler(urllib2.HTTPCookieProcessor(self.cookiejar))
  return opener

Thanks all!
Jason

On Wednesday, October 3, 2012 4:48:01 PM UTC-6, Jason Miller wrote:
>
> All,
>
> I have need of creating a small python script which would obtain the 
> current build page (bitten) and return a dictionary of status (and I would 
> be happy to relinquish this small code on demand). In order for this to 
> work, I need to authenticate to any Trac resource beyond the main page. I 
> have yet to successfully do so. Using the examples on the following site: 
> http://docs.python.org/howto/urllib2.html works fine when retrieving 
> resources from an LDAP protected location. But not to a Trac resource. 
>
> My Trac/Apache configuration (urllib2 fails):
> 
> # WSGI trac_test Trac page here:
> WSGIScriptAlias /trac_test /data/trac/trac_test/htdocs/trac_init.wsgi
> 
>  Options -Indexes
>  WSGIApplicationGroup %{GLOBAL}
>  Options FollowSymLinks
>  AllowOverride None
>  Order deny,allow
>  Allow from all
> 
> 
>   AuthType Basic
>   AuthName "Trac Test Site"
>   AuthBasicProvider ldap
>   AuthLDAPURL "ldap:///dc=sub,dc=com?uid"
>   AuthzLDAPAuthoritative off
>   require valid-user
>   Allow from all
> 
> 
>
>
>
> An Apache resource configuration (urllib2 succeeds):
> 
> 
>  AuthType Basic
>  AuthGroupFile /data/authz_generator/apache_groups
>  AuthName "Doxygen Access"
>  AuthBasicProvider ldap
>  AuthLDAPURL "ldap:///dc=sub,dc=com?uid"
>  AuthzLDAPAuthoritative off
>  require group 
>  Allow from all
> 
> 
>
> When I attempt to connect to /trac_test/login (or any Trac resource) I 
> receive:
> urllib2.HTTPError: HTTP Error 401: Authorization Required
>
> I realize I may have to fiddle with cookielib (maybe not). And that will 
> be an issue for another time.
> Is there an urllib2.Request.add_header() method I should be calling 
> specifically for wsgi Trac resources? When I look at the error logs, the 
> authentication error headers look identical... so I am not sure what I 
> should be asking for. I have yet to peak into the way bitten_slave 
> authenticates... And I suppose I may have to, unless someone here has a 
> quick "Yeah... you just add_header("blah we's need special trac wsgi 
> access: %s" % hash)" :)
>
> Thanks in advance!
> Jason Miller
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/trac-users/-/6i-p1J4R_tUJ.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



[Trac] urllib2 authentication to Trac resources

2012-10-03 Thread Jason Miller
All,

I have need of creating a small python script which would obtain the
current build page (bitten) and return a dictionary of status (and I would
be happy to relinquish this small code on demand). In order for this to
work, I need to authenticate to any Trac resource beyond the main page. I
have yet to successfully do so. Using the examples on the following site:
http://docs.python.org/howto/urllib2.html works fine when retrieving
resources from an LDAP protected location. But not to a Trac resource.

My Trac/Apache configuration (urllib2 fails):

# WSGI trac_test Trac page here:
WSGIScriptAlias /trac_test /data/trac/trac_test/htdocs/trac_init.wsgi

 Options -Indexes
 WSGIApplicationGroup %{GLOBAL}
 Options FollowSymLinks
 AllowOverride None
 Order deny,allow
 Allow from all


  AuthType Basic
  AuthName "Trac Test Site"
  AuthBasicProvider ldap
  AuthLDAPURL "ldap:///dc=sub,dc=com?uid"
  AuthzLDAPAuthoritative off
  require valid-user
  Allow from all





An Apache resource configuration (urllib2 succeeds):


 AuthType Basic
 AuthGroupFile /data/authz_generator/apache_groups
 AuthName "Doxygen Access"
 AuthBasicProvider ldap
 AuthLDAPURL "ldap:///dc=sub,dc=com?uid"
 AuthzLDAPAuthoritative off
 require group 
 Allow from all



When I attempt to connect to /trac_test/login (or any Trac resource) I
receive:
urllib2.HTTPError: HTTP Error 401: Authorization Required

I realize I may have to fiddle with cookielib (maybe not). And that will be
an issue for another time.
Is there an urllib2.Request.add_header() method I should be calling
specifically for wsgi Trac resources? When I look at the error logs, the
authentication error headers look identical... so I am not sure what I
should be asking for. I have yet to peak into the way bitten_slave
authenticates... And I suppose I may have to, unless someone here has a
quick "Yeah... you just add_header("blah we's need special trac wsgi
access: %s" % hash)" :)

Thanks in advance!
Jason Miller

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



Re: [Trac] Trouble with newly installed plugin (webadmin)

2012-10-03 Thread Adrya Stembridge
Steffen, thanks for the tip.   I'm using the older version since that's
what RHEL 5 installed with yum install trac.   I didn't realize it was that
out of date.  Will look into getting a more current version.

On Wed, Oct 3, 2012 at 6:06 PM, Steffen Hoffmann  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 03.10.2012 22:27, ams wrote:
> > I restarted the httpd server (trac uses Apache), and still have no Admin
> > button.
> This is most probably a permission issue and will continue with any more
> recent Trac environment. Do something like
>  trac-admin  permission add  TRAC_ADMIN
>
> to grant full permission to an admin user account, that is usable for
> administration tasks. As known elsewhere, you should create a less
> privileged account for your regular work to just use Trac.
>
> Steffen Hoffmann
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAlBstt4ACgkQ31DJeiZFuHcgNQCgpCZRfVSVLBy2ujlj0Y+Q2hej
> E60Ani0i+7htJPhVOAnJdpwhUaHqOoDj
> =jotr
> -END PGP SIGNATURE-
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Users" group.
> To post to this group, send email to trac-users@googlegroups.com.
> To unsubscribe from this group, send email to
> trac-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/trac-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



Re: [Trac] GanttCalendar - Its enable fields to select a date for a calendar?

2012-10-03 Thread Steffen Hoffmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 03.10.2012 04:59, Ivanelson Nunes wrote:
> use a calendar to input the start date and end date

I use a calendar pop-up plugin, but I fail to instantly find it on
trac-hacks.org now. I don't remember from 2 years back, if I found it
somewhere else.

So go better go for something from DateFieldPlugin based on jQueryUI as
hinted by Ryan before. This seems like the future even for Trac core anyway.

Steffen Hoffmann
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBswFYACgkQ31DJeiZFuHc6wwCgx+S6FsXWhg+85YgtAX+mSR+K
wlgAn3K3ZoCF4/kErI8p3YbU9Wsv6N1D
=0w+M
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



Re: [Trac] Trouble with newly installed plugin (webadmin)

2012-10-03 Thread Steffen Hoffmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 03.10.2012 22:27, ams wrote:
> I restarted the httpd server (trac uses Apache), and still have no Admin
> button.
This is most probably a permission issue and will continue with any more
recent Trac environment. Do something like
 trac-admin  permission add  TRAC_ADMIN

to grant full permission to an admin user account, that is usable for
administration tasks. As known elsewhere, you should create a less
privileged account for your regular work to just use Trac.

Steffen Hoffmann
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBstt4ACgkQ31DJeiZFuHcgNQCgpCZRfVSVLBy2ujlj0Y+Q2hej
E60Ani0i+7htJPhVOAnJdpwhUaHqOoDj
=jotr
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



Re: [Trac] Trouble with newly installed plugin (webadmin)

2012-10-03 Thread Steffen Hoffmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

longer version

On 03.10.2012 22:27, ams wrote:
> My RHEL 5x server uses an earlier version of Python, so I installed
> Python 2.6 alongside prior to installing Trac.

So no problem to go and redo with Trac-1.0, don't dare to use anything
before this current stable version for a new project, really. Trac-0.10
has been abandoned long ago and 0.11 is unchanged since 2010 too.

You'll have no luck on almost any issue you may encounter, and you miss
a truck-load of great features that have been introduced. Trac 0.11 had
major API changes in many respects, 0.12 went for full i18n support, if
you care for that, and 1.0 is just on the edge, supporting the new db
access API as well as retaining compatibility code for not-yet-updated
plugins (quite a lot to be honest).

Steffen Hoffmann
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBstaYACgkQ31DJeiZFuHcENwCgguAIxfEWqsDd0oY7xxEqhrUn
49sAn173KsUqMovO5eAmg16SGHMQUaEv
=1JkE
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



Re: [Trac] Trouble with newly installed plugin (webadmin)

2012-10-03 Thread Steffen Hoffmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 03.10.2012 22:27, ams wrote:
> installed /Trac .10.5/
 Oh no! - Sorry, but this hurts badly.

Go for 1.0 at any rate.

Steffen Hoffmann
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBstBEACgkQ31DJeiZFuHdjDwCggG5wsxYJKCAl8mu2GF/4WIxZ
L8cAoMNBMlNkZvmcKzMTz/5t1YAQauJk
=oJtX
-END PGP SIGNATURE-

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



[Trac] Trouble with newly installed plugin (webadmin)

2012-10-03 Thread ams


I installed *Trac .10.5* today and the system is working OK, including 
login authentication.   My RHEL 5x server uses an earlier version of 
Python, so I installed Python 2.6 alongside prior to installing Trac.  

After logging in, I noticed that there is not an Admin button.   I then 
discovered that this feature is available as a plugin with my version of 
Trac. 

I downloaded the WebAdmin plugin source:

svn export http://svn.edgewall.com/repos/trac/plugins/0.10/webadmin/

 

Then ran setup.py, which generated a dist/TracWebAdmin-0.1.2dev-py2.6.eggfile.

I then issued 

easy_install TracWebAdmin-0.1.2dev-py2.6.egg.


Here's the output: 

Processing TracWebAdmin-0.1.2dev-py2.6.egg

removing '/usr/lib/python2.6/site-packages/TracWebAdmin-0.1.2dev-py2.6.egg' 
(and everything under it)

creating /usr/lib/python2.6/site-packages/TracWebAdmin-0.1.2dev-py2.6.egg

Extracting TracWebAdmin-0.1.2dev-py2.6.egg to /usr/lib/python2.6/site-packages

TracWebAdmin 0.1.2dev is already the active version in easy-install.pth

Installed /usr/lib/python2.6/site-packages/TracWebAdmin-0.1.2dev-py2.6.egg

Processing dependencies for TracWebAdmin==0.1.2dev

Finished processing dependencies for TracWebAdmin==0.1.2dev

 

My *trac/conf/trac.ini* file has this section: 

[components]
webadmin.* = enabled


I restarted the httpd server (trac uses Apache), and still have no Admin 
button.

Any ideas?

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/trac-users/-/9TSzb2Ii5RkJ.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



[Trac] Re: GanttCalendar - Its enable fields to select a date for a calendar?

2012-10-03 Thread RjOllos
On Tuesday, October 2, 2012 7:59:13 PM UTC-7, ynoslenav wrote:

> It is possible to use a calendar to input the start date and end date 
> GanttPlugin? I'm using version Trac1.0 and entry of dates is literal. type: 
> 2012-09-01


I think you are asking for a jQuery DatePicker for the `current day` field, 
and perhaps other fields, like the DateFieldPlugin provides (1). Is that 
correct? 

It would be easy enough to generate a patch. Take a look at the 
DateFieldPlugin, and recent work on the Trac core for guidance (2, 3)

(1) http://trac-hacks.org/wiki/DateFieldPlugin
(2) http://trac.edgewall.org/ticket/10245
(3) http://trac.edgewall.org/ticket/10854

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/trac-users/-/5fZaKkWJrLAJ.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



Re: [Trac] post-commit-hooks and plugins

2012-10-03 Thread Peter Suter

On 03.10.2012 18:30, Sam Halliday wrote:

How would I (or bobbysmith007, author of "timing and estimation plugin")
go about implementing this functionality?


You could use the same hook script (which calls trac-admin, which 
triggers all IRepositoryChangeListener plugins) and write a small 
IRepositoryChangeListener plugin. [1]


The CommitTicketUpdater is actually itself such a plugin, so you could 
just take that as an example. [2]


--
Peter

[1] 
http://trac.edgewall.org/wiki/TracDev/ApiChanges/0.12#IRepositoryChangeListener
[2] 
http://trac.edgewall.org/browser/trunk/tracopt/ticket/commit_updater.py#L60


--
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



[Trac] post-commit-hooks and plugins

2012-10-03 Thread Sam Halliday
Hi all,

The new post-commit-hooks system for SVN in 1.0 (and possibly 0.12) looks a 
lot cleaner than before, with the actual script itself being very sparse 
and all logic in the trac side of things.

However, I had a post-commit-hook which parsed numbers in brackets and used 
them for an "hours" field so I could do time tracking from commit logs.

How would I (or bobbysmith007, author of "timing and estimation plugin") go 
about implementing this functionality?

 http://trac.edgewall.org/wiki/CommitTicketUpdater
 https://trac-hacks.org/ticket/10420

Regards, Sam

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/trac-users/-/WXk9nRekgaIJ.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.



Re: [Trac] Trac Global Group Management

2012-10-03 Thread Bas van der Vlies
On 10/02/2012 07:07 PM, RjOllos wrote:
> On Tuesday, October 2, 2012 1:36:46 AM UTC-7, Bas wrote:
> 
> I had opened a ticket and a request: 
>  * https://trac-hacks.org/ticket/3123 
> 
> I will create a new ticket with the version attached
> 
> 
> I see that you acquired about maintenance status of the plugin in that 
> ticket. Would you be interested in taking over if I changed
> the permissions so you can commit? At this time, it is not maintained. 
> 

I have several open source projects that are consuming time ;-).  I will 
consider it and let know what my decision will be.

regards

-- 

*  Bas van der Vliese-mail: b...@sara.nl   *
*  SARA - Academic Computing Services   Amsterdam, The Netherlands *




smime.p7s
Description: S/MIME Cryptographic Signature


[Trac] Permissions for specific tickets...

2012-10-03 Thread mutetella
Hello,

I'm using the AuthzPolicy-plugin to manage the permissions in a trac-env. 
Now I like to set a permission that disallow all users except for the 
admins to view tickets with a specific status.

I try a lot such as the following entry in the authzpolicy.conf:

[ticket:*/status:new]
@administrators = TICKET_VIEW
* =

Does the AuthzPolicy-plugin provides permission-setting for tickets with a 
specific status, owner or something else?

mutetella

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/trac-users/-/B5mujMmxw6gJ.
To post to this group, send email to trac-users@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.