aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
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).