diff options
author | Dennis Eriksen <d@ennis.no> | 2021-03-30 09:20:45 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2021-03-30 09:20:45 +0200 |
commit | f299a761993b25f7a460656cffbc76a852d22b05 (patch) | |
tree | c3a9b86e77f1bda9de7f792f30a42609f68ba54d /README.md | |
parent | more readme in comments, support -cron-suffix for cron (diff) | |
download | htmpasswd-f299a761993b25f7a460656cffbc76a852d22b05.tar.gz |
README, LICENCE
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..6ceafae --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# htmpasswd + +h**tmp**asswd is a script to help create temporary users in files made with +`htpasswd`. + +This script assumes your htpasswd-files are stored in `/etc/nginx/htpasswd` +(you can change this with the variable `$HTDIR`). It also needs access to +`/var/spool/htmpasswd`, where the temporary users are stored until they expore. + +`htmpasswd` takes two arguments. `$1` is the name of the password-file, and `$2` +is the name of the temporary user. `$2` is optional. The script returns a +temprary username and password separated by aa colon. + +Exaample: +``` +$ sudo htmlpasswd f.dnns.no +woeomu:aadscv +``` +This would now be valid at https://woeomu:aadscv@f.dnns.no. + +## cron +In order to automagically remove the temporary users after a set aamount of +time, the script also needs to be invoked regularly by cron. When run by cron, +it taakes no arguments. + +For the script to recognize it's being run by cron, you either need to set the +environmental variable `$RUN_BY_CRON` to `true`, or you can name the script +`htmpasswd-cron` (the script will recognize the `-cron`-suffix). |