Skip to content
Snippets Groups Projects
Commit b66b7fb5 authored by Christian Dresen's avatar Christian Dresen
Browse files

Docker for Web

parent 72ba3d61
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,7 @@
<div class="container">
<div class="container">
<div class="navbar-header">
<p class="text-muted"><small>Warpzone</small></p>
<p class="text-muted"><small>Warpzone</small></p>{% get_current_language as LANGUAGE_CODE %} {{ LANGUAGE_CODE}}
</div>
</div>
</div>
......
......@@ -3,7 +3,7 @@ from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotAll
from django.contrib.auth import authenticate, login, logout
from django.shortcuts import redirect
from django.contrib.auth.decorators import login_required
from django.utils import translation
from warpauth.util import *
def login_view(request):
......@@ -18,6 +18,10 @@ def login_view(request):
if user is not None:
if user.is_active:
login(request, user)
user_language = 'de_DE'
translation.activate(user_language)
request.session[translation.LANGUAGE_SESSION_KEY] = user_language
return redirect('/')
else:
if username != "" and password != "":
......
......@@ -155,7 +155,7 @@ AUTH_LDAP_USER_SEARCH = LDAPSearch(AUTH_LDAP_USER_SEARCH_PATH,
AUTH_LDAP_USER_ATTR_MAP = {"first_name": "givenName", "last_name": "sn", "email": "description"}
AUTH_LDAP_PROFILE_ATTR_MAP = {"home_directory": "homeDirectory"}
AUTH_LDAP_GROUP_SEARCH_PATH = "ou=Groups,dc=warpzone,dc=ms"
AUTH_LDAP_GROUP_SEARCH_PATH = "dc=warpzone,dc=ms"
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(AUTH_LDAP_GROUP_SEARCH_PATH,
ldap.SCOPE_SUBTREE, "(objectClass=posixGroup)"
)
......@@ -163,16 +163,16 @@ AUTH_LDAP_GROUP_SEARCH = LDAPSearch(AUTH_LDAP_GROUP_SEARCH_PATH,
AUTH_LDAP_GROUP_TYPE = PosixGroupType()
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
"is_active": "cn=active,ou=Groups,dc=warpzone,dc=ms",
"is_staff": ["cn=superuser,ou=Groups,dc=warpzone,dc=ms",
"cn=superuser,ou=Groups,dc=warpzone,dc=ms"],
"is_superuser": "cn=superuser,ou=Groups,dc=warpzone,dc=ms"
"is_active": "cn=active,ou=groups,ou=WarpAuth,ou=Warpzone,dc=warpzone,dc=ms",
"is_staff": ["cn=superuser,ou=groups,ou=WarpAuth,ou=Warpzone,dc=warpzone,dc=ms",
"cn=superuser,ou=groups,ou=WarpAuth,ou=Warpzone,dc=warpzone,dc=ms"],
"is_superuser": "cn=superuser,ou=groups,ou=WarpAuth,ou=Warpzone,dc=warpzone,dc=ms"
}
AUTH_LDAP_FIND_GROUP_PERMS = True
AUTH_LDAP_CACHE_GROUPS = True
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 300
AUTH_LDAP_GROUP_CACHE_TIMEOUT = 10
logger = logging.getLogger('django_auth_ldap')
logger.addHandler(logging.StreamHandler())
......
From debian:jessie
RUN apt-get update && apt-get install -y \
debconf-utils \
apt-utils \
ssh \
less \
ldap-utils \
rsyslog \
nano \
python \
python-pip \
python-django-auth-ldap \
python-bootstrapform \
python-ldap \
python-dev
build-essential \
libfreetype6-dev \
python-imaging \
libjpeg-dev
RUN pip install django \
django-ldapdb \
reportlab
RUN cd /opt/warpauth/;python manage.py migrate
COPY entrypoint.sh /opt/entrypoint.sh
EXPOSE 22 8000
VOLUME ["/opt/warpauth"]
ENTRYPOINT sh /opt/entrypoint.sh
docker build -t warpauth_web .
service rsyslog restart
bash
docker run \
-v /home/chris/Documents/warpzone/web:/opt/warpauth \
-p 8124:80 \
-it \
warpauth_web
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment