Skip to content

nueces/collective.recipe.htpasswd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buldout recipe for create htpasswd files

Introdution

This recipe can be used to generate files for basic authentication of HTTP users, to restrict the access to HTTP resoruces. The aim is to be fully compatible with the htpasswd program that come with the Apache httpd Server, and support all the password formats that it supports. This formats, with some minor diffenrences in the case of the plain method, are also supported by the auth_basic module of the nginx http server.

At this moment this recipe support plain and crypt algorithms for storage passwords. The crypt algorithm is based on the system's crypt() routine, so it inherits its limitations (see: man 5 crypt).

Note: The plaintext passowrds are only accepted by the Apache httpd server on Windows and Netware.

Caution: This recipe should not be used to update an existing htpasswd file, because it overwritte the htpasswd file in every update.

Example usage

The simplest way to use this recipe is to add a part in buildout.cfg like this:

[buildout]
parts = htpasswd

[htpasswd]
recipe = collective.recipe.htpasswd
output = ${buildout:directory}/etc/htpasswd
credentials =
    nueces:secret
    nutz:crackme

Supported options

  • output: Specify a path to the output file. The path will be created if it does not exist.
  • credentials: One set per line of credentials formed by username and password separated by a colon. e.g. <username>:<password>.
  • mode: Specified with octal numbers, as in the chmod program. e.g. 640. If it not set the file are created with the mask mode from the system enviroment.
  • algorithm: The supported options are 'crypt' and 'plain'. Default to 'cypt'.

Development

About

Buldout recipe for create htpasswd files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages