reverse: remove ngxpasswd

This commit is contained in:
Wonderfall 2016-04-29 19:04:32 +02:00
parent 1f4a3708e9
commit 287b32d56e
2 changed files with 0 additions and 44 deletions

View File

@ -29,7 +29,6 @@ RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/ap
libgcc \ libgcc \
libstdc++ \ libstdc++ \
su-exec \ su-exec \
openssl \
tini@commuedge \ tini@commuedge \
&& cd /tmp && git clone https://github.com/bagder/libbrotli && cd libbrotli \ && cd /tmp && git clone https://github.com/bagder/libbrotli && cd libbrotli \
&& ./autogen.sh && ./configure && make -j $NB_CORES && make install \ && ./autogen.sh && ./configure && make -j $NB_CORES && make install \
@ -83,7 +82,6 @@ RUN echo "@commuedge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/ap
COPY nginx.conf /etc/nginx/conf/nginx.conf COPY nginx.conf /etc/nginx/conf/nginx.conf
COPY run.sh /usr/local/bin/run.sh COPY run.sh /usr/local/bin/run.sh
COPY ngxpasswd /usr/local/bin/ngxpasswd
RUN chmod +x /usr/local/bin/* RUN chmod +x /usr/local/bin/*

View File

@ -1,42 +0,0 @@
#!/bin/sh
NAME="$1"
USER="$2"
PASSWORD="$3"
cd /passwds || exit 1
if [ -z "$NAME" ]; then
echo "Service name must be defined" 1>&2
exit 1
elif [ -f $NAME.htpasswd ]; then
echo "$NAME.htpasswd exists, aborting" 1>&2
exit 1
fi
if [ -z "$USER" ]; then
echo "User must be defined" 1>&2
exit 1
fi
if [ -z "$PASSWORD" ]; then
PASSWORD=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1`
echo "Password was not defined, generating a random one..."
fi
echo -n $USER:`openssl passwd -apr1 $PASSWORD` >> $NAME.htpasswd
chown $UID:$GID $NAME.htpasswd
chmod 640 $NAME.htpasswd
echo
echo "A new password file has been saved to /passwds/$NAME.htpasswd :"
echo "- Service : $NAME"
echo "- User : $USER"
echo "- Password : $PASSWORD"
echo
echo "Paste this to your vhost in order to enable auth :"
echo " auth_basic \"Who's this?\";"
echo " auth_basic_user_file /passwds/$NAME.htpasswd;"
echo
echo "Done."
exit 0