fixed
This commit is contained in:
1 parent
4194cef934
commit
363127fe9e
3350 files changed
+1284220
-1
No files matched your search
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Usage: ./create-user.sh <username> <password>
|
||||
# Appends (or creates) the htpasswd file the registry uses for auth.
|
||||
set -e
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage: $0 <username> <password>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
AUTH_DIR="$SCRIPT_DIR/auth"
|
||||
mkdir -p "$AUTH_DIR"
|
||||
|
||||
docker run --rm --entrypoint htpasswd httpd:2.4-alpine -Bbn "$1" "$2" \
|
||||
>> "$AUTH_DIR/htpasswd"
|
||||
|
||||
echo "Added/updated user '$1' in $AUTH_DIR/htpasswd"
|
||||
Reference in new issue
Block a user