Ticket #903 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Relative Path for the htpasswd file does not work on linux

Reported by: lazaridis_com Assigned to: 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

Change History

11/13/06 02:18:04 changed 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

11/13/06 02:18:58 changed by lazaridis_com

  • 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)

11/13/06 05:37:22 changed by athomas

  • release changed from 0.10 to 0.11.

(follow-up: ↓ 5 ) 11/15/06 04:46:54 changed 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.

(in reply to: ↑ 4 ; follow-up: ↓ 6 ) 11/15/06 09:53:33 changed 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.

(in reply to: ↑ 5 ; follow-up: ↓ 7 ) 11/19/06 04:24:29 changed 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)

(in reply to: ↑ 6 ) 11/19/06 06:10:11 changed by lazaridis_com

Replying to anonymous:

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

11/19/06 13:31:17 changed by mgood

  • status changed from assigned to closed.
  • resolution set to fixed.

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

(follow-up: ↓ 10 ) 11/20/06 13:17:40 changed by anonymous

  • status changed from closed to reopened.
  • resolution deleted.

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

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

(in reply to: ↑ 9 ) 11/20/06 13:18:32 changed by lazaridis_com

Replying to anonymous: that was me again.

02/28/07 15:07:53 changed by mgood

  • status changed from reopened to closed.
  • resolution set to fixed.

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


Add/Change #903 (Relative Path for the htpasswd file does not work on linux)




Change Properties
Action