Modify

Opened 18 years ago

Closed 18 years ago

#903 closed defect (fixed)

Relative Path for the htpasswd file does not work on linux

Reported by: lazaridis_com Owned by: Matt Good
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I've installed the account manager plugin and it works fine.

http://dev.lazaridis.com/base/changeset/111

One problem occours:

In the local installation (windows) the relative path within the *.ini works fine.

In the production server, the relative path does not work (giving an absolute path works nice).

Attachments (0)

Change History (11)

comment:1 Changed 18 years ago by lazaridis_com

configuration:

8 	[components]
9 	tracx.* = enabled
10 	acct_mgr.* = enabled
11 	acct_mgr.web_ui.RegistrationModule = disabled
12 	
13 	[account-manager]
14 	password_format = htpasswd
15 	password_file = ../trac.htpasswd

comment:2 Changed 18 years ago by lazaridis_com

Trac Release: 0.90.10

on the 0.11dev version (missing this from the "Trac Release" drop down in this trac installtion)

comment:3 Changed 18 years ago by Alec Thomas

Trac Release: 0.100.11

comment:4 Changed 18 years ago by lazaridis_com

If i understand right, then at this location:

source:accountmanagerplugin/trunk/acct_mgr/htfile.py#rev=1518#L51

a test should happen if the given 'filename' is existent.

If not, the filename should be constructed based on the current environment.

comment:5 in reply to:  4 ; Changed 18 years ago by Matt Good

Priority: highnormal
Status: newassigned

Replying to lazaridis_com:

If i understand right, then at this location:

source:accountmanagerplugin/trunk/acct_mgr/htfile.py#rev=1518#L51

a test should happen if the given 'filename' is existent.

If not, the filename should be constructed based on the current environment.

No, the Option class is just used to define that as a setting for trac.ini.

Using a relative path at this time will be relative to the current working directory of the web server. I'll look into making this work relative to the Trac environment instead.

comment:6 in reply to:  5 ; Changed 18 years ago by anonymous

Replying to mgood:

this code should do the work, possibly you can verify, I get some errors which seem to result out of the way you've implemented the inheritance:

    def __init__(self):
        if not os.path.isabs(self.filename_option):
            combined_name = os.path.join(self.env.path, self.filename_option)
            self.filename = os.path.normpath(combined_name)
            self.log.debug('account manager password-file: %s', self.filename)

comment:7 in reply to:  6 Changed 18 years ago by lazaridis_com

Replying to anonymous:

that was me, shouldn't this site do something like "auto-login" (e.g. from authentication cache? )

comment:8 Changed 18 years ago by Matt Good

Resolution: fixed
Status: assignedclosed

(In [1581]) enable password_file setting to be relative to the project (fixes #903)

comment:9 Changed 18 years ago by anonymous

Resolution: fixed
Status: closedreopened

the patch works technically, but there's a small cosmetic issue:

"_filename" appears on the Admin page instead of "filename".

comment:10 in reply to:  9 Changed 18 years ago by lazaridis_com

Replying to anonymous: that was me again.

comment:11 Changed 18 years ago by Matt Good

Resolution: fixed
Status: reopenedclosed

(In [2063]) make the filename option display nicely in admin page (fixes #903)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Matt Good.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.