config et scripts un peu plus compatibles FHS
codes dans /opt/polynum config dans /etc/opt/polynum donnees dans /var/opt/polynum
This commit is contained in:
parent
1fb697bb47
commit
e45296a593
6
Makefile
6
Makefile
|
@ -15,14 +15,16 @@ rebuild-indexes:
|
|||
python manage.py sqlindexes base | sed 's/CREATE/DROP/;s/INDEX/INDEX IF EXISTS/;s/ ON.*;/;/' | psql polynum
|
||||
python manage.py sqlindexes base | psql polynum
|
||||
|
||||
# only for package creation
|
||||
|
||||
# mainly for packages creation
|
||||
INSTALL=/usr/bin/install
|
||||
CP=/bin/cp
|
||||
install:
|
||||
$(INSTALL) -d $(DESTDIR)/opt/polynum
|
||||
$(CP) -r polynum $(DESTDIR)/opt/polynum
|
||||
$(CP) -r bin $(DESTDIR)/opt/polynum
|
||||
$(INSTALL) -d $(DESTDIR)/etc/polynum
|
||||
$(INSTALL) -d $(DESTDIR)/etc/opt/polynum
|
||||
$(INSTALL) -d $(DESTDIR)/var/opt/polynum
|
||||
|
||||
deb:
|
||||
dch --newversion=0.0.`date +%Y%m%d`~git`git log -1 --oneline | cut -f1 -d" "`-1
|
||||
|
|
|
@ -11,7 +11,7 @@ if not os.path.isdir(POLYNUM_DIR):
|
|||
sys.exit(1)
|
||||
|
||||
sys.path.append(POLYNUM_DIR)
|
||||
sys.path.append('/etc/polynum')
|
||||
sys.path.append('/etc/opt/polynum') # for "import local_settings"
|
||||
|
||||
if os.path.isdir(VIRTUAL_ENV):
|
||||
site_packages = os.path.join(VIRTUAL_ENV,
|
||||
|
|
|
@ -35,7 +35,8 @@ Dans la suite, l'arborescence des fichiers est la suivante :
|
|||
<tr><td><p><code>/opt/polynum/polynum</code></p></td><td><p>code de l'application Django Polynum</p></td></tr>
|
||||
<tr><td><p><code>/opt/polynum/bin</code></p></td><td><p>scripts associés au projet</p></td></tr>
|
||||
<tr><td><p><code>/opt/polynum/virtualenv</code></p></td><td><p>environnement virtuel Python (voir plus loin)</p></td></tr>
|
||||
<tr><td><p><code>/etc/polynum</code></p></td><td><p>répertoire de configuration</p></td></tr>
|
||||
<tr><td><p><code>/etc/opt/polynum</code></p></td><td><p>répertoire de configuration</p></td></tr>
|
||||
<tr><td><p><code>/var/opt/polynum</code></p></td><td><p>répertoire des données (fichiers PDF)</p></td></tr>
|
||||
</table>
|
||||
|
||||
</section>
|
||||
|
@ -151,18 +152,18 @@ pour s'exécuter.
|
|||
|
||||
<section id="installation-config">
|
||||
<title>Configuration de base l'application</title>
|
||||
<p>La configuration de l'application se fait dans <code>/etc/polynum/local_settings.py</code></p>
|
||||
<p>La configuration de l'application se fait dans <code>/etc/opt/polynum/local_settings.py</code></p>
|
||||
|
||||
<p>Un fichier d'exemple <code>local_settings.py.example</code> est fourni avec
|
||||
Polynum, c'est un modèle pour la création de
|
||||
<code>/etc/polynum/local_settings.py</code> : il contient la liste des
|
||||
<code>/etc/opt/polynum/local_settings.py</code> : il contient la liste des
|
||||
paramétrages possibles avec explications et exemples.</p>
|
||||
|
||||
<p>Si vous avez installé Polynum à partir du paquet, le modèle est placé
|
||||
dans <code>/usr/share/doc/polynum/</code>, il vous suffit donc de faire :</p>
|
||||
|
||||
<screen>
|
||||
<output style="prompt"># </output><input>cd /etc/polynum</input>
|
||||
<output style="prompt"># </output><input>cd /etc/opt/polynum</input>
|
||||
<output style="prompt"># </output><input>cp /usr/share/doc/polynum/local_settings.py.example local_settings.py</input>
|
||||
<output style="prompt"># </output><input>vi local_settings.py</input>
|
||||
</screen>
|
||||
|
@ -182,12 +183,12 @@ dans <code>/usr/share/doc/polynum/</code>, il vous suffit donc de faire :</p>
|
|||
<section id="installation-auth">
|
||||
<title>Configuration de l'authentification</title>
|
||||
<p>Polynum peut authentifier les utilisateurs via CAS et LDAP. Dans
|
||||
<code>/etc/polynum/local_settings.py</code> adapter les paramètres suivants
|
||||
<code>/etc/opt/polynum/local_settings.py</code> adapter les paramètres suivants
|
||||
:</p>
|
||||
|
||||
<code>
|
||||
|
||||
(... extrait de /etc/polynum/local_settings.py ...)
|
||||
(... extrait de /etc/opt/polynum/local_settings.py ...)
|
||||
|
||||
CAS_SERVER_URL = "https://cas.univ.fr/" # CAS server URL
|
||||
LDAP_URL = "ldaps://ldap.univ.fr" # LDAP server URL
|
||||
|
|
|
@ -2,41 +2,50 @@
|
|||
|
||||
# See settings.py for default values
|
||||
|
||||
DEBUG = True # set to False in production !
|
||||
DEBUG = True
|
||||
#DEBUG = False # for production
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
|
||||
# use PostgreSQL in production
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
|
||||
'NAME': 'polynum', # Or path to database file if using sqlite3.
|
||||
'USER': 'polynum', # Not used with sqlite3.
|
||||
'PASSWORD': 'abcdef', # Not used with sqlite3.
|
||||
'HOST': 'db.univ.fr', # Set to empty string for localhost. Not used with sqlite3.
|
||||
'PORT': '', # Set to empty string for default. Not used with sqlite3.
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': '/tmp/polynum',
|
||||
}
|
||||
}
|
||||
|
||||
# production : use PostgreSQL
|
||||
#DATABASES = {
|
||||
# 'default': {
|
||||
# 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
|
||||
# 'NAME': 'polynum', # Or path to database file if using sqlite3.
|
||||
# 'USER': 'polynum', # Not used with sqlite3.
|
||||
# 'PASSWORD': 'abcdef', # Not used with sqlite3.
|
||||
# 'HOST': 'db.univ.fr', # Set to empty string for localhost. Not used with sqlite3.
|
||||
# 'PORT': '', # Set to empty string for default. Not used with sqlite3.
|
||||
# }
|
||||
#}
|
||||
|
||||
#
|
||||
# Upload directory
|
||||
# Upload directory (polynum must have read+write permissions on it)
|
||||
#
|
||||
DOCUMENTS_UPLOAD_DIRECTORY = '/opt/polynum/uploads/'
|
||||
MEDIA_ROOT = '/var/opt/polynum/media/'
|
||||
|
||||
#
|
||||
# Authentification with CAS & LDAP
|
||||
#
|
||||
CAS_SERVER_URL = 'https://www.univ.fr/cas/' # CAS server URL, if empty CAS login is disabled
|
||||
LDAP_URL = 'ldaps://' # LDAP server URL
|
||||
LDAP_BIND_DN = '' # DN to authenticate to the LDAP server
|
||||
LDAP_BIND_PASSWORD = 'abdef' # and its password
|
||||
LDAP_USER_QUERY = '' # query to retrieve user, %s is the CAS username
|
||||
LDAP_BASE = '' # base DN for the query
|
||||
CAS_SERVER_URL = None # CAS server URL, for ex. 'https://cas.univ.fr/' -- if None, CAS login is disabled
|
||||
LDAP_URL = 'ldaps://...' # LDAP server URL
|
||||
LDAP_BIND_DN = 'uid=...,ou=...' # DN to authenticate to the LDAP server
|
||||
LDAP_BIND_PASSWORD = '...' # and its password
|
||||
LDAP_USER_QUERY = 'supannAliasLogin=%s' # query to retrieve user, %s is the CAS username
|
||||
LDAP_BASE = 'dc=univ,dc=fr' # base DN for the query
|
||||
|
||||
#
|
||||
# Design
|
||||
#
|
||||
# static files -- to create with "polynum-manage.py collectstatic"
|
||||
STATIC_ROOT = '/opt/polynum/static'
|
||||
# grappelli admin -- see http://readthedocs.org/docs/django-grappelli
|
||||
GRAPPELLI_ADMIN_TITLE = 'Univ - Administration de PolyNum'
|
||||
GRAPPELLI_ADMIN_TITLE = 'Administration de PolyNum'
|
||||
# templates
|
||||
TEMPLATE_DIRS = (
|
||||
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
||||
|
@ -47,7 +56,7 @@ TEMPLATE_DIRS = (
|
|||
)
|
||||
|
||||
#
|
||||
# OAI METADATA
|
||||
# OAI METADATA for OAI-PMH exports
|
||||
#
|
||||
OAI_ADMIN_EMAIL = 'admin@univ.fr'
|
||||
OAI_TEXT = 'Polynum documents'
|
||||
|
|
Reference in New Issue