From d72671bc2499a2d8f418af5b6cee0a328a7347cf Mon Sep 17 00:00:00 2001
From: Thomas NOEL
Date: Fri, 20 Jul 2012 10:01:54 +0200
Subject: [PATCH] retour sur /etc/polynum et /var/lib/polynum, plus intuitifs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
les /etc/opt/ et /var/opt/ ne sont quasiment jamais
utilisés par les programmes qui se mettent dans /opt
---
Makefile | 4 ++--
bin/polynum-manage.py | 2 +-
debian/README | 6 +++---
debian/changelog | 2 +-
debian/links | 1 +
debian/polynum.default | 16 +++++++++++-----
debian/postinst | 4 ++--
help/fr/install.page | 14 +++++++-------
local_settings.py.example | 4 ++--
9 files changed, 30 insertions(+), 23 deletions(-)
diff --git a/Makefile b/Makefile
index c060491..c826ec7 100644
--- a/Makefile
+++ b/Makefile
@@ -23,8 +23,8 @@ install:
$(INSTALL) -d $(DESTDIR)/opt/polynum
$(CP) -r polynum $(DESTDIR)/opt/polynum
$(CP) -r bin $(DESTDIR)/opt/polynum
- $(INSTALL) -d $(DESTDIR)/etc/opt/polynum
- $(INSTALL) -d $(DESTDIR)/var/opt/polynum
+ $(INSTALL) -d $(DESTDIR)/etc/polynum
+ $(INSTALL) -d $(DESTDIR)/var/lib/polynum
$(INSTALL) -d $(DESTDIR)/opt/polynum/static
deb:
diff --git a/bin/polynum-manage.py b/bin/polynum-manage.py
index be81c95..0ca83a3 100755
--- a/bin/polynum-manage.py
+++ b/bin/polynum-manage.py
@@ -11,7 +11,7 @@ if not os.path.isdir(POLYNUM_DIR):
sys.exit(1)
sys.path.append(POLYNUM_DIR)
-sys.path.append('/etc/opt/polynum') # for "import local_settings"
+sys.path.append('/etc/polynum') # for "import local_settings"
if os.path.isdir(VIRTUAL_ENV):
site_packages = os.path.join(VIRTUAL_ENV,
diff --git a/debian/README b/debian/README
index 74a5044..0880524 100644
--- a/debian/README
+++ b/debian/README
@@ -1,8 +1,8 @@
The Debian Package polynum
----------------------------
-All files goes to /opt/polynum/
-
-'coz everybody loves /opt !
+- Code files goes to /opt/polynum/
+- Configuration files in /etc/polynum
+- Variables in /var/lib/polynum (for example, uploads)
-- Thomas NOEL Tue, 17 Jul 2012 12:57:01 +0200
diff --git a/debian/changelog b/debian/changelog
index 69ed5a7..66d621e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-polynum (0.0.20120719~git5b45fc6-1) unstable; urgency=low
+polynum (0.0.20120720~git3fbb79f-1) UNRELEASED; urgency=low
* Premier paquet
diff --git a/debian/links b/debian/links
index 5dfa1b5..512a22c 100644
--- a/debian/links
+++ b/debian/links
@@ -1 +1,2 @@
opt/polynum/bin/polynum-manage.py usr/bin/polynum-manage.py
+opt/polynum/bin/polynum-build-virtualenv usr/sbin/polynum-build-virtualenv
diff --git a/debian/polynum.default b/debian/polynum.default
index 2d54245..7c61d8b 100644
--- a/debian/polynum.default
+++ b/debian/polynum.default
@@ -5,17 +5,23 @@ POLYNUM_USER=polynum
POLYNUM_GROUP=polynum
POLYNUM_HOME=/opt/polynum
-POLYNUM_VAR=/var/opt/polynum
-POLYNUM_ETC=/etc/opt/polynum
+POLYNUM_VAR=/var/lib/polynum
+POLYNUM_ETC=/etc/polynum
PIDFILE=/var/run/polynum/polynum.pid
+#
# polynum is started with : "polynum-manage.py $DAEMON_ARGS"
-# Ex :
+#
+# Examples :
# DAEMON_ARGS="runfcgi method=prefork host=127.0.0.1 port=3000 pidfile=${PIFILE} daemonize=true"
+# DAEMON_ARGS="run_gunicorn --workers=5 --bind=127.0.0.1:3000 --pid=${PIDFILE} --daemon"
# DAEMON_ARGS="run_gunicorn --workers=5 --bind=unix:/var/run/polynum/gunicorn.sock --pid=${PIDFILE} --daemon"
-# see all runfcgi options : "polynum-manage.py runfcgi --help"
-# see all run_gunicorn options : "polynum-manage.py run_gunicorn --help"
+# DAEMON_ARGS="run_gunicorn -c /etc/polynum/gunicorn_config.py --pid=${PIDFILE} --daemon"
+#
+# for FastCGI options : polynum-manage.py runfcgi --help
+# for Gunicorn options : polynum-manage.py run_gunicorn --help
+#
DAEMON_ARGS="run_gunicorn --workers=5 --bind=127.0.0.1:3000 --pid=${PIDFILE} --daemon"
diff --git a/debian/postinst b/debian/postinst
index 1604a0e..86ab806 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -34,8 +34,8 @@ case "$1" in
[ -z "$POLYNUM_NAME" ] && POLYNUM_NAME="PolyNum daemon user"
[ -z "$POLYNUM_HOME" ] && POLYNUM_HOME=/opt/polynum
[ -z "$POLYNUM_GROUP" ] && POLYNUM_GROUP=polynum
- [ -z "$POLYNUM_VAR" ] && POLYNUM_VAR=/var/opt/polynum
- [ -z "$POLYNUM_ETC" ] && POLYNUM_ETC=/etc/opt/polynum
+ [ -z "$POLYNUM_VAR" ] && POLYNUM_VAR=/var/lib/polynum
+ [ -z "$POLYNUM_ETC" ] && POLYNUM_ETC=/etc/polynum
[ -z "$PIDFILE" ] && PIDFILE=/var/run/polynum/polynum.pid
# 1. create group if not existing
diff --git a/help/fr/install.page b/help/fr/install.page
index 5370e12..5699488 100644
--- a/help/fr/install.page
+++ b/help/fr/install.page
@@ -35,8 +35,8 @@ Dans la suite, l'arborescence des fichiers est la suivante :
/opt/polynum/polynum
| code de l'application Django Polynum |
/opt/polynum/bin
| scripts associés au projet |
/opt/polynum/virtualenv
| environnement virtuel Python (voir plus loin) |
- /etc/opt/polynum
| répertoire de configuration |
- /var/opt/polynum
| répertoire des données (fichiers PDF) |
+ /etc/polynum
| répertoire de configuration |
+ /var/lib/polynum
| répertoire des données (fichiers PDF) |
@@ -152,18 +152,18 @@ pour s'exécuter.
Configuration de l'authentification
Polynum peut authentifier les utilisateurs via CAS et LDAP. Dans
-/etc/opt/polynum/local_settings.py
adapter les paramètres suivants
+/etc/polynum/local_settings.py
adapter les paramètres suivants
:
-(... extrait de /etc/opt/polynum/local_settings.py ...)
+(... extrait de /etc/polynum/local_settings.py ...)
CAS_SERVER_URL = "https://cas.univ.fr/" # CAS server URL
LDAP_URL = "ldaps://ldap.univ.fr" # LDAP server URL
diff --git a/local_settings.py.example b/local_settings.py.example
index 015974f..6b753b2 100644
--- a/local_settings.py.example
+++ b/local_settings.py.example
@@ -9,7 +9,7 @@ TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': '/tmp/polynum',
+ 'NAME': '/tmp/polynum.sqlite',
}
}
@@ -31,7 +31,7 @@ SITE_URL = 'https://polynum.univ.fr'
#
# Upload directory (polynum must have read+write permissions on it)
#
-MEDIA_ROOT = '/var/opt/polynum/media/'
+MEDIA_ROOT = '/var/lib/polynum/media/'
#
# Authentification with CAS & LDAP