Modify

Opened 8 years ago

Closed 8 years ago

#903 closed defect (fixed)

Relative Path for the htpasswd file does not work on linux

Reported by: lazaridis_com Owned by: mgood
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 8 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 8 years ago by lazaridis_com

  • Trac Release changed from 0.9 to 0.10

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

comment:3 Changed 8 years ago by athomas

  • Trac Release changed from 0.10 to 0.11

comment:4 follow-up: Changed 8 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 ; follow-up: Changed 8 years ago by mgood

  • Priority changed from high to normal
  • Status changed from new to assigned

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 ; follow-up: Changed 8 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 8 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 8 years ago by mgood

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:9 follow-up: Changed 8 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 8 years ago by lazaridis_com

Replying to anonymous: that was me again.

comment:11 Changed 8 years ago by mgood

  • Resolution set to fixed
  • Status changed from reopened to closed

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

Add Comment

Modify Ticket

Action
as closed The owner will remain mgood.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.