aboutsummaryrefslogtreecommitdiff
path: root/rpkid
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2013-03-06 03:09:49 +0000
committerMichael Elkins <melkins@tislabs.com>2013-03-06 03:09:49 +0000
commitf23534c036025f528f70b73afb8aeeda337a0c0f (patch)
treed8ffe7879065391c2ad36579e9fd7ab256f058b5 /rpkid
parent552f0ed9a863c0a09d1928f357e0c1387f592219 (diff)
revert [5096]
see #438 svn path=/trunk/; revision=5108
Diffstat (limited to 'rpkid')
-rw-r--r--rpkid/Makefile.in10
-rw-r--r--rpkid/portal-gui/Makefile.in6
-rw-r--r--rpkid/portal-gui/settings.py.in (renamed from rpkid/portal-gui/settings.py)24
3 files changed, 26 insertions, 14 deletions
diff --git a/rpkid/Makefile.in b/rpkid/Makefile.in
index 9ad7b4e8..5980d6bd 100644
--- a/rpkid/Makefile.in
+++ b/rpkid/Makefile.in
@@ -69,7 +69,7 @@ BUILD_SCRIPTS = portal-gui/scripts/rpkigui-reset-demo \
AUX_SCRIPTS =
-SETTINGS = portal-gui/local_settings.py portal-gui/rpki.wsgi
+SETTINGS = portal-gui/settings.py portal-gui/rpki.wsgi
all:: ${POW_SO} rpki/relaxng.py myrpki.rng rpki/sql_schemas.py ${SCRIPTS} ${AUX_SCRIPTS} ${SETTINGS} ${BUILD_SCRIPTS}
@@ -287,12 +287,8 @@ portal-gui/rpki.wsgi: ${srcdir}/portal-gui/rpki.wsgi.in
-e "s|@PYTHON""PATH@|${sysconfdir}/rpki|" \
${srcdir}/portal-gui/rpki.wsgi.in > portal-gui/rpki.wsgi
-portal-gui/local_settings.py: Makefile
- ( echo 'import rpki.config'; \
- echo 'SECRET_KEY="${SECRET_KEY}"'; \
- echo 'STATIC_ROOT="${datarootdir}/rpki/media"'; \
- echo 'rpki.config.default_dirname="${sysconfdir}"'; \
- ) > portal-gui/local_settings.py
+portal-gui/settings.py: ${srcdir}/portal-gui/settings.py.in
+ ${COMPILE_SETTINGS}
portal-gui/scripts/rpki-manage: ${srcdir}/portal-gui/scripts/rpki-manage.in
sed -e "s|@DJANGO""_ADMIN@|${DJANGO_ADMIN}|" \
diff --git a/rpkid/portal-gui/Makefile.in b/rpkid/portal-gui/Makefile.in
index 9e7fc85f..7eb2e572 100644
--- a/rpkid/portal-gui/Makefile.in
+++ b/rpkid/portal-gui/Makefile.in
@@ -24,7 +24,7 @@ INSTDIR=${DESTDIR}$(datarootdir)/rpki
SYSCONFDIR=${DESTDIR}${sysconfdir}/rpki
# automatically built sources
-BUILD=apache.conf local_settings.py
+BUILD=apache.conf
all: $(BUILD)
@@ -53,7 +53,6 @@ install: $(BUILD)
${INSTALL} -m 644 apache.conf $(SYSCONFDIR)/apache.conf
${INSTALL} -m 644 rpki.wsgi $(INSTDIR)/wsgi/rpki.wsgi
${INSTALL} -m 644 settings.py ${SYSCONFDIR}
- ${INSTALL} -m 644 local_settings.py ${SYSCONFDIR}
# this would be better handled with "django-admin collectstatic" but makes the install
# process harder for the end user.
${INSTALL} -m 644 $(srcdir)/../rpki/gui/app/static/css/* $(INSTDIR)/media/css
@@ -62,8 +61,7 @@ install: $(BUILD)
deinstall uninstall:
rm -rf $(INSTDIR)/media $(INSTDIR)/wsgi
- rm -rf $(SYSCONFDIR)/apache.conf $(SYSCONFDIR)/settings.py $(SYSCONFDIR)/settings.pyc \
- $(SYSCONFDIR)/local_settings.py $(SYSCONFDIR)/settings.pyc
+ rm -rf $(SYSCONFDIR)/apache.conf $(SYSCONFDIR)/settings.py $(SYSCONFDIR)/settings.pyc
test:
@true
diff --git a/rpkid/portal-gui/settings.py b/rpkid/portal-gui/settings.py.in
index ee4b5cee..8246304c 100644
--- a/rpkid/portal-gui/settings.py
+++ b/rpkid/portal-gui/settings.py.in
@@ -1,14 +1,23 @@
-# DO NOT EDIT! Modifications should be placed in local_settings.py
+#
+# Sample Django settings.py for running the RPKI portal gui. This
+# template was written for Django 1.3.
+#
+# DO NOT EDIT! This file is automatically generated from
+# settings.py.in
+
__version__ = '$Id$'
import rpki.config
import os.path
-from local_settings import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
+# needs to be set prior to the call to rpki.config.parser so it knows
+# where to find the system rpki.conf
+rpki.config.default_dirname = '%(AC_SYSCONFDIR)s'
+
# load the sql authentication bits from the system rpki.conf
rpki_config = rpki.config.parser(section='web_portal')
@@ -27,7 +36,10 @@ def get_conv():
from MySQLdb.converters import conversions
import types
conv = conversions.copy()
- conv[types.LongType] = lambda x, conv: "0x%x" % x
+ # WARNING: the extra percents in the following line are due to the fact
+ # that this entire script is used as a format string to generate
+ # settings.py
+ conv[types.LongType] = lambda x, conv: "0x%%x" %% x
return conv
DATABASES = {
@@ -66,6 +78,9 @@ def select_tz():
# system time zone.
TIME_ZONE = select_tz()
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = '%(AC_SECRET_KEY)s'
+
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
@@ -112,5 +127,8 @@ TEMPLATE_CONTEXT_PROCESSORS = (
"django.core.context_processors.static"
)
+# where to put static files
+STATIC_ROOT = '%(AC_DATAROOTDIR)s/rpki/media'
+
# must end with a slash!
STATIC_URL = '/media/'