Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https interface for user management #648

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
do stuff as openvpn user&group
  • Loading branch information
nanda committed Mar 30, 2021
commit 885a936bafb19ce2e34395b09a3de95994b2d863
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ RUN echo "http:https://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/reposi
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*

ENV OVPN_USER=openvpn
ENV OVPN_GROUP=openvpn

ADD ./lighttpd/htdocs/ /var/www/localhost/htdocs/
ADD ./lighttpd/config/* /etc/lighttpd/
RUN chown -R openvpn:openvpn /var/www/localhost/htdocs /etc/lighttpd /var/log/lighttpd
RUN sed -i /etc/lighttpd/lighttpd.conf -e 's/server\.username.*/server.username\ =\ "$OVPN_USER"/' -e 's/server\.groupname.*/server.groupname\ =\ "$OVPN_GROUP"/' && \
chown -R ${OVPN_USER}:${OVPN_GROUP} /var/www/localhost/htdocs /etc/lighttpd /var/log/lighttpd

ADD ./bin /usr/local/bin
RUN chmod 755 /usr/local/bin/* && chown root:${OVPN_GROUP} /usr/local/bin/*

# Add support for OTP authentication using a PAM module
ADD ./otp/openvpn /etc/pam.d/

# Needed by scripts
ENV OPENVPN=/etc/openvpn
Expand All @@ -29,11 +39,5 @@ EXPOSE 1194/udp
EXPOSE 443/tcp

CMD ["ovpn_run"]
USER $OVPN_USER:$OVPN_GROUP

ADD ./bin /usr/local/bin
RUN chmod a+x /usr/local/bin/* && chown -RH root:openvpn /usr/local/bin/

# Add support for OTP authentication using a PAM module
ADD ./otp/openvpn /etc/pam.d/

# TODO: make sure here & in scripts that everything is done as "openvpn" user