Commit 2975fb74 authored by Daniel STAN's avatar Daniel STAN

Merge remote-tracking branch 'git_crans/devel_vo' into merge_devel_vo

Conflicts:
	settings.py
parents 4cb6e423 00c9d106
#!/usr/bin/env python
#
# CONN_POOL.PY--
#
# Copyright (C) 2010 Antoine Durand-Gasselin
# Author: Antoine Durand-Gasselin <adg@crans.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
CONNS = {}
OBJECTS = {}
......@@ -5,6 +5,7 @@
#
# Copyright (C) 2009-2010 Nicolas Dandrimont
# Authors: Nicolas Dandrimont <olasd@crans.org>
# Censor: Antoine Durand-Gasselin <adg@crans.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -19,15 +20,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import settings
import settings, ldap
from django.contrib.auth.models import Group, User
from django.contrib.auth.backends import ModelBackend
from django.utils.importlib import import_module
# Pour se connecter à la base ldap
import sys
sys.path.append("/usr/scripts/lc_ldap")
from lc_ldap import lc_ldap
conn_pool = import_module('conn_pool', 'intranet')
class LDAPUserBackend(ModelBackend):
"""Authentifie un utilisateur à l'aide de la base LDAP"""
supports_anonymous_user = False
def authenticate(self, username=None, password=None):
"""Authentifie l'utilisateur sur la base LDAP. Crée un
utilisateur django s'il n'existe pas encore."""
......@@ -35,37 +44,31 @@ class LDAPUserBackend(ModelBackend):
if not username or not password:
return None
# Les clubs ont une méthode à part...
if "@club-" in username:
try:
user, club = username.split("@club-")
except ValueError:
return None
return self.authenticate_club(club, user, password)
try:
adherent = settings.db.search('uid=%s' % username)['adherent'][0]
conn = lc_ldap(user = username, cred = password)
ldap_user = conn.search(dn = conn.dn, scope = ldap.SCOPE_BASE)[0]
except IndexError:
return None
except ldap.INVALID_CREDENTIALS:
return None
if adherent.checkPassword(password):
# On stocke les utilisateurs dans la base django comme "uid@crans.org"
django_username = '%s@crans.org' % username
try:
user = User.objects.get(username=django_username)
except User.DoesNotExist:
user = User(username=django_username, password="LDAP Backend User!")
user.save()
self.refresh_droits(user, adherent)
self.refresh_fields(user, adherent)
return user
return None
# On stocke les utilisateurs dans la base django comme "uid@crans.org"
django_username = '%s@crans.org' % username
try:
user = User.objects.get(username=django_username)
except User.DoesNotExist:
user = User(username=django_username, password="LDAP Backend User!")
user.save()
conn_pool.CONNS[django_username] = conn
self.refresh_droits(user, ldap_user)
self.refresh_fields(user, ldap_user)
return user
def refresh_droits(self, user, cl_user):
"""Rafraîchit les droits de l'utilisateur django `user' depuis
l'utilisateur LDAP `cl_user'"""
cl_droits = cl_user.droits()
cl_droits = cl_user['droits']
if u"Nounou" in cl_droits:
user.is_staff = True
user.is_superuser = True
......@@ -75,6 +78,7 @@ class LDAPUserBackend(ModelBackend):
groups = []
for cl_droit in cl_droits:
cl_droit = cl_droit.value
group, created = Group.objects.get_or_create(name="crans_%s" % cl_droit.lower())
group.save()
groups.append(group)
......@@ -86,62 +90,15 @@ class LDAPUserBackend(ModelBackend):
"""Rafraîchit les champs correspondants à l'utilisateur (nom,
prénom, email)"""
user.first_name = cl_user.prenom()
user.last_name = cl_user.nom()
user.email = "%s@crans.org" % cl_user.mail()
user.first_name = unicode(cl_user['prenom'][0])
user.last_name = unicode(cl_user['nom'][0])
user.email = "%s@crans.org" % unicode(cl_user['mail'][0])
user.save()
def get_user(self, uid):
"""Récupère l'objet django correspondant à l'uid"""
try:
return User.objects.get(pk=uid)
except User.DoesNotExist:
return None
def authenticate_club(self, club=None, user=None, password=None):
"""Authentifie un utilisateur de club"""
if not club or not user or not password:
return None
try:
adherent = settings.db.search('uid=%s' % user)['adherent'][0]
club_obj = settings.db.search('uid=club-%s' % club)['club'][0]
except ValueError:
return None
if adherent.checkPassword(password):
# HACK
if club_obj.Nom().lower() == "crans":
droits = set(adherent.droits())
imprimeurs_crans = set((u'Bureau', u'Nounou'))
if droits.intersection(imprimeurs_crans):
domain = "club-crans.crans.org"
else:
return None
else:
aid = adherent.id()
if aid in club_obj.imprimeurs() or aid == club_obj.responsable().id():
domain = "club-%s.crans.org" % club
else:
return None
django_user = "%s@%s" % (user, domain)
try:
user = User.objects.get(username=django_user)
except User.DoesNotExist:
user = User(username=django_user, password="LDAP Backend User!")
user.set_unusable_password()
user.save()
return user
return user
return None
def get_user_club(self, club, user):
"""Récupère l'objet User correspondant à un utilisateur dans un club"""
try:
return User.objects.get(username="%s@club-%s.crans.org" % (club, user))
except User.DoesNotExist:
return None
# -*- coding: utf-8 -*-
# Django settings for intranet project.
# Connexion à la base ldap
# Imports des secrets (plus tard, mais pas en debug)
import sys
sys.path.append("/etc/crans/secrets")
DEBUG = True
TEMPLATE_DEBUG = DEBUG
......@@ -11,8 +12,7 @@ EMAIL_SUBJECT_PREFIX = "[Intranet2 Cr@ns] "
ADMINS = (
('Intranet', 'root@crans.org'),
# ('Your Name', 'your_email@domain.com'),
'Intranet', 'root@crans.org',
)
MANAGERS = ADMINS
......@@ -23,7 +23,7 @@ FIXTURE_DIRS=(ROOT_PATH + 'fixtures/',)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/home/dstan/crans/intranet/intranet.db',
'NAME': ROOT_PATH + 'intranet.db',
'HOST': '',
'USER': '',
}
......@@ -65,7 +65,10 @@ MEDIA_ROOT = ROOT_PATH
MEDIA_URL = 'http://127.0.0.1/media/'
# Make this unique, and don't share it with anybody.
SECRET_KEY='k5q7=k^)0(580foicgy%1)7*5s8oo1^1c^s%2#-s&amp;lkt0929qc'
if DEBUG:
SECRET_KEY = "sYjlDBZUBSMnk"
else: # Ne marchera que sur o2
from secrets import django_secret_key as SECRET_KEY
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
......
/* Translators (2009 onwards):
* - Damouns
* - IAlex
*/
/**
* @requires OpenLayers/Lang.js
*/
/**
* Namespace: OpenLayers.Lang["fr"]
* Dictionary for Français. Keys for entries are used in calls to
* <OpenLayers.Lang.translate>. Entry bodies are normal strings or
* strings formatted for use with <OpenLayers.String.format> calls.
*/
OpenLayers.Lang["fr"] = OpenLayers.Util.applyDefaults({
'unhandledRequest': "Requête non gérée, retournant ${statusText}",
'Permalink': "Permalien",
'Overlays': "Calques",
'Base Layer': "Calque de base",
'noFID': "Impossible de mettre à jour un objet sans identifiant (fid).",
'browserNotSupported': "Votre navigateur ne supporte pas le rendu vectoriel. Les renderers actuellement supportés sont : \n${renderers}",
'minZoomLevelError': "La propriété minZoomLevel doit seulement être utilisée pour des couches FixedZoomLevels-descendent. Le fait que cette couche WFS vérifie la présence de minZoomLevel est une relique du passé. Nous ne pouvons toutefois la supprimer sans casser des applications qui pourraient en dépendre. C\'est pourquoi nous la déprécions -- la vérification du minZoomLevel sera supprimée en version 3.0. A la place, merci d\'utiliser les paramètres de résolutions min/max tel que décrit sur : http://trac.openlayers.org/wiki/SettingZoomLevels",
'commitSuccess': "Transaction WFS : SUCCES ${response}",
'commitFailed': "Transaction WFS : ECHEC ${response}",
'googleWarning': "La couche Google n\'a pas été en mesure de se charger correctement.\x3cbr\x3e\x3cbr\x3ePour supprimer ce message, choisissez une nouvelle BaseLayer dans le sélecteur de couche en haut à droite.\x3cbr\x3e\x3cbr\x3eCela est possiblement causé par la non-inclusion de la librairie Google Maps, ou alors parce que la clé de l\'API ne correspond pas à votre site.\x3cbr\x3e\x3cbr\x3eDéveloppeurs : pour savoir comment corriger ceci, \x3ca href=\'http://trac.openlayers.org/wiki/Google\' target=\'_blank\'\x3ecliquez ici\x3c/a\x3e",
'getLayerWarning': "La couche ${layerType} n\'est pas en mesure de se charger correctement.\x3cbr\x3e\x3cbr\x3ePour supprimer ce message, choisissez une nouvelle BaseLayer dans le sélecteur de couche en haut à droite.\x3cbr\x3e\x3cbr\x3eCela est possiblement causé par la non-inclusion de la librairie ${layerLib}.\x3cbr\x3e\x3cbr\x3eDéveloppeurs : pour savoir comment corriger ceci, \x3ca href=\'http://trac.openlayers.org/wiki/${layerLib}\' target=\'_blank\'\x3ecliquez ici\x3c/a\x3e",
'Scale = 1 : ${scaleDenom}': "Echelle ~ 1 : ${scaleDenom}",
'W': "O",
'E': "E",
'N': "N",
'S': "S",
'reprojectDeprecated': "Vous utilisez l\'option \'reproject\' sur la couche ${layerName}. Cette option est dépréciée : Son usage permettait d\'afficher des données au dessus de couches raster commerciales.Cette fonctionalité est maintenant supportée en utilisant le support de la projection Mercator Sphérique. Plus d\'information est disponible sur http://trac.openlayers.org/wiki/SphericalMercator.",
'methodDeprecated': "Cette méthode est dépréciée, et sera supprimée à la version 3.0. Merci d\'utiliser ${newMethod} à la place.",
'proxyNeeded': "Vous avez très probablement besoin de renseigner OpenLayers.ProxyHost pour accéder à ${url}. Voir http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost"
});
This diff is collapsed.
......@@ -23,16 +23,16 @@ div.olLayerDiv {
}
.olLayerGooglePoweredBy {
left: 2px;
bottom: 15px;
bottom: 15px;
}
.olLayerGoogleV3.olLayerGooglePoweredBy {
bottom: 15px !important;
}
.olControlAttribution {
font-size: smaller;
right: 3px;
bottom: 4.5em;
position: absolute;
font-size: smaller;
right: 3px;
bottom: 4.5em;
position: absolute;
display: block;
}
.olControlScale {
......@@ -67,10 +67,10 @@ div.olLayerDiv {
display: block;
position: absolute;
font-size: smaller;
}
}
div.olControlMousePosition {
bottom: 0em;
bottom: 0;
right: 3px;
display: block;
position: absolute;
......@@ -90,13 +90,10 @@ div.olControlMousePosition {
-moz-border-radius: 1em 0 0 0;
}
.olControlOverviewMapMinimizeButton {
right: 0;
bottom: 80px;
cursor: pointer;
}
.olControlOverviewMapMinimizeButton,
.olControlOverviewMapMaximizeButton {
height: 18px;
width: 18px;
right: 0;
bottom: 80px;
cursor: pointer;
......@@ -136,7 +133,7 @@ div.olControlMousePosition {
.olPopupContent {
padding:5px;
overflow: auto;
}
}
.olControlNavigationHistory {
background-image: url("img/navigation_history.png");
......@@ -145,25 +142,25 @@ div.olControlMousePosition {
height: 24px;
}
.olControlNavigationHistoryPreviousItemActive {
.olControlNavigationHistoryPreviousItemActive {
background-position: 0 0;
}
.olControlNavigationHistoryPreviousItemInactive {
.olControlNavigationHistoryPreviousItemInactive {
background-position: 0 -24px;
}
.olControlNavigationHistoryNextItemActive {
.olControlNavigationHistoryNextItemActive {
background-position: -24px 0;
}
.olControlNavigationHistoryNextItemInactive {
.olControlNavigationHistoryNextItemInactive {
background-position: -24px -24px;
}
div.olControlSaveFeaturesItemActive {
div.olControlSaveFeaturesItemActive {
background-image: url(img/save_features_on.png);
background-repeat: no-repeat;
background-position: 0 1px;
}
div.olControlSaveFeaturesItemInactive {
div.olControlSaveFeaturesItemInactive {
background-image: url(img/save_features_off.png);
background-repeat: no-repeat;
background-position: 0 1px;
......@@ -184,12 +181,12 @@ div.olControlSaveFeaturesItemInactive {
opacity: 0.50;
font-size: 1px;
filter: alpha(opacity=50);
}
}
.olControlPanPanel {
top: 10px;
left: 5px;
}
}
.olControlPanPanel div {
background-image: url(img/pan-panel.png);
......@@ -224,7 +221,7 @@ div.olControlSaveFeaturesItemInactive {
.olControlZoomPanel {
top: 71px;
left: 14px;
}
}
.olControlZoomPanel div {
background-image: url(img/zoom-panel.png);
......@@ -252,9 +249,9 @@ div.olControlSaveFeaturesItemInactive {
background-position: 0 18px;
}
/*
/*
* When a potential text is bigger than the image it move the image
* with some headers (closes #3154)
* with some headers (closes #3154)
*/
.olControlPanZoomBar div {
font-size: 1px;
......@@ -323,10 +320,8 @@ div.olControlSaveFeaturesItemInactive {
padding-top: 5px;
padding-left: 10px;
padding-bottom: 5px;
padding-right: 75px;
padding-right: 10px;
background-color: darkblue;
width: 100%;
height: 100%;
}
.olControlLayerSwitcher .layersDiv .baseLbl,
......@@ -343,6 +338,8 @@ div.olControlSaveFeaturesItemInactive {
.olControlLayerSwitcher .maximizeDiv,
.olControlLayerSwitcher .minimizeDiv {
width: 18px;
height: 18px;
top: 5px;
right: 0;
cursor: pointer;
......@@ -431,3 +428,57 @@ span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a {
.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive {
background-position: -26px -24px;
}
div.olControlZoom {
position: absolute;
top: 8px;
left: 8px;
background: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
div.olControlZoom a {
display: block;
margin: 1px;
padding: 0;
color: white;
font-size: 18px;
font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
font-weight: bold;
text-decoration: none;
text-align: center;
height: 22px;
width:22px;
line-height: 19px;
background: #130085; /* fallback for IE - IE6 requires background shorthand*/
background: rgba(0, 60, 136, 0.5);
filter: alpha(opacity=80);
}
div.olControlZoom a:hover {
background: #130085; /* fallback for IE */
background: rgba(0, 60, 136, 0.7);
filter: alpha(opacity=100);
}
@media only screen and (max-width: 600px) {
div.olControlZoom a:hover {
background: rgba(0, 60, 136, 0.5);
}
}
a.olControlZoomIn {
border-radius: 4px 4px 0 0;
}
a.olControlZoomOut {
border-radius: 0 0 4px 4px;
}
/**
* Animations
*/
.olLayerGrid .olTileImage {
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
div.olControlZoom {
position: absolute;
top: 8px;
left: 8px;
background: rgba(255,255,255,0.4);
border-radius: 4px;
padding: 2px;
}
* {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
div.olControlZoom a {
display: block;
margin: 1px;
padding: 0;
color: white;
font-size: 28px;
font-family: sans-serif;
font-weight: bold;
text-decoration: none;
text-align: center;
height: 32px;
width: 32px;
line-height: 28px;
text-shadow: 0 0 3px rgba(0,0,0,0.8);
background: #130085; /* fallback for IE - IE6 requires background shorthand*/
background: rgba(0, 60, 136, 0.5);
filter: alpha(opacity=80);
}
a.olControlZoomIn {
border-radius: 4px 4px 0 0;
}
a.olControlZoomOut {
border-radius: 0 0 4px 4px;
}
div.olControlZoom a:hover {
background: #130085; /* fallback for IE */
background: rgba(0, 60, 136, 0.7);
filter: alpha(opacity=100);
}
@media only screen and (max-width: 600px) {
div.olControlZoom a:hover {
background: rgba(0, 60, 136, 0.5);
}
}
.olLayerGrid .olTileImage {
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
/* Enable 3d acceleration when operating on tiles, this is
known to yield better performance on IOS Safari.
http://osgeo-org.1803224.n2.nabble.com/Harware-accelerated-CSS3-animations-for-iOS-td6255560.html
It also prevents tile blinking effects in iOS 5.
See https://github.com/openlayers/openlayers/issues/511
*/
@media (-webkit-transform-3d) {
img.olTileImage {
-webkit-transform: translate3d(0, 0, 0);
}
}
div.olControlZoom{position:absolute;top:8px;left:8px;background:rgba(255,255,255,0.4);border-radius:4px;padding:2px;}*{-webkit-tap-highlight-color:rgba(0,0,0,0);}div.olControlZoom a{display:block;color:#FFF;font-size:28px;font-family:sans-serif;font-weight:700;text-decoration:none;text-align:center;height:32px;width:32px;line-height:28px;text-shadow:0 0 3px rgba(0,0,0,0.8);background:rgba(0,60,136,0.5);filter:alpha(opacity=80);margin:1px;padding:0;}a.olControlZoomIn{border-radius:4px 4px 0 0;}a.olControlZoomOut{border-radius:0 0 4px 4px;}div.olControlZoom a:hover{background:rgba(0,60,136,0.7);filter:alpha(opacity=100);}.olLayerGrid .olTileImage{-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear;}@media only screen and max-width 600px{div.olControlZoom a:hover{background:rgba(0,60,136,0.5);}}@media -webkit-transform-3d{img.olTileImage{-webkit-transform:translate3d(0,0,0);}}
\ No newline at end of file
......@@ -38,6 +38,11 @@
background-color: #DDD;
}
.borne h2, .borne h3, .borne h4, .borne ul, .borne li {
margin: none;
margin-left: 0;
}
.borne img {
vertical-align: middle;
}
......@@ -55,6 +60,10 @@
padding: 0 4px 2px 4px;
}
.borne .uptime {
font-style: oblique;
}
.borne.non-connected .count, .borne.non-connected .uptime {
display: none;
}
......@@ -63,10 +72,6 @@
font-size: 0.75em;
}
.borne .uptime {
font-style: oblique;
}
.borne .uptime .content {
font-style: italic;
}
......@@ -100,3 +105,20 @@
font-size: 0.65em;
font-weight: normal;
}
/* sorting */
.order {
display: none;
}
.order + label img {
cursor: pointer;
margin: 1px 1px 1px 1px;
vertical-align: middle;
}
.order:checked + label img {
border: 1px solid #FFF;
margin: 0;
}
This diff is collapsed.
......@@ -14,7 +14,7 @@
{% if form.errors %}
<div id="message">Your username and password didn't match. Please try again.</div>
{% endif %}
<form method="post" action="{% url django.contrib.auth.views.login %}">{% csrf_token %}
<form method="post" action="/login">{% csrf_token %}
{{ form.username.label_tag }}
{{ form.username }}
......
......@@ -6,6 +6,10 @@
<script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript" src="/static/OpenLayers/OpenLayers.js"></script>
<script type="text/javascript" src="/static/js/wifimap.js"></script>
<!-- Lang -->
<script type="text/javascript" src="/static/OpenLayers/Lang/fr.js"></script>
<script type="text/javascript">OpenLayers.Lang.setCode('fr');</script>
{% endblock %}
{% block content %}
Dernière mise à jour il y a <label id="last_update"> </label>
......@@ -22,6 +26,7 @@ Dernière mise à jour il y a <label id="last_update"> </label>
<span class="uptime template">Uptime: <span class="content"></span></span>
<ul>
<li class="comment template">Liste commentaire</li>
<li class="prise template">Prise: <span class="content"></span></li>
</ul>
<div class="network template">
<h4 class="ssid">
......@@ -29,7 +34,8 @@ Dernière mise à jour il y a <label id="last_update"> </label>
<span class="bssid">(BSS: <span class="content"></span>)</span>
</h4>
<ul class="client_list">
<li class="template client"></li>
<li class="template channel">Canal: <span class="content"></span></li>
<li class="template client">Client: <span class="content"></span></li>
</ul>
</div>
</div>
......
......@@ -3,6 +3,8 @@
from django.conf.urls.defaults import include, patterns, url
import settings
import django.contrib.auth.views
from utils.protectpost import protect
from django.contrib import admin
admin.autodiscover()
......@@ -12,7 +14,7 @@ urlpatterns = patterns('',
url('^$', 'intranet.accueil.view'),
# Pages de login
url('^login', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name="login"),
url('^login', protect(django.contrib.auth.views.login), {'template_name': 'login.html'}, name="login"),
url('^logout', 'django.contrib.auth.views.logout_then_login', name ="logout"),
(r'^admin/', include(admin.site.urls)),
)
......
-----BEGIN CERTIFICATE-----
MIIDkDCCAvmgAwIBAgIJAIJxK+S8ptAdMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYD
VQQGEwJGUjEWMBQGA1UECBMNSWxlLWRlLUZyYW5jZTEPMA0GA1UEBxMGQ2FjaGFu
MQ4wDAYDVQQKFAVDckBuczEfMB0GA1UEAxMWaW50cmFuZXQtZGV2LmNyYW5zLm9y
ZzEkMCIGCSqGSIb3DQEJARYVZGFuaWVsLnN0YW5AY3JhbnMub3JnMB4XDTEyMDYy
MTIwMjYzOFoXDTEzMDYyMTIwMjYzOFowgY0xCzAJBgNVBAYTAkZSMRYwFAYDVQQI
Ew1JbGUtZGUtRnJhbmNlMQ8wDQYDVQQHEwZDYWNoYW4xDjAMBgNVBAoUBUNyQG5z
MR8wHQYDVQQDExZpbnRyYW5ldC1kZXYuY3JhbnMub3JnMSQwIgYJKoZIhvcNAQkB
FhVkYW5pZWwuc3RhbkBjcmFucy5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
AoGBAMUShNbU+HBG5LBbz16FAJy36sYyZbWFGNzfiezEonna8P0n3ezi0nV/zsh7
oXN37UU70z7o06ZDFJ6WN0W9zK6JDyPZcdNd1lPk7SNZp1Ek9tMA6HnJvpXpbOPl
DDiekL07nggNIMp1tWbier3GBu///8nTgQh3rpbTHYX8I0f/AgMBAAGjgfUwgfIw
HQYDVR0OBBYEFIitQDJ1gj1ba91RiwoOFor0hNXaMIHCBgNVHSMEgbowgbeAFIit
QDJ1gj1ba91RiwoOFor0hNXaoYGTpIGQMIGNMQswCQYDVQQGEwJGUjEWMBQGA1UE
CBMNSWxlLWRlLUZyYW5jZTEPMA0GA1UEBxMGQ2FjaGFuMQ4wDAYDVQQKFAVDckBu
czEfMB0GA1UEAxMWaW50cmFuZXQtZGV2LmNyYW5zLm9yZzEkMCIGCSqGSIb3DQEJ
ARYVZGFuaWVsLnN0YW5AY3JhbnMub3JnggkAgnEr5Lym0B0wDAYDVR0TBAUwAwEB
/zANBgkqhkiG9w0BAQUFAAOBgQAqrAV+zbS1bJQRZ0BJRx0jjuNMhf4u2O787I8f
P0pxFTsjICrE4A8wiwEAcPqHM+6TzFKMPOXy18TLQWCO6tIsdDLcGG1W1Nuw5seW
w5Lvbdbb1cQgUzLq2u3ERWAMByUqlMwZbXOJiuxKlG3dqdcao9SmKg7+5+QExMXT
OD40AA==
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDFEoTW1PhwRuSwW89ehQCct+rGMmW1hRjc34nsxKJ52vD9J93s
4tJ1f87Ie6Fzd+1FO9M+6NOmQxSeljdFvcyuiQ8j2XHTXdZT5O0jWadRJPbTAOh5
yb6V6Wzj5Qw4npC9O54IDSDKdbVm4nq9xgbv///J04EId66W0x2F/CNH/wIDAQAB
AoGAGKYRUWF/1WM4lUpWbIcMJY3nYnTJPePw0Sdwc9nATKdyvucuncNc+W9L6M11
yyBz39X0vQiX+FKpkJBPR3zOzcl8+7iQD1WeXhw1DXMW/8cZUrx5s4M4HeIzOj8c
9/2GvXDMSIeo4ZLkgAJwlZZjWQhgkPoJ/jHZO3L7/AZkWNkCQQDraS3bwomj50s5
n3ScqJeNQtekUmwZfBGf40qdk70LBB3tfmMUlSAfWvK6K6NNJMkQyLrGnZgUcBVL
nR6h2aibAkEA1k7x6fQfyw694mPGCDdhzKLnWVMQQH7yBdtI8Uw5qeNKByTxhQps
qczTEfXYM3WEisn1RBMPE7eEPViFgpBabQJBAMT4DVHKFQZZ+ZwuKhEGE0AzxGCO
QjqUj96a/Aya19sGx8+2J0rKd8UkgOF6r7lVZRKxEW4r4FqBaaAJx96eUq8CQFqd
sN6KsfLLPfD+3RpWSI0diJMVczbCNpXRXethnrQ9/ew9a74kZUP67niWqh9AHpYM
xR9Oq75bh5fk2TcW0JUCQQC6C3okSgOkj8Oveqni3dQUCcTOzJOgRH97OsadLyzF
T1PwCc1PREE8fqV0lsf3kA1U2Bbslc1hHqbRs72iXNfV
-----END RSA PRIVATE KEY-----
......@@ -20,8 +20,8 @@ NAME=gunicorn_django
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/gunicorn-intranet.pid
SOCKET=unix:/tmp/gunicorn-intranet.sock
SETTINGS="/usr/local/django/intranet/settings.py"
DAEMON_ARGS="--workers=2 --pid=$PIDFILE --daemon --user=www-data --group=www-data --name=$NAME --bind=$SOCKET $SETTINGS"
SETTINGS="/localhome/django/intranet/settings.py"
DAEMON_ARGS="--workers=1 --pid=$PIDFILE --daemon --user=www-data --group=www-data --name=$NAME --bind=$SOCKET $SETTINGS"
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
......
......@@ -6,7 +6,7 @@ server {
listen 80;
server_name intranet2.crans.org;
rewrite ^/(.*) https://$server_name/$1 permanent;
rewrite ^/(.*) http://127.0.0.1:8000/$1 permanent;